1 2007-03-15 Raja R Harinath <rharinath@novell.com>
3 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
5 * statement.cs, iterators.cs, lambda.cs: Update to changes.
7 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
8 unconditionally. Simplify explanation.
9 (Try.Resolve, Using.Resolve): Likewise.
11 2007-03-15 Martin Baulig <martin@ximian.com>
15 * decl.cs (DeclSpace): If we're a partial class, use our
16 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
18 2007-03-15 Raja R Harinath <rharinath@novell.com>
20 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
22 (FlowBranching.UsageVector): Update to changes.
23 (FlowBranching.MergeSiblings): Likewise.
24 * statement.cs: Likewise.
26 2007-03-15 Martin Baulig <martin@ximian.com>
31 (MemberCache): Added a special .ctor for type parameters.
34 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
37 2007-03-09 Martin Baulig <martin@ximian.com>
39 * enum.cs (Enum): Make this a TypeContainer.
40 (EnumMember): Derive from `Const'.
43 (Const.DoResolveValue): New protected virtual method; move most of
44 the functionality of ResolveValue() here so we can override it in
46 (Const.CreateConstantReference): Make this virtual.
48 * class.cs (Kind): Add `Kind.Enum'.
49 (TypeContainer.Emit): Don't emit the enums here; they're already
50 in the `RootContext.typecontainer_resolve_order'.
52 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
53 here; they're already in the `typecontainer_resolve_order'.
55 * ecore.cs (EnumConstant.ConvertImplicitly): Add
56 TypeManager.DropGenericTypeArguments().
59 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
60 (TypeManager.IsEnumType): Likewise.
61 (TypeManager.EnumToUnderlying): Likewise.
62 (TypeManager.IsEqual): Add support for enums.
64 2007-03-12 Raja R Harinath <rharinath@novell.com>
66 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
67 DefaultParameterValueAttribute to be undefined, say if System.dll
70 2007-03-11 Marek Safar <marek.safar@gmail.com>
72 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
75 2007-03-10 Marek Safar <marek.safar@gmail.com>
77 * class.cs, parameter.cs: Unified parameters verification.
79 2007-03-08 Martin Baulig <martin@ximian.com>
81 * cs-parser.jay (constructor_header): Pass the location to the
82 newly created TopLevelBlock.
84 2007-03-07 Martin Baulig <martin@ximian.com>
86 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
88 2007-03-06 Miguel de Icaza <miguel@novell.com>
90 * convert.cs (ExplicitReferenceConversionExists): Sync this method
91 with the changes from David, fixes the build.
93 2007-03-05 David Mitchell <dmitchell@logos.com>
95 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
96 and its base interfaces to a one-dimensional array type S[],
97 provided there is an implicit or explicit reference conversion
100 2007-03-03 Marek Safar <marek.safar@gmail.com>
102 * cs-tokenizer.cs: Implemented basic linq grammar.
104 * driver.cs: Set linq lang version on demand.
106 2007-02-26 Marek Safar <marek.safar@gmail.com>
108 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
110 2007-02-25 Marek Safar <marek.safar@gmail.com>
112 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
115 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
117 Check property and event extern attributes.
119 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
122 2007-02-24 Marek Safar <marek.safar@gmail.com>
125 * ecore.cs: Don't report ambiguity error when methods have same parent.
127 2007-02-23 Marek Safar <marek.safar@gmail.com>
130 * class.cs, cs-parser.jay: Event property can host anonymous methods.
132 2007-02-22 Marek Safar <marek.safar@gmail.com>
134 * attribute.cs: Enable ExtensionAttribute presence test.
136 2007-02-22 Marek Safar <marek.safar@gmail.com>
138 * class.cs: Warn about missing GetHashCode only when Equals is override.
140 * decl.cs: Check accessibility of type arguments.
142 * typemanager.cs: Correctly report nullable array.
144 2007-02-20 Marek Safar <marek.safar@gmail.com>
146 * class.cs, report.cs: Capture more details when things go wrong.
148 2007-02-20 Marek Safar <marek.safar@gmail.com>
151 * cs-parser.jay: Anonymous container starts at constructor declaration
152 and not at block beginning because it has to be usable in constructor
155 * statement.cs: Use context location and not block one for error reporting.
157 2007-02-18 Marek Safar <marek.safar@gmail.com>
160 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
163 2007-02-18 Marek Safar <marek.safar@gmail.com>
165 A fix for bug #80493 by Atsushi Enomoto
166 * cs-parser.jay: Ignore invalid attribute target.
168 2007-02-18 Marek Safar <marek.safar@gmail.com>
170 * cs-tokenizer.cs: Ignore '\0' as white space character.
172 2007-02-17 Miguel de Icaza <miguel@novell.com>
174 * cs-parser.jay: Add support for lambda expressions to the mcs
177 * lambda.cs: Only clone when we are probing, not on the final call
178 (Compatible is the final call).
180 * statement.cs (CloneContext): Introduce class to provide block
181 remapping during clone.
183 All statements Clone themselves now.
185 (Clone): special handling for blocks, when we clone a block, we
186 register the block inside this routine, as children of the block
187 might trigger a lookup.
189 * expression.cs: Add support for CloneContext in all expressions.
191 2007-02-17 Marek Safar <marek.safar@gmail.com>
194 * statement.cs: Report ambiguous warning when interfaces are not related.
196 2007-02-15 Marek Safar <marek.safar@gmail.com>
198 C# 3.0 extension methods.
200 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
201 cannot be used directly.
203 * class.cs (Class.Emit): Emit extension attribute if any class method
205 (Method.Define): Add basic extension method validation conditions.
206 (Method.Emit): Emit extension attribute for method.
208 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
209 extension method exists. Currently we follow same approach as Microsoft
210 does, emit even if a method or a class are private but this can change
213 * cs-parser.jay: Add handling of `this' keyword in method parameters
216 * decl.cs (DeclSpace.IsStaticClass): New property.
217 (MemberCache.FindExtensionMethods): Looks for extension methods with
218 defined name and extension type.
220 * doc.cs: Updated after OverloadResolve changes.
222 * driver.cs: Add new soft reference to System.Core.dll.
224 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
225 (ExtensionMethodGroupExpr): Represents group of extension methods.
227 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
228 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
229 to MethodGroupExpr and made non-static for easier customization.
230 (Invocation.DoResolve): Add extension method lookup when no standard
232 (MemberAccess.DoResolve): Try extension methods if no member exists.
234 * modifiers.cs: Add METHOD_EXTENSION modifier.
236 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
237 as well as candidate extension type.
238 (ComputeNamespaces): When assembly constains extension methods registers
240 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
241 extension method lookup.
242 (Namespace.LookupExtensionMethod): Looks for extension method in this
244 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
245 find a method which matches name and extensionType.
247 * parameter.cs (Parameter): Add This modifer.
248 (HasExtensionMethodModifier): New property.
249 (Resolve): Add extension parameter check.
250 (ModFlags): turned to property to exclude this modifier as it is not real
252 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
254 * support.cs (ParameterData): Add ExtensionMethodType.
255 (ReflectionParameters): Implemented ExtensionMethodType interface property.
257 * typemanager.cs: Add type and ctor extension attribute type.
259 2007-02-15 Miguel de Icaza <miguel@novell.com>
261 * report.cs (DisableErrors, EnableErrors): used to prevent error
262 output when we are "trying" to compile various methods with
265 * ecore.cs (Expression): Add Clone method that calls the virtual
266 CloneTo method. The current CloneTo method in Expression throws
267 an exception so we can track down all the places where this must
268 be implemented (not using abstract, because that would be a lot of
269 up-front-work before we can start testing the implementation
272 Important: we only need Clone capabilities for expressions created
273 by the parser, as the expressions we will be cloning are
274 expressions in the pre-resolved state. This vastly simplifies
277 (SimpleName): Add CloneTo that does nothing.
278 (EmptyCast): Add CloneTo.
280 * expression.cs (Binary): Implement CloneTo.
281 (Invocation.IsApplicable): Store the current ec in
282 EmitContext.TempEc and restore it on return. This is used so we
283 do not have to sprinkle hundres of methods with an extra
284 EmitContext, we know that the only user is the lambda expression
285 ImplicitConversionExists code.
287 (Argument): Add Cloning capabilities.
288 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
289 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
290 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
291 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
292 IndexerAccess): Add Clone capability.
294 (LocalVariableReference, This): TODO: needs cloned Block mapping.
296 (Argument): Add cloning capability.
298 * assign.cs (Assign): Implement CloneTo.
300 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
302 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
303 version by calling Convert with the EmitContext (that we are
304 currently storing in ec, this is not great, but will do for now,
305 to avoid passing EmitContext parameters to hundreds of functions
306 that do not need them now).
308 (SetExpression): Remove, it is not needed.
310 (ContextualReturn): Implement CloneTo.
312 * statement.cs (Statement): Implement cloning infrastructure,
313 similar to expressions.
315 (Block): Partial implementation of Clone for statements.
317 (Return): Implement clone.
319 * constant.cs (Constant.CloneTo): New method, does nothing.
321 * codegen.cs (TempEc): Add a static EmitContext as a temporary
322 solution, until we decide how to exactly do this.
324 2007-02-14 Marek Safar <marek.safar@gmail.com>
327 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
328 a property is override we need to use second accessor.
330 2007-02-13 Marek Safar <marek.safar@gmail.com>
333 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
336 2007-02-13 Marek Safar <marek.safar@gmail.com>
338 Another fix for bug #80749
339 * pending.cs: Abstract class has priority over interfaces.
341 2007-02-13 Marek Safar <marek.safar@gmail.com>
343 Another fix for bug #80749
344 * pending.cs: Abstract class has priority over interfaces.
346 2007-02-13 Marek Safar <marek.safar@gmail.com>
348 Another fix for bug #80749
349 * pending.cs: Abstract class has priority over interfaces.
351 2007-02-13 Marek Safar <marek.safar@gmail.com>
353 Another fix for bug #80749
354 * pending.cs: Abstract class has priority over interfaces.
356 2007-02-13 Marek Safar <marek.safar@gmail.com>
358 * class.cs Better error message.
360 * driver.cs: Add shorter versions of -optimize option.
362 2007-02-13 Martin Baulig <martin@ximian.com>
364 * class.cs (Constructor.Emit): Check the return value of
365 ec.ResolveTopBlock() and return on error.
367 2007-02-13 Raja R Harinath <rharinath@novell.com>
369 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
370 message to fix error message regression.
372 2007-02-12 Marek Safar <marek.safar@gmail.com>
374 * delegate.cs: Delegate creation expression cannot be of Nullable type.
376 2007-02-12 Marek Safar <marek.safar@gmail.com>
379 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
380 its parent container.
382 * class.cs (DefineFieldInitializers): Each initializer can has different
387 2007-02-11 Miguel de Icaza <miguel@novell.com>
389 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
390 now all the heavy lifting to check that embedded statements or
391 expressions have the right form is done in the ContextualReturn.
393 (ContextualReturn): New class.
395 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
396 method that can be invoked to report 201, so we do not replicate
399 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
401 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
402 treating tabs as spaces.
404 2007-02-09 Marek Safar <marek.safar@gmail.com>
406 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
407 * assign.cs: Use full implicit conversion for right side check.
409 2007-02-09 Marek Safar <marek.safar@gmail.com>
411 * statement.cs (Switch): Switch over boolean type is not standardized.
413 2007-02-08 Marek Safar <marek.safar@gmail.com>
416 * decl.cs (FindBaseEvent): Don't use method cache for events.
418 2007-02-07 Marek Safar <marek.safar@gmail.com>
420 * cs-parser.jay: Better syntax error handling.
422 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
423 instead of underlying type value.
425 2007-02-06 Marek Safar <marek.safar@gmail.com>
427 * driver.cs: Check define identifier before is registered.
429 * namespace.cs: Use existing error message.
431 * report.cs: New warning.
433 2007-02-06 Marek Safar <marek.safar@gmail.com>
436 * expression.cs: Delegate Invoke method can be called directly.
438 2007-02-06 Marek Safar <marek.safar@gmail.com>
441 * class.cs (IsEntryPoint): The Main method can have params modifier.
443 2007-02-04 Miguel de Icaza <miguel@novell.com>
445 * parameter.cs (Parameter, Parameters): Add Clone method.
447 * anonymous.cs (Compatible): Turn method into virtual method, so
448 LambdaExpression can implement a different behavior.
450 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
451 out the basic checking here, so it can be used by
454 * lambda.cs: Introduce "Compatible" function that will do the
457 2007-02-02 Marek Safar <marek.safar@gmail.com>
459 * attribute.cs: Unified one error message.
461 * class.cs (Class): Use type attributes and not properties to test static
463 (IsEntryPoint): Don's pass local variable.
465 * convert.cs: Removed duplicate check.
467 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
469 * driver.cs: Don't crash when soft reference does not exist.
471 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
472 (UsingEntry): Removed redundant allocation.
474 * parameter.cs: Add fast path for type parameters.
476 * support.cs: Don't allocate attribute when it's not used.
478 2007-01-30 Miguel de Icaza <miguel@novell.com>
481 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
482 this into a virtual method, so we can override it in LambdaExpression.
484 * driver.cs: Improve diagnostics in case of failure.
486 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
487 write a function that is slightly more complex and that parses:
489 type identifier [, type identifier]* )
491 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
494 (canEmpty ? i >= 0 : i > 0)
496 2007-01-30 Raja R Harinath <rharinath@novell.com>
498 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
499 exception on possibly valid code.
501 2007-01-29 Raja R Harinath <rharinath@novell.com>
503 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
505 (parse_opt_type_arguments): Remove. It's almost the same as
507 (parse_namespace_or_typename): Use parse_less_than.
509 2007-01-28 Miguel de Icaza <miguel@novell.com>
511 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
512 this bug took a few hours to find, because the state saved and
513 restored by PushPosition and PopPosition was ignoring the state of
514 parse_generic_less_than.
516 I can also now remove the handling of OP_LT and OP_GT, this solves
519 * cs-tokenizer.cs: store the location for the ARROW token, we use
522 (PushPosition, PopPosition): save/restore also `current_token',
523 restore `parse_generic_less_than' (was missing).
525 (parse_opt_type_arguments): use parse_type, not
526 parse_namespace_or_typename to parse types.
528 * lambda.cs: Empty new file, will eventually have the lambda
529 expression implementation.
531 * lambda.test: used to test the internal tokenizer.
533 * report.cs (FeatureIsNotISO1): Rename from
534 FeatureIsNotStandardized, because it was about the language level
535 (1 vs 2) it was not about standarization.
537 (FeatureRequiresLINQ): New.
539 * support.cs (SeekableStreamReader): Only require that the reader
540 is a TextReader, not a StreamReader, so we can plug StringReader.
542 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
543 given position in the input stream the following tokens can be
544 parsed as a type followed by an identifier.
546 (is_punct): after a '(' if parse_type_and_parameter returns true,
547 then return a special token OPEN_PARENS_LAMBDA which is used to
548 avoid reduce/reduce errors in the grammar for the
549 lambda_expression rules.
551 (parse_type): implement a type parser inside the
552 tokenizer, the parser only returns true or false depending on
553 whether the input at a given position can be parsed as a type.
555 (peek_token): new method used during type parsing.
557 2007-01-28 Raja R Harinath <rharinath@novell.com>
560 * anonymous.cs (ScopeInfo.InflateParameters): New.
561 (AnonymousContainer.Resolve): Use it to redirect types of
564 2007-01-27 Raja R Harinath <rharinath@novell.com>
567 * expression.cs (Error_InvalidArguments): Don't use two different
568 messages for CS1503. Use ExtraInformation and
569 SymbolRelatedToPreviousError instead.
572 * decl.cs (DeclSpace.initialize_type_params): Don't access
573 'type_params' of a partial class directly.
575 2007-01-26 Miguel de Icaza <miguel@novell.com>
577 * constant.cs: Removed a handful of out-of-range checks that were
580 2007-01-25 Marek Safar <marek.safar@gmail.com>
582 * expression.cs (CheckUselessComparison): Add additional check for char
585 * namespace.cs: Fixed typo.
587 2007-01-23 Miguel de Icaza <miguel@novell.com>
589 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
590 gone, instead we inline the test, preventing the needless casts to
591 longs, ulongs and doubles for the parameters, avoiding calls to
592 methods that overchecked stuff, and instead inlined things
595 2007-01-20 Marek Safar <marek.safar@gmail.com>
597 * cs-parser.jay: Better parameter error handling.
599 2007-01-17 Marek Safar <marek.safar@gmail.com>
601 A fix for bug #80368, #80522
602 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
603 whether array initializer contains constants only.
604 (ArrayCreation.Emit): Use better formula to decide when
605 are array initializers for static initialization.
606 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
607 have to emit even constants otherwise they are pre-initialized.
609 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
610 Raja R Harinath <rharinath@novell.com>
612 Fix emit order of 'get' vs. 'set'.
613 * support.cs (Accessors): New.
614 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
615 Note the order in which accessors are declared in the source.
616 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
617 Refactored from Property.Define and Indexer.Define.
618 (PropertyBase.DefineAccessors): New helper that calls the above in
619 appropriate order as noted by the parser.
620 (Property.Define, Indexer.Define): Update to changes.
621 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
623 2007-01-17 Raja R Harinath <rharinath@novell.com>
625 Fix cs0029-6.cs and gcs0029-2.cs (regression)
626 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
627 there's an implicit conversion from the current type to the target
628 type before converting the underlying constant.
630 2007-01-16 Marek Safar <marek.safar@gmail.com>
632 * const.cs (ResolveValue): Updated after constant conversion was made more
635 * constant.cs (GetAttributableValue): constant to object conversion is
636 used for attributes only.
637 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
638 constant conversions.
639 (LongConstant.ConvertImplicitly): Ditto.
641 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
642 (ImplicitConversionStandard): Handle constant conversion as extra step.
643 It solves the issue when constant conversion was called indirectly like
644 inside array initializer and constant folding was skipped.
646 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
649 * statement.cs(ImplicitConversionStandard): Updated after constant
650 conversion was made more generic.
652 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
654 * expression.cs (As.DoResolve): Use GenericConstraints instead of
655 Constraints, solves the problem where the compiler incorrectly
656 reported that a type parameter was not constrained to a class (Bug
659 2007-01-14 Marek Habersack <grendello@gmail.com>
661 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
663 2007-01-14 Marek Safar <marek.safar@gmail.com>
666 * assign.cs (FieldInitializer): New class implements field
667 initializer statement.
669 * attribute.cs: Update after FieldMember rename.
671 * class.cs (PropertyBasedMember): New common class for property based
673 (InterfaceMemberBase): New base class for all members which can be used as
674 an interface members.
675 (MethodCore): Moved really common code to InterfaceMemberBase.
676 (Method.Define): Equal and GetHasCode detection is relevant for methods
678 (MethodData.Define): Don't assume that public event implements an
679 interface automatically.
680 (MethodData.DefineMethodBuilder): Issue an error even if only extern
682 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
683 (FieldMember): Merged with FieldBase.
684 (EventProperty.AEventPropertyAccessor): New specialization to check whether
685 event extern modifier can be used.
686 (EventField.EventFieldAccessor): Moved event field specific code here.
687 (Event.AllowedModifiers): Even event can be extern.
688 (Event.FindOutBaseMethod): New override specific to events.
689 (Indexer.parameters): Reintroduce parameters because base class holds
690 only properties common data.
691 (Indexer.CheckForDuplications): Indexers are threated as methods so we
692 need do extra parameters check.
694 * const.cs: Update after FieldMember rename.
696 * decl.cs (MemberCache.FindBaseEvent): New method.
698 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
699 to reflect that indexer is now derived from PropertyBased.
701 * ecore.cs (GetMemberType): Made public.
702 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
705 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
707 * typemanager.cs (CSharpSignature): Correctly print event accessors.
708 (RegisterEvent): Removed.
709 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
710 (GetPrivateFieldOfEvent): Renamed to GetEventField.
712 2007-01-11 Raja R Harinath <rharinath@novell.com>
715 * statement.cs (CollectionForeach.TryType): Prefer generic
716 GetEnumerator over non-generic variant. Fix code to follow comments.
718 2007-01-09 Raja R Harinath <rharinath@novell.com>
721 * support.cs (ReflectionParameter): Don't use an invalid index on
722 the generic parameter data.
724 2007-01-08 Miguel de Icaza <miguel@novell.com>
726 * driver.cs: Just add a tiny bit of infrastructure.
728 2007-01-02 Marek Safar <marek.safar@gmail.com>
730 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
731 where field type is struct from current assembly.
733 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
736 2007-01-02 Marek Safar <marek.safar@gmail.com>
739 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
742 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
744 (Namespace.LookupType): Always use core types from corlib when speficied.
746 * report.cs: A new warning.
748 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
749 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
750 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
752 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
753 (InitCoreTypes): Set expression type of object_type and value_type
754 immediately after lookup.
756 2007-01-01 Miguel de Icaza <miguel@novell.com>
758 * cs-tokenizer.cs: Accept Pc class characters (Connector
759 Punctuation) as valid identifiers. Fixes #78259
761 * expression.cs (Invocation.DoResolve): Moved the check for the
762 use of `this' for doing method calls to the Invocation resolution
763 step, after overload resolution has taken place instead of doing
764 the check at the low-level `This.DoResolve' level.
766 The `This.DoResolve'Â happens before overload resolution, so it has
767 no way of knowing if the method that will be called will be
768 instace or static, triggering an erroneous report for cs0188 (Bug
771 We now do the check for instance method invocations after we know
772 what method will be called.
774 (This.CheckThisUsage): Move the actual use of this structure
775 checking into its own method and expose it.
777 * Everywhere that called Error_ValueCannotBeConverted: pass a new
780 Exceptions: Null.ConvertImplicitly,
781 Constant.ImplicitConversionRequired as there are too many call
782 sites for passing the ec.
784 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
785 EmitContext, if the value is null, then we do not try to provide
786 the extra information from the error (If a userdefined conversion
787 exists, as UserDefinedConversion requires a non null-EmitContext).
791 2006-12-30 Raja R Harinath <rharinath@novell.com>
793 * flowanalysis.cs (MyBitVector): Document some invariants.
794 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
795 introduced below, and add a couple of others,
797 2006-12-30 Marek Safar <marek.safar@gmail.com>
799 * attribute.cs (GetMethodObsoleteAttribute): Uses new
800 GetPropertyFromAccessor and GetEventFromAccessor.
802 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
803 overrides non-obsolete one.
804 (Indexer.Define): Error message has been moved to the parser.
806 * cs-parser.jay: Better syntax errors handling.
808 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
809 when an invocation has no arguments.
811 * ecore.cs: Removed not used caching.
813 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
816 * report.cs: Add a new warning.
818 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
820 * typemanager.cs (enumeration_type): Removed.
821 (CSharpSignature): Reuses IsSpecialMethod.
822 (IsEqual): Hack for MS BCL.
823 (GetPropertyFromAccessor): New method.
824 (GetEventFromAccessor): New method.
825 (IsSpecialMethod): Fixed to handle more cases.
827 2006-12-30 Marek Safar <marek.safar@gmail.com>
829 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
830 Made white spaces array static.
832 * ecore.cs (RemoveGenericArity): Optimized.
834 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
836 (MyBitVector.initialize_vector): Simplified.
838 2006-12-22 Miguel de Icaza <miguel@novell.com>
840 * ecore.cs: Am not entirely happy with this hack, but it seems to
841 address the issue in 80257 (a small test case for
844 I set the MethodGroupExpr.Type to an internal compiler type
845 (itself in this case) to force the resolution to take place. Why
846 it does not take place with a null is beyond me.
848 2006-12-20 Marek Safar <marek.safar@gmail.com>
851 * expression.cs (ResolveOperator): Consider user defined conversion for
852 logical and operator too.
853 (EmitBranchable): Optimization for logical and when full constant folding
854 could not be applied but one operand is constant.
856 2006-12-19 Marek Safar <marek.safar@gmail.com>
858 * class.cs (GetClassBases): Write 5 times every day, will never use
859 FullName for error reporting.
861 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
863 2006-12-19 Martin Baulig <martin@ximian.com>
865 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
866 the symbol file info here.
868 2006-12-18 Marek Safar <marek.safar@gmail.com>
870 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
871 of `elseif' is taking then following sections are not taking.
872 Fixes an issue reported on mono mailing list.
874 2006-12-18 Marek Safar <marek.safar@gmail.com>
877 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
878 a caller is not taking.
880 2006-12-18 Raja R Harinath <rharinath@novell.com>
882 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
883 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
884 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
885 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
886 * class.cs: Update to changes.
888 2006-12-17 Marek Safar <marek.safar@gmail.com>
891 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
894 * class.cs (ResolveMembers): Register an iterator in current container and
897 2006-12-16 Raja R Harinath <rharinath@novell.com>
900 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
901 satisfy a params annotated parameter.
903 2006-12-16 Marek Safar <marek.safar@gmail.com>
906 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
907 paramters correctly and not rely on hacks in Parameters class.
908 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
910 (Invocation.VerifyArgumentsCompat): Ditto.
911 (Invocation.EmitArguments): Changed to correctly emit params arguments at
914 * parameter.cs (HasParams): Don't assume that params is the last one.
916 * support.cs (ReflectionParameters.ctor): Look for params attribute
918 (ReflectionParameters.ParameterType): Removed hack when we returned last
919 parameter for out of range parameters.
920 (ParameterName, ParameterModifier): Ditto.
922 2006-12-14 Marek Safar <marek.safar@gmail.com>
925 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
926 when assembly is not CLS compliant but type is. I have no idea why is this
929 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
931 2006-12-13 Miguel de Icaza <miguel@novell.com>
933 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
934 in struct constructors, they are basically no-ops.
936 2006-12-12 Marek Safar <marek.safar@gmail.com>
938 * cs-tokenizer.cs (Position): Save preprocessor status too.
940 2006-12-12 Marek Safar <marek.safar@gmail.com>
943 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
945 2006-12-12 Marek Safar <marek.safar@gmail.com>
947 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
949 (pp_expr): Report error for an invalid expression.
950 (handle_preprocessing_directive): Simplified; add more error checking.
952 2006-12-11 Marek Safar <marek.safar@gmail.com>
955 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
958 2006-12-10 Marek Safar <marek.safar@gmail.com>
960 A fix for bugs #80093, and #75984
961 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
962 logic, it seems to me as it worked before "by coincidence".
963 (xtoken): Simplified to use reworked handle_preprocessing_directive.
964 (cleanup): Enabled endif check.
966 2006-12-09 Marek Safar <marek.safar@gmail.com>
969 * statement.cs (CollectionForeach.TryType): Generics and non-generics
970 enumerators are never ambiguous.
972 2006-12-08 Raja R Harinath <rharinath@novell.com>
975 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
977 2006-12-06 Marek Safar <marek.safar@gmail.com>
980 * class.cs (EventProperty.Define): Explicit implementation means
981 that an even is used.
983 2006-12-06 Marek Safar <marek.safar@gmail.com>
985 Fixes the operators implementation (part II)
987 * cfold.cs (DoConstantNumericPromotions): Renamed to
988 DoBinaryNumericPromotions and simplified.
989 (BinaryFold): Couple of conversion fixes; simplified.
991 * constant.cs, ecore.cs, literal.cs
992 (ToType): Renamed to ConvertImplicitly.
993 (Reduce): Renamed to ConvertExplicitly.
995 * class.cs, convert.cs: Updated.
997 * expression.cs: TryReduce doesn't throw an exception.
999 2006-12-01 Marek Safar <marek.safar@gmail.com>
1001 A fix for bug #80108
1002 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
1005 2006-11-30 Marek Safar <marek.safar@gmail.com>
1007 Fixes unary operators implementation (part I)
1010 * cfold.cs (Error_CompileTimeOverflow): Made internal
1012 * const.cs (IConstant): Changed to use reference to constant and
1013 not constant itself.
1014 Updated IConstant implementations.
1016 * constant.cs (CreateConstant): New factory method.
1017 Updated IConstant implementation.
1019 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
1021 * ecore.cs: Updated to use CreateConstantReference.
1023 * enum.cs: Reflects IConstant changes.
1025 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
1027 * literal.cs (NullConstant): Change to be independently usable.
1029 2006-11-29 Martin Baulig <martin@ximian.com>
1031 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
1032 we need to emit the scope initializer before calling the base .ctor.
1034 * anonymous.cs: Merged back from the new anonymous methods branch.
1035 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
1037 * expression.cs (ParameterReference.DoResolveBase): Create a
1038 "normal" ScopeInfo when capturing parameters rather than using the
1039 root scope; this makes things work with anonymous methods having
1043 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
1045 2006-11-22 Marek Safar <marek.safar@gmail.com>
1047 A fix for bug #79987
1048 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
1049 check to a base class.
1050 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
1051 only when assembly has missing attribute.
1052 * report.cs: Update.
1054 2006-11-21 Marek Safar <marek.safar@gmail.com>
1056 * cs-tokenizer.cs: Merged with gmcs version.
1058 2006-11-20 Marek Safar <marek.safar@gmail.com>
1061 * cs-parser.jay: Better error message when partial keyword is misplaced.
1063 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
1065 A fix for bug #79810
1066 report.cs: CS1058 only applies to 2.0 profile (gmcs).
1067 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
1068 a RuntimeWrappedException by default.
1070 2006-11-18 Marek Safar <marek.safar@gmail.com>
1072 A fix for bug #79843
1073 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
1075 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
1077 2006-11-18 Marek Safar <marek.safar@gmail.com>
1079 * driver.cs, namespace.cs: Uses faster IndexOf version.
1081 2006-11-17 Marek Safar <marek.safar@gmail.com>
1083 A fix for bug #79941
1084 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
1086 (Operator.Define): Implicit/Explicit operator of same type is duplicate
1087 even if internal name is different.
1088 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
1089 (UserDefinedConversion): Simplified as the operators cannot be internal.
1090 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
1092 (MethodLookup): Replaced EmitContext with parentType.
1093 * expression.cs: Updated.
1095 2006-11-09 Raja R Harinath <rharinath@novell.com>
1097 * driver.cs (BadAssembly): Handle all the ugliness of
1098 DefineDynamicAssembly.
1100 2006-11-08 Raja R Harinath <rharinath@novell.com>
1102 Address parts of #58244 -- most of what's left is in the runtime
1103 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
1104 CS1509 error checks, and handle them for all assembly loads, not
1105 just the first invocation.
1106 (LoadModule): Likewise. Move handling of 'adder_method' ...
1107 * codegen.cs (AssemblyClass.AddModule): ... here.
1109 2006-11-02 Marek Safar <marek.safar@gmail.com>
1111 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
1112 IEnumerable<T> is ambiguous.
1114 2006-10-31 Marek Safar <marek.safar@gmail.com>
1116 A fix for bug #67689
1117 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
1118 GetEnumerator is ambiguous.
1120 * report.cs: Add new warning.
1122 2006-10-29 Marek Safar <marek.safar@gmail.com>
1124 A fix for bug #78602
1125 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1126 to protected member can be nested type.
1128 2006-10-28 Marek Safar <marek.safar@gmail.com>
1130 A fix for bug #78965
1131 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1132 to protected member must derive from current type.
1134 2006-10-27 Marek Safar <marek.safar@gmail.com>
1136 assign.cs: Reuses error method.
1138 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
1139 instead of type for constants.
1140 (Expression.Error_ValueAssignment): Common error method.
1142 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
1145 2006-10-27 Marek Safar <marek.safar@gmail.com>
1147 A fix for bug #79081
1148 * expression.cs (MemberAccess.DoResolve): Check nested type
1151 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
1153 * doc.cs : nested delegates were not handled. Fixed bug #79754.
1155 2006-10-26 Marek Safar <marek.safar@gmail.com>
1157 A fix for bug #76591
1158 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
1160 2006-10-26 Marek Safar <marek.safar@gmail.com>
1162 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
1163 type forwarder of the same type multiple times.
1165 2006-10-26 Raja R Harinath <rharinath@novell.com>
1168 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
1169 instance as an rvalue, even when we later resolve as an lvalue.
1171 2006-10-25 Martin Baulig <martin@ximian.com>
1173 * anonymous.cs: Fix #79673.
1175 2006-10-24 Marek Safar <marek.safar@seznam.cz>
1177 A fix for bug #79666
1178 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
1179 ignored when is optimized (= default value) as its value is already set.
1181 2006-10-23 Marek Safar <marek.safar@seznam.cz>
1183 A fix for bug #79724
1184 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
1185 TypeContainer for type lookup.
1187 2006-10-23 Marek Safar <marek.safar@seznam.cz>
1189 A fix for bug #79231
1190 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
1191 * expression.cs (OverloadResolve): Always convert type name for
1193 (ResolveNamespaceOrType): Don't confuse a nested type with any
1196 2006-10-18 Martin Baulig <martin@ximian.com>
1198 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
1200 2006-10-17 Miguel de Icaza <miguel@novell.com>
1202 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
1203 an int32, but requesting an int64 from the conversion
1205 2006-10-12 Martin Baulig <martin@ximian.com>
1208 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
1210 2006-10-12 Martin Baulig <martin@ximian.com>
1213 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
1215 2006-10-11 Miguel de Icaza <miguel@novell.com>
1217 * convert.cs: Remove broken code: I was doing the "Existance"
1218 tests for Implicit conversions.
1220 2006-10-10 Miguel de Icaza <miguel@novell.com>
1222 * convert.cs: Added one missing case in
1223 ImplicitStandardConversionExists uint64 to intptr.
1227 * typemanager.cs (uintptr_type): another core known type.
1229 * ecore.cs (OperatorCast): routine used to do cast operations that
1230 depend on op_Explicit. We could change some of the Decimal
1231 conversions to use this.
1233 This one has a probe mechanism that checks both types for an op_
1234 which it coudl be used to eliminate two classes: CastToDecimal
1235 and CastFromDecimal.
1237 * convert.cs: Implement the conversions documented in #59800
1239 2006-10-10 Martin Baulig <martin@ximian.com>
1241 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
1242 before RootScope.ResolveMembers().
1244 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
1245 `CurrentType' if appropriate.
1247 2006-10-09 Marek Safar <marek.safar@seznam.cz>
1249 A fix for bug #78568
1250 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
1251 when contains binary operators.
1252 * cs-parser.jay: Updated.
1254 2006-10-09 Martin Baulig <martin@ximian.com>
1257 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
1258 moved that into Define() and also do the other type parameter
1259 checks there. Fixes #79094. Added gtest-292.cs.
1262 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
1263 since that doesn't include type parameters; don't use `Ldelema'
1264 for type parameters. Fixes #78980. Added gtest-293.cs.
1266 2006-10-08 Marek Safar <marek.safar@seznam.cz>
1269 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
1270 conversion is allowed.
1272 2006-10-06 Marek Safar <marek.safar@seznam.cz>
1274 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
1275 error reporting when no error occurs.
1277 2006-10-06 Marek Safar <marek.safar@seznam.cz>
1279 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
1282 2006-10-06 Raja R Harinath <rharinath@novell.com>
1285 * class.cs (DefineTypeBuilder): Check circular dependencies before
1286 setting the parent of the TypeBuilder.
1287 (CheckRecursiveDefinition): Don't use 'BaseType', since
1288 it may not be valid until after DefineTypeBuilder. Use
1289 'base_type' instead.
1291 2006-10-04 Martin Baulig <martin@ximian.com>
1293 Merged the Anonymous Methods patch.
1295 * anonymous.cs, iterators.cs: The new anonymous methods code.
1297 * statement.cs (Variable): New public abstract class.
1298 (LocalInfo.Variable): New public property.
1299 (LocalInfo.ResolveVariable): New public method.
1300 (Block.Flags): Add `IsIterator'.
1301 (Block.AddVariable): Improved the CS0136 check.
1302 (Block.AnonymousChildren): New public property.
1303 (Block.AddAnonymousChild): New public method.
1304 (ToplevelBlock): Update to use the new anonymous method framework.
1305 (ToplevelBlock.ctor): `container' is now a `Block' and not a
1306 `ToplevelBlock'; this is required to correctly implement the
1308 (Fixed, Using): Use `TemporaryVariable' instead of directly
1309 creating the `LocalBuilder'.
1311 * parameter.cs (Parameter.ResolveVariable): New public method.
1312 (Parameters.ResolveVariable): Likewise.
1314 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
1316 * class.cs (TypeContainer): Replaced the `iterators' list and
1317 corresponding methods with a list of `CompilerGeneratedClass'es.
1318 (TypeContainer.ResolveMembers): New public method.
1319 (Method): `IIteratorContainer' has been replaced by
1322 * expression.cs (VariableReference): New public abstract base
1323 class for `LocalVariableReference', `ParameterReference' and
1326 * codegen.cs (EmitContext): Removed `capture_context',
1327 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
1328 (EmitContext.EmitThis): Removed.
1330 * cs-parser.jay: Replace `iterator_container' with
1333 2006-10-04 Martin Baulig <martin@ximian.com>
1335 * generic.cs (GenericMethod): Don't make this abstract.
1336 (Constraints.Clone): Added dummy implementation.
1338 2006-10-04 Raja R Harinath <harinath@gmail.com>
1341 * namespace.cs (LookForAnyGenericType): Avoid nullref on
1342 'declspaces'. Avoid allocating arrays willy-nilly.
1345 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
1346 cases out of the switch.
1348 2006-09-28 Marek Safar <marek.safar@seznam.cz>
1350 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
1351 message when non-generic type is used with the type arguments.
1352 * expression.cs: Updated.
1354 2006-09-28 Raja R Harinath <rharinath@novell.com>
1357 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
1358 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1359 Change semantics slightly. Don't insist on having only one
1360 temporary EmptyExpression -- just throttle the creation of new ones.
1363 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
1364 non-interfaces too. If no methods are found, don't try to create
1367 2006-09-28 Marek Safar <marek.safar@seznam.cz>
1369 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
1372 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
1373 us produce better error message.
1375 2006-09-27 Marek Safar <marek.safar@seznam.cz>
1377 * expression.cs (Binary.ResolveOperator): Warn about a side effect
1378 of the `|' operator.
1380 * report.cs: A new warning added.
1382 2006-09-27 Martin Baulig <martin@ximian.com>
1384 * generic.cs (GenericMethod): Don't make this abstract.
1386 2006-09-27 Martin Baulig <martin@ximian.com>
1389 (InternalErrorException): Added overloaded ctor taking a params array.
1391 2006-09-26 Marek Safar <marek.safar@seznam.cz>
1393 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
1394 Fixed the cases when same error was reported twice.
1396 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
1397 now report symbol information.
1399 2006-09-25 Martin Baulig <martin@ximian.com>
1401 * class.cs: Completely unified with the gmcs version.
1403 2006-09-25 Martin Baulig <martin@ximian.com>
1405 * typemanager.cs (TypeManager.IsNullableType): New public function.
1406 (TypeManager.IsNullableTypeOf): Likewise.
1407 (TypeManager.IsNullableValueType): Likewise.
1409 * class.cs (MethodCore): Added the `GenericMethod' argument from
1410 gmcs and also unified all classes derived from `MethodCore' with gmcs.
1412 2006-09-24 Raja R Harinath <harinath@gmail.com>
1414 * convert.cs: Unify with gmcs version.
1416 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1418 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
1419 verify them as well.
1421 * report.cs: New warning.
1423 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1425 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
1426 for anonymous block with out argument.
1428 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1430 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
1431 not used private events only.
1433 2006-09-23 Marek Safar <marek.safar@seznam.cz>
1435 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
1437 * const.cs (Const.Define): Check for constant type.
1438 (Const.IsConstantTypeValid): Looks for valid constant types.
1440 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
1442 * ecore.cs (EmptyConstantCast): New common class for all constant based
1445 * expression.cs (Is.DoResolve): Handle null constant especially.
1446 (New.DoResolve): Check for new void().
1447 (MemberAccess.DoResolve): Cope with all kind of nulls.
1449 * literal.cs (NullConstant): Uses EmptyConstantCast.
1450 (NullDefault): Based on EmptyConstantCast.
1451 (NullLiteral): Uses EmptyConstantCast.
1453 * statement.cs (Block.ResolveMeta): Check for constant type.
1455 2006-09-22 Martin Baulig <martin@ximian.com>
1457 * delegate.cs, attribute.cs: Merged with the gmcs versions.
1459 2006-09-22 Raja R Harinath <rharinath@novell.com>
1461 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
1465 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
1466 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
1469 2006-09-22 Martin Baulig <martin@ximian.com>
1471 * ecore.cs: Merged with the gmcs version.
1473 * generic.cs (ConstructedType): New dummy class.
1474 (TypeArguments): Don't make this abstract.
1477 (TypeManager.IsGenericTypeDefinition): New method.
1478 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
1480 2006-09-22 Raja R Harinath <rharinath@novell.com>
1482 * expression.cs (ComposedCast): Check for arrays of TypedReference
1483 before creating the type, not after.
1485 2006-09-21 Marek Safar <marek.safar@seznam.cz>
1487 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
1488 after ToType change.
1490 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
1491 when constant must be implicitly convertible.
1493 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
1495 * ecore.cs (NullCast): Derives from NullConstant.
1497 * expression.cs (Is.DoResolve): Removed useless variables.
1498 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
1499 (New.Constantify): Add enum support.
1500 (MemberAccess.DoResolve): Add warning when accessing null constant or
1503 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
1506 * literal.cs (NullConstant): New abstract class with common
1507 functionality for all null specializations.
1508 (NullDefault): Represents default(X) when result can be
1510 (NullLiteral): Updated.
1512 * report.cs: Add new warning.
1514 2006-09-21 Martin Baulig <martin@ximian.com>
1516 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
1518 2006-09-21 Martin Baulig <martin@ximian.com>
1520 * generic.cs (GenericConstraints): New dummy class.
1521 (Constraints): Likewise.
1522 (TypeParameter): Likewise.
1523 (TypeParameterName): Likewise.
1524 (GenericMethod): Likewise.
1526 * typemanager.cs (TypeManager.GetGenericArguments): New method.
1528 * decl.cs: Merged with the gmcs version.
1530 2006-09-21 Raja R Harinath <rharinath@novell.com>
1532 * generic.cs (TypeParameter): Implement IMemberContainer.
1533 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
1535 * rootcontext.cs: Unify with gmcs version.
1537 * report.cs: Unify with gmcs version.
1538 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
1539 from gmcs/generics.cs.
1540 * generics.cs (TypeParameter): New dummy class.
1542 * support.cs: Unify with gmcs version.
1544 2006-09-20 Raja R Harinath <rharinath@novell.com>
1546 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
1547 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
1549 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
1550 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
1551 * mcs.exe.sources: Add generic.cs.
1553 * codegen.cs: Unify with gmcs version.
1555 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
1556 (EmitContext): Add GenericDeclContainer implementation.
1557 * decl.cs (MemberCore, DeclSpace): Likewise.
1558 * namespace.cs: Remove #ifdef GMCS_SOURCE.
1560 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
1561 MCS TypeManager has a corresponding dummy method.
1563 2006-09-19 Martin Baulig <martin@ximian.com>
1565 * expression.cs: Completely merged with the gmcs version.
1567 2006-09-19 Martin Baulig <martin@ximian.com>
1569 * expression.cs (Invocation): Merged with the gmcs version.
1570 (ArrayAccess.GetStoreOpcode): Likewise.
1572 2006-09-19 Martin Baulig <martin@ximian.com>
1575 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
1576 (TypeManager.IsGenericMethodDefinition): Likewise.
1578 2006-09-19 Martin Baulig <martin@ximian.com>
1581 (TypeManager.IsEqual): Moved the gmcs implementation here.
1582 (TypeManager.DropGenericTypeArguments): Likewise.
1583 (TypeManager.DropGenericMethodArguments): Likewise.
1584 (TypeManager.GetTypeArguments): Moved here from gmcs.
1585 (TypeManager.HasGenericArguments): Likewise.
1587 2006-09-19 Martin Baulig <martin@ximian.com>
1589 * expression.cs (Binary): Merged with the gmcs version.
1591 2006-09-19 Martin Baulig <martin@ximian.com>
1593 * expression.cs (Probe, As, Is): Merged with the gmcs version.
1595 2006-09-19 Martin Baulig <martin@ximian.com>
1597 * typemanager.cs: Merged with the gmcs version.
1599 2006-09-16 Raja R Harinath <rharinath@novell.com>
1601 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
1602 * driver.cs: Likewise.
1604 2006-09-16 Marek Safar <marek.safar@seznam.cz>
1607 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
1608 only if parent type is class.
1609 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
1612 2006-09-15 Marek Safar <marek.safar@seznam.cz>
1615 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
1617 * typemanager.cs(CSharpName): Converts NullType to null.
1619 2006-09-15 Martin Baulig <martin@ximian.com>
1622 (TypeManager.GetMethodName): Added mcs implementation.
1623 (TypeManager.IsEqual): Likewise.
1626 (SimpleName.RemoveGenericArity): Added dummy implementation.
1628 * pending.cs: Merged with the gmcs version.
1630 2006-09-15 Martin Baulig <martin@ximian.com>
1632 * statement.cs: Merge with the gmcs version.
1634 2006-09-15 Martin Baulig <martin@ximian.com>
1636 * statement.cs (Switch): Merge with the gmcs implementation
1637 (without nullables), which is newer.
1639 2006-09-15 Martin Baulig <martin@ximian.com>
1641 * statement.cs (Block.Variables): Make this public.
1642 (ToplevelBlock.Parameters): Make this a property.
1643 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
1645 2006-09-15 Martin Baulig <martin@ximian.com>
1647 * namespace.cs: Merge with the gmcs version.
1649 2006-09-15 Martin Baulig <martin@ximian.com>
1651 * decl.cs (MemberName): Minor code cleanups.
1653 2006-09-15 Martin Baulig <martin@ximian.com>
1655 * parameter.cs: Merge with the gmcs version.
1657 2006-09-15 Martin Baulig <martin@ximian.com>
1659 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
1660 and an error in mcs.
1662 2006-09-15 Martin Baulig <martin@ximian.com>
1664 * flowanalysis.cs: Merged from GMCS; added the generics code into
1665 a `GMCS_SOURCE' conditional so we can share this file.
1667 2006-09-08 Martin Baulig <martin@ximian.com>
1669 * typemanager.cs (TypeManager.interlocked_type): New public field.
1670 (TypeManager.int_interlocked_compare-exchange): New public field.
1671 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
1672 enumerator types here and call InitGenericCoreTypes().
1673 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
1674 after calling InitEnumUnderlyingTypes().
1677 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
1678 `classes_second_stage'.
1680 2006-09-14 Marek Safar <marek.safar@seznam.cz>
1682 * assign.cs, ecore.cs, expression.cs: Share error message text.
1683 * class.cs (FieldMember.Define): Check for varible of static type.
1684 * driver.cs (LoadAssembly): Uses error output for errors.
1685 * statement.cs: Updated.
1687 2006-09-08 Marek Safar <marek.safar@seznam.cz>
1689 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
1692 2006-09-07 Martin Baulig <martin@ximian.com>
1695 (MainDriver): Revert r62663 from Marek; see #70506 for details.
1697 2006-08-29 Miguel de Icaza <miguel@novell.com>
1699 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
1701 2006-08-17 Miguel de Icaza <miguel@novell.com>
1703 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
1704 #52019 and #79064, the use of the \uXXXX sequence in source code
1705 to represent unicode characters.
1707 2006-08-15 Marek Safar <marek.safar@seznam.cz>
1709 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
1711 * class.cs, ecore.cs, statement.cs: Merged to one error message.
1713 2006-08-13 Miguel de Icaza <miguel@novell.com>
1715 * assign.cs: Catch attempts to assign to a method groups in += and
1718 2006-08-13 Marek Safar <marek.safar@seznam.cz>
1721 * cs-parser.jay: Don't destroy current array type by typeof of array's.
1723 2006-08-12 Marek Safar <marek.safar@seznam.cz>
1725 * class.cs (Method.Define): Issue a warning when generic method looks like
1727 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
1730 2006-08-09 Marek Safar <marek.safar@seznam.cz>
1732 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
1734 * decl.cs (MemberCache.FindMembers): When container is interface we need to
1735 search all base interfaces as a member can be ambiguous.
1736 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
1737 Constructor member type filter.
1738 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
1739 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
1740 reporting for returned memberinfos.
1741 * report.cs: Updated.
1742 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
1743 version to work on all runtimes.
1744 (TypeManager.RealMemberLookup): Removed members filtering.
1746 2006-08-08 Raja R Harinath <rharinath@novell.com>
1748 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
1749 (PropertyExpr.EmitAssign): Likewise.
1750 * expression.cs (Indirection.EmitAssign): Likewise.
1751 (LocalVariableReference.EmitAssign): Likewise.
1752 (ParameterReference.EmitAssign): Likewise.
1753 (Invocation.EmitArguments): Likewise.
1754 (ArrayAccess.EmitAssign): Likewise.
1755 (IndexerAccess.EmitAssign): Likewise.
1756 (This.EmitAssign): Likewise.
1757 (ConditionalLogicalOperator.Emit): Likewise.
1760 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
1761 instead of ArrayList. If the hashtable has a LocalBuilder, don't
1762 leave it in after returning it.
1763 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
1765 2006-08-06 Marek Safar <marek.safar@seznam.cz>
1767 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
1770 2006-08-03 Raja R Harinath <rharinath@novell.com>
1772 Fix cs0146-3.cs and cs0146-4.cs.
1773 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1774 enclosing types don't depend on the current type.
1776 2006-08-02 Raja R Harinath <rharinath@novell.com>
1779 * class.cs (TypeContainer.DoDefineMembers): Use
1780 FindBaseMemberWithSameName on Parent, since we're interested in
1781 whether we hide inherited members or not.
1782 (FindBaseMemberWithSameName): Make slightly more robust.
1784 Fix the non-generic testcase from #77396
1785 * decl.cs (DeclSpace.DeclContainer): Remove override.
1787 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1788 declspaces for doppelgangers too.
1789 (UsingEntry): Implement IResolveContext.
1790 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
1791 'this' as the resolve context.
1792 (LocalAliasEntry): Likewise.
1794 Implement parts of #77403
1795 * roottypes.cs (RootDeclSpace): New. Used to represent the
1796 toplevel declaration space. Each namespace declaration introduces
1797 a "partial" root declaretion space.
1798 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1799 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1800 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1801 from 'current_namespace.SlaveDeclSpace'.
1802 (namespace_declaration): Likewise.
1803 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1804 check. It can't happen now.
1805 * decl.cs (DeclSpace.LookupType): Likewise.
1806 * driver.cs (MainDriver): Sanity check.
1808 2006-08-01 Raja R Harinath <rharinath@novell.com>
1810 * decl.cs (DeclSpace.FindNestedType): Remove.
1811 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1812 LookupTypeContainer to get the container of the nested type.
1813 * class.cs (TypeContainer.FindNestedType): Make non-override.
1815 2006-07-31 Raja R Harinath <rharinath@novell.com>
1817 * decl.cs (DeclSpace.PartialContainer): Move field from ...
1818 * class.cs (TypeContainer.PartialContainer): ... here.
1819 (TypeContainer.AddBasesForPart): New helper.
1820 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
1822 * cs-parser.jay (current_class): Convert to DeclSpace.
1823 (struct_declaration, interface_declaration, class_declaration):
1824 Use AddBasesForPart instead of .Bases directly.
1825 * const.cs, iterators.cs: Update to changes.
1827 2006-07-28 Raja R Harinath <rharinath@novell.com>
1829 * class.cs (TypeContainer.AddMemberType): Rename from
1831 (TypeContainer.AddMember): Rename from AddToMemberContainer.
1832 (AddTypeContainer): New. Combine AddClassOrStruct and
1834 (AddPartial): Update. Add 'is_partial' argument.
1835 * roottypes.cs: Update to changes.
1836 * cs-parser.jay (push_current_class): New helper for handling
1837 current_container and current_class.
1838 (struct_declaration, interface_declaration, class_declaration):
1841 2006-07-26 Raja R Harinath <rharinath@novell.com>
1843 * roottypes.cs: Rename from tree.cs.
1845 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1846 * tree.cs (Tree, ITreeDump): Remove types.
1847 * rootcontext.cs (tree, Tree): Remove fields.
1848 (root, ToplevelTypes): New.
1849 * *.cs: Update to rename.
1851 * tree.cs (Tree.RecordDecl): Remove.
1852 (RootTypes.AddToTypeContainer): Record the toplevel type in its
1854 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1856 2006-07-23 Raja R Harinath <harinath@gmail.com>
1858 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1859 DoFlowAnalysis and OmitStructFlowAnalysis here.
1860 (ec.With): Rename from WithUnsafe and generalize.
1861 (ec.WithCheckState): Remove. All users can be handled by 'With'.
1862 (ec.WithFlowAnalyis): New.
1863 * ecore.cs, expression.cs, statement.cs: Update.
1865 2006-07-22 Raja R Harinath <harinath@gmail.com>
1867 * statement.cs (Block.ResolveMeta): Simplify slightly.
1869 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
1870 multiple boolean fields. Convert InUnsafe, constant_check_state,
1871 check_state to flags.
1872 (CheckState, ConstantCheckState): Update.
1873 (InUnsafe): New read-only property.
1874 (FlagsHandle): Rename from CheckStateHandle and convert to handle
1876 (WithUnsafe): New helper similar to WithCheckState.
1877 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1878 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1880 2006-07-21 Raja R Harinath <rharinath@novell.com>
1882 Make comparisons use the same IL irrespective of whether they're
1883 in a 'checked' or 'unchecked' context: one of the issues in #78899
1884 * codegen.cs (EmitContext.CheckState): Make read-only property.
1885 (EmitContext.ConstantCheckState): Likewise.
1886 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1887 helper that implement a save/restore stack for CheckState
1888 values. This is the only way to change check-state.
1889 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1890 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1891 (CheckedExpr.EmitBranchable): New forwarding method.
1892 (UnCheckedExpr): Likewise.
1893 * statement.cs (Block.ResolveMeta): Use WithCheckState.
1894 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1895 (Checked.Resolve, checked.DoEmit): Likewise.
1897 2006-07-20 Miguel de Icaza <miguel@novell.com>
1899 * anonymous.cs: Cache the resolved anonymous delegate, and return
1900 this so that the ResolveTopBlock is only triggered once, not
1903 Currently we trigger ResolvetopBlock twice due to a first pass of
1904 argument check compatibility, and a second pass that does the
1907 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1909 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1911 * rootcontext.cs (Reset): Add helper_classes.
1913 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1916 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1919 2006-07-13 Miguel de Icaza <miguel@novell.com>
1921 * statement.cs (Lock): Handle expressions of type
1922 TypeManager.null_type specially. Fixes #78770
1924 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1926 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1929 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1931 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1932 for accessors as well.
1933 * ecore.cs (EventExpr): Add AccessorTable.
1935 2006-07-01 Marek Safar <marek.safar@seznam.cz>
1938 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1939 for CS0122 where appropriate.
1940 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1942 (Filter): Assembly can be null in the case of top level attributes.
1944 2006-06-25 Marek Safar <marek.safar@seznam.cz>
1948 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1949 is done at global level.
1951 2006-06-24 Marek Safar <marek.safar@seznam.cz>
1953 A fix for #77002, Implemented TypeForwarder support.
1955 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1956 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1957 * typemanager.cs (): Add type_forwarder_attr_type.
1959 2006-06-24 Marek Safar <marek.safar@seznam.cz>
1961 * report.cs: Add CS0469 warning.
1963 2006-06-21 Martin Baulig <martin@ximian.com>
1965 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1966 the `try'-block, so we also report CS0016 etc. there.
1968 2006-06-21 Martin Baulig <martin@ximian.com>
1971 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1973 2006-06-21 Martin Baulig <martin@ximian.com>
1975 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1976 also report CS1686 for parameters.
1978 2006-06-21 Martin Baulig <martin@ximian.com>
1980 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1981 instead of an error if the value is not implicitly convertible to
1982 the switch types; fixes #77964.
1984 2006-06-21 Raja R Harinath <rharinath@novell.com>
1987 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1988 FieldBuilder is null.
1991 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1992 'left' and 'right' before error-checking.
1994 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
1996 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1998 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1999 (FieldExpr.DoResolve): likewise.
2000 (PropertyExpr.InstanceResolve): likewise.
2001 (EventExpr.InstanceResolve): likewise.
2003 2006-06-04 Marek Safar <marek.safar@seznam.cz>
2005 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
2006 attribute applicable tests for attribute argument.
2008 2006-06-02 Raja R Harinath <rharinath@novell.com>
2011 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
2012 (Binary.OverloadResolve_PredefinedIntegral): New.
2013 (Binary.OverloadResolve_PredefinedFloating): New.
2014 (Binary.OverloadResolve_PredefinedString): New.
2015 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
2016 Follow the standard more closely, and treat numeric promotions in
2017 terms of overload resolution.
2018 (Binary.CheckShiftArguments): Simplify.
2020 2006-06-01 Raja R Harinath <rharinath@novell.com>
2022 * flowanalysis.cs (MyBitVector): Simplify representation.
2023 (MyBitVector.Clone): Avoid allocating BitArray.
2024 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
2025 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
2026 (*): Update. Change all references to MyBitVector.And and
2027 MyBitVector.Or to &= and |=.
2029 2006-05-29 Raja R Harinath <rharinath@novell.com>
2032 * cs-parser.jay (formal_parameter_list): Extend the pattern below
2033 to param arguments too.
2035 2006-05-26 Miguel de Icaza <miguel@novell.com>
2037 * cs-parser.jay: Catch another parsing form for arglist being
2038 followed by other arguments. Fixes #78313.
2040 2006-05-24 Raja R Harinath <rharinath@novell.com>
2042 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
2043 checking of out parameters to ...
2044 (FlowBranchingToplevel.Merge): ... here.
2045 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
2046 set, propagate the origin upward, and only complain if there was
2048 (FlowBranchingException.AddContinueOrigin): Likewise.
2049 (FlowBranchingException.AddReturnOrigin): Likewise.
2050 (FlowBranchingException.AddGotoOrigin): Likewise.
2052 2006-05-23 Raja R Harinath <rharinath@novell.com>
2054 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
2055 unreachable, skip it.
2056 (FlowBranchingException.Merge): Always propagate jumps, even if
2057 the finally block renders subsequent code unreachable.
2059 2006-05-18 Raja R Harinath <rharinath@novell.com>
2062 * statement.cs (Goto.Resolve): Move responsibility for resolving
2063 'goto' to FlowBranching.AddGotoOrigin.
2064 (Goto.SetResolvedTarget): New. Callback to set the
2065 LabeledStatement that's the target of the goto.
2066 (Goto.DoEmit): Use Leave instead of Br when crossing an
2067 unwind-protect boundary.
2068 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
2069 LookupLabel and adjust to new semantics.
2070 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
2071 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
2072 Goto.SetResolvedTarget to update target.
2073 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
2074 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
2075 AddBreakOrigin & co. Delay propagation until ...
2076 (FlowBranchingException.Merge): ... this.
2078 * statement.cs (Block.Resolve): Always depend on flow-branching to
2079 determine unreachability. Kill workaround that originally emitted
2080 only one statement after an "unreachable" label (see infloop in
2083 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
2084 This is still "wrong", but anything better would probably need a
2085 multi-pass algorithm.
2086 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
2087 usage vector. Force current usage vector to be reachable, to
2088 optimistically signify backward jumps.
2089 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
2091 (FlowBranchingLabeled.Merge): New. If no backward jump was
2092 detected, return the original salted-away usage vector instead,
2093 updated with appropriate changes. Print unreachable warning if
2095 * statement.cs (Block.Resolve): Don't print unreachable warning on
2096 a labeled statement.
2098 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
2100 * driver.cs: Pass filename without path to AssemblyBuilder's
2101 AddResourceFile. Fixes bug #78407.
2103 2006-05-17 Raja R Harinath <rharinath@novell.com>
2105 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
2106 * flowanalysis.cs (FlowBranchingLabeled): ... here.
2107 (FlowBranching.MergeChild): Overwrite
2108 reachability information from Labeled branchings too.
2110 2006-05-16 Raja R Harinath <rharinath@novell.com>
2112 * statement.cs (Goto.Resolve): Merge jump origins here ...
2113 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
2115 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
2116 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
2117 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
2118 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
2120 * statement.cs (Goto.Resolve): ... not here.
2121 (Goto.Emit): Remove CS1632 check.
2123 2006-05-14 Marek Safar <marek.safar@seznam.cz>
2125 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
2128 2006-05-11 Raja R Harinath <rharinath@novell.com>
2130 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
2131 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
2132 (FlowBranchingException.Label): Likewise.
2134 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
2136 (MyBitVector.Or): Use it to avoid losing information (Count).
2137 (FlowBranching.MergeOrigins): Likewise.
2139 * flowanalysis.cs (UsageVector.IsDirty): Remove.
2140 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
2141 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
2142 (UsageVector.ToString): Simplify.
2143 (UsageVector.MergeSiblings): Move here from ...
2144 (FlowBranching.Merge): ... here.
2145 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
2148 2006-05-10 Raja R Harinath <rharinath@novell.com>
2150 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
2151 null bitvector is treated as all-true.
2153 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
2154 (MyBitVector): Rationalize invariants. 'vector != null' implies
2155 that we have our own copy of the bitvector. Otherwise,
2156 'InheritsFrom == null' implies all inherited bits are true.
2158 2006-05-09 Marek Safar <marek.safar@seznam.cz>
2160 * statement.cs (LocalInfo): Add IsConstant.
2161 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
2162 local variable for constants.
2164 2006-05-09 Raja R Harinath <rharinath@novell.com>
2166 * flowanalysis.cs (MyBitVector.Empty): New.
2167 (MyBitVector): Don't allow InheritedFrom to be null.
2168 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
2169 (UsageVector, FlowBranching): Update to changes.
2171 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
2172 recursion. The 'Parent == null' condition isn't sufficient for
2174 (FlowBranching.AddBreakOrigin): Likewise.
2175 (FlowBranching.AddContinueOrigin): Likewise.
2176 (FlowBranching.AddReturnOrigin): Likewise.
2177 (FlowBranching.StealFinallyClauses): Likewise.
2178 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
2179 (FlowBranching.CheckOutParameters): Likewise.
2180 (FlowBranchingToplevel): Terminate all the above recursions here.
2181 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
2182 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
2184 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
2186 (FlowBranchingToplevel): New. Empty for now.
2187 (FlowBranching.MergeTopBlock): Update.
2188 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
2189 branching for the anonymous delegate.
2190 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
2192 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
2193 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
2194 information at the start of the merge. Reorganize.
2196 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2198 * class.cs (MethodData.Define): Method cannot implement interface accessor.
2200 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2202 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
2203 to newly introduced ctor.
2205 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
2206 message to one place.
2207 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
2210 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2212 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
2214 * ecore.cs (Expression.ResolveAsConstant): Updated.
2216 * statement.cs (ResolveMeta): Updated.
2218 2006-05-06 Marek Safar <marek.safar@seznam.cz>
2220 * cs-parser.jay: __arglist cannot be used in initializer.
2222 2006-05-06 Marek Safar <marek.safar@seznam.cz>
2225 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
2228 2006-05-05 Raja R Harinath <rharinath@novell.com>
2230 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
2231 (LabeledStatement): Add 'name' parameter.
2232 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
2233 (Block.AddLabel): Update to changes.
2234 * cs-parser.jay (labeled_statement): Likewise.
2236 * flowanalysis.cs (BranchingType.Labeled): New.
2237 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
2238 (FlowBranchingLabeled): New. Does nothing for now, but will
2239 eventually handle 'goto' flows.
2240 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
2241 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
2242 that's terminated ...
2243 (Block.Resolve): ... here.
2245 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
2246 (UsageVector.MergeFinallyOrigins): Likewise.
2247 (FlowBranching.InTryOrCatch): Likewise.
2248 (FlowBranching.AddFinallyVector): Likewise.
2249 (FlowBranchingException): Update to changes.
2252 * statement.cs (Return.Resolve): Move error checking to ...
2253 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
2254 (FlowBranchingException): Handle return origins like break and
2256 (FlowBranching.UsageVector.CheckOutParameters): Remove.
2258 2006-05-04 Marek Safar <marek.safar@seznam.cz>
2261 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
2264 2006-05-04 Marek Safar <marek.safar@seznam.cz>
2267 * class.cs (MethodData.Define): Do public accessor check only when method
2268 implements an interface.
2270 2006-05-04 Raja R Harinath <rharinath@novell.com>
2272 Remove special handling of 'break'
2273 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
2274 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
2275 (UsageVector.Break): Remove.
2276 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
2278 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
2280 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
2281 UsageVector.Breaks (). Don't set NeedsReturnLabel.
2283 2006-05-03 Marek Safar <marek.safar@seznam.cz>
2286 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
2287 be the interface member.
2289 2006-05-03 Marek Safar <marek.safar@seznam.cz>
2292 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
2293 for emitting small (int) values.
2295 2006-05-03 Raja R Harinath <rharinath@novell.com>
2298 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
2299 control-flow passes through the 'finally' after merging-in all the
2300 control-flows from 'try' and the 'catch' clauses.
2302 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
2303 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
2304 always true at the only non-recursive entry point.
2305 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
2306 FlowBranchingBreakable.
2307 (FlowBranchingLoop): Remove.
2308 * statement.cs (Return.DoResolve): Update to changes.
2311 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
2312 (FlowBranching.CreateBranching): Handle it: create a
2313 FlowBranchingContinuable.
2314 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
2315 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
2316 except that it handles the 'continue' command.
2317 (FlowBranching.UsageVector.MergeOrigins): Rename from
2319 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
2320 except that it overrides AddContinueOrigin.
2321 (FlowBranchingException): Override AddContinueOrigin, similar to
2323 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
2324 Create a new branching around the embedded statement.
2325 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
2326 control flow after the embedded statement.
2327 (Continue.Resolve): Move all error checking to AddContinueOrigin.
2329 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
2330 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
2331 FlowBranchingBreakable.
2332 (FlowBranchingSwitch): Remove.
2335 * statement.cs (Break.Resolve): Simplify. Move responsibility for
2336 error reporting to ...
2337 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
2338 Rename from 'AddBreakVector'. Add new location argument. Return
2339 a bool indicating whether the 'break' crosses an unwind-protect.
2340 (FlowBranchingException.AddBreakOrigin): Add.
2341 (FlowBranchingException.Merge): Propagate 'break's to surrounding
2342 flowbranching after updating with the effects of the 'finally'
2344 (FlowBranchingBreakable): New common base class for
2345 FlowBranchingLoop and FlowBranchingSwitch.
2347 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
2349 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
2351 2006-05-02 Raja R Harinath <rharinath@novell.com>
2353 * statement.cs (Do.Resolve): If the loop is infinite, set the
2355 (While.Resolve, For.Resolve): Set a barrier after the embedded
2356 statement. There's no direct control flow that goes from the end
2357 of the embedded statement to the end of the loop.
2358 * flowanalysis.cs (FlowBranching.Infinite): Remove.
2359 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
2360 above ensure that the reachability is correctly computed.
2362 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
2363 (UsageVector.MergeBreakOrigins): If the current path is
2364 unreachable, treat it as if all parameters/locals are initialized.
2365 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
2366 infinite loops before merging-in break origins.
2368 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
2369 (Reachability.Reachable): Split part into ...
2370 (Reachability.Unreachable): ... this. Simplify.
2371 (Reachability.IsUnreachable): Use 'Unreachable' instead.
2373 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
2374 (Reachability.SetThrowsSometimes): Likewise.
2375 (FlowBranchingBlock.MergeTopBlock): Don't compare against
2376 TriState.Always, use corresponding property.
2377 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
2378 (Block.Resolve): Likewise. Remove some redundant checks.
2380 2006-05-02 Raja R Harinath <harinath@gmail.com>
2382 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
2383 (Reachability.Meet): Don't bother checking AlwaysThrows --
2384 barrier is always set.
2385 (FlowBranchingBlock.Merge): Likewise.
2387 2006-05-01 Raja R Harinath <harinath@gmail.com>
2389 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
2390 checks for unreachable.
2392 2006-05-01 Marek Safar <marek.safar@seznam.cz>
2395 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
2397 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
2398 whether field is really assigned.
2400 2006-04-30 Raja R Harinath <harinath@gmail.com>
2402 * flowanalysis.cs (Reachability): Make 4-argument constructor
2404 (Reachability.Meet): Rename from 'And'. Remove static variant.
2405 (Reachability.Always): Rename from the highly misleading
2406 'Reachability.Never'.
2407 (FlowBranching.Merge): Update to changes. Mark an impossible
2408 situation with a 'throw'.
2409 (*): Update to changes.
2411 2006-04-29 Raja R Harinath <harinath@gmail.com>
2413 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
2415 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
2416 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
2417 (*): Update to changes.
2418 * statement.cs: Update to changes.
2420 2006-04-28 Marek Safar <marek.safar@seznam.cz>
2423 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
2425 2006-04-28 Raja R Harinath <harinath@gmail.com>
2427 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
2430 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
2431 argument to two arguments: an usage-vector and a bool. Move call
2432 to FlowBranching.Merge () ...
2433 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
2435 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
2436 handling of loop and switch reachability to ...
2437 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
2439 2006-04-27 Raja R Harinath <harinath@gmail.com>
2441 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
2442 handling to FlowBranchingLoop.InLoop.
2443 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
2445 2006-04-26 Marek Safar <marek.safar@seznam.cz>
2448 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
2449 anonymous method is allowed from AnonymousContainer here.
2451 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
2453 2006-04-24 Raja R Harinath <rharinath@novell.com>
2456 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
2458 2006-04-23 Marek Safar <marek.safar@seznam.cz>
2461 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
2462 (DoubleConstant.Reduce): Ditto.
2464 2006-04-23 Raja R Harinath <rharinath@novell.com>
2466 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
2467 Remove 'lvalue_right_side' argument. Move parts to ...
2468 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
2469 (LocalVariable.DoResolveLValue): ... these.
2471 2006-04-21 Raja R Harinath <rharinath@novell.com>
2474 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
2475 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
2476 (LocalVariableReference.DoResolveBase): Use it to implement new
2478 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
2479 (Argument.Resolve): Simplify. Move CS1510 check ...
2480 * ecore.cs (Expression.ResolveLValue): ... here.
2481 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
2482 (PropertyExpr.DoResolveLValue): Likewise.
2483 (FieldExpr.Report_AssignToReadonly): Likewise.
2484 (FieldExpr.DoResolve): Add 'out_access' argument. Use
2485 LValueMemberAccess or LValueMemberOutAccess on instance depending
2487 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
2488 DoResolve as appropriate.
2490 2006-04-20 Raja R Harinath <rharinath@novell.com>
2493 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
2494 implicit conversions on 'out' and 'ref' arguments.
2496 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
2497 improve clarity. Remove dead code.
2500 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
2501 (Catch.Resolve): Resolve VarBlock if it exists.
2503 2006-04-19 Miguel de Icaza <miguel@novell.com>
2505 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
2506 twice, this was some residual code, the enumerator was emitted
2507 properly in the two branche of if later.
2509 2006-04-19 Raja R Harinath <rharinath@novell.com>
2511 * expression.cs (Cast.ResolveLValue): Remove. The result of a
2512 cast is never an lvalue.
2513 (Cast.DoResolve, Cast.ResolveRest): Combine.
2514 (Argument.Emit): Simplify slightly. Move 'Expr is
2515 IMemoryLocation' check ...
2516 (Argument.Resolve): ... here.
2517 (Argument.Error_LValueRequired): Remove. Inline into only user.
2519 Simplifications. Fix cs0191-2.cs
2520 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
2521 CS1649 and CS1651 to ...
2522 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
2523 the actual selection of the error code and message to a lookup
2524 table. Add a dummy return value to simplify callsites.
2525 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
2526 readonly fields of other instances of the same type. Move CS0197
2528 * expression.cs (Argument.Resolve): ... here. Simplify code.
2529 Ensure that ec.InRefOutArgumentResolving is only set during LValue
2530 resolution of an out or ref argument. The code simplification
2531 above uses this invariant.
2533 2006-04-18 Raja R Harinath <rharinath@novell.com>
2535 Possibly fix #77752. Fix cs1690-[4-7].cs.
2536 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
2537 CheckMarshallByRefAccess. Drop parameter.
2538 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
2540 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
2542 * report.cs (AllWarnings): Add CS1690.
2543 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
2545 (LocalVariableReference.DoResolveBase): Update.
2547 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2549 * class.cs (MethodOrOperator): Moved common parts from method class.
2550 detect obsolete attributes.
2551 (Method.Define): Simplified as it reuses code from base.
2552 (Constructor.ValidAttributeTargets): Fixed issue found during
2554 (Destructor.ValidAttributeTargets): Fixed issue found during
2556 (Operator): Finished refactoring set off by #78020. Operator class is now
2557 ordinary method class.
2559 * anonymous.cs: Updated.
2561 * decl.cs (DeclSpace): Add IsGeneric
2563 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2565 * class.cs (Constructor.Emit): Don't emit the attributes twice.
2567 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2569 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
2570 detect obsolete attributes.
2571 (Method.CreateEmitContext): Moved to MethodOrOperator.
2573 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2576 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
2577 customized exception to make crash detection easier.
2578 (MethodOrOperator): Started to work on new base class for methods and
2580 (Method): Derives from MethodOrOperator.
2581 (Constructor.Emit): Emits its own attributes.
2582 (AbstractPropertyEventMethod.Emit): Ditto.
2583 (Operator): Derives from MethodOrOperator, will refactor fully in extra
2585 (Operator.Emit): It's temporary more tricky than should be.
2587 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
2589 * report.cs (InternalErrorException): Add ctor with inner exception.
2591 2006-04-08 Marek Safar <marek.safar@seznam.cz>
2594 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
2597 2006-04-07 Marek Safar <marek.safar@seznam.cz>
2600 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
2603 2006-04-06 Marek Safar <marek.safar@seznam.cz>
2605 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
2606 attribute is present and Guid not.
2607 (Interface.ApplyAttributeBuilder): Ditto.
2609 * attribute.cs: Add error message.
2611 2006-04-06 Marek Safar <marek.safar@seznam.cz>
2615 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
2616 sources (it's composite) so hold them in extra array as they are used in
2617 Emit phase only. It worked in the previous versions by mistake.
2618 (Attribute.Emit): Emit attribute for more owners when exist.
2620 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
2621 it has now different behaviour.
2623 2006-04-04 Marek Safar <marek.safar@seznam.cz>
2625 * constant.cs (Constant.IsDefaultInitializer): New method.
2627 * class.cs: Updated.
2629 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
2630 re-initialize default values. It saves KBs almost for every assembly.
2631 Thanks Zoltan for the idea.
2632 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
2633 (ArrayCreation.DoResolve): Resolve only once.
2634 (ArrayCreation.Emit): Emit static initializer only when it is faster.
2635 (ArrayCreation.GetAttributableValue): Cope with optimized values.
2637 2006-04-03 Zoltan Varga <vargaz@gmail.com>
2639 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
2642 2006-04-01 Marek Safar <marek.safar@seznam.cz>
2644 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
2645 in an embedded statement too.
2647 2006-04-01 Raja R Harinath <rharinath@novell.com>
2650 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
2652 2006-04-01 Marek Safar <marek.safar@seznam.cz>
2656 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
2659 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
2661 2006-03-31 Marek Safar <marek.safar@seznam.cz>
2663 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
2666 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
2667 LocalTemporary change.
2669 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
2671 (ClassOrStruct.DefineFieldInitializers): Implemented static field
2672 initializers optimization.
2673 (ClassOrStruct.TypeAttr): Moved from modifiers.
2674 (Constructor.CheckBase): Don't crash when static ctor has parameters.
2675 (FieldBase.ResolveInitializer): Resolves initializer.
2676 (FieldBase.HasDefaultInitializer): New property.
2678 * cs-parser.jay: Removed message.
2680 * expression.cs (CompilerGeneratedThis): New specialization.
2682 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
2684 2006-03-28 Marek Safar <marek.safar@seznam.cz>
2686 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
2688 2006-03-27 Marek Safar <marek.safar@seznam.cz>
2690 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
2691 be now EnumConstants only.
2693 2006-03-27 Marek Safar <marek.safar@seznam.cz>
2695 * attribute.cs, driver.cs: Reset more caches.
2697 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2699 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
2701 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2703 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
2704 for easier reuse. Updated all overrides.
2705 (IntegralConstant): New base class for all integral constants.
2706 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
2707 of the constant range, report custom error.
2708 (UIntConstant.Reduce): Fixed uint conversion.
2710 * ecore.cs, literal.cs: Reduce updates.
2712 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2716 * class.cs (Constructor.Define): Removed extra if for default ctors.
2717 A patch from Atsushi Enomoto.
2719 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2721 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
2722 GetAttributableValue.
2724 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
2727 * convert.cs (ImplicitConversionRequired): Error message moved to
2730 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
2731 automatic implicit conversion of an output value.
2732 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
2734 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
2736 (TypeOf.GetAttributableValue): Add extra handling for object type.
2738 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
2739 special error message.
2741 2006-03-25 Marek Safar <marek.safar@seznam.cz>
2743 * class.cs (Constructor.Emit): Don't crash when struct ctor is
2745 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
2746 compatible with MS runtime.
2748 2006-03-23 Marek Safar <marek.safar@seznam.cz>
2750 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
2751 attribute arguments here.
2753 * class.cs (Indexer.Define): The check was moved to attribute class.
2755 2006-03-22 Marek Safar <marek.safar@seznam.cz>
2757 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
2758 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
2761 2006-03-22 Raja R Harinath <rharinath@novell.com>
2763 Support ParameterDefaultValueAttribute in gmcs. Also applied to
2764 mcs to keep code differences small.
2765 * attribute.cs (Attribute.GetParameterDefaultValue): New.
2766 * typemanager.cs (parameter_default_value_attribute_type): New.
2767 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
2770 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2772 * expression.cs (StringConcat.Append): Reverted back to no warning state.
2774 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2776 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2778 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2781 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
2783 * doc-bootstrap.cs : fix build.
2785 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2787 * expression.cs (StringConcat.Append): Issue a warning when empty string
2790 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2792 * assign.cs (CompoundAssign.ResolveSource): Removed.
2794 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2797 * class.cs (TypeContainer.FindMethods): Removed.
2798 (TypeContainer.CheckMemberUsage): Made static.
2800 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2802 * constant.cs (CheckRange): Removed unused type argument.
2803 (CheckUnsigned): Removed unused type argument.
2805 * cs-parser.jay: Updated after MemberAccess clean up.
2806 Uses Length for empty string test.
2808 * cs-tokenizer.cs: Uses Length for empty string test.
2809 (IsCastToken): Made static.
2810 (is_hex): Made static.
2811 (real_type_suffix): Made static.
2813 * decl.cs (SetupCache): Made static.
2814 (OnGenerateDocComment): Removed unused ds argument.
2816 * delegate.cs (VerifyDelegate): Removed unused argument.
2818 * doc.cs: Uses Length for empty string test.
2820 * driver.cs: Uses Length for empty string test.
2822 * enum.cs (IsValidEnumType): Made static
2824 * expression.cs (EnumLiftUp): Removed unused argument.
2825 (ResolveMethodGroup): Ditto.
2826 (BetterConversion): Ditto.
2827 (GetVarargsTypes): Ditto.
2828 (UpdateIndices): Ditto.
2829 (ValidateInitializers): Ditto.
2830 (MemberAccess.ctor): Ditto.
2831 (GetIndexersForType): Ditto.
2833 * flowanalysis.cs: (MergeFinally): Removed unused argument.
2835 * iterators.cs: Updated after MemberAccess clean up.
2837 * location.cs: Uses Length for empty string test.
2839 * namespace.cs: Uses Length for empty string test.
2841 * report.cs (CheckWarningCode): Made static.
2843 * statement.cs (LabeledStatement): Removed unused argument.
2845 * typemanager.cs (FilterNone): Removed.
2847 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2849 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2852 * class.cs: Updated.
2854 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2856 * cs-parser.jay.cs: __arglist is not allowed for delegates.
2858 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2862 * expression.cs (VerifyArgumentsCompat): Reverted to double error
2863 reporting, it's more tricky than I thought.
2865 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2869 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
2871 (AnonymousMethod.ImplicitStandardConversionExists): New method.
2872 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2873 Add more error reporting; Fixed issue with params.
2875 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2877 * cs-parser.jay: AnonymousMethod requires host container.
2879 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2881 2006-03-18 Raja R Harinath <harinath@gmail.com>
2883 * class.cs: Change 'TypeContainer ds' constructor argument to
2884 'DeclSpace parent'. Some classes were missed below due to
2885 different naming convention.
2887 * class.cs (MemberCore.Parent): Delete. This makes the
2888 ParentContainer changes below enforceable by the compiler.
2890 Treat pointers to enclosing declaration space as 'DeclSpace', not
2892 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2893 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2895 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2897 (Block.AddThisVariable): Likewise.
2898 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2899 (AbstractPropertyEventMethod.Emit): Likewise.
2900 (AbstractPropertyEventMethod.EmitMethod): Likewise.
2901 (GetMethod.Define, SetMethod.Define): Likewise.
2902 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2903 (DelegateMethod.EmitMethod): Likewise.
2905 Fix regression test-partial-13.cs.
2906 Rationalize use of PartialContainer. Ensure that the partial
2907 class semantics can be tied to type-correctness, i.e., any
2908 violation will cause a compile error.
2909 * class.cs, const.cs: Access all fields that belong to class
2910 TypeContainer via ParentContainer. Arguments of EmitContexts and
2911 Resolve()-like functions still use 'Parent'.
2913 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2914 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2915 (PropertyMethod.CheckModifiers): Remove unused argument.
2916 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2919 2006-03-17 Raja R Harinath <harinath@gmail.com>
2921 Make semantics of PartialContainer simpler.
2922 * decl.cs (DeclSpace.IsPartial): Remove.
2923 * class.cs (TypeContainer.IsPartial): Likewise.
2924 (TypeContainer..ctor): Set PartialContainer to point to self.
2925 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2926 (TypeContainer.FindNestedType): Likewise.
2927 (MemberCore.ParentContainer): Simplify. Remove deprecation.
2929 2006-03-17 Marek Safar <marek.safar@seznam.cz>
2931 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2933 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2935 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2938 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2940 * class.cs (Operator.Define): An error for base conversion was not
2943 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
2945 * iterator.cs : yield break is allowed in try statement which has
2946 catch clauses. Fixed bug #77767.
2948 2006-03-13 Marek Safar <marek.safar@seznam.cz>
2950 A fix for #77593, #77574.
2952 * class.cs (MethodCore.CheckBase): Another if for operator.
2954 2006-03-09 Marek Safar <marek.safar@seznam.cz>
2956 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2959 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2960 (DelegateCreation.ImplicitStandardConversionExists): New method for just
2963 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2966 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2967 Updated after another emitcontext usage was clean up. It should help us to
2968 synchronize with gmcs easier.
2970 2006-03-04 Marek Safar <marek.safar@seznam.cz>
2974 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2975 (Event.Define): ditto
2976 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2978 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2979 Removed redundant code and set NewSlot for Invoke method too.
2981 * parameter.cs (Parameters.ctor): Add custom, type ctor.
2982 (Parameters.MergeGenerated): New method. Use this method when you merge
2983 compiler generated argument with user arguments.
2985 2006-03-03 Marek Safar <marek.safar@seznam.cz>
2987 * attribute.cs (ResolveAsTypeTerminal): Removed.
2989 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2990 specialization for predefined types; 30% speed up.
2991 Finally placed obsolete check to right place.
2992 (Expression.ResolveType): Removed.
2994 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2995 Updated after ResolveType was removed.
2997 * expression.cs (Cast.ctor): Check void cast.
2998 (Binary.ResolveAsTypeTerminal): Is never type.
2999 (Conditional.ResolveAsTypeTerminal): Is never type.
3001 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
3003 2006-03-01 Raja R Harinath <rharinath@novell.com>
3006 * expression.cs (ParameterReference.DoResolveBase): Change return
3008 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
3012 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
3015 * typemanager.cs (GetFullNameSignature): Don't nullref on
3016 protected accessors.
3018 2006-02-27 Marek Safar <marek.safar@seznam.cz>
3020 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
3021 these two separated members to simplify the code.
3022 (Attribute.Resolve): Refactored to use new fields and methods.
3023 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
3024 implemented obsolete attribute checking.
3025 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
3026 implemented obsolete checking again. It look line never ending quest ;-)
3027 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
3029 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
3031 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
3033 *class.cs (Property.Define): Add RegisterProperty call.
3035 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
3036 argument groups (only 2).
3038 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
3039 encoding expression to arguments.
3040 (Expression.ExprClassToResolveFlags): Just turned to property.
3042 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
3043 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
3044 optimized as well as implemented support for zero-length attributes.
3046 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
3047 Add caching of PropertyInfo's.
3049 2006-02-25 Marek Safar <marek.safar@seznam.cz>
3051 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
3052 error multiple times.
3054 2006-02-25 Marek Safar <marek.safar@seznam.cz>
3056 New partial class implementation.
3057 A fix for #77027, #77029, #77403
3059 * attribute.cs (Attributable): Made attributes protected.
3061 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
3062 the replacements of ClassPart and PartialContainer.
3063 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
3064 (TypeContainer.AddInterface): Ditto.
3065 (TypeContainer.AddPartial): The main method for partial classes. It checks
3066 for errors and merges ModFlags and attributes. At the end class is added to
3068 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
3070 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
3071 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
3072 from the rest of partial classes.
3073 (TypeContainer.GetClassBases): Simplified.
3074 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
3076 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
3077 (TypeContainer.HasExplicitLayout): Uses Flags now.
3078 (PartialContainer): Removed.
3079 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
3080 (StaticClass): Was merged with Class.
3081 (Class.GetClassBases): class and static class bases are verified here.
3082 (Class.TypeAttr): Added static attributes when class is static.
3083 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
3084 (MemberBase): In some cases we need to call parent container for partial
3085 class. It should be eliminated but it's not easy now.
3087 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
3089 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
3090 partial classed to accumulate class comments.
3091 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
3093 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
3095 * driver.cs (MainDriver): Tree.GetDecl was removed.
3097 * modifiers.cs (Modifiers): Add partial modifier.
3099 * tree.cs (Tree.decl): Removed.
3100 (RootTypes): Started to use this class more often for root types
3103 2006-02-22 Marek Safar <marek.safar@seznam.cz>
3107 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
3108 external interface does not have an attribute.
3110 2006-02-22 Marek Safar <marek.safar@seznam.cz>
3112 Another prerequisites for new partial classs implementation.
3114 * attribute.cs (Attribute.Equal): Implemented.
3115 (Attribute.Emit): Changed as attributes can be applied more than twice.
3116 (Attributes.Emit): Check for duplicate attributes here.
3118 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
3119 as a parameter, clean-up.
3121 2006-02-11 Marek Safar <marek.safar@seznam.cz>
3125 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
3126 contains obsolete attribute check which can in some cases look for base
3127 type of current class which is not initialized yet.
3128 (TypeContainer.BaseType): Replacement of ptype.
3130 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
3132 2006-02-11 Marek Safar <marek.safar@seznam.cz>
3134 First of prerequisites for new partial classs implemention.
3136 * attribute.cs (Attributable): Extended by ResolveContext;
3137 Attributes finally have correct context for resolving in all cases.
3138 (AttachTo): Attribute owner is assigned here.
3140 * codegen.cs (IResolveContext): Introduce new interface to hold
3141 all information needed in resolving phase.
3142 (EmitContext): Implements IResolveContext; more clean-up needed here.
3144 * decl.cs (MemberCore): Implemented IResolveContext.
3146 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
3147 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
3148 parameter.cs, statement.cs, tree.cs, typemanager.cs:
3149 Refactored to use new IResolveContext instead of EmitContext; cleanup
3151 2006-02-06 Miguel de Icaza <miguel@novell.com>
3153 * codegen.cs (EmitScopeInitFromBlock): check here the
3154 capture_context, there is no need to make two calls to the
3157 * anonymous.cs: Add some debugging messages that might help me
3158 track other instances of this problem in the future (the
3159 regression of test 467).
3161 * cs-parser.jay: track the variable block, as we need to initalize
3162 any captured variables declared in this block for the "catch"
3163 portion of the "Try" statement.
3165 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
3166 scope initialization for captured variables.
3168 Also, move the emit for the variables after the block location has
3171 2006-02-06 Marek Safar <marek.safar@seznam.cz>
3173 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
3175 2006-02-02 Miguel de Icaza <miguel@novell.com>
3177 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
3178 commit yesterday, the initialization for the roots is necessary.
3179 What is not necessary is the scope activation.
3181 2006-02-02 Raja R Harinath <rharinath@novell.com>
3183 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
3184 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
3186 (Argument.Resolve): Remove CS0206 checks.
3188 2006-02-01 Miguel de Icaza <miguel@novell.com>
3190 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
3191 scopes for all the roots, the scopes will now be emitted when the
3192 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
3194 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
3195 code. This reduces a lot of existing cruft.
3197 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
3198 that the ScopeInfo is generated as we enter the scope, not at the
3199 time of use, which is what we used to do before.
3201 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
3202 every time a Block is about to be emitted if we have a
3205 2006-02-01 Raja R Harinath <rharinath@novell.com>
3207 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
3209 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
3211 * typemanager.cs (cons_param_array_attribute): Make private.
3212 (Reset): Set it to null.
3213 (InitCoreHelpers): Don't initialize it.
3214 (ConsParamArrayAttribute): New. Initialize it as needed.
3215 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
3217 2006-01-31 Miguel de Icaza <miguel@novell.com>
3219 * expression.cs: There might be errors reported during the
3220 selection of applicable methods. If there are errors, do not
3221 continue execution as it will lead the compiler to crash.
3223 2006-01-30 Miguel de Icaza <miguel@novell.com>
3225 * expression.cs: Member access is not allowed on anonymous
3226 methods. Fixes #77402.
3228 2006-01-30 Raja R Harinath <rharinath@novell.com>
3231 * cs-parser.jay (VariableDeclaration): Don't set
3232 current_array_type to null.
3233 (field_declaration, event_declaration, declaration_statement):
3234 Set it to null here.
3236 2006-01-28 Raja R Harinath <harinath@gmail.com>
3238 * typemanager.cs (GenericParameterPosition): New.
3241 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
3243 * doc.cs : To process "include" elements, first we should create
3244 another list than XmlNodeList, because it could result in node
3245 removal, which could result in that the XmlNodeList gives up
3248 (Also made code identical to gmcs again.)
3250 2006-01-25 Miguel de Icaza <miguel@novell.com>
3252 * ecore.cs: Introduce an error report that we were not catching
3253 before, if not silent, we must report the error. Gonzalo ran into
3256 2006-01-23 Miguel de Icaza <miguel@novell.com>
3258 A fix for bug: #76957
3260 * iterators.cs (MoveNextMethod.CreateMethodHost): call
3261 ComputeMethodHost before creating the method, this is a new
3264 * anonymous.cs (AnonymousContainer): Now we track all the scopes
3265 that this method references (RegisterScope). The actual scope
3266 where the method is hosted is computed with the ComputeMethodHost
3267 before we create the method.
3269 Moved the Deepest routine here.
3271 (AnonymousContainer.ComputeMethodHost): New routine used to
3272 compute the proper ScopeInfo that will host the anonymous method.
3274 (ScopeInfo): Deal with multiple roots. The problem was that we
3275 did not have a unique root where all ScopeInfos could be hanged
3276 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
3279 Remove AdjustMethodScope which is now computed at the end. Remove
3280 LinkScope which did a partial link, instead link all ScopeInfos
3281 before code generation from the new "LinkScopes" routine.
3283 Simplify all the Add* routines as they no longer need to maintain
3284 the tree, they just need to record that they are using variables
3287 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
3288 routines to produce the forest of ScopeInfo trees.
3290 * class.cs (TypeContainer.AppendMethod): This is just like
3291 AddMethod, but ensures that an interface implementation method
3292 (IEnumerable.XXX) is not inserted at the beginning of the queue of
3293 methods, but at the end.
3295 We use this functionality to ensure that the generated MoveNext
3296 method in the iterator class is resolved/emitted before the
3297 enumerator methods created.
3299 This is required because the MoveNext method computes the right
3300 ScopeInfo for the method. And the other methods will eventually
3301 need to resolve and fetch information computed from the anonymous
3304 2006-01-21 Raja R Harinath <harinath@gmail.com>
3305 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3308 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
3310 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
3311 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
3313 2006-01-18 Raja R Harinath <rharinath@novell.com>
3315 Fix #76656, cs0231-2.cs.
3316 * cs-parser.jay (formal_parameter_list): Make error case catch
3318 (parenthesized_expression_0): Add CS1026 check.
3319 (invocation_expression): Remove unused { $$ = lexer.Location }.
3321 2006-01-17 Raja R Harinath <rharinath@novell.com>
3324 * cs-parser.jay (statement_expression): Don't list out the
3325 individual statement-expressions. Convert syntax error into
3328 2006-01-16 Raja R Harinath <rharinath@novell.com>
3331 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
3332 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
3333 CheckIntermediateModification.
3334 (FieldExpr.DoResolve): Add new two-argument version that
3335 allows us to resolve the InstanceExpression as an lvalue.
3336 The one-argument variant is now just a wrapper.
3337 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
3338 Resolve the lhs as an lvalue if the it has a value type.
3339 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
3340 from Assign.DoResolve.
3341 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
3342 resolved as an lvalue.
3343 (PropertyExpr.DoResolve): Update.
3344 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
3345 has a value type. Move CS1612 check here from
3346 CheckIntermediateModification.
3347 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
3348 * expression.cs (EmptyExpression.OutAccess): New. Used as the
3349 'right_side' of a ResolveLValue on an 'out' argument.
3350 (EmptyExpression.LValueMemberAccess): New. Used as the
3351 'right_side' of a propagated ResolveLValue on a value type.
3352 (LocalVariableReference.DoResolveBase): Recognize
3353 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
3355 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
3356 EmptyExpression.Null.
3358 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
3360 * typemanager.cs : added IsGenericParameter(). In mcs it always
3362 * doc.cs : for generic parameters, use GenericParameterPosition,
3365 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
3367 * expression.cs: Fix Console.WriteLine ((this = x).foo);
3369 2006-01-12 Miguel de Icaza <miguel@novell.com>
3371 This fixes the problem where we used ldfld instead of ldflda to
3372 load the "THIS" pointer on captured parameters, when THIS is a
3373 value type. See bug #77205.
3375 * iterators.cs (CapturedThisReference.Emit): Pass false to
3376 EmitThis (we do not need the address).
3378 * codegen.cs (EmitThis): it needs to know whether we need the
3379 address of `this' or not. This is used by value types.
3381 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
3382 every other call passes false.
3384 2006-01-12 Raja R Harinath <rharinath@novell.com>
3387 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
3389 * expression.cs (Invocation.OverloadResolve): Update.
3390 (Invocation.DoResolve): Avoid double resolution of invocation.
3392 2006-01-11 Raja R Harinath <rharinath@novell.com>
3395 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
3396 unary negation of floating point types as 0-expr; negation cannot
3397 overflow in floating point types.
3400 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
3401 on operands of 'void' type.
3404 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
3405 and ExclusiveOr for boolean constants too.
3407 2006-01-09 Raja R Harinath <rharinath@novell.com>
3410 * expression.cs (Invocation.OverloadResolve): Replace reflected
3411 override methods with their base virtual methods, rather than
3413 * typemanager.cs (TypeManager.GetOverride): New.
3415 2006-01-05 Jb Evain <jbevain@gmail.com>
3417 * class.cs (Property.Define, Indexer.Define): do not tag the
3418 properties as SpecialName | RTSpecialName.
3420 2006-01-04 Miguel de Icaza <miguel@novell.com>
3422 * class.cs (MethodCore.IsDuplicateImplementation): This method was
3423 doing a low-level comparission of parameter types. It was lacking
3424 a check for __argslist.
3426 2005-12-30 Miguel de Icaza <miguel@novell.com>
3428 * expression.cs (ParameterReference.DoResolveBase): Allow
3429 reference parameters if they are local to this block.
3431 This allows the ref and out parameters of a delegate to be used in
3432 an anonymous method, for example:
3434 delegate void set (out int x);
3436 set s = delegate (out int x){
3440 This is used by functionality introduced late in the C# language.
3442 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
3443 method that take ref and out parameters.
3445 Fixes #77119 which was a late change in the spec.
3447 2005-12-23 Miguel de Icaza <miguel@novell.com>
3449 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
3450 parent if its the same scope. Fixes #77060.
3452 2005-12-21 Miguel de Icaza <miguel@novell.com>
3454 * driver.cs: Report the case of no source files and no -out:
3457 2005-12-20 Raja R Harinath <rharinath@novell.com>
3460 * expression.cs (ComposedCast.GetSignatureForError): Define.
3462 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3466 * namespace.cs (NamespaceEntry): Add extern_aliases as a
3467 ListDictionary, to contain the ExternAliasEntry entries (in
3468 addition to the NamespaceEntry.aliases hashtable). This field is
3469 shared between the original entry and its doppelganger (bodyless
3471 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
3472 extern_aliases field.
3473 (NamespaceEntry.Lookup): Move the IsImplicit check after the
3474 lookup in extern_aliases.
3476 2005-12-16 Raja R Harinath <rharinath@novell.com>
3479 * class.cs (TypeContainer.Mark_HasEquals): New.
3480 (TypeContainer.Mark_HasGetHashCode): New.
3481 (ClassPart): Override them.
3482 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
3485 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
3486 'parent' argument to the base constructor.
3488 Remove all mention of TypeContainer from decl.cs.
3489 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
3490 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
3491 (DeclSpace.DeclSpace): Likewise.
3492 (DeclSpace.DefineMembers): Remove unused argument.
3493 * cs-parser.jay (pop_current_class): Update to changes. Simplify
3494 debugging check -- we don't care if the debug code throws an
3495 InvalidCastException instead of an InternalErrorException.
3496 * class.cs (TypeContainer.DefineMembers): Update to changes.
3497 (TypeContainer.DoDefineMembers): Likewise.
3498 (TypeContainer.GetMethods): Likewise.
3499 (PropertyMember.Define): Likewise.
3500 (MemberBase.Parent): New property that forwards to
3501 MemberCore.Parent, but ensures that we get a TypeContainer.
3502 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
3503 (RootContext.PopulateTypes): Likewise. Remove special case code
3504 for !RootContext.StdLib: DefineMembers is idempotent.
3506 2005-12-14 Miguel de Icaza <miguel@novell.com>
3508 * convert.cs (ExplicitConversionCore): Check the return value from
3509 ExplicitConversionCore which can return null on failure. Fixes #76914
3511 2005-12-13 Marek Safar <marek.safar@seznam.cz>
3513 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
3515 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
3517 * doc.cs : The search for referenced namespace was insufficient to
3518 get global one as it used to do. Fixed bug #76965.
3520 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
3522 * doc.cs : check name in cref in the last phase that whether it is
3525 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3527 * cs-tokenizer.cs : reverted the latest change: it somehow broke
3530 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3532 * doc.cs : so it turned out that we cannot skip override check for
3533 interface members. Fixed bug #76954.
3535 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3537 * cs-tokenizer.cs : fixed bug #75984:
3538 - #warning and #error should not be handled when the source line
3540 - #line is not checked strictly when the source line is disabled.
3541 - #define and #undef is on the other hand checked strictly at any
3544 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
3546 * cs-tokenizer.cs : missing Location (actually, filename) in one of
3549 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3551 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
3553 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
3555 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
3556 (FieldBase.Initializer): Initializer is now optional.
3557 (EventField.Define): Only event field can have initializer.
3559 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
3561 * const.cs (Const): Reuse initializer.
3563 * cs-parser.jay: Updated after FieldBase changes.
3564 Added current_array_type to simplify array initializers.
3566 * ecore.cs (NullCast.IsDefaultValue): Implemented.
3568 * expression.cs, iterators.cs: Updated.
3570 * namespace.cs (NamespaceEntry): Made UsingFound private.
3572 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3574 * parameterCollection.cs: Obsolete, removed.
3575 * parser.cs: Obsolete, removed.
3577 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3580 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
3582 * enum.cs (Enum.Define): Set obsolete context here.
3584 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3587 - FindDocumentedMember() now expects 1) paramList as null
3588 when "we don't have to check the number of parameters" and
3589 2) Type.EmptyTypes when "there is no arguments".
3590 - Introduced FoundMember struct to hold the exact type which was
3591 used to find the documented member (the above change broke
3592 test-xml-044; it might be better just to use DeclaringType than
3593 what MS does, like this change does, but it depends on usage.)
3595 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3597 * doc.cs : documented member might be from DeclaringType for nested
3598 types. Fixed bug #76782.
3600 2005-12-03 Ben Maurer <bmaurer@ximian.com>
3602 * anonymous.cs: Have the param code handle leaving copies on the
3603 stack etc. Allows anonymous params to take part in the assignment
3604 code (++, +=, etc). Fixes bug #76550
3606 * expression.cs: Handle the prepare_for_load/leave_copy by passing
3607 it down to the anon code.
3609 * iterators.cs: Use dummy var here
3611 * codegen.cs: Handle new vars
3613 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3616 * class.cs (MethodData.Define): Set proper Obsolete context.
3618 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3620 (FieldExpr.DoResolve): Ditto.
3622 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3625 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3626 parent is not obsolete.
3628 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
3630 * doc.cs : (FindDocumentedMember) find parameterless members first
3631 and get CS0419 in the early stage. Fixed first case of bug #76727.
3633 2005-11-30 Marek Safar <marek.safar@seznam.cz>
3636 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3637 no error was reported.
3639 *expression.cs (Binary.DoResolve): left can be null.
3641 2005-11-22 Marek Safar <marek.safar@seznam.cz>
3644 * class.cs (MethodData.Emit): Parameters should be labeled first.
3646 2005-11-21 Marek Safar <marek.safar@seznam.cz>
3649 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3651 2005-11-18 Marek Safar <marek.safar@seznam.cz>
3653 * attribute.cs (AreParametersCompliant): Moved to Parameter.
3655 * class.cs (MethodCore): Parameter clean up.
3656 (IMethodData): Added ParameterInfo.
3657 (MethodData): Parameter clean up.
3658 (Indexer.Define): Parameter clean up.
3670 * typemanager.cs: Parameter clean up.
3672 * delegate.cs (Define): Get rid of duplicated code.
3674 * expression.cs (ParameterReference): Removed useless parameters
3676 (Invocation): Ditto.
3678 * parameter.cs (ParamsParameter): New class, params specialization.
3679 (ArglistParameter): Attemp to separate arglist.
3680 (Parameter): Refactored to be reusable and faster.
3681 (Parameter.Modifier): Made understandable.
3682 (Parameters): Changed to be used as a class for `this' assembly
3683 parameters. Refactored to use new specialized classes.
3685 * support.cs (ParameterData): Added Types property.
3686 (InternalParameters): Deleted.
3688 2005-08-20 Martin Baulig <martin@ximian.com>
3690 Merging this patch from GMCS to fix #75867.
3692 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3693 scope if we don't already have it.
3695 2005-11-17 Martin Baulig <martin@ximian.com>
3698 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3699 inherit the scope from our parent. Fixes #76653.
3701 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3703 * doc.cs : the previous patch does not actually fix the bug.
3704 PropertyInfo override check is now implemented and really fixed it.
3705 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3707 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3709 * doc.cs : apply "override filter" also to properties.
3712 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3714 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3715 no need to check overrides. For classes, omit those results from
3716 interfaces since they must exist in the class. Fixed bug #76726.
3718 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3720 * typemanager.cs : (GetFullNameSignature) differentiate indexers
3721 with different parameters. Fixed the second problem in #76685.
3723 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3725 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3726 get expected 'protected' access in CheckValidFamilyAccess()).
3729 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3731 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3732 Fixed bug #76705. CS1569 was incorrectly commented out.
3734 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3736 * doc.cs : use Invocation.IsOverride() to do real override check.
3737 * expression.cs : made Invocation.IsOverride() internal.
3739 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3741 * doc.cs : use TypeManager.FindMembers() instead of (possible)
3742 TypeBuilder.FindMembers() and filter overriden base members out.
3745 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3747 * doc.cs : ref/out parameters are represented as '@' (instead of
3748 '&' in type FullName). Fixed bug #76630 (additionally crefs).
3750 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3752 * doc.cs : when there was no '.' in cref to methods in doc comment,
3753 then parameters were missing in the output. Fixed bug #76691.
3755 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3757 * driver.cs : don't output docs when there is an error.
3760 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3763 Now it should detect indexers. Fixed primary concern in bug #76685.
3764 Fixed CS0419 message to not show the identical member signature in
3767 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3769 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3770 instead of Type.FindMembers() since it does not handle events.
3773 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
3775 * codegen.cs: Fixed typo (speficied -> specified).
3777 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3780 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3782 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3784 * attribute.cs: Changed error message.
3786 * cs-tokenizer.cs: One more check.
3788 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3790 * statement.cs (Block.Resolve): Ignore empty statement.
3792 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3794 * report.cs: Made error/warning methods more strict to avoid
3797 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3798 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3799 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3800 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3802 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3804 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3805 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3807 * class.cs (TypeContainer.IsComImport): New property.
3808 (Constructor.Define): Create proper ctor for ComImport types.
3810 * expression.cs (New.CheckComImport): Fixed.
3812 2005-11-07 Miguel de Icaza <miguel@novell.com>
3814 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3815 that a parameter has been captured does not mean that we do not
3816 have to do the rest of the processing. This fixes the second part
3817 of #76592. If there was another anonymous method capturing
3818 values in the past, the Scope would never be set for the second
3819 method that captured the same parameter.
3821 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3822 properly manipulate the stack. Second part of fix for #76592.
3824 * expression.cs (New): Add support for invoking "new" on
3825 interfaces that have been flagged with the ComImport attribute and
3826 the CoClass. Fixes #76637
3828 * statement.cs (Try.DoEmit): When a variable is captured, do not
3829 try to emit the vi.LocalBuilder variable as it has been captured.
3830 Create a temporary variable and store the results on the
3831 FieldBuilder. Fixes #76642
3833 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3835 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3837 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3839 * expression.cs (Binary.DoResolve): Added && optimalization.
3841 * typemanager.cs (AddUserType): Removed useless argument.
3843 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3845 * statement.cs (Block.variables): Uses ListDictionary.
3847 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3850 * class.cs (PartialContainer.EmitType): Customized to emit
3851 security attributes.
3852 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3853 for partial classes.
3855 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3858 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3859 access has to be fixed.
3861 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3863 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3866 * ecore.cs (NullCast.Reduce): Implemented.
3868 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3871 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3873 (Foreach.Resolve): Catch null properly.
3875 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3877 * cs-tokenizer.cs: Warning text fix.
3879 * driver.cs: AllWarningNumbers exposed on public interface.
3881 * report.cs (): Reviewed warning numbers.
3882 (IsValidWarning): Use binary search.
3884 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3886 * driver.cs: Implemeted resource visibility.
3887 (Resources): New class for code sharing between /res: and
3890 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3893 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3896 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3899 * ecore.cs (NullCast): Child is contant only.
3901 * literal.cs (NullLiteral.Reduce): null can be converted to any
3904 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3906 * driver.cs: Use Encoding.Default as default code page instead
3909 2005-10-27 Raja R Harinath <rharinath@novell.com>
3912 * expression.cs (Invocation.Error_InvalidArguments): Handle
3913 __arglist parameters.
3914 (Invocation.VerifyArgumentsCompat): Likewise.
3915 * support.cs (ReflectionParameters.GetSignatureForError): Print
3916 __arglist parameters.
3917 (InternalParamters.GetSignatureForError): Likewise.
3918 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3920 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3922 * attribute.cs (GetPropertyValue): Made public.
3924 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3926 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3928 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3931 * driver.cs: Reflect method name change.
3933 * statement.cs (Try.Resolve): Warn when try has both general
3936 * typemanager.cs: runtime_compatibility_attr_type new predefined
3939 2005-10-26 Raja R Harinath <harinath@gmail.com>
3942 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3943 treat it as an empty parameter list.
3945 2005-10-26 Raja R Harinath <rharinath@novell.com>
3948 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3949 ResolveAsTypeStep silent.
3950 * statement.cs (Block.AddConstant): Mark block as used.
3951 (Block.ResolveMeta): Avoid piling on error messages
3952 if a constant initializer resolution fails.
3954 2005-10-25 Raja R Harinath <rharinath@novell.com>
3956 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3958 (NamespaceEntry.VerifyAllUsing): New.
3959 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3960 behaviour. Delegates actual resolution of alias to ...
3961 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3962 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3964 * driver.cs (Driver.MainDriver): Update.
3966 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3967 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3969 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3971 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3972 RootNamespace.DefineNamespacesForAll.
3974 2005-10-24 Raja R Harinath <harinath@gmail.com>
3976 * typemanager.cs (assemblies, external_aliases, modules)
3977 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3978 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3979 overhead. Move resposibility ...
3980 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3981 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3983 2005-10-23 Raja R Harinath <harinath@gmail.com>
3985 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3986 cached_namespaces. Improve usage.
3987 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3988 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3989 Move from GlobalRootNamespace and simplify.
3990 (RootNamespace.Global): Make instance variable.
3991 (RootNamespace.RootNamespace): Add "alias name" parameter.
3992 (GlobalRootNamespace): Simplify drastically.
3993 (Namespace.Lookup): Don't use GetNamespace.
3994 * typemanager.cs (GetRootNamespace): Rename from
3995 ComputeNamespaceForAlias.
3996 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3998 2005-10-23 Marek Safar <marek.safar@seznam.cz>
4000 * anonymous.cs (AnonymousContainer): Don't crash when container
4003 2005-10-23 Marek Safar <marek.safar@seznam.cz>
4005 * expression.cs (Binary.DoResolve): Warn when comparing same
4008 2005-10-23 Marek Safar <marek.safar@seznam.cz>
4011 * expression.cs (Binary.DoResolve): It looks like there are no
4012 convetsion rules in enum context.
4014 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4016 Add support for extern alias qualifiers.
4017 * typemanager.cs: Move some LookupTypeReflection code
4018 to namespace.cs, to have cleaner code. Added some methods
4019 to help us keep track of the extern aliased references.
4020 * driver.cs: Add suport for extern alias assemblies on command
4021 line and check for their warnings/errors. Also keep track of the
4022 extern aliased assemblies.
4023 * namespace.cs: Move the global functionality of Namespace
4024 to GlobalRootNamespace/RootNamespace. Now the global namespace
4025 is GlobalRootNamespace.Globa. Also the code moved from
4026 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
4027 Finally added LocalAliasEntry (AliasEntry before) and
4028 ExternAliasEntry, to handle alias statements.
4029 * cs-parser.jay: Add support in the grammar for extern alias
4031 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
4032 Update callings to Namespace (now in GlobalRootNamespace).
4034 2005-10-18 Raja R Harinath <rharinath@novell.com>
4037 * class.cs (TypeContainer.DefineType): Move updating of
4038 topological sort earlier in the code.
4039 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
4041 2005-10-18 Marek Safar <marek.safar@seznam.cz>
4044 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
4046 * constant.cs (Constant.TryReduce): Moved from Cast class.
4047 (Reduce): Made little bit more OO and fixed missing conversions.
4049 * ecore.cs (Reduce): Implemented.
4050 (Binary.EnumLiftUp): New method to upgrade values to enum values.
4052 * literal.cs (Reduce): Implemented.
4054 * class.cs: Reverted Miguel's wrong commit.
4056 2005-10-14 Miguel de Icaza <miguel@novell.com>
4058 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
4060 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
4062 * cs-parser.jay, expression.cs : CS0214 was missing error location
4063 for constants. Fixed bug #76404.
4065 2005-10-11 Marek Safar <marek.safar@seznam.cz>
4068 * convert.cs (ExplicitConversionCore): Fixed object->enum
4071 2005-10-10 Raja R Harinath <rharinath@novell.com>
4073 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
4075 (PropertyExpr.EmitCall): Likewise.
4076 * expression.cs (Invocation.EmitArguments): Handle case where
4078 (Invocation.EmitCall): Avoid allocating temporary variable if
4079 there are no arguments.
4081 2005-10-07 Raja R Harinath <rharinath@novell.com>
4084 * convert.cs (ImplicitConversionStandard): Move conversion of
4085 void* to arbitrary pointer types ...
4086 (ExplicitConversionStandard): .. here.
4087 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
4088 error to always print typenames.
4090 2005-10-07 Raja R Harinath <rharinath@novell.com>
4092 * convert.cs (GetConversionOperator): Rename from
4093 GetConversionOperators. Move operator selection code from ...
4094 (UserDefinedConversion): ... here.
4096 2005-10-06 Marek Safar <marek.safar@seznam.cz>
4098 * convert.cs (ExplicitConversionCore): Removed duplicate enum
4101 2005-10-05 Marek Safar <marek.safar@seznam.cz>
4103 * assign.cs (Assign.DoResolve): Error method changed.
4105 * cfold.cs (DoConstantNumericPromotions): Error method changed.
4107 * const.cs (ResolveValue): Reset in_transit immediately.
4109 * constant.cs: Error method changed.
4111 * convert.cs: Removed useless location parameter.
4112 (ExplicitNumericConversion): Don't do double enum check.
4113 (ExplicitConversionCore): Renamed from ExplicitConversion.
4114 (ExplicitUnsafe): Extracted from ExplicitConversion.
4115 (ExplicitConversion): Uses for error reporting.
4117 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
4119 (ResolveBoolean): Uses common error method.
4120 (CastToDecimal): Get rid of ec.
4121 (CastFromDecimal): Optimized.
4122 (ConvCast): Get rid of ec.
4124 * enum.cs (ResolveValue): Reset in_transit immediately.
4125 (Emit): Return after first error.
4127 * expression.cs: Convert changes.
4129 * literal.cs: Error method changed.
4131 * statement.cs: Error method changed.
4133 2005-10-03 Raja R Harinath <rharinath@novell.com>
4135 * support.cs (SeekableStreamReader.Position): Don't error out when
4136 the requested position is just beyond the end of the current
4139 2005-09-28 Raja R Harinath <rharinath@novell.com>
4141 * support.cs (SeekableStreamReader): Simplify drastically. Don't
4142 try to keep in sync with the byte count of the underlying Stream.
4143 However, this limits us to a window size of 2048 characters: i.e.,
4144 the maximum lookahead of our lexer/parser can be 2048 characters.
4146 2005-09-28 Marek Safar <marek.safar@seznam.cz>
4149 * driver.cs: Fix compilation files with full root path.
4151 2005-09-25 Miguel de Icaza <miguel@novell.com>
4153 * report.cs (SymbolRelatedToPreviousError): Format the output so
4154 it does not use an open parenthesis that is never closed.
4156 * driver.cs: Follow coding guidelines
4158 2005-09-27 Marek Safar <marek.safar@seznam.cz>
4161 * const.cs (Const.ResolveValue): Check for assigning non-null
4162 value to reference type.
4164 2005-09-27 Marek Safar <marek.safar@seznam.cz>
4166 * anonymous.cs: Implemented ExprClassName.
4168 * assign.cs (Assign.DoResolve): Don't chrash when type is not
4171 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
4174 * class.cs (StaticClass.DefineContainerMembers): Report protected
4177 * codegen.cs: if(ed) PRODUCTION.
4179 * convert.cs (Error_CannotImplicitConversion): Better error
4182 * cs-parser.jay: More error checks.
4184 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
4186 * driver.cs (CSCParseOption): Enabled wrong option check.
4188 * ecore.cs (Expression.ExprClassName): Turned to property.
4189 (MemberExpr.CheckIntermediateModification): For checking boxed
4190 value types modification.
4192 * statement.cs (Fixed.Resolve): Expression type must be
4193 convertible to fixed type.
4194 (CollectionForeach.GetEnumeratorFilter,TryType):
4195 Small refactoring for easier error checking.
4197 2005-09-26 Marek Safar <marek.safar@seznam.cz>
4199 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
4202 * class.cs (GeneratedBaseInitializer): New class for customization
4203 compiler generated initializers.
4204 (MemberBase.DoDefine): Check Obsolete attribute here.
4205 (FieldMember.DoDefine): Ditto.
4207 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
4210 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
4211 (MemberCore.GetObsoleteAttribute): Removed argument.
4212 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
4213 (MemberCore.CheckObsoleteType): New helper.
4217 * statement.cs: Updates after MemberCore changes.
4219 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
4220 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
4222 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
4223 obsolete attribute for compiler construct.
4224 (As.DoResolve): Cache result.
4226 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
4228 2005-09-26 Raja R Harinath <rharinath@novell.com>
4231 * expression.cs (This.VerifyFixed): In a value type T, the type of
4232 'this' is T&, iow, 'this' is either an out or ref parameter. In a
4233 value type R, 'this' is treated as a value parameter.
4235 2005-09-22 Miguel de Icaza <miguel@novell.com>
4237 * statement.cs (Lock): Use the TemporaryVariable class instead of
4238 manually using local variables as those do not work when variables
4241 * ecore.cs: Moved the TemporaryVariable class from being a nested
4242 class inside Foreach to be a public class that can be employed in
4245 2005-09-19 Marek Safar <marek.safar@seznam.cz>
4247 * cs-parser.jay: interface_accessors replaced by
4248 accessor_declarations.
4250 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
4253 * statement.cs (GotoCase.Resolve): Convert null constant to
4255 (SwitchLabel.ResolveAndReduce): Ditto.
4256 (SwitchLabel.NullStringCase): Custom null stamp.
4257 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
4259 typemanager.cs (CSharpSignature): Don't skip first argument
4262 2005-09-18 Miguel de Icaza <miguel@novell.com>
4264 * driver.cs: Set InEmacs based on the environment variable EMACS.
4266 * location.cs (InEmacs): in this mode, do not report column
4267 location as it confuses Emacs.
4269 2005-09-16 Marek Safar <marek.safar@seznam.cz>
4271 * cfold.cs, constant.cs, convert.cs, ecore.cs,
4272 expression.cs, iterators.cs, literal.cs: Store constants and
4275 * class.cs (MemberBase.ShortName): Pass location.
4277 * cs-parser.jay: Some location fixes.
4279 * ecore.cs (Expression.Location): Made virtual.
4281 2005-09-05 Miguel de Icaza <miguel@novell.com>
4283 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
4284 if the underlying types are the same, otherwise we need to produce
4285 code that will do the proper cast.
4287 This was exposed by Marek's constant rewrite which produced
4288 invalid code for the call site:
4291 void Method (X v) {}
4295 This fixes test-49.cs
4297 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
4299 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
4300 Type/Object should be allowed as well. Fixed bug #75968.
4302 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
4304 * expression.cs : (Binary.DoResolve): when one is enum constant and
4305 another is constant 0, then return enum one *as enum type*.
4308 2005-09-02 Raja R Harinath <rharinath@novell.com>
4310 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4314 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4315 flow-branching for LocalVariableReferences in case we were invoked
4316 from a MemberAccess.
4317 * expression.cs (LocalVariableReference.VerifyAssigned): New.
4319 (LocalVariableReference.DoResolveBase): ... this.
4320 (MemberAccess.Resolve): Do the check that was disabled during
4323 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
4326 (PartialContainer.Create): check abstract/sealed/static strictly
4327 but abstract/sealed can exist only at one side. Fixed bug #75883.
4329 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
4332 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
4333 specified, don't default to UnmanagedType.I4.
4335 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
4337 * expression.cs : conditional operator should check possibly
4338 incorrect assign expression. Fixed bug #75946.
4340 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
4342 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
4343 Reverting the change. gmcs is much complex than mcs on this matter.
4345 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
4347 * cs-tokenizer.cs : To read another token ahead of the actual
4348 consumption, use new SavedToken and cache token instead of moving
4349 back the stream with SeekableStreamReader (it seemed problematic).
4351 driver.cs : Thus use StreamReader directly.
4352 * support.cs : Thus removed SeekableStreamReader.
4354 2005-08-30 Raja R Harinath <rharinath@novell.com>
4357 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
4358 (ScopeInfo.EmitScopeType): Use it to construct field names from
4359 names of captured locals.
4362 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
4363 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
4364 Pass 'target_type' to BoxedCast. Don't default to 'object'.
4365 (ExplicitConversion): Remove enum cases already handled by
4366 implicit conversion. Move implicit conversion check to the beginning.
4367 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
4368 * expression.cs (ArrayCreation.EmitDynamicInitializers):
4369 Don't treat System.Enum as a struct.
4371 2005-08-30 Jb Evain <jbevain@gmail.com>
4373 * attribute.cs: handles as expression in parameters.
4375 2005-08-30 Raja R Harinath <rharinath@novell.com>
4378 * class.cs (TypeContainer.VerifyClsName): Don't use a
4379 PartialContainer when verifying CLS compliance.
4380 (AbstractPropertyEventMethod): Set Parent here, ...
4381 (PropertyMethod): ... not here.
4383 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
4385 * attribute.cs : escaped attribute name should not be allowed to be
4386 resolved (e.g. @class as classAttribute). Fixed bug #75930.
4388 2005-08-29 Raja R Harinath <rharinath@novell.com>
4391 * convert.cs (ImplicitStandardConversionExists): Allow zero also
4392 when converting a long constant to unsigned long.
4393 * expression.cs (Invocation.OverloadResolve): Add sanity check to
4394 detect where IsApplicable and VerifyArgumentsCompat disagree.
4396 2005-08-29 Raja R Harinath <rharinath@novell.com>
4397 and Carlos Alberto Cortez <carlos@unixmexico.org>
4400 * class.cs (TypeContainer.CanElideInitializer): New helper.
4401 (TypeContainer.EmitFieldInitializers): Use it to determine if we
4402 can safely emitting the initializer of a field.
4404 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4406 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4407 allowed inside a switch (without loop). Fixed bug #75433.
4409 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4411 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4412 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4414 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4416 * driver.cs : kinda reverting the default encoding changes (not exact
4417 revert since I noticed that "codepage:reset" might not work fine).
4419 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4421 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4422 Location. Now getter and setter store location correctly.
4423 (errors/cs0111-12.cs now reports the expected location.)
4425 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4427 * driver.cs : Use default encoding on the environment.
4428 Removed (now that) extra parameter for SeekableStreamReader.
4429 * support.cs : (SeekableStreamReader) third .ctor() argument for
4430 StreamReader is not required (always true). preamble size could
4431 be acquired in simpler and safe way.
4433 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
4435 * cs-parser.jay: report CS0642 at warning level 3
4436 and report CS0642 for an if else statement also
4437 fixes bug #74745. Patch by John Luke (and a bit
4439 Removed extra CS0642 warning check for "while",
4441 * statement.cs: In Block.Resolve(), CS0642 check
4442 is reimplemented to check a sequence of an empty
4443 statement and a block.
4445 Both fix bug #66777.
4447 2005-08-24 Marek Safar <marek.safar@seznam.cz>
4449 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4450 detection until I fix it.
4452 * cs-tokenizer.cs: Changed error message.
4454 * cs-parser.jay: Fixed 2 error locations.
4456 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4457 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4460 * enum.cs (GetSignatureForError): Fixed.
4462 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4466 * typemanager.cs (RegisterProperty): Removed.
4468 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4470 2005-08-24 Raja R Harinath <rharinath@novell.com>
4473 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4474 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4476 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4478 * expression.cs : tiny fix is required for not warning positive ulong.
4481 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4483 * expression.cs : add CS0652 check for constant and integral
4484 expression. Fixed bug #53974.
4486 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4488 * expression.cs : in DoNumericPromotions(), check if there is implicit
4489 conversion overload for string (to check CS0034). Fixed bug #52492.
4491 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4493 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4495 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4497 * ecore.cs : report location when it is *not* Null.
4499 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4505 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4506 correctly. Fixed bug #75721.
4508 2005-08-23 Raja R Harinath <rharinath@novell.com>
4510 * support.cs (SeekableStreamReader.Position): Avoid an expensive
4511 loop that performs 'min (pos, char_count)'.
4514 * expression.cs (Unary.ResolveOperator): Don't discard implicit
4515 converted value in Operator.OnesComplement.
4517 2005-08-22 Ben Maurer <bmaurer@ximian.com>
4519 * anonymous.cs: If the anon method is pulled into a helper class,
4520 it needs to be `internal' not `private'. Fixes runtime behavior on
4523 2005-08-20 Martin Baulig <martin@ximian.com>
4525 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4526 scope if we don't already have it.
4528 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4529 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4532 2005-08-17 Marek Safar <marek.safar@seznam.cz>
4535 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4538 2005-08-16 Marek Safar <marek.safar@seznam.cz>
4540 The big constants rewrite
4541 Fix #75746, #75685 and more
4542 As a side effect saved 1MB for MWF ;-)
4544 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4545 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4546 enum based for corlib compilation.
4548 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4551 * class.cs (FixedField.Define): Use ResolveAsConstant.
4553 * const.cs (IConstant): Interface constants and enums.
4554 (Const.ResolveValue): New method for constant resolvning.
4555 (ExternalConstant): Constants from imported assemblies.
4557 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4558 conversion; like enums.
4559 (Constant.ToType): Converts this constant to different type.
4560 (Constant.Increment): Adds 1.
4562 * convert.cs (ImplicitConversionRequired): Simplified.
4564 * cs-parser.jay: Create EnumMember directly.
4566 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4568 * doc.cs (GenerateEnumDocComment): Removed.
4570 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4571 (ConvertIntLiteral): Removed.
4572 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4574 * enum.cs (EnumMember): Implement IConstant.
4575 (Enum.IsValidEnumConstant): Removed.
4576 (Enum.GetNextDefaultValue): Removed.
4577 (Enum.FindMembers): Updated.
4578 (Enum.GenerateDocComment): Iterate enum members.
4580 * expression.cs (Cast.TryReduce): Handle enums correctly.
4581 (New.Constantify): Made public.
4582 (MemberAccess.DoResolve): Removed contant specific if(s).
4584 * literal.cs (NullLiteral): Implement new abstract methods.
4586 * statement.cs (GotoCase.Resolve): Use new constant methods.
4587 (SwitchLabel.ResolveAndReduce): Use new constant methods.
4589 * typemanager.cs (LookupEnum): Removed.
4590 (IsEnumType): Fixed to work with corlib.
4591 (RegisterConstant): Removed.
4592 (LookupConstant): Removed.
4593 (GetConstant): Changed to work with IConstant.
4595 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
4597 * location.cs : Fixed overflown (>255) column number.
4599 2005-08-03 Raja R Harinath <rharinath@novell.com>
4601 First cut of the qualified-alias-member feature.
4602 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4604 * cs-parser.jay (DOUBLE_COLON): New token.
4605 (namespace_or_type_name): Add rule for recognizing
4606 qualified-alias-members.
4607 (primary_expression): Likewise.
4608 (element_access): Allow QualifiedAliasMember as a possible
4609 type-bearing expression.
4610 (local_variable_type, local_variable_pointer_type): Likewise.
4611 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
4612 aliases in the current and enclosing namespace declarations.
4613 (NamespaceEntry.UsingAlias): Add CS0440 warning.
4614 * decl.cs (MemberName.is_double_colon): New.
4615 (MemberName.MemberName): Add new constructor for alias-member.
4616 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4617 * expression.cs (QualifiedAliasMember): New expression type.
4619 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4621 * location.cs : it borked when no argument was specified.
4623 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4625 * location.cs : tiny ToString() format fix.
4627 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4629 * statement.cs : oops, it was missing.
4631 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4633 A set of fixes for precise line/column location.
4636 "token" field now holds a file/line "delta", a line number offset
4637 from the segment, and a column number. See also:
4638 http://lists.ximian.com/pipermail/mono-devel-list/2004-
4639 December/009508.html
4640 Removed static IsNull. Use instance IsNull property instead.
4642 For some tokens it stores Location. For Identifier it stores
4643 LocatedToken which is a pair of string name and location.
4644 Column numbers are adjusted only at getChar().
4646 Use Location.ToString() for reporting (it now contains column).
4648 Largely modified to use LocatedToken instead of
4649 string (IDENTIFIER), and to acquire Location from some tokens.
4650 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4651 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4653 Now MemberName holds Location. DeclSpace.ctor() receives Location
4654 as a parameter. Removed extra parameters to all derived classes.
4655 Replaced Location.IsNull() with instance property.
4656 * assign.cs, expression.cs :
4657 Added .ctor() overload that omits Location.
4659 Added "nameEscaped" flag that indicates the identifier was escaped
4660 in the source file. This fixes bug #57047.
4662 2005-08-02 Marek Safar <marek.safar@seznam.cz>
4664 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4665 New method, looking for lo-case imported cls type.
4667 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4670 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4672 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4674 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4676 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4678 Optimized to save 3.5 MB for SWF compilation.
4680 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4682 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4683 (PartialContainer.Create): Moved logic AddToContainer.
4684 (PartialContainer.MarkForDuplicationCheck): Shares name.
4686 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4689 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4691 (Namespace.GetSignatureForError): New method.
4693 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4694 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4696 2005-08-01 Raja R Harinath <rharinath@novell.com>
4699 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4700 member lookup rather than qualifier_type, since qualifier_type can
4703 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4705 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4708 2005-07-31 Miguel de Icaza <miguel@novell.com>
4710 * statement.cs: Copy the local exception into the exception
4711 captured local. Fixes 75674
4713 2005-07-31 Raja R Harinath <harinath@gmail.com>
4716 * expression.cs (Invocation.OverloadResolve): Don't report error
4717 CS1501 if error CS1502 has been reported.
4718 (New.DoResolve): Delegate CS1501 reporting to
4719 Invocation.OverloadResolve.
4722 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4723 invariant-meaning-in-block property in an enclosing block if
4726 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4728 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4729 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4730 (Switch.CheckSwitch): Just save 50kb for SWF.
4732 2005-07-27 Martin Baulig <martin@ximian.com>
4734 * anonymous.cs (CaptureContext.AddField): Added
4735 `AnonymousContainer am' argument; compute its toplevel scope if
4736 it's not already computed. Fixes #75649.
4738 2005-07-26 Raja R Harinath <rharinath@novell.com>
4741 * class.cs (Constructor.Emit): Reset block to null if the block
4744 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4746 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4748 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4750 * class.cs (MethodData.Define): Check whether accessor implementing
4751 interface is public.
4753 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4755 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4758 * namespace.cs (LookupType): Moved same type check to...
4760 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4763 2005-07-21 Raja R Harinath <rharinath@novell.com>
4765 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4766 already found a typebuilder.
4767 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4768 MemberNames, not strings.
4770 * const.cs (Error_ExpressionMustBeConst):
4771 Rename from Error_EpressionMustBeConst.
4772 * const.cs, class.cs, statement.cd: Update.
4774 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4778 * const.cs (Const.LookupConstantValue): Report missing contant expression
4780 (Error_EpressionMustBeConstant): Only one error method.
4782 * class.cs, statement.c: Updated.
4784 2005-07-20 Raja R Harinath <rharinath@novell.com>
4786 * statement.cs (Block.Flags): Add back HasVarargs.
4787 (Block.flags): Make protected.
4788 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4790 * typemanager.cs (types, typecontainers, user_types): Remove.
4791 (UserTypes, TypeContainers): Likewise.
4792 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4793 (CleanUp, Reset): Update.
4794 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4795 (GetNestedType): Use Type.GetNestedType.
4796 (CoreLookupType): Take two arguments, the namespace and the
4797 basename of the type. Update to use the Namespace.Lookup
4799 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4800 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4801 string concatenation and substring matches.
4802 * class.cs, enum.cs, delegate.cs: Update to changes.
4804 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4806 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4807 Expression and made virtual.
4809 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4810 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4812 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4814 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4817 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4820 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4823 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4824 AssemblyCultureAttribute is not used on executable.
4827 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4829 2005-07-16 Raja R Harinath <rharinath@novell.com>
4832 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4833 New. Reports CS0252/CS0253.
4834 Mostly taken from preliminary patch by Duncak Mak.
4835 (Binary.DoResolveOperator): Store results of operator lookup.
4836 Use them to detect if we need to warn about unintended reference
4839 2005-07-15 Raja R Harinath <rharinath@novell.com>
4842 * namespace.cs (Namespace.Lookup): Add back location parameter.
4843 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4844 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4846 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4847 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4848 (Namespace.LookupType): ... this.
4849 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4851 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4852 purported to handle pointers.
4853 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4856 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4858 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4861 2005-07-15 Raja R Harinath <rharinath@novell.com>
4863 * namespace.cs (Namespace.Lookup): Drop location parameter.
4864 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4865 (NamespaceEntry.Lookup): ... this.
4866 (NamespaceEntry.Error_AmbiguousTypeReference):
4867 Move here from DeclSpace.
4868 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4870 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4871 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4872 Move to NamespaceEntry.
4873 * delegate.cs, expression.cs: Update to changes.
4875 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4877 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4878 CheckAttributeType and refactored.
4879 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4880 ResolveAsTypeTerminal error handling.
4881 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4883 (GetSignatureForError): Print errors in same way.
4886 * codegen.cs: Reflect attribute GetSignatureForError change.
4889 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4891 * namespace.cs (UsingEntry): Refactored to make fields private.
4894 statement.cs: Error_UnexpectedKind has extra parameter.
4896 2005-07-14 Raja R Harinath <rharinath@novell.com>
4898 * ecore.cs (IAlias): Remove.
4899 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4900 that implement the interface.
4901 * namespace.cs (Namespace): Likewise.
4902 (Namespace.declspaces): Renamed from 'defined_names'.
4903 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4904 DeclSpace instead of an IAlias.
4905 * tree.cs (Tree.AddDecl): Update.
4907 2005-07-12 Raja R Harinath <rharinath@novell.com>
4909 * statement.cs (Block.Flags); Remove HasVarargs.
4910 (Block.HasVarargs): Move to ToplevelBlock.
4911 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4912 (Block.Variables): Make protected. Initialize variable hashtable
4914 (Block.AddVariable): Update.
4915 (Block.Resolve): Update to changes.
4916 (ToplevelBlock.HasVarargs): New boolean.
4917 (ToplevelBlock.ThisVariable): Move here from Block.
4918 (ToplevelBlock.AddThisVariable): Likewise.
4919 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4920 * expression.cs (This.ResolveBase): Update to changes.
4921 (ArglistAccess.DoResolve): Likewise.
4923 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4926 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4928 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4929 not used and not used & assigned.
4930 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4932 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4935 * expression.cs (Is.DoResolve): null is never provided type.
4937 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4940 * cs-parser.jay: Less strict event error rule to catch more errors.
4942 2005-07-08 Martin Baulig <martin@ximian.com>
4944 Fix test-iter-10.cs - distinguish whether we `yield' in a property
4945 gettter (allowed) or setter (not allowed).
4947 * class.cs (Accessor): Implement IIteratorContainer.
4948 (Accessor.Yields): New public field.
4949 (PropertyBase.PropertyMethod.Define): Handle iterators on a
4953 (get_accessor_declaration, set_accessor_declaration): Set the
4954 `yields' flag on the accessor, not the property.
4955 (property_declaration): Do the iterators check on a per-accessor
4956 basis and not for the whole property.
4958 2005-07-08 Martin Baulig <martin@ximian.com>
4960 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4961 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4963 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4966 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4967 (ExtractSecurityPermissionSet): Cope with self referencing security
4968 attributes properly.
4970 * driver.cs (SetOutputFile): Made public property OutputFile.
4972 2005-07-07 Raja R Harinath <rharinath@novell.com>
4975 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4976 has_nonstatic_fields. Make into a FieldBase pointer.
4977 (TypeContainer.AddField): Add CS0282 check.
4978 (TypeContainer.EmitType): Update.
4980 2005-07-06 Miguel de Icaza <miguel@novell.com>
4982 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4983 compare if they start with __.
4985 2005-07-06 Raja R Harinath <rharinath@novell.com>
4987 * statement.cs (Switch.SwitchGoverningType): Only look at
4988 UserCasts that don't need implicit standard conversions to one of
4989 the allowed switch types (Fixes test-322.cs).
4990 (LocalInfo.Resolve): Re-enable sanity-test.
4992 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4994 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4996 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4998 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
5000 2005-07-06 Raja R Harinath <rharinath@novell.com>
5003 * ecore.cs (SimpleName.GetSignatureForError): Add.
5004 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
5005 (MemberAccess.GetSignatureForError): Add.
5007 2005-07-05 Marek Safar <marek.safar@seznam.cz>
5009 The big error and warning messages review.
5039 * typemanager.cs: Updated.
5041 * class.cs: (MethodCore.SetYields): Moved here to share.
5042 (PropertyMethod.Define): Moved iterator setup here.
5044 * iterators.cs: Add orig_method to have full access to parent
5047 2005-07-05 Raja R Harinath <rharinath@novell.com>
5049 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
5050 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
5051 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
5052 variable of struct type.
5053 * expression.cs (Unary.ResolveOperator): Update to change.
5054 (Indirection.VerifyFixed): Likewise.
5055 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
5056 (ParameterReference.VerifyFixed): Value parameters are fixed.
5057 (This.VerifyFixed): Treat 'this' as a value parameter.
5058 * statement.cs (LocalInfo.IsFixed): Remove.
5060 2005-07-01 Martin Baulig <martin@ximian.com>
5062 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
5063 `ec.EmitThis ()' to get the correct scope.
5065 2005-07-01 Martin Baulig <martin@ximian.com>
5067 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
5068 instance is a ParameterReference; fixes #75299.
5070 2005-07-01 Martin Baulig <martin@ximian.com>
5072 Reverted Marek's latest patch (r46725):
5073 - it contains structural changes which are neither mentioned in
5074 the ChangeLog nor explained anywhere; for example the additional
5075 argument of EmitContext's and Iterator's .ctor's and the
5076 TypeContainer.DefineMembers() change.
5077 - structural changes like this should go in in seperate patches
5078 and not be hidden in a huge patch which just seems to affect
5079 warnings and errors.
5080 a big and hard to understand patch.
5081 - it breaks iterators and causes regressions, for instance in
5084 2005-06-30 Raja R Harinath <rharinath@novell.com>
5087 * expression.cs (Indexers.map): Remove.
5088 (Indexers.Append): Filter out inaccessible setters and getters.
5089 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
5092 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
5094 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
5095 (FieldExpr.Emit, PropertyExpr.Emit): Update.
5096 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
5097 * expression.cs (Invocation.EmitCall): Add CS0120 check.
5099 2005-06-30 Marek Safar <marek.safar@seznam.cz>
5102 * class.cs (FieldBase.GetInitializerExpression): One more field
5105 2005-06-28 Miguel de Icaza <miguel@novell.com>
5107 * pending.cs: Do not define a proxy if the base method is virtual,
5108 it will be picked up by the runtime (bug 75270).
5110 2005-06-08 Martin Baulig <martin@ximian.com>
5112 The big Iterators rewrite :-)
5114 * iterators.cs: Rewrite this to use the anonymous methods framework.
5116 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5117 before the TypeContainers; see 2test-21.cs.
5120 (TypeContainer.DefineType): Don't create a new EmitContext if we
5121 already have one (this only happens if we're an Iterator).
5122 (TypeContainer.Define): Also call Define() on all our iterators.
5123 (Method.CreateEmitContext): Added support for iterators.
5126 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5127 (AnonymousContainer.CreateMethodHost): Moved here from
5128 AnonymousMethod and made abstract.
5129 (AnonymousContainer.CreateScopeType): New abstract method.
5130 (AnonymousContainer.IsIterator): New public property.
5131 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5132 get the ScopeTypeBuilder rather than manually defining it here.
5133 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5136 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5137 before RootContext.DefineTypes().
5139 * codegen.cs (EmitContext.RemapToProxy): Removed.
5140 (EmitContext.CurrentAnonymousMethod): Changed type from
5141 AnonymousMethod -> AnonymousContainer.
5142 (EmitContext.ResolveTopBlock): Protect from being called twice.
5143 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5144 (EmitContext.EmitThis): Removed the iterators hacks; use the
5145 anonymous methods framework for that.
5148 (ToplevelBlock.Container): Make this a property, not a field.
5149 (ToplevelBlock.ReParent): New public method; move the
5150 ToplevelBlock into a new container.
5151 (Foreach.TemporaryVariable): Simplify.
5153 2005-06-05 Martin Baulig <martin@ximian.com>
5155 * statement.cs (LocalInfo.CompilerGenerated): New flag.
5156 (Block.AddTemporaryVariable): New public method; creates a new
5157 `LocalInfo' for a temporary variable.
5158 (Block.EmitMeta): Create the LocalBuilders for all the temporary
5160 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5161 non-iterator variables.
5163 2005-06-05 Martin Baulig <martin@ximian.com>
5165 * statement.cs (Foreach.TemporaryVariable): Create the
5166 LocalBuilder in the Emit phase and not in Resolve since in some
5167 situations, we don't have an ILGenerator during Resolve; see
5168 2test-19.cs for an example.
5170 2005-06-04 Martin Baulig <martin@ximian.com>
5172 **** Merged r45395 from GCS ****
5174 The big Foreach rewrite - Part II.
5176 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5177 with `PropertyInfo ienumerator_getcurrent'.
5179 * codegen.cs (VariableStorage): Removed.
5182 (Foreach): Derive from Statement, not ExceptionStatement.
5183 (Foreach.CollectionForeach): New nested class. Moved all the code
5184 dealing with collection foreach here.
5185 (Foreach.ForeachHelperMethods): Removed.
5186 (Foreach.TemporaryVariable): Implement IMemoryLocation.
5188 2005-05-23 Martin Baulig <martin@ximian.com>
5190 * statement.cs (Try.DoResolve): Don't create a `finally' if we
5191 don't need to. Fix #75014.
5193 2005-05-20 Martin Baulig <martin@ximian.com>
5195 Merged r44808 from GMCS.
5197 * class.cs (TypeContainer.CircularDepException): Removed.
5198 (TypeContainer.DefineType): Removed the `InTransit' stuff.
5199 (TypeContainer.CheckRecursiveDefinition): Check for circular class
5200 (CS0146) and interface (CS0529) dependencies here.
5202 2005-06-21 Raja R Harinath <rharinath@novell.com>
5204 * expression.cs (Invocation.EmitCall): Fix initialization
5205 'this_call' to reflect current behaviour. Fix indentation.
5207 * convert.cs (FindMostEncompassedType): Add two trivial special
5208 cases (number_of_types == 0 || number_of_types == 1).
5209 (FindMostEncompasingType): Likewise.
5211 2005-06-17 Raja R Harinath <rharinath@novell.com>
5213 Some cleanups preparing for the fix of #75283.
5214 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
5216 (EventExpr.InstanceResolve): Likewise.
5217 (EventExpr.DoResolve): Remove redundant checks.
5219 2005-06-10 Duncan Mak <duncan@novell.com>
5221 * cs-tokenizer.cs (process_directives): New flag for controlling
5222 the processing of preprocessor directives.
5223 (x_token): After seeing a '#', return Token.NONE instead of going
5224 to handle_preprocessing_directive() when not processing
5225 directives. This avoids unnecessary processing during the token peek in
5230 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
5231 the existing error reporting methods instead of Report.Error.
5233 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
5234 after Raja's rewrite.
5236 2005-06-08 Miguel de Icaza <miguel@novell.com>
5238 * class.cs: Small fix.
5240 2005-06-08 Raja R Harinath <rharinath@novell.com>
5243 * class.cs (GetPartialBases): Fix return value check of
5246 2005-06-07 Raja R Harinath <rharinath@novell.com>
5248 Ensure that partial classes are registered in their enclosing
5249 namespace. Initial part of fix of #75160.
5250 * tree.cs (Tree.RecordDecl): Add new namespace argument.
5251 Register declspace with namespace here, not in
5252 DeclSpace.RecordDecl.
5253 * cs-parser.jay: Pass namespace to RecordDecl.
5254 * class.cs (PartialContainer.Create): Likewise.
5255 (ClassPart.DefineType): New sanity-check. Throws an exception if
5257 * decl.cs (Declspace.RecordDecl): Remove.
5258 * namespace.cs (NamespaceEntry.DefineName): Remove.
5260 2005-06-06 Marek Safar <marek.safar@seznam.cz>
5262 * rootcontext.cs: Reset TargetExt as well.
5264 2005-06-03 Raja R Harinath <rharinath@novell.com>
5266 * ecore.cs (Expression.Resolve): Emit CS0654 error when
5269 2005-06-02 Raja R Harinath <rharinath@novell.com>
5271 Fix #75080, cs0119.cs.
5272 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
5274 (Expression.Resolve): ... this. Use it. Remove bogus code
5275 allowing ExprClass.Type and ExprClass.Namespace for
5276 ResolveFlags.VariableOrValue.
5277 (Expression.Resolve) [1-argument variant]: Change default resolve
5278 flags based on language version.
5279 (Expression.Error_UnexpectedKind): Use a simple string array
5280 rather than an ArrayList.
5281 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
5283 (TypeOfVoid.DoResolve): Likewise.
5284 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
5285 flags argument -- it always has the same value.
5287 2005-05-31 Raja R Harinath <rharinath@novell.com>
5290 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
5291 Use it in the error message.
5292 * assign.cs, expression.cs, statement.cs: Update.
5294 2005-05-30 Raja R Harinath <rharinath@novell.com>
5297 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
5298 the "almostMatchedMember" case too.
5299 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
5300 that failed the accessibility checks to 'almost_match'.
5302 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
5304 * attribute.cs: Use internal MethodBuilder methods to set
5305 ExactSpelling and SetLastError on PInvoke methods, instead
5306 of passing them via charset. Fixes #75060.
5308 2005-05-27 Raja R Harinath <rharinath@novell.com>
5310 * parameter.cs (Parameter): Remove TODO comment.
5311 (Parameter.DefineParameter): Remove Location parameter.
5312 (Parameters.LabelParameters): Likewise.
5313 * class.cs (Constructor.Emit): Update to change.
5314 (MethodData.Emit): Likewise.
5315 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
5316 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5318 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
5321 Removed Parameters.Location and added Parameter.Location instead.
5322 Removed Location parameter from Emit() and GetSignature().
5329 Modified all related calls.
5331 2005-05-26 Raja R Harinath <rharinath@novell.com>
5333 Improve user-defined conversion handling.
5334 * convert.cs (GetConversionOperators): Rewrite. Return only the
5335 applicable operators.
5336 (AddConversionOperators): New. Helper for GetConversionOperators.
5337 (FindMostEncompassedType, FindMostEncompassingType): Verify that
5338 there is only one most encompassed/encompassing type.
5339 (FindMostSpecificSource, FindMostSpecificTarget): Remove
5340 "applicable operator" handling.
5341 (UserConversion): Move cache here from GetConversionOperators.
5342 Directly cache the chosen operator, rather than the whole
5344 (ExplicitNumericConversion): Fix buggy implementation of Decimal
5345 case. Allow conversion of decimal to sbyte and byte too.
5346 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5347 New static methods. Used to avoid allocating EmptyExpressions in
5350 2005-05-24 Duncan Mak <duncan@novell.com>
5352 * ecore.cs (CastFromDecimal): New class for casting a decimal to
5353 another class, used in Convert.ExplicitNumericConversion.
5354 (CastToDecimal): New class, similar to above, but casts to
5355 System.Decimal, used in Convert.ImplicitNumericConversion and also
5356 in explicit convesion from double/float to decimal.
5358 * convert.cs (ImplicitNumericConversion): Handle implicit
5359 conversions to System.Decimal.
5360 (ExplicitNumericConversion): handle explicit conversions to
5365 2005-05-20 Miguel de Icaza <miguel@novell.com>
5367 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
5368 know the type at this stage, just break through. Fixes #75008
5370 2005-05-19 Martin Baulig <martin@ximian.com>
5373 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5374 to disable error reporting.
5376 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5377 here since we don't want to report an error; see the new test-336.cs.
5379 2005-05-19 Raja R Harinath <rharinath@novell.com>
5381 * statement.cs (ToplevelBlock.GetParameterReference)
5382 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5383 Move here from class Block.
5384 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5385 * expression.cs (ParameterReference.DoResolveBase): Likewise.
5387 2005-05-18 Martin Baulig <martin@ximian.com>
5392 (FlowBranching.Reachability): Add non-static public And() and Or()
5394 (FlowBranchingSwitch): New class; do the `break_origins' thing
5395 like in FlowBranchingLoop.
5396 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5397 reachability, not just locals and parameters.
5398 (FlowBranching.MergeChild): Remove some of the hacks for loop and
5399 switch; MergeBreakOrigins() now takes care of that.
5401 2005-05-18 Martin Baulig <martin@ximian.com>
5403 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5404 a loop and may leave it, reset the barrier; fixes #74974.
5406 2005-05-17 Marek Safar <marek.safar@seznam.cz>
5408 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5411 * cs-parser.jay: Catch more lexical errors.
5413 * report.cs: Add one more Error method.
5416 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5418 2005-05-17 Martin Baulig <martin@ximian.com>
5420 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5423 2005-05-16 Raja R Harinath <rharinath@novell.com>
5425 Fix test-382.cs. Emit values of decimal constants.
5426 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5428 (TypeContainer.AddField): ... this.
5429 (TypeContainer.EmitFieldInitializers): Allow the list of fields
5430 with initializers to include 'Const's.
5431 (ClassPart.RegisterFieldForInitialization): Forward to
5433 * const.cs (Const.Const): Pass initializer to base class.
5434 (Const.Define): In case of decimal constants, register them for
5435 initialization in a static constructor.
5437 2005-05-14 Martin Baulig <martin@ximian.com>
5439 * statement.cs (Block.Resolve): Correctly handle unreachable code;
5440 do not call ResolveUnreachable() on unreachable statements in
5441 here, see the comment in the source code.
5443 2005-05-13 Raja R Harinath <rharinath@novell.com>
5446 * expression.cs (BinaryResolveOperator): If one of the operands of
5447 an equality comparison is 'null' and the other is a pointer type,
5448 convert the null to a NullPointer.
5449 * convert.cs (ImplicitReferenceConversion): If the expression is a
5450 NullLiteral and the target type is a pointer type, return a
5451 NullPointer instead.
5452 (ImplicitConversionStandard): Likewise.
5454 2005-05-13 Marek Safar <marek.safar@seznam.cz>
5456 * cs-parser.jay: Set readonly context based on special constructs.
5458 * expression.cs (LocalVariableReference.DoResolveBase): Improved
5459 readonly variable error handling.
5461 * rootcontext.cs (EmitCode): Don't verify members when error
5464 * statement.cs (LocalInfo): Add reaodnly context information.
5465 (SetReadOnlyContext, GetReadOnlyContext): New methods.
5467 2005-05-13 Raja R Harinath <rharinath@novell.com>
5469 * statement.cs (Block.Resolve): Revert change below. Modify fix
5470 for #74041 to initialize 'resolved' to false only for explicit
5471 blocks. Fixes #74873.
5473 2005-05-12 Raja R Harinath <harinath@gmail.com>
5476 * typemanager.cs (unmanaged_enclosing_types): New.
5477 (IsUnmanagedType): Avoid infloops by using
5478 'unmanaged_enclosing_types' to talk with recursive invocations.
5480 2005-05-13 Martin Baulig <martin@ximian.com>
5482 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5483 instance variable, not a local. Fix #74873.
5484 (Block.ResolveUnreachable): Set it to true here.
5486 2005-05-11 Duncan Mak <duncan@novell.com>
5488 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5489 continuing to process for 'arg'.
5490 (handle_preprocessing_directive): Check the argument of the #endif
5491 directive and report error CS1025 if there are any trailing
5494 According to the C# spec, having even whitespace after the #endif
5495 directive is illegal; however, because we call arg.TrimEnd ()
5496 beforehand, we have the same behavior as csc, allowing whitespace
5497 after the directive.
5501 2005-05-11 Marek Safar <marek.safar@seznam.cz>
5505 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5506 (Constructor.GetObsoleteAttribute): Implemented correctly.
5508 2005-05-10 Martin Baulig <martin@ximian.com>
5510 * support.cs (ReflectionParameters.ParameterModifier): Use
5511 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5512 and `ParameterAttributes.In'. Fixes #74884.
5514 2005-05-10 Marek Safar <marek.safar@seznam.cz>
5516 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5518 * expression.cs (Argument.GetParameterModifier): Turned to property.
5519 (Invocation.Error_InvalidArguments): Add more descriptive errors.
5521 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5524 2005-05-09 Raja R Harinath <rharinath@novell.com>
5527 * decl.cs (MemberCache.AddMethods): Register override methods,
5528 rather than non-override methods.
5529 * typemanager.cs (RegisterOverride): New.
5530 (IsOverride): Update.
5532 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5536 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5537 recursive declaration.
5539 * statement.cs (Block.ResolveMeta): Report any error in resolving.
5541 2005-05-06 Marek Safar <marek.safar@seznam.cz>
5543 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5545 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5547 2005-05-05 Raja R Harinath <rharinath@novell.com>
5550 * decl.cs (DeclSpace.FamilyAccessible):
5551 Use TypeManager.IsNestedFamilyAccessible.
5553 Fix reopened #64812.
5554 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5557 2005-05-04 Raja R Harinath <rharinath@novell.com>
5558 Abin Thomas <projectmonokochi@rediffmail.com>
5559 Anoob V E <projectmonokochi@rediffmail.com>
5560 Harilal P R <projectmonokochi@rediffmail.com>
5563 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5564 allow access to all static members.
5566 2005-05-04 Martin Baulig <martin@ximian.com>
5568 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5570 2005-05-04 Martin Baulig <martin@ximian.com>
5574 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5575 section at the end; make things work if `default' is not the last
5578 2005-05-04 Martin Baulig <martin@ximian.com>
5582 * statement.cs (Switch): Replaced the `got_default' field with a
5583 `default_section' one.
5584 (Switch.CheckSwitch): Set `default_section' here.
5585 (Switch.Resolve): If we're a constant switch and the constant is
5586 not found, use the default section.
5588 2005-05-03 Martin Baulig <martin@ximian.com>
5590 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5592 * statement.cs (Foreach.ArrayForeach): New nested class.
5593 (Foreach.TemporaryVariable): New nested class.
5594 (Foreach.EmitArrayForeach): Removed; this is now in the new
5597 2005-05-03 Raja R Harinath <rharinath@novell.com>
5599 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5601 (VerifyPendingMethods): Revert change below.
5603 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5604 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5605 that used to trigger warning -28. Remove warning -28.
5606 * expression.cs (Invocation.OverloadResolve): Use
5607 TypeManager.IsOverride to distinguish override methods.
5610 * pending.cs (VerifyPendingMethods): If a base type implements the
5611 requested interface, don't bother checking individual methods of
5612 the base type. As a side-effect, this prevents the creation of
5613 unnecessary proxies.
5615 2005-05-02 Martin Baulig <martin@ximian.com>
5619 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5620 Also `And' the locals if the old vector is null.
5621 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5622 null; in this case we basically reset all the variables.
5624 2005-05-02 Martin Baulig <martin@ximian.com>
5628 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5629 Added `FlowBranching branching' argument; always `and' the
5630 variables instead of `or'ing them unless we're an infinite loop.
5632 * statement.cs (While.Resolve): Create a new sibling unless we're
5635 2005-05-02 Martin Baulig <martin@ximian.com>
5639 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5640 arguments; use it instead of creating a new TopLevelBlock.
5641 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5642 our ConstructorInitializer.
5645 (TopLevelBlock.TopLevelBranching): New public property.
5646 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5647 and create our `TopLevelBranching'.
5649 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5650 anonymous method host, use `block.TopLevelBranching' rather than
5651 creating a new branching.
5653 2005-04-20 Miguel de Icaza <miguel@novell.com>
5655 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5656 a ScopeInfo, if any of the current children is a child of the new
5657 entry, move those children there.
5659 2005-04-30 Martin Baulig <martin@ximian.com>
5661 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5662 at the beginning of a SwitchSection. Fix #73335.
5664 2005-04-27 Marek Safar <marek.safar@seznam.cz>
5667 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5669 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5670 (FieldExpr.DoResolve): Obsolete members are ignored for field
5673 2005-04-26 Marek Safar <marek.safar@seznam.cz>
5675 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5676 of arrays detection.
5678 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5680 (Field.VerifyClsCompliance): Volatile fields are not compliant.
5682 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5685 2005-04-25 Ben Maurer <bmaurer@ximian.com>
5687 * cs-parser.jay: Use the prefered version of -unsafe in error
5690 2005-04-22 Marek Safar <marek.safar@seznam.cz>
5692 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5695 2005-04-20 John Luke <john.luke@gmail.com>
5697 * driver.cs: fix typo in error message, --outout to --output
5699 2005-04-20 Marek Safar <marek.safar@seznam.cz>
5701 * codegen.cs (InRefOutArgumentResolving): New field.
5703 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5704 fields outside contructor.
5706 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5708 2005-04-19 Miguel de Icaza <miguel@novell.com>
5710 * anonymous.cs (CaptureContext.EmitParameterInstance): The
5711 parameter code was not completed ever, so it was not as up-to-date
5712 as local variables. Must finish it.
5714 The bug fix was to compare the Toplevel of the block, not the
5715 current block. Thanks for Ben for pointing this out.
5717 2005-04-19 Raja R Harinath <rharinath@novell.com>
5719 * decl.cs (AddMethods): Use the declaring type of the problem
5720 method to determine if we want to squash a warning.
5722 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5724 * attribute.cs: Removed debug output.
5726 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5728 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5731 2005-04-18 Raja R Harinath <rharinath@novell.com>
5734 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5735 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5736 all null comparisons against reference types.
5738 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5741 * class.cs (TypeContainer.CircularDepException) New nested
5743 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5744 (TypeContainer.DefineType): Removed error, reset InTransit before
5746 (Class.DefineType): Throw exception when is in Transit.
5747 Catch exception and report error.
5748 (Struct.DefineType): Throw exception when is in Transit.
5749 Catch exception and report error.
5750 (Interface.DefineType): Throw exception when is in Transit.
5751 Catch exception and report error.
5753 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5754 handle nested exception handlers.
5756 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5759 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5760 InFinally and InCatch storage.
5762 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5763 (Catch.Resolve): Set and Restore ec.InCatch.
5764 (Try.Resolve): Set and Restore ec.InFinally.
5765 (Try.HasCatch): True when try has catch.
5767 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5769 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5770 for the same event member, so exclude such cases from warning 419.
5773 2005-04-16 Miguel de Icaza <miguel@novell.com>
5775 * expression.cs (Binary.ResolveOperator): Apply patch from John
5776 Luke to fix bug 59864: operators &, | and ^ on enumerations
5777 require that the same enum type on both sides.
5779 * driver.cs: Add warnings to old flag usage, this is to assist
5780 people who produce Makefiles and hope that the Makefiles will be
5783 * class.cs (TypeContainer.EmitType): Moved the definition of the
5784 special $PRIVATE$ field from the resolve phase to the Emit phase.
5785 During resolve we do not know if we are a struct with
5786 HasExplicitLayout, we know this only after the attributes for the
5789 Set the FieldOffset to zero on the dummy field that we create for
5790 the class. Fixes 74590.
5792 2005-04-16 Raja R Harinath <rharinath@novell.com>
5795 * ecore.cs (PropertyExpr.resolved): New.
5796 (DoResolve): Use it to handle a case of double resolution here.
5797 Handle a case of identical-name-and-type-name.
5798 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5799 resolution by storing the results of expression resolution back
5800 into the "probes" array.
5802 2005-04-15 Raja R Harinath <rharinath@novell.com>
5804 Fix cs0208-7.cs and cs0208-8.cs.
5805 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5806 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5807 error reporting to point out the reason a struct is not unmanaged.
5809 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5811 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5812 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5814 2005-04-13 Raja R Harinath <rharinath@novell.com>
5817 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5818 IdenticalNameAndTypeName here.
5819 (EventExpr.InstanceResolve): Likewise.
5821 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5823 C# 2.0 DefaultCharSetAttribute implementation
5825 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5826 which allows us to set GlobalNamespace for every resolve.
5827 (Attribute.ResolveArguments): Cut from Resolve.
5828 (Attribute.GetCharSetValue): Returns CharSet named argument.
5829 (Attribute.DefinePInvokeMethod): Gets default charset from
5831 (GlobalAttribute.ResolveAsTypeStep): Override.
5832 (GlobalAttribute.ResolveArguments): Override.
5834 * class.cs (TypeAttr): Is protected.
5836 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5837 (ModuleClass.DefaultCharSetType): New memeber.
5838 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5840 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5841 charset from module.
5843 * delegate.cs (TypeAttr): Override.
5844 (Delegate.DefineType): Use this TypeAttr.
5846 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5847 at very early stage (before types are defined) to resolve model
5848 module attributes. It will probably not work with corlib but it
5851 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5852 charset from module.
5854 * typemanager.cs (default_charset_type): New type.
5856 2005-04-13 Raja R Harinath <rharinath@novell.com>
5858 * decl.cs (MemberCache.AddMethods): Don't warn if
5859 System.Object.Finalize has buggy MethodAttributes.
5861 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5864 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5866 * doc.cs : detect ambiguous reference to overloaded members.
5867 Fixed bug #71603. MS 1.1 csc does not detect it.
5869 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5871 * doc.cs : delegates must not be referenced with parameters.
5874 2005-04-12 Miguel de Icaza <miguel@novell.com>
5876 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5878 2005-04-10 Miguel de Icaza <miguel@novell.com>
5880 * driver.cs (MainDriver): Stop processing if the CLS stage found
5883 (CompilerCallableEntryPoint.InvokeCompiler): Always
5884 reset after execution; Take a TextWriter argument for the
5887 * report.cs: Use the error stream instead of hardcoding stderr.
5889 2005-04-09 Miguel de Icaza <miguel@novell.com>
5891 * class.cs: Reduce code paths to test, too small of an
5892 optimization to make it worth the extra testing. Always perform
5895 2005-04-08 Raja R Harinath <rharinath@novell.com>
5898 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5899 operators that had errors reported on them.
5901 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5903 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5905 (Attribute.Resolve): Add named argument type checking.
5907 * class.cs (FixedField.Define): Use IsPrimitiveType
5909 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5911 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5912 unsafe parameter types.
5914 * statement.cs (Using.ResolveExpression): Add better error description.
5916 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5918 2005-04-08 Raja R Harinath <rharinath@novell.com>
5921 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5922 AttributeUsageAttribute in the emitcontext of the attribute class,
5923 not in the emitcontext of the attributable entity it was attached to.
5924 * cs-parser.jay: Use 'current_class', not 'current_container',
5925 when creating a GlobalAttribute.
5927 2005-04-08 Alp Toker <alp@atoker.com>
5929 * pending.cs: The fix to #58413 failed to compile methods implementing
5930 interfaces with/without params modifiers and vice versa, even though
5931 params modifiers aren't part of the signature. Make the modifier check
5932 less strict as in csc.
5934 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5935 Anoob V E <projectmonokochi@rediffmail.com>
5936 Harilal P R <projectmonokochi@rediffmail.com>
5939 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5940 modifiers of pending methods.
5941 (PendingImplementation.PendingImplementation): Initialize it.
5942 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5943 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5944 with ParameterData. Add check for modifiers.
5945 * class.cs (MethodData.Define): Update to changes.
5947 2005-04-07 Raja R Harinath <rharinath@novell.com>
5949 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5951 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5953 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5956 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5959 * typemanager.cs: Registered RequiredAttributeAttribute.
5961 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5963 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5964 Warning CS0169 is back at level 3.
5965 (IMethodData.SetMemberIsUsed): New method.
5967 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5968 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5970 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5972 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5974 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5977 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5980 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5981 to avoid the problems with nested types.
5983 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5984 Anoob V.E <projectmonokochi@rediffmail.com>
5985 Harilal P.R <projectmonokochi@rediffmail.com>
5986 Raja R Harinath <rharinath@novell.com>
5989 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5991 * typemanager (GetConstructor): Make public.
5993 2005-04-05 John Luke <john.luke@gmail.com>
5994 Raja R Harinath <rharinath@novell.com>
5997 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5998 struct too. Return false quicker in a few cases.
5999 (VerifyUnManaged): Use it.
6001 2005-04-05 Raja R Harinath <rharinath@novell.com>
6004 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
6005 not 'unreachable_seen'.
6007 2005-04-04 Marek Safar <marek.safar@seznam.cz>
6009 * attribute.cs (Attribute.GetValue): Removed unused.
6011 * codegen.cs (CodeGen.TrimExt): Removed unused.
6013 * cs-parser.jay (output): Removed unused.
6015 * cs-tokenizer.cs (hex_digits): Removed unused.
6017 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
6019 * expression.cs (Indirection.LoadExprValue): Removed unused.
6020 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
6022 * iterators.cs (Iterator.param_types): Removed unused.
6024 * statement.cs (Goto.block): Removed unused.
6025 (ToplevelBlock.did): Removed unused.
6026 (Switch.ResolveConstantSwitch): Removed unused.
6028 2005-04-01 Ben Maurer <bmaurer@ximian.com>
6030 * rootcontext.cs: Allow mcs to bootstrap with the compilation
6033 2005-04-01 Raja R Harinath <rharinath@novell.com>
6035 Fix #74232 and cs0208-3.cs.
6036 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
6037 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
6038 unmanaged type. Don't use FieldBuilders when 't' is a
6039 TypeBuilder. Use ModFlags and MemberType fields.
6040 * class.cs (MemberBase.member_type): Rename from MemberType.
6041 (MemberBase.MemberType): New property. Determines member_type on
6043 (MemberBase.DoDefine): Don't initialize MemberType here.
6044 (FieldMember.Define): Likewise.
6046 2005-04-01 Marek Safar <marek.safar@seznam.cz>
6049 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
6050 Attributes are emitted there.
6052 2005-04-01 Raja R Harinath <rharinath@novell.com>
6054 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
6055 keyword in 'partial enum' too.
6056 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
6058 Report from Kamil Skalski <nazgul@omega.pl>.
6061 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
6062 have partial containers too.
6064 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
6065 in block' checks to Block.CheckInvariantMeaningInBlock.
6066 * statement.cs (Block.GetKnownVariableInfo): Make private.
6067 (Block.IsVariableUsedInChildBlock): Remove.
6068 (Block.IsVariableUsedInBlock): Likewise.
6069 (Block.CheckInvariantMeaningInBlock): New. Show location of
6070 conflicting declaration.
6071 (Block.AddVariable): Make error messages less long-winded and more
6072 specific. Show location of conflicting declaration.
6073 * parameter.cs (Parameters.Location): New readonly property.
6075 2005-03-31 Raja R Harinath <rharinath@novell.com>
6077 Clean up semantics of invoking ResolveMemberAccess.
6078 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
6079 can have an instance, ensure that we pass in a non-TypeExpression
6080 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
6081 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
6082 argument. Update to changes and simplify.
6083 (FieldExpr.Emitinstance): Remove CS0120 check.
6084 (PropertyExpr.EmitInstance): Likewise.
6085 * expression.cs (Argument.Resolve): Likewise.
6086 (Invocation.DoResolve): Update to changes in semantics of
6089 2005-03-31 Marek Safar <marek.safar@seznam.cz>
6092 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
6095 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6097 2005-03-31 Raja R Harinath <rharinath@novell.com>
6099 Fix difference in behaviour with commandline invocation.
6100 * driver.cs (Driver.Reset): New.
6101 (CompilerCallableEntryPoint): Call it.
6103 * statement.cs (If.Resolve): Avoid spurious "uninitialized
6104 variable" warnings if the boolean expression failed to resolve.
6106 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
6108 * attribute.cs: Fix the union of several permissions when some of them
6109 are unrestricted (so the result isn't an unrestricted permission set).
6112 2005-03-30 Raja R Harinath <rharinath@novell.com>
6114 * ecore.cs (MemberExpr): New class. Convert from interface
6116 (MemberExpr.ResolveMemberAccess): Refactor and move here from
6117 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
6119 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6120 (MethodGroupExpr.IsExplicitImpl): Remove.
6121 (Expression.GetFieldFromEvent): Remove.
6122 (SimpleName.MemberStaticCheck): Remove.
6123 (SimpleName.DoSimpleNameResolve): Update to changes.
6124 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6125 (MemberAccess.IdenticalNameAndTypeName): Remove.
6126 (MemberAccess.error176): Move to MemberExpr.
6127 (MemberAccess.DoResolve): Update to changes.
6128 (BaseAccess.DoResolve): Likewise.
6130 2005-03-30 Marek Safar <marek.safar@seznam.cz>
6132 C# 2.0 Conditional attribute class implementation
6134 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6135 Analyzes class whether it has attribute which has ConditionalAttribute
6136 and its condition is not defined.
6138 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6139 (Class.IsExcluded): New method. Search for at least one defined
6140 condition in ConditionalAttribute of attribute class.
6142 2005-03-30 Raja R Harinath <rharinath@novell.com>
6144 * ecore.cs (PropertyExpr): Derive from Expression, not
6145 ExpressionStatement.
6146 (PropertyExpr.EmitStatement): Remove.
6148 2005-03-29 Raja R Harinath <rharinath@novell.com>
6151 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6152 internal field "value__" of an enum be private. The examples for
6153 "value__" that I found on MSDN all used FieldAttributes.Private.
6155 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6156 Don't mention IL method attribute names.
6158 Fix #47991. Remove a TODO.
6159 * statement.cs (Block.Toplevel): Make into a field.
6160 (Block.Parameters): Move into ToplevelBlock.
6161 (Block.known_variables): Rename from child_variable_names.
6162 (Block.Block): Remove variants that take Parameters. Initialize
6163 'Toplevel' with the immediately surrounding toplevel block.
6164 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
6165 LocalInfo parameter.
6166 (Block.GetKnownVariableInfo): New.
6167 (Block.IsVariableNameUsedInChildBlock): Update.
6168 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
6169 the block, even though it may not be in scope.
6170 (Block.AddVariable): Remove Parameters parameter. Use
6171 Toplevel.Parameters instead.
6172 (Block.AddConstant): Remove Parameters parameter.
6173 (Block.GetParameterReference): Update to use Toplevel.Parameters.
6174 (Block.IsParamaterReference): Likewise.
6175 (Block.IsLocalParameter): Likewise. Simplify a lot.
6176 (ToplevelBlock.Parameters): New. Moved from Block.
6177 (ToplevelBlock.ToplevelBlock): Update to changes. Always
6178 initialize Parameters to a non-null value.
6179 * cs-parser.jay: Update to changes.
6180 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6181 simple names that mean different things in the same block. Use
6182 Block.IsVariableNameUsedInBlock.
6184 2005-03-28 Raja R Harinath <rharinath@novell.com>
6186 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6187 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6188 GetTypeHandle. It is possible for a reflected type to derive from
6189 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6190 System.Array during mscorlib compilation).
6191 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6192 contain a method_hash, don't create one either. Don't create a
6193 deep copy of the base cache's method_hash.
6194 (MemberCache.SetupCache): Rename back from DeepCopy.
6195 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6196 already initialized. If we see an override function, add its
6197 underlying base virtual function to the member_hash too.
6199 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6201 2005-03-26 Raja R Harinath <harinath@acm.org>
6204 * assign.cs (Assign.DoResolve): When the RHS of an assignment
6205 fails to resolve, ensure that the LHS is still resolved as an
6208 2005-03-25 Raja R Harinath <harinath@acm.org>
6210 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6212 (Enum.current_ec): Remove.
6213 (Enum.LookupEnumValue): Remove EmitContext argument.
6214 Just uses the one created during DefineType.
6215 (Enum.FindMembers): Update.
6216 * expression.cs (MemberAccess.DoResolve): Update.
6218 2005-03-22 Marek Safar <marek.safar@seznam.cz>
6220 * assign.cs (Assign.DoResolve): Check for CS1717 when
6221 source and target are same (uses Equals).
6223 * expression.cs (LocalVariableReference, ParameterReference,
6224 This): Implemented Equals, GetHashCode.
6226 * statement.cs (Block.GetParameterReference): Removed useless
6229 2005-03-22 Raja R Harinath <rharinath@novell.com>
6232 * statement.cs (Block.AddVariable): Ensure that we skip implicit
6233 blocks before deciding whether the error is cs0136 or cs0128.
6235 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6236 (using_alias_directive, using_namespace_directive): Pass
6237 MemberName, not an expression to Namespace.UsingAlias and
6239 (MakeName): Use the MemberName of the namespace.
6240 * namespace.cs (Namespace.MemberName): New.
6241 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6242 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6244 * decl.cs (MemberName.Name): Make readonly.
6245 (MemberName.FromDotted): New "constructor".
6246 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6247 (MemberCore.Name): Compute from MemberName on demand.
6248 (MemberCore.SetMemberName): Provide a way to change the
6250 (MemberCore.AddToContainer): Don't take a fullname parameter.
6251 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6252 fully qualified name of the container to the member name.
6253 (TypeContainer.AddToTypeContainer): Use a fully qualified name
6254 only if the type is a member of the root container.
6255 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6256 MemberName.Left rather than searching for an embedded ".".
6257 (PartialContainer.CreatePart): Update to changes in RootContext.
6258 (MemberBase.ShortName): Turn into a property. Use
6259 MemberCore.SetMemberName.
6260 (MemberBase.ExplicitInterfaceName): Remove.
6261 (MemberBase.UpdateMemberName): Remove.
6262 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6263 (PropertyBase.SetMemberName): New override.
6264 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6265 (Tree.GetDecl): New.
6266 (Tree.AllDecls): Rename from Decls.
6267 * attribute.cs, enum.cs, report.cs: Update to changes.
6268 * driver.cs (MainDriver): Use MemberName.FromDotted on
6269 RootContext.MainClass.
6271 2005-03-21 Marek Safar <marek.safar@seznam.cz>
6273 * class.cs (FixedField.Define): Check for CS1664 and more sanity
6276 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6278 2005-03-18 Marek Safar <marek.safar@seznam.cz>
6280 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6281 property accessor modifiers.
6283 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6284 fixed buffer attribute (CS1716).
6285 (PropertyMethod.HasCustomAccessModifier): When property accessor
6286 has custom modifier.
6288 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6290 (PropertyExpr.DoResolveLValue): Add CS0272.
6292 2005-03-17 Miguel de Icaza <miguel@novell.com>
6294 * convert.cs: When converting to a pointer, use the proper Conv.U
6295 or Conv.I depending on the source data type.
6297 * cs-tokenizer.cs: Make the size for large decimal constants,
6300 2005-03-17 Martin Baulig <martin@ximian.com>
6302 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6303 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6305 2005-03-17 Martin Baulig <martin@ximian.com>
6307 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6308 to bool so we can return an error condition.
6309 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6312 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
6314 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6317 2005-03-16 Raja R Harinath <rharinath@novell.com>
6319 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6320 Refactor to avoid traversing the list of assemblies, and to avoid
6321 string concatenation.
6322 * typemanager.cs (guid_attr_type): Remove.
6323 (negative_hits, pointers, references): Remove hashes.
6325 (GetConstructedType): New. Uses type_hash to handle constructed
6326 types (arrays, references, pointers).
6327 (GetReferenceType, GetPointerType): Use it.
6328 (GetNestedType): New. Uses type_hash to handle nested types of
6330 (LookupType, LookupTypeDirect): Remove.
6331 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
6332 'types' hash and LookupTypeReflection directly.
6333 (params_string, params_object): Use GetConstructedType.
6334 * namespace.cs (Namespace.cached_types): New. Cache of reflected
6336 (Namespace.Lookup): Use cached_types.
6337 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6338 provided by old TypeManager.LookupType.
6339 * rootcontext.cs (MakeFQN): Remove.
6340 * decl.cs (DeclSpace.MakeFQN): Likewise.
6341 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6342 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6343 TypeManager.GetConstructedType.
6344 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6346 2005-03-15 Marek Safar <marek.safar@seznam.cz>
6348 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
6351 * cs-parser.jay: Reports CS1527 for any namespace element.
6353 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6356 * expression.cs (ParameterReference.IsAssigned): Changed error to
6358 (Error_WrongNumArguments): Moved CS0245 detection here.
6360 * statement.cs (Return.Resolve): Add CS1622 report.
6362 2005-03-11 Marek Safar <marek.safar@seznam.cz>
6364 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6366 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
6368 * attribute.cs expression.cs: Get rid of some allocations.
6370 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
6372 * doc.cs : just eliminate the latest change.
6374 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6376 * doc.cs : commented out the latest change. It breaks xml-030.cs
6378 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6380 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6381 fail. So invoke CreateType() in FindDocumentedType().
6383 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6385 * cs-tokenizer.cs : added IsKeyword().
6386 * doc.cs : Detect keyword incorrectly used as identifier.
6387 Allow identifiers prefixed by @.
6389 2005-03-10 Marek Safar <marek.safar@seznam.cz>
6391 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6392 It caused exception in namespace resolving (again!).
6394 * class.cs (Class.ctor): Removed exit.
6395 (PropertyMethod.ctor): ditto.
6397 * codegen.cs (Codegen.Reset): Reset static data.
6398 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6400 * cs-tokenizer.cs (Cleanup): Removed.
6402 * driver.cs (GetSystemDir): Rewrote to one line command.
6403 It caused problem with unloaded dynamic modules.
6404 (UnixParseOption): Removed Exit.
6405 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6406 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6407 Now can be mcs used as library.
6409 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6412 * location.cs (Reset): Reset static data.
6414 * namespace.cs (Reset): Reset static data.
6416 * report.cs (Report.Reset): Reset static data.
6418 * rootcontext.cs (RootContext.Reset): Reset static data.
6420 * tree.cs (RootTypes.ctor): Use Location.Null
6422 * typemanager.cs (TypeManager.Reset): Reset static data.
6423 (CoreLookupType): Removed Exit.
6424 (TypeHandle.Reset): Reset static data.
6426 2005-03-10 Raja R Harinath <rharinath@novell.com>
6429 * typemanager.cs (ComputeNamespaces): Import namespaces from
6430 referenced modules too.
6432 2005-03-09 Raja R Harinath <rharinath@novell.com>
6434 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6437 2005-03-09 Raja R Harinath <rharinath@novell.com>
6439 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6440 enclosing DeclSpace. This ensures that a name-lookup populates
6441 more caches and there are fewer 'TypeExpression's. Carve out
6442 nested type lookup into ...
6443 (LookupNestedTypeInHierarchy): ... this.
6445 2005-03-09 Raja R Harinath <rharinath@novell.com>
6447 Clean up a few partial-class semantics.
6448 Fixes test-357.cs and cs1618-2.cs.
6449 * cs-parser.jay (struct_declaration): Use 'current_class' as
6450 parent of newly-created struct. Remove call to Register ().
6451 Use 'pop_current_class' to complete handing the current struct.
6452 (interface_declaration): Likewise.
6453 (class_declaration): Likewise.
6454 (enum_declaration): Use 'current_class' as parent of newly created
6456 (delegate_declaration): Likewise.
6457 (pop_current_class): New function. This is used to handle closing
6458 up the 'current_class' and 'current_container', and pointing them
6459 to the enclosing class/container.
6460 (CSharpParser): Initialize 'current_class' too.
6461 * decl.cs (MemberCore): Add check for invariant: a partial
6462 container is not a parsed entity, and thus does not enclose any
6464 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6465 (DeclSpace.BaseTypeExpr): Use it.
6466 (DeclSpace.LookupType): Add check for invariant.
6467 * class.cs (TypeContainer): Add check for invariant: a nested
6468 class should have the same NamespaceEntry as its enclosing class.
6469 (TypeContainer.EmitFieldInitializers): Make virtual.
6470 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6472 (TypeContainer.Register): Remove.
6473 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6474 null. Use TypeResolveEmitContext for resolving base types and
6475 interfaces. Move initialization of Parts.TypeBuilder here from
6477 (TypeContainer.DefineNestedTypes): ... here.
6478 (PartialContainer): Take a Namespace not a NamespaceEntry.
6479 (PartialContainer.Create): Don't use Register. Call the
6480 appropriate Add... function directly.
6481 (ClassPart): Take both the PartialContainer and the enclosing
6482 class as constructor arguments.
6483 (ClassPart.EmitFieldInitializers): Override.
6484 (ClassPart.PartFindNestedTypes): Remove.
6485 (FieldBase.GetInitializerExpression): Resolve the initializer
6486 expression in the emit context of the enclosing class.
6487 * tree.cs (RootTypes): Remove Register ().
6489 2005-03-08 Marek Safar <marek.safar@seznam.cz>
6491 * cs-parser.jay: Removed CS0134.
6493 * driver.cs: Removed CS1901.
6495 * expression.cs (SizeOf.DoResolve): Don't report CS0233
6496 for predefined types.
6498 2005-03-07 Duncan Mak <duncan@novell.com>
6500 * codegen.cs (Save): Catch UnauthorizedAccessException as
6501 well. Fixes bug #73454.
6503 2005-03-07 Marek Safar <marek.safar@seznam.cz>
6505 * cs-tokenizer.cs (xtoken): Add CS1035.
6507 * class.cs (MethodData.Define): Add CS0683.
6508 (FieldMember.ctor): Add CS0681.
6510 2005-03-07 Raja R Harinath <rharinath@novell.com>
6512 * ecore.cs (SimpleName.DoResolve): Rename from
6513 SimpleName.DoResolveAllowStatic.
6514 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6515 Pass 'intermediate' flag to MemberStaticCheck.
6516 (SimpleName.MemberStaticCheck): Skip "static check" only in case
6517 of "intermediate" lookups via MemberAccess.
6518 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
6519 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6521 2005-03-07 Raja R Harinath <rharinath@novell.com>
6524 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6525 slipped in because of variable names that are identical to a
6526 builtin type's BCL equivalent ('string String;', 'int Int32;').
6527 (PropertyExpr.EmitInstance): Likewise.
6529 2005-03-04 Marek Safar <marek.safar@seznam.cz>
6531 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6533 * report.cs (warning_ignore_table): Made public.
6535 2005-03-04 Raja R Harinath <rharinath@novell.com>
6538 * class.cs (MethodData.Emit): Pass 'container' to
6539 container.GetObsoleteAttribute instead of 'container.Parent'.
6541 2005-03-03 Marek Safar <marek.safar@seznam.cz>
6543 * cs-parser.jay: Add 1534 error test.
6545 * iterators.cs (Yield.CheckContext): Add error 1629.
6546 (Iterator.ctor): Save unsafe modifier.
6547 (MoveNextMethod.DoEmit): Restore unsafe context.
6549 * namespace.cs (UsingAlias): Better error message.
6551 2005-03-03 Dan Winship <danw@novell.com>
6553 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6554 the warning message [#73219]
6556 2005-03-03 Raja R Harinath <rharinath@novell.com>
6558 Fix compile with MCS 1.0.0.0.
6559 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6560 w_restore to not depend on string constant folding.
6562 2005-03-03 Raja R Harinath <rharinath@novell.com>
6564 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6565 CS0246 check to users who passed 'silent = false'.
6566 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6568 (SimpleName.SimpleNameResolve): Update.
6569 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6570 (MemberAccess.IdenticalNameAndTypeName): Update.
6571 * doc.cs (FindDocumentedTypeNonArray): Update.
6573 2005-03-03 Raja R Harinath <rharinath@novell.com>
6575 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6576 * parameters.cs (ComputeAndDefineParameters): Remove.
6577 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6578 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6579 Use GetParameterInfo.
6581 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6583 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6585 2005-03-02 Raja R Harinath <rharinath@novell.com>
6587 Unify DeclSpace.LookupType and DeclSpace.FindType.
6588 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6589 is in charge of defining nested types on demand.
6590 (DeclSpace.LookupType): Use it when the current_type is a
6591 TypeBuilder. Use LookupTypeDirect for reflected types.
6592 (DeclSpace.FindType): Remove.
6593 (DeclSpace.LookupInterfaceOrClass): Likewise.
6594 (DeclSpace.DefineTypeAndParents): Likewise.
6595 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6596 DeclSpace.LookupType.
6597 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6598 * typemanager.cs (LookupType): Simplify.
6599 (AddUserType): Remove type from negative_hits.
6600 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6601 * class.cs (TypeContainer.FindMembers): Move handling of nested
6603 (TypeContainer.FindMembers_NestedTypes): ... here.
6604 (TypeContainer.FindNestedType): Implement override.
6605 (ClassPart.FindNestedType): Delegate to PartialContainer.
6606 (ClassPart.PartFindNestedType): Looks up the nested types of the
6609 2005-03-02 Martin Baulig <martin@ximian.com>
6611 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6612 static constructor in static classes.
6614 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6616 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6617 sizeParamIndex is not specified.
6619 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6622 * report.cs (WarningMessage.IsEnabled): Missing null check.
6624 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6626 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6627 in the fields and not in the properties.
6629 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6631 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6634 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6636 * attribute.cs: Small refactoring (improved robustness).
6637 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6638 (ValidateGuid): Removed.
6639 (Resolve): Removed referenced to above mentioned.
6640 (GetAttributeUsage): Made private and changed to work without
6642 (GetIndexerAttributeValue): Don't crash.
6643 (GetConditionalAttributeValue): Ditto.
6644 (GetClsCompliantAttributeValue): Ditto.
6645 (ExtractSecurityPermissionSet): All attributes exceptions are
6647 (GetPropertyValue): New helper.
6648 (GetMethodImplOptions): New method.
6649 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6650 some missing properties.
6652 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6653 (Method.ApplyAttributeBuilder): Updated.
6655 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6658 2005-02-28 Raja R Harinath <rharinath@novell.com>
6661 * report.cs (Report.SymbolRelatedToPreviousError): Handle
6662 non-simple types (array, pointer, reference).
6664 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6666 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6668 * class.cs (MethodCore.IsDuplicateImplementation): Special error
6670 (Method.CheckBase): Catch wrong destructor here.
6671 (MethodData.Define): Add errors 550, 668.
6673 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6675 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6677 * pending.cs (VerifyPendingMethods): Add error 551.
6679 * typemanager.cs (CSharpName): Next error report helper.
6681 2005-02-25 Marek Safar <marek.safar@seznam.cz>
6683 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6684 attributes. Removed useless attribute double check.
6685 It saves almost 2MBs for corlib.
6687 2005-02-25 Raja R Harinath <rharinath@novell.com>
6690 * statement.cs (ExpressionStatement.Resolve): Make robust to being
6691 called twice in case of error.
6693 2005-02-23 Chris Toshok <toshok@ximian.com>
6695 Fix compiler portions of #72827.
6696 * statement.cs (Block.Emit): call Begin/EndScope on the
6697 EmitContext instead of the ILGenerator.
6699 * codegen.cs (EmitContext.BeginScope): new method, call
6700 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6702 (EmitContext.BeginScope): same, but EndScope and CloseScope
6704 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6705 offset and call the superclass's OpenScope(int) with it.
6706 (SymbolWriter.CloseScope): get the current il
6707 offset and call superclass's CloseScope(int) with it.
6709 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6711 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6712 CS1677 for out and ref as well.
6714 * class.cs (Method.Define): Add error CS1599 detection.
6716 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6718 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6720 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6722 * support.cs.cs (ModifierDesc): New helper method.
6724 2005-02-23 Raja R Harinath <rharinath@novell.com>
6725 Abin Thomas <projectmonokochi@rediffmail.com>
6726 Anoob V E <projectmonokochi@rediffmail.com>
6727 Harilal P R <projectmonokochi@rediffmail.com>
6730 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6731 MemberLookup (used for error reporting) actually returns a result.
6732 Fix error report number (122, not 112).
6734 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6735 Anoob V E <projectmonokochi@rediffmail.com>
6736 Harilal P R <projectmonokochi@rediffmail.com>
6739 * pending.cs (PendingImplementation.GetAbstractMethods):
6740 Find NonPublic members too.
6742 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6744 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6747 * class.cs (MethodCore.CheckMethodAgainstBase):
6748 Add error 239 report.
6750 2005-02-21 Raja R Harinath <rharinath@novell.com>
6753 * expression.cs (Invocation.IsApplicable): Make public.
6754 (Invocation.IsParamsMethodApplicable): Likewise.
6755 * delegate.cs (Delegate.VerifyApplicability): Don't use
6756 Invocation.VerifyArgumentCompat for parameter applicability
6757 testing. Use Invocation.IsApplicable and
6758 Invocation.IsParamsMethodApplicable.
6760 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6762 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6764 * class.cs (Operator.Define): Add error 217 report.
6766 2005-02-21 Raja R Harinath <rharinath@novell.com>
6768 * namespace.cs (UsingEntry.Resolve): Undo change below.
6770 2005-02-21 Raja R Harinath <rharinath@novell.com>
6773 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6774 disable the error message when the extended MemberLookup also
6776 (Expression.MemberLookupFinal): Update.
6777 (SimpleName.DoSimpleNameResolve): Update.
6778 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6779 Don't use MemberLookupFinal.
6780 (New.DoResolve): Update.
6781 (BaseAccess.CommonResolve): Update.
6783 2005-02-21 Raja R Harinath <rharinath@novell.com>
6786 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6787 occured previously, don't resolve again.
6789 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6792 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6793 argument. Call ResolveAttributeUsage for unresolved.
6794 when types doesn't match ctor arguments.
6796 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6797 for nested attribute classes.
6798 (Class.attribute_usage): Removed.
6799 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6800 for attribute class.
6802 * ecore.cs (IsAttribute): Removed.
6804 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6806 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6808 (attribute_types): Removed.
6809 (EmitCode): Global attributes are emited as the latest.
6811 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6813 * class.cs (EmitFieldInitializers): Don't emit field initializer
6814 for default values when optimilization is on.
6816 * constant.cs (Constant.IsDefaultValue): New property.
6818 * driver.cs: Add /optimize handling.
6822 * literal.cs: Implement new IsDefaultValue property.
6824 * rootcontext.cs (Optimize): New field, holds /optimize option.
6826 2005-02-18 Raja R Harinath <rharinath@novell.com>
6828 Fix crasher in re-opened #72347.
6829 * namespace.cs (Namespace.Lookup): Return null if
6830 DeclSpace.DefineType returns null.
6833 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6835 2005-02-18 Raja R Harinath <rharinath@novell.com>
6837 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6838 now returns null if it cannot resolve to an lvalue.
6839 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6840 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6841 returned null. Remove check for SimpleName.
6842 (EventExpr.DoResolveLValue): New.
6843 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6844 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6846 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6848 (Unary.ResolveOperator): Move CS0211 check ...
6849 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6851 (Unary.DoResolveLValue): Simplify.
6852 (AddressOf.DoResolveLValue): New.
6853 (ArrayAccess.DoResolveLValue): New.
6855 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6857 * attribute.cs (Attribute.Resolve): Add arguments casting for
6858 when types doesn't match ctor arguments.
6860 2005-02-16 Raja R Harinath <rharinath@novell.com>
6862 Fix parts of #63202.
6863 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6864 lookup of operator in base type. Ensure that all checks happen
6865 when the operator resolves to an "op_..." method.
6867 2005-02-15 Raja R Harinath <rharinath@novell.com>
6870 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6871 'ignore_cs0104' parameter. Pass it to ...
6872 (NamespaceEntry.Lookup): ... this.
6873 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6874 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6875 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6876 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6877 Update. Request that cs0104 errors be ignored.
6878 (ComposedCast.ResolveAsTypeStep): Update.
6880 2005-02-14 Raja R Harinath <rharinath@novell.com>
6883 * expression.cs (Invocation.BetterFunction): Remove support for
6884 comparing virtual functions and their overrides.
6885 (Invocation.IsOverride): New.
6886 (Invocation.OverloadResolve): Don't consider 'override' functions
6887 during candidate selection. Store them in a lookaside list.
6888 If the selected method is a 'virtual' function, use the list to
6889 find any overrides that are closer to the LHS type.
6891 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6893 * expression.cs (New.DoResolve): Add complex core type reduction.
6894 (New.Constantify): Converts complex core type syntax like 'new int ()'
6897 2005-02-14 Raja R Harinath <rharinath@novell.com>
6899 * decl.cs (EntryType.EntryType): New constructor to create an
6900 updated copy of a cache entry.
6901 (MemberCache.AddMethods): Use it.
6902 (MemberCache.ClearDeclaredOnly): Remove.
6903 (MemberCache.MemberCache): Update.
6905 2005-02-11 Miguel de Icaza <miguel@novell.com>
6907 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6908 variable. This one is represents the actual low-level declaration
6909 of the method, as opposed to the semantic level `IsStatic'.
6911 An anonymous method which is hosted into a static method might be
6912 actually an instance method. IsStatic would reflect the
6913 container, while MethodIsStatic represents the actual code
6916 * expression.cs (ParameterReference): Use the new MethodIsStatic
6917 instead of IsStatic.
6919 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6920 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6921 set on the current EmitContext.
6923 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6924 resolve our casted expression as an LValue. This triggers the
6925 proper LValue processing that is later required by Assign.
6929 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6931 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6933 C# 2.0 Fixed buffer implementation
6935 * anonymous.cs: Update after RegisterHelperClass renaming.
6937 * attribute.cs (AttributeTester.fixed_buffer_cache):
6938 Cache of external fixed buffers.
6939 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6940 implementation if field is fixed buffer else null.
6943 (TypeContainer.AddField): Accept FieldMember instead of Field.
6944 (FieldBase.IsFieldClsCompliant): Extracted code from
6945 VerifyClsCompliance descendant customization.
6946 (FixedField): New class handles fixed buffer fields.
6947 (FixedFieldExternal): Keeps information about imported fixed
6949 (IFixedField): Make access to internal or external fixed buffer
6952 * cs-parser.jay: Add fixed buffer parsing.
6954 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6957 * expression.cs (Indirection): Extended implementation to accept
6959 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6960 (ElementAccess.MakePointerAccess): Get type as parameter.
6961 (DoResolve): Add fixed buffer field expression conversion.
6962 (DoResolveLValue): Ditto.
6963 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6964 (ArrayPtr): Derives from FixedBufferPtr.
6965 (ArrayPtr.Emit): Add extra emit for array elements.
6967 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6969 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6970 for compiler generated types.
6971 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6973 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6974 and consume less memory.
6975 (Fixed.Resolve): Add fixed buffer case.
6977 * typemanager.cs (compiler_generated_attr_ctor,
6978 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6979 (HasElementType): Add our own implementation to work on every
6982 2005-02-11 Miguel de Icaza <miguel@novell.com>
6984 * anonymous.cs (CaptureContext): Track whether `this' has been
6987 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6988 only captured `this' if it was implicitly done (instance
6989 methods/variables were used).
6991 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6992 `this' must be captured.
6994 2005-01-30 Miguel de Icaza <miguel@novell.com>
6996 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6997 is null it means that there has been no need to capture anything,
6998 so we just create a sibling.
7000 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
7002 Just a partial fix. The other half is fairly elusive.
7004 2005-02-10 Raja R Harinath <rharinath@novell.com>
7006 Fix #52586, cs0121-4.cs.
7007 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
7008 and return a hashtable.
7009 (MemberCache.ClearDeclaredOnly): New.
7010 (MemberCache.MemberCache): Update to change. Make a deep copy of
7011 the method_hash of a base type too.
7012 (MemberCache.AddMethods): Adapt to having a deep copy of the base
7013 type methods. Overwrite entries with the same MethodHandle so
7014 that the ReflectedType is correct. The process leaves in base
7015 virtual functions and their overrides as distinct entries.
7016 (CacheEntry): Now a class instead of a struct. It shouldn't alter
7017 matters since it was boxed in a ArrayList before.
7018 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
7020 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
7021 case of a virtual function and its override (choose the overload
7023 (Invocation.OverloadResolve): Avoid 'override' members during
7024 'applicable_type' calculation.
7026 2005-02-09 Raja R Harinath <rharinath@novell.com>
7028 Combine two near-redundant caches.
7029 * typemanager.cs (method_params): Rename from method_internal_params.
7030 (TypeManager.GetParameterData): New. Replace
7031 Invocation.GetParameterData.
7032 (TypeManager.LookupParametersByBuilder): Remove.
7033 * expression.cs (Invocation.method_parameter_cache): Remove.
7034 (Invocation.GetParameterData): Remove.
7036 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
7039 2005-02-08 Raja R Harinath <rharinath@novell.com>
7042 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
7043 TypeManager.multicast_delegate_type is null, resolve it by looking
7044 up "System.MulticastDelegate".
7045 * rootcontext.cs (RootContext.ResolveCore): Simplify.
7047 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
7048 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
7049 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
7052 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
7053 (LabeledStatement.AddReference): New. Set 'referenced'.
7054 (Goto.Resolve): Use it.
7056 2005-02-05 John Luke <john.luke@gmail.com>
7058 * driver.cs: remove duplicate -doc line in Usage ()
7060 2005-02-04 Raja R Harinath <rharinath@novell.com>
7062 * location.cs (Location.AddFile): Fix CS2002 error report.
7064 2005-02-02 Martin Baulig <martin@ximian.com>
7066 * delegate.cs (Delegate.DefineType): Report an internal error if
7067 TypeManager.multicast_delegate_type is null. See bug #72015 for
7070 2005-02-02 Raja R Harinath <rharinath@novell.com>
7072 Fix a crasher in a variant of #31984.
7073 * const.cs (Constant.CheckBase): New override that defers the
7074 new-or-override check in case the base type hasn't been populated
7076 (Constant.Define): Ensure the new-or-override check is performed.
7078 2005-02-01 Duncan Mak <duncan@ximian.com>
7080 * const.cs (LookupConstantValue): Check that `ce' is not null
7081 before calling GetValue ().
7083 2005-02-01 Raja R Harinath <rharinath@novell.com>
7085 Fix test-334.cs (#69519).
7086 * cs-parser.jay (using_alias_directive): Pass in an expression to
7087 NamespaceEntry.UsingAlias.
7088 (using_namespace_directive): Pass in an expression to
7089 NamespaceEntry.Using.
7090 (namespace_name): Don't flatten to a string.
7091 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7092 (NamespaceEntry.AliasEntry.Resolve): Lookup using
7094 (NamespaceEntry.UsingEntry): Likewise.
7095 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7097 (NamespaceEntry.LookupForUsing): Remove.
7098 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7100 (NamespaceEntry.Lookup): Remove support for dotted names.
7102 2005-02-01 Raja R Harinath <rharinath@novell.com>
7104 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7106 (NamespaceEntry.ImplicitParent): Compute on demand.
7107 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7108 parallels the current.
7109 (NamespaceEntry.LookupForUsing): Use it.
7110 (NamespaceEntry.Lookup): If the current namespace-entry is
7111 implicit, don't search aliases and using tables.
7113 2005-02-01 Raja R Harinath <rharinath@novell.com>
7116 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7118 (TypeContainer.BaseCache): Compute on demand.
7119 (TypeContainer.FindMembers): Define constants and types if they're
7120 not already created.
7121 (FieldMember.Define): Move resetting of ec.InUnsafe before error
7123 * const.cs (Constant.Define): Make idempotent.
7125 2005-01-29 Miguel de Icaza <miguel@novell.com>
7127 * pending.cs: Produce better code (no nops produced by using Ldarg
7130 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7131 i - 1' it should be arg + 1.
7135 2005-01-28 Raja R Harinath <rharinath@novell.com>
7137 * attribute.cs (Attribute.CheckAttributeType): Make private
7139 (Attribute.ResolveType): Make virtual.
7140 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7141 handling of RootContext.Tree.Types.
7143 2005-01-27 Raja R Harinath <rharinath@novell.com>
7145 Update attribute-handling to use the SimpleName/MemberAccess
7147 * cs-parser.jay (attribute): Pass in an expression to the
7148 constructors of Attribute and GlobalAttribute.
7149 * attribute.cs (Attribute): Take an expression for the name.
7150 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
7151 passed in attribute name expression.
7152 (Attribute.CheckAttributeType): Use it.
7153 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7154 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7155 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
7156 argument to prevent error messages if the lookup fails.
7158 2005-01-27 Marek Safar <marek.safar@seznam.cz>
7160 * expression.cs (Indirection): Implemented IVariable interface
7161 to support indirection in AddressOf operator.
7162 (PointerArithmetic.Emit): Add optimalization for case where
7163 result can be precomputed.
7165 2005-01-26 Martin Baulig <martin@ximian.com>
7167 * class.cs (TypeContainer.AttributeTargets): Return the correct
7168 AttributeTargets depending on our `Kind' instead of throwing an
7169 exception; fixes #71632.
7171 2005-01-26 Marek Safar <marek.safar@seznam.cz>
7174 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7177 2005-01-25 Raja R Harinath <rharinath@novell.com>
7180 * expression.cs (MemberAccess.DoResolve): Don't complain with
7181 cs0572 when the LHS of a member access has identical name and type
7184 2005-01-25 Marek Safar <marek.safar@seznam.cz>
7187 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7189 Create custom PermissionSet only for PermissionSetAttribute.
7191 2005-01-24 Marek Safar <marek.safar@seznam.cz>
7194 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7195 delegates in static class.
7197 2005-01-24 Martin Baulig <martin@ximian.com>
7199 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7200 merging an implicit block, just use its reachability.
7202 * statement.cs (Block.Resolve): Make the unreachable code check
7203 work wrt. implicit blocks; see test-337 from #63842.
7205 2005-01-21 Alp Toker <alp@atoker.com>
7207 * cs-parser.jay: destructor_declaration's container is PartialContainer
7208 not Class when partial types are used, so use Kind prop instead of
7211 2005-01-22 Miguel de Icaza <miguel@ximian.com>
7213 * cs-parser.jay: Improve error reporting when an interface
7216 2005-01-20 Dick Porter <dick@ximian.com>
7218 * support.cs: SeekableStreamReader fix from Sandor Dobos
7219 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7220 chars are read. Fixes bug 70369.
7222 2005-01-20 Raja R Harinath <rharinath@novell.com>
7224 * cs-parser.jay (catch_clause): Simplify current_block handling
7227 2005-01-17 Miguel de Icaza <miguel@ximian.com>
7229 * convert.cs (ImplicitStandardConversionExists): Synchronize the
7230 code with ImplicitStandardConversion to handle the implicit
7231 conversion of method groups into valid delegate invocations.
7233 The problem is that in parameter handling we were using this code
7234 path. Fixes bug #64698
7236 2005-01-19 Raja R Harinath <rharinath@novell.com>
7238 * cs-parser.jay: Fix several infelicities.
7239 - Avoid assigning to the parser value stack. Code like
7240 '$3 = null' is unclean. Synthesize a value for the code block
7242 - Avoid using oob_stack for storing location information. Use ...
7243 (_mark_): ... this. New (empty) rule. Saves the current location
7245 (foreach_statement): Avoid using oob_stack for current_block
7246 handling. Use technique used in for_statement and
7247 using_statement. Synthesize a value for the code block to store
7248 additional intermediate information.
7250 2005-01-13 Miguel de Icaza <miguel@ximian.com>
7252 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7253 of a different type is only allowed to private fields of a
7254 containing type, not on fields of a base class.
7256 See test-174.cs and error cs0122-9.cs
7258 2005-01-13 Raja R Harinath <rharinath@novell.com>
7260 Fix test-335.cs (bug #58126).
7261 * cs-parser.jay (argument): Split out non-expression parts of the
7262 rule into 'non_simple_argument'.
7263 (invocation_expression): Support parenthesized invocations with
7264 multiple arguments, and with single non-simple arguments.
7266 2005-01-13 Raja R Harinath <rharinath@novell.com>
7268 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7271 2005-01-12 Raja R Harinath <rharinath@novell.com>
7273 Fix cs0038-1.cs, cs1640-6.cs.
7274 * ecore.cs (Expression.Resolve): Remove special-case for
7275 SimpleName in error-handling.
7276 (Expression.almostMatchedMembers): Relax access permission to
7278 (Expression.MemberLookupFailed): Handle duplicates in
7279 almostMatchedMembers list.
7280 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7281 * expression.cs (New.DoResolve): Report CS1540 for more cases.
7282 * typemanager.cs (GetFullNameSignature): Use the MethodBase
7283 overload if the passed in MemberInfo is a MethodBase.
7285 2005-01-12 Marek Safar <marek.safar@seznam.cz>
7288 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7289 for non-CAS & merge permission sets properly.
7291 2005-01-11 Raja R Harinath <rharinath@novell.com>
7293 Improve standard-compliance of simple name and member access
7294 resolution. Fixes bugs #52697, #57200, #67520, #69519.
7295 * ecore.cs (FullNamedExpression): New abstract base class
7296 for Namespaces and TypeExpressions.
7297 (ResolveFlags.SimpleName): Remove.
7298 (SimpleName): Remove support for dotted names.
7299 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
7300 DeclSpace.FindType and DeclSpace.LookupType.
7301 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7302 (Expression.ExprClassName): Make member function.
7303 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7304 a namespace. Remove creation of dotted "SimpleName"s.
7305 (MemberAccess.DoResolve): Likewise.
7306 * decl.cs (DeclSpace.Cache): Make private.
7307 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7308 (DeclSpace.FindType): Update.
7309 (DeclSpace.LookupType): Move here from RootContext. Return a
7310 FullNamedExpression.
7311 * namespace.cs (Namespace): Derive from FullNamedExpression
7312 so that it can be part of expression resolution.
7313 (Namespace.Lookup): Return an FullNamedExpression.
7314 (NamespaceEntry.LookupAlias): Lookup aliases only in current
7316 * rootcontext.cs (NamespaceLookup): Remove.
7317 (LookupType): Move to DeclSpace.
7318 * attribute.cs (CheckAttributeType): Update.
7319 * doc.cs (FindDocumentedType): Remove allowAlias argument.
7320 (FindDocumentedTypeNonArray): Likewise.
7322 2005-01-11 Raja R Harinath <rharinath@novell.com>
7324 Fix cs0509.cs, cs1632.cs.
7325 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7326 is the same as IsInterface.
7327 (TypeContainer.GetClassBases): Likewise.
7328 * statement.cs (LabeledStatement.ig): New field.
7329 (LabeledStatement.LabelTarget): Save ILGenerator which created the
7331 (LabeledStatement.DoEmit): Check that the label was created with
7332 the same ILGenerator.
7334 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7337 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7338 accessors to its properties.
7340 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7341 from accessors to property.
7343 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7346 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7349 2005-01-08 Miguel de Icaza <miguel@ximian.com>
7351 * attribute.cs: Check for null and empty strings.
7353 I have lost another battle to Paolo.
7355 2005-01-07 Marek Safar <marek.safar@seznam.cz>
7358 * class.cs (PropertyMethod): Set Parent field in ctors.
7359 (SetMethod.InternalParameters): Add unsafe switch hack.
7360 Override MarkForDuplicationCheck where it is appropriate.
7362 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7363 It says whether container allows members with the same name.
7365 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7366 Removed is_method parameter.
7368 2005-01-06 Duncan Mak <duncan@ximian.com>
7370 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7371 because the previous change led to incorrect reporting of CS1032
7372 ("Cannot define/undefine preprocessor symbols after first token in
7373 file"). Instead of using `tokens_seen' as the only flag that
7374 triggers CS1040, introduce `comments_seen'. This new flag is used
7375 to signify having seen comments on the current line, so it is
7376 unset after a newline.
7378 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7380 * doc.cs : When searching for a type, find nested type too.
7381 This fixes bug #71040.
7383 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7386 - Warn missing member comment on those classes which also does not
7387 have doc comments. Fixed bug #71041.
7388 - Don't warn missing doc comment on default constructor.
7391 2005-01-06 Duncan Mak <duncan@ximian.com>
7393 * cs-tokenizer.cs (xtoken): After handling traditional C-style
7394 comments, set `tokens_seen' to true. This allows us to detect
7395 misplaced preprocessor directives (i.e. not at the beginning of
7396 the a line, nor after whitespaces). In that case, report error
7397 CS1040. This fixes bug #56460.
7399 * cs-parser.jay (interface_member_declaration): Add checks for
7400 IsExplicitImpl, and report CS0541 error if an interface member is
7401 defined as an explicit interface declaration.
7403 2005-01-06 Marek Safar <marek.safar@seznam.cz>
7406 * class.cs (PropertyMethod): Set Parent field in ctors.
7407 (SetMethod.InternalParameters): Add unsafe switch hack.
7409 * decl.cs (MemberCore.Parent): Cannot be readonly.
7411 2005-01-06 Raja R Harinath <rharinath@novell.com>
7413 * decl.cs (DeclSpace.ResolveType): Remove.
7414 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7415 Merge in code from ...
7416 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
7417 * class.cs, enum.cs: Update to changes.
7419 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7421 * anonymous.cs: Ensure that we init the scope of our parent if it
7422 has not been initialized yet.
7424 2004-12-30 Duncan Mak <duncan@ximian.com>
7426 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7427 if field.FieldBuilder is null. Fixes #70758.
7429 * convert.cs: Fixed some typos and updated some of the comments.
7430 (ImplicitStandardConversionExists):
7431 (TryImplicitIntConversion): If `target_type' is an interface and
7432 the type of `ic' implements this interface, return true or a new
7433 BoxedCast instead of null. This fixes #70468.
7435 2004-12-29 Duncan Mak <duncan@ximian.com>
7437 * expression.cs (Argument.Emit): Check that Expr is
7438 IMemoryLocation before casting to it, and report CS1510 otherwise.
7442 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7444 * statement.cs (Block.ThisVariable): remove the recursion here, to
7445 make the --profile more sane.
7447 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7449 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7450 assembly, by JB Evain.
7452 2004-12-17 Raja R Harinath <rharinath@novell.com>
7454 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7455 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7456 "parent" refers to enclosing type/class. "base" refers to superclass.
7458 2004-12-17 Raja R Harinath <rharinath@novell.com>
7460 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7461 Ensure that we only have GlobalAttributes.
7462 * attribute.cs (Attribute.Emit): Make non-virtual.
7463 (GlobalAttribute.Emit): Remove.
7464 (Attribute.Resolve): Make virtual.
7465 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7466 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7467 the argument. Don't create one.
7468 (Attribute.GetObsoleteAttribute): Likewise.
7469 (Attribute.GetClsCompliantAttributeValue): Likewise.
7470 * class.cs, decl.cs: Update to changes.
7472 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7474 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7476 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7478 * statement.cs (Foreach.Resolve): Add error 186 report.
7480 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7482 * expression.cs (Conditional.DoResolve): Add warning 429.
7484 * statement.cs (If.Resolve): Add warning 665.
7486 2004-12-16 Raja R Harinath <rharinath@novell.com>
7488 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7489 except when in the parser, and in GlobalAttribute.
7490 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7491 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7492 RootContext.Tree.Types.NamespaceEntry once work is done.
7493 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7494 and resets RootContext.Tree.Types.NamespaceEntry.
7496 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7498 * cs-parser.jay: Don't create a block for every variable.
7500 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7502 * location.cs: Provide extra information.
7504 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7505 variables from the captured environment, it is the ldarg_0.
7507 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7509 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7512 * class.cs: Changed warning level for 169 to avoid developer
7513 displeasure from warning flooding. It will be changed back when they
7514 fix most of current BCL warnings.
7516 * RootContext.cs: Pushed default WarningLevel to 3.
7518 * statement.cs: Removed unused variable.
7520 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7522 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7523 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7524 Add error 502 report.
7525 (StaticClass.DefineType): Add error 441 report.
7526 (Class.AllowedModifiersProp): New virtual property as temporary
7527 extension to AllowedModifiers.
7528 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7529 to share implementation with StaticClass and don't call virtual
7532 * driver.cs (MainDriver): Add error 1558 test.
7534 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7535 report. Moved error 36 test here.
7537 * statement.cs (Throw.Resolve): Add error 724 report.
7539 * typemanager.cs: Add out_attribute_type core type.
7541 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7543 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7545 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7547 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7550 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7552 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7553 Add error 3023 report.
7554 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7556 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7559 2004-12-12 John Luke <john.luke@gmail.com>
7561 * driver.cs (AddArgs): take -- into account when
7562 adding arguments, fixes bug 65710
7564 2004-12-12 Martin Baulig <martin@ximian.com>
7566 * expression.cs (Unary.TryReduceNegative): Added support for
7567 SByteConstant and ByteConstant.
7568 (Unary.Reduce): Check error values from TryReduceNegative().
7570 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7572 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7573 and report exception as error 182.
7575 2004-12-10 Raja R Harinath <rharinath@novell.com>
7577 * driver.cs (Main): Fix message when there are warnings.
7579 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7581 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7583 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7585 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7586 Reduced number of warnings.
7588 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7590 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7592 * driver.cs: Removed message.
7594 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7596 2004-12-08 <vargaz@freemail.hu>
7598 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7600 2004-12-08 Martin Baulig <martin@ximian.com>
7602 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7603 instead of a CS3002 for properties and indexer.
7605 2004-12-08 Martin Baulig <martin@ximian.com>
7607 * decl.cs (MemberName.ToString): Make this work again.
7609 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7611 * attribute.cs (Resolve): Add error 591 detection.
7613 * class.cs (FieldMember.Define): Add error 1547 detection.
7614 (Indexer.Define): Add error 620 detection.
7615 (Operator.Define): Add error 590 detection.
7617 * ecore.cs: Missing argument for error 79.
7619 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7622 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7625 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7628 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7630 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7631 Some operator comments were suppressed.
7632 * doc.cs : Implicit/explicit operator name in doc comments are like
7633 "op_Explicit(type)~returnType", so added suffix handling.
7635 2004-12-07 Martin Baulig <martin@ximian.com>
7638 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7639 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7640 (DeclSpace.ec): New protected field; store the EmitContext here.
7641 (DeclSpace.EmitContext): New public property; moved here from
7643 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7646 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7647 (Enum.Emit): Don't create a new EmitContext.
7649 * delegate.cs (Delegate.DefineType): Always create the
7652 * iterators.cs (Iterators.DefineIterator): Create a new
7653 EmitContext and store it in `ec'.
7655 2004-08-24 Martin Baulig <martin@ximian.com>
7658 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7659 this for accessibility checks.
7660 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7661 IsNestedFamilyAccessible.
7662 (TypeManager.IsSubclassOf): New method, do what the name actually
7665 2004-12-06 Raja R Harinath <rharinath@novell.com>
7667 Fix crash on cs0657-17.cs.
7668 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7669 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7670 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7671 the case where the NamespaceEntry gets overwritten.
7673 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7675 Fixed #69195, #56821
7676 * ecore.cs (ResolveBoolean): Tiny refactoring.
7678 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7679 of right expression resolving when left is false constant and
7680 operator is LogicalAnd OR true constant and operator is LogicalOr.
7682 * statement.cs (ResolveUnreachable): Always reports warning.
7684 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7686 * class.cs: Distinguish between 1721 and 1722 (just a little help
7687 for the programmer).
7689 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7691 * delegate.cs: Only allow this on new versions of the language.
7693 2004-12-02 Duncan Mak <duncan@ximian.com>
7695 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7697 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7698 here as a static method. Take an additional bool out parameter
7699 `must_do_cs1540_check' for signaling to InstanceResolve.
7700 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7701 member field from PropertyExpr class and made it an argument of
7703 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7704 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7705 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7706 and `remove_accessor' as well as InstanceResolve: report CS0122
7711 2004-12-03 Raja R Harinath <rharinath@novell.com>
7713 Fix test-327.cs, test-328.cs, and put in early infrastructure
7714 for eventually fixing #52697.
7715 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7716 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7718 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7719 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7720 (VerifyUsing, error246): Update.
7721 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7722 'NamespaceEntry.LookupNamespaceOrType'.
7724 2004-12-03 Martin Baulig <martin@ximian.com>
7726 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7727 method as our child, call AnonymousMethod.Compatible() on it.
7729 2004-12-03 Raja R Harinath <rharinath@novell.com>
7731 Disable XML documentation support in 'basic' profile.
7732 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
7733 Redirect XmlElement to System.Object.
7734 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
7735 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
7736 * mcs.exe.sources: Add doc-bootstrap.cs.
7737 * doc-bootstrap.cs: New file. Contains empty stub implementation
7740 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7742 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7743 comments are allowed.
7745 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7747 * delegate.cs: Add checks for subtypes in paramaters and return values
7748 in VerifyMethod () to add support for Covariance/Contravariance
7751 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7753 * report.cs: Remove extra closing parenthesis.
7755 * convert.cs (Error_CannotImplicitConversion): If the name of the
7756 types are the same, provide some extra information.
7758 * class.cs (FieldBase): Use an unused bit field from the field to
7759 encode the `has_offset' property from the FieldMember. This saves
7760 a couple of Ks on bootstrap compilation.
7762 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7763 method as our child, return the AnonymousMethod resolved
7766 * expression.cs (New.DoResolve): Allow return values from
7767 NewDelegate to also include AnonymousMethods.
7771 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7774 * attribute.cs (Resolve): Improved implementation of params
7775 attribute arguments.
7777 * support.cs (ParameterData): Add HasParams to be faster.
7779 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7781 all things are for /doc support:
7783 * doc.cs: new file that supports XML documentation generation.
7784 * mcs.exe.sources: added doc.cs.
7786 Handle /doc command line option.
7787 Report error 2006 instead of 5 for missing file name for /doc.
7788 Generate XML documentation when required, after type resolution.
7790 Added support for picking up documentation (/// and /** ... */),
7791 including a new XmlCommentState enumeration.
7793 Added lines to fill Documentation element for field, constant,
7794 property, indexer, method, constructor, destructor, operator, event
7795 and class, struct, interface, delegate, enum.
7796 Added lines to warn incorrect comment.
7798 Added Documentation field (passed only when /doc was specified).
7800 Added DocComment, DocCommentHeader, GenerateDocComment() and
7801 OnGenerateDocComment() and some supporting private members for
7802 /doc feature to MemberCore.
7804 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7806 Added overriden DocCommentHeader.
7808 Added overriden DocCommentHeader and GenerateDocComment().
7810 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7812 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7813 unwrapping the enumeration values, chain to
7814 DoConstantNumericPromotions again, so we can promote things to the
7815 fundamental types (takes care of enums that are bytes, sbytes).
7819 2004-12-01 Raja R Harinath <rharinath@novell.com>
7821 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7822 Fix long-standing bug in type-lookup. Use FindType instead of
7823 LookupType when ec.ResolvingTypeTree.
7824 (Attribute.ResolveType, Attribute.Resolve)
7825 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7827 (Attributes.Search): Remove internal version. Update.
7828 (Attributes.SearchMulti): Update.
7829 (Attributes.GetClsCompliantAttribute): Remove.
7830 (Attributes.GetIndexerNameAttribute): Remove.
7831 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7832 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7833 * class.cs (Indexer.Define): Likewise.
7835 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7838 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7839 MarshallByReference members access.
7841 * expression.cs: Use CheckMarshallByRefAccess;
7842 Better error CS0197 message.
7844 * report.cs: Print whole related error message.
7846 2004-11-30 Raja R Harinath <rharinath@novell.com>
7848 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7849 the current directory to help debugging.
7851 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7853 * class (GetClassBases): Better error 60 report.
7854 (EventProperty): Disabled warning 67 detection.
7856 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7859 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7861 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7864 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7867 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7869 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7871 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7873 * attribute.cs (Attribute.Resolve): Refine error reporting and
7874 report a cs0117 if the identifier does not exist, to distinguish
7875 from 0617 which is a miss-use of the actual identifier.
7877 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7878 between cs0070 and cs0079.
7880 * class.cs (MemberBase.DoDefine): When reporting a wrong
7881 accessibility level, we use MethodCore to compare instead of
7882 Method (this was a regression in some refactoring effort).
7884 So now we correctly report cs0056 again.
7886 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7887 testing the target_type (which was known to be object_type) and
7888 not the source type (which is anonymous_method).
7890 Fixed reporting of error cs1660.
7892 * expression.cs (UserCast.Source): Expose the underlying cast.
7894 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7895 allowed types to find a match to int32 first (most common).
7897 In addition, it ignores any ImplicitUserConversions that did an
7898 internal implicit conversion (as the switch statement allows only
7899 one integral conversion to exist).
7901 * class.cs (PartialContainer.Create): rename `name' to
7902 `member_name' for clarity. Then replace the string calls with a
7903 call to MemberName.GetPartialName, as now using
7904 MemberName.ToString is an error (this is due to the side effects
7905 it had, that were fixed in the past).
7907 This will restore the error reporting on a number of partial class
7908 errors that were missusing this (and getting an exception as a
7909 results, which is now just a plain textual warning, because
7910 yyparse debug output would crash otherwise).
7912 2004-11-26 Raja R Harinath <rharinath@novell.com>
7914 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7916 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7918 * rootcontext.cs (LookupType): Make sure to cache lookups that
7919 don't give us a negative result. This saves about 5% of corlib
7922 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7924 * report.cs (AbstractMessage.Print): messages are sent to stderr
7926 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7927 non-interface in the list of interfaces (at this point, either
7928 parent was properly set, or a base class is being listed in the
7929 interfaces section).
7931 This flags error 1722, and resolves the crash from bug 69259.
7933 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7935 * statement.cs (Using.EmitExpressionFinally): make this work right
7936 for valuetypes. Fixes 69926.
7938 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7940 * const.cs (Const.ChangeType): Cope with the "0 literal can be
7941 converted to an enum" here, before we try to change the underlying
7942 type. This code exists, but it is a different code path than the
7943 one used while encoding constants.
7945 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7946 old bug: when converting from the null literal to a pointer,
7947 return an EmptyCast, not the NullLiteral.
7949 This fixes #69921, the recent null_type changes probably made this
7952 (ImplicitReferenceConversionExists): In addition, resynchronized
7953 the code here, so it matches the same code in
7954 ImplicitReferenceConversionExists for the `from any class-type S
7955 to any interface-type T'.
7958 2004-11-25 Marek Safar <marek.safar@seznam.cz>
7960 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7962 2004-11-24 Miguel de Icaza <miguel@ximian.com>
7964 * cs-parser.jay: Use verbosity accordingly.
7966 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7968 * expression.cs (Unary.ResolveOperator): Do not report warning;
7969 AddressOf reads from variable.
7971 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7973 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7977 * attribute.cs (Attributable): Removed CheckTargets.
7978 (Attributes.Emit): Explicit attribute targets are tested here.
7980 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7981 not enabled for interfaces.
7983 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7984 (GetAssemblyName): Ouch next bug there.
7986 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7988 * expression.cs: Error 275 added.
7990 2004-11-23 Marek Safar <marek.safar@seznam.cz>
7992 Fix bug #69177 (Implemented decimal constant support)
7994 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7995 (BinaryFold): Add DecimalConstant.
7997 * const.cs (Define): Decimal constant
7999 (ChangeType): Add decimal type handling.
8000 (LookupConstantValue): Don't set value for decimal type but
8001 emit DecimalConstantAttribute. Needed for constant optimization.
8003 * constant.cs (ToDecimal): New method.
8004 (ConvertToDecimal): New method.
8005 (IntConstant): Implemented ConvertToDecimal.
8006 (DecimalConstant.Emit): Emit optimized version for decimals in
8009 * expression.cs (ResolveOperator): Changed order of constant
8010 reduction to work correctly with native types which have
8011 overloaded operators.
8012 (ResolveMemberAccess): Extract constant value from attribute
8015 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8017 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8018 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8019 (ChangeType): Decimal is special.
8020 (TypeToCoreType): Add decimal type.
8022 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8024 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8027 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8029 * class.cs (EventField.ApplyAttributeBuilder): Fix error
8032 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8034 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8036 * pending.cs (PendingImplementation): Grab only interfaces.
8038 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8040 * statement.cs (ForeachHelperMethods): Add location member and
8041 error 202 detection.
8043 2004-11-19 Raja R Harinath <rharinath@novell.com>
8045 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
8046 automatically handled by executable.make.
8047 (PROGRAM): Make profile-specific.
8049 2004-11-18 Marek Safar <marek.safar@seznam.cz>
8051 * expression.cs (DoResolveBase): Fixed wrong warning for out
8054 2004-11-18 Martin Baulig <martin@ximian.com>
8056 Merged latest changes into gmcs. Please keep this comment in
8057 here, it makes it easier for me to see what changed in MCS since
8058 the last time I merged.
8060 2004-11-17 Raja R Harinath <rharinath@novell.com>
8062 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8063 (TypeHandle.GetMemberCache): New.
8064 (TypeHandle.TypeHandle): Update.
8065 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8066 (TypeManager.LookupParentInterfacesCache):
8067 Rename from LookupInterfaceCache. Optimize slightly.
8068 (TypeManager.MemberLookup_FindMembers): Update.
8069 * decl.cs (MemberCache.MemberCache): Set Container to null in the
8071 (AddCacheContents): Rename from AddHashtable.
8072 * class.cs (TypeContainer.parent_container): Remove.
8073 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8074 (TypeContainer.DoDefineMembers): Don't initialize it.
8075 Update to name changes.
8077 2004-11-17 Miguel de Icaza <miguel@ximian.com>
8079 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8080 that factors the code to check access modifiers on override.
8082 (PropertyBase): Use the code here.
8084 Patch from Lluis S'anchez, fixes bug #69361.
8086 2004-11-15 Miguel de Icaza <miguel@ximian.com>
8088 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8089 routine that is used to report the use of a captured variable
8090 whose address has been taken.
8092 There are two checks: one when variables are being captured and
8093 the other check is when the address of a variable is taken.
8095 (because an anonymous methods might be resolved before *or* after
8096 the address has been taken) and
8098 * expression.cs (Conditional.DoResolve): Remove the special
8099 casing that Martin added to trueExpr and falseExpr being both
8100 NullLiteral. We get the right behavior now just by introducing
8101 the null_type into the compiler.
8103 * convert.cs (ExplicitConversion): Change the code to use
8104 null_type instead of testing `expr is NullLiteral'.
8105 (ImplicitConversionStandard): use null_type too.
8106 (ImplicitReferenceConversionExists): use null_type too.
8107 (ImplicitReferenceConversion): use null_type too.
8109 * literal.cs: The type of `NullLiteral' is now null_type instead
8111 (Resolve): Set the type here.
8113 * typemanager.cs: Introduce null_type.
8115 2004-11-17 Martin Baulig <martin@ximian.com>
8117 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8118 direction, like FindMembers() does. Fixes #69546, testcase is in
8121 2004-11-16 Martin Baulig <martin@ximian.com>
8123 This is based on a patch from Marek Safar, see bug #69082.
8124 Fixes bugs #63705 and #67130.
8126 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8127 method; create a MemberCache for an interface type and cache the
8130 * decl.cs (IMemberContainer.ParentContainer): Removed.
8131 (IMemberContainer.ParentCache): New property.
8132 (MemberCache.SetupCacheForInterface): Removed.
8133 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8134 to create a cache for an interface's "parent".
8136 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8139 2004-11-16 Martin Baulig <martin@ximian.com>
8141 Merged back from gmcs; these changes already went into gmcs a
8142 couple of weeks ago.
8145 (TypeManager.AddUserType): Removed the `ifaces' argument.
8146 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
8148 (TypeManager.AddUserInterface): Removed.
8149 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
8151 (TypeManager.GetInterfaces): Likewise.
8152 (TypeManager.GetExplicitInterfaces): Likewise.
8154 * ecore.cs (TypeExpr.GetInterfaces): Removed.
8156 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
8157 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
8159 2004-11-14 Ben Maurer <bmaurer@ximian.com>
8161 * statement.cs: Avoid adding bools to a hashtable.
8163 2004-11-07 Miguel de Icaza <miguel@ximian.com>
8165 * expression.cs (Invocation.OverloadResolve): Flag error if we are
8166 calling an unsafe method from a safe location.
8168 2004-11-06 Marek Safar <marek.safar@seznam.cz>
8171 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8173 2004-11-06 Miguel de Icaza <miguel@ximian.com>
8175 * namespace.cs (VerifyUsing): use GetPartialName instead of
8178 2004-11-05 Miguel de Icaza <miguel@ximian.com>
8180 * statement.cs (Return.Resolve): Fix regression in typo: if
8181 `in_exc', we have to request a NeedReturnLabel, this was a typo
8182 introduced in the anonymous method check-in. Fixes #69131.
8184 * Indexers were using the ShortName when defining themselves,
8185 causing a regression in the compiler bootstrap when applying the
8186 patch from 2004-11-02 (first part), now they use their full name
8187 and the bug is gone.
8189 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
8191 * driver.cs: Strip the path from the names of embedded resources. Fixes
8194 2004-11-04 Raja R Harinath <rharinath@novell.com>
8196 Fix error message regression: cs0104-2.cs.
8197 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8198 (AliasEntry.Resolve): Update.
8199 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
8201 (RootContext.LookupType): Update.
8203 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
8205 * cs-parser.jay: Add support for handling accessor modifiers
8206 * class: Add support port accessor modifiers and error checking,
8207 define PropertyMethod.Define as virtual (not abstract anymore)
8208 * ecore.cs: Add checking for proeprties access with access modifiers
8209 * iterators.cs: Modify Accessor constructor call based in the modified
8211 2004-11-02 Ben Maurer <bmaurer@ximian.com>
8213 * expression.cs (StringConcat): Handle being called twice,
8214 as when we have a concat in a field init with more than two
8217 2004-11-02 Miguel de Icaza <miguel@ximian.com>
8219 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8220 special case explicit implementations, we should always produce
8221 the .property or .event declaration.
8223 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8224 since it will not return correct data if people use this
8225 unresolved in the presence of using statements (see test-313).
8227 * class.cs (MethodData.Define): If we are an explicit interface
8228 implementation, set the method name to the full name of the
8229 interface plus the name of the method.
8231 Notice that using the method.MethodName.GetFullName() does not
8232 work, as it will only contain the name as declared on the source
8233 file (it can be a shorthand in the presence of using statements)
8234 and not the fully qualifed type name, for example:
8238 class D : ICloneable {
8239 object ICloneable.Clone () {
8243 Would produce a method called `ICloneable.Clone' instead of
8244 `System.ICloneable.Clone'.
8246 * namespace.cs (Alias.Resolve): Use GetPartialName.
8248 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8250 * cs-parser.jay: Add error 1055 report.
8252 2004-11-01 Miguel de Icaza <miguel@ximian.com>
8254 * assign.cs (Assign.DoResolve): Only do the transform of
8255 assignment into a New if the types are compatible, if not, fall
8256 through and let the implicit code deal with the errors and with
8257 the necessary conversions.
8259 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8261 * cs-parser.jay: Add error 1031 report.
8263 * cs-tokenizer.cs: Add location for error 1038.
8265 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8267 * cs-parser.jay: Add error 1016 report.
8269 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8271 * cs-parser.jay: Add errors 1575,1611 report.
8273 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8275 * cs-parser.jay: Add error 1001 report.
8277 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8280 * attribute.cs (GetMarshal): Add method argument for
8281 caller identification.
8283 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8284 agument for GetMarshal and RuntimeMissingSupport.
8286 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8288 * attribute.cs (ExtractSecurityPermissionSet): Removed
8289 TypeManager.code_access_permission_type.
8291 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8293 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8295 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8296 for obsolete use of a variable here. Fixes regression on errors
8297 cs0619-25 and cs0619-26.
8299 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8301 Fix #62358, implemented security attribute encoding.
8303 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8304 Tests permitted SecurityAction for assembly or other types.
8305 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8306 data from SecurityPermissionAttribute to PermisionSet class.
8308 * class.cs (ApplyAttributeBuilder): Added special handling
8309 for System.Security.Permissions.SecurityAttribute based types.
8311 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8312 special handling for System.Security.Permissions.SecurityAttribute
8315 * enum.cs (ApplyAttributeBuilder): Added special handling
8316 for System.Security.Permissions.SecurityAttribute based types.
8318 * parameter.cs (ApplyAttributeBuilder): Added special handling
8319 for System.Security.Permissions.SecurityAttribute based types.
8321 * rootcontext.cs: Next 2 core types.
8323 * typemanager.cs (TypeManager.security_permission_attr_type):
8324 Built in type for the SecurityPermission Attribute.
8325 (code_access_permission_type): Build in type.
8327 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8329 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8330 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8331 all of this information into
8332 EmitContext.EmitCapturedVariableInstance.
8334 * codegen.cs (EmitCapturedVariableInstance): move here the
8335 funcionality of emitting an ldarg.0 in the presence of a
8336 remapping. This centralizes the instance emit code.
8338 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8339 then emit a load of this: it means that we have reached the
8340 topmost ScopeInfo: the one that contains the pointer to the
8341 instance of the class hosting the anonymous method.
8343 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8344 captures to the topmost CaptureContext.
8346 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8348 * expression.cs (LocalVariableReference): Move the knowledge about
8349 the iterators into codegen's EmitCapturedVariableInstance.
8351 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8353 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8354 all code paths return a value from an anonymous method (it is the
8355 same as the 161 error, but for anonymous methods).
8357 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8359 The introduction of anonymous methods in the compiler changed
8360 various ways of doing things in the compiler. The most
8361 significant one is the hard split between the resolution phase
8362 and the emission phases of the compiler.
8364 For instance, routines that referenced local variables no
8365 longer can safely create temporary variables during the
8366 resolution phase: they must do so from the emission phase,
8367 since the variable might have been "captured", hence access to
8368 it can not be done with the local-variable operations from the runtime.
8372 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8373 is a toplevel block.
8375 (ToplevelBlock): A new kind of Block, these are the blocks that
8376 are created by the parser for all toplevel method bodies. These
8377 include methods, accessors and anonymous methods.
8379 These contain some extra information not found in regular blocks:
8380 A pointer to an optional CaptureContext (for tracking captured
8381 local variables and parameters). A pointer to the parent
8384 (Return.Resolve): Catch missmatches when returning a value from an
8385 anonymous method (error 1662).
8386 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8389 (Break.Resolve): ditto.
8391 (SwitchLabel): instead of defining the labels during the
8392 resolution phase, we now turned the public ILLabel and ILLabelCode
8393 labels into methods called GetILLabelCode() and GetILLabel() that
8394 only define the label during the Emit phase.
8396 (GotoCase): Track the SwitchLabel instead of the computed label
8397 (its contained therein). Emit the code by using
8398 SwitchLabel.GetILLabelCode ().
8400 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8401 whether the Local has been captured or not.
8403 (LocalInfo.IsCaptured): New property, used to tell whether the
8404 local has been captured.
8406 * anonymous.cs: Vastly updated to contain the anonymous method
8409 The main classes here are: CaptureContext which tracks any
8410 captured information for a toplevel block and ScopeInfo used to
8411 track the activation frames for various local variables.
8413 Each toplevel block has an optional capture context associated
8414 with it. When a method contains an anonymous method both the
8415 toplevel method and the anonymous method will create a capture
8416 context. When variables or parameters are captured, they are
8417 recorded on the CaptureContext that owns them, for example:
8421 MyDelegate d = delegate {
8426 Here `a' will be recorded as captured on the toplevel
8427 CapturedContext, the inner captured context will not have anything
8428 (it will only have data if local variables or parameters from it
8429 are captured in a nested anonymous method.
8431 The ScopeInfo is used to track the activation frames for local
8432 variables, for example:
8434 for (int i = 0; i < 10; i++)
8435 for (int j = 0; j < 10; j++){
8436 MyDelegate d = delegate {
8441 At runtime this captures a single captured variable `i', but it
8442 captures 10 different versions of the variable `j'. The variable
8443 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8444 recorded on a child.
8446 The toplevel ScopeInfo will also track information like the `this'
8447 pointer if instance variables were referenced (this is necessary
8448 as the anonymous method lives inside a nested class in the host
8449 type of the method).
8451 (AnonymousMethod): Expanded to track the Toplevel, implement
8452 `AnonymousMethod.Compatible' to tell whether an anonymous method
8453 can be converted to a target delegate type.
8455 The routine now also produces the anonymous method content
8457 (AnonymousDelegate): A helper class that derives from
8458 DelegateCreation, this is used to generate the code necessary to
8459 produce the delegate for the anonymous method that was created.
8461 * assign.cs: API adjustments for new changes in
8462 Convert.ImplicitStandardConversionExists.
8464 * class.cs: Adjustments to cope with the fact that now toplevel
8465 blocks are of type `ToplevelBlock'.
8467 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8468 insteda of standard blocks.
8470 Flag errors if params arguments are passed to anonymous methods.
8472 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8473 `CurrentAnonymousMethod' which points to the current Anonymous
8474 Method. The variable points to the AnonymousMethod class that
8475 holds the code being compiled. It is set in the new EmitContext
8476 created for the anonymous method.
8478 (EmitContext.Phase): Introduce a variable and an enumeration to
8479 assist in enforcing some rules about when and where we are allowed
8480 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8481 only one that enfonces this right now).
8483 (EmitContext.HaveCaptureInfo): new helper method that returns
8484 whether we have a CapturedContext initialized.
8486 (EmitContext.CaptureVariable): New method used to register that a
8487 LocalInfo must be flagged for capturing.
8489 (EmitContext.CapturedParameter): New method used to register that a
8490 parameters must be flagged for capturing.
8492 (EmitContext.CapturedField): New method used to register that a
8493 field must be flagged for capturing.
8495 (EmitContext.HaveCapturedVariables,
8496 EmitContext.HaveCapturedFields): Return whether there are captured
8497 variables or fields.
8499 (EmitContext.EmitMethodHostInstance): This is used to emit the
8500 instance for the anonymous method. The instance might be null
8501 (static methods), this (for anonymous methods that capture nothing
8502 and happen to live side-by-side with the current method body) or a
8503 more complicated expression if the method has a CaptureContext.
8505 (EmitContext.EmitTopBlock): Routine that drives the emission of
8506 code: it will first resolve the top block, then emit any metadata
8507 and then emit the code. The split is done so that we can extract
8508 any anonymous methods and flag any captured variables/parameters.
8510 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8511 during this phase, the ILGenerator should not be used as labels
8512 and local variables declared here might not be accessible to any
8513 code that is part of an anonymous method.
8515 Exceptions to this include the temporary variables that are
8516 created by some statements internally for holding temporary
8519 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8522 (EmitContext.TemporaryReturn): This method is typically called
8523 from the Emit phase, and its the only place where we allow the
8524 ReturnLabel to be defined other than the EmitMeta. The reason is
8525 that otherwise we would have to duplicate a lot of logic in the
8526 Resolve phases of various methods that today is on the Emit
8529 (EmitContext.NeedReturnLabel): This no longer creates the label,
8530 as the ILGenerator is not valid during the resolve phase.
8532 (EmitContext.EmitThis): Extended the knowledge in this class to
8533 work in anonymous methods in addition to iterators.
8535 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8536 code is necessary on the stack to access the instance to a local
8537 variable (the variable will be accessed as a field).
8539 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8540 EmitContext.EmitAddressOfParameter): Routines to support
8541 parameters (not completed at this point).
8543 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8544 will also remove the parameters.
8546 * convert.cs (Convert): Define a `ConstantEC' which points to a
8547 null. This is just to prefity some code that uses
8548 ImplicitStandardConversion code and do not have an EmitContext
8551 The idea is to flag explicitly that at that point in time, it is
8552 known that the conversion will not trigger the delegate checking
8553 code in implicit conversions (which requires a valid
8556 Everywhere: pass new EmitContext parameter since
8557 ImplicitStandardConversionExists now requires it to check for
8558 anonymous method conversions.
8560 (Convert.ImplicitStandardConversionExists): If the type of an
8561 expression is the anonymous_method_type, and the type is a
8562 delegate, we invoke the AnonymousMethod.Compatible method to check
8563 whether an implicit conversion is possible.
8565 (Convert.ImplicitConversionStandard): Only do implicit method
8566 group conversions if the language level is not ISO_1.
8568 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8569 MethodInfo for the Invoke method. used by Delegate and
8572 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8573 method conversions if the target type is a delegate.
8575 Removed extra debugging nops.
8577 (LocalVariableReference): Turn the `local_info' into a public
8580 Add `prepared' field, the same hack used for FieldExprs to cope
8581 with composed assignments, as Local variables do not necessarily
8582 operate purely on the stack as they used to: they can be captured
8585 Add `temp' for a temporary result, like fields.
8587 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8589 It now copes with Local variables that are captured and emits the
8590 proper instance variable to load it from a field in the captured
8593 (ParameterReference.DoResolveBase): During the resolve phase,
8594 capture parameters if we are in an anonymous method.
8596 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8597 anonymous method, use the EmitContext helper routines to emit the
8598 parameter reference.
8600 * iterators.cs: Set RemapToProxy to true/false during the
8603 * parameters.cs (GetParameterByName): New helper method.
8605 * typemanager.cs (anonymous_method_type) a new type that
8606 represents an anonyous method. This is always an internal type,
8607 used as a fencepost to test against the anonymous-methodness of an
8610 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8612 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8614 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8616 2004-10-18 Martin Baulig <martin@ximian.com>
8618 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8619 `Type' directly, but call ResolveType() on it.
8620 (Catch.Resolve): Likewise.
8621 (Foreach.Resolve): Likewise.
8623 2004-10-18 Martin Baulig <martin@ximian.com>
8625 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8626 `Type' directly, but call ResolveType() on it.
8627 (Probe.DoResolve): Likewise.
8628 (ArrayCreation.LookupType): Likewise.
8629 (TypeOf.DoResolve): Likewise.
8630 (SizeOf.DoResolve): Likewise.
8632 2004-10-18 Martin Baulig <martin@ximian.com>
8634 * expression.cs (Invocation.BetterFunction): Put back
8635 TypeManager.TypeToCoreType().
8637 2004-10-18 Raja R Harinath <rharinath@novell.com>
8639 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8642 2004-10-18 Martin Baulig <martin@ximian.com>
8644 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
8645 `Type' directly, but call ResolveType() on it.
8647 2004-10-18 Martin Baulig <martin@ximian.com>
8649 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8650 `Type' directly, but call ResolveType() on it.
8651 (MemberBase.DoDefine): Likewise.
8653 * expression.cs (New.DoResolve): Don't access the TypeExpr's
8654 `Type' directly, but call ResolveType() on it.
8655 (ComposedCast.DoResolveAsTypeStep): Likewise.
8657 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8658 `Type' directly, but call ResolveType() on it.
8660 2004-10-17 John Luke <john.luke@gmail.com>
8662 * class.cs (Operator.GetSignatureForError): use CSharpName
8664 * parameter.cs (Parameter.GetSignatureForError): Returns
8665 correct name even if was not defined.
8667 2004-10-13 Raja R Harinath <rharinath@novell.com>
8670 * class.cs (TypeContainer.EmitContext): New property.
8671 (DefineNestedTypes): Create an emitcontext for each part.
8672 (MethodCore.DoDefineParameters): Use container's emitcontext.
8673 Pass type array to InternalParameters.
8674 (MemberBase.DoDefine): Use container's emitcontext.
8675 (FieldMember.Define): Likewise.
8676 (Event.Define): Likewise.
8677 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8678 Pass type array to InternalParameters.
8679 (SetIndexerMethod.GetParameterInfo): Likewise.
8680 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8681 * delegate.cs (Define): Pass emitcontext to
8682 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8683 array to InternalParameters.
8684 * expression.cs (ParameterReference.DoResolveBase): Pass
8685 emitcontext to GetParameterInfo.
8686 (ComposedCast.DoResolveAsTypeStep): Remove check on
8687 ec.ResolvingTypeTree.
8688 * parameter.cs (Parameter.Resolve): Change argument to
8689 EmitContext. Use ResolveAsTypeTerminal.
8690 (Parameter.GetSignature): Change argument to EmitContext.
8691 (Parameters.ComputeSignature): Likewise.
8692 (Parameters.ComputeParameterTypes): Likewise.
8693 (Parameters.GetParameterInfo): Likewise.
8694 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8695 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8696 * support.cs (InternalParameters..ctor): Remove variant that takes
8698 * typemanager.cs (system_intptr_expr): New.
8699 (InitExpressionTypes): Initialize it.
8701 2004-10-12 Chris Toshok <toshok@ximian.com>
8703 * cs-parser.jay: fix location for try_statement and catch_clause.
8705 2004-10-11 Martin Baulig <martin@ximian.com>
8707 * report.cs: Don't make --fatal abort on warnings, we have
8708 -warnaserror for that.
8710 2004-10-07 Raja R Harinath <rharinath@novell.com>
8712 More DeclSpace.ResolveType avoidance.
8713 * decl.cs (MemberCore.InUnsafe): New property.
8714 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
8715 with newly created EmitContext.
8716 (FieldMember.Define): Likewise.
8717 * delegate.cs (Delegate.Define): Likewise.
8718 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8719 only if normal name-lookup fails.
8720 (TypeExpr.DoResolve): Enable error-checking.
8721 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8722 (SizeOf.DoResolve): Likewise.
8723 (ComposedCast.DoResolveAsTypeStep): Likewise.
8724 (StackAlloc.DoResolve): Likewise.
8725 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8726 (Block.Unsafe): New property.
8727 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8728 (Unsafe): Set 'unsafe' flag of contained block.
8729 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8730 (Fixed.Resolve): Likewise.
8731 (Catch.Resolve): Likewise.
8732 (Using.ResolveLocalVariableDecls): Likewise.
8733 (Foreach.Resolve): Likewise.
8735 2004-10-05 John Luke <john.luke@gmail.com>
8737 * cs-parser.jay: add location to error CS0175
8739 2004-10-04 Miguel de Icaza <miguel@ximian.com>
8741 * ecore.cs (Expression.Constantity): Add support for turning null
8744 * const.cs (Const.Define): Allow constants to be reference types
8745 as long as the value is Null.
8747 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
8749 * namespace.cs (NamespaceEntry.Using): No matter which warning
8750 level is set, check if this namespace name has already been added.
8752 2004-10-03 Ben Maurer <bmaurer@ximian.com>
8754 * expression.cs: reftype [!=]= null should always use br[true,false].
8757 2004-10-03 Marek Safar <marek.safar@seznam.cz>
8760 * attribute.cs: Enum conversion moved to
8761 GetAttributeArgumentExpression to be applied to the all
8764 2004-10-01 Raja R Harinath <rharinath@novell.com>
8766 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8767 * class.c (TypeContainer.DefineType): Flag error if
8768 base types aren't accessible due to access permissions.
8769 * decl.cs (DeclSpace.ResolveType): Move logic to
8770 Expression.ResolveAsTypeTerminal.
8771 (DeclSpace.ResolveTypeExpr): Thin layer over
8772 Expression.ResolveAsTypeTerminal.
8773 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8774 Refactor code into NestedAccess. Use it.
8775 (DeclSpace.NestedAccess): New.
8776 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8777 argument to silence errors. Check access permissions.
8778 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8779 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8780 (Cast.DoResolve): Likewise.
8781 (New.DoResolve): Likewise.
8782 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8783 (TypeOf.DoResolve): Likewise.
8785 * expression.cs (Invocation.BetterConversion): Return the Type of
8786 the better conversion. Implement section 14.4.2.3 more faithfully.
8787 (Invocation.BetterFunction): Make boolean. Make correspondence to
8788 section 14.4.2.2 explicit.
8789 (Invocation.OverloadResolve): Update.
8790 (Invocation): Remove is_base field.
8791 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8792 (Invocation.Emit): Likewise.
8794 2004-09-27 Raja R Harinath <rharinath@novell.com>
8796 * README: Update to changes.
8798 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8800 * cs-parser.jay: Reverted 642 warning fix.
8802 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8805 * decl.cs (FindMemberWithSameName): Indexer can have more than
8808 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8810 * expression.cs (LocalVariableReference.DoResolveLValue):
8811 Do not report warning 219 for out values.
8812 (EmptyExpression.Null): New member to avoid extra allocations.
8814 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8816 * cs-parser.jay: Fix wrong warning 642 report.
8818 * cs-tokenizer.cs (CheckNextToken): New helper;
8819 Inspect next character if is same as expected.
8821 2004-09-23 Martin Baulig <martin@ximian.com>
8823 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8824 (Convert.ImplicitReferenceConversionExists): Likewise.
8826 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8828 * class.cs (Operator.Define): Add error 448 and 559 report.
8830 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8832 * class.cs (MemberBase.IsTypePermitted): New protected
8833 method for checking error CS0610.
8835 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8837 * class.cs (TypeContainer.HasExplicitLayout): New property
8838 Returns whether container has StructLayout attribute set Explicit.
8839 (FieldMember): New abstract class for consts and fields.
8840 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8841 (Field): Reuse FieldMember.
8843 * const.cs (Const): Reuse FieldMember.
8845 * rootcontext.cs: EmitConstants call moved to class.
8847 2004-09-22 Martin Baulig <martin@ximian.com>
8849 Thanks to Peter Sestoft for this bug report.
8851 * expression.cs (Conditional): If both the `trueExpr' and the
8852 `falseExpr' is a NullLiteral, return a NullLiteral.
8854 2004-09-22 Martin Baulig <martin@ximian.com>
8856 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8857 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8858 for the "get_Current" call.
8860 2004-09-22 Martin Baulig <martin@ximian.com>
8862 Marek and me just fixed one of our oldest bugs: #28562 :-)
8864 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8866 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8867 we're an EnumConstant, just return that.
8868 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8869 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8870 to get the value which'll actually be written into the attribute.
8871 However, we have to use GetValue() to access the attribute's value
8874 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8876 * constant.cs (Constant.IsNegative): New abstract property
8879 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8880 (StackAlloc.DoResolve): Reused IsNegative.
8882 2004-09-21 Martin Baulig <martin@ximian.com>
8884 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8885 if we're used in an iterator, we may be called from different
8888 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8889 we actually have an exception block.
8891 2004-09-20 John Luke <jluke@cfl.rr.com>
8893 * class.cs, cs-parser.jay: Improve the error report for 1520:
8894 report the actual line where the error happens, not where the
8897 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8898 Pass location information that was available elsewhere.
8900 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
8902 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8903 runtime to delay sign assemblies.
8905 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8907 * cs-parser.jay: Do not report the stack trace, this is barely
8910 2004-08-22 John Luke <john.luke@gmail.com>
8912 * driver.cs : check that a resource id is not already used
8913 before adding it, report CS1508 if it is, bug #63637
8915 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8917 * ecore.cs: Removed dead code.
8919 2004-09-18 Marek Safar <marek.safar@seznam.cz>
8921 * class.cs: Do not report warning CS0067 on the interfaces.
8923 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8925 * cs-parser.jay: Add error 504 report.
8927 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8929 * rootcontext.cs: WarningLevel is 4 by default now.
8931 * statement.cs (Fixed.Resolve): Do not null
8934 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8937 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8938 deep search when property is not virtual.
8939 (PropertyExpr.ResolveAccessors): Make one call for both
8942 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8945 * statement.cs: Error 152 report constains also location.
8947 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8950 * const.cs: Explicitly set constant as static.
8952 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8955 * cs-parser.jay: Add error 1017 report.
8957 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8959 Fixed bug #59980, #64224
8960 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8962 * typemanager.cs (IsSpecialMethod): Simplified
8964 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8966 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8967 condition with better params.
8969 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8972 * attribute.cs (Resolve): Property has to have both
8975 2004-09-14 Martin Baulig <martin@ximian.com>
8977 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8979 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8982 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8983 called and is obsolete then this member suppress message
8984 when call is inside next [Obsolete] method or type.
8986 * expression.cs: Use TestObsoleteMethodUsage member.
8988 2004-09-14 Martin Baulig <martin@ximian.com>
8990 * cs-parser.jay: Sync a bit with the GMCS version.
8992 2004-09-14 Martin Baulig <martin@ximian.com>
8994 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8995 (CSharpParser.yacc_verbose_flag): New public field.
8997 * genericparser.cs: Removed.
8999 2004-09-14 Raja R Harinath <rharinath@novell.com>
9001 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
9003 2004-09-13 Marek Safar <marek.safar@seznam.cz>
9005 * class.cs (MethodCore.CheckBase): Fix bug #65757.
9007 2004-09-10 Martin Baulig <martin@ximian.com>
9009 Backported my MemberName changes from GMCS into MCS.
9011 - we are now using a special `MemberName' class instead of using
9012 strings; in GMCS, the `MemberName' also contains the type
9015 - changed the grammar rules a bit:
9016 * the old `member_name' is now a `namespace_or_type_name':
9017 The rule is that we use `namespace_or_type_name' everywhere
9018 where we expect either a "member name" (GetEnumerator) or a
9019 "member name" with an explicit interface name
9020 (IEnumerable.GetEnumerator).
9021 In GMCS, the explicit interface name may include type arguments
9022 (IEnumerable<T>.GetEnumerator).
9023 * we use `member_name' instead of just `IDENTIFIER' for
9025 The rule is that we use `member_name' wherever a member may
9026 have type parameters in GMCS.
9028 * decl.cs (MemberName): New public class.
9029 (MemberCore.MemberName): New public readonly field.
9030 (MemberCore.ctor): Take a `MemberName' argument, not a string.
9031 (DeclSpace): Likewise.
9033 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
9034 * enum.cs (Enum.ctor): Likewise.
9036 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
9038 (AliasEntry.ctor): Take a MemberName, not an Expression.
9039 (AliasEntry.UsingAlias): Likewise.
9041 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
9042 (IMethodData.MemberName): Changed type from string to MemberName.
9043 (MemberBase.ExplicitInterfaceName): Likewise.
9044 (AbstractPropertyEventMethod.SetupName): Make this private.
9045 (AbstractPropertyEventMethod.ctor): Added `string prefix'
9046 argument; compute the member name here.
9047 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
9048 on the `member.MemberName' and the `prefix'.
9050 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
9052 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
9053 thus, we get a `MemberName' instead of a `string'. These
9054 declarations may have type parameters in GMCS.
9055 (interface_method_declaration, delegate_declaration): Likewise.
9056 (class_declaration, interface_declaration): Likewise.
9057 (method_header): Use `namespace_or_type_name' instead of
9058 `member_name'. We may be an explicit interface implementation.
9059 (property_declaration, event_declaration): Likewise.
9060 (member_name): This is now just an `IDENTIFIER', not a
9061 `namespace_or_type_name'.
9062 (type_name, interface_type): Removed.
9063 (namespace_or_type_name): Return a MemberName, not an Expression.
9064 (primary_expression): Use `member_name' instead of `IDENTIFIER';
9065 call GetTypeExpression() on the MemberName to get an expression.
9066 (IndexerDeclaration.interface_type): Changed type from string to
9068 (MakeName): Operate on MemberName's instead of string's.
9070 2004-09-13 Raja R Harinath <rharinath@novell.com>
9073 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
9074 (NamespaceEntry.Lookup): Add new argument to flag if we want the
9075 lookup to avoid symbols introduced by 'using'.
9076 * rootcontext.cs (NamespaceLookup): Update.
9078 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9080 * class.cs (TypeContainer.DoDefineMembers): Do not call
9081 DefineDefaultConstructor for static classes.
9083 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9085 * attribute.cs (Attribute.Resolve): Add error 653 report.
9087 * class.cs (Class.ApplyAttributeBuilder): Add error 641
9089 (Method.ApplyAttributeBuilder): Add error 685 report.
9090 (Operator.Define): Add error 564 report.
9092 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9094 * expression.cs (Invocation.DoResolve): Add error
9097 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9100 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9102 * class.cs (ConstructorInitializer.Resolve):
9103 Wrong error number (515->516).
9105 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9107 * class.cs (Indexer.Define): Add error 631 report.
9109 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9111 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9113 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9115 * expression.cs (Probe.DoResolve): Add error CS0241 report.
9117 2004-09-10 Marek Safar <marek.safar@seznam.cz>
9119 * cs-parser.jay: Added error CS0241 report.
9121 2004-09-10 Raja R Harinath <rharinath@novell.com>
9123 * cs-parser.jay (fixed_statement): Introduce a scope for the
9124 declaration in the 'fixed' statement.
9126 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9128 * cs-parser.jay: Added CS0230 error report.
9130 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9132 * cs-parser.jay: Added errors CS0231 and CS0257 report.
9134 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9136 * expression.cs (Argument.Resolve): Added error CS0192 and
9139 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9141 C# 2.0 #pragma warning feature
9143 * cs-tokenizer.cs (PreProcessPragma): New method;
9144 Handles #pragma directive.
9146 * report.cs (WarningRegions): New class; Support
9147 class for #pragma warning directive. It tests whether
9148 warning is enabled for a given line.
9150 2004-09-08 Miguel de Icaza <miguel@ximian.com>
9152 * const.cs: Add more descriptive error report, tahnks to
9155 2004-09-08 Marek Safar <marek.safar@seznam.cz>
9157 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9159 2004-09-07 Miguel de Icaza <miguel@ximian.com>
9161 * expression.cs: Apply patch from Ben: Remove dead code from
9162 ArrayCreation, and remove the TurnintoConstant call in const.cs,
9163 as that code just threw an exception anwyays.
9165 * const.cs: Remove the call to the turnintoconstant, for details
9168 * literal.cs: The type of the null-literal is the null type; So
9169 we use a placeholder type (literal.cs:System.Null, defined here)
9172 * expression.cs (Conditional.DoResolve): Remove some old code that
9173 is no longer needed, conversions have been fixed.
9175 (ArrayCreationExpression.DoResolve): Return false if we fail to
9176 resolve the inner expression.
9178 2004-09-07 Raja R Harinath <rharinath@novell.com>
9181 * cs-parser.jay (delegate_declaration): Record a delegate
9182 declaration as a type declaration.
9183 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9185 2004-09-06 Miguel de Icaza <miguel@ximian.com>
9187 * parameter.cs: Do not crash if the type can not be resolved.
9189 * expression.cs: Report errors with unsafe pointers, fixes #64896
9191 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
9193 * expression.cs: Pointer arith always needs to do a conv.i
9194 if the operand is a long. fix 65320
9196 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9198 Fixed cs0619-37.cs, cs0619-38.cs
9200 * enum.cs (GetObsoleteAttribute): Removed.
9202 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9203 on Enum member is double staged. The first is tested member
9206 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9208 Fixed #56986, #63631, #65231
9210 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9211 adds member to name container.
9212 (TypeContainer.AddToTypeContainer): New method, adds type to
9214 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9215 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9216 AddOperator): Simplified by reusing AddToMemberContainer.
9217 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9219 (Method.CheckForDuplications): Fixed implementation to test all
9221 (MemberBase): Detection whether member is explicit interface
9222 implementation is now in constructor.
9223 (MemberBase.UpdateMemberName): Handles IndexerName.
9224 (Accessor): Changed to keep also location information.
9225 (AbstractPropertyEventMethod): Is derived from MemberCore.
9226 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9227 will be emited or not.
9228 (PropertyBase.AreAccessorsDuplicateImplementation):
9229 Tests whether accessors are not in collision with some method.
9230 (Operator): Is derived from MethodCore to simplify common
9233 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9235 (DeclSpace.AddToContainer): Adds the member to defined_names
9236 table. It tests for duplications and enclosing name conflicts.
9238 * enum.cs (EnumMember): Clean up to reuse the base structures
9240 2004-09-03 Martin Baulig <martin@ximian.com>
9242 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9243 into TypeContainer, to make partial classes work again.
9245 2004-09-03 Martin Baulig <martin@ximian.com>
9247 * rootcontext.cs (RootContext.V2): Removed.
9249 2004-03-23 Martin Baulig <martin@ximian.com>
9251 * expression.cs (Invocation.OverloadResolve): Added `bool
9252 may_fail' argument and use it instead of the Location.IsNull() hack.
9254 2004-09-03 Martin Baulig <martin@ximian.com>
9256 Merged latest changes into gmcs. Please keep this comment in
9257 here, it makes it easier for me to see what changed in MCS since
9258 the last time I merged.
9260 2004-09-03 Raja R Harinath <rharinath@novell.com>
9263 * expression.cs (BetterConversion): Don't allow either conversion
9264 to be null. Remove redundant implicit conversion test when 'q ==
9265 null' -- when this function is invoked, we already know that the
9266 implicit conversion exists.
9267 (BetterFunction): Assume that 'best' is non-null. Remove
9268 redundant reimplementation of IsApplicable when 'best' is null.
9269 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9270 number of arguments.
9271 (IsAncestralType): Extract from OverloadResolve.
9272 (OverloadResolve): Make robust to the MethodGroupExpr being
9273 unsorted. Implement all the logic of Section 14.5.5.1, and
9274 support overloading of methods from multiple applicable types.
9275 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9277 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9278 (RealError, Warning): Append type of report to related symbol.
9280 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9282 * enum.cs: Fixed CLS-Compliance checks for enum members.
9283 Error tests cs3008-8.cs, cs3014-8.cs
9285 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9287 Fixed bug #62342, #63102
9288 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9289 like ImplementMethod.
9291 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9293 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9296 2004-09-02 Martin Baulig <martin@ximian.com>
9298 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9299 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9302 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9304 C# 2.0 Static classes implemented
9306 * class.cs (TypeContainer): instance_constructors,
9307 initialized_fields, initialized_static_fields,
9308 default_constructor, base_inteface_types are protected to be
9309 accessible from StaticClass.
9310 (TypeContainer.DefineDefaultConstructor): New virtual method
9311 for custom default constructor generating
9312 (StaticClass): New class to handle "Static classes" feature.
9314 * cs-parser.jay: Handle static keyword on class like instance
9317 * driver.cs: Added "/langversion" command line switch with two
9318 options (iso-1, default).
9320 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9322 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9324 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9326 * delegate.cs: Style.
9328 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9330 * delegate.cs: Add seperate instance expr field for miguel.
9332 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9334 * PointerArithmetic (Resolve): make sure we are not doing
9335 pointer arith on void*. Also, make sure we are resolved
9336 by not setting eclass until resolve.
9338 All callers: Make sure that PointerArithmetic gets resolved.
9340 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9342 * ArrayCreation (LookupType): If the type does not resolve
9343 to an array, give an error.
9345 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9347 * statement.cs (Try.Resolve): Fixed bug #64222
9349 2004-08-27 Martin Baulig <martin@ximian.com>
9352 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9355 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9357 * ecore.cs (Constantify): Get underlying type via
9358 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9359 Windows in special cases.
9361 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9363 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9364 for obtaining also private methods.
9365 (GetRemoveMethod): Used GetRemoveMethod (true)
9366 for obtaining also private methods.
9368 2004-08-24 Martin Baulig <martin@ximian.com>
9370 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9371 MethodAttributes.HideBySig for operators.
9373 2004-08-23 Martin Baulig <martin@ximian.com>
9375 Back to the old error reporting system :-)
9377 * report.cs (Message): Removed.
9378 (Report.MessageData, ErrorData, WarningData): Removed.
9379 (Report.Error, Warning): Back to the old system.
9381 2004-08-23 Martin Baulig <martin@ximian.com>
9383 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9385 * class.cs (TypeContainer.ParentContainer): New public virtual
9386 method; replaces the explicit interface implementation.
9387 (ClassPart.ParentContainer): Override.
9389 2004-08-23 Martin Baulig <martin@ximian.com>
9391 * statement.cs (Switch): Added support for constant switches; see
9392 #59428 or test-285.cs.
9394 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9397 * statement.cs (GetEnumeratorFilter): Removed useless
9398 logic because C# specs is strict. GetEnumerator must be
9401 2004-08-22 Martin Baulig <martin@ximian.com>
9403 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9404 a switch and may break, reset the barrier. Fixes #59867.
9406 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9408 CLS-Compliance speed up (~5% for corlib)
9410 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9411 New method. Tests container for CLS-Compliant names
9413 * class.cs (TypeContainer.VerifyClsName): New method.
9414 Checks whether container name is CLS Compliant.
9415 (Constructor): Implements IMethodData.
9417 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9418 low-case table for CLS Compliance test.
9419 (MemberCache.VerifyClsParameterConflict): New method.
9420 Checks method parameters for CS3006 error.
9422 * enum.cs (EnumMember): Is derived from MemberCore.
9423 (Enum.VerifyClsName): Optimized for better performance.
9425 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9427 * report.cs: Renamed Error_T to Error and changed all
9430 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9432 * class.cs (TypeContainer.IndexerArrayList): New inner class
9433 container for indexers.
9434 (TypeContainer.DefaultIndexerName): New constant for default
9435 indexer name. Replaced all "Item" with this constant.
9436 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9438 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9439 DefaultMemberAttribute constructor.
9441 2004-08-05 Martin Baulig <martin@ximian.com>
9443 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9446 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9448 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9449 multi platforms problem.
9451 * compiler.csproj: Included shared files.
9453 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9455 Fix bug 60333, 55971 in the more general way
9456 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9457 Added arg_type argument for constant conversion.
9458 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9460 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9463 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9464 OperatorArrayList, MethodCoreArrayList for typecontainer
9465 containers. Changed class member types to these new types.
9466 (MethodArrayList.DefineMembers): Added test for CS0659.
9468 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9470 * cfold.cs: Synchronize the folding with the code in expression.cs
9471 Binary.DoNumericPromotions for uint operands.
9473 * attribute.cs: Revert patch from Raja, it introduced a regression
9474 while building Blam-1.2.1 (hard to isolate a test case).
9476 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9480 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9482 (MethodCore.parent_method): New member. The method we're overriding
9483 if this is an override method.
9484 (MethodCore.CheckBase): Moved from Method class and made common.
9485 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9487 (MethodCore.CheckForDuplications): New abstract method. For custom
9488 member duplication search in a container
9489 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9490 method and its return type.
9491 (Event.conflict_symbol): New member. Symbol with same name in the
9495 (MemberCache.FindMemberWithSameName): New method. The method
9496 is looking for conflict with inherited symbols.
9498 2004-08-04 Martin Baulig <martin@ximian.com>
9500 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9502 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9504 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9506 * report.cs (Message): New enum for better error, warning reference in
9508 (MessageData): New inner abstract class. It generally handles printing of
9509 error and warning messages.
9510 Removed unused Error, Warning, Message methods.
9512 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9514 Fix for cs0592-8.cs test
9516 (Attributable.ValidAttributeTargets): Made public.
9517 (Attribute.ExplicitTarget): New member for explicit target value.
9518 (Attribute.CheckTargets): Now we translate explicit attribute
9519 target to Target here.
9521 2004-08-03 Ben Maurer <bmaurer@ximian.com>
9523 * ecore.cs (MethodGroupExpr): new IsBase property.
9525 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9527 * delegate.cs (DelegateCreation): store a MethodGroupExpr
9528 rather than an instance expr.
9530 (DelegateCreation.Emit): Use the method group rather than
9531 the instance expression. Also, if you have base.Foo as the
9532 method for a delegate, make sure to emit ldftn, not ldftnvirt.
9534 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
9536 (NewDelegate.DoResolve): Only check for the existance of Invoke
9537 if the method is going to be needed. Use MethodGroupExpr.
9539 (NewDelegate.Emit): Remove, DelegateCreation implements this.
9541 * expression.cs: For pointer arith., make sure to use
9542 the size of the type, not the size of the pointer to
9545 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9548 * class.cs (Class): Added error CS0502 test.
9550 2004-08-03 John Luke <jluke@cfl.rr.com>
9551 Raja R Harinath <rharinath@novell.com>
9554 * attribute.cs (Attribute.complained_before): New flag.
9555 (Attribute.ResolveType, Attribute.Resolve),
9556 (Attribute.DefinePInvokeMethod): Set it.
9557 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9559 2004-08-03 Martin Baulig <martin@ximian.com>
9561 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9562 use a user-defined operator; we still need to do numeric
9563 promotions in case one argument is a builtin type and the other
9564 one has an implicit conversion to that type. Fixes #62322.
9566 2004-08-02 Martin Baulig <martin@ximian.com>
9568 * statement.cs (LocalInfo.Flags): Added `IsThis'.
9569 (LocalInfo.IsThis): New public property.
9570 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9572 2004-08-01 Martin Baulig <martin@ximian.com>
9574 * class.cs (TypeContainer.GetClassBases): Don't set the default
9575 here since we may get called from GetPartialBases().
9576 (TypeContainer.DefineType): If GetClassBases() didn't return a
9577 parent, use the default one.
9579 2004-07-30 Duncan Mak <duncan@ximian.com>
9581 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
9583 2004-07-30 Martin Baulig <martin@ximian.com>
9585 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9587 * class.cs (SourceMethod): New public class, derive from the
9588 symbol writer's ISourceMethod.
9589 (Method): Use the new symbol writer API.
9591 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9592 as argument and use the new symbol writer.
9595 (SourceFile): Implement the symbol writer's ISourceFile.
9596 (Location.SymbolDocument): Removed.
9597 (Location.SourceFile): New public property.
9599 * symbolwriter.cs: Use the new symbol writer API.
9601 2004-07-30 Raja R Harinath <rharinath@novell.com>
9603 * Makefile (install-local): Remove. Functionality moved to
9606 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
9608 * Makefile: Install mcs.exe.config file together with mcs.exe.
9609 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9610 correct runtime version.
9612 2004-07-25 Martin Baulig <martin@ximian.com>
9615 (TypeContainer.RegisterOrder): Removed, this was unused.
9616 (TypeContainer, interface_order): Removed.
9617 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9618 TypeContainer as argument since we can also be called with a
9619 `PartialContainer' for a partial class/struct/interface.
9620 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9621 of checking whether we're an `Interface' - we could be a
9623 (PartialContainer.Register): Override; call
9624 AddClass()/AddStruct()/AddInterface() on our parent.
9626 * cs-parser.jay (interface_member_declaration): Add things to the
9627 `current_container', not the `current_class'.
9629 * rootcontext.cs (RegisterOrder): The overloaded version which
9630 takes an `Interface' was unused, removed.
9632 * typemanager.cs (TypeManager.LookupInterface): Return a
9633 `TypeContainer', not an `Interface'.
9634 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9635 contain a `PartialContainer' for an interface, so check it's
9636 `Kind' to figure out what it is.
9638 2004-07-25 Martin Baulig <martin@ximian.com>
9640 * class.cs (Class.DefaultTypeAttributes): New public constant.
9641 (Struct.DefaultTypeAttributes): Likewise.
9642 (Interface.DefaultTypeAttributes): Likewise.
9643 (PartialContainer.TypeAttr): Override this and add the
9644 DefaultTypeAttributes.
9646 2004-07-25 Martin Baulig <martin@ximian.com>
9648 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9649 we can just use the `Parent' field instead.
9651 2004-07-25 Martin Baulig <martin@ximian.com>
9653 * class.cs (TypeContainer.Emit): Renamed to EmitType().
9655 2004-07-25 Martin Baulig <martin@ximian.com>
9657 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9658 our parts before defining any methods.
9659 (TypeContainer.VerifyImplements): Make this virtual.
9660 (ClassPart.VerifyImplements): Override and call VerifyImplements()
9661 on our PartialContainer.
9663 2004-07-25 Martin Baulig <martin@ximian.com>
9665 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9667 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9668 argument, we can just use the `Parent' field instead.
9671 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
9672 (MemberBase.DoDefine): Likewise.
9674 2004-07-24 Martin Baulig <martin@ximian.com>
9676 * decl.cs (MemberCore.Parent): New public field.
9677 (DeclSpace.Parent): Moved to MemberCore.
9679 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9680 (MemberBase.ctor): Added TypeContainer argument, pass it to our
9682 (FieldBase, Field, Operator): Likewise.
9683 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9684 (EventField, Event): Likewise.
9686 2004-07-23 Martin Baulig <martin@ximian.com>
9688 * class.cs (PartialContainer): New public class.
9689 (ClassPart): New public class.
9690 (TypeContainer): Added support for partial classes.
9691 (TypeContainer.GetClassBases): Splitted some of the functionality
9692 out into GetNormalBases() and GetPartialBases().
9694 * cs-tokenizer.cs (Token.PARTIAL): New token.
9695 (Tokenizer.consume_identifier): Added some hacks to recognize
9696 `partial', but only if it's immediately followed by `class',
9697 `struct' or `interface'.
9699 * cs-parser.jay: Added support for partial clases.
9701 2004-07-23 Martin Baulig <martin@ximian.com>
9703 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9704 a `DeclSpace' and also made it readonly.
9705 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9706 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9707 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9709 * cs-parser.jay: Pass the `current_class', not the
9710 `current_container' (at the moment, this is still the same thing)
9711 to a new Method, Property, Event, Indexer or Constructor.
9713 2004-07-23 Martin Baulig <martin@ximian.com>
9715 * cs-parser.jay (CSharpParser): Added a new `current_class' field
9716 and removed the `current_interface' one.
9717 (struct_declaration, class_declaration, interface_declaration):
9718 Set `current_class' to the newly created class/struct/interface;
9719 set their `Bases' and call Register() before parsing their body.
9721 2004-07-23 Martin Baulig <martin@ximian.com>
9723 * class.cs (Kind): New public enum.
9724 (TypeContainer): Made this class abstract.
9725 (TypeContainer.Kind): New public readonly field.
9726 (TypeContainer.CheckDef): New public method; moved here from
9728 (TypeContainer.Register): New public abstract method.
9729 (TypeContainer.GetPendingImplementations): New public abstract
9731 (TypeContainer.GetClassBases): Removed the `is_class' and
9732 `is_iface' parameters.
9733 (TypeContainer.DefineNestedTypes): Formerly known as
9735 (ClassOrStruct): Made this class abstract.
9737 * tree.cs (RootTypes): New public type.
9739 2004-07-20 Martin Baulig <martin@ximian.com>
9741 * tree.cs (Tree.RecordNamespace): Removed.
9742 (Tree.Namespaces): Removed.
9744 * rootcontext.cs (RootContext.IsNamespace): Removed.
9746 * cs-parser.jay (namespace_declaration): Just create a new
9747 NamespaceEntry here.
9749 2004-07-20 Martin Baulig <martin@ximian.com>
9751 * statement.cs (ExceptionStatement): New abstract class. This is
9752 now used as a base class for everyone who's using `finally'.
9753 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
9754 our local variables before using them.
9756 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
9757 virtual method. This is used by Yield.Resolve() to "steal" an
9758 outer block's `finally' clauses.
9759 (FlowBranchingException): The .ctor now takes an ExceptionStatement
9762 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
9763 version which takes an ExceptionStatement. This version must be
9764 used to create exception branchings.
9767 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
9768 (Iterator.EmitMoveNext): Added exception support; protect the
9769 block with a `fault' clause, properly handle 'finally' clauses.
9770 (Iterator.EmitDispose): Run all the `finally' clauses here.
9772 2004-07-20 Martin Baulig <martin@ximian.com>
9774 * iterator.cs: This is the first of a set of changes in the
9775 iterator code. Match the spec more closely: if we're an
9776 IEnumerable, then GetEnumerator() must be called. The first time
9777 GetEnumerator() is called, it returns the current instance; all
9778 subsequent invocations (if any) must create a copy.
9780 2004-07-19 Miguel de Icaza <miguel@ximian.com>
9782 * expression.cs: Resolve the constant expression before returning
9785 2004-07-19 Martin Baulig <martin@ximian.com>
9787 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9788 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9789 the return type of the new EmitContext.
9791 2004-07-18 Martin Baulig <martin@ximian.com>
9793 * class.cs (Property.Define): Fix iterators.
9795 * iterators.cs (Iterator.Define): Moved the
9796 `container.AddInterator (this)' call here from the .ctor; only do
9797 it if we resolved successfully.
9799 2004-07-17 Miguel de Icaza <miguel@ximian.com>
9801 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9802 `true' for preprocessing directives that we parse. The return
9803 value indicates whether we should return to regular tokenizing or
9804 not, not whether it was parsed successfully.
9806 In the past if we were in: #if false ... #line #endif, we would
9807 resume parsing after `#line'. See bug 61604.
9809 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9810 building: IsEnumType should return true only for enums, not for
9811 enums or System.Enum itself. This fixes #61593.
9813 Likely what happened is that corlib was wrong: mcs depended on
9814 this bug in some places. The bug got fixed, we had to add the
9815 hack, which caused bug 61593.
9817 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9818 that was a workaround for the older conditions.
9820 2004-07-16 Ben Maurer <bmaurer@ximian.com>
9822 * assign.cs: IAssignMethod has a new interface, as documented
9823 inline. All assignment code now uses this new api.
9825 * ecore.cs, expression.cs: All classes which implement
9826 IAssignMethod now use the new interface.
9828 * expression.cs (Invocation): add a hack to EmitCall so that
9829 IndexerAccess can be the target of a compound assignment without
9830 evaluating its arguments twice.
9832 * statement.cs: Handle changes in Invocation api.
9834 2004-07-16 Martin Baulig <martin@ximian.com>
9836 * iterators.cs: Rewrote this. We're now using one single Proxy
9837 class for both the IEnumerable and the IEnumerator interface and
9838 `Iterator' derives from Class so we can use the high-level API.
9840 * class.cs (TypeContainer.AddIterator): New method.
9841 (TypeContainer.DoDefineType): New protected virtual method, which
9842 is called from DefineType().
9843 (TypeContainer.DoDefineMembers): Call DefineType() and
9844 DefineMembers() on all our iterators.
9845 (TypeContainer.Emit): Call Emit() on all our iterators.
9846 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9848 * codegen.cs (EmitContext.CurrentIterator): New public field.
9850 2004-07-15 Martin Baulig <martin@ximian.com>
9853 (TypeManager.not_supported_exception_type): New type.
9855 2004-07-14 Martin Baulig <martin@ximian.com>
9857 * iterators.cs: Use real error numbers.
9859 2004-07-14 Martin Baulig <martin@ximian.com>
9861 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9862 requires this to be a System.Collection.IEnumerable and not a
9863 class implementing that interface.
9864 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9866 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9868 * class.cs: Fixed previous fix, it broke some error tests.
9870 2004-07-12 Martin Baulig <martin@ximian.com>
9872 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9875 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9877 * assign.cs (LocalTemporary): Add new argument: is_address,If
9878 `is_address' is true, then the value that we store is the address
9879 to the real value, and not the value itself.
9881 * ecore.cs (PropertyExpr): use the new local temporary
9882 stuff to allow us to handle X.Y += z (where X is a struct)
9884 2004-07-08 Martin Baulig <martin@ximian.com>
9886 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9887 not always return, just like we're doing in Using.Resolve().
9889 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9891 * cs-parser.jay (fixed_statement): flag this as Pinned.
9893 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9895 * typemanager.cs (TypeManager): Removed MakePinned method, this
9896 mechanism is replaced with the .NET 2.x compatible mechanism of
9897 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9899 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9900 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9901 `IsFixed' property which has a different meaning.
9903 2004-07-02 Raja R Harinath <rharinath@novell.com>
9905 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9906 visible from inside a nested class, not just the names of the
9907 immediately enclosing class.
9910 2004-06-24 Raja R Harinath <rharinath@novell.com>
9912 * expression.cs (BetterConversion): Remove buggy special-case
9913 handling of "implicit constant expression conversions". At this
9914 point, we already know that the conversion is possible -- we're
9915 only checking to see which is better.
9917 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9919 * cs-parser.jay: Added error CS0210 test.
9921 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9923 * cs-parser.jay: Added error CS0134 test.
9925 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9928 * cs-parser.jay: Added error CS0145 test.
9930 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9932 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9934 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9936 * expression.cs (StackAlloc.Resolve): The argument may not
9937 be a constant; deal with this case.
9939 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9941 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9942 GetIndexerAttributeValue.
9943 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9945 * class.cs (Indexer.Define): Added error tests for CS0415,
9948 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9950 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9953 2004-06-23 Martin Baulig <martin@ximian.com>
9955 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9956 neither return nor throw, reset the barrier as well. Fixes #60457.
9958 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9960 * class.cs : EventAttributes is now set to None by default.
9961 This fixes bug #60459.
9963 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9966 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9967 Don't throw exception but return null (it's sufficient now).
9969 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9971 * typemanager.cs (GetArgumentTypes): Faster implementation.
9973 2004-06-18 Martin Baulig <martin@ximian.com>
9975 * attribute.cs (Attribute.Resolve): Check whether we're an
9976 EmptyCast which a Constant child. Fixes #60333.
9978 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9980 * statement.cs (EmitCollectionForeach): Account for the fact that
9981 not all valuetypes are in areas which we can take the address of.
9982 For these variables, we store to a temporary variable. Also, make
9983 sure that we dont emit a `callvirt' on a valuetype method.
9985 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9987 * expression.cs (StackAlloc.DoReSolve): Added test for
9988 negative parameter (CS0247).
9990 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9993 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9995 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9998 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10001 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10003 Fix bug #58254 & cs1555.cs, cs1556.cs
10004 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10006 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10008 * cs-parser.jay: Added error CS1669 test for indexers.
10010 2004-06-11 Martin Baulig <martin@ximian.com>
10012 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10013 call this twice: for params and varargs methods.
10015 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10018 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10020 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10022 * attribute.cs (Attribute.GetValidTargets): Made public.
10025 (AbstractPropertyEventMethod): New class for better code sharing.
10026 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10028 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10030 2004-06-11 Raja R Harinath <rharinath@novell.com>
10033 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
10034 that the call to Resolve is part of a MemberAccess.
10035 (Expression.Resolve): Use it for SimpleName resolution.
10036 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
10037 Add 'intermediate' boolean argument.
10038 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
10039 error message when the SimpleName can be resolved ambiguously
10040 between an expression and a type.
10041 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
10043 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
10044 call on the left-side.
10046 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10049 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
10051 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10053 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
10055 2004-06-11 Martin Baulig <martin@ximian.com>
10057 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
10058 varargs methods if applicable.
10060 2004-06-11 Martin Baulig <martin@ximian.com>
10062 * expression.cs (Invocation.EmitCall): Don't use
10063 `method.CallingConvention == CallingConventions.VarArgs' since the
10064 method could also have `CallingConventions.HasThis'.
10066 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10068 * class.cs (Event.GetSignatureForError): Implemented.
10069 Fixed crash in error test cs3010.cs
10071 2004-06-10 Miguel de Icaza <miguel@ximian.com>
10073 * cs-tokenizer.cs: Change the way we track __arglist to be
10074 consistent with the other keywords.
10076 2004-06-09 Miguel de Icaza <miguel@ximian.com>
10078 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
10081 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
10083 * codegen.cs: Check that all referenced assemblies have a strongname
10084 before strongnaming the compiled assembly. If not report error CS1577.
10085 Fix bug #56563. Patch by Jackson Harper.
10086 * typemanager.cs: Added a method to return all referenced assemblies.
10087 Fix bug #56563. Patch by Jackson Harper.
10089 2004-06-08 Marek Safar <marek.safar@seznam.cz>
10092 (Method.ApplyAttributeBuilder): Moved and added conditional
10093 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
10096 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
10098 2004-06-08 Marek Safar <marek.safar@seznam.cz>
10101 * class.cs: (EventField.attribute_targets): Changed default target.
10103 2004-06-08 Martin Baulig <martin@ximian.com>
10105 * expression.cs (Invocation.EmitCall): Enable varargs methods.
10107 2004-06-08 Martin Baulig <martin@ximian.com>
10109 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
10111 2004-06-07 Martin Baulig <martin@ximian.com>
10113 Added support for varargs methods.
10115 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
10118 * cs-parser.jay: Added support for `__arglist'.
10120 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
10122 * expression.cs (Argument.AType): Added `ArgList'.
10123 (Invocation): Added support for varargs methods.
10124 (ArglistAccess): New public class.
10125 (Arglist): New public class.
10127 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
10129 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
10130 a method's top-level block if the method has varargs.
10132 * support.cs (ReflectionParameters, InternalParameters): Added
10133 support for varargs methods.
10135 2004-06-07 Miguel de Icaza <miguel@ximian.com>
10137 * class.cs: Provide location in indexer error report.
10139 * driver.cs: Use standard names.
10141 * namespace.cs: Catch the use of using after a namespace has been
10142 declared also on using aliases.
10144 2004-06-03 Raja R Harinath <rharinath@novell.com>
10147 * typemanager.cs (closure_private_ok, closure_invocation_type)
10148 (closure_qualifier_type, closure_invocation_assembly)
10149 (FilterWithClosure): Move to ...
10150 (Closure): New internal nested class.
10151 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
10152 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
10153 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
10154 (MemberLookup, MemberLookupFailed): Use it.
10155 * expression.cs (New.DoResolve): Treat the lookup for the
10156 constructor as being qualified by the 'new'ed type.
10157 (Indexers.GetIndexersForTypeOrInterface): Update.
10159 2004-06-03 Marek Safar <marek.safar@seznam.cz>
10162 (GetConditionalAttributeValue): New method. Returns
10163 condition of ConditionalAttribute.
10164 (SearchMulti): New method. Returns all attributes of type 't'.
10165 Use it when attribute is AllowMultiple = true.
10166 (IsConditionalMethodExcluded): New method.
10169 (Method.IsExcluded): Implemented. Returns true if method has conditional
10170 attribute and the conditions is not defined (method is excluded).
10171 (IMethodData): Extended interface for ConditionalAttribute support.
10172 (PropertyMethod.IsExcluded): Implemented.
10175 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
10178 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
10181 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
10183 * expression.cs (ArrayCreationExpression): Make this just an
10184 `expression'. It can't be a statement, so the code here was
10187 2004-06-02 Marek Safar <marek.safar@seznam.cz>
10190 * typemanager.cs (GetFullNameSignature): New method for
10193 2004-06-02 Marek Safar <marek.safar@seznam.cz>
10196 * class.cs (MemberBase.GetSignatureForError): New virtual method.
10197 Use this method when MethodBuilder is null.
10198 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
10199 Added test for error CS0626 (MONO reports error for this situation).
10200 (IMethodData.GetSignatureForError): Extended interface.
10202 2004-06-01 Marek Safar <marek.safar@seznam.cz>
10205 (AttributeTester.GetObsoleteAttribute): Returns instance of
10206 ObsoleteAttribute when type is obsolete.
10209 (TypeContainer.VerifyObsoleteAttribute): Override.
10210 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10211 (MethodCode.VerifyObsoleteAttribute): Override.
10212 (MemberBase.VerifyObsoleteAttribute): Override.
10215 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10216 and report proper error.
10219 Delegate.VerifyObsoleteAttribute): Override.
10222 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10223 and report proper error.
10224 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10227 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10231 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10232 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10233 Added test for ObsoleteAttribute.
10236 (Catch): Derived from Statement.
10238 2004-06-01 Marek Safar <marek.safar@seznam.cz>
10240 Fixed bug #59071 & cs0160.cs
10242 * statement.cs (Try.Resolve): Check here whether order of catch
10243 clauses matches their dependencies.
10245 2004-05-31 Miguel de Icaza <miguel@ximian.com>
10247 * Reverted patch to namespace.cs (Use lookuptypedirect). This
10248 caused a regression: #59343. Referencing nested classes from an
10249 assembly stopped working.
10251 2004-05-31 Martin Baulig <martin@ximian.com>
10253 MCS is now frozen for beta 2.
10255 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10257 * convert.cs: add a trivial cache for overload operator resolution.
10259 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10261 * decl.cs: If possible, use lookuptypedirect here. We can only do
10262 this if there is no `.' after the namespace. Avoids using
10263 LookupType, which does lots of slow processing.
10264 (FindNestedType) New method, does what it says :-).
10265 * namespace.cs: use LookupTypeDirect.
10266 * rootcontext.cs: use membercache, if possible.
10267 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10269 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10272 According to the spec,
10274 In a member access of the form E.I, if E is a single identifier,
10275 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10276 field, property, localvariable, or parameter with the same type as
10277 the meaning of E as a type-name (§3.8), then both possible
10278 meanings of E are permitted.
10280 We did not check that E as a simple-name had the same type as E as
10283 This trivial check gives us 5-7% on bootstrap time.
10285 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10287 * expression.cs (Invocation.OverloadResolve): Avoid the
10288 use of hashtables and boxing here by allocating on demand.
10290 2004-05-30 Martin Baulig <martin@ximian.com>
10292 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10293 we're doing a silent lookup. Don't try to lookup nested types in
10294 TypeManager.object_type (thanks to Ben Maurer).
10296 2004-05-30 Martin Baulig <martin@ximian.com>
10298 Committing a patch from Ben Maurer.
10300 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10302 2004-05-29 Martin Baulig <martin@ximian.com>
10304 * class.cs (IMethodData.ShouldIgnore): New method.
10306 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10307 `Location' argument, we don't need it anywhere. Use
10308 `IMethodData.ShouldIgnore ()' instead of
10309 `MethodData.GetMethodFlags ()'.
10310 (TypeManager.AddMethod): Removed.
10311 (TypeManager.AddMethod2): Renamed to AddMethod.
10313 2004-05-29 Martin Baulig <martin@ximian.com>
10315 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10317 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10318 converting from a class type S to an interface type and we already
10319 have an object on the stack, don't box it again. Fixes #52578.
10321 2004-05-29 Martin Baulig <martin@ximian.com>
10323 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10324 Added support for `params' parameters. Fixes #59267.
10326 2004-05-29 Martin Baulig <martin@ximian.com>
10328 * literal.cs (NullPointer): Provide a private .ctor which sets
10329 `type' to TypeManager.object_type. Fixes #59048.
10331 2004-05-29 Martin Baulig <martin@ximian.com>
10333 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10334 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10336 * ecore.cs (EventExpr.instance_expr): Make the field private.
10338 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10340 Fixed bug #50080 & cs0214-2.cs
10341 * expression.cs (Cast.DoResolve): Check unsafe context here.
10343 * statement.cs (Resolve.DoResolve): Likewise.
10345 2004-05-26 Martin Baulig <martin@ximian.com>
10347 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10349 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10350 (RootContext.LookupType): Pass down the `silent' flag.
10352 2004-05-25 Martin Baulig <martin@ximian.com>
10355 (MethodGroupExpr.IdenticalTypeName): New public property.
10356 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10357 expression actually refers to a type.
10359 2004-05-25 Martin Baulig <martin@ximian.com>
10361 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10362 for #56176 and made it actually work.
10364 2004-05-25 Martin Baulig <martin@ximian.com>
10366 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10367 (FieldExpr, PropertyExpr): Override and implement
10368 CacheTemporaries. Fixes #52279.
10370 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10372 * location.cs: In the new compiler listing a file twice is a
10373 warning, not an error.
10375 2004-05-24 Martin Baulig <martin@ximian.com>
10377 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10378 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10380 2004-05-24 Martin Baulig <martin@ximian.com>
10382 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10383 walking the `using' list. Fixes #53921.
10385 2004-05-24 Martin Baulig <martin@ximian.com>
10387 * const.cs (Const.LookupConstantValue): Added support for
10388 EmptyCast's; fixes #55251.
10390 2004-05-24 Martin Baulig <martin@ximian.com>
10392 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10393 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10394 which does the CS0135 check. The reason is that we first need to
10395 check whether the variable actually exists.
10397 2004-05-24 Martin Baulig <martin@ximian.com>
10399 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10400 than RootContext.LookupType() to find the explicit interface
10401 type. Fixes #58584.
10403 2004-05-24 Raja R Harinath <rharinath@novell.com>
10405 * Makefile: Simplify. Use executable.make.
10406 * mcs.exe.sources: New file. List of sources of mcs.exe.
10408 2004-05-24 Anders Carlsson <andersca@gnome.org>
10412 Use the invariant culture when doing String.Compare for CLS case
10415 2004-05-23 Martin Baulig <martin@ximian.com>
10417 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10418 don't have any dots. Fixes #52622, added cs0246-8.cs.
10420 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10422 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10424 * class.cs (MemberBase.Define): Reuse MemberType member for
10425 resolved type. Other methods can use it too.
10427 2004-05-23 Martin Baulig <martin@ximian.com>
10429 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10430 the variable also exists in the current block (otherwise, we need
10431 to report a CS0103). Fixes #58670.
10433 2004-05-23 Martin Baulig <martin@ximian.com>
10435 * flowanalysis.cs (Reachability.Reachable): Compute this
10436 on-the-fly rather than storing it as a field.
10438 2004-05-23 Martin Baulig <martin@ximian.com>
10440 * flowanalysis.cs (Reachability.And): Manually compute the
10441 resulting `barrier' from the reachability.
10443 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10446 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10447 instance of ObsoleteAttribute when symbol is obsolete.
10450 (IMethodData): Extended interface for ObsoleteAttribute support.
10452 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10454 * attribute.cs: Fix bug #55970
10456 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10460 (GetObsoleteAttribute): New method. Creates the instance of
10462 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10463 ObsoleteAttribute when member is obsolete.
10464 (AttributeTester.Report_ObsoleteMessage): Common method for
10465 Obsolete error/warning reporting.
10468 (TypeContainer.base_classs_type): New member for storing parent type.
10471 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10472 for this MemberCore.
10474 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10476 * attribute.cs, const.cs: Fix bug #58590
10478 2004-05-21 Martin Baulig <martin@ximian.com>
10480 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10481 out parameters if the end of the method is unreachable. Fixes
10484 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10486 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10487 Hari was right, why extra method.
10489 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10491 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10493 2004-05-20 Martin Baulig <martin@ximian.com>
10495 Merged this back from gmcs to keep the differences to a minumum.
10497 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
10498 instead of a Declspace.
10499 (Attribute.ResolveType): Likewise.
10500 (Attributes.Search): Likewise.
10501 (Attributes.Contains): Likewise.
10502 (Attributes.GetClsCompliantAttribute): Likewise.
10504 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
10506 (MethodData.ApplyAttributes): Take an EmitContext instead of a
10509 2004-05-19 Marek Safar <marek.safar@seznam.cz>
10511 Fix bug #58688 (MCS does not report error when the same attribute
10514 * attribute.cs (Attribute.Emit): Distinction between null and default.
10516 2004-05-19 Raja R Harinath <rharinath@novell.com>
10518 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10519 of a top-level attribute without an attribute target.
10520 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
10522 (Attribute.Conditional_GetConditionName),
10523 (Attribute.Obsolete_GetObsoleteMessage): Update.
10524 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
10525 part of ScanForIndexerName.
10526 (Attribute.CanIgnoreInvalidAttribute): New function.
10527 (Attribute.ScanForIndexerName): Move to ...
10528 (Attributes.ScanForIndexerName): ... here.
10529 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10530 (Attributes.Search): New internal variant that can choose not to
10531 complain if types aren't resolved. The original signature now
10533 (Attributes.GetClsCompliantAttribute): Use internal variant, with
10534 complaints suppressed.
10535 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10536 only if it not useful.
10537 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10538 top-level for attributes that are shared between the assembly
10539 and a top-level class.
10540 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10541 * class.cs: Update to reflect changes.
10542 (DefineIndexers): Fuse loops.
10543 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
10544 a couple more variants of attribute names.
10546 2004-05-18 Marek Safar <marek.safar@seznam.cz>
10548 Fix bug #52585 (Implemented explicit attribute declaration)
10551 (Attributable.ValidAttributeTargets): New abstract method. It gets
10552 list of valid attribute targets for explicit target declaration.
10553 (Attribute.Target): It holds target itself.
10554 (AttributeSection): Removed.
10555 (Attribute.CheckTargets): New method. It checks whether attribute
10556 target is valid for the current element.
10559 (EventProperty): New class. For events that are declared like
10560 property (with add and remove accessors).
10561 (EventField): New class. For events that are declared like field.
10564 * cs-parser.jay: Implemented explicit attribute target declaration.
10566 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10567 Override ValidAttributeTargets.
10570 (ReturnParameter): Class for applying custom attributes on
10572 (ParameterAtribute): New class. Class for applying custom
10573 attributes on the parameter type.
10575 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10577 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10580 (Method): Allow UNSAFE here.
10582 * modifiers.cs: Support unsafe reporting.
10584 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10586 * decl.cs: Fix bug #58478.
10588 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10590 * statement.cs: When checking for unreachable code on an EmptyStatement,
10591 set the location. Fixes bug #58488.
10593 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10595 * driver.cs: Add -pkg handling.
10597 From Gonzalo: UseShelLExecute=false
10599 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10602 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10604 (Attribute.IsClsCompliaceRequired): Moved to base for better
10606 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10607 when attribute is AttributeUsageAttribute.
10608 (Attribute.GetValidTargets): Simplified.
10609 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10610 attribute for this type.
10611 (Attribute.ApplyAttributes): Method renamed to Emit and make
10613 (GlobalAttributeSection): New class for special handling of global
10614 attributes (assembly, module).
10615 (AttributeSection.Emit): New method.
10617 * class.cs: Implemented Attributable abstract methods.
10618 (MethodCore.LabelParameters): Moved to Parameter class.
10619 (Accessor): Is back simple class.
10620 (PropertyMethod): Implemented Attributable abstract class.
10621 (DelegateMethod): Implemented Attributable abstract class.
10622 (Event): New constructor for disctintion between normal Event
10623 and Event with accessors.
10625 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10627 * codegen.cs, const.cs, decl.cs, delegate.cs:
10628 (CommonAssemblyModulClass): Implemented Attributable abstract class
10631 * enum.cs: Implement IAttributeSupport interface.
10632 (EnumMember): New class for emum members. Implemented Attributable
10636 (ParameterBase): Is abstract.
10637 (ReturnParameter): New class for easier [return:] attribute handling.
10639 * typemanager.cs: Removed builder_to_attr.
10641 2004-05-11 Raja R Harinath <rharinath@novell.com>
10644 * attribute.cs (Attribute.GetPositionalValue): New function.
10645 * class.cs (TypeContainer.VerifyMembers): New function.
10646 (TypeContainer.Emit): Use it.
10647 (ClassOrStruct): New base class for Class and Struct.
10648 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
10649 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10651 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10652 then each non-static field should have a FieldOffset attribute.
10653 Otherwise, none of the fields should have a FieldOffset attribute.
10654 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
10655 and FieldOffset attributes.
10656 * typemanager.cs (TypeManager.struct_layout_attribute_type)
10657 (TypeManager.field_offset_attribute_type): New core types.
10658 (TypeManager.InitCoreTypes): Initialize them.
10660 2004-05-11 Michal Moskal <malekith@pld-linux.org>
10662 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10663 Return correct type.
10666 2004-05-09 Miguel de Icaza <miguel@ximian.com>
10668 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10669 be implicitly converted to ulong.
10671 * expression.cs: The logic for allowing operator &, | and ^ worked
10672 was wrong, it worked before because we did not report an error in
10673 an else branch. Fixes 57895.
10675 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10676 allow volatile fields to be reference types.
10678 2004-05-07 Miguel de Icaza <miguel@ximian.com>
10680 * driver.cs: Add support for /debug-
10682 2004-05-07 Raja R Harinath <rharinath@novell.com>
10684 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
10685 Add a 'complain' parameter to silence errors.
10686 (Attribute.Resolve): Update to changes. Put in sanity check to catch
10687 silently overlooked type-resolutions.
10688 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10689 to reflect changes.
10690 (Attributes.Search): New function.
10691 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10692 (Attributes.GetAttributeFullName): Remove hack.
10693 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
10694 Update to reflect changes.
10695 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10696 Use Attributes.Search instead of nested loops.
10698 2004-05-07 Marek Safar <marek.safar@seznam.cz>
10701 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10702 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10703 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10705 * report.cs: (Report.Warning): Renamed to Warning_T because of
10706 parameter collision.
10708 2004-05-05 Raja R Harinath <rharinath@novell.com>
10710 * expression.cs (MemberAccess.ResolveMemberAccess):
10711 Exit with non-zero status after Report.Error.
10712 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10714 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10716 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10718 * support.cs: Don't hang when the file is empty.
10720 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10722 * support.cs: In SeekableStreamReader, compute the preamble size of the
10723 underlying stream. Position changes should take into account that initial
10726 2004-05-03 Todd Berman <tberman@sevenl.net>
10728 * driver.cs: remove unused GetSysVersion function.
10730 2004-05-03 Todd Berman <tberman@sevenl.net>
10732 * driver.cs: Remove the hack from saturday, as well as the hack
10733 from jackson (LoadAssemblyFromGac), also adds the CWD to the
10734 link_paths to get that bit proper.
10736 2004-05-01 Todd Berman <tberman@sevenl.net>
10738 * driver.cs: Try a LoadFrom before a Load, this checks the current
10739 path. This is currently a bug in mono that is be fixed, however, this
10740 provides a workaround for now. This will be removed when the bug
10743 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
10745 * CryptoConvert.cs: Updated to latest version. Fix issue with
10746 incomplete key pairs (#57941).
10748 2004-05-01 Todd Berman <tberman@sevenl.net>
10750 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10753 2004-04-30 Jackson Harper <jackson@ximian.com>
10755 * codegen.cs: Open keys readonly.
10757 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10759 * typemanager.cs: don't report cyclic struct layout when a struct
10760 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10761 which has 2 Pango.Rectangle fields.
10763 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
10765 * expression.cs: Handle IntPtr comparisons with IL code
10766 rather than a method call.
10768 2004-04-29 Martin Baulig <martin@ximian.com>
10770 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
10771 the list of PropertyInfo's in class hierarchy and find the
10772 accessor. Fixes #56013.
10774 2004-04-29 Martin Baulig <martin@ximian.com>
10776 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10778 2004-04-29 Martin Baulig <martin@ximian.com>
10780 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10782 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10784 2004-04-29 Martin Baulig <martin@ximian.com>
10786 * class.cs (ConstructorInitializer.Resolve): Check whether the
10787 parent .ctor is accessible. Fixes #52146.
10789 2004-04-29 Martin Baulig <martin@ximian.com>
10791 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10793 * statement.cs (Using.EmitLocalVariableDecls): Use
10794 TypeManager.idisposable_type, not typeof (IDisposable).
10795 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10797 2004-04-29 Martin Baulig <martin@ximian.com>
10799 * class.cs (Event.Define): Don't emit the field and don't set
10800 RTSpecialName and SpecialName for events on interfaces. Fixes
10803 2004-04-29 Raja R Harinath <rharinath@novell.com>
10805 Refactor Attribute.ApplyAttributes.
10806 * attribute.cs (Attributable): New base class for objects that can
10807 have Attributes applied on them.
10808 (Attribute): Make AttributeUsage fields public.
10809 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10810 (Attribute.IsInternalCall): New property.
10811 (Attribute.UsageAttr): Convert to a public read-only property.
10812 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10813 (Attribute.ResolveType, Attribute.Resolve)
10814 (Attribute.ScanForIndexerName): Update to reflect changes.
10815 (Attribute.CheckAttributeTarget): Re-format.
10816 (Attribute.ApplyAttributes): Refactor, to various
10817 Attributable.ApplyAttributeBuilder methods.
10818 * decl.cs (MemberCore): Make Attributable.
10819 * class.cs (Accessor): Make Attributable.
10820 (MethodData.ApplyAttributes): Use proper attribute types, not
10822 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10823 (TypeContainer.ApplyAttributeBuilder)
10824 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10825 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10826 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10827 (Operator.ApplyAttributeBuilder): New factored-out methods.
10828 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10829 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10830 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10831 * parameter.cs (ParameterBase): New Attributable base class
10832 that can also represent Return types.
10833 (Parameter): Update to the changes.
10835 2004-04-29 Jackson Harper <jackson@ximian.com>
10837 * driver.cs: Prefer the corlib system version when looking for
10838 assemblies in the GAC. This is still a hack, but its a better hack
10841 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10843 * decl.cs, enum.cs: Improved error 3005 reporting.
10845 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10846 (related_symbols): New private member for list of symbols
10847 related to reported error/warning.
10849 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10851 2004-04-29 Martin Baulig <martin@ximian.com>
10853 * ecore.cs (Expression.Constantify): If we're an enum and
10854 TypeManager.TypeToCoreType() doesn't give us another type, use
10855 t.UnderlyingSystemType. Fixes #56178.
10857 2004-04-29 Martin Baulig <martin@ximian.com>
10859 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10860 interfaces and for each interface, only add members directly
10861 declared in that interface. Fixes #53255.
10863 2004-04-28 Martin Baulig <martin@ximian.com>
10865 * expression.cs (ConditionalLogicalOperator): Use a temporary
10866 variable for `left' to avoid that we evaluate it more than once;
10869 2004-04-28 Martin Baulig <martin@ximian.com>
10871 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10874 2004-04-28 Martin Baulig <martin@ximian.com>
10876 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10879 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10880 whether the type is not void (CS1547).
10882 2004-04-28 Martin Baulig <martin@ximian.com>
10884 * expression.cs (Unary.DoResolveLValue): Override this and report
10885 CS0131 for anything but Operator.Indirection.
10887 2004-04-28 Martin Baulig <martin@ximian.com>
10889 Committing a patch from Ben Maurer; see bug #50820.
10891 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10894 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10897 2004-04-28 Martin Baulig <martin@ximian.com>
10899 Committing a patch from Ben Maurer; see bug #50820.
10901 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10904 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10907 2004-04-28 Martin Baulig <martin@ximian.com>
10909 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10910 (Block.AddLabel): Call DoLookupLabel() to only search in the
10913 2004-04-28 Martin Baulig <martin@ximian.com>
10915 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10916 comparing StringConstants and NullLiterals in Equality and Inequality.
10918 2004-04-28 Jackson Harper <jackson@ximian.com>
10920 * driver.cs: Attempt to load referenced assemblies from the
10921 GAC. This is the quick and dirty version of this method that
10922 doesnt take into account versions and just takes the first
10923 canidate found. Will be good enough for now as we will not have more
10924 then one version installed into the GAC until I update this method.
10926 2004-04-28 Martin Baulig <martin@ximian.com>
10928 * typemanager.cs (TypeManager.CheckStructCycles): New public
10929 static method to check for cycles in the struct layout.
10931 * rootcontext.cs (RootContext.PopulateTypes): Call
10932 TypeManager.CheckStructCycles() for each TypeContainer.
10933 [Note: We only need to visit each type once.]
10935 2004-04-28 Martin Baulig <martin@ximian.com>
10937 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10939 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10940 success and added `out object value'. Use a `bool resolved' field
10941 to check whether we've already been called rather than
10942 `ConstantValue != null' since this breaks for NullLiterals.
10944 2004-04-28 Raja R Harinath <rharinath@novell.com>
10946 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10947 setting of this flag, since the 'set' method may be non-public.
10949 2004-04-28 Raja R Harinath <rharinath@novell.com>
10951 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10952 check on current_vector.Block.
10954 2004-04-27 Martin Baulig <martin@ximian.com>
10956 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10957 a field initializer. Fixes #56459.
10959 2004-04-27 Martin Baulig <martin@ximian.com>
10961 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10962 we're not attempting to use an indexer. Fixes #52154.
10964 2004-04-27 Martin Baulig <martin@ximian.com>
10966 * statement.cs (Return): Don't create a return label if we don't
10967 need it; reverts my change from January 20th. Thanks to Ben
10970 2004-04-27 Martin Baulig <martin@ximian.com>
10972 According to the spec, `goto' can only leave a nested scope, but
10975 * statement.cs (Block.LookupLabel): Only lookup in the current
10976 block, don't recurse into parent or child blocks.
10977 (Block.AddLabel): Check in parent and child blocks, report
10978 CS0140/CS0158 if we find a duplicate.
10979 (Block): Removed this indexer for label lookups.
10980 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10981 this already does the error reporting for us.
10984 (FlowBranching.UsageVector.Block): New public variable; may be null.
10985 (FlowBranching.CreateSibling): Added `Block' argument.
10986 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10987 label for the target of a `goto' and check whether we're not
10988 leaving a `finally'.
10990 2004-04-27 Martin Baulig <martin@ximian.com>
10992 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10993 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10996 2004-04-27 Martin Baulig <martin@ximian.com>
10998 * statement.cs (Block.AddLabel): Also check for implicit blocks
10999 and added a CS0158 check.
11001 2004-04-27 Martin Baulig <martin@ximian.com>
11003 * flowanalysis.cs (FlowBranchingLoop): New class.
11004 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11005 UsageVector's instead of an ArrayList.
11006 (FlowBranching.Label): Likewise.
11007 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11008 (FlowBranching.AddBreakVector): New method.
11010 2004-04-27 Miguel de Icaza <miguel@ximian.com>
11012 * attribute.cs: Small regression fix: only convert the type if we
11013 the type is different, fixes System.Drawing build.
11015 2004-04-27 Martin Baulig <martin@ximian.com>
11017 * attribute.cs (Attribute.Resolve): If we have a constant value
11018 for a named field or property, implicity convert it to the correct
11021 2004-04-27 Raja R Harinath <rharinath@novell.com>
11023 * statement.cs (Block.Block): Implicit blocks share
11024 'child_variable_names' fields with parent blocks.
11025 (Block.AddChildVariableNames): Remove.
11026 (Block.AddVariable): Mark variable as "used by a child block" in
11027 every surrounding block.
11028 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11029 been used in a child block, complain about violation of "Invariant
11030 meaning in blocks" rule.
11031 * cs-parser.jay (declare_local_variables): Don't use
11032 AddChildVariableNames.
11033 (foreach_statement): Don't create an implicit block: 'foreach'
11034 introduces a scope.
11036 2004-04-23 Miguel de Icaza <miguel@ximian.com>
11038 * convert.cs (ImplicitNumericConversion): 0 is also positive when
11039 converting from 0L to ulong. Fixes 57522.
11041 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11043 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11044 derived class hides via 'new' keyword field from base class (test-242.cs).
11045 TODO: Handle this in the more general way.
11047 * class.cs (CheckBase): Ditto.
11049 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11051 * decl.cs (caching_flags): New member for storing cached values
11053 (MemberCore.Flags): New enum where bit flags for caching_flags
11055 (MemberCore.cls_compliance): Moved to caching_flags.
11056 (DeclSpace.Created): Moved to caching_flags.
11058 * class.cs: Use caching_flags instead of DeclSpace.Created
11060 2004-04-21 Miguel de Icaza <miguel@ximian.com>
11062 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11063 if we are only a derived class, not a nested class.
11065 * typemanager.cs: Same as above, but do this at the MemberLookup
11066 level (used by field and methods, properties are handled in
11067 PropertyExpr). Allow for the qualified access if we are a nested
11070 2004-04-21 Marek Safar <marek.safar@seznam.cz>
11072 * class.cs: Refactoring.
11073 (IMethodData): New inteface; Holds links to parent members
11074 to avoid member duplication (reduced memory allocation).
11075 (Method): Implemented IMethodData interface.
11076 (PropertyBase): New inner classes for get/set methods.
11077 (PropertyBase.PropertyMethod): Implemented IMethodData interface
11078 (Event): New inner classes for add/remove methods.
11079 (Event.DelegateMethod): Implemented IMethodData interface.
11081 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11082 EmitContext (related to class.cs refactoring).
11084 2004-04-21 Raja R Harinath <rharinath@novell.com>
11086 * delegate.cs (Delegate.VerifyApplicability): If the number of
11087 arguments are the same as the number of parameters, first try to
11088 verify applicability ignoring any 'params' modifier on the last
11092 2004-04-16 Raja R Harinath <rharinath@novell.com>
11094 * class.cs (TypeContainer.AddIndexer): Use
11095 'ExplicitInterfaceName' to determine if interface name was
11096 explicitly specified. 'InterfaceType' is not initialized at this time.
11097 (TypeContainer.DefineIndexers): Remove use of temporary list. The
11098 Indexers array is already in the required order. Initialize
11099 'IndexerName' only if there are normal indexers.
11100 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11101 (TypeContainer.Emit): Emit DefaultMember attribute only if
11102 IndexerName is initialized.
11105 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
11107 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11110 2004-04-15 Raja R Harinath <rharinath@novell.com>
11112 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11116 * attribute.cs (Attribute.Resolve): Check for duplicate named
11120 2004-04-15 Miguel de Icaza <miguel@ximian.com>
11122 * iterators.cs (MarkYield): track whether we are in an exception,
11123 and generate code accordingly. Use a temporary value to store the
11124 result for our state.
11126 I had ignored a bit the interaction of try/catch with iterators
11127 since their behavior was not entirely obvious, but now it is
11128 possible to verify that our behavior is the same as MS .NET 2.0
11132 2004-04-14 Miguel de Icaza <miguel@ximian.com>
11134 * iterators.cs: Avoid creating temporaries if there is no work to
11137 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11138 Enumerations, use TypeManager.EnumToUnderlying and call
11141 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11144 (This.Emit): Use EmitContext.EmitThis to emit our
11147 (This.EmitAssign): Ditto.
11149 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11150 codepaths, we will move all the functionality into
11153 (FieldExpr.EmitAssign): Ditto.
11155 This fixes several hidden bugs that I uncovered while doing a code
11156 review of this today.
11158 * codegen.cs (EmitThis): reworked so the semantics are more clear
11159 and also support value types "this" instances.
11161 * iterators.cs: Changed so that for iterators in value types, we
11162 do not pass the value type as a parameter.
11164 Initialization of the enumerator helpers is now done in the caller
11165 instead of passing the parameters to the constructors and having
11166 the constructor set the fields.
11168 The fields have now `assembly' visibility instead of private.
11170 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11172 * expression.cs (Argument.Resolve): Check if fields passed as ref
11173 or out are contained in a MarshalByRefObject.
11175 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11176 another compiler type.
11178 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11180 * class.cs (Indexer.Define): use the new name checking method.
11181 Also, return false on an error.
11182 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11183 (is_identifier_[start/part]_character): make static.
11185 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11187 * expression.cs (Binary.ResolveOperator): Do no append strings
11188 twice: since we can be invoked more than once (array evaluation)
11189 on the same concatenation, take care of this here. Based on a fix
11190 from Ben (bug #56454)
11192 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11194 * codegen.cs: Fix another case where CS1548 must be reported (when
11195 delay-sign isn't specified and no private is available #56564). Fix
11196 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11197 error when MCS is used on the MS runtime and we need to delay-sign
11198 (which seems unsupported by AssemblyBuilder - see #56621).
11200 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11202 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11203 (TypeManager.ComputeNamespaces): Faster implementation for
11206 * compiler.csproj: Updated AssemblyName to mcs.
11208 2004-04-07 Miguel de Icaza <miguel@ximian.com>
11210 * rootcontext.cs: Add new types to the boot resolution.
11212 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11213 MulticastDelegate is not allowed.
11215 * typemanager.cs: Add new types to lookup: System.TypedReference
11218 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11219 check for TypedReference or ArgIterator, they are not allowed.
11221 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11222 makes us properly catch 1510 in some conditions (see bug 56016 for
11225 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
11227 * CryptoConvert.cs: update from corlib version
11230 2004-04-05 Miguel de Icaza <miguel@ximian.com>
11232 * class.cs (Indexer.Define): Check indexername declaration
11234 2004-04-05 Marek Safar <marek.safar@seznam.cz>
11236 * attribute.cs (IsClsCompliant): Fixed problem with handling
11237 all three states (compliant, not-compliant, undetected).
11239 2004-03-30 Marek Safar <marek.safar@seznam.cz>
11241 * attribute.cs (Attribute): Location is now public.
11242 (Resolve): Store resolved arguments (pos_values) in attribute class.
11243 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11244 (GetClsCompliantAttributeValue): New method that gets
11245 CLSCompliantAttribute value.
11246 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11247 if exists else null.
11248 (AttributeTester): New class for CLS-Compliant verification routines.
11250 * class.cs (Emit): Add CLS-Compliant verification.
11251 (Method.GetSignatureForError): Implemented.
11252 (Constructor.GetSignatureForError): Implemented
11253 (Constructor.HasCompliantArgs): Returns if constructor has
11254 CLS-Compliant arguments.
11255 (Constructor.Emit): Override.
11256 (Construcor.IsIdentifierClsCompliant): New method; For constructors
11257 is needed to test only parameters.
11258 (FieldBase.GetSignatureForError): Implemented.
11259 (TypeContainer): New member for storing base interfaces.
11260 (TypeContainer.FindMembers): Search in base interfaces too.
11262 * codegen.cs (GetClsComplianceAttribute): New method that gets
11263 assembly or module CLSCompliantAttribute value.
11264 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11266 (ModuleClass.Emit): Add error 3012 test.
11268 * const.cs (Emit): Override and call base for CLS-Compliant tests.
11270 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11271 state for all decl types.
11272 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11273 if CLS-Compliant tests are required.
11274 (IsClsCompliaceRequired): New method. Analyze whether code
11275 must be CLS-Compliant.
11276 (IsExposedFromAssembly): New method. Returns true when MemberCore
11277 is exposed from assembly.
11278 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11279 value or gets cached value.
11280 (HasClsCompliantAttribute): New method. Returns true if MemberCore
11281 is explicitly marked with CLSCompliantAttribute.
11282 (IsIdentifierClsCompliant): New abstract method. This method is
11283 used to testing error 3005.
11284 (IsIdentifierAndParamClsCompliant): New method. Common helper method
11285 for identifier and parameters CLS-Compliant testing.
11286 (VerifyClsCompliance): New method. The main virtual method for
11287 CLS-Compliant verifications.
11288 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11289 null. I don't know why is null (too many public members !).
11290 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11291 and get value of first CLSCompliantAttribute that found.
11293 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11294 (VerifyClsCompliance): Override and add extra tests.
11296 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11297 clscheck- disable CLS-Compliant verification event if assembly is has
11298 CLSCompliantAttribute(true).
11300 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11301 ApllyAttribute is now called in emit section as in the other cases.
11302 Possible future Emit integration.
11303 (IsIdentifierClsCompliant): New override.
11304 (VerifyClsCompliance): New override.
11305 (GetEnumeratorName): Returns full enum name.
11307 * parameter.cs (GetSignatureForError): Implemented.
11309 * report.cs (WarningData): New struct for Warning message information.
11310 (LocationOfPreviousError): New method.
11311 (Warning): New method. Reports warning based on the warning table.
11312 (Error_T): New method. Reports error based on the error table.
11314 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11315 verifications are done here.
11317 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11319 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11320 CLSCompliantAttribute.
11321 (all_imported_types): New member holds all imported types from other
11323 (LoadAllImportedTypes): New method fills static table with exported types
11324 from all referenced assemblies.
11325 (Modules): New property returns all assembly modules.
11327 2004-03-30 Miguel de Icaza <miguel@ximian.com>
11329 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11330 throwing a parser error.
11332 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11333 which removes the hardcoded get_/set_ prefixes for properties, as
11334 IL allows for the properties to be named something else.
11338 * expression.cs: Do not override operand before we know if it is
11339 non-null. Fix 56207
11341 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11343 * typemanager.cs: support for pinned variables.
11345 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11347 * decl.cs, typemanager.cs: Avoid using an arraylist
11348 as a buffer if there is only one result set.
11350 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11352 * expression.cs: Make sure you cant call a static method
11353 with an instance expression, bug #56174.
11355 2004-03-29 Miguel de Icaza <miguel@ximian.com>
11357 * class.cs (IsDuplicateImplementation): Improve error reporting to
11358 flag 663 (method only differs in parameter modifier).
11360 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11361 in preprocessor directives.
11363 * location.cs (LookupFile): Allow for the empty path.
11365 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
11366 better approach for some of that patch, but its failing with the
11367 CharSet enumeration. For now try/catch will do.
11369 * typemanager.cs: Do not crash if a struct does not have fields.
11372 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11374 * expression.cs: cs0213, cant fix a fixed expression.
11377 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11379 * cs-parser.jay: detect invalid embeded statements gracefully.
11382 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11384 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11387 the invocation type may not be a subclass of the tye of the item/
11388 The type of the item must be a subclass of the invocation item.
11393 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
11395 * attribute.cs: Added methods to get a string and a bool from an
11396 attribute. Required to information from AssemblyKeyFileAttribute,
11397 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11398 * codegen.cs: Modified AssemblyName creation to include support for
11399 strongnames. Catch additional exceptions to report them as CS1548.
11400 * compiler.csproj: Updated include CryptoConvert.cs.
11401 * compiler.csproj.user: Removed file - user specific configuration.
11402 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
11403 Mono.Security assembly. The original class is maintained and tested in
11404 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11405 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11406 like CSC 8.0 (C# v2) supports.
11407 * Makefile: Added CryptoConvert.cs to mcs sources.
11408 * rootcontext.cs: Added new options for strongnames.
11410 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
11412 * driver.cs: For --expect-error, report error code `2'
11413 if the program compiled with no errors, error code `1' if
11414 it compiled with an error other than the one expected.
11416 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
11418 * compiler.csproj: Updated for Visual Studio .NET 2003.
11419 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11420 * compiler.sln: Updated for Visual Studio .NET 2003.
11422 2004-03-24 Ravi Pratap M <ravi@ximian.com>
11424 * expression.cs: Fix bug #47234. We basically need to apply the
11425 rule that we prefer the conversion of null to a reference type
11426 when faced with a conversion to 'object' (csc behaviour).
11428 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11430 * statement.cs: Shorter form for foreach, eliminates
11431 a local variable. r=Martin.
11433 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11435 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11436 checks if we can use brtrue/brfalse to test for 0.
11437 * expression.cs: use the above in the test for using brtrue/brfalse.
11438 cleanup code a bit.
11440 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11442 * expression.cs: Rewrite string concat stuff. Benefits:
11444 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11445 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11446 rather than a concat chain.
11448 * typemanager.cs: Add lookups for more concat overloads.
11450 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11452 * expression.cs: Emit shorter il code for array init.
11469 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
11471 * statement.cs: Before, two switch blocks would be merged if the
11472 total size of the blocks (end_item - begin_item + 1) was less than
11473 two times the combined sizes of the blocks.
11475 Now, it will only merge if after the merge at least half of the
11480 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
11482 * class.cs : csc build fix for GetMethods(). See bug #52503.
11484 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
11486 * expression.cs: Make sure fp comparisons work with NaN.
11487 This fixes bug #54303. Mig approved this patch a long
11488 time ago, but we were not able to test b/c the runtime
11491 2004-03-19 Miguel de Icaza <miguel@ximian.com>
11493 * ecore.cs (TypExpr.GetHashCode): implement this overload.
11495 2004-03-19 Martin Baulig <martin@ximian.com>
11497 * class.cs (MemberCore.IsDuplicateImplementation): Report the
11498 error here and not in our caller.
11500 2004-03-19 Martin Baulig <martin@ximian.com>
11502 * interface.cs: Completely killed this file.
11503 (Interface): We're now a TypeContainer and live in class.cs.
11505 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11506 argument; we're now also called for interfaces.
11507 (TypeContainer.DefineMembers): Allow this method being called
11509 (TypeContainer.GetMethods): New public method; formerly known as
11510 Interface.GetMethod(). This is used by PendingImplementation.
11511 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11512 it's now private and non-static.
11513 (Interface): Moved this here; it's now implemented similar to
11515 (Method, Property, Event, Indexer): Added `bool is_interface'
11516 argument to their .ctor's.
11517 (MemberBase.IsInterface): New public field.
11519 * cs-parser.jay: Create normal Method, Property, Event, Indexer
11520 instances instead of InterfaceMethod, InterfaceProperty, etc.
11521 (opt_interface_base): Removed; we now use `opt_class_base' instead.
11522 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11524 2004-03-19 Martin Baulig <martin@ximian.com>
11526 * class.cs (MethodCore.IsDuplicateImplementation): New private
11527 method which does the CS0111 checking.
11528 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11529 Use IsDuplicateImplementation().
11531 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
11533 * decl.cs (FindMemberToOverride): New method to find the correct
11534 method or property to override in the base class.
11536 - Make Method/Property use the above method to find the
11537 version in the base class.
11538 - Remove the InheritableMemberSignatureCompare as it is now
11541 This patch makes large code bases much faster to compile, as it is
11542 O(n) rather than O(n^2) to do this validation.
11544 Also, it fixes bug 52458 which is that nested classes are not
11545 taken into account when finding the base class member.
11547 Reviewed/Approved by Martin.
11549 2004-03-17 Marek Safar <marek.safar@seznam.cz>
11551 * interface.cs: In all interface classes removed redundant
11552 member initialization.
11554 2004-03-16 Martin Baulig <martin@ximian.com>
11556 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11558 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11560 * decl.cs (DefineTypeAndParents): New helper method to define a
11561 type's containers before the type itself is defined; This is a
11562 bug exposed by the recent changes to Windows.Forms when an
11563 implemented interface was defined inside a class that had not been
11566 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11568 (Check): Loop correctly to report errors modifiers
11569 (UNSAFE was not in the loop, since it was the same as TOP).
11571 * interface.cs: Every interface member now takes a ModFlags,
11572 instead of a "is_new" bool, which we set on the base MemberCore.
11574 Every place where we called "UnsafeOk" in the interface, now we
11575 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11576 the unsafe settings from the member declaration instead of the
11577 container interface.
11579 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11581 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11582 `set_indexer_name' to the pending bits (one per type).
11584 We fixed a bug today that was picking the wrong method to
11585 override, since for properties the existing InterfaceMethod code
11586 basically ignored the method name. Now we make sure that the
11587 method name is one of the valid indexer names.
11589 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11591 * support.cs (SeekableStreamReader): Keep track of stream byte
11592 positions and don't mix them with character offsets to the buffer.
11594 Patch from Gustavo Giráldez
11596 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11598 * interface.cs (InterfaceSetGetBase): Removed double member
11599 initialization, base class does it as well.
11601 2004-03-13 Martin Baulig <martin@ximian.com>
11603 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11604 when compiling corlib.
11606 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11608 * convert.cs (ExplicitConversion): We were reporting an error on
11609 certain conversions (object_type source to a value type, when the
11610 expression was `null') before we had a chance to pass it through
11611 the user defined conversions.
11613 * driver.cs: Replace / and \ in resource specifications to dots.
11616 * class.cs: Add check for duplicate operators. Fixes 52477
11618 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11620 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11621 that are in the middle of the statements, not only at the end.
11624 * class.cs (TypeContainer.AddField): No longer set the
11625 `HaveStaticConstructor' flag, now we call it
11626 `UserDefineStaticConstructor' to diferentiate the slightly
11627 semantic difference.
11629 The situation is that we were not adding BeforeFieldInit (from
11630 Modifiers.TypeAttr) to classes that could have it.
11631 BeforeFieldInit should be set to classes that have no static
11636 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11638 And most importantly Zoltan's comment:
11640 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11642 "I think beforefieldinit means 'it's ok to initialize the type sometime
11643 before its static fields are used', i.e. initialization does not need
11644 to be triggered by the first access to the type. Setting this flag
11645 helps the JIT to compile better code, since it can run the static
11646 constructor at JIT time, and does not need to generate code to call it
11647 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11648 this flag for lots of classes like String.
11650 csc sets this flag if the type does not have an explicit static
11651 constructor. The reasoning seems to be that if there are only static
11652 initalizers for a type, and no static constructor, then the programmer
11653 does not care when this initialization happens, so beforefieldinit
11656 This bug prevents the AOT compiler from being usable, since it
11657 generates so many calls to mono_runtime_class_init that the AOT code
11658 is much slower than the JITted code. The JITted code is faster,
11659 because it does not generate these calls if the vtable is type is
11660 already initialized, which is true in the majority of cases. But the
11661 AOT compiler can't do this."
11663 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11665 * class.cs (MethodData.Emit): Refactor the code so symbolic
11666 information is generated for destructors; For some reasons we
11667 were taking a code path that did not generate symbolic information
11670 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11672 * class.cs: Create a Constructor.CheckBase method that
11673 takes care of all validation type code. The method
11674 contains some code that was moved from Define.
11676 It also includes new code that checks for duplicate ctors.
11677 This fixes bug #55148.
11679 2004-03-09 Joshua Tauberer <tauberer@for.net>
11681 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11682 a { ... }-style array creation invokes EmitStaticInitializers
11683 which is not good for reference-type arrays. String, decimal
11684 and now null constants (NullCast) are not counted toward
11685 static initializers.
11687 2004-03-05 Martin Baulig <martin@ximian.com>
11689 * location.cs (SourceFile.HasLineDirective): New public field;
11690 specifies whether the file contains or is referenced by a "#line"
11692 (Location.DefineSymbolDocuments): Ignore source files which
11693 either contain or are referenced by a "#line" directive.
11695 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11697 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11698 direct access to our parent, so check the method inline there.
11700 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11702 * expression.cs (Invocation.EmitCall): Miguel's last commit
11703 caused a regression. If you had:
11708 In Foo the implict this would be null.
11710 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11712 * expression.cs (Invocation.EmitCall): If the method is not
11713 virtual, do not emit a CallVirt to it, use Call.
11715 * typemanager.cs (GetFullNameSignature): Improve the method to
11716 cope with ".ctor" and replace it with the type name.
11718 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11719 as an argument the ConstructorBuilder where it is being defined,
11720 to catch the recursive constructor invocations.
11722 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11724 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11725 routines to check if a type is an enumerable/enumerator allow
11726 classes that implement the IEnumerable or IEnumerator interfaces.
11728 * class.cs (Property, Operator): Implement IIteratorContainer, and
11729 implement SetYields.
11731 (Property.Define): Do the block swapping for get_methods in the
11732 context of iterators. We need to check if Properties also
11733 include indexers or not.
11735 (Operator): Assign the Block before invoking the
11736 OperatorMethod.Define, so we can trigger the Iterator code
11739 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11740 Property and Operator classes are not created when we parse the
11741 declarator but until we have the block completed, so we use a
11742 singleton SimpleIteratorContainer.Simple to flag whether the
11743 SetYields has been invoked.
11745 We propagate this setting then to the Property or the Operator to
11746 allow the `yield' to function.
11748 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11750 * codegen.cs: Implemented attribute support for modules.
11751 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11752 Assembly/Module functionality.
11754 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11755 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11756 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11758 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11760 * interface.cs (FindMembers): The operation is performed on all base
11761 interfaces and not only on the first. It is required for future CLS Compliance patch.
11763 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11765 * statement.cs, codegen.cs:
11766 This patch deals with patterns such as:
11768 public class List : IEnumerable {
11770 public MyEnumerator GetEnumerator () {
11771 return new MyEnumerator(this);
11774 IEnumerator IEnumerable.GetEnumerator () {
11778 public struct MyEnumerator : IEnumerator {
11783 Before, there were a few things we did wrong:
11784 1) we would emit callvirt on a struct, which is illegal
11785 2) we emited ldarg when we needed to emit ldarga
11786 3) we would mistakenly call the interface methods on an enumerator
11787 type that derived from IEnumerator and was in another assembly. For example:
11789 public class MyEnumerator : IEnumerator
11791 Would have the interface methods called, even if there were public impls of the
11792 method. In a struct, this lead to invalid IL code.
11794 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11796 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11799 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11801 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11803 * cs-parser.jay: Fix small regression: we were not testing V2
11804 compiler features correctly.
11806 * interface.cs: If the emit context is null, then create one
11808 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11810 * decl.cs (GetSignatureForError): New virtual method to get full name
11811 for error messages.
11813 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11814 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11816 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11817 Duplicated members and code in these classes has been removed.
11818 Better encapsulation in these classes.
11820 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11822 * assign.cs (Assign.DoResolve): When dealing with compound
11823 assignments, there is a new rule in ECMA C# 2.4 (might have been
11824 there before, but it is documented here) that states that in:
11828 If b is of type int, and the `op' is a shift-operator, then the
11829 above is evaluated as:
11833 * expression.cs (Binary.ResolveOperator): Instead of testing for
11834 int/uint/long/ulong, try to implicitly convert to any of those
11835 types and use that in pointer arithmetic.
11837 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11838 method to print information for from the type, not from the
11839 null-method we were given.
11841 2004-02-01 Duncan Mak <duncan@ximian.com>
11843 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11844 parsing for cmd, fixes bug #53694.
11846 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11848 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11849 in the member name duplication tests. Property and operator name duplication
11850 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11852 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11854 * interface.cs (PopulateMethod): Fixed crash when interface method
11855 returns not existing type (error test cs0246-3.cs).
11857 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11859 * cs-parser.jay (interface_accessors): Re-write actions to also
11860 store attributes attached to get and set methods. Fix spelling
11863 (inteface_property_declaration): Modify accordingly.
11865 (InterfaceAccessorInfo): New helper class to store information to pass
11866 around between rules that use interface_accessors.
11868 * interface.cs (Emit): Apply attributes on the get and set
11869 accessors of properties and indexers too.
11871 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11872 right MethodBuilder when applying attributes to the get and set accessors.
11874 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11876 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11878 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11880 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11882 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11884 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11885 changes that treat `yield' specially when present before `break'
11886 or `return' tokens.
11888 * cs-tokenizer.cs: yield is no longer a keyword.
11890 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11892 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11893 setting for default constructors.
11894 For default constructors are almost every time set wrong Modifier. The
11895 generated IL code has been alright. But inside mcs this values was
11896 wrong and this was reason why several of my CLS Compliance tests
11899 2004-01-22 Martin Baulig <martin@ximian.com>
11901 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11902 not a QualifiedIdentifier. This is what `type_name_expression'
11903 was previously doing.
11904 (type_name_expression): Removed; the code is now in
11905 `namespace_or_type_name'.
11906 (qualified_identifier): Removed, use `namespace_or_type_name'
11908 (QualifiedIdentifier): Removed this class.
11910 2004-01-22 Martin Baulig <martin@ximian.com>
11912 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11913 not a string as alias name.
11915 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11917 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11918 #52730 bug, and instead compute correctly the need to use a
11919 temporary variable when requesting an address based on the
11920 static/instace modified of the field and the constructor.
11922 2004-01-21 Martin Baulig <martin@ximian.com>
11924 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11925 class and namespace before looking up aliases. Fixes #52517.
11927 2004-01-21 Martin Baulig <martin@ximian.com>
11929 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11930 assinged in a 'try'; fixes exception4.cs.
11932 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11933 * class.cs : Implemented parameter-less constructor for TypeContainer
11935 * decl.cs: Attributes are now stored here. New property OptAttributes
11937 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11939 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11941 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11943 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11944 (CSharpSignature): New method for indexer and property signature.
11946 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11948 * pending.cs (IsVirtualFilter): Faster implementation.
11950 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11952 * typemanager.cs: Avoid inclusion of same assembly more than once.
11954 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11956 * cs-parser.jay: Fixed problem where the last assembly attribute
11957 has been applied also to following declaration (class, struct, etc.)
11959 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11961 * class.cs: Added error CS0538, CS0539 reporting.
11962 Fixed crash on Microsoft runtime when field type is void.
11964 * cs-parser.jay: Added error CS0537 reporting.
11966 * pending.cs: Added error CS0535 reporting.
11967 Improved error report for errors CS0536, CS0534.
11969 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11971 Merge a few bits from the Anonymous Method MCS tree.
11973 * statement.cs (ToplevelBlock): New class for toplevel methods,
11974 will hold anonymous methods, lifted variables.
11976 * cs-parser.jay: Create toplevel blocks for delegates and for
11977 regular blocks of code.
11979 2004-01-20 Martin Baulig <martin@ximian.com>
11981 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11982 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11983 and `NeedExplicitReturn'; added `IsLastStatement'.
11984 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11985 have a `ReturnLabel' or we're not unreachable.
11987 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11988 child's reachability; don't just override ours with it. Fixes
11989 #58058 (lluis's example).
11990 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11991 InFinally(), InLoop(), InSwitch() and
11992 BreakCrossesTryCatchBoundary() methods.
11994 * statement.cs (Return): Do all error checking in Resolve().
11995 Unless we are the last statement in a top-level block, always
11996 create a return label and jump to it.
11997 (Break, Continue): Do all error checking in Resolve(); also make
11998 sure we aren't leaving a `finally'.
11999 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12000 statement in a top-level block.
12001 (Block.Flags): Added `IsDestructor'.
12002 (Block.IsDestructor): New public property.
12004 2004-01-20 Martin Baulig <martin@ximian.com>
12006 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12008 2004-01-20 Martin Baulig <martin@ximian.com>
12010 * statement.cs (Statement.ResolveUnreachable): New public method.
12011 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12012 (Block.Resolve): Resolve unreachable statements.
12014 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12016 * expression.cs: We need to fix the case where we do
12017 not have a temp variable here.
12019 * assign.cs: Only expression compound assignments need
12020 temporary variables.
12022 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12024 * flowanalysis.cs: Reduce memory allocation in a few ways:
12025 - A block with no variables should not allocate a bit
12027 - A method with no out parameters does not need any tracking
12028 for assignment of the parameters, so we need not allocate
12031 public readonly Type[] VariableTypes;
12032 public readonly string[] VariableNames;
12033 Are redundant. The data is already stored in the variable
12034 map, so we need not allocate another array for it.
12035 - We need to add alot of checks for if (params | locals) == null
12036 due to the first two changes.
12038 2004-01-18 Miguel de Icaza <miguel@ximian.com>
12040 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12041 implement IMemoryLocation, we store a copy on a local variable and
12042 take the address of it. Patch from Benjamin Jemlich
12044 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12045 to use a special "type_name_expression" rule which reduces the
12046 number of "QualifiedIdentifier" classes created, and instead
12047 directly creates MemberAccess expressions.
12049 2004-01-17 Miguel de Icaza <miguel@ximian.com>
12051 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12052 that fixes #52853. Null literal assignment to ValueType
12054 * class.cs (MethodData.Emit): Instead of checking the name of the
12055 method to determine if its a destructor, create a new derived
12056 class from Method called Destructor, and test for that.
12058 * cs-parser.jay: Create a Destructor object instead of a Method.
12060 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12064 2004-01-16 Miguel de Icaza <miguel@ximian.com>
12066 * expression.cs (Binary.ResolveOperator): Perform an implicit
12067 conversion from MethodGroups to their delegate types on the
12068 Addition operation.
12070 * delegate.cs: Introduce a new class DelegateCreation that is the
12071 base class for `NewDelegate' and `ImplicitDelegateCreation',
12072 factor some code in here.
12074 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12075 conversion from MethodGroups to compatible delegate types.
12077 * ecore.cs (Expression.Resolve): Do not flag error 654
12078 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12079 we allow conversions from MethodGroups to delegate types now.
12081 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12082 assignments in v2 either.
12084 2004-01-10 Miguel de Icaza <miguel@ximian.com>
12086 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12087 static read-only fields in ctors.
12089 Applied patch from Benjamin Jemlich
12091 * expression.cs (UnaryMutator): Avoid leaking local variables.
12093 2004-01-09 Miguel de Icaza <miguel@ximian.com>
12095 * cs-tokenizer.cs (IsCastToken): Allow the various native types
12096 here to return true, as they can be used like this:
12098 (XXX) int.MEMBER ()
12100 Fixed 49836 and all the other dups
12102 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
12104 * driver.cs: Implement /win32res and /win32icon.
12106 2004-01-08 Miguel de Icaza <miguel@ximian.com>
12108 * cs-parser.jay: Add a rule to improve error handling for the
12109 common mistake of placing modifiers after the type.
12111 2004-01-07 Miguel de Icaza <miguel@ximian.com>
12113 * cs-parser.jay (interface_event_declaration): Catch
12114 initialization of events on interfaces, and report cs0068
12116 * cs-parser.jay (interface_event_declaration): Catch
12117 initialization of events.
12119 * ecore.cs: Better report missing constructors.
12121 * expression.cs (Binary.ResolveOperator): My previous bug fix had
12122 the error reporting done in the wrong place. Fix.
12124 * expression.cs (Binary.ResolveOperator): Catch the
12125 operator + (E x, E y) error earlier, and later allow for implicit
12126 conversions in operator +/- (E e, U x) from U to the underlying
12129 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12130 52596, if the container class is abstract, the default constructor
12131 is protected otherwise its public (before, we were always public).
12133 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12136 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12137 Jemlich that fixes bug #52597, MCS was generating invalid code for
12138 idisposable structs. Thanks to Ben for following up with this
12141 2004-01-06 Miguel de Icaza <miguel@ximian.com>
12143 * driver.cs: Allow assemblies without code to be generated, fixes
12146 2004-01-07 Nick Drochak <ndrochak@gol.com>
12148 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12150 2004-01-05 Miguel de Icaza <miguel@ximian.com>
12152 * cs-parser.jay: Add rules to improve error reporting if fields or
12153 methods are declared at the namespace level (error 116)
12155 * Add rules to catch event add/remove
12157 2004-01-04 David Sheldon <dave-mono@earth.li>
12159 * expression.cs: Added matching ")" to error message for
12162 2004-01-03 Todd Berman <tberman@gentoo.org>
12164 * ecore.cs, attribute.cs:
12165 Applying fix from #52429.
12167 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12169 * ecore.cs, expression.cs, statement.cs:
12170 Total rewrite of how we handle branching. We
12171 now handle complex boolean expressions with fewer
12172 jumps. As well if (x == 0) no longer emits a ceq.
12174 if (x is Foo) is much faster now, because we generate
12177 Overall, we get a pretty big improvement on our benchmark
12178 tests. The code we generate is smaller and more readable.
12180 I did a full two-stage bootstrap. The patch was reviewed
12181 by Martin and Miguel.
12183 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12185 * cs-parser.jay: Make primary_expression not take a QI.
12186 we dont need this because the member_access rule covers
12187 us here. So we replace the rule with just IDENTIFIER.
12189 This has two good effects. First, we remove a s/r conflict.
12190 Second, we allocate many fewer QualifiedIdentifier objects.
12192 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12194 * attribute.cs: Handle MarshalAs attributes as pseudo, and
12195 set the correct information via SRE. This prevents
12196 hanging on the MS runtime. Fixes #29374.
12198 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12200 * convert.cs: correctly handle conversions to value types
12201 from Enum and ValueType as unboxing conversions.
12203 Fixes bug #52569. Patch by Benjamin Jemlich.
12205 2004-01-02 Ravi Pratap <ravi@ximian.com>
12207 * expression.cs (BetterConversion): Prefer int -> uint
12208 over int -> ulong (csc's behaviour). This fixed bug #52046.
12210 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
12212 * decl.cs (MemberCache.FindMembers): now returns a
12215 * typemanager.cs: In general, go with with ^^.
12216 (CopyNewMethods): take an IList.
12217 (RealMemberLookup): Only allocate an arraylist
12218 if we copy from two sets of methods.
12220 This change basically does two things:
12221 1) Fewer array lists allocated due to CopyNewMethods.
12222 2) the explicit cast in MemberList costed ALOT.
12224 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
12226 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12227 a hashtable to avoid needless string allocations when an identifier is
12228 used more than once (the common case).
12230 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12232 * pending.cs: MS's TypeBuilder.GetInterfaces ()
12233 is broken, it will not return anything. So, we
12234 have to use the information we have in mcs to
12237 * typemanager.cs: Add a cache for GetInterfaces,
12238 since this will now be used more often (due to ^^)
12240 (GetExplicitInterfaces) New method that gets the
12241 declared, not effective, interfaces on a type
12242 builder (eg, if you have interface IFoo, interface
12243 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12246 This patch makes MCS able to bootstrap itself on
12249 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12251 * expression.cs: Remove the Nop's that Miguel put
12254 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12256 * report.cs, codegen.cs: Give the real stack trace to
12257 the error when an exception is thrown.
12259 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12261 * decl.cs: only allocate hashtables for ifaces if
12264 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12266 * expression.cs: fix the error from cs0121-2.cs
12267 (a parent interface has two child interfaces that
12268 have a function with the same name and 0 params
12269 and the function is called through the parent).
12271 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
12273 * class.cs, rootcontext.cs, typmanager.cs: do not
12276 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
12278 * codegen.cs: remove stack for the ec flow branching.
12279 It is already a linked list, so no need.
12281 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
12283 * Makefile: Allow custom profiler here.
12285 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12287 * typemanager.cs (LookupType):
12288 - Use a static char [], because split takes
12289 a param array for args, so it was allocating
12291 - Do not store true in a hashtable, it boxes.
12293 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12295 * flowanalysis.cs: bytify common enums.
12297 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12299 * modifiers.cs: Add a new set of flags for the
12300 flags allowed on explicit interface impls.
12301 * cs-parser.jay: catch the use of modifiers in
12302 interfaces correctly.
12303 * class.cs: catch private void IFoo.Blah ().
12305 All related to bug #50572.
12307 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12309 * decl.cs: Rewrite the consistant accessability checking.
12310 Accessability is not linear, it must be implemented in
12311 a tableish way. Fixes #49704.
12313 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12315 * expression.cs: Handle negation in a checked context.
12316 We must use subtraction from zero. Fixes #38674.
12318 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12320 * class.cs: Ignore static void main in DLLs.
12321 * rootcontext.cs: Handle the target type here,
12322 since we are have to access it from class.cs
12323 * driver.cs: account for the above.
12325 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12327 * report.cs: Give line numbers and files if available.
12329 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
12331 * driver.cs: Implement /addmodule.
12333 * typemanager.cs: Change 'modules' field so it now contains Modules not
12336 2003-12-20 Martin Baulig <martin@ximian.com>
12338 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12339 (FieldBase.IsAssigned): Removed this field.
12340 (FieldBase.SetAssigned): New public method.
12341 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12343 2003-12-20 Martin Baulig <martin@ximian.com>
12345 * expression.cs (LocalVariableReference.DoResolve): Don't set
12346 `vi.Used' if we're called from DoResolveLValue().
12348 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12349 returns the usage vector it just merged into the current one -
12350 pass this one to UsageWarning().
12351 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12352 of the `EmitContext', don't call this recursively on our children.
12354 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
12356 * driver.cs: Implement /target:module.
12358 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
12360 * support.cs (CharArrayHashtable): New helper class.
12362 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
12363 char arrays, not strings, so we can avoid creating a string in
12364 consume_identifier if the identifier is a keyword.
12366 2003-12-16 Martin Baulig <martin@ximian.com>
12368 * statement.cs (LocalInfo.Assigned): Removed this property.
12369 (LocalInfo.Flags): Removed `Assigned'.
12370 (LocalInfo.IsAssigned): New public method; takes the EmitContext
12371 and uses flow analysis.
12372 (Block.UsageWarning): Made this method private.
12373 (Block.Resolve): Call UsageWarning() if appropriate.
12375 * expression.cs (LocalVariableReference.DoResolve): Always set
12376 LocalInfo.Used here.
12378 2003-12-13 Martin Baulig <martin@ximian.com>
12380 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12381 any value here; we're now using flow analysis to figure out
12382 whether a statement/block returns a value.
12384 2003-12-13 Martin Baulig <martin@ximian.com>
12386 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12388 (FlowBranching.MergeFinally): Don't call
12389 `branching.CheckOutParameters()' here, this is called in
12391 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12392 when adding the `finally' vector.
12394 2003-12-13 Martin Baulig <martin@ximian.com>
12397 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12398 actually work and also fix #48962.
12400 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
12402 * decl.cs: Do not check System.Object for nested types,
12403 since we know it does not have any. Big bang for buck:
12406 Run 1: 8.35 seconds
12407 Run 2: 8.32 seconds
12408 corlib: 17.99 seconds
12410 Run 1: 8.17 seconds
12411 Run 2: 8.17 seconds
12412 corlib: 17.39 seconds
12414 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12416 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12417 time we are returning 0 members, so we save alot here.
12419 2003-12-11 Martin Baulig <martin@ximian.com>
12421 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12422 `MergeChild()', also just take the `FlowBranching' as argument;
12423 call Merge() on it and return the result.
12424 (FlowBranching.Merge): We don't need to do anything if we just
12427 2003-12-11 Martin Baulig <martin@ximian.com>
12429 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12430 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12431 Maurer for this idea.
12433 2003-12-11 Martin Baulig <martin@ximian.com>
12435 * flowanalysis.cs (MergeResult): This class is now gone; we now
12436 use the `UsageVector' for this. The reason for this is that if a
12437 branching just has one sibling, we don't need to "merge" them at
12438 all - that's the next step to do.
12439 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12442 2003-12-11 Martin Baulig <martin@ximian.com>
12444 Reworked flow analyis and made it more precise and bug-free. The
12445 most important change is that we're now using a special `Reachability'
12446 class instead of having "magic" meanings of `FlowReturns'. I'll
12447 do some more cleanups and optimizations and also add some more
12448 documentation this week.
12450 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12451 largely reworked this class.
12452 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12453 the new `Reachability' class instead of having "magic" values here.
12454 (FlowBranching): We're now using an instance of `Reachability'
12455 instead of having separate `Returns', `Breaks' etc. fields.
12457 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12458 based on flow analysis; ignore the return value of block.Emit ().
12460 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12462 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12463 if they are private.
12465 2003-12-09 Martin Baulig <martin@ximian.com>
12467 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12468 call them directly on the UsageVector.
12470 2003-12-09 Martin Baulig <martin@ximian.com>
12472 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12473 Changed return type from `FlowReturns' to `Reachability'.
12475 2003-12-09 Martin Baulig <martin@ximian.com>
12477 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12478 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12479 `Reachable' fields with a single `Reachability' one.
12481 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12483 * class.cs (FindMembers): Remove foreach's.
12488 Run 1: 8.74 seconds
12489 Run 2: 8.71 seconds
12492 Run 1: 8.64 seconds
12493 Run 2: 8.58 seconds
12496 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12501 This patch does a few things:
12502 1. EmptyStatement is now a singleton, so it is never reallocated.
12503 2. All blah is EmptyStatement constructs have been changed to
12504 blah == EmptyStatement.Value, which is much faster and valid
12505 now that EmptyStatement is a singleton.
12506 3. When resolving a block, rather than allocating a new array for
12507 the non-empty statements, empty statements are replaced with
12508 EmptyStatement.Value
12509 4. Some recursive functions have been made non-recursive.
12510 Mainly the performance impact is from (3), however (1) and (2) are needed for
12511 this to work. (4) does not make a big difference in normal situations, however
12512 it makes the profile look saner.
12517 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12518 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12519 Total memory allocated: 56397 KB
12522 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12523 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12524 Total memory allocated: 55666 KB
12526 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12528 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12529 than the hashtable in a hashtable version
12531 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12532 we always end up concating a string. This results in a huge perf
12533 loss, because many strings have to be tracked by the GC. In this
12534 patch, we first use a hashtable that works with two keys, so that
12535 the strings do not need to be concat'ed.
12539 Run 1: 8.74 seconds
12540 Run 2: 8.71 seconds
12543 Run 1: 8.65 seconds
12544 Run 2: 8.56 seconds
12546 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12548 * Makefile: Add a new target `do-time' that does a quick and simple
12549 profile, leaving easy to parse output.
12551 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12553 * codegen.cs (Init): Create the dynamic assembly with
12554 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12556 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12558 * support.cs: Make the PtrHashtable use only one
12559 instance of its comparer.
12561 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12563 * typemanager.cs: Fix lookup of GetNamespaces.
12565 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12567 * expression.cs: Removed redundant line.
12569 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12570 ArrayLists, use for loops with bounds.
12572 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12575 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12576 arraylists, use for loop with bounds.
12578 The above three changes give us a 0.071 second performance
12579 improvement out of 3.294 seconds down to 3.223. On my machine
12580 the above changes reduced the memory usage by 1,387 KB during
12581 compiler bootstrap.
12583 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12584 QualifiedIdentifiers. Before we created a new string through
12585 concatenation, and mostly later on, the result would be
12586 manipulated by DecomposeQI through string manipulation.
12588 This reduced the compiler memory usage for bootstrapping from
12589 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12590 compile times in 0.05 seconds.
12592 2003-11-28 Dick Porter <dick@ximian.com>
12594 * support.cs: Do string compares with the Invariant culture.
12602 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12603 the comparison is done with the Invariant culture.
12605 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12607 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12608 GetEnumerator method.
12610 (ProbeCollectionType): Iterate starting at the most specific type
12611 upwards looking for a GetEnumerator
12613 * expression.cs: Shift count can be up to 31 for int/uint and 63
12616 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12618 * statement.cs (Block.LookupLabel): Also look for the label on the
12619 children blocks. Use a hash table to keep track of visited
12622 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12623 we actually did transform the other operand, otherwise fall back
12624 to the common codepath that casts to long.
12626 * cs-tokenizer.cs: Use the same code pattern as the int case.
12627 Maybe I should do the parsing myself, and avoid depending on the
12628 Parse routines to get this done.
12630 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12632 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12633 which fixes bug 51347. This time test it.
12635 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12636 attributes for example can not tell the difference between these.
12637 The difference was only a syntax feature of the language.
12639 * attribute.cs: Apply attributes to delegates.
12641 * delegate.cs: Call the apply attributes method.
12643 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12645 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12646 comparing 0 vs Byte.MinValue, not the value
12648 (ImplicitConversionRequired): When reporting a conversion error,
12649 use error 31 to print out the constant error instead of the
12652 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12653 which fixes bug 51347.
12655 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12657 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12658 which fixes the -warnaserror command line option.
12660 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12662 * cfold.cs (DoNumericPromotions): During constant folding of
12663 additions on UIntConstant, special case intconstants with
12664 IntConstants like we do on the expression binary operator.
12666 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12668 * convert.cs (ImplicitReferenceConversion): We were missing a case
12669 (System.Enum are not value types or class types, so we need to
12670 classify them separatedly).
12672 * driver.cs: We do not support error 2007.
12674 2003-11-12 Jackson Harper <jackson@ximian.com>
12676 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12677 system directory. Also use the full file name so users can
12678 libraries names mscorlib-o-tron.dll in a non system dir.
12680 2003-11-10 Martin Baulig <martin@ximian.com>
12682 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12683 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12684 calling `ResolveType()' on them, directly assign their `Type'.
12686 2003-11-08 Martin Baulig <martin@ximian.com>
12688 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12689 return value and the `out parent' parameter.
12690 (TypeContainer.DefineType): Moved the CS0644 check into
12691 GetClassBases(). Don't pass the interface types to the
12692 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12693 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12695 * ecore.cs (TypeExpr.IsAttribute): New property.
12696 (TypeExpr.GetInterfaces): New method.
12698 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12699 TypeExpr instead of a Type.
12700 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12701 (Interface.DefineType): Don't pass the interface types to the
12702 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12703 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12705 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12706 instead of a `Type[]'.
12707 (TypeManager.RegisterBuilder): Likewise.
12708 (TypeManager.AddUserInterface): Likewise.
12709 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12710 `Type[]' and also return a `TypeExpr[]'.
12711 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12713 2003-11-08 Martin Baulig <martin@ximian.com>
12715 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12718 2003-11-08 Martin Baulig <martin@ximian.com>
12720 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12721 TypeManager.ResolveExpressionTypes().
12723 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12724 instead of an Expression.
12725 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12726 (TypeExpression): New public class; formerly known as `TypeExpr'.
12728 * expression.cs (ComposedCast): Derive from TypeExpr.
12730 * typemanager.cs (TypeManager.system_*_expr): These are now
12731 TypExpr's instead of Expression's.
12732 (TypeManager.ResolveExpressionTypes): New public static function;
12733 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12736 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12738 * expression.cs (New.DoResolve): Do not dereference value that
12739 might be a null return.
12741 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12742 sure that the constant value has the right type. Fixes an
12743 unreported bug, similar to 50425.
12745 * const.cs (Const.LookupConstantValue): Call
12746 ImplicitStandardConversionExists before doing a conversion to
12747 avoid havng the TypeManager.ChangeType do conversions.
12749 Reduced the number of casts used
12751 (Const.ChangeType): New routine to enable reuse of the constant
12752 type changing code from statement.
12754 * typemanager.cs (ChangeType): Move common initialization to
12755 static global variables.
12759 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12760 every value type to go through, even if it was void. Fix that.
12762 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12763 character of the define, and the is_identifier_part_character for
12764 the rest of the string.
12766 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12768 * expression.cs (UnaryMutator.EmitCode): When I updated
12769 LocalVariableReference.DoResolve, I overdid it, and dropped an
12770 optimization done on local variable references.
12772 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12774 * ecore.cs: Convert the return from Ldlen into an int.
12776 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12778 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12779 the accessibility, this is a special case for toplevel non-public
12780 classes (internal for instance).
12782 2003-10-20 Nick Drochak <ndrochak@gol.com>
12784 * ecore.cs: Fix typo and build. Needed another right paren.
12786 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12788 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12789 `internal' case regular and protected, but not allowing protected
12790 to be evaluated later. Bug 49840
12792 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12794 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12795 to kb.Nlast, and not the kb.nFirst to isolate the switch
12798 Extract the underlying type, so enumerations of long/ulong are
12799 treated like long/ulong.
12801 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12803 * expression.cs (New): Overload the meaning of RequestedType to
12804 track the possible creation of the NewDelegate type, since
12805 DoResolve is invoked more than once for new constructors on field
12808 See bugs: #48800 and #37014
12810 * cs-parser.jay (declare_local_constants): Take an arraylist
12811 instead of a single constant.
12813 (local_constant_declaration): It should take a
12814 constant_declarators, not a constant_declarator. Fixes 49487
12816 * convert.cs: Fix error report.
12818 2003-10-13 Jackson Harper <jackson@ximian.com>
12820 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12823 2003-10-09 Martin Baulig <martin@ximian.com>
12825 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12827 (MethodCore.DoDefineParameters): Removed the TypeContainer
12828 argument; use the DeclSpace which was passed to the .ctor instead.
12829 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12830 TypeContainer; we only need a DeclSpace here.
12832 2003-10-09 Martin Baulig <martin@ximian.com>
12834 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12836 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12837 EmitContext's .ctor.
12839 2003-10-09 Martin Baulig <martin@ximian.com>
12841 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12842 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12843 AsAccessible(), moved them as well.
12845 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12847 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12849 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12851 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12853 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12854 generation for >=, as spotted by Paolo, bug 48679.
12855 Patch from David Waite.
12857 * cs-tokenizer.cs: Add handling for #pragma.
12859 * cs-parser.jay: Allow for both yield and yield return in the
12860 syntax. The anti-cobolization of C# fight will go on!
12862 * class.cs (TypeBuilder.DefineType): Catch error condition here
12863 (Parent.DefineType erroring out and returning null).
12865 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12866 coping with enumerations variables, we were mistakenly processing
12867 them as a regular value type instead of built-in types. Fixes the
12870 * typemanager.cs (IsBuiltinOrEnum): New method.
12872 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12874 * cs-parser.jay: Upgrade: yield now needs the return clause.
12876 2003-09-19 Martin Baulig <martin@ximian.com>
12878 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12879 `MemberCache parent' argument. Normally, an interface doesn't
12880 have a parent type except System.Object, but we use this in gmcs
12881 for generic type parameters.
12883 2003-09-18 Martin Baulig <martin@ximian.com>
12885 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12886 on `type.IsInterface'; don't check whether the type has a parent
12887 to determine whether it's an interface.
12889 2003-09-15 Martin Baulig <martin@ximian.com>
12891 * class.cs (TypeContainer.DefineType): Added an error flag to
12892 avoid reporting duplicate CS0146's ("class definition is
12895 * driver.cs (Driver.MainDriver): Abort if
12896 RootContext.ResolveTree() reported any errors.
12898 2003-09-07 Martin Baulig <martin@ximian.com>
12900 * report.cs (Error, Warning): Added overloaded versions which take
12901 a `params object[] args' and call String.Format().
12903 2003-09-07 Martin Baulig <martin@ximian.com>
12905 * decl.cs (DeclSpace..ctor): Don't call
12906 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12907 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12908 (DeclSpace.RecordDecl): New method.
12910 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12912 2003-09-02 Ravi Pratap <ravi@ximian.com>
12914 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12915 value attributes to be applied to ParameterBuilders.
12917 * class.cs (MethodCore.LabelParameters): Make static and more
12918 generic so that it can be used from other places - like interface
12919 methods, for instance.
12921 * interface.cs (Interface.Emit): Call LabelParameters before
12922 emitting attributes on the InterfaceMethod.
12924 2003-08-26 Martin Baulig <martin@ximian.com>
12926 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12927 resolving aliases; fixes #47927.
12929 2003-08-26 Martin Baulig <martin@ximian.com>
12931 * statement.cs (Using.DoResolve): This is internally emitting a
12932 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12933 do not always return. Fixes #47681.
12935 2003-08-26 Martin Baulig <martin@ximian.com>
12937 * decl.cs (MemberCore): Moved WarningNotHiding(),
12938 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12940 (AdditionResult): Make this nested in DeclSpace.
12941 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12942 argument; call NamespaceEntry.Define() unless we're nested in a
12945 * namespace.cs (Namespace.DefineName): New public function. This
12946 is called from DeclSpace's .ctor to add
12947 (Namespace.Lookup): Include DeclSpaces in the lookup.
12949 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12951 * const.cs (Const): Derive from MemberBase, not MemberCore.
12953 2003-08-25 Martin Baulig <martin@ximian.com>
12955 * convert.cs (Convert.ExplicitReferenceConversion): When
12956 converting from an interface type to a class, unbox if the target
12957 type is a struct type. Fixes #47822.
12959 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12961 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12964 2003-08-22 Martin Baulig <martin@ximian.com>
12966 * class.cs (TypeManager.DefineType): When defining a nested type,
12967 call DefineType() on our parent; fixes #47801.
12969 2003-08-22 Martin Baulig <martin@ximian.com>
12971 * class.cs (MethodData.Define): While checking if a method is an
12972 interface implementation, improve the test a bit more to fix #47654.
12974 2003-08-22 Martin Baulig <martin@ximian.com>
12976 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12977 correctly; fixes #47722.
12979 2003-08-22 Martin Baulig <martin@ximian.com>
12981 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12982 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12984 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12986 2003-08-22 Martin Baulig <martin@ximian.com>
12988 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12989 can only be assigned in static constructors. Fixes #47161.
12991 2003-08-22 Martin Baulig <martin@ximian.com>
12993 Rewrote and improved the flow analysis code.
12995 * flowbranching.cs (FlowBranching): Make this class abstract.
12996 (FlowBranching.CreateBranching): New static function to create a
12997 new flow branching.
12998 (FlowBranchingBlock, FlowBranchingException): New classes.
12999 (FlowBranching.UsageVector.Type): New public readonly field.
13000 (FlowBranching.UsageVector.Breaks): Removed the setter.
13001 (FlowBranching.UsageVector.Returns): Removed the setter.
13002 (FlowBranching.UsageVector): Added Break(), Return(),
13003 NeverReachable() and Throw() methods to modify the reachability.
13004 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13005 done by FlowBranching.Merge().
13006 (FlowBranching.UsageVector.MergeChild): New method; merges the
13007 merge result into the current vector.
13008 (FlowBranching.Merge): New abstract method to merge a branching.
13010 2003-08-12 Martin Baulig <martin@ximian.com>
13012 * expression.cs (Indirection.CacheTemporaries): Create the
13013 LocalTemporary with the pointer type, not its element type.
13015 2003-08-10 Miguel de Icaza <miguel@ximian.com>
13017 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13018 token was a keyword or not.
13020 Add `error' options where an IDENTIFIER was expected; Provide
13021 CheckToken and CheckIdentifierToken convenience error reporting
13024 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13026 * decl.cs: Rename `NamespaceEntry Namespace' public field into
13027 NameSpaceEntry NameSpaceEntry.
13029 (LookupInterfaceOrClass): Avoid creating a full qualified name
13030 from namespace and name: avoid doing lookups when we know the
13031 namespace is non-existant. Use new Tree.LookupByNamespace which
13032 looks up DeclSpaces based on their namespace, name pair.
13034 * driver.cs: Provide a new `parser verbose' to display the
13035 exception thrown during parsing. This is turned off by default
13036 now, so the output of a failure from mcs is more graceful.
13038 * namespace.cs: Track all the namespaces defined in a hashtable
13041 (IsNamespace): New method
13043 2003-08-09 Miguel de Icaza <miguel@ximian.com>
13045 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
13046 we know that we need to concatenate (full typename can never be
13051 * statement.cs: Use a bitfield; Do not initialize to null things
13052 which are done by the constructor by default.
13054 * cs-parser.jay: bug fix, parameter was 4, not 3.
13056 * expression.cs: Just use the property;
13058 * statement.cs: No need for GetVariableInfo method.
13060 2003-08-08 Martin Baulig <martin@ximian.com>
13062 * flowanalysis.cs (FlowReturns): This is now nested in the
13063 `FlowBranching' class.
13064 (MyBitVector): Moved this here from statement.cs.
13065 (FlowBranching.SiblingType): New enum type.
13066 (FlowBranching.CreateSibling): Added `SiblingType' argument.
13068 2003-08-07 Martin Baulig <martin@ximian.com>
13070 * flowanalysis.cs (FlowBranchingType): This is now nested in the
13071 `FlowBranching' class and called `BranchingType'.
13073 2003-08-07 Martin Baulig <martin@ximian.com>
13075 * flowanalysis.cs: Moved all the control flow analysis code into
13078 2003-08-07 Martin Baulig <martin@ximian.com>
13080 * assign.cs (Assign.DoResolve): `target' must either be an
13081 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
13084 2003-08-07 Miguel de Icaza <miguel@ximian.com>
13086 * expression.cs (BinaryMethod): This kind of expression is created by the
13087 Binary class if it determines that the operator has to be handled
13090 (BinaryDelegate): This kind of expression is created if we are
13091 dealing with a + or - operator on delegates.
13093 (Binary): remove method, argumetns, and DelegateOperator: when
13094 dealing with methods,
13096 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13098 * statement.cs (Block): use bitfields for the three extra booleans
13099 we had in use. Remove unused topblock parameter.
13101 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13103 * assign.cs: Drop extra unneeded tests.
13105 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13107 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13109 * statement.cs (Foreach): Use VariableStorage instead of
13112 * codegen.cs (VariableStorage): New class used by clients that
13113 require a variable stored: locals or fields for variables that
13114 need to live across yield.
13116 Maybe provide a convenience api for EmitThis+EmitLoad?
13118 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13121 2003-08-05 Miguel de Icaza <miguel@ximian.com>
13123 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13124 RemapParameterLValue): New methods that are used to turn a
13125 precomputed FieldInfo into an expression like this:
13129 The idea is to use this instead of making LocalVariableReference
13130 have more than one meaning.
13132 * cs-parser.jay: Add error production to BASE.
13134 * ecore.cs: Deal with TypeManager.GetField returning null, which
13135 is now a valid return value.
13137 (FieldExprNoAddress): New expression for Fields whose address can
13140 * expression.cs (LocalVariableReference): During the resolve
13141 phases, create new expressions if we are in a remapping context.
13142 Remove code that dealt with remapping here.
13144 (ParameterReference): same.
13146 (ProxyInstance): New expression, like the `This' expression, but
13147 it is born fully resolved. We know what we are doing, so remove
13148 the errors that are targeted to user-provided uses of `this'.
13150 * statement.cs (Foreach): our variable is now stored as an
13151 Expression; During resolution, follow the protocol, dont just
13152 assume it will return this.
13154 2003-08-06 Martin Baulig <martin@ximian.com>
13156 * support.cs (SeekableStreamReader.cs): New public class.
13158 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13159 SeekableStreamReader instead of the normal StreamReader.
13161 2003-08-04 Martin Baulig <martin@ximian.com>
13163 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13164 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13165 deambiguate casts and delegate invocations.
13166 (parenthesized_expression): Use the new tokens to ensure this is
13167 not a cast of method invocation.
13169 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13170 when reading a `)' and Deambiguate_CloseParens () was previously
13173 * expression.cs (ParenthesizedExpression): New class. This is
13174 just used for the CS0075 test.
13175 (Binary.DoResolve): Check for CS0075.
13177 2003-07-29 Ravi Pratap <ravi@ximian.com>
13179 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13180 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13181 reference comparison.
13183 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13184 examine the ReturnType for equality - this is necessary in the
13185 cases of implicit and explicit operators whose signature also
13186 includes the return type.
13188 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13190 * namespace.cs: Cache the result of the namespace computation,
13191 instead of computing it every time.
13193 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13195 * decl.cs: Use a global arraylist that we reuse over invocations
13196 to avoid excesive memory consumption. Reduces memory usage on an
13197 mcs compile by one meg (45 average).
13199 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13200 private, work around that.
13202 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13204 * literal.cs (IntLiteral): Define Zero and One static literals.
13206 * cs-parser.jay (integer_literal): use static literals to reduce
13207 memory usage for the most used literals (0, 1 and -1). 211kb
13208 reduced in memory usage.
13210 Replace all calls to `new ArrayList' with `new
13211 ArrayList(4)' which is a good average number for most allocations,
13212 and also requires only 16 bytes of memory for its buffer by
13215 This reduced MCS memory usage in seven megabytes for the RSS after
13218 2003-07-28 Ravi Pratap <ravi@ximian.com>
13220 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13221 handle params methods the correct way by forming only one
13222 applicable set with params and normal methods in them. Earlier we
13223 were looking at params methods only if we found no normal methods
13224 which was not the correct thing to do.
13226 (Invocation.BetterFunction): Take separate arguments indicating
13227 when candidate and the best method are params methods in their
13230 This fixes bugs #43367 and #46199.
13232 * attribute.cs: Documentation updates.
13234 (CheckAttribute): Rename to CheckAttributeTarget.
13235 (GetValidPlaces): Rename to GetValidTargets.
13237 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13238 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13242 2003-07-28 Martin Baulig <martin@ximian.com>
13244 * class.cs (TypeContainer.DefineMembers): Use the base type's full
13245 name when looking up the base class of a nested class. Fixes #46977.
13247 2003-07-26 Martin Baulig <martin@ximian.com>
13249 * expression.cs (Indexers.Indexer): New nested struct; contains
13250 getter, setter and the indexer's type.
13251 (Indexers.Properties): This is now an ArrayList of
13252 Indexers.Indexer's.
13253 (IndexerAccess.DoResolveLValue): Correctly set the type if the
13254 indexer doesn't have any getters.
13256 * assign.cs (Assign.DoResolve): Also do the implicit conversions
13257 for embedded property and indexer assignments.
13259 2003-07-26 Martin Baulig <martin@ximian.com>
13261 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
13262 preprocessor directive is not the first non-whitespace character
13265 2003-07-26 Martin Baulig <martin@ximian.com>
13267 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
13268 namespace parsing, follow the spec more closely.
13270 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
13271 NamespaceEntry.Lookup().
13273 2003-07-25 Martin Baulig <martin@ximian.com>
13275 * MethodCore.cs (OverridesSomething): New public field; it's set
13276 from TypeContainer.DefineMembers if this method overrides
13277 something (which doesn't need to be a method). Fix #39462.
13279 2003-07-25 Ravi Pratap <ravi@ximian.com>
13281 * typemanager.cs (GetMembers): Ensure that the list of members is
13282 reversed. This keeps things in sync.
13284 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
13285 find an AttributeUsage attribute.
13287 * expression.cs (Invocation.OverloadResolve): Perform the check
13288 which disallows Invoke to be directly called on a Delegate.
13290 (Error_InvokeOnDelegate): Report error cs1533.
13292 2003-07-25 Martin Baulig <martin@ximian.com>
13294 * expression.cs (Indexers.GetIndexersForType): Only look in the
13295 interface hierarchy if the requested type is already an
13296 interface. Fixes #46788 while keeping #46502 fixed.
13298 2003-07-25 Martin Baulig <martin@ximian.com>
13300 * class.cs (TypeContainer.DefineMembers): Check whether all
13301 readonly fields have been assigned and report warning CS0649 if
13304 * statement.cs (LocalInfo.IsFixed): Always return true if this is
13307 2003-07-24 Ravi Pratap <ravi@ximian.com>
13309 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
13310 returned from GetMethods to make things consistent with the
13311 assumptions MCS makes about ordering of methods.
13313 This should comprehensively fix bug #45127 and it does :-)
13315 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
13316 ordering is actually reverse.
13318 * Clean up some debug messages I left lying around.
13320 * interface.cs (Populate*): Get rid of code which emits attributes
13321 since the stage in which we emit attributes is the 'Emit' stage,
13322 not the define stage.
13324 (Emit): Move attribute emission for interface members here.
13326 2003-07-22 Ravi Pratap <ravi@ximian.com>
13328 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13329 closely: we eliminate methods in base types when we have an
13330 applicable method in a top-level type.
13332 Please see section 14.5.5.1 for an exact description of what goes
13335 This fixes bug #45127 and a host of other related to corlib compilation.
13337 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13338 array is the method corresponding to the top-level type (this is
13339 because of the changes made to icall.c) so we change this
13342 (MethodGroupExpr.Name): This too.
13344 * typemanager.cs (GetElementType): New method which does the right
13345 thing when compiling corlib.
13347 * everywhere: Make use of the above in the relevant places.
13349 2003-07-22 Martin Baulig <martin@ximian.com>
13351 * cs-parser.jay (invocation_expression): Moved
13352 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13353 `cast_expression', but create a InvocationOrCast which later
13354 resolves to either an Invocation or a Cast.
13356 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13357 method; call this before EmitStatement() to make sure that this
13358 expression can be used as a statement.
13360 * expression.cs (InvocationOrCast): New class; resolves to either
13361 an Invocation or a Cast.
13363 * statement.cs (StatementExpression): Call ResolveStatement() on
13364 the ExpressionStatement before emitting it.
13366 2003-07-21 Martin Baulig <martin@ximian.com>
13368 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13369 `ref' and `out' attributes match; fixes #46220.
13370 (MemberAccess.ResolveMemberAccess): You can't reference a type
13371 through an expression; fixes #33180.
13372 (Indexers.GetIndexersForType): Don't return the indexers from
13373 interfaces the class implements; fixes #46502.
13375 2003-07-21 Martin Baulig <martin@ximian.com>
13377 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13378 CS0661 checks; fixes bug #30442.
13380 2003-07-21 Martin Baulig <martin@ximian.com>
13382 * decl.cs (AdditionResult): Added `Error'.
13384 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13386 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
13387 makes cs0031.cs actually work.
13389 2003-07-20 Martin Baulig <martin@ximian.com>
13391 * namespace.cs: Fixed that bug which caused a crash when compiling
13392 the debugger's GUI.
13394 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13396 * typemanager.cs (LookupTypeReflection): Never expose types which
13397 are NotPublic, NestedPrivate, NestedAssembly, or
13398 NestedFamANDAssem. We used to return these, and later do a check
13399 that would report a meaningful error, but the problem is that we
13400 would not get the real match, if there was a name override.
13402 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13404 * namespace.cs (Namespace, Name): Do not compute the namespace
13405 name dynamically, compute it in the constructor. This reduced
13406 memory usage by 1697 KB.
13408 * driver.cs: Use --pause to pause at the end.
13410 2003-07-17 Peter Williams <peter@newton.cx>
13412 * Makefile: Change the name of the test target so that it doesn't
13413 conflict with the recursive test target.
13415 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13417 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13418 AddressOf): Do not use EmitThis, that was wrong, use the actual
13421 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13423 * class.cs (MethodData.Define): While checking if a method is an
13424 interface implementation, improve the test: If we are not public
13425 (use new test here: use the computed MethodAttributes directly,
13426 instead of the parsed modifier flags) check if the `implementing'
13427 method comes from an interface or not.
13429 * pending.cs (VerifyPendingMethods): Slightly better error
13432 * makefile: add test target that does the mcs bootstrap.
13434 2003-07-16 Ravi Pratap <ravi@ximian.com>
13436 * interface.cs (Define): Do nothing here since there are no
13437 members to populate etc. Move the attribute emission out of here
13438 since this was just totally the wrong place to put it. Attribute
13439 application happens during the 'Emit' phase, not in the 'Define'
13442 (Emit): Add this method and move the attribute emission here
13444 * rootcontext.cs (EmitCode): Call the Emit method on interface
13447 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13449 * expression.cs (OverloadResolve): Report error only if Location
13450 is not 'Null' which means that there was a probe going on.
13452 2003-07-14 Martin Baulig <martin@ximian.com>
13454 * expression.cs (ConditionalLogicalOperator): New public class to
13455 implement user defined conditional logical operators.
13456 This is section 14.11.2 in the spec and bug #40505.
13458 2003-07-14 Martin Baulig <martin@ximian.com>
13460 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13462 2003-07-14 Martin Baulig <martin@ximian.com>
13464 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13466 * ecore.cs (IVariable.VerifyFixed): New interface method.
13468 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13469 operator, check whether the variable is actually fixed. Fixes bug
13470 #36055. Set a variable definitely assigned when taking its
13471 address as required by the spec.
13473 * statement.cs (LocalInfo.IsFixed): New field.
13474 (LocalInfo.MakePinned): Set `IsFixed' to true.
13476 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13478 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13479 for .ctors, ensure that we only ask for members declared in the
13480 attribute type (BindingFlags.DeclaredOnly).
13484 * expression.cs (Error_WrongNumArguments): Report error 1501
13485 correctly the way CSC does.
13487 2003-07-13 Martin Baulig <martin@ximian.com>
13489 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13490 lookup on the fully qualified name, to make things like "X.X" work
13491 where "X.X" is a fully qualified type name, but we also have a
13492 namespace "X" in the using list. Fixes #41975.
13494 2003-07-13 Martin Baulig <martin@ximian.com>
13496 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13497 function. If we're a CompoundAssign, we need to create an embedded
13498 CompoundAssign, not an embedded Assign.
13499 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13502 2003-07-13 Martin Baulig <martin@ximian.com>
13504 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13505 work to fix bug #46088.
13507 2003-07-13 Ravi Pratap <ravi@ximian.com>
13509 * class.cs (Operator.Emit): Do not emit attributes here - it is
13510 taken care of by the Method class that we delegate too. This takes
13511 care of bug #45876.
13513 2003-07-10 Martin Baulig <martin@ximian.com>
13515 * expression.cs (TypeOfVoid): New class.
13516 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13518 2003-07-10 Martin Baulig <martin@ximian.com>
13520 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13523 2003-07-10 Martin Baulig <martin@ximian.com>
13525 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13526 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13528 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13530 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13532 2003-07-10 Martin Baulig <martin@ximian.com>
13534 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13535 of decimal. Fixes #42850.
13537 NOTE: I also fixed the created byte blob, but this doesn't work on
13538 the MS runtime and csc never produces any byte blobs for decimal
13541 2003-07-10 Martin Baulig <martin@ximian.com>
13543 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13544 structs; fixes #32068.
13545 (Block.AddChildVariableNames): Fixed #44302.
13547 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13549 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13551 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13553 * attribute.cs: And this test is onger needed.
13555 2003-07-08 Martin Baulig <martin@ximian.com>
13557 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13558 inaccessible types. Fixes #36313.
13560 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13562 * namespace.cs (NamespaceEntry): Create implicit entries for all
13563 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13564 implicit entries for N1.N2 and N1.
13566 2003-07-08 Martin Baulig <martin@ximian.com>
13568 Rewrote the handling of namespaces to fix a lot of the issues
13569 wrt. `using' aliases etc.
13571 * namespace.cs (Namespace): Splitted this class into a
13572 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13574 * typemanager.cs (TypeManager.IsNamespace): Removed.
13575 (TypeManager.ComputeNamespaces): Only compute namespaces from
13576 loaded assemblies here, not the namespaces from the assembly we're
13577 currently compiling.
13579 2003-07-08 Martin Baulig <martin@ximian.com>
13581 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13583 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13585 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13588 I thought about the memory savings here, but LookupTypeReflection
13589 is used under already very constrained scenarios. Compiling
13590 corlib or mcs only exposes one hit, so it would not really reduce
13591 any memory consumption.
13593 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13595 * typemanager.cs: fixes bug #45889 by only adding public types from
13596 other assemblies to the list of known types.
13598 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13600 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13601 on the type we resolved.
13603 2003-07-05 Martin Baulig <martin@ximian.com>
13605 * pending.cs (PendingImplementation.ParentImplements): Don't
13606 create the proxy if the parent is abstract.
13608 * class.cs (TypeContainer.DefineIndexers): Process explicit
13609 interface implementations first. Fixes #37714.
13611 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13613 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13614 defined recursively; but since we modify the input parameters
13615 (left is set to `this' temporarily), we reset this value if the
13616 left_is_explicit is false, which gives the original semantics to
13619 * literal.cs (NullPointer): new class used to represent a null
13620 literal in a pointer context.
13622 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13623 type is a pointer, use a NullPointer object instead of a
13624 NullLiteral. Closes 43687
13626 (ExplicitConversion): Convert pointer values using
13627 the conv opcode to the proper type.
13629 * ecore.cs (New): change ValueTypeVariable property into a method,
13630 that returns whether the valuetype is suitable for being used.
13632 * expression.cs (Binary.DoNumericPromotions): Only return if we
13633 the int constant was a valid uint, and we can return both left and
13634 right as uints. If not, we continue processing, to trigger the
13635 type conversion. This fixes 39018.
13637 * statement.cs (Block.EmitMeta): During constant resolution, set
13638 the CurrentBlock property on the emitcontext, so that we resolve
13639 constants propertly.
13641 2003-07-02 Martin Baulig <martin@ximian.com>
13643 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13644 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13646 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13647 than emitting it here.
13649 * statement.cs: Fixed some more flow analysis bugs.
13651 2003-07-02 Martin Baulig <martin@ximian.com>
13653 * class.cs (MethodData.Define): When implementing interface
13654 methods, set Final unless we're Virtual.
13656 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13657 check work for interface methods.
13659 2003-07-01 Martin Baulig <martin@ximian.com>
13661 * ecore.cs (EmitContext.This): Replaced this property with a
13662 GetThis() method which takes a Location argument. This ensures
13663 that we get the correct error location for a CS0188.
13665 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13667 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13668 ImplicitStandardConversion.
13670 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13672 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13674 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13677 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13679 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13682 (MethodData.Define): Turn off initlocals for unsafe methods.
13684 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13686 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13687 complete; Fixes #37521.
13689 * delegate.cs: Use Modifiers.TypeAttr to compute the
13690 TypeAttributes, instead of rolling our own. This makes the flags
13691 correct for the delegates.
13693 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13695 * class.cs (Constructor.Define): Set the private flag for static
13696 constructors as well.
13698 * cs-parser.jay (statement_expression): Set the return value to
13699 null, to avoid a crash when we catch an error.
13701 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13703 * cs-parser.jay: Applied patch from Jackson that adds support for
13704 extern and unsafe modifiers to destructor declarations.
13706 * expression.cs: Report error 21 if the user is trying to index a
13709 * driver.cs: Add an error message, suggested by the bug report.
13711 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13712 if we do not have a ": this ()" constructor initializer. Fixes 45149
13714 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13716 * namespace.cs: Add some information to reduce FAQs.
13718 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13720 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13721 underlying enumeration types. Fixes #43915.
13723 * expression.cs: Treat ushort/short as legal values to be used in
13724 bitwise operations.
13726 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13728 * delegate.cs: transfer custom attributes for paramenters from
13729 the delegate declaration to Invoke and BeginInvoke.
13731 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13733 * attribute.cs: handle custom marshalers and emit marshal info
13736 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13738 * makefile.gnu: Added anonymous.cs to the compiler sources.
13740 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13742 * iterators.cs: Change the name of the proxy class to include two
13745 * cs-parser.jay: Update grammar to include anonymous methods.
13747 * anonymous.cs: new file.
13749 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13751 * class.cs (Field.Define): Add missing test for pointers and
13754 2003-05-27 Ravi Pratap <ravi@ximian.com>
13756 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13757 we use the stobj opcode.
13759 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13760 since it wasn't the correct fix.
13762 It still is puzzling that we are required to use stobj for IntPtr
13763 which seems to be a ValueType.
13765 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13767 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13768 during regular simple name resolution. Now, the trick is that
13769 instead of returning for processing the simplename, we do a
13770 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13771 contextual lookup type). If a match is found, return that, if
13772 not, return for further composition.
13774 This fixes long-standing 30485.
13776 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13777 using the address to initialize an object, do an Stobj instead of
13778 using the regular Stelem.
13780 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13781 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13782 Because if we are a BaseIndexerAccess that value will be true.
13785 * statement.cs (GotoCase.Resolve): Return after reporting an
13786 error, do not attempt to continue.
13788 * expression.cs (PointerArithmetic.Emit): If our operand is a
13789 long, convert our constants to match the operand before
13790 multiplying. Convert to I type before adding. Fixes 43670.
13792 2003-05-14 Ravi Pratap <ravi@ximian.com>
13794 * enum.cs (ImplicitConversionExists) : Rename to
13795 ImplicitEnumConversionExists to remove ambiguity.
13797 * ecore.cs (NullCast): New type of cast expression class which
13798 basically is very similar to EmptyCast with the difference being
13799 it still is a constant since it is used only to cast a null to
13801 (eg. (string) null)
13803 * convert.cs (ImplicitReferenceConversion): When casting a null
13804 literal, we return a NullCast.
13806 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13807 should be around anymore.
13809 The renaming (reported was slightly wrong). Corrections:
13811 ConvertImplicitStandard -> ImplicitConversionStandard
13812 ConvertExplicitStandard -> ExplicitConversionStandard
13814 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13815 before passing them in !
13817 * convert.cs (ImplicitConversionStandard): When comparing for
13818 equal expr and target types, ensure that expr is not a
13821 In general, we must not be checking (expr_type ==
13822 target_type) in the top level conversion methods
13823 (ImplicitConversion, ExplicitConversion etc). This checking is
13824 done in the methods that they delegate to.
13826 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13828 * convert.cs: Move Error_CannotConvertType,
13829 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13830 ImplicitNumericConversion, ImplicitConversionExists,
13831 ImplicitUserConversionExists, StandardConversionExists,
13832 FindMostEncompassedType, FindMostSpecificSource,
13833 FindMostSpecificTarget, ImplicitUserConversion,
13834 ExplicitUserConversion, GetConversionOperators,
13835 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13836 TryImplicitIntConversion, Error_CannotConvertImplicit,
13837 ConvertImplicitRequired, ConvertNumericExplicit,
13838 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13839 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13842 Perform the following renames:
13844 StandardConversionExists -> ImplicitStandardConversionExists
13845 ConvertImplicit -> ImplicitConversion
13846 ConvertImplicitStandard -> ImplicitStandardConversion
13847 TryImplicitIntConversion -> ImplicitIntConversion
13848 ConvertImplicitRequired -> ImplicitConversionRequired
13849 ConvertNumericExplicit -> ExplicitNumericConversion
13850 ConvertReferenceExplicit -> ExplicitReferenceConversion
13851 ConvertExplicit -> ExplicitConversion
13852 ConvertExplicitStandard -> ExplicitStandardConversion
13854 2003-05-19 Martin Baulig <martin@ximian.com>
13856 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13857 (TypeInfo): Added support for structs having structs as fields.
13859 * ecore.cs (FieldExpr): Implement IVariable.
13860 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13861 VariableInfo for the field.
13863 2003-05-18 Martin Baulig <martin@ximian.com>
13865 * expression.cs (This.DoResolve): Report a CS0027 if we're
13866 emitting a field initializer.
13868 2003-05-18 Martin Baulig <martin@ximian.com>
13870 * expression.cs (This.ResolveBase): New public function.
13871 (This.DoResolve): Check for CS0188.
13873 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13876 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13877 `instance_expression' to null if we don't have any non-static
13880 2003-05-18 Martin Baulig <martin@ximian.com>
13882 Reworked the way how local variables and parameters are handled by
13883 the flow analysis code.
13885 * statement.cs (TypeInfo, VariableMap): New public classes.
13886 (VariableInfo): New public class. This is now responsible for
13887 checking whether a variable has been assigned. It is used for
13888 parameters and local variables.
13889 (Block.EmitMeta): Take the InternalParameters as argument; compute
13890 the layout of the flow vectors here.
13891 (Block.LocalMap, Block.ParameterMap): New public properties.
13892 (FlowBranching): The .ctor doesn't get the InternalParameters
13893 anymore since Block.EmitMeta() now computes the layout of the flow
13895 (MyStructInfo): This class is now known as `StructInfo' and nested
13896 in `TypeInfo'; we don't access this directly anymore.
13898 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13899 property and removed IsAssigned(), IsFieldAssigned(),
13900 SetAssigned() and SetFieldAssigned(); we now call them on the
13901 VariableInfo so we don't need to duplicate this code everywhere.
13903 * expression.cs (ParameterReference): Added `Block block' argument
13905 (LocalVariableReference, ParameterReference, This): The new
13906 VariableInfo class is now responsible for all the definite
13909 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13910 IsParameterAssigned, SetParameterAssigned): Removed.
13912 2003-05-18 Martin Baulig <martin@ximian.com>
13914 * typemanager.cs (InitCoreTypes): Try calling
13915 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13916 the 3-args-version. Corlib now also needs our `void_type'.
13917 (GetMethod): Added overloaded version which takes an optional
13918 `bool report_errors' to allow lookups of optional methods.
13920 2003-05-12 Martin Baulig <martin@ximian.com>
13922 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13923 only used for locals and not for parameters.
13925 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13927 * support.cs (InternalParameters.ParameterType): Return the
13928 ExternalType of the parameter.
13930 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13933 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13935 * class.cs (MethodData.Define): Do not set the `newslot' on
13936 interface members, if they are also flagged as "override".
13938 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13939 better code for ++i and i++. This only works for static fields
13940 and local variables.
13942 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13943 want to pull the DeclSpace out of the builder_to_declspace instead
13944 of the TypeBuilder (like in TypeContainer.FindMembers).
13946 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13947 instead of LookupTypeContainer. Fixes the crash on .NET for
13948 looking up interface members.
13950 * const.cs: Create our own emit context during the Definition
13951 stage, so that constants are evaluated in the proper context, when
13952 a recursive definition happens.
13954 2003-05-11 Martin Baulig <martin@ximian.com>
13956 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13957 new block for a switch section.
13958 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13959 the adding/lookup in the switch block. Fixes #39828.
13961 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13963 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13964 functionality: I needed to convert the data after I had performed
13965 the add/sub operation into the operands type size.
13967 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13968 pass the type for the box operation, otherwise the resulting
13969 object would have been of type object.
13971 (BoxedCast): Add constructor to specify the type to box as.
13973 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13975 * iterators.cs: I was reusing the `count' variable inadvertently,
13976 take steps to not allow this to happen.
13978 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13980 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13981 by creating an array at the point where the params starts and
13982 putting all those arguments there, then adjusting the size of the
13985 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13987 * expression.cs (New.AddressOf): Implement interface
13988 IMemoryLocation. This is used when the `new' operator is used in
13989 the context of an invocation to a method on a value type.
13991 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13994 * namespace.cs: Also check the using aliases here.
13996 * driver.cs: Move the test for using validity after the types have
13997 been entered, so we do a single pass that also includes the using
14000 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14001 in the regular case. CreateSiblingForFinally is doing extra
14004 * attribute.cs (GetAttributeArgumentExpression): Store the result
14005 on an out value, and use the return value to indicate failure
14006 instead of using null (which is a valid return for Constant.GetValue).
14008 * statement.cs: Perform the analysis flow for the increment
14009 portion after the statement, because this will be the real flow of
14010 execution. Fixes #42385
14012 * codegen.cs (EmitContext.EmitArgument,
14013 EmitContext.EmitStoreArgument): New helper functions when the
14014 RemapToProxy flag is set.
14016 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14019 Add support for remapping parameters.
14021 * iterators.cs: Propagate parameter values; Store parameter
14022 values in the proxy classes.
14024 2003-05-04 Miguel de Icaza <miguel@ximian.com>
14026 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
14027 need a proxy reference; I do not know what I was thinking
14029 * cs-parser.jay (constructor_initializer): catch another error,
14030 and display nice message.
14032 (field_declaration): catch void field declaration
14033 to flag a better error.
14035 * class.cs (MemberBase.CheckBase): Report an error instead of a
14036 warning if a new protected member is declared in a struct.
14037 (Field.Define): catch the error of readonly/volatile.
14039 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14041 (FieldExpr.AddressOf): ditto. Catch error where the address of a
14042 volatile variable is taken
14044 2003-05-02 Miguel de Icaza <miguel@ximian.com>
14046 * statement.cs (Fixed.Resolve): Report an error if we are not in
14049 2003-05-01 Miguel de Icaza <miguel@ximian.com>
14051 * typemanager.cs: reuse the code that handles type clashes for
14052 delegates and enumerations.
14054 * class.cs (Report28): Always report.
14056 * expression.cs (EncodeAsAttribute): Allow nulls here.
14058 2003-04-28 Miguel de Icaza <miguel@ximian.com>
14060 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14061 the functionality for testing whether an expression is valid for
14062 an attribute here. Also handle the case of arrays of elements
14065 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14066 encoding a linear array into an array of objects that are suitable
14067 to be passed to an CustomAttributeBuilder.
14069 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14071 * ecore.cs: (FieldExpr): Handle field remapping here.
14073 * iteratators.cs: Pass the instance variable (if the method is an
14074 instance method) to the constructors, so we can access the field
14075 variables on the class.
14077 TODO: Test this with structs. I think the THIS variable on
14078 structs might have to be a pointer, and not a refenrece
14080 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14082 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14083 local variables to fields in a proxy class.
14085 * iterators.cs (PopulateProxy): Rename our internal fields to
14087 Create a <THIS> field if we are an instance method, so we can
14088 reference our parent container variables.
14089 (MapVariable): Called back from the EmitContext code to enter a
14090 new variable to field mapping into the proxy class (we just create
14094 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14095 for using the remapped locals to fields.
14097 I placed the code here, because that gives the same semantics to
14098 local variables, and only changes the Emit code.
14100 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14101 statements inside iterators.
14102 (VariableInfo): Add a FieldBuilder for the cases when we are
14103 remapping local variables to fields in a proxy class
14105 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14106 current_block != null.
14108 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14109 not cope with strings, as it has been moved to the
14110 TableSwitchEmit. Fixed bug in switch generation.
14112 * expression.cs (New.DoResolve): Provide more context for the user
14113 when reporting an error.
14115 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14118 * expression.cs (MemberAccess.DoResolve): When we get a type back,
14119 check the permissions for it. Note than in a type-resolution
14120 context the check was already present in DeclSpace.ResolveType,
14121 but was missing from the MemberAccess.
14123 (ArrayCreation.CheckIndices): warn if the user has
14124 more nested levels of expressions, but there are no more
14125 dimensions specified. Avoids crash on bug 41906.
14127 2003-04-26 Miguel de Icaza <miguel@ximian.com>
14129 * statement.cs (Block): replace Implicit bool, for a generic
14131 New flag: `Unchecked'. This is used during the EmitMeta phase
14132 (which is out-of-line with the regular Resolve/Emit process for a
14133 statement, as this is done ahead of time, but still gets a chance
14134 to call constant resolve).
14136 (Block.Flags): new enum for adding a new flag.
14138 (Block.EmitMeta): track the state of unchecked.
14140 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14141 to enable constant resolution to work there as well.
14143 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14145 * typemanager.cs (ienumerable_type): Also look up
14146 System.Collections.IEnumerable.
14148 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14150 TODO: Test more than one conditional per method.
14152 * class.cs (Indexer.Define): Report the location where the user is
14153 referencing the unsupported feature.
14155 (MethodData): Overload the use of `conditionals' to
14156 minimize the creation of needless ArrayLists. This saves roughly
14157 212kb on my machine.
14159 (Method): Implement the new IIteratorContainer interface.
14160 (Method.SetYields): Implement the method by setting the ModFlags
14161 to contain METHOD_YIELDS.
14163 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14164 which just got set to null.
14166 * iterators.cs: New file.
14168 (Yield, YieldBreak): New statements.
14170 * statement.cs (Return.Resolve): Flag an error if we are used in
14171 an iterator method.
14173 * codegen.cs (InIterator): New flag set if the code is being
14174 compiled in an iterator method.
14176 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14177 internal modifier, and we just use it to avoid adding extra
14178 fields, as this is seldom used.
14180 * cs-parser.jay: Add yield_statement (yield and yield break).
14182 * driver.cs: New flag -v2 to turn on version 2 features.
14184 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14185 hashtable when v2 is enabled.
14187 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14189 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14190 there is already a namespace defined with this name.
14192 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14193 people upgraded their corlibs.
14195 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14196 always use fully qualified types, no need to use the compiler
14199 (TypeManager.IsNamespace): Use binarysearch.
14201 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14202 AddDelegate): I did not quite use the new IsValid API properly: I
14203 have to pass the short-name and the fullname. I was passing only
14204 the basename instead of the fullname sometimes.
14206 (TypeContainer.DefineType): call NamespaceClash.
14208 * interface.cs (Interface.DefineType): use NamespaceClash before
14211 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14214 * enum.cs: (Enum.DefineType): use NamespaceClash before
14217 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14218 speed increase. First, use the negative_hits cache when we get a
14219 negative. Second, add the type with its full original name
14220 instead of the new . and + encoded name (reflection uses + to
14221 separate type from a nested type). Use LookupTypeReflection
14222 directly which bypasses the type->name hashtable (that we already
14223 know does not contain the type.
14225 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14226 location/container type.
14228 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14230 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14232 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14234 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14235 method is being referenced in the method group from a static
14236 context, and report error 120 if so.
14238 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14241 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14242 is created, we create the A namespace).
14244 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14247 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14249 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14250 invocation to ModuleBuilder.GetType with the same values will
14251 return a new type instance, so we need to cache its return
14254 * expression.cs (Binary.ResolveOperator): Only allow the compare
14255 operators on enums if they are of the same type.
14257 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14258 types of ValueType on their own case. Before we were giving them
14259 the same treatment as objects.
14261 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14262 fullname. Short name is used to compare against container name.
14263 Fullname is used to check against defined namespace names.
14265 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14266 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14268 (Method.CheckBase): Call parent.
14269 (MemberBase.CheckBase): Check for protected members on sealed
14271 (PropertyBase.CheckBase): Call parent.
14272 (Field.Define): Call parent.
14274 * report.cs: Negative error codes are now mapped to 8000 - code,
14275 so that the display is render more nicely.
14277 * typemanager.cs: Do not use try/catch, instead report a regular
14280 (GetPointerType, GetReferenceType): These methods provide
14281 mechanisms to obtain the T* and T& from a T. We had the code
14282 previously scattered around the code base, and it also used
14283 TypeManager.LookupType that would go through plenty of caches.
14284 This one goes directly to the type source.
14286 In some places we did the Type.GetType followed by
14287 ModuleBuilder.GetType, but not in others, so this unifies the
14288 processing as well.
14290 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14291 statements now that we have namespace information.
14293 * typemanager.cs (IsNamespace): New method, returns whether the
14294 string presented is a namespace or not.
14296 (ComputeNamespaces): New public entry point, computes the list of
14297 available namespaces, using the GetNamespaces API call in Mono, or
14298 the slower version in MS.NET.
14300 Now before we start the semantic analysis phase, we have a
14301 complete list of namespaces including everything that the user has
14304 Deleted old code to cache namespaces in .nsc files.
14306 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14308 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14309 class/struct location definition Location for the implicit
14310 constructor location.
14312 (Operator.Define): Use the location of the operator for the
14313 implicit Method definition.
14315 (Constructor.Emit): use the constructor location for the implicit
14316 base initializer constructor.
14318 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14319 and the Expression class now contains two new methods:
14321 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14322 isolate type lookup from the rest of the resolution process.
14324 Since we use Expressions to hold type definitions due to the way
14325 we parse the input we have historically overloaded Resolve to
14326 perform the Type lookups if a special flag is passed. Now this is
14327 eliminated and two methods take their place.
14329 The differences in the two methods between xStep and xTerminal is
14330 that xStep is involved in our current lookup system that uses
14331 SimpleNames to compose a name, while xTerminal is used just to
14332 catch the case where the simplename lookup failed.
14334 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14336 * expression.cs (ResolveMemberAccess): Remove redundant code.
14337 TypeExpr expressions are always born fully resolved.
14339 * interface.cs (PopulateMethod): Do not lookup the types twice.
14340 We were doing it once during SemanticAnalysis and once during
14343 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14344 in local variable type definitions, were being returned as a
14345 SimpleName (we decomposed everything into a string), that is
14346 because primary_expression was being used instead of a type in the
14347 grammar (reduce/reduce conflicts).
14349 The part that was wrong is that we converted the expression into a
14350 string (an oversimplification in one hand, compounded with primary
14351 expressions doing string concatenation).
14357 Would return "A.B.C[]" as a SimpleName. This stopped things like
14358 using clauses from working on this particular context. And a type
14359 was being matched directly against "A.B.C[]".
14361 We now use the correct approach, and allow for ComposedCast to be
14362 part of the unary expression. So the "A.B.C []" become a composed
14363 cast of "A.B.C" (as a nested group of MemberAccess with a
14364 SimpleName at the end) plus the rank composition "[]".
14368 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14370 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14371 for the access level checking.
14373 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14374 `TypeContainer container', because I kept getting confused when I
14375 was debugging this code.
14377 * expression.cs (Indexers): Instead of tracking getters/setters,
14378 we now track them in parallel. We create one arraylist less, but
14379 most importantly it is possible now for the LValue code to find a
14380 matching get for a set.
14382 (IndexerAccess.DoResolveLValue): Update the code.
14383 GetIndexersForType has been modified already to extract all the
14384 indexers from a type. The code assumed it did not.
14386 Also make the code set the correct return type for the indexer.
14387 This was fixed a long time ago for properties, but was missing for
14388 indexers. It used to be void_type.
14390 (Binary.Emit): Test first for doubles instead of
14391 floats, as they are more common.
14393 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14394 when dealing with floats and the <=, >= operators. This fixes bug
14397 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14398 to load the array value by emitting a load on the foreach variable
14399 type. This was incorrect.
14401 We now emit the code to load an element using the the array
14402 variable type, and then we emit the conversion operator.
14406 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14408 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14410 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14412 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14413 test for protection before we test for signatures.
14415 (MethodSignature.ToString): implement.
14417 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14418 to the case where we reduced into a LongConstant.
14420 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14421 depend on whether the information is acurrate, because the
14422 Microsoft runtime will always claim that the array type is public,
14423 regardless of the real state.
14425 If the type is a pointer, another problem happens: the type is
14426 reported as non-public in Microsoft.
14428 In both cases we have to call CheckAccessLevel recursively with
14429 the underlying type as the argument to be tested.
14431 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14433 * assign.cs (Assign.Emit): If we are dealing with a compound
14434 assignment expression, we should use the code path that stores the
14435 intermediate result in a temporary value. This fixes #40903.
14437 *expression.cs (Indirection.ToString): Provide ToString method for
14440 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14442 * class.cs: Null out fields holding references to Block objects so
14443 they can be garbage collected.
14445 * expression.cs (OverloadResolve): Remove unused local.
14447 2003-04-07 Martin Baulig <martin@ximian.com>
14449 * codegen.cs (EmitContext.CurrentFile): New public field.
14450 (EmitContext.Mark): Use the CurrentFile to check whether the
14451 location is in the correct file.
14452 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14454 2003-04-07 Martin Baulig <martin@ximian.com>
14456 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14458 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14459 location. [FIXME: The location argument which gets passed to this
14460 method is sometimes wrong!]
14462 2003-04-07 Nick Drochak <ndrochak@gol.com>
14464 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14466 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14468 * expression.cs (Indirection.EmitAssign): We were using the
14469 temporary, but returning immediately instead of continuing the
14472 2003-04-06 Martin Baulig <martin@ximian.com>
14474 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14475 if it's a nested child, but also deriving from the outer class.
14478 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14479 nested child, but also deriving from the outer class. See
14481 (FilterWithClosure): We may access private members of the outer
14482 class if we're a nested child and deriving from the outer class.
14483 (RealMemberLookup): Only set `closure_private_ok' if the
14484 `original_bf' contained BindingFlags.NonPublic.
14486 2003-04-05 Martin Baulig <martin@ximian.com>
14488 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
14490 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14492 * class.cs (Event.Define): Do not allow abstract events to have
14495 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14497 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14498 block in event declarations.
14500 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14501 value type, get its address.
14503 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14504 leaving a class on the stack instead of a boolean value (int
14505 0/1). Change the code so we compare against null, and then the
14506 result against zero.
14508 * class.cs (TypeContainer.GetClassBases): We were checking for the
14509 parent class being sealed too late.
14511 * expression.cs (Binary.Emit): For <= and >= when dealing with
14512 floating point values, use cgt.un and clt.un instead of cgt and
14515 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14517 * statement.cs: Apply the same optimization as MS: skip the
14518 GetEnumerator returning an IEnumerator, and use the one returning a
14519 CharEnumerator instead. This allows us to avoid the try-finally block
14522 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14524 * cs-parser.jay: Attributes cannot be applied to
14525 namespaces. Fixes #40473
14527 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14530 (Add*): check if the name is valid using the full name for constants,
14531 fields, properties and events.
14533 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14535 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14536 char constants to be part of the enumeration.
14538 * expression.cs (Conditional.DoResolve): Add support for operator
14539 true. Implements the missing functionality from 14.12
14541 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14542 operator true/false as required by the spec.
14544 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14545 implicit conversion to boolean.
14547 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14548 also one where the type implements `operator true'.
14550 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14551 get an expression that will invoke operator true based on an
14554 (GetConversionOperators): Removed the hack that called op_True
14557 (Expression.ResolveBoolean): Move this from Statement.
14559 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14561 * ecore.cs (FieldExpr): do not allow initialization of initonly
14562 fields on derived classes
14564 2003-03-13 Martin Baulig <martin@ximian.com>
14566 * statement.cs (Block.Emit): Call ig.BeginScope() and
14567 ig.EndScope() when compiling with debugging info; call
14568 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14570 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14572 * expression.cs (Indexers): Do not construct immediately, allow
14573 for new members to be appended as we go. Fixes 38143
14575 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14577 * expression.cs: save/restore context when resolving an unchecked
14580 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14582 * cfold.cs: Catch division by zero in modulus operator during
14585 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14587 * interface.cs (Interface.DefineMembers): Avoid defining members
14590 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14592 * driver.cs: handle the +/- options for -noconfig
14594 * statement.cs (Unckeched.Resolve): Also track the state of
14595 unchecked in the Resolve phase.
14597 2003-02-27 Martin Baulig <martin@ximian.com>
14599 * ecore.cs (Expression.MemberLookup): Don't create a
14600 MethodGroupExpr for something which is not a method. Fixes #38291.
14602 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14604 * class.cs (MemberBase.CheckParameters): Also check that the type
14605 is unmanaged if it is a pointer.
14607 * expression.cs (SizeOf.Resolve): Add location information.
14609 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14610 a managed type is declared.
14612 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14613 parameter modifiers as well. Fixes bug 38606
14615 * class.cs: Very sad. Am backing out the speed up changes
14616 introduced by the ArrayList -> Array in the TypeContainer, as they
14617 were not actually that much faster, and introduced a bug (no error
14618 reports on duplicated methods).
14620 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14621 source first, this will guarantee that we have a valid expression
14622 before calling in lower levels functions that will require a
14623 resolved object. Then use this original_source in the
14624 target.ResolveLValue instead of the original source that was
14627 Another change. Use target.Resolve instead of LValueResolve.
14628 Although we are resolving for LValues, we will let the Assign code
14629 take care of that (it will be called again from Resolve). This
14630 basically allows code like this:
14632 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14633 class Y { void A (X x) { x [0] += o; }
14635 The problem was that the indexer was trying to resolve for
14636 set_Item (idx, object o) and never finding one. The real set_Item
14637 was set_Item (idx, X). By delaying the process we get the right
14642 2003-02-23 Martin Baulig <martin@ximian.com>
14644 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14645 while calling DoEmit ().
14647 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14648 source files; if you use the #line directive inside a method, the
14649 compiler stops emitting line numbers for the debugger until it
14650 reaches the end of the method or another #line directive which
14651 restores the original file.
14653 2003-02-23 Martin Baulig <martin@ximian.com>
14655 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14657 2003-02-23 Martin Baulig <martin@ximian.com>
14659 * statement.cs (Block.AddChildVariableNames): We need to call this
14660 recursively, not just for our immediate children.
14662 2003-02-23 Martin Baulig <martin@ximian.com>
14664 * class.cs (Event.Define): Always make the field private, like csc does.
14666 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14667 actually work, fixes bug #37521.
14669 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14671 * delegate.cs: When creating the various temporary "Parameters"
14672 classes, make sure that we call the ComputeAndDefineParameterTypes
14673 on those new parameters (just like we do with the formal ones), to
14674 allow them to be resolved in the context of the DeclSpace.
14676 This fixes the bug that Dick observed in Bugzilla #38530.
14678 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14680 * expression.cs (ResolveMemberAccess): When resolving a constant,
14681 do not attempt to pull a constant if the value was not able to
14682 generate a valid constant.
14684 * const.cs (LookupConstantValue): Do not report more errors than required.
14686 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14688 * expression.cs: fixes bug #38328.
14690 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14692 * class.cs: Changed all the various members that can be part of a
14693 class from being an ArrayList to be an Array of the right type.
14694 During the DefineType type_list, interface_list, delegate_list and
14695 enum_list are turned into types, interfaces, delegates and enums
14698 And during the member population, indexer_list, event_list,
14699 constant_list, field_list, instance_constructor_list, method_list,
14700 operator_list and property_list are turned into their real arrays.
14702 Although we could probably perform this operation earlier, for
14703 good error reporting we need to keep the lists and remove the
14704 lists for longer than required.
14706 This optimization was triggered by Paolo profiling the compiler
14707 speed on the output of `gen-sample-program.pl' perl script.
14709 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14710 not crash in methods like MemberLookupFailed that use this field.
14712 This problem arises when the compiler fails to resolve a type
14713 during interface type definition for example.
14715 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14717 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14718 inherit from System.Object, so we have to stop at null, not only
14719 when reaching System.Object.
14721 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14723 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14724 DeclaredOnly because the parent indexer might have had a different
14725 name, but did not loop until the top of the hierarchy was reached.
14727 The problem this one fixes is 35492: when a class implemented an
14728 indexer from an interface, we were getting the interface method
14729 (which was abstract) and we were flagging an error (can not invoke
14732 This also keeps bug 33089 functioning, and test-148 functioning.
14734 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14735 out if a method is special is to see if it is declared in a
14736 property or event, or whether it is one of the predefined operator
14737 names. This should fix correctly #36804.
14739 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14741 The goal here is to remove the dependency on EmptyCast.Peel ().
14742 Killing it completely.
14744 The problem is that currently in a number of places where
14745 constants are expected, we have to "probe" for an EmptyCast, and
14746 Peel, which is not the correct thing to do, as this will be
14747 repetitive and will likely lead to errors.
14749 The idea is to remove any EmptyCasts that are used in casts that
14750 can be reduced to constants, so we only have to cope with
14753 This bug hunt was triggered by Bug 37363 and the desire to remove
14754 the duplicate pattern where we were "peeling" emptycasts to check
14755 whether they were constants. Now constants will always be
14758 * ecore.cs: Use an enumconstant here instead of wrapping with
14761 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14762 throwing me off. By handling this we can get rid of a few hacks.
14764 * statement.cs (Switch): Removed Peel() code.
14766 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14768 * class.cs: Location information for error 508
14770 * expression.cs (New.DoResolve): Add a guard against double
14771 resolution of an expression.
14773 The New DoResolve might be called twice when initializing field
14774 expressions (see EmitFieldInitializers, the call to
14775 GetInitializerExpression will perform a resolve on the expression,
14776 and later the assign will trigger another resolution
14778 This leads to bugs (#37014)
14780 * delegate.cs: The signature for EndInvoke should contain any ref
14781 or out parameters as well. We were not doing this in the past.
14783 * class.cs (Field.Define): Do not overwrite the type definition
14784 inside the `volatile' group. Turns out that volatile enumerations
14785 were changing the type here to perform a validity test, which
14788 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14790 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14791 and structs, we do not want to load the instance variable
14793 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14794 enum_type has to be handled like an object reference (implicit
14795 conversions exists from this to object), but the regular IsClass
14796 and IsValueType tests will never return true for this one.
14798 Also we use TypeManager.IsValueType instead of type.IsValueType,
14799 just for consistency with the rest of the code (this is only
14800 needed if we ever use the construct exposed by test-180.cs inside
14801 corlib, which we dont today).
14803 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14805 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14808 2003-02-09 Martin Baulig <martin@ximian.com>
14810 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14811 (Namespace.DefineNamespaces): New static public method; this is
14812 called when we're compiling with debugging to add all namespaces
14813 to the symbol file.
14815 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14816 pass it to the Namespace's .ctor.
14818 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14819 and MethodBase arguments; pass the namespace ID to the symwriter;
14820 pass the MethodBase instead of the token to the symwriter.
14821 (SymbolWriter.DefineNamespace): New method to add a namespace to
14824 2003-02-09 Martin Baulig <martin@ximian.com>
14826 * symbolwriter.cs: New file. This is a wrapper around
14827 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14828 methods here in near future.
14830 2003-02-09 Martin Baulig <martin@ximian.com>
14832 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14833 ILGenerator.MarkSequencePoint() which are actually used by the
14836 2003-02-09 Martin Baulig <martin@ximian.com>
14838 * location.cs (SourceFile): New public sealed class. This
14839 contains the name and an index which is used in the location's token.
14840 (Location): Reserve an appropriate number of bits in the token for
14841 the source file instead of walking over that list, this gives us a
14842 really huge performance improvement when compiling with debugging.
14844 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14845 `SourceFile' argument instead of a string.
14846 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14847 but don't parse/tokenize here, we need to generate the list of all
14848 source files before we do that.
14849 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14852 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14853 instead of a string.
14855 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14858 2003-02-09 Martin Baulig <martin@ximian.com>
14860 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14861 filename on `#line default'.
14863 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14865 * statement.cs: don't clear the pinned var when the fixed statement
14866 returns from the method (fixes bug#37752).
14868 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14870 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14873 2003-02-07 Martin Baulig <martin@ximian.com>
14875 * driver.cs: Removed the `--debug-args' command line argument.
14877 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14878 automatically by the AsssemblyBuilder.
14879 (CodeGen.InitializeSymbolWriter): We don't need to call any
14880 initialization function on the symbol writer anymore. This method
14881 doesn't take any arguments.
14883 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14885 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14886 from referenced assemblies as well.
14888 2003-02-02 Martin Baulig <martin@ximian.com>
14890 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14892 2003-02-02 Martin Baulig <martin@ximian.com>
14894 * class.cs (Constructor.Emit): Open the symbol writer before
14895 emitting the constructor initializer.
14896 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14897 single-stepping through constructor initializers.
14899 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14901 * class.cs: Handle error 549: do not allow virtual methods in
14904 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14906 * decl.cs: Check access levels when resolving types
14908 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14910 * statement.cs: Add parameters and locals set in catch blocks that might
14911 return to set vector
14913 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14915 * class.cs (Operator): Set the SpecialName flags for operators.
14917 * expression.cs (Invocation.DoResolve): Only block calls to
14918 accessors and operators on SpecialName methods.
14920 (Cast.TryReduce): Handle conversions from char constants.
14923 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14925 * statement.cs: small memory and time optimization in FlowBranching.
14927 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14929 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14930 problem that the last fix but in the other sid (Set).
14932 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14933 access when there is no indexer in the hierarchy.
14935 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14937 * class.cs: Combine some if statements.
14939 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14941 * driver.cs: fixed bug #37187.
14943 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14945 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14946 any indexer, it's needed to build a list with all the indexers in the
14947 hierarchy (AllGetters), else we have problems. Fixes #35653.
14949 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14951 * class.cs (MethodData.Define): It is wrong for an interface
14952 implementation to be static in both cases: explicit and implicit.
14953 We were only handling this in one case.
14955 Improve the if situation there to not have negations.
14957 * class.cs (Field.Define): Turns out that we do not need to check
14958 the unsafe bit on field definition, only on usage. Remove the test.
14960 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14962 * driver.cs: use assembly.Location instead of Codebase (the latest
14963 patch made mcs fail when using MS assemblies).
14965 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14967 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14968 get the path to *corlib.dll.
14970 2003-01-21 Nick Drochak <ndrochak@gol.com>
14974 * typemanager.cs: Remove compiler warnings
14976 2003-01-20 Duncan Mak <duncan@ximian.com>
14978 * AssemblyInfo.cs: Bump the version number to 0.19.
14980 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14982 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14984 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14986 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14988 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14990 * cs-parser.jay: Small fix: we were not comparing the constructor
14991 name correctly. Thanks to Zoltan for the initial pointer.
14993 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14995 * cs-tokenizer.cs: Set file name when specified with #line
14997 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14999 * cs-parser.jay: Only perform the constructor checks here if we
15000 are named like the class; This will help provider a better
15001 error. The constructor path is taken when a type definition is
15002 not found, but most likely the user forgot to add the type, so
15003 report that rather than the constructor error.
15005 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15007 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15010 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15012 * cs-parser.jay: Add cleanup call.
15014 2003-01-13 Duncan Mak <duncan@ximian.com>
15016 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15017 consistent with other methods.
15019 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15021 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15023 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15025 * attribute.cs: only set GuidAttr to true when we have a
15028 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15032 * typemanager.cs: fixes to allow mcs compile corlib with the new
15033 Type.IsSubclassOf fix.
15035 2003-01-08 Miguel de Icaza <miguel@ximian.com>
15037 * expression.cs (LocalVariableReference.DoResolve): Classify a
15038 constant as a value, not as a variable. Also, set the type for
15041 * cs-parser.jay (fixed_statement): take a type instead of a
15042 pointer_type, so we can produce a better error message later.
15044 * statement.cs (Fixed.Resolve): Flag types that are not pointers
15047 (For.DoEmit): Make inifinite loops have a
15048 non-conditional branch back.
15050 (Fixed.DoEmit): First populate the pinned variables, then emit the
15051 statement, then clear the variables. Before I was emitting the
15052 code once for each fixed piece.
15055 2003-01-08 Martin Baulig <martin@ximian.com>
15057 * statement.cs (FlowBranching.MergeChild): A break in a
15058 SWITCH_SECTION does not leave a loop. Fixes #36155.
15060 2003-01-08 Martin Baulig <martin@ximian.com>
15062 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15063 lives in the same number space than `param_map'. Fixes #36154.
15065 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15067 * cs-parser.jay (constructor_declaration): Set the
15068 Constructor.ModFlags before probing for it. This makes the
15069 compiler report 514, 515 and 132 (the code was there, but got
15072 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15073 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15074 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15076 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15078 * enum.cs: create the enum static fields using the enum type.
15080 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15082 * class.cs: don't try to create the ParamBuilder for the return
15083 type if it's not needed (and handle it breaking for the ms runtime
15086 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15088 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15090 2002-12-29 Miguel de Icaza <miguel@ximian.com>
15092 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15093 the command. This showed up while compiling the JANET source
15094 code, which used \r as its only newline separator.
15096 2002-12-28 Miguel de Icaza <miguel@ximian.com>
15098 * class.cs (Method.Define): If we are an operator (because it
15099 reuses our code), then set the SpecialName and HideBySig. #36128
15101 2002-12-22 Miguel de Icaza <miguel@ximian.com>
15103 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15104 exception, report error 120 `object reference required'.
15106 * driver.cs: Add --pause option, used during to measure the size
15107 of the process as it goes with --timestamp.
15109 * expression.cs (Invocation.DoResolve): Do not allow methods with
15110 SpecialName to be invoked.
15112 2002-12-21 Miguel de Icaza <miguel@ximian.com>
15114 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15115 number before adding it.
15117 2002-12-21 Ravi Pratap <ravi@ximian.com>
15119 * ecore.cs (StandardImplicitConversion): When in an unsafe
15120 context, we allow conversion between void * to any other pointer
15121 type. This fixes bug #35973.
15123 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15125 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15126 is not thrown when extensionless outputs are used
15128 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15130 * rootcontext.cs: fixed compilation of corlib.
15132 2002-12-19 Miguel de Icaza <miguel@ximian.com>
15134 * attribute.cs (Attributes.Contains): Add new method.
15136 * class.cs (MethodCore.LabelParameters): if the parameter is an
15137 `out' parameter, check that no attribute `[In]' has been passed.
15139 * enum.cs: Handle the `value__' name in an enumeration.
15141 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15143 * decl.cs: Added special case to allow overrides on "protected
15146 2002-12-18 Ravi Pratap <ravi@ximian.com>
15148 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15149 since it makes much more sense.
15151 (Attributes.ctor): Don't require a Location parameter.
15153 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15155 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15156 since we already have that information per attribute.
15158 * everywhere : make appropriate changes.
15160 * class.cs (LabelParameters): Write the code which actually
15161 applies attributes to the return type. We can't do this on the MS
15162 .NET runtime so we flag a warning in the case an exception is
15165 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15167 * const.cs: Handle implicit null conversions here too.
15169 2002-12-17 Ravi Pratap <ravi@ximian.com>
15171 * class.cs (MethodCore.LabelParameters): Remove the extra
15172 Type [] parameter since it is completely unnecessary. Instead
15173 pass in the method's attributes so that we can extract
15174 the "return" attribute.
15176 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15178 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15179 of ignoring it and letting the compile continue.
15181 * typemanager.cs (ChangeType): use an extra argument to return an
15182 error condition instead of throwing an exception.
15184 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15186 * expression.cs (Unary.TryReduce): mimic the code for the regular
15187 code path. Perform an implicit cast in the cases where we can
15188 implicitly convert to one of the integral types, and then reduce
15189 based on that constant. This fixes bug #35483.
15191 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15193 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15195 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15197 * namespace.cs: fixed bug #35489.
15199 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15201 * class.cs: Remove some dead code.
15203 * cs-parser.jay: Estimate the number of methods needed
15204 (RootContext.MethodCount);
15206 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15207 numbers instead of StringBuilders.
15209 * support.cs (PtrHashtable): Add constructor with initial size;
15210 We can now reduce reallocations of the method table.
15212 2002-12-10 Ravi Pratap <ravi@ximian.com>
15214 * attribute.cs (ApplyAttributes): Keep track of the emitted
15215 attributes on a per-target basis. This fixes bug #35413.
15217 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15219 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15220 default to the Windows 1252 encoding.
15222 (UnixParseOption): Support version, thanks to Alp for the missing
15225 * AssemblyInfo.cs: Add nice assembly information.
15227 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15230 * cs-parser.jay: Allow a trailing comma before the close bracked
15231 in the attribute_section production.
15233 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15234 address of the instance was being taken, I will take this out,
15235 because we take the address of the object immediately here.
15237 2002-12-09 Ravi Pratap <ravi@ximian.com>
15239 * typemanager.cs (AreMultipleAllowed): Take care of the most
15240 obvious case where attribute type is not in the current assembly -
15243 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15245 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15246 definitions, instead of doing that afterwards.
15248 Also we use a nice little hack, depending on the constructor, we
15249 know if we are a "composed" name or a simple name. Hence, we
15250 avoid the IndexOf test, and we avoid
15252 * codegen.cs: Add code to assist in a bug reporter to track down
15253 the source of a compiler crash.
15255 2002-12-07 Ravi Pratap <ravi@ximian.com>
15257 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15258 types have been emitted for a given element and flag an error
15259 if something which does not have AllowMultiple set is used more
15262 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15263 attribute types and their corresponding AllowMultiple properties
15265 (AreMultipleAllowed): Check the property for a given type.
15267 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15268 property in the case we have a TypeContainer.
15270 (Attributes.AddAttribute): Detect duplicates and just skip on
15271 adding them. This trivial fix catches a pretty gross error in our
15272 attribute emission - global attributes were being emitted twice!
15274 Bugzilla bug #33187 is now fixed.
15276 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15278 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15279 instead of pp_and).
15281 * expression.cs (Binary.ResolveOperator): I can only use the
15282 Concat (string, string, string) and Concat (string, string,
15283 string, string) if the child is actually a concatenation of
15286 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15288 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15289 context where we need a 2-character lookahead.
15291 * pending.cs (PendingImplementation): Rework so we can keep track
15292 of interface types all the time, and flag those which were
15293 implemented by parents as optional.
15295 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15297 * expression.cs (Binary.ResolveOperator): Use
15298 String.Concat(string,string,string) or
15299 String.Concat(string,string,string,string) when possible.
15301 * typemanager: More helper methods.
15304 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15306 * pending.cs: remove the bogus return from GetMissingInterfaces()
15307 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15309 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15311 * namespace.cs: avoid duplicated 'using xxx' being added to
15312 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15313 when we get more than one 'using' statement for the same namespace.
15314 Report a CS0105 warning for it.
15316 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15318 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15319 of calling getChar/putback, uses internal knowledge of it.
15321 (xtoken): Reorder tokenizer so most common patterns are checked
15322 first. This reduces the compilation time in another 5% (from 8.11s
15323 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15325 The parsing time is 22% of the compilation in mcs, and from that
15326 64% is spent on the tokenization process.
15328 I tried using a binary search for keywords, but this is slower
15329 than the hashtable. Another option would be to do a couple of
15332 * Not use a StringBuilder, instead use an array of chars,
15333 with a set value. Notice that this way we could catch
15334 the 645 error without having to do it *afterwards*.
15336 * We could write a hand-parser to avoid the hashtable
15337 compares altogether.
15339 The identifier consumption process takes 37% of the tokenization
15340 time. Another 15% is spent on is_number. 56% of the time spent
15341 on is_number is spent on Int64.Parse:
15343 * We could probably choose based on the string length to
15344 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15347 Another 3% is spend on wrapping `xtoken' in the `token' function.
15349 Handle 0xa0 as whitespace (#34752)
15351 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15353 * typemanager.cs (IsCLRType): New routine to tell whether a type
15354 is one of the builtin types.
15356 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15357 typecode in more places instead of doing pointer comparissions.
15358 We could leverage some knowledge about the way the typecodes are
15361 New code to cache namespaces in assemblies, it is currently not
15362 invoked, to be used soon.
15364 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15366 * expression.cs (Binary.ResolveOperator): specially handle
15367 strings, and do not perform user-defined operator overloading for
15370 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15372 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15373 internalcall as it is a pretty simple operation; Avoid whenever
15374 possible to call Char.IsLetter.
15376 (consume_identifier): Cut by half the number of
15377 hashtable calls by merging the is_keyword and GetKeyword behavior.
15379 Do not short-circuit, because if we do, we
15380 report errors (ie, #if false && true would produce an invalid
15384 2002-11-24 Martin Baulig <martin@ximian.com>
15386 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15387 check constant ranges and report a CS0221. Fixes #33186.
15389 2002-11-24 Martin Baulig <martin@ximian.com>
15391 * cs-parser.jay: Make this work for uninitialized variable
15392 declarations in the `for' initializer. Fixes #32416.
15394 2002-11-24 Martin Baulig <martin@ximian.com>
15396 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15397 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15399 2002-11-24 Martin Baulig <martin@ximian.com>
15401 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15402 argument; if true, we also check for user-defined conversions.
15403 This is only needed if both arguments are of a user-defined type.
15404 Fixes #30443, added test-175.cs.
15405 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15407 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15409 2002-11-24 Martin Baulig <martin@ximian.com>
15411 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15412 function to get the store opcode.
15413 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15414 only emit the Ldelema if the store opcode is Stobj. You must run
15415 both test-34 and test-167 to test this. Fixes #34529.
15417 2002-11-23 Martin Baulig <martin@ximian.com>
15419 * ecore.cs (Expression.MemberLookup): Added additional
15420 `qualifier_type' argument which is used when we're being called
15421 from MemberAccess.DoResolve() and null if we're called from a
15423 (Expression.MemberLookupFailed): New method to report errors; this
15424 does the CS1540 check and reports the correct error message.
15426 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15427 argument for the CS1540 check and redone the way how we're dealing
15428 with private members. See the comment in the source code for details.
15429 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15430 `closure_start_type' to `closure_qualifier_type' and check whether
15431 it's not null. It was not this filter being broken, it was just
15432 being called with the wrong arguments.
15434 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15435 and pass it the correct `qualifier_type'; this also does the error
15438 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15440 * expression.cs (Invocation.EmitParams): If the we are dealing
15441 with a non-built-in value type, load its address as well.
15443 (ArrayCreation): Use a a pretty constant instead
15444 of the hardcoded value 2. Use 6 instead of 2 for the number of
15445 static initializers.
15447 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15448 because they are not really value types, just glorified integers.
15450 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15452 * ecore.cs: Remove redundant code for enumerations, make them use
15453 the same code path as everything else, fixes the casting issue
15454 with enumerations in Windows.Forms.
15456 * attribute.cs: Do only cast to string if it is a string, the
15457 validation happens later.
15459 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15460 people upgrade their corlibs.
15462 * ecore.cs: Oops, enumerations were not following the entire code path
15464 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15466 * typemanager.cs (FilterWithClosure): Commented out the test for
15467 1540 in typemanager.cs, as it has problems when accessing
15468 protected methods from a parent class (see test-174.cs).
15470 * attribute.cs (Attribute.ValidateGuid): new method.
15471 (Attribute.Resolve): Use above.
15473 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15475 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15477 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15478 handling for enumerations, as we only needed the TypeContainer
15479 functionality to begin with (this is required for the fix below to
15480 work for enums that reference constants in a container class for
15483 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15485 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15486 a valid TypeBuilder to perform lookups on.o
15488 * class.cs (InheritableMemberSignatureCompare): Use true in the
15489 call to GetGetMethod and GetSetMethod, because we are comparing
15490 the signature, and we need to get the methods *even* if they are
15493 (PropertyBase.CheckBase): ditto.
15495 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15496 GotoCase.Resolve): Use Peel on EmpytCasts.
15498 * ecore.cs (EmptyCast): drop child, add Peel method.
15500 2002-11-17 Martin Baulig <martin@ximian.com>
15502 * ecore.cs (EmptyCast.Child): New public property.
15504 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15505 label resolved to an EmptyCast. Fixes #34162.
15506 (GotoCase.Resolve): Likewise.
15507 (Block.EmitMeta): Likewise.
15509 2002-11-17 Martin Baulig <martin@ximian.com>
15511 * expression.cs (Invocation.BetterConversion): Prefer int over
15512 uint; short over ushort; long over ulong for integer literals.
15513 Use ImplicitConversionExists instead of StandardConversionExists
15514 since we also need to check for user-defined implicit conversions.
15515 Fixes #34165. Added test-173.cs.
15517 2002-11-16 Martin Baulig <martin@ximian.com>
15519 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15520 with the `true' and `false' literals. Fixes #33151.
15522 2002-11-16 Martin Baulig <martin@ximian.com>
15524 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15525 October 22nd; don't do the cs1540 check for static members.
15527 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15528 now using our own filter here and doing the cs1540 check again.
15530 2002-11-16 Martin Baulig <martin@ximian.com>
15532 * support.cs (InternalParameters): Don't crash if we don't have
15533 any fixed parameters. Fixes #33532.
15535 2002-11-16 Martin Baulig <martin@ximian.com>
15537 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15538 when looking up static methods to make this work on Windows.
15541 2002-11-16 Martin Baulig <martin@ximian.com>
15543 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15544 a setter rather than using PropertyInfo.CanWrite.
15546 2002-11-15 Nick Drochak <ndrochak@gol.com>
15548 * class.cs: Allow acces to block member by subclasses. Fixes build
15551 2002-11-14 Martin Baulig <martin@ximian.com>
15553 * class.cs (Constructor.Emit): Added the extern/block check.
15556 2002-11-14 Martin Baulig <martin@ximian.com>
15558 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15559 iteration while looking for indexers, this is needed because the
15560 indexer may have a different name in our base classes. Fixed the
15561 error reporting (no indexers at all, not get accessor, no
15562 overloaded match). Fixes bug #33089.
15563 (IndexerAccess.DoResolveLValue): Likewise.
15565 2002-11-14 Martin Baulig <martin@ximian.com>
15567 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15568 indexers. Fixes the first part of bug #33089.
15569 (MethodSignature.InheritableMemberSignatureCompare): Added support
15572 2002-11-13 Ravi Pratap <ravi@ximian.com>
15574 * attribute.cs (Attribute.Resolve): Catch the
15575 NullReferenceException and report it since it isn't supposed to
15578 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15580 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15581 LogicalOr and LogicalAnd that can benefit from recursively
15582 handling EmitBranchable. The code now should be nice for Paolo.
15584 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15586 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15587 the Type lookups, as we perform quite a number of lookups on
15588 non-Types. This can be removed once we can deterministically tell
15589 whether we have a type or a namespace in advance.
15591 But this might require special hacks from our corlib.
15595 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15596 and double which avoids a conversion from an integer to a double.
15598 * expression.cs: tiny optimization, avoid calling IsConstant,
15599 because it effectively performs the lookup twice.
15601 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15603 But a bogus return here to keep the semantics of the old code
15604 until the Mono runtime is fixed.
15606 * pending.cs (GetMissingInterfaces): New method used to remove all
15607 the interfaces that are already implemented by our parent
15608 classes from the list of pending methods.
15610 * interface.cs: Add checks for calls after ResolveTypeExpr.
15612 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15614 * class.cs (Class.Emit): Report warning 67: event not used if the
15615 warning level is beyond 3.
15617 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15618 being a NullLiteral.
15620 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15623 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15624 path that might fail if a type can not be resolved.
15626 * expression.cs (Binary.Emit): Emit unsigned versions of the
15629 * driver.cs: use error 5.
15631 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15633 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15635 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15637 * cs-parser.jay (switch_section): A beautiful patch from Martin
15638 Baulig that fixed 33094.
15640 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15642 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15643 Check whether the base is abstract and report an error if so.
15645 * expression.cs (IndexerAccess.DoResolveLValue,
15646 IndexerAccess.DoResolve): ditto.
15648 (Invocation.DoResolve): ditto.
15650 (Invocation.FullMethodDesc): Improve the report string.
15652 * statement.cs (Block): Eliminate IsVariableDefined as it is
15653 basically just a wrapper for GetVariableInfo.
15655 * ecore.cs (SimpleName): Use new
15657 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15658 type, as we return the actual parameter ref/unref state on a
15661 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15663 * support.cs: Return proper flags REF/OUT fixing the previous
15666 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15667 not used to mean `ref' but `ref or out' in ParameterReference
15669 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15670 full type signature instead of calling TypeManger.CSharpName
15673 * support.cs (InternalParameters.ParameterDesc): Do not compare
15674 directly to the modflags, because REF/OUT will actually be bitsets
15677 * delegate.cs (VerifyMethod): Check also the modifiers.
15679 * cs-tokenizer.cs: Fix bug where floating point values with an
15680 exponent where a sign was missing was ignored.
15682 * driver.cs: Allow multiple assemblies to be specified in a single
15685 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15687 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15688 because identifiers after a parenthesis would end up in this kind
15689 of production, and we needed to desamiguate it for having casts
15692 (UserDefinedType *) xxx
15694 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15696 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15697 we should set on the Bindingflags.NonPublic, but not turn on
15698 private_ok. private_ok controls whether a Private member is
15699 returned (this is chekced on the filter routine), while the
15700 BindingFlags.NonPublic just controls whether private/protected
15701 will be allowed. This fixes the problem part of the problem of
15702 private properties being allowed to be used in derived classes.
15704 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15705 so we can call the children DoResolveLValue method (this will
15706 properly signal errors on lvalue assignments to base properties)
15708 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15709 getter are null, and we have a property info, we know that this
15710 happened because the lookup failed, so we report an error 122 for
15711 protection level violation.
15713 We also silently return if setter and getter are null in the
15714 resolve functions, this condition only happens if we have flagged
15715 the error before. This is the other half of the problem.
15717 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15718 not have accessibility information, that is why we were returning
15719 true in the filter function in typemanager.cs.
15721 To properly report 122 (property is inaccessible because of its
15722 protection level) correctly, we report this error in ResolveAccess
15723 by failing if both the setter and the getter are lacking (ie, the
15726 DoResolve and DoLResolve have been modified to check for both
15727 setter/getter being null and returning silently, the reason being
15728 that I did not want to put the knowledge about this error in upper
15731 int old = Report.Errors;
15732 x = new PropertyExpr (...);
15733 if (old != Report.Errors)
15738 So the property expr is returned, but it is invalid, so the error
15739 will be flagged during the resolve process.
15741 * class.cs: Remove InheritablePropertySignatureCompare from the
15742 class, as we no longer depend on the property signature to compute
15743 whether it is possible to implement a method or not.
15745 The reason is that calling PropertyInfo.GetGetMethod will return
15746 null (in .NET, in Mono it works, and we should change this), in
15747 cases where the Get Method does not exist in that particular
15752 class X { public virtual int A { get { return 1; } } }
15754 class Z : Y { public override int A { get { return 2; } } }
15756 Would fail in Z because the parent (Y) would not have the property
15757 defined. So we avoid this completely now (because the alternative
15758 fix was ugly and slow), and we now depend exclusively on the
15761 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15762 reference method, instead of using the property.
15764 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15765 routines are gone now.
15767 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15768 names, they were incorrectly named.
15770 * cs-tokenizer.cs: Return are more gentle token on failure.
15772 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15773 had an out-of-sync index variable, which caused it to remove from
15774 the list of pending methods the wrong method sometimes.
15776 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15778 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15779 CanWrite, because those refer to this particular instance of the
15780 property, and do not take into account the fact that we can
15781 override single members of a property.
15783 Constructor requires an EmitContext. The resolution process does
15784 not happen here, but we need to compute the accessors before,
15785 because the resolution does not always happen for properties.
15787 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15788 subclass, before we did not update this flag, but we did update
15791 (GetAccessors): Drop this routine, as it did not work in the
15792 presence of partially overwritten set/get methods.
15794 Notice that this broke the cs1540 detection, but that will require
15797 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15801 * driver.cs: issue a warning instead of an error if we don't support
15802 debugging for the platform. Also ignore a couple of errors that may
15803 arise when trying to write the symbols. Undo my previous patch.
15805 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15807 * driver.cs: ignore /debug switch except for Unix platforms.
15809 2002-10-23 Nick Drochak <ndrochak@gol.com>
15811 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15813 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15815 * driver.cs: Do not make mcs-debug conditional, so we do not break
15816 builds that use it.
15818 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15819 review this patch. But basically after all the children variables
15820 have been merged, the value of "Breaks" was not being set to
15821 new_breaks for Switch blocks. I think that it should be set after
15822 it has executed. Currently I set this to the value of new_breaks,
15823 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15824 conservative, but I do not understand this code very well.
15826 I did not break anything in the build, so that is good ;-)
15828 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15830 2002-10-20 Mark Crichton <crichton@gimp.org>
15832 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15834 2002-10-20 Nick Drochak <ndrochak@gol.com>
15836 * cfold.cs: Fixed compile blocker.
15838 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15840 * driver.cs: I was chekcing the key, not the file.
15842 2002-10-19 Ravi Pratap <ravi@ximian.com>
15844 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15845 message that we were generating - we just need to silently return
15848 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15850 * class.cs (Event.Define): Change my previous commit, as this
15851 breaks the debugger. This is a temporary hack, as it seems like
15852 the compiler is generating events incorrectly to begin with.
15854 * expression.cs (Binary.ResolveOperator): Added support for
15855 "U operator - (E x, E y)"
15857 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15860 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15861 init-only variables, but this path did not take into account that
15862 there might be also instance readonly variables. Correct this
15865 This fixes bug 32253
15867 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15870 * driver.cs: Change the extension for modules to `netmodule'
15872 * cs-parser.jay: Improved slightly the location tracking for
15873 the debugger symbols.
15875 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15876 modifiers that were specified instead of the hardcoded value
15877 (FamAndAssem). This was basically ignoring the static modifier,
15878 and others. Fixes 32429.
15880 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15881 fixed a bug in the process (32476)
15883 * expression.cs (ArrayAccess.EmitAssign): Patch from
15884 hwang_rob@yahoo.ca that fixes bug 31834.3
15886 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15888 * driver.cs: Make the module extension .netmodule.
15890 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15892 * driver.cs: Report an error if the resource file is not found
15893 instead of crashing.
15895 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15896 false, like Emit does.
15898 2002-10-16 Nick Drochak <ndrochak@gol.com>
15900 * typemanager.cs: Remove unused private member. Also reported mcs
15901 bug to report this as a warning like csc.
15903 2002-10-15 Martin Baulig <martin@gnome.org>
15905 * statement.cs (Statement.Emit): Made this a virtual method; emits
15906 the line number info and calls DoEmit().
15907 (Statement.DoEmit): New protected abstract method, formerly knows
15908 as Statement.Emit().
15910 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15912 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15914 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15915 have fixed a remaining problem: not every AddXXXX was adding a
15916 fully qualified name.
15918 Now everyone registers a fully qualified name in the DeclSpace as
15919 being defined instead of the partial name.
15921 Downsides: we are slower than we need to be due to the excess
15922 copies and the names being registered this way.
15924 The reason for this is that we currently depend (on the corlib
15925 bootstrap for instance) that types are fully qualified, because
15926 we dump all the types in the namespace, and we should really have
15927 types inserted into the proper namespace, so we can only store the
15928 basenames in the defined_names array.
15930 2002-10-10 Martin Baulig <martin@gnome.org>
15932 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15933 from bug #31834, see the bug report for a testcase which is
15936 2002-10-10 Martin Baulig <martin@gnome.org>
15938 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15939 flow analysis code for this.
15941 * statement.cs (Do, While, For): Tell the flow analysis code about
15943 (FlowBranching.UsageVector): Added support for infinite loops.
15944 (Block.Resolve): Moved the dead code elimination here and use flow
15947 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15949 * class.cs (Field.Define): Catch cycles on struct type
15952 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15953 fields if the fields are static. We only need to check instance
15956 * expression.cs (As.DoResolve): Test for reference type.
15958 * statement.cs (Using.ResolveExpression): Use
15959 ConvertImplicitRequired, not ConvertImplicit which reports an
15961 (Using.ResolveLocalVariableDecls): ditto.
15963 * expression.cs (Binary.ResolveOperator): Report errors in a few
15964 places where we had to.
15966 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15968 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15970 * expression.cs: Use StoreFromPtr instead of extracting the type
15971 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15973 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15974 an enumeration value to a System.Enum, but System.Enum is not a
15975 value type, but an class type, so we need to box.
15977 (Expression.ConvertExplicit): One codepath could return
15978 errors but not flag them. Fix this. Fixes #31853
15980 * parameter.cs (Resolve): Do not allow void as a parameter type.
15982 2002-10-06 Martin Baulig <martin@gnome.org>
15984 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15985 if it's a class type and not a struct. Fixes #31815.
15987 2002-10-06 Martin Baulig <martin@gnome.org>
15989 * statement.cs: Reworked the flow analysis code a bit to make it
15990 usable for dead code elimination.
15992 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15994 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15996 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15998 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15999 to fix the test 165, will investigate deeper.
16001 2002-10-04 Martin Baulig <martin@gnome.org>
16003 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16004 finally blocks actually work.
16005 (Try.Resolve): We don't need to create a sibling for `finally' if
16006 there is no finally block.
16008 2002-10-04 Martin Baulig <martin@gnome.org>
16010 * class.cs (Constructor.Define): The default accessibility for a
16011 non-default constructor is private, not public.
16013 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16015 * class.cs (Constructor): Make AllowedModifiers public, add
16018 * cs-parser.jay: Perform the modifiers test here, as the
16019 constructor for the Constructor class usually receives a zero
16020 because of the way we create it (first we create, later we
16021 customize, and we were never checking the modifiers).
16023 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16024 is a version of LookupTypeReflection that includes the type-name
16025 cache. This can be used as a fast path for functions that know
16026 the fully qualified name and are only calling into *.GetType() to
16027 obtain a composed type.
16029 This is also used by TypeManager.LookupType during its type
16032 (LookupType): We now also track the real type name, as sometimes
16033 we can get a quey for the real type name from things like
16034 ComposedCast. This fixes bug 31422.
16036 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16037 complete type fullname, it does not have to go through the type
16038 resolution system to obtain the composed version of the type (for
16039 obtaining arrays or pointers).
16041 (Conditional.Emit): Use the EmitBoolExpression to
16042 generate nicer code, as requested by Paolo.
16044 (ArrayCreation.CheckIndices): Use the patch from
16045 hwang_rob@yahoo.ca to validate the array initializers.
16047 2002-10-03 Miguel de Icaza <miguel@ximian.com>
16049 * class.cs (ConstructorInitializer.Emit): simplify code by using
16050 Invocation.EmitCall, and at the same time, fix the bugs in calling
16051 parent constructors that took variable arguments.
16053 * ecore.cs (Expression.ConvertNumericExplicit,
16054 Expression.ImplicitNumericConversion): Remove the code that
16055 manually wrapped decimal (InternalTypeConstructor call is now gone
16058 * expression.cs (Cast.TryReduce): Also handle decimal types when
16059 trying to perform a constant fold on the type.
16061 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16063 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16064 that only turned off an error report, and did nothing else.
16066 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16068 * driver.cs: Handle and ignore /fullpaths
16070 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16072 * expression.cs (Binary.ResolveOperator): Catch the case where
16073 DoNumericPromotions returns true,
16075 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16077 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16079 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16082 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16084 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16085 conversion exists, but it is also required that the conversion be
16086 performed. This manifested in "(Type64Enum) 2".
16088 * class.cs (TypeManager.AddMethod): The fix is not to change
16089 AddEnum, because that one was using a fully qualified name (every
16090 DeclSpace derivative does), but to change the AddMethod routine
16091 that was using an un-namespaced name. This now correctly reports
16092 the duplicated name.
16094 Revert patch until I can properly fix it. The issue
16095 is that we have a shared Type space across all namespaces
16096 currently, which is wrong.
16098 Options include making the Namespace a DeclSpace, and merge
16099 current_namespace/current_container in the parser.
16101 2002-09-25 Miguel de Icaza <miguel@ximian.com>
16103 * cs-parser.jay: Improve error reporting when we get a different
16104 kind of expression in local_variable_type and
16105 local_variable_pointer_type.
16107 Propagate this to avoid missleading errors being reported.
16109 * ecore.cs (ImplicitReferenceConversion): treat
16110 TypeManager.value_type as a target just like object_type. As
16115 Is valid, and needs to result in the int 1 being boxed before it
16116 is assigned to the value type v.
16118 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16119 to validate the enumeration name.
16121 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16122 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
16123 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16125 * ecore.cs (TryImplicitIntConversion): When doing an
16126 implicit-enumeration-conversion, check if the type is 64-bits and
16127 perform a conversion before passing to EnumConstant.
16129 2002-09-23 Miguel de Icaza <miguel@ximian.com>
16131 * decl.cs (Error_AmbiguousTypeReference); New routine used to
16132 report ambiguous type references. Unlike the MS version, we
16133 report what the ambiguity is. Innovation at work ;-)
16135 (DeclSpace.FindType): Require a location argument to
16136 display when we display an ambiguous error.
16138 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16140 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16142 * expression.cs (EmitDynamicInitializers): Apply patch from
16143 hwang_rob@yahoo.ca that fixes the order in which we emit our
16146 2002-09-21 Martin Baulig <martin@gnome.org>
16148 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16149 delegate takes no arguments.
16151 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16153 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16156 * expression.cs: Extract the underlying type.
16158 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16160 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16162 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16164 * class.cs (TypeContainer.DefineType): We can not use the nice
16165 PackingSize with the size set to 1 DefineType method, because it
16166 will not allow us to define the interfaces that the struct
16169 This completes the fixing of bug 27287
16171 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16172 means also structs. This fixes part of the problem.
16173 (Expresion.ImplicitReferenceConversionExists): ditto.
16175 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16176 error if there were no errors reported during the type lookup
16177 process, to avoid duplicates or redundant errors. Without this
16178 you would get an ambiguous errors plus a type not found. We have
16179 beaten the user enough with the first error.
16181 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16184 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16185 during the resolution process, stop the lookup, this avoids
16186 repeated error reports (same error twice).
16188 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16190 * typemanager.cs (LookupType): Redo the type lookup code to match
16191 the needs of System.Reflection.
16193 The issue is that System.Reflection requires references to nested
16194 types to begin with a "+" sign instead of a dot. So toplevel
16195 types look like: "NameSpace.TopLevelClass", and nested ones look
16196 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16199 2002-09-19 Martin Baulig <martin@gnome.org>
16201 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16202 says that a method always returns or always throws an exception,
16203 don't report the CS0161.
16205 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16206 set `Returns = new_returns'.
16208 2002-09-19 Martin Baulig <martin@gnome.org>
16210 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16211 to an enum constant, check for a CS0176.
16213 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16215 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16216 for operators that must be in pairs and report errors.
16218 * ecore.cs (SimpleName.DoResolveType): During the initial type
16219 resolution process, when we define types recursively, we must
16220 check first for types in our current scope before we perform
16221 lookups in the enclosing scopes.
16223 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16225 (Invocation.VerifyArgumentsCompat): Call
16226 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16227 I thought we were supposed to always call this, but there are a
16228 few places in the code where we dont do it.
16230 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16232 * driver.cs: Add support in -linkres and -resource to specify the
16233 name of the identifier.
16235 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16237 * ecore.cs (StandardConversionExists): Sync with the conversion
16238 code: allow anything-* to void* conversions.
16240 (FindMostSpecificSource): Use an Expression argument
16241 instead of a Type, because we might be handed over a Literal which
16242 gets a few more implicit conversions that plain types do not. So
16243 this information was being lost.
16245 Also, we drop the temporary type-holder expression when not
16248 2002-09-17 Martin Baulig <martin@gnome.org>
16250 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16251 this is an explicit interface implementation.
16253 2002-09-17 Martin Baulig <martin@gnome.org>
16255 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16256 different `IndexerName' attributes.
16258 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16259 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16260 virtual CommonResolve().
16262 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16264 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16265 and convert that to the UnderlyingType.
16267 * statement.cs (Foreach.Resolve): Indexers are just like variables
16268 or PropertyAccesses.
16270 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16271 inside quoted strings, we were not doing this before.
16273 2002-09-16 Martin Baulig <martin@gnome.org>
16275 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16276 resolve it. This is needed for the definite assignment check of the
16277 instance expression, fixes bug #29846.
16278 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16280 2002-09-16 Nick Drochak <ndrochak@gol.com>
16282 * parameter.cs: Fix compile error. Cannot reference static member
16283 from an instance object. Is this an mcs bug?
16285 2002-09-14 Martin Baulig <martin@gnome.org>
16287 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16288 multiple times. Fixes bug #30295, added test-166.cs.
16290 2002-09-14 Martin Baulig <martin@gnome.org>
16292 * statement.cs (Block.Emit): Don't emit unreachable code.
16293 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16294 `break' statements.
16295 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16297 2002-09-14 Martin Baulig <martin@gnome.org>
16299 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16302 2002-09-14 Martin Baulig <martin@gnome.org>
16304 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16305 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16306 be false on the ms runtime.
16308 2002-09-13 Martin Baulig <martin@gnome.org>
16310 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16311 the CS0038 error message.
16313 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16315 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16316 constant inside, return it.
16318 2002-09-12 Martin Baulig <martin@gnome.org>
16320 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16321 implicit conversion can be done between enum types.
16323 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16324 check whether an implicit conversion to the current enum's UnderlyingType
16325 exists and report an error if not.
16327 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16328 without debugging support.
16330 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16331 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16333 2002-09-12 Martin Baulig <martin@gnome.org>
16335 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16337 * ecore.cs (IMemberExpr.DeclaringType): New property.
16338 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16339 nonstatic member of an outer type (CS0038).
16341 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16343 * driver.cs: Activate the using-error detector at warning level
16344 4 (at least for MS-compatible APIs).
16346 * namespace.cs (VerifyUsing): Small buglett fix.
16348 * pending.cs (PendingImplementation): pass the container pointer.
16350 * interface.cs (GetMethods): Allow for recursive definition. Long
16351 term, I would like to move every type to support recursive
16352 definitions, not the current ordering mechanism that we have right
16355 The situation is this: Attributes are handled before interfaces,
16356 so we can apply attributes to interfaces. But some attributes
16357 implement interfaces, we will now handle the simple cases
16358 (recursive definitions will just get an error).
16360 * parameter.cs: Only invalidate types at the end if we fail to
16363 2002-09-09 Martin Baulig <martin@gnome.org>
16365 * ecore.cs (PropertyExpr.Emit): Also check for
16366 TypeManager.system_int_array_get_length so this'll also work when
16367 compiling corlib. Fixes #30003.
16369 2002-09-09 Martin Baulig <martin@gnome.org>
16371 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16372 and throw an exception if we can't get the type's size. Fixed #30040,
16375 2002-09-09 Martin Baulig <martin@gnome.org>
16377 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16379 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16380 context. Fixes bug #30027.
16382 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16383 virtual functions. Fixes bug #30043, added test-164.cs.
16385 2002-09-08 Ravi Pratap <ravi@ximian.com>
16387 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16389 2002-09-08 Nick Drochak <ndrochak@gol.com>
16391 * driver.cs: Use an object to get the windows codepage since it's not a
16394 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16396 * statement.cs (For.Emit): for infinite loops (test == null)
16397 return whether there is a break inside, not always "true".
16399 * namespace.cs (UsingEntry): New struct to hold the name of the
16400 using definition, the location where it is defined, and whether it
16401 has been used in a successful type lookup.
16403 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16408 2002-09-06 Ravi Pratap <ravi@ximian.com>
16410 * attribute.cs : Fix incorrect code which relied on catching
16411 a NullReferenceException to detect a null being passed in
16412 where an object was expected.
16414 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16416 * statement.cs (Try): flag the catch variable as assigned
16418 * expression.cs (Cast): Simplified by using ResolveType instead of
16419 manually resolving.
16421 * statement.cs (Catch): Fix bug by using ResolveType.
16423 2002-09-06 Ravi Pratap <ravi@ximian.com>
16425 * expression.cs (BetterConversion): Special case for when we have
16426 a NullLiteral as the argument and we have to choose between string
16427 and object types - we choose string the way csc does.
16429 * attribute.cs (Attribute.Resolve): Catch the
16430 NullReferenceException and report error #182 since the Mono
16431 runtime no more has the bug and having this exception raised means
16432 we tried to select a constructor which takes an object and is
16435 2002-09-05 Ravi Pratap <ravi@ximian.com>
16437 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16438 message (1502, 1503) when we can't locate a method after overload
16439 resolution. This is much more informative and closes the bug
16442 * interface.cs (PopulateMethod): Return if there are no argument
16443 types. Fixes a NullReferenceException bug.
16445 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16446 expressions too. Previously we were checking only in one place for
16447 positional arguments leaving out named arguments.
16449 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16450 type to the enum type is not allowed. Remove code corresponding to
16453 (ConvertNumericExplicit): Allow explicit conversions from
16454 the underlying type to enum type. This precisely follows the spec
16455 and closes a bug filed by Gonzalo.
16457 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16460 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16462 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16464 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16465 it was important that we stored the right value after the
16466 reduction in `converted'.
16468 2002-09-04 Martin Baulig <martin@gnome.org>
16470 * location.cs (Location.SymbolDocument): Use full pathnames for the
16473 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16475 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16476 of the expression resolve mechanism, because that will catch the
16477 SimpleName error failures.
16479 (Conditional): If we can not resolve the
16480 expression, return, do not crash.
16482 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16485 (location): display token name instead of its number.
16487 2002-08-28 Martin Baulig <martin@gnome.org>
16489 * expression.cs (Binary.ResolveOperator): Don't silently return
16490 but return an error if an operator cannot be applied between two
16493 2002-08-28 Martin Baulig <martin@gnome.org>
16495 * class.cs (Constructor.Define): Set the permission attributes
16496 correctly instead of making all constructors public.
16498 2002-08-28 Martin Baulig <martin@gnome.org>
16500 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16501 for private members before reporting a CS0103; if we find anything,
16504 2002-08-28 Martin Baulig <martin@gnome.org>
16506 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16507 to check whether `closure_start_type == closure_invocation_type',
16508 we also need to check whether `m.DeclaringType == closure_invocation_type'
16509 before bypassing the permission checks. We might be accessing
16510 protected/private members from the base class.
16511 (TypeManager.RealMemberLookup): Only set private_ok if private
16512 members were requested via BindingFlags.NonPublic.
16514 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16516 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16517 MethodGroupExpr.IsExplicitImpl if appropriate.
16518 (Invocation.DoResolve): Don't report the CS0120 for explicit
16519 interface implementations.
16521 2002-08-27 Martin Baulig <martin@gnome.org>
16523 * expression.cs (Invocation.DoResolve): If this is a static
16524 method and we don't have an InstanceExpression, we must report
16527 2002-08-25 Martin Baulig <martin@gnome.org>
16529 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16530 `==' between a valuetype and an object.
16532 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16534 * ecore.cs (TypeExpr): Provide a ToString method.
16536 2002-08-24 Martin Baulig <martin@gnome.org>
16538 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16539 now called proggie.dbg and it's a binary file.
16541 2002-08-23 Martin Baulig <martin@gnome.org>
16543 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16545 2002-08-23 Martin Baulig <martin@gnome.org>
16547 * struct.cs (MyStructInfo.ctor): Make this work with empty
16548 structs; it's not allowed to use foreach() on null.
16550 2002-08-23 Martin Baulig <martin@gnome.org>
16552 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16553 writer the full pathname of the generated assembly.
16555 2002-08-23 Martin Baulig <martin@gnome.org>
16557 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16558 A `finally' block never returns or breaks; improved handling of
16561 2002-08-23 Martin Baulig <martin@gnome.org>
16563 * statement.cs (Throw.Resolve): Allow `throw null'.
16565 2002-08-23 Martin Baulig <martin@gnome.org>
16567 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16568 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16569 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16570 MemberLookup would return a wrong event if this is an explicit
16571 interface implementation and the class has an event with the same
16574 2002-08-23 Martin Baulig <martin@gnome.org>
16576 * statement.cs (Block.AddChildVariableNames): New public method.
16577 (Block.AddChildVariableName): Likewise.
16578 (Block.IsVariableNameUsedInChildBlock): Likewise.
16579 (Block.AddVariable): Check whether a variable name has already
16580 been used in a child block.
16582 * cs-parser.jay (declare_local_variables): Mark all variable names
16583 from the current block as being used in a child block in the
16586 2002-08-23 Martin Baulig <martin@gnome.org>
16588 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16589 find the symbol writer.
16591 * driver.cs: csc also allows the arguments to /define being
16592 separated by commas, not only by semicolons.
16594 2002-08-23 Martin Baulig <martin@gnome.org>
16596 * interface.cs (Interface.GetMembers): Added static check for events.
16598 2002-08-15 Martin Baulig <martin@gnome.org>
16600 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16601 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16603 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16604 why the MethodData.EmitDestructor() change was necessary.
16606 2002-08-20 Martin Baulig <martin@gnome.org>
16608 * class.cs (TypeContainer.FindMembers): Added static check for events.
16610 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16612 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16613 use Type.GetEvents(), not Type.FindMembers().
16615 2002-08-20 Martin Baulig <martin@gnome.org>
16617 * decl.cs (MemberCache): Added a special method cache which will
16618 be used for method-only searched. This ensures that a method
16619 search will return a MethodInfo with the correct ReflectedType for
16622 2002-08-20 Martin Baulig <martin@gnome.org>
16624 * decl.cs (DeclSpace.FindMembers): Made this public.
16626 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16628 * delegate.cs: fixed build on windows.
16629 [FIXME: Filed as bug #29150: MCS must report these errors.]
16631 2002-08-19 Ravi Pratap <ravi@ximian.com>
16633 * ecore.cs (StandardConversionExists): Return a false
16634 if we are trying to convert the void type to anything else
16635 since that is not allowed.
16637 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16638 we flag error 70 in the event an event is trying to be accessed
16639 directly from outside the declaring type.
16641 2002-08-20 Martin Baulig <martin@gnome.org>
16643 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16644 MemberCache from typemanager.cs to decl.cs.
16646 2002-08-19 Martin Baulig <martin@gnome.org>
16648 * class.cs (TypeContainer): Implement IMemberContainer.
16649 (TypeContainer.DefineMembers): Create the MemberCache.
16650 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16651 return public members if BindingFlags.Public was given, check
16652 whether members are static.
16654 2002-08-16 Martin Baulig <martin@gnome.org>
16656 * decl.cs (DeclSpace.Define): Splitted this in Define and
16657 DefineMembers. DefineMembers is called first and initializes the
16660 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16661 DefineMembers() on all our DeclSpaces.
16663 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16664 but call DefineMembers() on all nested interfaces. We call their
16665 Define() in our new Define() function.
16667 * interface.cs (Interface): Implement IMemberContainer.
16668 (Interface.Define): Moved all code except the attribute stuf to
16670 (Interface.DefineMembers): Initialize the member cache.
16672 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16673 need this anymore since we can use MemberCache.FindMembers directly.
16675 2002-08-19 Martin Baulig <martin@gnome.org>
16677 * typemanager.cs (MemberCache): When creating the cache for an
16678 interface type, add all inherited members.
16679 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16680 to `out bool used_cache' and documented it.
16681 (TypeManager.MemberLookup): If we already used the cache in the first
16682 iteration, we don't need to do the interfaces check.
16684 2002-08-19 Martin Baulig <martin@gnome.org>
16686 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16687 here from IMemberFinder and don't implement this interface anymore.
16688 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16690 * typemanager.cs (IMemberFinder): This interface is now only used by
16691 classes which actually support the member cache.
16692 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16693 since we only put DeclSpaces into this Hashtable.
16694 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16695 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16697 2002-08-16 Martin Baulig <martin@gnome.org>
16699 * typemanager.cs (ICachingMemberFinder): Removed.
16700 (IMemberFinder.MemberCache): New property.
16701 (TypeManager.FindMembers): Merged this with RealFindMembers().
16702 This function will never be called from TypeManager.MemberLookup()
16703 so we can't use the cache here, just the IMemberFinder.
16704 (TypeManager.MemberLookup_FindMembers): Check whether the
16705 IMemberFinder has a MemberCache and call the cache's FindMembers
16707 (MemberCache): Rewrote larger parts of this yet another time and
16708 cleaned it up a bit.
16710 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16712 * driver.cs (LoadArgs): Support quoting.
16714 (Usage): Show the CSC-like command line arguments.
16716 Improved a few error messages.
16718 2002-08-15 Martin Baulig <martin@gnome.org>
16720 * typemanager.cs (IMemberContainer.Type): New property.
16721 (IMemberContainer.IsInterface): New property.
16723 The following changes are conditional to BROKEN_RUNTIME, which is
16724 defined at the top of the file.
16726 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16727 class'es members, but add all members from TypeHandle.ObjectType
16728 if we're an interface.
16729 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16730 is the current type.
16731 (MemberCache.CacheEntry.Container): Removed this field.
16732 (TypeHandle.GetMembers): Include inherited members.
16734 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16736 * typemanager.cs: fixed compilation and added a comment on a field that
16739 2002-08-15 Martin Baulig <martin@gnome.org>
16741 * class.cs (ConstructorInitializer.Resolve): In the
16742 Expression.MemberLookup call, use the queried_type as
16745 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16746 declared' attribute, it's always true.
16747 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16748 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16749 temporary wrapper for FindMembers which tells MemberLookup whether
16750 members from the base classes are included in the return value.
16751 This will go away soon.
16752 (TypeManager.MemberLookup): Use this temporary hack here; once the
16753 new MemberCache is completed, we don't need to do the DeclaredOnly
16754 looping here anymore since the MemberCache will take care of this.
16755 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16756 (MemberCache): When creating the MemberCache for a class, get
16757 members from the current class and all its base classes.
16758 (MemberCache.CacheEntry.Container): New field. This is a
16759 temporary hack until the Mono runtime is fixed to distinguish
16760 between ReflectedType and DeclaringType. It allows us to use MCS
16761 with both the MS runtime and the unfixed Mono runtime without
16762 problems and without accecting performance.
16763 (MemberCache.SearchMembers): The DeclaredOnly looping from
16764 TypeManager.MemberLookup is now done here.
16766 2002-08-14 Martin Baulig <martin@gnome.org>
16768 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16769 Type.GetFields on dynamic types but get the fields from the
16770 corresponding TypeContainer.
16771 (MyStructInfo.GetStructInfo): Added check for enum types.
16773 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16774 (MemberList.SyncRoot): Implemented.
16775 (TypeManager.FilterWithClosure): No need to check permissions if
16776 closure_start_type == closure_invocation_type, don't crash if
16777 closure_invocation_type is null.
16779 2002-08-13 Martin Baulig <martin@gnome.org>
16781 Rewrote TypeContainer.FindMembers to use a member cache. This
16782 gives us a speed increase of about 35% for the self-hosting MCS
16783 build and of about 15-20% for the class libs (both on GNU/Linux).
16785 * report.cs (Timer): New class to get enhanced profiling. This
16786 whole class is "TIMER" conditional since it remarkably slows down
16789 * class.cs (MemberList): New class. This is an IList wrapper
16790 which we're now using instead of passing MemberInfo[]'s around to
16791 avoid copying this array unnecessarily.
16792 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16793 (ICachingMemberFinder, IMemberContainer): New interface.
16794 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16795 has already been checked, otherwise use it for the name comparision.
16796 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16797 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16798 if possible. Returns a MemberList, not a MemberInfo [].
16799 (TypeHandle): New class, implements IMemberContainer. We create
16800 one instance of this class per type, it contains a MemberCache
16801 which is used to do the member lookups.
16802 (MemberCache): New class. Each instance of this class contains
16803 all members of a type and a name-based hash table.
16804 (MemberCache.FindMembers): This is our new member lookup
16805 function. First, it looks up all members of the requested name in
16806 the hash table. Then, it walks this list and sorts out all
16807 applicable members and returns them.
16809 2002-08-13 Martin Baulig <martin@gnome.org>
16811 In addition to a nice code cleanup, this gives us a performance
16812 increase of about 1.4% on GNU/Linux - not much, but it's already
16813 half a second for the self-hosting MCS compilation.
16815 * typemanager.cs (IMemberFinder): New interface. It is used by
16816 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16817 Enum, Delegate or Interface.
16818 (TypeManager.finder_to_member_finder): New PtrHashtable.
16819 (TypeManager.finder_to_container): Removed.
16820 (TypeManager.finder_to_delegate): Removed.
16821 (TypeManager.finder_to_interface): Removed.
16822 (TypeManager.finder_to_enum): Removed.
16824 * interface.cs (Interface): Implement IMemberFinder.
16826 * delegate.cs (Delegate): Implement IMemberFinder.
16828 * enum.cs (Enum): Implement IMemberFinder.
16830 * class.cs (TypeContainer): Implement IMemberFinder.
16832 2002-08-12 Martin Baulig <martin@gnome.org>
16834 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16836 2002-08-12 Martin Baulig <martin@gnome.org>
16838 * ecore.cs (ITypeExpression): New interface for expressions which
16840 (TypeExpression): Renamed to TypeLookupExpression.
16841 (Expression.DoResolve): If we're doing a types-only lookup, the
16842 expression must implement the ITypeExpression interface and we
16843 call DoResolveType() on it.
16844 (SimpleName): Implement the new ITypeExpression interface.
16845 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16846 hack, the situation that we're only looking up types can't happen
16847 anymore when this method is called. Moved the type lookup code to
16848 DoResolveType() and call it.
16849 (SimpleName.DoResolveType): This ITypeExpression interface method
16850 is now doing the types-only lookup.
16851 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16852 (ResolveFlags): Added MaskExprClass.
16854 * expression.cs (MemberAccess): Implement the ITypeExpression
16856 (MemberAccess.DoResolve): Added support for a types-only lookup
16857 when we're called via ITypeExpression.DoResolveType().
16858 (ComposedCast): Implement the ITypeExpression interface.
16860 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16861 Expression.Resolve() with ResolveFlags.Type instead.
16863 2002-08-12 Martin Baulig <martin@gnome.org>
16865 * interface.cs (Interface.Define): Apply attributes.
16867 * attribute.cs (Attribute.ApplyAttributes): Added support for
16868 interface attributes.
16870 2002-08-11 Martin Baulig <martin@gnome.org>
16872 * statement.cs (Block.Emit): Only check the "this" variable if we
16873 do not always throw an exception.
16875 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16876 whether the property has a set accessor.
16878 2002-08-11 Martin Baulig <martin@gnome.org>
16880 Added control flow analysis support for structs.
16882 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16883 with control flow analysis turned off.
16884 (IVariable): New interface.
16885 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16886 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16887 (FieldExpr.DoResolve): Resolve the instance expression with flow
16888 analysis turned off and do the definite assignment check after the
16889 resolving when we know what the expression will resolve to.
16891 * expression.cs (LocalVariableReference, ParameterReference):
16892 Implement the new IVariable interface, only call the flow analysis
16893 code if ec.DoFlowAnalysis is true.
16894 (This): Added constructor which takes a Block argument. Implement
16895 the new IVariable interface.
16896 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16897 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16898 This does the definite assignment checks for struct members.
16900 * class.cs (Constructor.Emit): If this is a non-static `struct'
16901 constructor which doesn't have any initializer, call
16902 Block.AddThisVariable() to tell the flow analysis code that all
16903 struct elements must be initialized before control returns from
16906 * statement.cs (MyStructInfo): New public class.
16907 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16908 argument to this indexer. If non-zero, check an individual struct
16909 member, not the whole struct.
16910 (FlowBranching.CheckOutParameters): Check struct members.
16911 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16912 overloaded versions of these methods which take an additional
16913 `int field_idx' argument to check struct members.
16914 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16915 overloaded versions of these methods which take an additional
16916 `string field_name' argument to check struct member.s
16917 (VariableInfo): Implement the IVariable interface.
16918 (VariableInfo.StructInfo): New public property. Returns the
16919 MyStructInfo instance of the variable if it's a struct or null.
16920 (Block.AddThisVariable): New public method. This is called from
16921 Constructor.Emit() for non-static `struct' constructor which do
16922 not have any initializer. It creates a special variable for the
16923 "this" instance variable which will be checked by the flow
16924 analysis code to ensure that all of the struct's fields are
16925 initialized before control returns from the constructor.
16926 (UsageVector): Added support for struct members. If a
16927 variable/parameter is a struct with N members, we reserve a slot
16928 in the usage vector for each member. A struct is considered fully
16929 initialized if either the struct itself (slot 0) or all its
16930 members are initialized.
16932 2002-08-08 Martin Baulig <martin@gnome.org>
16934 * driver.cs (Driver.MainDriver): Only report an error CS5001
16935 if there were no compilation errors.
16937 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16938 `UnsafeContext' property to determine whether the parent is in
16939 unsafe context rather than checking the parent's ModFlags:
16940 classes nested in an unsafe class are unsafe as well.
16942 2002-08-08 Martin Baulig <martin@gnome.org>
16944 * statement.cs (UsageVector.MergeChildren): Distinguish between
16945 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16946 we return. Added test17() and test18() to test-154.cs.
16948 2002-08-08 Martin Baulig <martin@gnome.org>
16950 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16951 Family access, make sure the invoking type isn't a subclass of the
16952 queried type (that'd be a CS1540).
16954 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16955 this method which takes an additional `Type invocation_type'.
16957 * expression.cs (BaseAccess.DoResolve): Use the base type as
16958 invocation and query type.
16959 (MemberAccess.DoResolve): If the lookup failed and we're about to
16960 report a CS0122, try a lookup with the ec.ContainerType - if this
16961 succeeds, we must report a CS1540.
16963 2002-08-08 Martin Baulig <martin@gnome.org>
16965 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16966 (MethodGroupExpr): Implement the IMemberExpr interface.
16968 * expression (MemberAccess.ResolveMemberAccess): No need to have
16969 any special code for MethodGroupExprs anymore, they're now
16972 2002-08-08 Martin Baulig <martin@gnome.org>
16974 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16975 Family, FamANDAssem and FamORAssem permissions.
16976 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16978 2002-08-08 Martin Baulig <martin@gnome.org>
16980 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16981 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16984 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16986 * driver.cs: implemented /resource option to embed managed resources.
16988 2002-08-07 Martin Baulig <martin@gnome.org>
16990 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16991 (FieldBase.HasFieldInitializer): New public property.
16992 (FieldBase.GetInitializerExpression): New public method. Resolves and
16993 returns the field initializer and makes sure it is only resolved once.
16994 (TypeContainer.EmitFieldInitializers): Call
16995 FieldBase.GetInitializerExpression to get the initializer, this ensures
16996 that it isn't resolved multiple times.
16998 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16999 the resolving process (SimpleName/MemberLookup) that we're currently
17000 emitting a field initializer (which must not access any instance members,
17001 this is an error CS0236).
17003 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17004 argument, if the `IsFieldInitializer' flag is set, we must report and
17005 error CS0236 and not an error CS0120.
17007 2002-08-07 Martin Baulig <martin@gnome.org>
17009 * ecore.cs (IMemberExpr): New public interface.
17010 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17011 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17012 if the expression is an IMemberExpr.
17014 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17015 to be null, implicitly default to `this' if we're non-static in
17016 this case. Simplified the code a lot by using the new IMemberExpr
17017 interface. Also fixed bug #28176 here.
17019 2002-08-06 Martin Baulig <martin@gnome.org>
17021 * cs-parser.jay (SimpleLookup): Removed. We need to create
17022 ParameterReferences during semantic analysis so that we can do a
17023 type-only search when resolving Cast, TypeOf and SizeOf.
17024 (block): Pass the `current_local_parameters' to the Block's
17027 * class.cs (ConstructorInitializer): Added `Parameters parameters'
17028 argument to the constructor.
17029 (ConstructorInitializer.Resolve): Create a temporary implicit
17030 block with the parameters.
17032 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17033 references here if we aren't doing a type-only search.
17035 * statement.cs (Block): Added constructor which takes a
17036 `Parameters parameters' argument.
17037 (Block.Parameters): New public property.
17039 * support.cs (InternalParameters.Parameters): Renamed `parameters'
17040 to `Parameters' and made it public readonly.
17042 2002-08-06 Martin Baulig <martin@gnome.org>
17044 * ecore.cs (Expression.Warning): Made this public as well.
17046 * report.cs (Report.Debug): Print the contents of collections.
17048 2002-08-06 Martin Baulig <martin@gnome.org>
17050 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
17051 used to tell Resolve() which kinds of expressions it may return.
17052 (Expression.Resolve): Added overloaded version of this method which
17053 takes a `ResolveFlags flags' argument. This can be used to tell
17054 Resolve() which kinds of expressions it may return. Reports a
17056 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17057 ResolveFlags.SimpleName.
17058 (Expression.Error118): Added overloaded version of this method which
17059 takes a `ResolveFlags flags' argument. It uses the flags to determine
17060 which kinds of expressions are allowed.
17062 * expression.cs (Argument.ResolveMethodGroup): New public method.
17063 Resolves an argument, but allows a MethodGroup to be returned.
17064 This is used when invoking a delegate.
17066 * TODO: Updated a bit.
17068 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17070 Fixed compilation with csc.
17072 * ecore.cs: Expression.Error made public. Is this correct? Should
17073 Warning be made public too?
17075 * expression.cs: use ea.Location instead of ea.loc.
17076 [FIXME: Filed as bug #28607: MCS must report these errors.]
17078 2002-08-06 Martin Baulig <martin@gnome.org>
17080 * ecore.cs (Expression.loc): Moved the location here instead of
17081 duplicating it in all derived classes.
17082 (Expression.Location): New public property.
17083 (Expression.Error, Expression.Warning): Made them non-static and
17084 removed the location argument.
17085 (Expression.Warning): Added overloaded version which takes an
17086 `int level' argument.
17087 (Expression.Error118): Make this non-static and removed the
17088 expression and location arguments.
17089 (TypeExpr): Added location argument to the constructor.
17091 * expression.cs (StaticCallExpr): Added location argument to
17093 (Indirection, PointerArithmetic): Likewise.
17094 (CheckedExpr, UnCheckedExpr): Likewise.
17095 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17096 (StringPtr): Likewise.
17099 2002-08-05 Martin Baulig <martin@gnome.org>
17101 * expression.cs (BaseAccess.DoResolve): Actually report errors.
17103 * assign.cs (Assign.DoResolve): Check whether the source
17104 expression is a value or variable.
17106 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17107 while resolving the corresponding blocks.
17109 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17110 an error, don't silently return null.
17112 * statement.cs (Block.AddVariable): Do the error reporting here
17113 and distinguish between CS0128 and CS0136.
17114 (Block.DoResolve): Report all unused labels (warning CS0164).
17115 (LabeledStatement): Pass the location to the constructor.
17116 (LabeledStatement.HasBeenReferenced): New property.
17117 (LabeledStatement.Resolve): Set it to true here.
17119 * statement.cs (Return.Emit): Return success even after reporting
17120 a type mismatch error (CS0126 or CS0127), this is what csc does and
17121 it avoids confusing the users with any consecutive errors.
17123 2002-08-05 Martin Baulig <martin@gnome.org>
17125 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17127 * const.cs (Const.LookupConstantValue): Catch circular definitions.
17129 * expression.cs (MemberAccess.DoResolve): Silently return if an
17130 error has already been reported.
17132 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17133 error has already been reported.
17135 2002-08-05 Martin Baulig <martin@gnome.org>
17137 * statement.cs (UsageVector): Only initialize the `parameters'
17138 vector if we actually have any "out" parameters.
17140 2002-08-05 Martin Baulig <martin@gnome.org>
17142 * expression.cs (Binary.ResolveOperator): When combining delegates,
17143 they must have the same type.
17145 2002-08-05 Martin Baulig <martin@gnome.org>
17147 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17148 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17149 work with the ms runtime and we also don't need it: if we're a
17150 PropertyBuilder and not in the `indexer_arguments' hash, then we
17151 are a property and not an indexer.
17153 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17154 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17155 since the latter one doesn't work with the ms runtime.
17157 2002-08-03 Martin Baulig <martin@gnome.org>
17159 Fixed bugs #27998 and #22735.
17161 * class.cs (Method.IsOperator): New public field.
17162 (Method.CheckBase): Report CS0111 if there's already a method
17163 with the same parameters in the current class. Report CS0508 when
17164 attempting to change the return type of an inherited method.
17165 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17166 and it's not marked abstract or extern.
17167 (PropertyBase): New abstract base class for Property and Indexer.
17168 (PropertyBase.CheckBase): Moved here from Property and made it work
17170 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17171 the same so we can reuse it there.
17172 (Property, Indexer): Derive from PropertyBase.
17173 (MethodSignature.inheritable_property_signature_filter): New delegate
17174 to find properties and indexers.
17176 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17177 argument and improved error reporting.
17179 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17180 EmptyReadOnlyParameters and made it a property.
17182 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17183 version of this method which takes a `PropertyInfo indexer'.
17184 (TypeManager.RegisterIndexer): New method.
17186 * class.cs: Added myself as author of this file :-)
17188 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17190 * class.cs: fixed compilation on windoze.
17192 2002-08-03 Martin Baulig <martin@gnome.org>
17194 * interface.cs (Interface.GetInterfaceBases): Check whether all
17195 base interfaces are at least as accessible than the current one.
17197 * class.cs (TypeContainer.GetClassBases): Check whether base types
17198 are at least as accessible than the current type.
17199 (TypeContainer.AsAccessible): Implemented and made non-static.
17200 (MemberBase.CheckParameters): Report errors if the accessibility
17203 * delegate.cs (Delegate.Delegate): The default visibility is
17204 internal for top-level types and private for nested types.
17205 (Delegate.Define): Report errors if the accessibility checks fail.
17207 * enum.cs (Enum.Enum): The default visibility is internal for
17208 top-level types and private for nested types.
17209 (Enum.DefineType): Compute the correct visibility.
17211 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17212 function which takes a `bool is_toplevel' instead of a TypeContainer.
17214 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17217 2002-08-02 Martin Baulig <martin@gnome.org>
17219 * expression.cs (LocalVariableReferenc): Added constructor which
17220 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17221 (LocalVariableReference.IsReadOnly): New property.
17222 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17223 variable is readonly, use our own readonly flag to do this; you can
17224 use the new constructor to get a writable reference to a read-only
17227 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17228 reference to the local variable.
17230 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17232 * rootcontext.cs (ResolveCore): Also include System.Exception
17234 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17235 we reach an EmptyStatement.
17237 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17240 * expression.cs (Binary.ResolveOperator): Check error result in
17243 use brtrue/brfalse directly and avoid compares to null.
17245 2002-08-02 Martin Baulig <martin@gnome.org>
17247 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17248 Fixes bug #28407, added test-155.cs.
17250 2002-08-01 Martin Baulig <martin@gnome.org>
17252 * class.cs (Event.EmitDefaultMethod): Make this work with static
17253 events. Fixes #28311, added verify-3.cs.
17255 2002-08-01 Martin Baulig <martin@gnome.org>
17257 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17258 `is_disposable' fields.
17259 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17260 `hm.is_disposable' if we're using the collection pattern.
17261 (Foreach.EmitCollectionForeach): Use the correct type for the
17262 enumerator's local variable, only emit the try/finally block if
17263 necessary (fixes #27713).
17265 2002-08-01 Martin Baulig <martin@gnome.org>
17267 * ecore.cs (Expression.report118): Renamed to Error118 and made
17270 * statement.cs (Throw.Resolve): Check whether the expression is of
17271 the correct type (CS0118) and whether the type derives from
17272 System.Exception (CS0155).
17273 (Catch.Resolve): New method. Do the type lookup here and check
17274 whether it derives from System.Exception (CS0155).
17275 (Catch.CatchType, Catch.IsGeneral): New public properties.
17277 * typemanager.cs (TypeManager.exception_type): Added.
17279 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17281 * driver.cs: Updated About function.
17283 2002-07-31 Martin Baulig <martin@gnome.org>
17285 Implemented Control Flow Analysis.
17287 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17288 (EmitContext.CurrentBranching): Added.
17289 (EmitContext.StartFlowBranching): Added.
17290 (EmitContext.EndFlowBranching): Added.
17291 (EmitContext.KillFlowBranching): Added.
17292 (EmitContext.IsVariableAssigned): Added.
17293 (EmitContext.SetVariableAssigned): Added.
17294 (EmitContext.IsParameterAssigned): Added.
17295 (EmitContext.SetParameterAssigned): Added.
17296 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17297 Added control flow analysis stuff here.
17299 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17300 resolve the expression as lvalue.
17301 (LocalVariableReference.DoResolve): Check whether the variable has
17302 already been assigned.
17303 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17304 the parameter as assigned here.
17305 (ParameterReference.DoResolve): Check whether the parameter has already
17307 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17308 expression as lvalue.
17310 * statement.cs (FlowBranching): New class for the flow analysis code.
17311 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17312 (LabeledStatement.IsDefined): New public property.
17313 (LabeledStatement.AddUsageVector): New public method to tell flow
17314 analyis that the label may be reached via a forward jump.
17315 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17317 (VariableInfo.Number): New public field. This is used by flow analysis
17318 to number all locals of a block.
17319 (Block.CountVariables): New public property. This is the number of
17320 local variables in this block (including the locals from all parent
17322 (Block.EmitMeta): Number all the variables.
17324 * statement.cs: Added flow analysis support to all classes.
17326 2002-07-31 Martin Baulig <martin@gnome.org>
17328 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17329 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17330 then use this argument.
17332 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17334 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17335 use this to specify /define options.
17337 2002-07-29 Martin Baulig <martin@gnome.org>
17339 * statement.cs (Fixed): Moved all code that does variable lookups
17340 and resolvings from Emit to Resolve.
17342 * statement.cs (For): Moved all code that does variable lookups
17343 and resolvings from Emit to Resolve.
17345 * statement.cs (Using): Moved all code that does variable lookups
17346 and resolvings from Emit to Resolve.
17348 2002-07-29 Martin Baulig <martin@gnome.org>
17350 * attribute.cs (Attribute.Resolve): Explicitly catch a
17351 System.NullReferenceException when creating the
17352 CustromAttributeBuilder and report a different warning message.
17354 2002-07-29 Martin Baulig <martin@gnome.org>
17356 * support.cs (ParameterData.ParameterName): Added method to
17357 get the name of a parameter.
17359 * typemanager.cs (TypeManager.IsValueType): New public method.
17361 2002-07-29 Martin Baulig <martin@gnome.org>
17363 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17364 is a flag which specifies that it's either ref or out.
17365 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17366 the out parameter to `out Parameter.Modifier mod', also set the
17367 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17369 * support.cs (InternalParameters.ParameterModifier): Distinguish
17370 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17371 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17373 * expression.cs (Argument.GetParameterModifier): Distinguish
17374 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17375 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17377 2002-07-29 Martin Baulig <martin@gnome.org>
17379 * expression.cs (ParameterReference.ParameterReference): Added
17380 `Location loc' argument to the constructor.
17382 * cs-parser.jay: Pass location to ParameterReference.
17384 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17386 * statement.cs (Try): Initialize the location.
17388 * cs-parser.jay: pass location to Try.
17390 * expression.cs (Unary.Reduce): Change the prototype to return
17391 whether a constant fold could be performed or not. The result is
17392 returned in an out parameters. In the case of Indirection and
17393 AddressOf, we want to perform the full tests.
17395 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17397 * statement.cs (Statement.Emit): Flag dead code.
17399 2002-07-27 Andrew Birkett <andy@nobugs.org>
17401 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17403 2002-07-27 Martin Baulig <martin@gnome.org>
17405 * class.cs (MethodData.Define): Put back call to
17406 TypeManager.AddMethod(), accidentally commented this out.
17408 * report.cs (Debug): New public method to print debugging information,
17409 this is `[Conditional ("DEBUG")]'.
17411 2002-07-26 Martin Baulig <martin@gnome.org>
17413 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17414 (switch_statement): Push the current_block to the switch_stack and
17415 pop it again when we're done with the switch.
17416 (switch_section): The new block is a child of the current_block.
17417 Fixes bug #24007, added test-152.cs.
17419 2002-07-27 Martin Baulig <martin@gnome.org>
17421 * expression.cs (Invocation.EmitArguments): When calling a varargs
17422 function with only its fixed arguments, we need to pass an empty
17425 2002-07-27 Martin Baulig <martin@gnome.org>
17427 Mono 0.13 has been released.
17429 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17431 * driver.cs: Rename --resource to --linkres, because that is what
17432 we do currently, we dont support --resource yet.
17434 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17436 2002-07-25 Martin Baulig <martin@gnome.org>
17438 * class.cs (MethodData): New public class. This is a `method builder'
17439 class for a method or one accessor of a Property/Indexer/Event.
17440 (MethodData.GetMethodFlags): Moved here from MemberBase.
17441 (MethodData.ApplyAttributes): Likewise.
17442 (MethodData.ApplyObsoleteAttribute): Likewise.
17443 (MethodData.ApplyConditionalAttribute): Likewise.
17444 (MethodData.ApplyDllImportAttribute): Likewise.
17445 (MethodData.CheckAbstractAndExternal): Likewise.
17446 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17447 (MethodData.Emit): Formerly known as Method.Emit().
17448 (MemberBase): Moved everything which was specific to a single
17449 accessor/method to MethodData.
17450 (Method): Create a new MethodData and call Define() and Emit() on it.
17451 (Property, Indexer, Event): Create a new MethodData objects for each
17452 accessor and call Define() and Emit() on them.
17454 2002-07-25 Martin Baulig <martin@gnome.org>
17456 Made MethodCore derive from MemberBase to reuse the code from there.
17457 MemberBase now also checks for attributes.
17459 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17460 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17462 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17463 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17464 (MemberBase.ApplyAttributes): New virtual method; applies the
17465 attributes to a method or accessor.
17466 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17467 (MemberBase.ApplyConditionalAttribute): Likewise.
17468 (MemberBase.ApplyDllImportAttribute): Likewise.
17469 (MemberBase.CheckAbstractAndExternal): Likewise.
17470 (MethodCore.ParameterTypes): This is now a property instead of a
17471 method, it's initialized from DoDefineParameters().
17472 (MethodCore.ParameterInfo): Removed the set accessor.
17473 (MethodCore.DoDefineParameters): New protected virtual method to
17474 initialize ParameterTypes and ParameterInfo.
17475 (Method.GetReturnType): We can now simply return the MemberType.
17476 (Method.GetMethodFlags): Override the MemberBase version and add
17477 the conditional flags.
17478 (Method.CheckBase): Moved some code from Define() here, call
17479 DoDefineParameters() here.
17480 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17481 here to avoid some larger code duplication.
17482 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17483 ensure that abstract and external accessors don't declare a body.
17485 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17486 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17487 lookup in the attribute's parent classes, so we need to abort as soon
17488 as we found the first match.
17489 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17490 the attribute has no arguments.
17492 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17495 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17497 * cs-parser.jay: reverted previous patch.
17499 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17501 * cs-parser.jay: fixed bug #22119.
17503 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17505 * attribute.cs: fixed compilation. The error was:
17506 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17507 be assigned to before control leaves the current method."
17508 [FIXME: Filed as bug #28186: MCS must report this error.]
17510 2002-07-25 Martin Baulig <martin@gnome.org>
17512 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17513 method to pull the condition name ouf of a Conditional attribute.
17514 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17515 the obsolete message and error flag out of an Obsolete attribute.
17517 * class.cs (Method.GetMethodFlags): New public method to get the
17518 TypeManager.MethodFlags for this method.
17519 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17521 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17522 if we're overriding a virtual function, set the new private variable
17523 `parent_method'; call the new TypeManager.AddMethod().
17525 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17526 the MethodBuilder and the Method in a PtrHashtable.
17527 (TypeManager.builder_to_method): Added for this purpose.
17528 (TypeManager.MethodFlags): Added IsObsoleteError.
17529 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17530 Obsolete and Conditional arguments in MethodBuilders. If we discover
17531 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17532 the message from the attribute.
17534 2002-07-24 Martin Baulig <martin@gnome.org>
17536 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17537 preprocessor directives, ensure that the argument to #define/#undef is
17538 exactly one identifier and that it's actually an identifier.
17540 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17543 2002-07-24 Martin Baulig <martin@gnome.org>
17545 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17546 initialize it to TypeManager.object_type in the constructor.
17547 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17548 of the `hm.get_current' method if we're using the collection pattern.
17549 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17550 for the explicit conversion to make it work when we're using the collection
17551 pattern and the `Current' property has a different return type than `object'.
17554 2002-07-24 Martin Baulig <martin@gnome.org>
17556 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17557 does not match, but don't report any errors. This method is called in
17558 order for all methods in a MethodGroupExpr until a matching method is
17559 found, so we don't want to bail out if the first method doesn't match.
17560 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17561 matches, report the 123. Fixes #28070.
17563 2002-07-24 Martin Baulig <martin@gnome.org>
17565 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17566 TypeManager.TypeToCoreType() to the top of the method so the
17567 following equality checks will work. Fixes #28107.
17569 2002-07-24 Martin Baulig <martin@gnome.org>
17571 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17572 operand is of type uint, and the other operand is of type sbyte,
17573 short or int, the operands are converted to type long." -
17574 Actually do what this comment already told us. Fixes bug #28106,
17577 2002-07-24 Martin Baulig <martin@gnome.org>
17579 * class.cs (MethodBase): New abstract class. This is now a base
17580 class for Property, Indexer and Event to avoid some code duplication
17581 in their Define() and DefineMethods() methods.
17582 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17583 generic methods for Define() and DefineMethods().
17584 (FieldBase): Derive from MemberBase, not MemberCore.
17585 (Property): Derive from MemberBase, not MemberCore.
17586 (Property.DefineMethod): Moved all the code from this method to the
17587 new MethodBase.DefineAccessor(), just call it with appropriate
17589 (Property.Define): Call the new Property.DoDefine(), this does some
17590 sanity checks and we don't need to duplicate the code everywhere.
17591 (Event): Derive from MemberBase, not MemberCore.
17592 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17593 accessors, this will also make them work with interface events.
17594 (Indexer): Derive from MemberBase, not MemberCore.
17595 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17596 (Indexer.Define): Use the new MethodBase functions.
17598 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17599 argument to the constructor.
17600 (Interface.FindMembers): Added support for interface events.
17601 (Interface.PopluateEvent): Implemented.
17603 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17605 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17607 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17608 but this is required to check for a method name being the same as
17609 the containing class.
17613 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17615 * interface.cs: initialize variable.
17617 2002-07-23 Martin Baulig <martin@gnome.org>
17619 Implemented the IndexerName attribute in interfaces.
17621 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17622 name if this is an explicit interface implementation.
17623 (Indexer.InterfaceIndexerName): New public variable. If we're
17624 implementing an interface indexer, this is the IndexerName in that
17625 interface. Otherwise, it's the IndexerName.
17626 (Indexer.DefineMethod): If we're implementing interface indexer,
17627 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17628 and Pending.ImplementIndexer methods.
17629 (Indexer.Define): Also define the PropertyBuilder if we're
17630 implementing an interface indexer and this is neither an explicit
17631 interface implementation nor do the IndexerName match the one in
17634 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17635 If a method is defined here, then we always need to create a proxy
17636 for it. This is used when implementing interface indexers.
17637 (Pending.IsInterfaceIndexer): New public method.
17638 (Pending.ImplementIndexer): New public method.
17639 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17640 This is used when implementing interface indexers to define a proxy
17642 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17643 define a proxy if necessary.
17645 * interface.cs (Interface.IndexerName): New public variable.
17646 (Interface.PopulateIndexer): Set the IndexerName.
17647 (Interface.DefineIndexers): New private method. Populate all the
17648 indexers and make sure their IndexerNames match.
17650 * typemanager.cs (IndexerPropertyName): Added support for interface
17653 2002-07-22 Martin Baulig <martin@gnome.org>
17655 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17656 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17657 ret if HasReturnLabel.
17658 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17661 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17662 and set the ec.LoopBeginTryCatchLevel.
17663 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17664 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17665 the current ec.TryCatchLevel, the branch goes out of an exception
17666 block. In this case, we need to use Leave and not Br.
17668 2002-07-22 Martin Baulig <martin@gnome.org>
17670 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17671 block unless the block does not always return or it is contained in
17672 another try { ... } catch { ... } block. Fixes bug #26506.
17673 Added verify-1.cs to the test suite.
17675 2002-07-22 Martin Baulig <martin@gnome.org>
17677 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17678 then we do not always return. Fixes bug #24985.
17680 2002-07-22 Martin Baulig <martin@gnome.org>
17682 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17683 lookup on a per-class level; ie. walk up the class hierarchy until we
17684 found at least one applicable method, then choose the best among them.
17685 Fixes bug #24463 and test-29.cs.
17687 2002-07-22 Martin Baulig <martin@gnome.org>
17689 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17690 return types of the methods. The return type is not part of the
17691 signature and we must not check it to make the `new' modifier work.
17692 Fixes bug #27999, also added test-147.cs.
17693 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17695 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17696 on the method's return type.
17698 2002-07-21 Martin Baulig <martin@gnome.org>
17700 * assign.cs: Make this work if the rightmost source is a constant and
17701 we need to do an implicit type conversion. Also adding a few more tests
17702 to test-38.cs which should have caught this.
17704 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17705 target in the makefile for this. The makefile.gnu is primarily intended
17706 for end-users who don't want to debug the compiler.
17708 2002-07-21 Martin Baulig <martin@gnome.org>
17710 * assign.cs: Improved the Assign class so it can now handle embedded
17711 assignments (X = Y = Z = something). As a side-effect this'll now also
17712 consume less local variables. test-38.cs now passes with MCS, added
17713 a few new test cases to that test.
17715 2002-07-20 Martin Baulig <martin@gnome.org>
17717 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17718 instructions. Fixes bug #27977, also added test-146.cs.
17720 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17722 * cs-tokenizer.cs: fixed getHex ().
17724 2002-07-19 Martin Baulig <martin@gnome.org>
17726 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17727 not Type.GetType() to lookup the array type. This is needed when
17728 we're constructing an array of a user-defined type.
17729 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17730 single-dimensional arrays, but also for single-dimensial arrays of
17733 2002-07-19 Martin Baulig <martin@gnome.org>
17735 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17736 this function is called, it's not allowed to share LocalBuilders
17737 among ILGenerators.
17739 2002-07-19 Martin Baulig <martin@gnome.org>
17741 * expression.cs (Argument.Resolve): Report an error 118 when trying
17742 to pass a type as argument.
17744 2002-07-18 Martin Baulig <martin@gnome.org>
17746 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17747 Conv_R_Un for the signed `long' type.
17749 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17751 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17752 `expr' for the temporary result, as that will fail if we do
17753 multiple resolves on the same expression.
17755 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17757 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17758 ec.TypeContainer for looking up aliases.
17760 * class.cs (TypeContainer): Remove LookupAlias from here.
17762 * decl.cs (DeclSpace); Move here.
17764 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17766 * class.cs (FindMembers): Only call filter if the constructor
17767 bulider is not null.
17769 Also handle delegates in `NestedTypes' now. Now we will perform
17770 type lookups using the standard resolution process. This also
17773 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17774 This uses Expressions (the limited kind that can be parsed by the
17775 tree) instead of strings.
17777 * expression.cs (ComposedCast.ToString): Implement, used to flag
17778 errors since now we have to render expressions.
17780 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17783 * ecore.cs (SimpleName.ToString): ditto.
17785 * cs-parser.jay: Instead of using strings to assemble types, use
17786 Expressions to assemble the type (using SimpleName, ComposedCast,
17787 MemberAccess). This should fix the type lookups in declarations,
17788 because we were using a different code path for this.
17790 * statement.cs (Block.Resolve): Continue processing statements
17791 even when there is an error.
17793 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17795 * class.cs (Event.Define): Also remove the `remove' method from
17796 the list of pending items.
17798 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17799 generate more compact code.
17801 2002-07-17 Martin Baulig <martin@gnome.org>
17803 * const.cs (Const.LookupConstantValue): Add support for constant
17804 `unchecked' and `checked' expressions.
17805 Also adding test case test-140.cs for this.
17807 2002-07-17 Martin Baulig <martin@gnome.org>
17809 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17810 check whether mi.ReturnType implements the IEnumerator interface; the
17811 `==' and the IsAssignableFrom() will fail in this situation.
17813 2002-07-16 Ravi Pratap <ravi@ximian.com>
17815 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17818 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17820 * expression.cs: fixed bug #27811.
17822 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17824 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17825 Molaro: when we are a ref, the value already contains a pointer
17826 value, do not take the address of it.
17828 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17829 * removed mb-parser.jay and mb-tokenizer.cs
17831 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17833 * expression.cs: check against the building corlib void type.
17835 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17837 * ecore.cs: fix for valuetype static readonly fields: when
17838 initializing them, we need their address, not the address of a copy.
17840 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17842 * typemanager.cs: register also enum_type in corlib.
17844 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17846 * class.cs: allow calling this (but not base) initializers in structs.
17848 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17850 * ecore.cs: make sure we compare against the building base types
17853 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17855 * typemanager.cs: fix TypeToCoreType() to handle void and object
17856 (corlib gets no more typerefs after this change).
17858 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17860 * expression.cs (ArrayCreation.EmitArrayArguments): use
17861 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17863 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17864 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17865 array indexes, the runtime actually forbids them.
17867 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17868 for array arguments here.
17870 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17871 instead of the default for ValueTypes.
17873 (New.DoEmit): Use IsValueType instead of
17874 IsSubclassOf (value_type)
17875 (New.DoResolve): ditto.
17876 (Invocation.EmitCall): ditto.
17878 * assign.cs (Assign): ditto.
17880 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17881 Statements *are* currently doing part of their resolution during
17884 Expressions do always resolve during resolve, but statements are
17885 only required to propagate resolution to their children.
17887 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17889 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17891 (LoadAssembly): Do not add the dll if it is already specified
17893 (MainDriver): Add the System directory to the link path at the end,
17894 after all the other -L arguments.
17896 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17897 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17898 ldelem.u1) and using the opposite for sbytes.
17900 This fixes Digger, and we can finally run it.
17902 * driver.cs (UnixParseOption): Move the option parsing here.
17903 (CSCParseOption): Implement CSC-like parsing of options.
17905 We now support both modes of operation, the old Unix way, and the
17906 new CSC-like way. This should help those who wanted to make cross
17907 platform makefiles.
17909 The only thing broken is that /r:, /reference: and /lib: are not
17910 implemented, because I want to make those have the same semantics
17911 as the CSC compiler has, and kill once and for all the confussion
17912 around this. Will be doing this tomorrow.
17914 * statement.cs (Unsafe.Resolve): The state is checked during
17915 resolve, not emit, so we have to set the flags for IsUnsfe here.
17917 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17919 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17920 not catch the Error_ObjectRefRequired in SimpleName (as it is
17921 possible to have a class/instance variable name that later gets
17922 deambiguated), we have to check this here.
17924 2002-07-10 Ravi Pratap <ravi@ximian.com>
17926 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17927 make static and put into Expression.
17929 (Event.Define): Register the private field of the event with the
17930 TypeManager so that GetFieldFromEvent can get at it.
17932 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17933 keep track of the private field associated with an event which
17936 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17939 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17941 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17943 * expression.cs (Binary.EmitBranchable): this routine emits the
17944 Binary expression in a branchable context. This basically means:
17945 we need to branch somewhere, not just get the value on the stack.
17947 This works together with Statement.EmitBoolExpression.
17949 * statement.cs (Statement.EmitBoolExpression): Use
17952 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17954 * statement.cs (For): Reduce the number of jumps in loops.
17956 (For): Implement loop inversion for the For statement.
17958 (Break): We can be breaking out of a Try/Catch controlled section
17959 (foreach might have an implicit try/catch clause), so we need to
17960 use Leave instead of Br.
17962 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17963 now). If the instace expression supports IMemoryLocation, we use
17964 the AddressOf method from the IMemoryLocation to extract the
17965 address instead of emitting the instance.
17967 This showed up with `This', as we were emitting the instance
17968 always (Emit) instead of the Address of This. Particularly
17969 interesting when This is a value type, as we dont want the Emit
17970 effect (which was to load the object).
17972 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17974 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17976 * statement.cs (Checked): Set the CheckedState during the resolve
17977 process too, as the ConvCast operations track the checked state on
17978 the resolve process, and not emit.
17980 * cs-parser.jay (namespace_member_declaration): Flag that we have
17981 found a declaration when we do. This is used to flag error 1529
17983 * driver.cs: Report ok when we display the help only.
17985 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17987 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17989 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17991 * cs-tokenizer.cs (define): We also have to track locally the
17992 defines. AllDefines is just used for the Conditional Attribute,
17993 but we also need the local defines for the current source code.
17995 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17997 * statement.cs (While, For, Do): These loops can exit through a
17998 Break statement, use this information to tell whether the
17999 statement is the last piece of code.
18001 (Break): Flag that we break.
18003 * codegen.cs (EmitContexts): New `Breaks' state variable.
18005 2002-07-03 Martin Baulig <martin@gnome.org>
18007 * class.cs (TypeContainer.MethodModifiersValid): Allow override
18008 modifiers in method declarations in structs. Otherwise, you won't
18009 be able to override things like Object.Equals().
18011 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18013 * class.cs (Method, Property, Indexer): Do not allow the public
18014 modifier to be used in explicit interface implementations.
18016 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18017 override modifiers in method declarations in structs
18019 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
18021 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18022 integer or real overflow, report an error
18024 2002-07-02 Martin Baulig <martin@gnome.org>
18026 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18027 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18028 to tell the runtime about our newly created System.Object and
18029 System.ValueType types.
18031 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18033 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18034 struct instead of Ldarg/Starg.
18036 2002-07-02 Martin Baulig <martin@gnome.org>
18038 * expression.cs (Indirection.Indirection): Call
18039 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18041 2002-07-02 Martin Baulig <martin@gnome.org>
18043 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18044 ValueType, call TypeManager.TypeToCoreType() on it.
18045 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18046 the OpCodes.Newarr argument.
18048 2002-07-02 Martin Baulig <martin@gnome.org>
18050 * expression.cs (Invocation.EmitCall): When compiling corlib,
18051 replace all calls to the system's System.Array type to calls to
18052 the newly created one.
18054 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18055 System.Array methods.
18056 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18057 from the system's System.Array type which must be replaced.
18059 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18061 * typemanager.cs: load unverifiable_code_ctor so we can build
18062 corlib using the correct type. Avoid using GetTypeCode() with
18064 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18065 TypeManager.object_type to allow building corlib.
18067 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18069 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18071 2002-07-01 Martin Baulig <martin@gnome.org>
18073 * class.cs: Make the last change actually work, we need to check
18074 whether `ifaces != null' to avoid a crash.
18076 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18078 * class.cs: when we build structs without fields that implement
18079 interfaces, we need to add the interfaces separately, since there is
18080 no API to both set the size and add the interfaces at type creation
18083 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18085 * expression.cs: the dimension arguments to the array constructors
18086 need to be converted if they are a long.
18088 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18090 * class.cs: don't emit ldarg.0 if there is no parent constructor
18091 (fixes showstopper for corlib).
18093 2002-06-29 Martin Baulig <martin@gnome.org>
18095 MCS now compiles corlib on GNU/Linux :-)
18097 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18098 ie. check for MethodImplOptions.InternalCall.
18100 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18101 and TypeManager.attribute_type are null, so we must explicitly check
18102 whether parent is not null to find out whether it's an attribute type.
18103 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18104 and SetBuilder, not only if the property is neither abstract nor external.
18105 This is necessary to set the MethodImplOptions on the accessor methods.
18106 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18107 SetBuilder, see Property.Emit().
18109 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18110 populate "System.Object", "System.ValueType" and "System.Attribute" since
18111 they've already been populated from BootCorlib_PopulateCoreTypes().
18113 2002-06-29 Martin Baulig <martin@gnome.org>
18115 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18116 is the NullLiteral, we also need to make sure that target_type is not
18119 2002-06-29 Martin Baulig <martin@gnome.org>
18121 * rootcontext.cs (RootContext.ResolveCore): We must initialize
18122 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18123 before calling BootstrapCorlib_ResolveDelegate ().
18125 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18127 * statement.cs: fixed build-breaker. All tests passed ok.
18129 2002-06-27 Martin Baulig <martin@gnome.org>
18131 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18132 for System.Decimal when compiling corlib.
18134 2002-06-27 Martin Baulig <martin@gnome.org>
18136 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18137 switch blocks which contain nothing but a default clause.
18139 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
18141 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18143 2002-06-27 Martin Baulig <martin@gnome.org>
18145 * ecore.cs (PropertyExpr.PropertyExpr): Call
18146 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18148 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18149 is already a TypeBuilder.
18151 2002-06-27 Martin Baulig <martin@gnome.org>
18153 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18154 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18155 the "from an array-type to System.Array" case. This makes it work
18156 when compiling corlib.
18158 2002-06-27 Martin Baulig <martin@gnome.org>
18160 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18161 non-static PropertyExpr, set its InstanceExpression. This makes
18162 the `ICollection.Count' property work in System/Array.cs.
18164 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18166 * driver.cs: Made error handling more consistent. Errors now
18167 tracked by Report class, so many methods which used to return int
18168 now return void. Main() now prints success/failure and
18169 errors/warnings message.
18171 Renamed '--probe' compiler argument to '--expect-error'. Removed
18172 the magic number return values (123 and 124). Now, if the
18173 expected error occurs, the compiler exits with success (exit value
18174 0). If the compilation completes without seeing that particular
18175 error, the compiler exits with failure (exit value 1). The
18176 makefile in mcs/errors has been changed to handle the new behaviour.
18178 * report.cs: Made 'expected error' number a property and renamed
18179 it from 'Probe' to 'ExpectedError'.
18181 * genericparser.cs: Removed error handling support, since it is
18182 now all done by Report class.
18184 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18185 class, so parse() no longer returns an int.
18187 * namespace.cs: Use Report.Error instead of GenericParser.error
18189 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18191 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18192 TypeContainer.AddOperator): At the front of the list put the
18193 explicit implementations, so they get resolved/defined first.
18195 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18197 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18198 interface type is implemented by this TypeContainer. Used during
18199 explicit interface implementation.
18201 (Property.Define, Indexer.Define, Method.Define): Validate that
18202 the given interface in the explicit implementation is one of the
18203 base classes for the containing type.
18205 Also if we are explicitly implementing an interface, but there is
18206 no match in the pending implementation table, report an error.
18208 (Property.Define): Only define the property if we are
18209 not explicitly implementing a property from an interface. Use the
18210 correct name also for those properties (the same CSC uses,
18211 although that is really not needed).
18213 (Property.Emit): Do not emit attributes for explicitly implemented
18214 properties, as there is no TypeBuilder.
18216 (Indexer.Emit): ditto.
18218 Hiding then means that we do not really *implement* a pending
18219 implementation, which makes code fail.
18221 2002-06-22 Martin Baulig <martin@gnome.org>
18223 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18224 the return value of Object.GetType(). [FIXME: we need to do this whenever
18225 we get a type back from the reflection library].
18227 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18229 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18231 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18233 * attribute.cs: Return null if we can not look up the type.
18235 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18236 the interface types found.
18238 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18239 interface types found.
18241 * typemanager.cs (GetInterfaces): Make this routine returns alll
18242 the interfaces and work around the lame differences between
18243 System.Type and System.Reflection.Emit.TypeBuilder in the results
18244 result for GetInterfaces.
18246 (ExpandInterfaces): Given an array of interface types, expand and
18247 eliminate repeated ocurrences of an interface. This expands in
18248 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18251 2002-06-21 Martin Baulig <martin@gnome.org>
18253 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18256 2002-06-21 Martin Baulig <martin@gnome.org>
18258 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18259 and called with one of the core types, return the corresponding typebuilder for
18262 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18265 2002-06-21 Martin Baulig <martin@gnome.org>
18267 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18268 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18269 (Expression.ConvertReferenceExplicit): Likewise.
18271 * expression.cs (ElementAccess.DoResolve): Likewise.
18272 (ElementAccess.DoResolveLValue): Likewise.
18274 2002-06-10 Martin Baulig <martin@gnome.org>
18276 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18277 add the "value" parameter to the parameter list.
18279 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18282 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18284 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18285 the argument to an int, uint, long or ulong, per the spec. Also
18286 catch negative constants in array creation.
18288 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18290 * class.cs: do not allow the same interface to appear twice in
18291 the definition list.
18293 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18295 * ecore.cs: don't use ldlen with System.Array.
18297 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18299 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18301 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18303 * modifiers.cs: produce correct field attributes for protected
18304 internal. Easy fix so miguel can work on ther harder stuff:-)
18306 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18308 * pending.cs: New file. Move the code from class.cs here.
18309 Support clearning the pending flag for all methods (when not doing
18310 explicit interface implementation).
18312 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18314 * rootcontext.cs: added a couple more types needed to bootstrap.
18316 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18318 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18319 constructor in the type, instead of any constructor in the type
18320 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18321 a bug in the Mono runtime when applying the params attribute).
18323 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18324 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18326 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18328 * expression.cs (Unary.ResolveOperator): Use TypeManager
18329 to resolve the type.
18331 2002-06-13 Ravi Pratap <ravi@ximian.com>
18333 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18336 * enum.cs (AddEnumMember): Add support to store the attributes associated
18337 with each member too.
18339 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18340 field builders too - this takes care of the enum member case.
18342 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18344 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18345 address-of operator on both value types and pointers.
18347 2002-06-10 Martin Baulig <martin@gnome.org>
18349 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18350 PropertyBuilder to the `property_builders' list.
18352 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18353 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18354 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18355 find any indexers which are inherited from an interface.
18357 2002-06-09 Martin Baulig <martin@gnome.org>
18359 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18360 the same type as the constant if necessary. There's also a test-130.cs
18363 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18365 * typemanager.cs (TypeManager.ChangeType): Previously known as
18366 Enum.ChangeEnumType().
18368 2002-06-09 Martin Baulig <martin@gnome.org>
18370 * expression.cs (Cast.TryReduce): Added support for consts.
18372 2002-06-08 Ravi Pratap <ravi@ximian.com>
18374 * class.cs (Accessor): Hold attributes information so we can pass
18377 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18378 Modify to pass in attributes attached to the methods.
18380 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18382 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18383 to handle the Accessor kind :-)
18385 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18387 2002-06-08 Martin Baulig <martin@gnome.org>
18389 * expression.cs (Unary.TryReduceNegative): Added support for
18392 2002-06-08 Martin Baulig <martin@gnome.org>
18394 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18395 name can't be found in the `defined_names' - the caller will do a
18396 MemberLookup in this case and thus find methods in System.Enum
18397 such as Enum.IsDefined().
18399 2002-06-08 Martin Baulig <martin@gnome.org>
18401 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18402 Convert.ChangeType() which works with TypeBuilder created types.
18403 (Enum.LookupEnumValue, Enum.Define): Use it here.
18405 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18406 `TypeBuilder.BaseType != null' check.
18407 (TypeContainer.FindMembers): Only lookup parent members if we
18408 actually have a parent.
18409 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18410 (ConstructorInitializer.Resolve): Likewise.
18412 * interface.cs (Interface.FindMembers): Added
18413 `TypeBuilder.BaseType != null' check.
18415 * rootcontext.cs (RootContext.ResolveCore): Added
18416 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18417 classes_second_stage.
18419 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18420 debug_type and trace_type when compiling with --nostdlib.
18422 2002-06-07 Martin Baulig <martin@gnome.org>
18424 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18425 (AddField): Set it to true when adding a non-static field.
18426 (DefineType): Use `have_nonstatic_fields' to find out whether we
18427 have non-static fields, not `Fields != null'.
18429 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18431 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18432 dereferencing a null on the static-field code path)
18434 2002-05-30 Martin Baulig <martin@gnome.org>
18436 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18437 to take command line arguments. Use reflection to call the new
18438 custom `Initialize' function on the symbol writer and pass it the
18439 command line arguments.
18441 * driver.cs (--debug-args): New command line argument to pass command
18442 line arguments to the symbol writer.
18444 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18446 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18447 the target type for indexers and properties. Thanks to Joe for
18450 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18452 * typemanager.cs (MethodFlags): returns the method flags
18453 (Obsolete/ShouldIgnore) that control warning emission and whether
18454 the invocation should be made, or ignored.
18456 * expression.cs (Invocation.Emit): Remove previous hack, we should
18457 not do this on matching a base type, we should do this based on an attribute
18459 Only emit calls to System.Diagnostics.Debug and
18460 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18461 on the command line.
18463 * rootcontext.cs: Global settings for tracing and debugging.
18465 * cs-tokenizer.cs (define): New utility function to track
18466 defines. Set the global settings for TRACE and DEBUG if found.
18468 2002-05-25 Ravi Pratap <ravi@ximian.com>
18470 * interface.cs (Populate*): Pass in the TypeContainer as well as
18471 the DeclSpace as parameters so that we can create EmitContexts and
18472 then use that to apply attributes etc.
18474 (PopulateMethod, PopulateEvent, PopulateProperty)
18475 (PopulateIndexer): Apply attributes everywhere.
18477 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18480 (ApplyAttributes): Update accordingly.
18482 We now apply interface attributes for all members too.
18484 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18486 * class.cs (Indexer.Define); Correctly check if we are explicit
18487 implementation (instead of checking the Name for a ".", we
18488 directly look up if the InterfaceType was specified).
18490 Delay the creation of the PropertyBuilder.
18492 Only create the PropertyBuilder if we are not an explicit
18493 interface implementation. This means that explicit interface
18494 implementation members do not participate in regular function
18495 lookups, and hence fixes another major ambiguity problem in
18496 overload resolution (that was the visible effect).
18498 (DefineMethod): Return whether we are doing an interface
18501 * typemanager.cs: Temporary hack until we get attributes in
18502 interfaces (Ravi is working on that) and we get IndexerName
18503 support in interfaces.
18505 * interface.cs: Register the indexers as properties.
18507 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18508 warning, I have verified that this is a bug in the .NET runtime
18509 (JavaScript suffers of the same problem).
18511 * typemanager.cs (MemberLookup): When looking up members for
18512 interfaces, the parent of an interface is the implicit
18513 System.Object (so we succeed in searches of Object methods in an
18514 interface method invocation. Example: IEnumerable x; x.ToString
18517 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18519 * class.cs (Event): Events should also register if they do
18520 implement the methods that an interface requires.
18522 * typemanager.cs (MemberLookup); use the new GetInterfaces
18525 (GetInterfaces): The code used to lookup interfaces for a type is
18526 used in more than one place, factor it here.
18528 * driver.cs: Track the errors at the bottom of the file, we kept
18531 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18532 instance if the method we are calling is static!
18534 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18536 * attribute.cs (ApplyAttributes): Make this function filter out
18537 the IndexerName attribute (as that attribute in reality is never
18538 applied) and return the string constant for the IndexerName
18541 * class.cs (TypeContainer.Emit): Validate that all the indexers
18542 have the same IndexerName attribute, and if so, set the
18543 DefaultName attribute on the class.
18545 * typemanager.cs: The return value might contain other stuff (not
18546 only methods). For instance, consider a method with an "Item"
18547 property and an Item method.
18549 * class.cs: If there is a problem with the parameter types,
18552 2002-05-24 Ravi Pratap <ravi@ximian.com>
18554 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18555 looks at user defined conversion after making a call to
18556 StandardConversionExists - we need this for overload resolution.
18558 * expression.cs : Update accordingly the various method calls.
18560 This fixes 2 bugs filed against implicit user defined conversions
18562 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18564 * statement.cs: Track the result of the assignment.
18566 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18568 * expression.cs (MemberAccess): Improved error reporting for
18569 inaccessible members.
18571 2002-05-22 Martin Baulig <martin@gnome.org>
18573 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18574 itself with debugging support.
18576 2002-05-22 Martin Baulig <martin@gnome.org>
18578 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18579 Removed, this isn't needed anymore.
18581 2002-05-20 Martin Baulig <martin@gnome.org>
18583 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18584 be underlying type for an enum.
18586 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18588 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18589 that splits out the loading of just the core types.
18591 * rootcontext.cs (ResolveCore): Split the struct resolution in
18592 two, so we can load the enumeration underlying types before any
18595 * expression.cs (Is): Bandaid until we fix properly Switch (see
18596 bug #24985 for details).
18598 * typemanager.cs (ImplementsInterface): The hashtable will contain
18599 a null if there are no interfaces implemented.
18601 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18603 * cs-parser.jay (indexer_declarator): It is fine to have array
18606 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18608 * typemanager.cs: (RegisterBuilder): New function used to register
18609 TypeBuilders that implement interfaces. Since
18610 TypeBuilder.GetInterfaces (as usual) does not work with lame
18612 (AddUserType): register interfaces.
18614 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18615 dealing with TypeBuilder. Also, arrays are showing up as
18616 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18617 methods can not be invoked on them!
18619 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18620 (ImplicitReferenceConversionExists): Split out from
18621 StandardConversionExists.
18623 * expression.cs (As): We were only implementing one of the three
18624 cases for the as operator. We now implement them all.
18625 (Is): Implement the various other cases for Is as well.
18627 * typemanager.cs (CACHE): New define used to control if we want or
18628 not the FindMembers cache. Seems to have a negative impact on
18629 performance currently
18631 (MemberLookup): Nested types have full acess to
18632 enclosing type members
18634 Remove code that coped with instance/static returns for events, we
18635 now catch this in RealFindMembers.
18637 (RealFindMembers): only perform static lookup if the instance
18638 lookup did not return a type or an event.
18640 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18642 * assign.cs (CompoundAssign): We pass more semantic information
18643 now to Compound Assignments than we did before: now we have all
18644 the information at hand, and now we resolve the target *before* we
18645 do the expression expansion, which allows the "CacheValue" method
18646 to have the effect we intended (before, a [x] += 1 would generate
18647 two differen ArrayAccess expressions from the ElementAccess,
18648 during the resolution process).
18650 (CompoundAssign.DoResolve): Resolve target and original_source here.
18652 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18654 * expression.cs (ArrayAccess): dropped debugging information.
18656 * typemanager.cs: Small bug fix: I was always returning i_members,
18657 instead of one of i_members or s_members (depending on which had
18660 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18661 method is invoked before any code generation takes place, and it
18662 is a mechanism to inform that the expression will be invoked more
18663 than once, and that the method should use temporary values to
18664 avoid having side effects
18666 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18668 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18671 * expression.cs (Indirection, ArrayAccess): Add support for
18672 CacheTemporaries in these two bad boys.
18674 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18675 ldobj or ldind_ref.
18676 (StoreFromPtr): Handle stobj as well.
18678 * expression.cs (UnaryMutator): Share more code.
18680 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18681 down: I was not tracking the Filter function as well, which
18682 was affecting the results of the cache.
18684 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18686 * attribute.cs: Remove the hack to handle the CharSet property on
18689 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18691 * attribute.cs (DoResolve): More uglyness, we now only try to
18692 resolve the attribute partially, to extract the CharSet
18693 information (only if we are a StructLayout attribute). Otherwise
18695 (GetExtraTypeInfo): Add some code to conditionally kill in the
18696 future this. I am more and more convinced that the .NET
18697 framework has special code to handle the attribute setting on
18700 * expression.cs (IsParamsMethodApplicable): Revert my previous
18701 foreach change here, it was wrong.
18703 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18705 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18706 (pp_expr): do not abort on unknown input, just return.
18707 (eval): abort if there are pending chars.
18709 * attribute.cs (Attribute.Resolve): Positional parameters are
18710 optional. Deal with that case.
18712 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18713 the Ansi/Unicode/Auto information for the type.
18715 (TypeContainer.DefineType): instantiate the EmitContext here, as
18716 we will be using it during the type definition (to resolve
18717 attributes) and during the emit phase.
18719 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18720 to pull type information out of the attributes
18722 (Attribute.Resolve): track the constructor builder, and allow for
18723 multiple invocations (structs and classes will use this).
18725 * ecore.cs (MemberLookupFinal): new version with all the
18726 parameters customizable.
18728 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18729 constructors. Return if the result value is null (as the error
18730 would have been flagged already by MemberLookupFinal)
18732 Do not allow instances of abstract classes or interfaces to be
18735 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18736 We have to compare the assembly property here when dealing with
18737 FamANDAssem and Assembly access modifiers, because we might be
18738 creating an assembly from *modules* (that means that we are not
18739 getting TypeBuilders for types defined in other modules that are
18740 part of this assembly).
18742 (Method.Emit): If the method is marked abstract and has a body,
18745 (TypeContainer.DefineMembers): If both the defined member and the
18746 parent name match are methods, then do not emit any warnings: let
18747 the Method.Define routine take care of flagging warnings. But if
18748 there is a mismatch (method overrides something else, or method is
18749 overriwritten by something, then emit warning).
18751 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18752 set to null, this means `do not check for the return type on the
18755 (Method.Define): set the return type for the method signature to
18756 null, so that we get methods with the same name and parameters and
18757 different return types. This is used to flag warning 114 (you are
18758 hiding a method, and you probably want to use the new/override
18761 * typemanager.cs (MemberLookup): Implemented proper access
18762 control, closing a long standing set of bug reports. The problem
18763 was that the Framework only has two bits: Public and NonPublic,
18764 and NonPublic includes private and protected methods, but we need
18765 to enforce the FamANDAssem, FamOrAssem and Family.
18767 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18769 * statement.cs (GotoCase): Return true: Ammounts to giving up
18770 knowledge on whether we return or not, and letting the other case
18771 be responsible for it.
18773 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18775 * driver.cs: Do not load directories for each file processed, only
18776 do it if there is a pattern.
18778 * ecore.cs: Report readonly assigns here as well, as we might have
18779 been resolved only by MemberAccess.
18781 (SimpleName.SimpleNameResolve): Also be useful for LValue
18782 resolution. We need this to propagate assign to local readonly variables
18784 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18785 do not want to reuse potential criteria memory.
18787 * class.cs (MyEventBuilder): Set reflected_type;
18789 * ecore.cs (Constantify): Added support for constifying bools.
18791 (RootContext.LookupType): Added a cache for values looked up in
18792 the declaration space.
18794 * typemanager.cs (FindMembers): Now is a front-end to
18795 RealFindMembers, and provides a two-level hashtable-based cache to
18798 15% performance improvement: from 22.5 to 19.2 seconds.
18800 * expression.cs (IsParamsMethodApplicable): use foreach.
18801 (Invocation.DoResolve): ditto.
18802 (New.DoResolve): ditto.
18803 (ArrayCreation.DoResolve): ditto.
18805 * ecore.cs (FindMostEncompassingType): use foreach.
18807 * delegate.cs (NewDelegate.DoResolve): Use foreach
18809 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18810 (RemoveMethods): use foreach.
18812 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18813 nested foreach statements instead of for, and also break out of
18814 the inner loop once a match is found.
18816 (Invocation.OverloadResolve): Use foreach, simplify the code.
18818 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18820 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18821 we actually unwrap the expression to allow for extra information
18824 * expression.cs: Use Shr_Un on unsigned operations.
18826 2002-05-08 Ravi Pratap <ravi@ximian.com>
18828 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18829 applicable operators was not being considered correctly. This closes
18830 the bug Miguel reported.
18832 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18834 * attribute.cs: check that the type derives from System.Attribute
18835 and report the correct error in that case (moved the duplicate code to
18836 its own method, too).
18838 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18840 * attribute.cs: lookup attribute type name as the spec says: first the
18841 bare attribute name and then name + "Attribute" (nant compiles with
18842 mcs after this fix).
18844 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18846 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18847 Because of the way we parse things, we should try to see if a
18848 UIntConstant can fit in an integer.
18850 2002-05-07 Ravi Pratap <ravi@ximian.com>
18852 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18853 when we are in an explicit context.
18855 (ConvertReferenceExplicit): When converting from Iface type S to Class
18856 T make sure the rules are implemented as an OR.
18858 * parameter.cs (ParameterType): Make it a property for now although the
18859 purpose really isn't anything immediate.
18861 * expression.cs (Is*Applicable): Do better checking on the parameter type
18862 of a ref/out parameter. The ones from the system assemblies are already
18863 marked with the correct type so we don't need to do any correction.
18865 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18866 the object type is standard too so include that.
18868 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18870 * ecore.cs (StandardConversionExists): Augment with missing code:
18871 deal with IntConstant, LongConstants and Enumerations.
18873 * assign.cs: Report the error, instead of failing silently
18875 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18876 typecontainer that they are declared, because the
18877 typecontainer/namespace will have the list of using clauses that
18878 need to be applied.
18880 Assembly Attributes were escaping the normal registration
18883 (EmitCode): Apply attributes within an EmitContext that represents
18884 the container they were declared on.
18886 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18888 2002-05-06 Ravi Pratap <ravi@ximian.com>
18890 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18891 Revamp completely - make much cleaner as we now operate only
18894 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18895 to implement the logic detailed in the spec more correctly.
18897 (UserDefinedConversion): Update accordingly.
18899 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18901 * statement.cs: Return flow analysis information up.
18903 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18906 (token): Do not consume an extra character before calling
18909 2002-05-06 Piers Haken <piersh@friskit.com>
18911 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18913 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18915 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18916 EmitContext during the instance constructor initializer
18917 resolution, to stop access to instance variables.
18919 This is mandated by the spec, last paragraph of the `constructor
18920 initializers' section.
18922 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18924 * cs-parser.jay, class.cs (Accessor): new class used to represent
18925 an accessor (get or set). In the past we used `null' to represent
18926 a missing accessor. But this is ambiguous because there was no
18927 way to tell in abstract indexers/properties if one of them was
18930 Now there is a way of addressing that.
18932 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18933 instead of FindMembers.
18935 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18936 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18938 * attribute.cs: Treat indexers and properties as the same in terms
18939 of applying attributes
18941 * ecore.cs (FindMostEncompassedType): Use statically initialized
18942 EmptyExpressions()s like we do elsewhere to avoid creating useless
18943 objects (and we take this out of the tight loop).
18945 (GetConversionOperators): Move the code to extract the actual
18946 operators to a separate routine to clean things up.
18948 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18950 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18951 events are always registered FieldBuilders.
18953 * class.cs (FieldBase): New class shared by Fields
18955 * delegate.cs: If we are a toplevel delegate, use our full name.
18956 If we are a nested delegate, then only use our tail name.
18958 2002-05-02 Ravi Pratap <ravi@ximian.com>
18960 * expression.cs (IsApplicable): Ensure that we add the "&" to
18961 ref/out types before comparing it with the type of the argument.
18963 (IsParamsMethodApplicable): Ditto.
18965 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18968 * delegate.cs : Handle the case when we have more than one applicable
18969 method. Flag an error only when we finish checking all.
18971 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18973 * expression.cs: Add support for boolean static initializers.
18975 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18977 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18979 * parameter.cs (ComputeParameterTypes,
18980 ComputeAndDefineParameterTypes): Better error handling: now we
18981 clear the `types' cache if we fail during any of the type lookups.
18982 We also return the status code correctly to our caller
18984 * delegate.cs: If we fail to define a delegate, abort the extra
18987 * expression.cs (Binary.ResolveOperator): for
18988 operator==(object,object) and operator !=(object, object) we also
18989 have to verify that there is an implicit conversion from one to
18992 (ArrayAccess.DoResolve): Array Access can operate on
18995 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18997 * assign.cs (CompoundAssign): A new class used as a "flag" that
18998 the assignment actually is happening as part of a compound
18999 assignment operator.
19001 During compound assignment, a few new rules exist to enable things
19008 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19009 to the type of x) if y is implicitly convertible to the type of x,
19010 and the operator is a builtin operator and the return type of the
19011 operator is explicitly convertible to the type of x.
19013 * rootcontext.cs: Reset warning level to 2. 4 catches various
19014 "interesting" features in mcs, we must clean this up at some
19015 point, but currently am trying to kill other bugs ;-)
19017 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19018 in container classes as well.
19020 * expression.cs (Binary.ResolveOperator): Handle string case
19021 before anything else (as operator overloading does emit an error
19022 before doing anything else).
19024 This code could go away when we move to a table driven model, but
19025 i could not come up with a good plan last night.
19027 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
19029 * typemanager.cs (CSharpName): reimplementation using regex.
19030 * class.cs: added null check for fields in Emit
19031 * rootcontext.cs: set warninglevel to 4
19033 2002-04-29 Miguel de Icaza <miguel@ximian.com>
19035 * typemanager.cs (CSharpName): reimplemented with Lupus
19038 2002-04-28 Miguel de Icaza <miguel@ximian.com>
19040 * statement.cs (If): correclty implement Resolve, because we were
19041 not catching sem errors in there. The same process is needed
19043 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19046 (Statement.Warning_DeadCodeFound): Factorize code.
19047 (While): Report dead code here too.
19049 (Statement): Added Resolve virtual method to allow
19050 for resolution split from the emit code.
19052 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19054 * statement.cs (EmitBoolExpression): No longer try to resolve the
19056 (MakeBoolean): New utility function that resolve, implicitly
19057 converts to boolean and tags the expression.
19060 (If, Do): Implement dead code elimination.
19061 (While): Implement loop inversion
19063 (Do, While, For, If): Resolve the expression prior to calling our
19066 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19069 - added method Report28 (warning: program has more than one entry point)
19070 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19071 - modified method Method.Define, the part at the end of the method
19073 * rootcontext.cs: added static public Location EntryPointLocation;
19075 * ../errors/cs0028.cs : Add test case for the above warning.
19078 - modified method CSharpName to allow arrays of primitive type to
19079 be printed nicely (e.g. instead of System.Int32[][] it now prints
19081 - added method CSharpSignature: returns the signature of a method
19082 in string format to be used in reporting errors, warnings, etc.
19084 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19087 2002-04-26 Ravi Pratap <ravi@ximian.com>
19089 * delegate.cs (Define): Fix extremely silly bug where I was
19090 setting the type of the 'object' parameter of the BeginInvoke
19091 method to System.IAsyncResult instead of System.Object ;-)
19093 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19095 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19098 (Constructor.Emit): return if we fail to initialize the
19099 constructor. Another door closed!
19101 * expression.cs (New.DoResolve): Improve error message (from -6 to
19102 1501). Use DeclaredOnly lookup to find the exact constructor.
19104 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19105 loop. This is useful.
19107 * cs-parser.jay: Adjust the default parameters so that destructors
19108 have the proper signature.
19110 2002-04-26 Martin Baulig <martin@gnome.org>
19112 * driver.cs (LoadAssembly): If `assembly' contains any characters
19113 which are only valid in path names and not in assembly names
19114 (currently slash, backslash and point), use Assembly.LoadFrom ()
19115 instead of Assembly.Load () on the `assembly' (before iteration
19116 over the link_paths).
19118 2002-04-26 Martin Baulig <martin@gnome.org>
19120 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19122 2002-04-25 Miguel de Icaza <miguel@ximian.com>
19124 * class.cs (Property): use the new typemanager.MemberLookup
19126 (TypeContainer.MemberLookup): Implement using the
19127 TypeManager.MemberLookup now.
19129 * typemanager.cs: Make MemberLookup a function of the TypeManager,
19130 and return MemberInfos, so that these can be used without an
19131 EmitContext (what we had before).
19133 2002-04-24 Miguel de Icaza <miguel@ximian.com>
19135 * expression.cs: Fix the case where the argument to params if the
19136 type of the params. I omitted handling this before. Fixed
19138 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19140 * driver.cs: Call BootCorlib_PopulateCoreType
19142 * class.cs (Property.CheckBase): Check for properties only, not
19145 * interface.cs: Temporary hack: try/catch around the
19146 CustomAttributeBuilder, because I am getting an exception that I
19149 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19150 types whose definitions are required to be there (attributes are
19151 defined before standard types).
19153 Compute definitions as we boot the various types, as they are used
19154 immediately (value_type class will need object_type, but if we do
19155 not initialize object_type, we will pass a null, which will let
19156 the runtime pick the System.Object from the existing corlib, which
19157 is not what we want).
19159 2002-04-22 Patrik Torstensson <totte@labs2.com>
19161 * cs-tokenizer.cs: fixed a number of trim() issues.
19163 2002-04-22 Ravi Pratap <ravi@ximian.com>
19165 * expression.cs (Argument.Type): Ensure that we return the correct
19166 type when we have out or ref parameters [in which case we
19169 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19171 * class.cs (Property, Indexer): Allow extern modifier in there.
19173 * typemanager.cs (InitBaseTypes): Initializes object_type and
19174 value_type, since those will be used early on during the bootstrap
19175 process to compile corlib.
19177 (InitCoreTypes): Move code from here to InitBaseTypes.
19179 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19181 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19182 single-dimension arrays as using the ldlen opcode.
19184 Daniel Lewis discovered this optimization.
19186 * typemanager.cs: Add signature for System.Array::get_Length
19188 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19190 * statement.cs: report the error when the foreach does not apply to an
19191 array nor a collection.
19193 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19195 * expression.cs: Add implicit conversions to the operator ~.
19197 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19199 * typemanager.cs: Locate the decimal constructor.
19201 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19203 * attribute.cs: use the new property of TypeOf.
19204 * expression.cs: added 'get' property around typearg.
19206 These changes fix a build breaker reported by NickD. Is this the
19207 correct way to fix? If not, please, revert my changes and make it
19210 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19212 * attribute.cs: Add support for typeof in attribute invocations.
19213 I am not sure that this is right though.
19215 2002-04-14 Duncan Mak <duncan@ximian.com>
19217 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19218 Binary.Operator.Division case.
19220 2002-04-13 Ravi Pratap <ravi@ximian.com>
19222 * class.cs (DefineType): Ensure that we do a proper check on
19223 attribute types and also register it with the TypeManager.
19225 (TypeContainer.Targets): The default for attribute types is
19226 AttributeTargets.All.
19228 * attribute.cs (ApplyAttributes): Registering the attribute type
19229 is done elsewhere, not when we discover we have a Usage attribute.
19231 2002-04-12 Ravi Pratap <ravi@ximian.com>
19233 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19234 and get rid of is_delegate parameter.
19236 * everywhere : update.
19238 2002-04-12 Ravi Pratap <ravi@ximian.com>
19240 * cs-parser.jay (compilation_unit): Revamp completely to use
19241 some new ideas that I got from Rhys' grammar to solve the problems
19242 with assembly level attributes.
19244 (outer_declaration): New grammar production.
19246 (attribute_sections): Add.
19248 (opt_attributes): Base on attribute_sections
19250 (namespace_declaration): Allow opt_attributes to tackle the case
19251 when we have assembly level attributes - we are clever in this
19254 * attribute.cs (ApplyAttributes): Do not worry about assembly
19255 attributes in the non-global context.
19257 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19258 instead of SetGlobalAttributes.
19260 * class.cs, rootcontext.cs : Ensure we define and generate
19261 attribute types before anything else.
19263 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19264 and flag the new error -20 for the case when the attribute type
19265 does not have valid targets specified. csc does not catch this.
19267 * ../errors/errors.txt : update for error # -20
19269 2002-04-11 Ravi Pratap <ravi@ximian.com>
19271 * support.cs (InternalParameters.ParameterModifier): Do some null
19272 checking and return sane values.
19274 * class.cs (Method.Define): If we are a PInvoke method, ensure
19275 that we are static and extern. Report error # 601
19277 * ../errors/cs0601.cs : Add test case for the above error.
19279 2002-04-07 Ravi Pratap <ravi@ximian.com>
19281 * rootcontext.cs (attribute_types): We need to keep type of
19282 all attribute types separately and emit code for them first.
19284 (RegisterAttribute) : Implement.
19286 * class.cs (DefineType): Check if the current Type is a custom
19287 attribute type and register it accordingly.
19289 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19290 adding the first attribute twice and rename to
19292 (SetGlobalAttributes): this.
19294 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19297 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19298 if we are processing global arguments. Hmm, I am unsure of this.
19300 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19302 * expression.cs: added static array of strings to avoid calling
19303 Enum.ToString () for Operator in Binary. Significant recover of
19306 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19308 * class.cs (FindMembers): Allow the Builders of the various
19309 members to be null. If they are skip them. This only happens
19310 during the PInvoke declaration.
19312 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19314 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19315 failure, so we do not keep going afterwards.
19317 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19318 wanted to pass `false' as the `is_delegate' argument. If this is
19319 the case, why not use delegate_type == null to mean `is_delegate =
19320 false' and anything else as is_delegate = true.
19322 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19324 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19325 code for the section, not the beginning of the tests.
19327 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19329 * cfold.cs: Handle operator + (Enum x, Underlying x)
19331 * expression.cs (Binary): same. Warn about errors where we have
19332 Enum/Enum in operator + as well.
19334 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19337 - added support for switch(bool)
19338 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19339 - add TableSwitchEmit() to handle table-based switch statements
19341 2002-04-05 Ravi Pratap <ravi@ximian.com>
19343 * expression.cs (Invocation.OverloadResolve): Factor out code which
19344 does parameter compatibility checking with arguments so that we can
19345 re-use the code even from Delegate.VerifyApplicability
19347 (VerifyArgumentsCompat): Move above code here.
19349 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19350 and instead make a call to the above method.
19352 2002-03-31 Ravi Pratap <ravi@ximian.com>
19354 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19355 We use it to keep track of classes which are attribute types.
19357 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19359 * delegate.cs (Delegate.Define): Correctly define the types in the
19360 presence of fixed and array parameters.
19362 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19365 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19366 include NonPublic after the first iteration.
19368 * class.cs (Indexer.CheckBase): Only check if both parents are
19371 * cs-parser.jay (accessor_body): If empty, set to null.
19373 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19374 same code path here to resolve constants names that we did have in
19375 MemberAccess.DoResolve. There is too much code duplicated here.
19377 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19379 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19381 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19384 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19385 tokens, numbers and strings.
19387 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19390 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19391 asyncronous parameters and the regular parameters.
19393 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19394 specify the target directory.
19396 * expression.cs: (This.DoResolve): Simplify
19397 (As.Emit): Optimize, do not generate IsInst if the expression is
19398 always of the given type.
19400 (Is.DoResolve): Bug fix, we were reporting both always/never for
19403 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19404 creating too many unnecessary arrays.
19406 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19408 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19409 fields instead of rolling our own initializer. Takes care of all
19410 implicit conversions, and drops unnecessary static checks/argument.
19412 2002-03-31 Dick Porter <dick@ximian.com>
19414 * driver.cs: use the GetDirectories() return values properly, and
19415 use "/" as path separator.
19417 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19419 * expression.cs (Unary): Optimize - - expr into expr.
19420 (Binary): Optimize a + (-b) into a -b.
19422 * codegen.cs (CodeGen): Made all methods static.
19424 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19428 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19429 TypeBuilder property.
19431 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19434 * tree.cs: Removed the various RecordXXXX, and replaced with a
19435 single RecordDecl. Removed all the accessor methods, and just
19436 left a single access point Type
19438 * enum.cs: Rename DefineEnum to DefineType.
19440 * decl.cs: New abstract method `DefineType' used to unify the
19441 Defines for Enumerations, Interfaces, TypeContainers and
19444 (FindType): Moved LookupInterfaceOrClass here. Moved the
19445 LookupBaseClasses method that used to live in class.cs and
19446 interface.cs here, and renamed to FindType.
19448 * delegate.cs: Implement DefineType. Take advantage of the
19449 refactored pattern for locating the parent builder without taking
19450 the parent_builder argument (which we know does not work if we are
19451 nested, and triggering a toplevel definition).
19453 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19455 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19456 accessibility of a member has changed during override and report
19459 * class.cs (Method.Define, Property.Define): Only complain on
19460 overrides if the method is private, any other accessibility is
19461 fine (and since we just checked the permission is the same, we are
19464 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19465 and elif are processed always. The other pre-processing
19466 directives are only processed if we are "taking" the path
19468 2002-03-29 Martin Baulig <martin@gnome.org>
19470 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19471 current location is not Null.
19473 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19474 a separate method so we can profile it.
19476 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19477 `span.Seconds' are just seconds, but no minutes or hours.
19478 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19480 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19482 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19483 Remove the gratuitous set of Final:
19485 // If an interface implementation, then we can set Final.
19486 if (((flags & MethodAttributes.Abstract) == 0) &&
19487 implementing.DeclaringType.IsInterface)
19488 flags |= MethodAttributes.Final;
19490 I do not know what I was smoking when I used that.
19493 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19494 step into fixing the name resolution issues for delegates and
19495 unifying the toplevel name resolution.
19497 2002-03-28 Martin Baulig <martin@gnome.org>
19499 * class.cs (Method.Emit): If we have a symbol writer, call its
19500 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19501 tell it about the current method.
19503 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19504 writer that we're going to emit the first byte of IL code for a new
19505 statement (a new source line).
19506 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19507 EmitContext.Mark() before emitting any code.
19509 * location.cs (SymbolDocument): Return null when we're Null.
19511 * statement.cs (Statement): Moved the `Location loc' variable here.
19512 (Statement.EmitBoolExpression): If we have a symbol writer, call
19513 ec.Mark() before emitting any code to tell it that we're at the
19514 beginning of a new statement.
19515 (StatementExpression): Added `Location' argument to the constructor.
19516 (Block): Added public readonly variable `StartLocation' and public
19517 variable `EndLocation'. The latter is to be set using SetEndLocation().
19518 (Block): Added constructor which takes a start and end location.
19519 (Block.SetEndLocation): New method. This sets the end location.
19520 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19521 local variables we create.
19522 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19523 each statement and do also mark the begin and end of the block.
19525 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19526 tell it the current lexer.Location, use Location.Null for the end of the
19528 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19529 current block, set its end location using SetEndLocation().
19530 (statement_expression): StatementExpression constructor now takes the
19531 lexer.Location as additional argument.
19532 (for_statement, declare_local_variables): Likewise.
19533 (declare_local_variables): When creating a new implicit block, use the
19534 new Block constructor and pass it the lexer.Location.
19536 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19538 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19539 members also on the parent interfaces recursively.
19541 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19543 * report.cs: Use new formats, since Gonzalo finished the missing
19546 * expression.cs (Binary.ResolveOperator): added missing operator|
19547 operator& and operator^ for bool/bool.
19549 * cs-parser.jay: CheckDef now takes a Location argument that is
19550 used to report errors more precisly (instead of reporting the end
19551 of a definition, we try to track something which is a lot closer
19552 to the source of the problem).
19554 * cs-tokenizer.cs: Track global token use, so we can properly flag
19555 the use of #define/#undef after the first token has been seen.
19557 Also, rename the reportXXXX to Error_DescriptiveName
19559 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19560 TypeContainer, so that Enum and Interface can use this too.
19562 * class.cs (TypeContainer.LookupInterfaceOrClass,
19563 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19564 `builder' argument. Typically this was used to pass the parent
19565 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19568 The problem is that a nested class could trigger the definition of
19569 a toplevel class, and the builder would be obviously wrong in that
19572 So we drop this argument, and we compute dynamically the
19573 TypeBuilder/ModuleBuilder (the correct information was available
19574 to us anyways from DeclSpace.Parent)
19576 * interface.cs (Interface.DefineInterface): Drop builder
19577 parameter cleanup like class.cs
19579 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19582 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19585 (Try.Emit): Propagate the returns value from the statement.
19587 (Return.Emit): Even if we are leavning
19589 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19591 * modifiers.cs: Fix the computation of MethodAttributes flags.
19593 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19595 * driver.cs: allow compilation of files that start with '/'.
19596 Add a default case when checking the argument of --target.
19598 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19600 * interface.cs: Implement the same search algorithm for types in
19601 the interface code.
19603 * delegate.cs: Do not allow multiple definition.
19605 * Recovered ChangeLog that got accidentally amputated
19607 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19609 * rootcontext.cs: Load manually enum to allow core classes to
19610 contain enumerations.
19612 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19613 Update to new static methods in TypeManager.
19615 * typemanager.cs (GetMethod, GetConstructor): Use our
19616 implementation of FindMembers to find the members, since during
19617 corlib compilation, the types are TypeBuilders and GetMethod and
19618 GetConstructor do not work.
19620 Make all methods in TypeManager static.
19622 (InitCodeHelpers): Split the functionality from
19623 the InitCodeTypes function.
19625 * driver.cs: Call InitCodeHelpers after we have populated the
19628 * cs-parser.jay (delegate_declaration): we did not used to compute
19629 the delegate name correctly for void delegates.
19631 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19633 * rootcontext.cs (RootContext): Init the interface_resolve_order
19634 and type_container_resolve_order always.
19636 (ResolveCore, BootstrapCorlib_ResolveClass,
19637 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19638 compiler when compiling with --nostdlib
19640 * class.cs (TypeContainer.DefineType): Check that our parent is
19641 not null. This test is most important when we are bootstraping
19644 * codegen.cs: Split out the symbol writing code.
19646 2002-03-25 Martin Baulig <martin@gnome.org>
19648 * driver.cs (-g): Made -g an alias for --debug.
19650 2002-03-24 Martin Baulig <martin@gnome.org>
19652 * codegen.cs (SymbolWriter): New public variable. Returns the
19653 current symbol writer.
19654 (CodeGen): Added `bool want_debugging_support' argument to the
19655 constructor. If true, tell the ModuleBuild that we want debugging
19656 support and ask it for the ISymbolWriter.
19657 (Save): If we have a symbol writer, call it's Close() method after
19658 saving the assembly.
19660 * driver.c (--debug): New command line argument to create a
19661 debugger information file.
19663 * location.cs (SymbolDocument): New public property. Returns an
19664 ISymbolDocumentWriter object for the current source file or null
19665 if we don't have a symbol writer.
19667 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19669 * driver.cs (LoadAssembly): Correctly return when all the paths
19670 have been tried and not before.
19672 * statement.cs (Switch.Emit): return the actual coverage for this
19673 statement (returns/not-returns)
19675 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19676 switch of the statement if we are the last switch section. That
19677 kills two problems: try/catch problems (we used to emit an empty
19678 nop at the end) and switch statements where all branches would
19681 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19683 * driver.cs: Add default assemblies (the equivalent to the
19684 Microsoft CSC.RSP file)
19686 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19687 also update tokens_seen and set it to false.
19689 * driver.cs: Implement --recurse for Mike.
19691 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19692 correctly splitting out the paths.
19694 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19696 * interface.cs (Interface.PopulateProperty): Instead of using
19697 `parent' as the declaration space for the set parameters, use
19700 * support.cs (InternalParameters): InternalParameters constructor
19701 takes a DeclSpace instead of a TypeContainer.
19703 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19704 types are being initialized, load the address of it before calling
19707 (New): Provide a mechanism to disable the generation of local
19708 value type temporaries when the caller will be providing us with
19709 an address to store it.
19711 (ArrayCreation.EmitDynamicInitializers): Use it.
19713 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19715 * expression.cs (Invocation.EmitArguments): Only probe for array
19716 property if there is more than one argument. Sorry about that.
19718 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19719 empty param arrays.
19721 * class.cs (Method.LabelParameters): Fix incorrect code path that
19722 prevented the `ParamArrayAttribute' from being applied to the
19725 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19727 * support.cs (ReflectionParameters): Correctly compute whether the
19728 last argument is a params array. Fixes the problem with
19731 * typemanager.cs: Make the assemblies array always be non-null
19732 (empty, but non-null)
19734 * tree.cs (RecordDecl): New function that abstracts the recording
19735 of names. This reports error 101, and provides a pointer to the
19736 previous declaration. Fixes a crash in the compiler.
19738 * cs-parser.jay (constructor_declaration): Update to new grammar,
19739 and provide a constructor_body that can be empty.
19741 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19743 * driver.cs: Add support for --resources.
19745 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19746 Make all types for the various array helper methods be integer.
19748 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19749 CheckState to ConvCast.
19751 (ConvCast): Now it takes a `checked' state argument, to avoid
19752 depending on the emit context for the conversion, and just using
19753 the resolve time setting.
19755 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19756 instead of Invocation.EmitArguments. We do not emit the original
19757 arguments, instead we emit those which have been converted to
19758 unsigned int expressions.
19760 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19762 * codegen.cs: ditto.
19764 * expression.cs (LocalVariableReference): Drop the use of the
19765 Store function that depended on the variable index.
19767 * statement.cs (VariableInfo): Drop the `Idx' property from this
19768 class, as this is not taking into account the indexes for
19769 temporaries tat we generate during the execution, getting the
19772 * class.cs: First emit class initializers, then call the parent
19775 * expression.cs (Binary): Fix opcode emision.
19776 (UnaryMutator.EmitCode): Support checked code generation
19778 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19779 matches for events for both the Static and Instance scans,
19780 pointing to the same element. Fix that.
19782 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19784 * rootcontext.cs (ResolveTree): Always set the
19785 interface_resolve_order, because nested interfaces will be calling
19788 * class.cs (GetInterfaceOrClass): Track the same resolution
19789 process used by TypeManager.LookupType. This fixes the nested
19790 type lookups in class declarations (separate path from
19793 (TypeContainer.DefineType): Also define nested interfaces.
19794 (TypeContainer.RegisterOrder): New public function used to
19795 register the order in which child interfaces need to be closed.
19797 Nested interfaces need to be closed after their parents have been
19800 * interface.cs (InterfaceAttr): Put all the logic for computing
19801 the interface attribute here.
19803 (DefineInterface): Register our interface order with the
19804 RootContext or with the TypeContainer depending on the case.
19806 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19808 * cs-parser.jay: rework foreach statement to work with the new
19809 changes to the policy on SimpleNames.
19811 * report.cs: support Stacktrace on warnings as well.
19813 * makefile: drop --unsafe and /unsafe from the compile.
19815 2002-03-13 Ravi Pratap <ravi@ximian.com>
19817 * ecore.cs (StandardConversionExists): Modify to take an Expression
19818 as the first parameter. Ensure we do null -> reference type conversion
19821 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19822 temporary Expression objects.
19824 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19826 * interface.cs: workaround bug in method overloading resolution
19827 (there is already a bugzilla bug for it).
19829 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19831 We could also solve this problem by having a separate path for
19832 performing type lookups, instead of DoResolve, we could have a
19833 ResolveType entry point, and only participating pieces of the
19834 production (simplename, deref, array) would implement this.
19836 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19837 signal SimpleName to only resolve type names and not attempt to
19838 resolve anything else.
19840 * expression.cs (Cast): Set the flag.
19842 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19844 * class.cs: Only report 108 if there is no `new' modifier.
19846 * cs-parser.jay: rework foreach statement to work with the new
19847 changes to the policy on SimpleNames.
19849 * report.cs: support Stacktrace on warnings as well.
19851 * makefile: drop --unsafe and /unsafe from the compile.
19853 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19855 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19856 lookups here, instead of doing that at parse time. This means
19857 that our grammar will not introduce `LocalVariableReferences' as
19858 expressions at this point. That solves the problem of code like
19862 static void Main ()
19866 This is only half the fix. The full fix requires parameters to
19867 also be handled in this way.
19869 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19870 makes the use more obvious of the DeclSpace. The
19871 ec.TypeContainer.TypeBuilder is now only used to pull the
19872 TypeBuilder for it.
19874 My theory is that I can get rid of the TypeBuilder completely from
19875 the EmitContext, and have typecasts where it is used (from
19876 DeclSpace to where it matters).
19878 The only pending problem is that the code that implements Aliases
19879 is on TypeContainer, and probably should go in DeclSpace.
19881 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19882 lookups here, instead of doing that at parse time. This means
19883 that our grammar will not introduce `LocalVariableReferences' as
19884 expressions at this point. That solves the problem of code like
19888 static void Main ()
19892 This is only half the fix. The full fix requires parameters to
19893 also be handled in this way.
19895 * class.cs (Property.DefineMethod): When implementing an interface
19896 method, set newslot, when implementing an abstract method, do not
19897 set the flag (before we tried never setting it, or always setting
19898 it, which is the difference).
19899 (Indexer.DefineMethod): same.
19900 (Method.DefineMethod): same.
19902 * ecore.cs: Only set the status used flag if we get back a Field.
19904 * attribute.cs: Temporary hack, so Paolo can keep working.
19906 2002-03-08 Ravi Pratap <ravi@ximian.com>
19908 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19909 the unmanaged type in the case we have a MarshalAs attribute.
19911 (Resolve): Handle the case when we are parsing the special MarshalAs
19912 attribute [we need to store the unmanaged type to use later]
19914 * typemanager.cs (marshal_as_attr_type): Built in type for the
19915 MarshalAs Attribute.
19917 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19918 on parameters and accordingly set the marshalling info.
19920 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19922 * class.cs: Optimizing slightly by removing redundant code after
19923 we switched to the `NoTypes' return value.
19924 (Property.DefineMethod): use NoTypes here too.
19926 This fixes the bug I introduced in my last batch of changes.
19928 2002-03-05 Ravi Pratap <ravi@ximian.com>
19930 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19932 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19933 Enums since those are types too.
19935 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19937 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19938 thanks to a call during the lookup process.
19940 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19942 * statement.cs (Foreach): Lots of work to accomodate a particular
19943 kind of foreach statement that I had not kept in mind. It is
19944 possible to have foreachs on classes that provide a GetEnumerator
19945 method that return objects that implement the "pattern" for using
19946 a foreach, there is no need to support GetEnumerator
19949 This is needed to compile nant.
19951 * decl.cs: Only report 114 if the member is not `Finalize' and if
19952 the warning level is at least 2.
19954 * class.cs: Moved the compare function from Method to
19957 (MethodSignature.InheritableMemberSignatureCompare): Add new
19958 filter function that is used to extract inheritable methods from a
19961 (Method.Define): Use the new `inheritable_method_signature_filter'
19964 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19967 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19969 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19971 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19973 * expression.cs: Pass location information to
19974 ConvertImplicitStandard.
19976 * class.cs: Added debugging code to track return values from
19979 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19981 * expression.cs (Is.DoResolve): If either side of the `is' is an
19982 interface, do not flag the warning.
19984 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19987 * report.cs: Allow for --fatal to be used with --probe.
19989 * typemanager.cs (NoTypes): Move the definition for the empty Type
19992 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19994 (TypeContainer.DefineProxy): New function used to proxy to parent
19995 implementations when implementing interfaces.
19996 (TypeContainer.ParentImplements): used to lookup if our parent
19997 implements a public function that is required by an interface.
19998 (TypeContainer.VerifyPendingMethods): Hook this up.
20000 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20001 `modules' and `assemblies' arraylists into arrays. We only grow
20002 these are the very early start up of the program, so this improves
20003 the speedof LookupType (nicely measured).
20005 * expression.cs (MakeByteBlob): Replaced unsafe code with
20006 BitConverter, as suggested by Paolo.
20008 * cfold.cs (ConstantFold.Binary): Special case: perform constant
20009 folding of string concatenation, but if either side is a string,
20010 and the other is not, then return null, and let the runtime use
20011 the concatenation on the string plus the object (using
20012 `Object.ToString').
20014 2002-03-04 Miguel de Icaza <miguel@ximian.com>
20016 Constant Folding has been implemented now.
20018 * expression.cs (Unary.Reduce): Do not throw an exception, catch
20019 the error instead on types that are not supported in one's
20022 * constant.cs (Constant and all children): New set of functions to
20023 perform implict and explicit conversions.
20025 * ecore.cs (EnumConstant): Implement the new functions to perform
20026 conversion by proxying to the child expression.
20028 * codegen.cs: (ConstantCheckState): Constant evaluation has its
20029 own separate setting that can not be turned off from the command
20030 line using --unchecked or --checked and is only controlled using
20031 the checked/unchecked statements and expressions. This setting is
20032 used by the constant folder to flag errors.
20034 * expression.cs (CheckedExpr, UncheckedExpr): Set the
20035 ConstantCheckState as well.
20037 During Resolve, they also have to flag the state, because the
20038 constant folder runs completely in the Resolve phase.
20040 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20043 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20045 * cfold.cs: New file, this file contains the constant folder.
20047 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20048 argument to track whether we are using the resulting address to
20049 load or store a value and provide better error messages.
20051 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20052 new AddressOf arguments.
20054 * statement.cs (Foreach.EmitCollectionForeach): Update
20056 * expression.cs (Argument.Emit): Call AddressOf with proper
20057 arguments to track usage.
20059 (New.DoEmit): Call AddressOf with new arguments.
20061 (Unary.Emit): Adjust AddressOf call.
20063 2002-03-01 Ravi Pratap <ravi@ximian.com>
20065 * cs-parser.jay (member_access): Change the case for pre-defined types
20066 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20069 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20072 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20073 essentially like methods and apply attributes like MethodImplOptions to them too.
20075 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20078 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20079 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20082 * Update code everywhere accordingly.
20084 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20086 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20088 2002-02-28 Ravi Pratap <ravi@ximian.com>
20090 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20091 try performing lookups against those instead of jumping straight into using
20092 the 'using' clauses.
20094 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20096 (LookupType): Perform lookups in implicit parents too.
20098 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20099 sequence as RootContext.LookupType.
20101 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
20102 the various cases of namespace lookups into this method.
20104 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20106 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20107 in positional arguments)
20109 * class.cs (Operator): Update the AllowedModifiers to contain
20112 * cs-parser.jay: Update operator declaration to allow for the
20113 operator body to be empty.
20115 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20118 2002-02-27 Miguel de Icaza <miguel@ximian.com>
20120 * class.cs (Method.Emit): Label parameters.
20122 * driver.cs: Return 1 or 0 as the program exit code.
20124 2002-02-26 Miguel de Icaza <miguel@ximian.com>
20126 * expression.cs: Special case the `null' object when trying to
20127 auto-compute the type, as anything can be explicitly converted to
20130 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20131 spotting this Paolo.
20133 (Expression.ImplicitNumericConversion): Perform comparissions of
20134 the type using the underlying type in the case of an enumeration
20135 rather than using the enumeration type for the compare.
20137 Cope with the underlying == type case, which is not possible to
20140 (Expression.ConvertNumericExplicit): Perform comparissions of
20141 the type using the underlying type in the case of an enumeration
20142 rather than using the enumeration type for the compare.
20144 * driver.cs: If the user does not supply an extension, assume .exe
20146 * cs-parser.jay (if_statement): Rewrote so that we can track the
20147 location for the if statement.
20149 * expression.cs (Binary.ConstantFold): Only concat strings when
20150 the operation is "+", not everything ;-)
20152 * statement.cs (Statement.EmitBoolExpression): Take a location
20154 (If, While, Do): Track location.
20156 * expression.cs (Binary.ResolveOperator): In the object + string
20157 case, I was missing a call to ConvertImplicit
20159 2002-02-25 Ravi Pratap <ravi@ximian.com>
20161 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20162 Location arguments. Ensure we use RootContext.LookupType to do our work
20163 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20165 * interface.cs (PopulateMethod): Handle the type of the parameter being
20168 * expression.cs (Invocation.BetterFunction): Handle the case when we
20169 have a params method with no fixed arguments and a call is made with no
20172 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20174 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20175 the verbatim-string-literal
20177 * support.cs (InternalParameters.ParameterModifier): handle null
20179 (InternalParameters.ParameterType): ditto.
20181 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20182 duplicating the name of the variable parameter.
20183 (GetParameterByName): Fix bug where we were not looking up array
20184 paramters if they were the only present (thanks Paolo!).
20185 (GetParameterInfo): We only have an empty set of types if both
20186 fixed and array are set to null.
20187 (GetParameterInfo-idx): Handle FixedParameter == null
20189 * cs-parser.jay: Handle the case where there is no catch
20190 statements (missing null test).
20192 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20194 * driver.cs (MainDriver): Be conservative on our command line
20197 Catch DirectoryNotFoundException when calling GetFiles.
20199 (SplitPathAndPattern): Used to split the input specification into
20200 a path and a pattern that we can feed to Directory.GetFiles.
20202 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20204 * statement.cs (Fixed): Implement the last case of the Fixed
20205 statement (string handling).
20207 * expression.cs (StringPtr): New class used to return a char * to
20208 a string; Used by the Fixed statement.
20210 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20212 * expression.cs (Binary.ResolveOperator): Remove redundant
20213 MemberLookup pn parent type.
20214 Optimize union call, we do not need a union if the types are the same.
20215 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20218 Specialize the use of MemberLookup everywhere, instead of using
20219 the default settings.
20221 (StackAlloc): Implement stackalloc keyword.
20223 * cs-parser.jay: Add rule to parse stackalloc.
20225 * driver.cs: Handle /h, /help, /?
20227 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20228 before we supported unsafe code.
20230 * makefile: add --unsafe to the self compilation of mcs.
20232 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20234 * expression.cs (PointerArithmetic): New class that is used to
20235 perform pointer arithmetic.
20236 (Binary.Resolve): Handle pointer arithmetic
20237 Handle pointer comparission.
20238 (ArrayPtr): Utility expression class that is used to take the
20239 address of an array.
20241 (ElementAccess): Implement array access for pointers
20243 * statement.cs (Fixed): Implement fixed statement for arrays, we
20244 are missing one more case before we are done.
20246 * expression.cs (Indirection): Implement EmitAssign and set the
20247 ExprClass to Variable. This allows pointer dereferences to be
20248 treated as variables, and to have values assigned to them.
20250 * ecore.cs (Expression.StoreFromPtr): New utility function to
20251 store values dereferencing.
20253 2002-02-20 Ravi Pratap <ravi@ximian.com>
20255 * expression.cs (Binary.ResolveOperator): Ensure that we are
20256 not trying to operate on a void type - this fixes the reported
20259 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20260 the parent implementation is sealed.
20262 * ../errors/cs0239.cs : Add.
20264 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20266 * typemanager.cs (unverifiable_code_type): Corresponds to
20267 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20268 which have unsafe code in them.
20270 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20273 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20275 * cs-tokenizer.cs: Add support for @"litreal strings"
20277 Make tokenizer accept pre-processor directives
20278 on any column (remove the old C-like limitation).
20280 * rootcontext.cs (EmitCode): Emit any global attributes.
20281 (AddGlobalAttributes): Used to keep track of assembly attributes.
20283 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20285 * cs-parser.jay: Add support for global attributes.
20287 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20289 * expression.cs (Indirection): New helper class. Unary will
20290 create Indirection classes to be able to implement the
20291 IMemoryLocation interface on it.
20293 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20295 * cs-parser.jay (fixed_statement): reference the right statement.
20297 * statement.cs (Fixed.Emit): Finish implementing the fixed
20298 statement for the &x case.
20300 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20302 * class.cs (Property.Define, Method.Define): Remove newslot when
20305 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20306 wrong. NewSlot should only be used if the `new' keyword is present.
20308 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20309 locating our system dir. Sorry about this.
20311 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20313 * driver.cs (GetSystemDir): Compute correctly the location of our
20314 system assemblies. I was using the compiler directory instead of
20315 the library directory.
20317 2002-02-13 Ravi Pratap <ravi@ximian.com>
20319 * expression.cs (BetterFunction): Put back in what Miguel commented out
20320 since it is the correct fix. The problem is elsewhere ;-)
20322 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20323 parameters of the parms method are themselves compatible or not !
20325 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20326 to check that a class implements an interface before saying that an implicit
20327 conversion was allowed. Use ImplementsInterface to do the checking.
20329 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20331 * class.cs (Method.Define): Track whether we are an explicit
20332 implementation or not. And only call DefineMethodOverride if we
20333 are an explicit implementation.
20335 (Property.DefineMethod): Ditto.
20337 2002-02-11 Ravi Pratap <ravi@ximian.com>
20339 * expression.cs (BetterFunction): Catch hideous bug which was
20340 preventing us from detecting ambiguous calls due to implicit casts i.e
20343 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20345 * support.cs (Pair): Remove un-needed method. I figured why I was
20346 getting the error in cs-parser.jay, the variable in a foreach loop
20347 is readonly, and the compiler does not really treat this as a variable.
20349 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20350 instead of EQUALS in grammar.
20352 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20354 * expression.cs (Unary.DoResolve): Check whether the argument is
20357 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20359 * support.cs: Api for Pair to set a value. Despite the fact that
20360 the variables are public the MS C# compiler refuses to compile
20361 code that accesses the field if the variable is part of a foreach
20364 * statement.cs (Fixed): Begin implementation of the fixed
20367 (Block.AddVariable): Return the VariableInfo on success and null
20368 on failure instead of true/false.
20370 * cs-parser.jay (foreach): Catch errors on variables already
20371 defined (we were ignoring this value before) and properly unwind
20372 the block hierarchy
20374 (fixed_statement): grammar for the fixed statement.
20376 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20378 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20379 pointer types to be incretemented.
20381 (SizeOf): Implement.
20383 * cs-parser.jay (pointer_member_access): Implement
20384 expr->IDENTIFIER production.
20386 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20387 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20390 (Unary): Implement indirection.
20392 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20393 use in non-unsafe context).
20395 (SimpleName.DoResolve): Check for pointers in field access on safe
20398 (Expression.LoadFromPtr): Factor the load-indirect code in this
20399 function. This was duplicated in UnboxCast and ParameterReference
20401 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20403 * expression.cs (ComposedCast): report an error if a pointer cast
20404 is used in a safe region.
20406 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20407 pointer type casts in unsafe context.
20409 * codegen.cs (EmitContext): Set up IsUnsafe.
20411 * cs-parser.jay (non_expression_type): Add productions for pointer
20414 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20415 code. We should not use force into static mode if the method is
20416 not virtual. Fixes bug in MIS
20418 * statement.cs (Do.Emit, While.Emit, For.Emit,
20419 Statement.EmitBoolExpression): Add support to Do and While to
20420 propagate infinite loop as `I do return' semantics.
20422 Improve the For case to also test for boolean constants.
20424 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20425 to the list of attributes we can add.
20427 Remove `EmitContext' argument.
20429 * class.cs (Method.Define): Apply parameter attributes.
20430 (Constructor.Define): Apply parameter attributes.
20431 (MethodCore.LabelParameters): Move here the core of labeling
20434 * support.cs (ReflectionParameters.ParameterModifier,
20435 InternalParameters.ParameterModifier): Use IsByRef on the type and
20436 only return the OUT bit for these parameters instead of in/out/ref
20439 This is because I miss-understood things. The ParameterInfo.IsIn
20440 and IsOut represent whether the parameter has the [In] and [Out]
20443 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20445 * ecore.cs (FieldExpr.Emit): Release temporaries.
20447 * assign.cs (LocalTemporary.Release): new function.
20449 * codegen.cs (EmitContext.GetTemporaryStorage,
20450 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20451 temporary storage. Now we can "put back" localbuilders when we
20454 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20456 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20457 need to make a copy of the variable to generate verifiable code.
20459 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20461 * driver.cs: Compute dynamically the system directory.
20463 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20464 Slower, but more generally useful. Used by the abstract
20465 registering implementation.
20467 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20468 the rules for the special rule on Type/instances. First check if
20469 we have the same name, and if so, try that special static path
20470 rather than the instance path.
20472 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20474 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20477 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20478 Enum, ValueType, Delegate or Array for non-corlib compiles.
20480 * cs-tokenizer.cs: Catch long identifiers (645)
20482 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20485 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20486 fix, we were returning too early, so we were not registering
20487 pending methods from abstract classes.
20489 Do not register pending methods if the class is abstract.
20491 * expression.cs (Conditional.DoResolve): Report circular implicit
20492 conversions when we neecd to compute it for conditional
20495 (Is.DoResolve): If the expression is always of the provided type,
20496 flag warning 183. If the expression can not ever be of the
20497 provided type flag warning 184.
20499 * class.cs: Catch 169 as well.
20501 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20504 2002-01-18 Nick Drochak <ndrochak@gol.com>
20506 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20508 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20510 * interface.cs: (PopulateMethod): Check for pointers being defined
20511 only if the unsafe context is active.
20512 (PopulateProperty): ditto.
20513 (PopulateIndexer): ditto.
20515 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20516 specified. If pointers are present, make sure that they are
20517 present in an unsafe context.
20518 (Constructor, Constructor.Define): ditto.
20519 (Field, Field.Define): ditto.
20520 (Property, Property.Define): ditto.
20521 (Event, Event.Define): ditto.
20523 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20524 hashtable if there are classes or structs defined.
20526 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20527 code, as the constant resolution moved.
20529 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20530 the metadata, so we can flag error 133.
20532 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20533 pointer is being declared in an unsafe context.
20535 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20537 * modifiers.cs (Modifiers.Check): Require a Location argument.
20538 Report error 227 for Unsafe use.
20540 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20542 * statement.cs (For.Emit): If the test is null, then report that
20543 we do `return', as we wont reach anything afterwards.
20545 (Switch.SwitchGoverningType): Track the expression that matched
20548 * driver.cs: Allow negative numbers as an error code to flag.
20550 * cs-parser.jay: Handle 1551.
20552 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20554 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20556 * cs-parser.jay: Report 1518 (type declaration can only contain
20557 class, struct, interface, enum or delegate)
20559 (switch_label): Report 1523 (keywords `case' or `default' must
20562 (opt_switch_sections): Report 1522 (empty switch)
20564 * driver.cs: Report 1515 (response file specified multiple times)
20565 Report 1516 (Source file specified multiple times).
20567 * expression.cs (Argument.Resolve): Signal 1510
20569 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20570 access not allowed in static code)
20572 2002-01-11 Ravi Pratap <ravi@ximian.com>
20574 * typemanager.cs (IsPointerType): Utility method which we are going
20577 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20578 the object type, so we take care of that.
20580 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20582 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20583 added to non-params parameters :-)
20585 * typemanager.cs (CSharpName): Include 'void' type too.
20587 (void_ptr_type): Include in the set of core types.
20589 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20592 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20595 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20596 completely forgotten about it.
20598 2002-01-10 Ravi Pratap <ravi@ximian.com>
20600 * cs-parser.jay (pointer_type): Add. This begins our implementation
20601 of parsing rules for unsafe code.
20603 (unsafe_statement): Implement.
20605 (embedded_statement): Modify to include the above.
20607 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20609 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20610 if the current context is an unsafe one.
20612 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20613 are handled differently, we need separate rules for them.
20615 (local_variable_declaration): Update to use local_variable_pointer_type
20616 to allow variable declarations of unmanaged pointer types.
20618 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20619 in unsafe contexts.
20621 * ../errors/cs0214.cs : Add.
20623 2002-01-16 Nick Drochak <ndrochak@gol.com>
20625 * makefile: remove 'response' file when cleaning.
20627 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20629 * cs-parser.jay: Report 1524.
20631 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20633 * typemanager.cs (RegisterMethod): drop checking if we have
20634 registered this from here
20636 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20638 * class.cs (Method.EmitDestructor): Implement calling our base
20641 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20642 value of InFinally.
20644 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20645 this routine and will wrap the call in a try/catch block. Deal
20648 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20650 * ecore.cs (Expression.MemberLookup): instead of taking a
20651 parameter `same_type' that was used to tell whether we could
20652 access private members we compute our containing type from the
20655 (FieldExpr): Added partial support for volatile fields. This does
20656 not work for volatile fields exposed from assemblies, as I can not
20657 figure out how to extract the modreq from it.
20659 Updated all the source files to use this.
20661 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20662 because it is referenced by MemberLookup very often.
20664 2002-01-09 Ravi Pratap <ravi@ximian.com>
20666 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20667 TypeBuilder.GetCustomAttributes to retrieve what we need.
20669 Get rid of redundant default_member_attr_type as this is the same as
20670 default_member_type which already exists.
20672 * interface.cs, attribute.cs : Update accordingly.
20674 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20676 * typemanager.cs: Enable IndexerPropertyName again. It does not
20677 work for TYpeBuilders though. Ravi, can you please fix this?
20679 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20681 * expression.cs (Argument.Emit): Handle the case of ref objects
20682 being passed to ref functions;
20684 (ParameterReference.EmitLoad): Loads the content of the pointer
20685 without dereferencing.
20687 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20689 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20691 2002-01-08 Ravi Pratap <ravi@ximian.com>
20693 * class.cs (Indexer.DefineMethod): Incorporate the interface
20694 type in the name of the method if we are doing explicit interface
20697 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20699 (BetterConversion): Fix extremely trivial bug where we were referring to
20700 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20703 * ../errors/bug16.cs : Add although we have fixed it.
20705 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20707 * expression.cs (BaseIndexer): Begin implementation.
20709 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20711 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20712 production directly to remove a shift/reduce, and implement
20713 explicit interface implementation.
20715 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20716 after a floating point suffix.
20718 * expression.cs (DoNumericPromotions): Improved the conversion for
20719 uint/uint. If we have a constant, we avoid doing a typecast to a
20722 * class.cs (Indexer): Implement explicit interface implementation
20725 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20727 * class.cs: make the default instance constructor public and hidebysig.
20729 2001-01-03 Ravi Pratap <ravi@ximian.com>
20731 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20732 so we can call it from elsewhere.
20734 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20735 we emit it internally if the class has a defined indexer; otherwise the user
20736 emits it by decorating the class definition with the DefaultMemberAttribute.
20738 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20739 attribute is not used on a type which defines an indexer.
20741 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20742 character when we skip whitespace.
20744 * ../errors/cs0646.cs : Add.
20746 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20748 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20751 * makefile: Add practical target `mcs3.exe' which builds the third
20752 generation compiler.
20754 * expression.cs (New): Fix structures constructor calling.
20756 * class.cs (Property, Method, Indexer): Emit Final flag on the
20757 method if we are an interface implementation and we are not
20760 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20761 whether this property is referencing a `base' method.
20763 * expression.cs (Invocation.EmitCall): take an extra argument:
20764 is_base, this is used to determine whether the `call' or
20765 `callvirt' opcode should be used.
20768 * delegate.cs: update EmitCall.
20770 * class.cs (Method.Define): Set NewSlot for the cases where we are
20771 not implementing an interface method.
20773 (Property.Define): ditto.
20775 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20777 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20778 'r'. Allows mcs to parse itself fully.
20780 2002-01-02 Ravi Pratap <ravi@ximian.com>
20782 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20783 of the number of initializers that require the InitializeArray method.
20785 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20786 update the above field where necessary.
20788 (MakeByteBlob): Update accordingly.
20790 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20793 (EmitDynamicInitializers): Update in accordance with the new optimization.
20795 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20796 same OpCode applies.
20798 * cs-parser.jay : Fix some glaring errors I introduced.
20800 2002-01-01 Ravi Pratap <ravi@ximian.com>
20802 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20803 so that we can check for name clashes there too.
20805 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20806 for interface indexers.
20808 * interfaces.cs (Define): Emit the default member attribute.
20810 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20811 variable was being referred to while setting the value ;-)
20813 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20815 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20816 byte-by-byte information when we know the data is zero.
20818 Make the block always a multiple of 4, because
20819 DefineInitializedData has a bug.
20821 * assign.cs: Fix, we should assign from the temporary, not from
20824 * expression.cs (MakeByteBlob): Fix my incorrect code.
20826 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20828 * typemanager.cs (EnumToUnderlying): This function is used to get
20829 the underlying type from an enumeration, because it does not
20832 * constant.cs: Use the I4_S form for values between -128 and 127.
20834 * statement.cs (Block.LookupLabel): Looks up a label.
20835 (Block): Drop support for labeled blocks.
20837 (LabeledStatement): New kind of statement that represents a label
20840 (Goto): Finally implement this bad boy.
20842 * cs-parser.jay: Update to reflect new mechanism to implement
20845 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20847 * codegen.cs (EmitContext.This): a codegen property that keeps the
20848 a single instance of this instead of creating many different this
20851 * delegate.cs (Delegate.DoResolve): Update to use the property;
20853 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20855 * expression.cs (BaseAccess.DoResolve): Ditto.
20857 2001-12-29 Ravi Pratap <ravi@ximian.com>
20859 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20860 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20862 (InitCoreTypes): Update accordingly.
20864 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20865 so we can quickly store the state.
20867 (ApplyAttributes): Set the correct implementation flags
20868 for InternalCall methods.
20870 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20872 * expression.cs (EmitCall): if a method is not virtual, then do
20873 not use callvirt on it.
20875 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20876 user defined stuff) requires the use of stobj, which takes an
20877 address on the stack instead of an array and an index. So emit
20878 the Ldelema operation for it.
20880 (EmitStoreOpcode): Use stobj for valuetypes.
20882 (UnaryMutator.EmitCode): Use the right 1 value depending on
20883 whether we are dealing with int64/uint64, float or doubles.
20885 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20886 constructors that I implemented last night.
20888 (Constructor.IsDefault): Fix to work properly for static
20891 * cs-parser.jay (CheckDef): report method signature errors.
20892 Update error number 103 to be 132.
20894 * decl.cs: New AdditionResult enumeration value: MethodExists.
20895 Although we do this check for methods later on in the semantic
20896 analysis, catching repeated default constructors is so easy that
20897 we catch these here.
20899 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20902 (ParameterReference.EmitAssign, Emit): handle
20905 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20906 (ArrayAccess.EmitStoreOpcode): ditto.
20908 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20910 * expression.cs (MakeByteBlob): Complete all the missing types
20911 (uint, short, ushort, byte, sbyte)
20913 * class.cs: Only init instance field initializers on instance
20916 Rename `constructors' to instance_constructors.
20918 (TypeContainer.AddConstructor): Only add constructors to the list
20919 if it is not static.
20921 Make sure that we handle default_static_constructor independently
20922 everywhere where we handle instance_constructors
20924 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20926 * class.cs: Do not lookup or create a base initializer for a
20927 static constructor.
20929 (ConstructorInitializer.Resolve): use the proper type to lookup
20932 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20934 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20937 * decl.cs: CloseType is now an virtual method, the default
20938 implementation just closes this type.
20940 2001-12-28 Ravi Pratap <ravi@ximian.com>
20942 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20943 to PreserveSig by default. Also emit HideBySig on such methods.
20945 Basically, set the defaults to standard values.
20947 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20948 argument, if candidate is better, it can't be worse than the best !
20950 (Invocation): Re-write bits to differentiate between methods being
20951 applicable in their expanded form and their normal form - for params
20954 Get rid of use_standard everywhere as only standard conversions are allowed
20955 in overload resolution.
20957 More spec conformance.
20959 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20961 * driver.cs: Add --timestamp, to see where the compiler spends
20964 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20965 `this' in static code.
20967 (SimpleName.DoResolve): Implement in terms of a helper function
20968 that allows static-references to be passed upstream to
20971 (Expression.ResolveWithSimpleName): Resolve specially simple
20972 names when called by MemberAccess to implement the special
20975 (Expression.ImplicitReferenceConversion): Handle conversions from
20976 Null to reference types before others, as Null's type is
20979 * expression.cs (Invocation.EmitCall): Handle the special case of
20980 calling methods declared on a reference type from a ValueType
20981 (Base classes System.Object and System.Enum)
20983 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20984 the left hand side is a TypeExpr, not on every enumeration.
20986 (Binary.Resolve): If types are reference types, then do a cast to
20987 object on operators != and == of both arguments.
20989 * typemanager.cs (FindMembers): Extract instance and static
20990 members if requested.
20992 * interface.cs (PopulateProperty): Use void_type instead of null
20993 as the return type for the setter method.
20995 (PopulateIndexer): ditto.
20997 2001-12-27 Ravi Pratap <ravi@ximian.com>
20999 * support.cs (ReflectionParameters): Fix minor bug where we
21000 were examining the wrong parameter for the ParamArray attribute.
21002 Cope with requests for the type of the parameter at position
21003 greater than the params parameter's. We now return the element
21004 type of the params array as that makes more sense.
21006 * expression.cs (Invocation.IsParamsMethodApplicable): Update
21007 accordingly as we no longer have to extract the element type
21010 (Invocation.OverloadResolve): Update.
21012 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21014 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21015 against IEnumerator, test whether the return value is a descendant
21016 of the IEnumerator interface.
21018 * class.cs (Indexer.Define): Use an auxiliary method to implement
21019 the other bits of the method definition. Begin support for
21020 explicit interface implementation.
21022 (Property.DefineMethod): Use TypeManager.void_type instead of null
21023 for an empty return value.
21025 2001-12-26 Miguel de Icaza <miguel@ximian.com>
21027 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21028 dealing with a FieldExpr which is composed of a FieldBuilder, in
21029 the code path we did extract the constant, but we should have
21030 obtained the underlying value to be able to cast it (otherwise we
21031 end up in an infinite loop, this is what Ravi was running into).
21033 (ArrayCreation.UpdateIndices): Arrays might be empty.
21035 (MemberAccess.ResolveMemberAccess): Add support for section
21036 14.5.4.1 that deals with the special case of E.I when E is a type
21037 and something else, that I can be a reference to a static member.
21039 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21040 handle a particular array type to create byte blobs, it is just
21041 something we dont generate byteblobs for.
21043 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21046 * location.cs (Push): remove the key from the hashtable that we
21047 are about to add. This happens for empty files.
21049 * driver.cs: Dispose files after we have parsed them.
21051 (tokenize): new function that only runs the tokenizer on its
21052 input, for speed testing.
21054 2001-12-26 Ravi Pratap <ravi@ximian.com>
21056 * class.cs (Event.Define): Define the private field only if there
21057 are no accessors defined.
21059 * expression.cs (ResolveMemberAccess): If there is no associated
21060 field with the event, that means we have an event defined with its
21061 own accessors and we should flag error cs0070 since transforming
21062 ourselves into a field is not valid in that case.
21064 * ecore.cs (SimpleName.DoResolve): Same as above.
21066 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21067 and charset to sane values.
21069 2001-12-25 Ravi Pratap <ravi@ximian.com>
21071 * assign.cs (DoResolve): Perform check on events only if they
21072 are being accessed outside the declaring type.
21074 * cs-parser.jay (event_declarations): Update rules to correctly
21075 set the type of the implicit parameter etc.
21077 (add_accessor, remove_accessor): Set current local parameters.
21079 * expression.cs (Binary): For delegate addition and subtraction,
21080 cast the return value from the method into the appropriate delegate
21083 2001-12-24 Ravi Pratap <ravi@ximian.com>
21085 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21086 of these as the workaround is unnecessary.
21088 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21089 delegate data - none of that is needed at all.
21091 Re-write bits to extract the instance expression and the delegate method
21094 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
21097 * attribute.cs (ApplyAttributes): New method to take care of common tasks
21098 of attaching attributes instead of duplicating code everywhere.
21100 * everywhere : Update code to do attribute emission using the above method.
21102 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21104 * expression.cs (IsParamsMethodApplicable): if there are not
21105 parameters, return immediately.
21107 * ecore.cs: The 0 literal can be implicity converted to an enum
21110 (SimpleName.DoResolve): First lookup the type, then lookup the
21113 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21114 want to get its address. If the InstanceExpression is not
21115 addressable, store the result in a temporary variable, then get
21118 * codegen.cs: Only display 219 errors on warning level or above.
21120 * expression.cs (ArrayAccess): Make it implement the
21121 IMemoryLocation interface.
21123 (Binary.DoResolve): handle the operator == (object a, object b)
21124 and operator != (object a, object b) without incurring into a
21125 BoxedCast (because 5 != o should never be performed).
21127 Handle binary enumerator operators.
21129 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21130 value type, otherwise use Ldelem_ref.
21132 Use precomputed names;
21134 (AddressOf): Implement address of
21136 * cs-parser.jay (labeled_statement): Fix recursive block
21137 addition by reworking the production.
21139 * expression.cs (New.DoEmit): New has a special case:
21141 If we are dealing with a ValueType, we have a few
21142 situations to deal with:
21144 * The target of New is a ValueType variable, that is
21145 easy, we just pass this as the variable reference
21147 * The target of New is being passed as an argument,
21148 to a boxing operation or a function that takes a
21151 In this case, we need to create a temporary variable
21152 that is the argument of New.
21155 2001-12-23 Ravi Pratap <ravi@ximian.com>
21157 * rootcontext.cs (LookupType): Check that current_type is not null before
21158 going about looking at nested types.
21160 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21161 not implement the IAssignMethod interface any more.
21163 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21164 where we tranform them into FieldExprs if they are being resolved from within
21165 the declaring type.
21167 * ecore.cs (SimpleName.DoResolve): Do the same here.
21169 * assign.cs (DoResolve, Emit): Clean up code considerably.
21171 * ../errors/bug10.cs : Add.
21173 * ../errors/cs0070.cs : Add.
21175 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21177 * assign.cs : Get rid of EventIsLocal everywhere.
21179 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21181 * ecore.cs (ConvertIntLiteral): finished the implementation.
21183 * statement.cs (SwitchLabel): Convert the value we are using as a
21184 key before looking up the table.
21186 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21188 * codegen.cs (EmitTopBlock): Require a Location argument now.
21190 * cs-parser.jay (constructor_declarator): We need to setup
21191 current_local_parameters before we parse the
21192 opt_constructor_initializer, to allow the variables to be bound
21193 to the constructor arguments.
21195 * rootcontext.cs (LookupType): First lookup nested classes in our
21196 class and our parents before we go looking outside our class.
21198 * expression.cs (ConstantFold): Extract/debox the values at the
21201 * rootcontext.cs (EmitCode): Resolve the constants first before we
21202 resolve the types. This is not really needed, but it helps debugging.
21204 * statement.cs: report location.
21206 * cs-parser.jay: pass location to throw statement.
21208 * driver.cs: Small bug fix.
21210 * report.cs: Updated format to be 4-zero filled digits.
21212 2001-12-22 Ravi Pratap <ravi@ximian.com>
21214 * expression.cs (CheckIndices): Fix minor bug where the wrong
21215 variable was being referred to ;-)
21217 (DoEmit): Do not call EmitStaticInitializers when the
21218 underlying type is System.Object.
21220 2001-12-21 Ravi Pratap <ravi@ximian.com>
21222 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21223 and do the usual workaround for SRE.
21225 * class.cs (MyEventBuilder.EventType): New member to get at the type
21226 of the event, quickly.
21228 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21230 * assign.cs (Assign.DoResolve): Handle the case when the target
21231 is an EventExpr and perform the necessary checks.
21233 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21236 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21238 (EventExpr): Set the type in the constructor itself since we
21239 are meant to be born fully resolved.
21241 (EventExpr.Define): Revert code I wrote earlier.
21243 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21244 instance expression is null. The instance expression is a This in that case
21245 or a null, depending on whether it is a static method or not.
21247 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21248 refers to more than one method.
21250 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21251 and accordingly flag errors.
21253 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21255 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21257 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21259 * location.cs (ToString): Provide useful rutine.
21261 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21263 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21264 objects, return the actual integral boxed.
21266 * statement.cs (SwitchLabel): define an ILLabel for each
21269 (Switch.CheckSwitch): If the value is a Literal, extract
21270 the underlying literal.
21272 Also in the unused hashtable we had, add the SwitchLabel so we can
21273 quickly look this value up.
21275 * constant.cs: Implement a bunch of new constants. Rewrite
21276 Literal based on this. Made changes everywhere to adapt to this.
21278 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21279 dereferencing array only once, and also copes with enumrations.
21281 bytes are two bytes wide, not one.
21283 (Cast): Perform constant conversions.
21285 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21286 wrappers to the literals here.
21288 * expression.cs (DoNumericPromotions): long literals can converted
21289 to ulong implicity (this is taken care of elsewhere, but I was
21290 missing this spot).
21292 * ecore.cs (Expression.Literalize): Make the return type Literal,
21293 to improve type checking.
21295 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21297 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21299 * literal.cs: Revert code from ravi that checked the bounds. The
21300 bounds are sane by the definition of the type itself.
21302 * typemanager.cs: Fix implementation of ImplementsInterface. We
21303 need to actually look up in our parent hierarchy for interfaces
21306 * const.cs: Use the underlying type for enumerations
21308 * delegate.cs: Compute the basename for the delegate creation,
21309 that should fix the delegate test case, and restore the correct
21310 Type Lookup semantics in rootcontext
21312 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21313 referencing a nested type with the Reflection API is using the "+"
21316 * cs-parser.jay: Do not require EOF token at the end.
21318 2001-12-20 Ravi Pratap <ravi@ximian.com>
21320 * rootcontext.cs (LookupType): Concatenate type names with
21321 a '.' instead of a '+' The test suite passes again.
21323 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21324 field of the enumeration.
21326 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21327 the case when the member is an EventExpr.
21329 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21330 static has an associated instance expression.
21332 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21334 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21336 * class.cs (Event.Define): Register event and perform appropriate checks
21339 We define the Add and Remove methods even if the use provides none because
21340 in that case, we provide default implementations ourselves.
21342 Define a private field of the type of the event. This is done by the CSC compiler
21343 and we should be doing it too ;-)
21345 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21346 More methods we use in code we generate.
21348 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21351 (InitCoreTypes): Update accordingly for the above.
21353 * class.cs (Event.Emit): Generate code for default accessors that we provide
21355 (EmitDefaultMethod): Do the job in the above.
21357 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21360 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21362 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21363 builders even if we were missing one.
21365 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21366 pass the Basename as our class name instead of the Name. The
21367 basename will be correctly composed for us.
21369 * parameter.cs (Paramters): Now takes a Location argument.
21371 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21372 make all the code call directly LookupType in RootContext and take
21373 this chance to pass the Location information everywhere.
21375 * Everywhere: pass Location information.
21377 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21379 * class.cs (Constructor.Define): Updated way of detecting the
21380 length of the parameters.
21382 (TypeContainer.DefineType): Use basename as the type name for
21385 (TypeContainer.Define): Do not recursively define types here, as
21386 definition is taken care in order by the RootContext.
21388 * tree.cs: Keep track of namespaces in a per-file basis.
21390 * parameter.cs (Parameter.ComputeSignature): Update to use
21393 (Parameters.GetSignature): ditto.
21395 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21396 instead of a TypeContainer.
21398 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21399 resolve names. Because we need to be resolve in our context, not
21402 * driver.cs: Implement response files.
21404 * class.cs (TypeContainer.DefineType): If we are defined, do not
21405 redefine ourselves.
21407 (Event.Emit): Emit the code for add/remove handlers.
21408 (Event.Define): Save the MethodBuilders for add/remove.
21410 * typemanager.cs: Use pair here too.
21412 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21413 DictionaryEntry requires the first argument to be non-null.
21415 (enum_declaration): Compute full name for registering the
21418 (delegate_declaration): Instead of using
21419 formal_parameter_list, use opt_formal_parameter_list as the list
21422 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21423 (EventParsing): New property that controls whether `add' and
21424 `remove' are returned as tokens or identifiers (for events);
21426 2001-12-19 Ravi Pratap <ravi@ximian.com>
21428 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21429 use MyEventBuilder only and let it wrap the real builder for us.
21431 (MyEventBuilder): Revamp constructor etc.
21433 Implement all operations that we perform on EventBuilder in precisely the same
21436 (FindMembers): Update to use the EventBuilder member.
21438 (Event.Emit): Update accordingly.
21440 2001-12-18 Ravi Pratap <ravi@ximian.com>
21442 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21443 by calling the appropriate methods.
21445 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21448 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21450 2001-12-17 Ravi Pratap <ravi@ximian.com>
21452 * delegate.cs (Delegate.Populate): Check that the return type
21453 and various parameters types are indeed accessible.
21455 * class.cs (Constructor.Define): Same here.
21457 (Field.Define): Ditto.
21459 (Event.Define): Ditto.
21461 (Operator.Define): Check that the underlying Method defined itself
21462 correctly - so it's MethodBuilder should not be null.
21464 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21465 expression happens to be null.
21467 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21468 members but as of now we don't seem to be able to do anything really useful with it.
21470 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21471 not the EventBuilder.
21473 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21475 * cs-tokenizer.cs: Add support for defines.
21476 Add support for #if, #elif, #else, #endif
21478 (eval_var): evaluates a variable.
21479 (eval): stubbed for evaluating functions.
21481 * cs-parser.jay: Pass the defines information
21483 * driver.cs: Add --define command line option.
21485 * decl.cs: Move MemberCore here.
21487 Make it the base class for DeclSpace. This allows us to catch and
21488 report 108 and 109 for everything now.
21490 * class.cs (TypeContainer.Define): Extract all the members
21491 before populating and emit the warning 108 (new keyword required
21492 to override) instead of having each member implement this.
21494 (MemberCore.Define): New abstract method, we will be using this in
21495 the warning reporting engine in Populate.
21497 (Operator.Define): Adjust to new MemberCore protocol.
21499 * const.cs (Const): This does not derive from Expression, it is a
21500 temporary object we use to create fields, it is a MemberCore.
21502 * class.cs (Method.Define): Allow the entry point to be in a
21505 * driver.cs: Rewrite the argument handler to clean it up a bit.
21507 * rootcontext.cs: Made it just an auxiliary namespace feature by
21508 making everything static.
21510 * driver.cs: Adapt code to use RootContext type name instead of
21513 * delegate.cs: Remove RootContext argument.
21515 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21518 * class.cs (Event.Define): The lookup can fail.
21520 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21522 * expression.cs: Resolve the this instance before invoking the code.
21524 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21526 * cs-parser.jay: Add a production in element_access that allows
21527 the thing to become a "type" reference. This way we can parse
21528 things like "(string [])" as a type.
21530 Note that this still does not handle the more complex rules of
21534 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21536 * ecore.cs: (CopyNewMethods): new utility function used to
21537 assemble the list of methods from running FindMembers.
21539 (MemberLookup): Rework FindMembers so that
21541 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21543 * class.cs (TypeContainer): Remove Delegates who fail to be
21546 * delegate.cs (Populate): Verify that we dont get null return
21547 values. TODO: Check for AsAccessible.
21549 * cs-parser.jay: Use basename to emit error 574 (destructor should
21550 have the same name as container class), not the full name.
21552 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21553 possible representation.
21555 Also implements integer type suffixes U and L.
21557 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21559 * expression.cs (ArrayCreation.DoResolve): We need to do the
21560 argument resolution *always*.
21562 * decl.cs: Make this hold the namespace. Hold the root context as
21564 (LookupType): Move here.
21566 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21568 * location.cs (Row, Name): Fixed the code, it was always returning
21569 references to the first file.
21571 * interface.cs: Register properties defined through interfaces.
21573 * driver.cs: Add support for globbing on the command line
21575 * class.cs (Field): Make it derive from MemberCore as well.
21578 2001-12-15 Ravi Pratap <ravi@ximian.com>
21580 * class.cs (Event::Define): Check that the type of the event is a delegate
21581 type else flag error #66.
21583 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21586 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21587 values of EntryPoint, CharSet etc etc.
21589 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21591 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21592 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21593 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21594 which needs this to do its work.
21596 * ../errors/cs0066.cs : Add.
21598 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21600 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21603 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21604 clears out the parameters field.
21605 (MemberSignatureCompare): Cleanup
21607 (MemberCore): New base class used to share code between MethodCore
21610 (RegisterRequiredImplementations) BindingFlags.Public requires
21611 either BindingFlags.Instace or Static. Use instance here.
21613 (Property): Refactored code to cope better with the full spec.
21615 * parameter.cs (GetParameterInfo): Return an empty array instead
21618 * class.cs (Property): Abstract or extern properties have no bodies.
21620 * parameter.cs (GetParameterInfo): return a zero-sized array.
21622 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21623 method modifier validation to the typecontainer so we can reuse
21624 this on properties.
21626 (MethodCore.ParameterTypes): return an empty sized array of types.
21628 (Property.Define): Test property modifier validity.
21630 Add tests for sealed/override too.
21632 (Method.Emit): abstract or extern methods have no bodies.
21634 2001-12-14 Ravi Pratap <ravi@ximian.com>
21636 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21639 (Method::Define, ::Emit): Modify accordingly.
21641 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21643 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21645 * makefile: Pass in /unsafe.
21647 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21649 * class.cs (MakeKey): Kill routine.
21651 * class.cs (TypeContainer.Define): Correctly define explicit
21652 method implementations (they require the full interface name plus
21655 * typemanager.cs: Deply the PtrHashtable here and stop using the
21656 lame keys. Things work so much better.
21658 This of course broke everyone who depended on `RegisterMethod' to
21659 do the `test for existance' test. This has to be done elsewhere.
21661 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21662 the object stupid Equals method (because, that like fails all over
21663 the place). We still do not use it.
21665 * class.cs (TypeContainer.SetRequiredInterface,
21666 TypeContainer.RequireMethods): Killed these two routines and moved
21667 all the functionality to RegisterRequiredImplementations.
21669 (TypeContainer.RegisterRequiredImplementations): This routine now
21670 registers all the implementations required in an array for the
21671 interfaces and abstract methods. We use an array of structures
21672 which can be computed ahead of time to reduce memory usage and we
21673 also assume that lookups are cheap as most classes will not
21674 implement too many interfaces.
21676 We also avoid creating too many MethodSignatures.
21678 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21679 clear the "pending" bit if we find that there are problems with
21682 (TypeContainer.VerifyPendingMethods): Update to report errors of
21683 methods that look like implementations but are not.
21685 (TypeContainer.Define): Add support for explicit interface method
21688 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21690 * typemanager.cs: Keep track of the parameters here instead of
21691 being a feature of the TypeContainer.
21693 * class.cs: Drop the registration of parameters here, as
21694 InterfaceMethods are also interface declarations.
21696 * delegate.cs: Register methods with the TypeManager not only with
21697 the TypeContainer. This code was buggy.
21699 * interface.cs: Full registation here.
21701 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21703 * expression.cs: Remove reducer for binary expressions, it can not
21706 * const.cs: Put here the code that used to go into constant.cs
21708 * constant.cs: Put here the code for constants, this is a new base
21709 class for Literals.
21711 * literal.cs: Make Literal derive from Constant.
21713 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21715 * statement.cs (Return.Emit): Report error 157 if the user
21716 attempts to return from a finally block.
21718 (Return.Emit): Instead of emitting a return, jump to the end of
21721 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21722 LocalBuilder to store the result of the function. ReturnLabel is
21723 the target where we jump.
21726 2001-12-09 Radek Doulik <rodo@ximian.com>
21728 * cs-parser.jay: remember alias in current namespace
21730 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21733 * class.cs (LookupAlias): lookup alias in my_namespace
21735 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21737 (LookupAlias): lookup alias in this and if needed in parent
21740 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21744 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21745 making things static. I need this to avoid passing the
21746 TypeContainer when calling ParameterType.
21748 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21749 that did string manipulation to compute the type and then call
21750 GetType. Use Parameter.ParameterType instead.
21752 * cs-tokenizer.cs: Consume the suffix for floating values.
21754 * expression.cs (ParameterReference): figure out whether this is a
21755 reference parameter or not. Kill an extra variable by computing
21756 the arg_idx during emission.
21758 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21759 function that returns whether a parameter is an out/ref value or not.
21761 (Parameter.ParameterType): The type of the parameter (base,
21762 without ref/out applied).
21764 (Parameter.Resolve): Perform resolution here.
21765 (Parameter.ExternalType): The full type (with ref/out applied).
21767 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21768 support for expressions on the using statement.
21770 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21772 * statement.cs (Using.EmitLocalVariableDecls): Split the
21773 localvariable handling of the using statement.
21775 (Block.EmitMeta): Keep track of variable count across blocks. We
21776 were reusing slots on separate branches of blocks.
21778 (Try.Emit): Emit the general code block, we were not emitting it.
21780 Check the type of the declaration to be an IDisposable or
21781 something that can be implicity converted to it.
21783 Emit conversions if required.
21785 * ecore.cs (EmptyExpression): New utility class.
21786 (Expression.ImplicitConversionExists): New utility function.
21788 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21790 * statement.cs (Using): Implement.
21792 * expression.cs (LocalVariableReference): Support read only variables.
21794 * statement.cs: Remove the explicit emit for the Leave opcode.
21795 (VariableInfo): Add a readonly field.
21797 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21799 * ecore.cs (ConvCast): new class used to encapsulate the various
21800 explicit integer conversions that works in both checked and
21801 unchecked contexts.
21803 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21804 properly generate the overflow opcodes.
21806 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21808 * statement.cs: The correct type for the EmptyExpression is the
21809 element_type, not the variable type. Ravi pointed this out.
21811 2001-12-04 Ravi Pratap <ravi@ximian.com>
21813 * class.cs (Method::Define): Handle PInvoke methods specially
21814 by using DefinePInvokeMethod instead of the usual one.
21816 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21817 above to do the task of extracting information and defining the method.
21819 2001-12-04 Ravi Pratap <ravi@ximian.com>
21821 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21822 of the condition for string type.
21824 (Emit): Move that here.
21826 (ArrayCreation::CheckIndices): Keep string literals in their expression
21829 (EmitDynamicInitializers): Handle strings appropriately.
21831 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21833 * codegen.cs (EmitContext): Replace multiple variables with a
21834 single pointer to the current Switch statement.
21836 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21839 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21843 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21846 (Foreach.Emit): Foreach on arrays was not setting
21847 up the loop variables (for break/continue).
21849 (GotoCase): Semi-implented.
21851 2001-12-03 Ravi Pratap <ravi@ximian.com>
21853 * attribute.cs (CheckAttribute): Handle system attributes by using
21854 Attribute.GetAttributes to examine information we need.
21856 (GetValidPlaces): Same here.
21858 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21860 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21862 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21864 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21866 (Method::Emit): Handle the case when we are a PInvoke method.
21868 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21870 * expression.cs: Use ResolveWithSimpleName on compound names.
21872 2001-12-02 Ravi Pratap <ravi@ximian.com>
21874 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21875 before trying to reduce it.
21877 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21879 * constant.cs (LookupConstantValue): Implement.
21881 (EmitConstant): Use the above in emitting the constant.
21883 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21884 that are user-defined by doing a LookupConstantValue on them.
21886 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21889 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21891 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21893 (BaseAccess.DoResolve): Implement.
21895 (MemberAccess.DoResolve): Split this routine into a
21896 ResolveMemberAccess routine that can be used independently
21898 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21900 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21901 As that share bits of the implementation. Is returns a boolean,
21902 while As returns the Type that is being probed.
21904 2001-12-01 Ravi Pratap <ravi@ximian.com>
21906 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21907 instead of a Literal - much easier.
21909 (EnumInTransit): Remove - utterly useless :-)
21911 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21913 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21915 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21916 chain when we have no associated expression.
21918 2001-11-30 Ravi Pratap <ravi@ximian.com>
21920 * constant.cs (Define): Use Location while reporting the errror.
21922 Also emit a warning when 'new' is used and there is no inherited
21925 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21928 (LookupEnumValue): Implement to lookup an enum member's value and define it
21931 (Populate): Re-write accordingly to use the above routine.
21933 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21935 * expression.cs (This): Fix prototype for DoResolveLValue to
21936 override the base class DoResolveLValue.
21938 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21941 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21942 (we need to load the address of the field here). This fixes
21945 (FieldExpr.DoResolveLValue): Call the DoResolve
21946 function to initialize the Instance expression.
21948 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21949 correctly the GetEnumerator operation on a value type.
21951 * cs-parser.jay: Add more simple parsing error catches.
21953 * statement.cs (Switch): Add support for string switches.
21954 Handle null specially.
21956 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21958 2001-11-28 Ravi Pratap <ravi@ximian.com>
21960 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21962 (declare_local_constant): New helper function.
21964 * statement.cs (AddConstant): Keep a separate record of constants
21966 (IsConstant): Implement to determine if a variable is a constant.
21968 (GetConstantExpression): Implement.
21970 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21972 * statement.cs (IsVariableDefined): Re-write.
21974 2001-11-27 Ravi Pratap <ravi@ximian.com>
21976 * class.cs (TypeContainer::FindMembers): Look for constants
21977 in the case when we are looking for MemberTypes.Field
21979 * expression.cs (MemberAccess::DoResolve): Check that in the
21980 case we are a FieldExpr and a Literal, we are not being accessed
21981 by an instance reference.
21983 * cs-parser.jay (local_constant_declaration): Implement.
21985 (declaration_statement): Implement for constant declarations.
21987 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21989 * statement.cs (Switch): Catch double defaults.
21991 (Switch): More work on the switch() statement
21992 implementation. It works for integral values now, need to finish
21996 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21998 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21999 integer literals into other integer literals. To be used by
22002 2001-11-24 Ravi Pratap <ravi@ximian.com>
22004 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22007 (EmitDynamicInitializers): Cope with the above since we extract data
22008 directly from ArrayData now.
22010 (ExpectInitializers): Keep track of whether initializers are mandatory
22013 (Bounds): Make it a hashtable to prevent the same dimension being
22014 recorded for every element in that dimension.
22016 (EmitDynamicInitializers): Fix bug which prevented the Set array method
22019 Also fix bug which was causing the indices to be emitted in the reverse
22022 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22024 * expression.cs (ArrayCreation): Implement the bits that Ravi left
22025 unfinished. They do not work, because the underlying code is
22028 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22030 * cs-parser.jay: Remove bogus fixme.
22032 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22033 on Switch statement.
22035 2001-11-23 Ravi Pratap <ravi@ximian.com>
22037 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22040 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22041 parameter. Apparently, any expression is allowed.
22043 (ValidateInitializers): Update accordingly.
22045 (CheckIndices): Fix some tricky bugs thanks to recursion.
22047 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
22048 I was being completely brain-dead.
22050 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22051 and re-write acordingly.
22053 (DelegateInvocation): Re-write accordingly.
22055 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22057 (MakeByteBlob): Handle types more correctly.
22059 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22060 initialization from expressions but it is incomplete because I am a complete
22063 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22065 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22066 on If. Basically, we have to return `true' (ie, we do return to
22067 our caller) only if both branches of the if return.
22069 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22070 short-circuit operators, handle them as short circuit operators.
22072 (Cast.DoResolve): Resolve type.
22073 (Cast.Cast): Take an expression as the target type.
22075 * cs-parser.jay (cast_expression): Remove old hack that only
22076 allowed a limited set of types to be handled. Now we take a
22077 unary_expression and we resolve to a type during semantic
22080 Use the grammar productions from Rhys to handle casts (this is
22081 not complete like Rhys syntax yet, we fail to handle that corner
22082 case that C# has regarding (-x), but we will get there.
22084 2001-11-22 Ravi Pratap <ravi@ximian.com>
22086 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22087 field which is an array type.
22089 * cs-parser.jay (declare_local_variables): Support array initialization too.
22091 * typemanager.cs (MakeKey): Implement.
22093 (everywhere): Use the above appropriately.
22095 * cs-parser.jay (for_statement): Update for array initialization while
22096 declaring variables.
22098 * ecore.cs : The error message was correct, it's the variable's names that
22099 were misleading ;-) Make the code more readable.
22101 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22102 the correct type etc.
22104 (ConvertExplicit): Handle Enum types by examining the underlying type.
22106 2001-11-21 Ravi Pratap <ravi@ximian.com>
22108 * parameter.cs (GetCallingConvention): Always return
22109 CallingConventions.Standard for now.
22111 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22113 * expression.cs (Binary.ResolveOperator): Update the values of `l'
22114 and `r' after calling DoNumericPromotions.
22116 * ecore.cs: Fix error message (the types were in the wrong order).
22118 * statement.cs (Foreach.ProbeCollectionType): Need to pass
22119 BindingFlags.Instance as well
22121 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22122 implicit int literal conversion in an empty cast so that we
22123 propagate the right type upstream.
22125 (UnboxCast): new class used to unbox value types.
22126 (Expression.ConvertExplicit): Add explicit type conversions done
22129 (Expression.ImplicitNumericConversion): Oops, forgot to test for
22130 the target type before applying the implicit LongLiterals to ULong
22133 2001-11-21 Miguel de Icaza <miguel@ximian.com>
22135 * cs-parser.jay (for_statement): Reworked the way For works: now
22136 we declare manually any variables that are introduced in
22137 for_initializer to solve the problem of having out-of-band code
22138 emition (that is what got for broken).
22140 (declaration_statement): Perform the actual variable declaration
22141 that used to be done in local_variable_declaration here.
22143 (local_variable_declaration): Do not declare anything, just pass
22144 the information on a DictionaryEntry
22146 2001-11-20 Ravi Pratap <ravi@ximian.com>
22148 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22149 re-write of the logic to now make it recursive.
22151 (UpdateIndices): Re-write accordingly.
22153 Store element data in a separate ArrayData list in the above methods.
22155 (MakeByteBlob): Implement to dump the array data into a byte array.
22157 2001-11-19 Ravi Pratap <ravi@ximian.com>
22159 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22162 * constant.cs (Define): Implement.
22164 (EmitConstant): Re-write fully.
22166 Pass in location info.
22168 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22171 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22172 DictionaryEntry since we need location info too.
22174 (constant_declaration): Update accordingly.
22176 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22177 code into another method : UpdateIndices.
22179 2001-11-18 Ravi Pratap <ravi@ximian.com>
22181 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22182 some type checking etc.
22184 2001-11-17 Ravi Pratap <ravi@ximian.com>
22186 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22187 bits to provide dimension info if the user skips doing that.
22189 Update second constructor to store the rank correctly.
22191 2001-11-16 Ravi Pratap <ravi@ximian.com>
22193 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22194 and try to implement.
22196 * ../errors/cs0150.cs : Add.
22198 * ../errors/cs0178.cs : Add.
22200 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22202 * statement.cs: Implement foreach on multi-dimensional arrays.
22204 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22205 name of the params argument.
22207 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22208 initializing the array.
22210 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22211 we can use this elsewhere.
22213 * statement.cs: Finish implementation of foreach for single
22216 * cs-parser.jay: Use an out-of-band stack to pass information
22217 around, I wonder why I need this.
22219 foreach_block: Make the new foreach_block the current_block.
22221 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22222 function used to return a static Parameters structure. Used for
22223 empty parameters, as those are created very frequently.
22225 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22227 2001-11-15 Ravi Pratap <ravi@ximian.com>
22229 * interface.cs : Default modifier is private, not public. The
22230 make verify test passes again.
22232 2001-11-15 Ravi Pratap <ravi@ximian.com>
22234 * support.cs (ReflectionParameters): Fix logic to determine
22235 whether the last parameter is a params one. Test 9 passes again.
22237 * delegate.cs (Populate): Register the builders we define with
22238 RegisterParameterForBuilder. Test 19 passes again.
22240 * cs-parser.jay (property_declaration): Reference $6 instead
22241 of $$ to get at the location.
22243 (indexer_declaration): Similar stuff.
22245 (attribute): Ditto.
22247 * class.cs (Property): Register parameters for the Get and Set methods
22248 if they exist. Test 23 passes again.
22250 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22251 call to EmitArguments as we are sure there aren't any params arguments.
22252 Test 32 passes again.
22254 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22255 IndexOutOfRangeException.
22257 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22258 Test 33 now passes again.
22260 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22262 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22263 broke a bunch of things. Will have to come up with a better way
22264 of tracking locations.
22266 * statement.cs: Implemented foreach for single dimension arrays.
22268 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22270 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22271 an error. This removes the lookup from the critical path.
22273 * cs-parser.jay: Removed use of temporary_loc, which is completely
22276 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22278 * support.cs (ReflectionParameters.ParameterModifier): Report
22279 whether the argument is a PARAMS argument or not.
22281 * class.cs: Set the attribute `ParamArrayAttribute' on the
22282 parameter argument.
22284 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22285 and cons_param_array_attribute (ConstructorInfo for
22286 ParamArrayAttribute).,
22288 * codegen.cs: Emit the return using the `Return' statement, that
22289 way we can report the error correctly for missing return values.
22291 * class.cs (Method.Emit): Clean up.
22293 * expression.cs (Argument.Resolve): Take another argument: the
22294 location where this argument is used. Notice that this is not
22295 part of the "Argument" class as to reduce the size of the
22296 structure (we know the approximate location anyways).
22298 Test if the argument is a variable-reference, if not, then
22299 complain with a 206.
22301 (Argument.Emit): Emit addresses of variables.
22303 (Argument.FullDesc): Simplify.
22305 (Invocation.DoResolve): Update for Argument.Resolve.
22307 (ElementAccess.DoResolve): ditto.
22309 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22310 method should be virtual, as this method is always virtual.
22312 (NewDelegate.DoResolve): Update for Argument.Resolve.
22314 * class.cs (ConstructorInitializer.DoResolve): ditto.
22316 * attribute.cs (Attribute.Resolve): ditto.
22318 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22320 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22322 * expression.cs (ParameterReference): Drop IStackStorage and implement
22323 IAssignMethod instead.
22325 (LocalVariableReference): ditto.
22327 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22328 IAssignMethod instead.
22330 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22332 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22333 enumerations that are used in heavily used structures derive from
22334 byte in a laughable and pathetic attempt to reduce memory usage.
22335 This is the kind of pre-optimzations that you should not do at
22336 home without adult supervision.
22338 * expression.cs (UnaryMutator): New class, used to handle ++ and
22339 -- separatedly from the other unary operators. Cleans up the
22340 code, and kills the ExpressionStatement dependency in Unary.
22342 (Unary): Removed `method' and `Arguments' from this class, making
22343 it smaller, and moving it all to SimpleCall, so I can reuse this
22344 code in other locations and avoid creating a lot of transient data
22345 strucutres when not required.
22347 * cs-parser.jay: Adjust for new changes.
22349 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22351 * enum.cs (Enum.Populate): If there is a failure during
22354 * cs-parser.jay (opt_enum_base): we used to catch type errors
22355 here, but this is really incorrect. The type error should be
22356 catched during semantic analysis.
22358 2001-12-11 Ravi Pratap <ravi@ximian.com>
22360 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22361 current_local_parameters as expected since I, in my stupidity, had forgotten
22364 * attribute.cs (GetValidPlaces): Fix stupid bug.
22366 * class.cs (Method::Emit): Perform check on applicability of attributes.
22368 (Constructor::Emit): Ditto.
22370 (Field::Emit): Ditto.
22372 (Field.Location): Store location information.
22374 (Property, Event, Indexer, Operator): Ditto.
22376 * cs-parser.jay (field_declaration): Pass in location for each field.
22378 * ../errors/cs0592.cs : Add.
22380 2001-11-12 Ravi Pratap <ravi@ximian.com>
22382 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22384 (InitCoreTypes): Update accordingly.
22386 (RegisterAttrType, LookupAttr): Implement.
22388 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22389 info about the same.
22391 (Resolve): Update to populate the above as necessary.
22393 (Error592): Helper.
22395 (GetValidPlaces): Helper to the above.
22397 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22399 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22401 2001-11-12 Ravi Pratap <ravi@ximian.com>
22403 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22405 * ../errors/cs0617.cs : Add.
22407 2001-11-11 Ravi Pratap <ravi@ximian.com>
22409 * enum.cs (Emit): Rename to Populate to be more consistent with what
22410 we expect it to do and when exactly it is called.
22412 * class.cs, rootcontext.cs : Update accordingly.
22414 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22415 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22417 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22419 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22420 of a fieldinfo using the above, when dealing with a FieldBuilder.
22422 2001-11-10 Ravi Pratap <ravi@ximian.com>
22424 * ../errors/cs0031.cs : Add.
22426 * ../errors/cs1008.cs : Add.
22428 * ../errrors/cs0543.cs : Add.
22430 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22433 (FindMembers): Implement.
22435 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22436 enums and delegates too.
22438 (enum_types): Rename to builder_to_enum.
22440 (delegate_types): Rename to builder_to_delegate.
22442 * delegate.cs (FindMembers): Implement.
22444 2001-11-09 Ravi Pratap <ravi@ximian.com>
22446 * typemanager.cs (IsEnumType): Implement.
22448 * enum.cs (Emit): Re-write parts to account for the underlying type
22449 better and perform checking etc.
22451 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22452 of the underlying type.
22454 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22457 * enum.cs (error31): Helper to report error #31.
22459 * cs-parser.jay (enum_declaration): Store location of each member too.
22461 * enum.cs (member_to_location): New hashtable.
22463 (AddEnumMember): Update location hashtable.
22465 (Emit): Use the location of each member while reporting errors.
22467 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22469 * cs-parser.jay: A for_initializer if is a
22470 local_variable_declaration really ammount to have an implicit
22471 block with the variable declaration and no initializer for for.
22473 * statement.cs (For.Emit): Cope with null initializers.
22475 This fixes the infinite loop on for initializers.
22477 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22479 * enum.cs: More cleanup.
22481 * ecore.cs: Remove dead code.
22483 * class.cs (Property.Emit): More simplification.
22484 (Event.Emit): ditto.
22486 Reworked to have less levels of indentation.
22488 2001-11-08 Ravi Pratap <ravi@ximian.com>
22490 * class.cs (Property): Emit attributes.
22500 * enum.cs (Emit): Ditto.
22502 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22505 * class.cs (Field, Event, etc.): Move attribute generation into the
22506 Emit method everywhere.
22508 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22509 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22510 as we had no way of defining nested enums !
22512 * rootcontext.cs : Adjust code accordingly.
22514 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22516 2001-11-07 Ravi Pratap <ravi@ximian.com>
22518 * expression.cs (EvalConstantExpression): Move into ecore.cs
22520 * enum.cs (Enum): Rename some members and make them public and readonly
22521 according to our convention.
22523 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22526 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22528 (Enum::Emit): Write a simple version for now which doesn't try to compute
22529 expressions. I shall modify this to be more robust in just a while.
22531 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22533 (TypeContainer::CloseType): Create the Enum types too.
22535 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22537 * expression.cs (EvalConstantExpression): Get rid of completely.
22539 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22540 user-defined values and other cases.
22542 (IsValidEnumLiteral): Helper function.
22544 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22545 out there in the case we had a literal FieldExpr.
22547 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22549 (Literalize): Revamp a bit to take two arguments.
22551 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22553 2001-11-06 Ravi Pratap <ravi@ximian.com>
22555 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22557 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22559 (Resolve): Use the above to ensure we have proper initializers.
22561 2001-11-05 Ravi Pratap <ravi@ximian.com>
22563 * expression.cs (Expression::EvalConstantExpression): New method to
22564 evaluate constant expressions.
22566 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22568 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22570 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22573 (Binary.ResolveOperator): Handle operator != (object a, object b)
22574 and operator == (object a, object b);
22576 (Binary.DoNumericPromotions): Indicate whether the numeric
22577 promotion was possible.
22579 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22582 Made the ArrayAccess implement interface IAssignMethod instead of
22583 IStackStore as the order in which arguments are passed reflects
22586 * assign.cs: Instead of using expr.ExprClass to select the way of
22587 assinging, probe for the IStackStore/IAssignMethod interfaces.
22589 * typemanager.cs: Load InitializeArray definition.
22591 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22592 static data that can be used to initialize arrays.
22594 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22596 * expression.cs: Handle operator== and operator!= for booleans.
22598 (Conditioal.Reduce): Implement reducer for the ?: operator.
22600 (Conditional.Resolve): Implement dead code elimination.
22602 (Binary.Resolve): Catch string literals and return a new
22603 concatenated string.
22605 (Unary.Reduce): Implement reduction of unary expressions.
22607 * ecore.cs: Split out the expression core handling here.
22609 (Expression.Reduce): New method used to perform constant folding
22610 and CSE. This is needed to support constant-expressions.
22612 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22613 targets, and optimize for !x.
22615 2001-11-04 Ravi Pratap <ravi@ximian.com>
22617 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22618 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22619 set custom atttributes.
22621 * literal.cs (Literal::GetValue): New abstract method to return the actual
22622 value of the literal, cast as an object.
22624 (*Literal): Implement GetValue method.
22626 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22627 expressions to the arraylist but objects of type Argument.
22629 * class.cs (TypeContainer::Emit): Emit our attributes too.
22631 (Method::Emit, Constructor::Emit): Ditto.
22633 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22634 to be ignoring earlier.
22636 2001-11-03 Ravi Pratap <ravi@ximian.com>
22638 * attribute.cs (AttributeSection::Define): Implement to do the business
22639 of constructing a CustomAttributeBuilder.
22641 (Attribute): New trivial class. Increases readability of code.
22643 * cs-parser.jay : Update accordingly.
22645 (positional_argument_list, named_argument_list, named_argument): New rules
22647 (attribute_arguments): Use the above so that we are more correct.
22649 2001-11-02 Ravi Pratap <ravi@ximian.com>
22651 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22652 to perform all checks for a method with a params parameter.
22654 (Invocation::OverloadResolve): Update to use the above method and therefore
22655 cope correctly with params method invocations.
22657 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22660 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22661 constructors in our parent too because we can't afford to miss out on
22664 * attribute.cs (AttributeSection): New name for the class Attribute
22666 Other trivial changes to improve readability.
22668 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22669 use the new class names.
22671 2001-11-01 Ravi Pratap <ravi@ximian.com>
22673 * class.cs (Method::Define): Complete definition for params types too
22675 (Indexer::Define): Ditto.
22677 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22678 Cope everywhere with a request for info about the array parameter.
22680 2001-11-01 Ravi Pratap <ravi@ximian.com>
22682 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22684 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22685 local_variable_type to extract the string corresponding to the type.
22687 (local_variable_type): Fixup the action to use the new helper method.
22689 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22692 * expression.cs : Clean out code which uses the above.
22694 2001-10-31 Ravi Pratap <ravi@ximian.com>
22696 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22697 and bale out if necessary by returning a false.
22699 (RegisterProperty): Ditto.
22701 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22702 and print out appropriate error messages.
22704 * interface.cs (everywhere): Ditto.
22706 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22707 location to constructor.
22709 * class.cs (Property, Event, Indexer): Update accordingly.
22711 * ../errors/cs111.cs : Added.
22713 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22714 of a method, as laid down by the spec.
22716 (Invocation::OverloadResolve): Use the above method.
22718 2001-10-31 Ravi Pratap <ravi@ximian.com>
22720 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22721 now take a TypeContainer and a Parameters object.
22723 (ParameterData): Modify return type of ParameterModifier method to be
22724 Parameter.Modifier and not a string.
22726 (ReflectionParameters, InternalParameters): Update accordingly.
22728 * expression.cs (Argument::GetParameterModifier): Same here.
22730 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22731 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22732 symbol in it at all so maybe this is only for now.
22734 2001-10-30 Ravi Pratap <ravi@ximian.com>
22736 * support.cs (InternalParameters): Constructor now takes an extra argument
22737 which is the actual Parameters class.
22739 (ParameterDesc): Update to provide info on ref/out modifiers.
22741 * class.cs (everywhere): Update call to InternalParameters to pass in
22742 the second argument too.
22744 * support.cs (ParameterData): Add ParameterModifier, which is a method
22745 to return the modifier info [ref/out etc]
22747 (InternalParameters, ReflectionParameters): Implement the above.
22749 * expression.cs (Argument::ParameterModifier): Similar function to return
22750 info about the argument's modifiers.
22752 (Invocation::OverloadResolve): Update to take into account matching modifiers
22755 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22756 a new SetFormalParameters object which we pass to InternalParameters.
22758 2001-10-30 Ravi Pratap <ravi@ximian.com>
22760 * expression.cs (NewArray): Merge into the ArrayCreation class.
22762 2001-10-29 Ravi Pratap <ravi@ximian.com>
22764 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22765 NewUserdefinedArray into one as there wasn't much of a use in having
22768 * expression.cs (Argument): Change field's name to ArgType from Type.
22770 (Type): New readonly property which returns the proper type, taking into
22771 account ref/out modifiers.
22773 (everywhere): Adjust code accordingly for the above.
22775 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22776 whether we are emitting for a ref or out parameter.
22778 * expression.cs (Argument::Emit): Use the above field to set the state.
22780 (LocalVariableReference::Emit): Update to honour the flag and emit the
22783 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22785 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22787 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22789 (ReflectionParameters, InternalParameters): Implement the above method.
22791 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22794 (Invocation::FullMethodDesc): Ditto.
22796 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22798 * cs-parser.jay: Add extra production for the second form of array
22801 * expression.cs (ArrayCreation): Update to reflect the above
22804 * Small changes to prepare for Array initialization.
22806 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22808 * typemanager.cs (ImplementsInterface): interface might be null;
22809 Deal with this problem;
22811 Also, we do store negative hits on the cache (null values), so use
22812 this instead of calling t.GetInterfaces on the type everytime.
22814 2001-10-28 Ravi Pratap <ravi@ximian.com>
22816 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22818 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22819 split functionality out into different classes.
22821 (New::FormArrayType): Move into NewBuiltinArray.
22823 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22826 (NewBuiltinArray): New class to handle creation of built-in arrays.
22828 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22829 account creation of one-dimensional arrays.
22831 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22833 (NewUserdefinedArray::DoResolve): Implement.
22835 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22837 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22838 we maintain inside the TypeManager. This is necessary to perform lookups on the
22841 (LookupType): Update to perform GetType on the module builders too.
22843 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22845 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22847 2001-10-23 Ravi Pratap <ravi@ximian.com>
22849 * expression.cs (New::DoResolve): Implement guts of array creation.
22851 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22853 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22855 * expression.cs: Fix bug I introduced lsat night that broke
22858 (Expression.Resolve): Report a 246 error (can not resolve name)
22859 if we find a SimpleName in the stream.
22861 (Expression.ResolveLValue): Ditto.
22863 (Expression.ResolveWithSimpleName): This function is a variant of
22864 ResolveName, this one allows SimpleNames to be returned without a
22865 warning. The only consumer of SimpleNames is MemberAccess
22867 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22869 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22870 might arrive here. I have my doubts that this is correct.
22872 * statement.cs (Lock): Implement lock statement.
22874 * cs-parser.jay: Small fixes to support `lock' and `using'
22876 * cs-tokenizer.cs: Remove extra space
22878 * driver.cs: New flag --checked, allows to turn on integer math
22881 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22882 Threading.Monitor.Exit
22884 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22886 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22887 Expression Class to be IndexerAccess.
22889 Notice that Indexer::DoResolve sets the eclass to Value.
22891 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22893 * class.cs (TypeContainer::Emit): Emit code for indexers.
22895 * assign.cs (IAssignMethod): New interface implemented by Indexers
22896 and Properties for handling assignment.
22898 (Assign::Emit): Simplify and reuse code.
22900 * expression.cs (IndexerAccess, PropertyExpr): Implement
22901 IAssignMethod, clean up old code.
22903 2001-10-22 Ravi Pratap <ravi@ximian.com>
22905 * typemanager.cs (ImplementsInterface): New method to determine if a type
22906 implements a given interface. Provides a nice cache too.
22908 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22911 (ConvertReferenceExplicit): Ditto.
22913 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22914 various methods, with correct names etc.
22916 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22917 Operator.UnaryNegation.
22919 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22920 we have a unary plus or minus operator.
22922 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22925 * everywhere : update accordingly.
22927 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22930 * class.cs (Method::Define): For the case where we are implementing a method
22931 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22932 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22934 2001-10-21 Ravi Pratap <ravi@ximian.com>
22936 * interface.cs (FindMembers): Implement to work around S.R.E
22939 * typemanager.cs (IsInterfaceType): Implement.
22941 (FindMembers): Update to handle interface types too.
22943 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22944 use IsAssignableFrom as that is not correct - it doesn't work.
22946 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22947 and accordingly override EmitStatement.
22949 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22950 using the correct logic :-)
22952 2001-10-19 Ravi Pratap <ravi@ximian.com>
22954 * ../errors/cs-11.cs : Add to demonstrate error -11
22956 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22958 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22959 then pass this as a hint to ResolveLValue.
22961 * expression.cs (FieldExpr): Add Location information
22963 (FieldExpr::LValueResolve): Report assignment to readonly
22966 (Expression::ExprClassFromMemberInfo): Pass location information.
22968 (Expression::ResolveLValue): Add new method that resolves an
22971 (Expression::DoResolveLValue): Default invocation calls
22974 (Indexers): New class used to keep track of indexers in a given
22977 (IStackStore): Renamed from LValue, as it did not really describe
22978 what this did. Also ResolveLValue is gone from this interface and
22979 now is part of Expression.
22981 (ElementAccess): Depending on the element access type
22983 * typemanager.cs: Add `indexer_name_type' as a Core type
22984 (System.Runtime.CompilerServices.IndexerNameAttribute)
22986 * statement.cs (Goto): Take a location.
22988 2001-10-18 Ravi Pratap <ravi@ximian.com>
22990 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22991 if two delegates are compatible.
22993 (NewDelegate::DoResolve): Update to take care of the case when
22994 we instantiate a delegate from another delegate.
22996 * typemanager.cs (FindMembers): Don't even try to look up members
22997 of Delegate types for now.
22999 2001-10-18 Ravi Pratap <ravi@ximian.com>
23001 * delegate.cs (NewDelegate): New class to take care of delegate
23004 * expression.cs (New): Split the delegate related code out into
23005 the NewDelegate class.
23007 * delegate.cs (DelegateInvocation): New class to handle delegate
23010 * expression.cs (Invocation): Split out delegate related code into
23011 the DelegateInvocation class.
23013 2001-10-17 Ravi Pratap <ravi@ximian.com>
23015 * expression.cs (New::DoResolve): Implement delegate creation fully
23016 and according to the spec.
23018 (New::DoEmit): Update to handle delegates differently.
23020 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23021 because of which we were printing out arguments in reverse order !
23023 * delegate.cs (VerifyMethod): Implement to check if the given method
23024 matches the delegate.
23026 (FullDelegateDesc): Implement.
23028 (VerifyApplicability): Implement.
23030 * expression.cs (Invocation::DoResolve): Update to accordingly handle
23031 delegate invocations too.
23033 (Invocation::Emit): Ditto.
23035 * ../errors/cs1593.cs : Added.
23037 * ../errors/cs1594.cs : Added.
23039 * delegate.cs (InstanceExpression, TargetMethod): New properties.
23041 2001-10-16 Ravi Pratap <ravi@ximian.com>
23043 * typemanager.cs (intptr_type): Core type for System.IntPtr
23045 (InitCoreTypes): Update for the same.
23047 (iasyncresult_type, asynccallback_type): Ditto.
23049 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23052 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23055 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23056 the builders for the 4 members of a delegate type :-)
23058 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23061 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23063 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23065 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23067 * statement.cs (Break::Emit): Implement.
23068 (Continue::Emit): Implement.
23070 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23071 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23072 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23073 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23076 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23077 properties that track the label for the current loop (begin of the
23078 loop and end of the loop).
23080 2001-10-15 Ravi Pratap <ravi@ximian.com>
23082 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23083 use of emitting anything at all.
23085 * class.cs, rootcontext.cs : Get rid of calls to the same.
23087 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23089 (Populate): Define the constructor correctly and set the implementation
23092 * typemanager.cs (delegate_types): New hashtable to hold delegates that
23095 (AddDelegateType): Implement.
23097 (IsDelegateType): Implement helper method.
23099 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23101 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23102 and accordingly handle it.
23104 * delegate.cs (Populate): Take TypeContainer argument.
23105 Implement bits to define the Invoke method. However, I still haven't figured out
23106 how to take care of the native int bit :-(
23108 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
23109 Qualify the name of the delegate, not its return type !
23111 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23114 (StandardConversionExists): Checking for array types turns out to be recursive.
23116 (ConvertReferenceExplicit): Implement array conversion.
23118 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23120 2001-10-12 Ravi Pratap <ravi@ximian.com>
23122 * cs-parser.jay (delegate_declaration): Store the fully qualified
23123 name as it is a type declaration.
23125 * delegate.cs (ReturnType, Name): Rename members to these. Make them
23128 (DefineDelegate): Renamed from Define. Does the same thing essentially,
23129 as TypeContainer::DefineType.
23131 (Populate): Method in which all the definition of the various methods (Invoke)
23134 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23137 (CloseDelegate): Finally creates the delegate.
23139 * class.cs (TypeContainer::DefineType): Update to define delegates.
23140 (Populate, Emit and CloseType): Do the same thing here too.
23142 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23143 delegates in all these operations.
23145 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23147 * expression.cs: LocalTemporary: a new expression used to
23148 reference a temporary that has been created.
23150 * assign.cs: Handle PropertyAccess back here, so that we can
23151 provide the proper semantic access to properties.
23153 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23154 a few more explicit conversions.
23156 * modifiers.cs: `NEW' modifier maps to HideBySig.
23158 * expression.cs (PropertyExpr): Make this into an
23159 ExpressionStatement, and support the EmitStatement code path.
23161 Perform get/set error checking, clean up the interface.
23163 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23164 them into toplevel access objects.
23166 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23168 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23171 * typemanager.cs: Keep track here of our PropertyBuilders again to
23172 work around lameness in SRE.
23174 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23176 * expression.cs (LValue::LValueResolve): New method in the
23177 interface, used to perform a second resolution pass for LValues.
23179 (This::DoResolve): Catch the use of this in static methods.
23181 (This::LValueResolve): Implement.
23183 (This::Store): Remove warning, assigning to `this' in structures
23186 (Invocation::Emit): Deal with invocation of
23187 methods on value types. We need to pass the address to structure
23188 methods rather than the object itself. (The equivalent code to
23189 emit "this" for structures leaves the entire structure on the
23190 stack instead of a pointer to it).
23192 (ParameterReference::DoResolve): Compute the real index for the
23193 argument based on whether the method takes or not a `this' pointer
23194 (ie, the method is static).
23196 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23197 value types returned from functions when we need to invoke a
23198 method on the sturcture.
23201 2001-10-11 Ravi Pratap <ravi@ximian.com>
23203 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23204 defining the type in the Modulebuilder or Typebuilder. This is to take
23205 care of nested types which need to be defined on the TypeBuilder using
23206 DefineNestedMethod.
23208 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23209 methods in RootContext, only ported to be part of TypeContainer.
23211 (TypeContainer::GetInterfaceOrClass): Ditto.
23213 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23215 * interface.cs (Interface::DefineInterface): New method. Does exactly
23216 what RootContext.CreateInterface did earlier, only it takes care of nested types
23219 (Interface::GetInterfaces): Move from RootContext here and port.
23221 (Interface::GetInterfaceByName): Same here.
23223 * rootcontext.cs (ResolveTree): Re-write.
23225 (PopulateTypes): Re-write.
23227 * class.cs (TypeContainer::Populate): Populate nested types too.
23228 (TypeContainer::Emit): Emit nested members too.
23230 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23231 instead just use the name argument passed in as it is already fully
23234 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23235 to TypeContainer mapping to see if a type is user-defined.
23237 * class.cs (TypeContainer::CloseType): Implement.
23239 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23240 the default constructor.
23242 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23245 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23247 * interface.cs (CloseType): Create the type here.
23249 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23252 Remove all the methods which are now in TypeContainer.
23254 2001-10-10 Ravi Pratap <ravi@ximian.com>
23256 * delegate.cs (Define): Re-write bits to define the delegate
23259 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23261 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23263 * expression.cs (ImplicitReferenceConversion): handle null as well
23264 as a source to convert to any reference type.
23266 * statement.cs (Return): Perform any implicit conversions to
23267 expected return type.
23269 Validate use of return statement.
23271 * codegen.cs (EmitContext): Pass the expected return type here.
23273 * class.cs (Method, Constructor, Property): Pass expected return
23274 type to EmitContext.
23276 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23278 * expression.cs: Make DoResolve take an EmitContext instead of a
23281 Replaced `l' and `location' for `loc', for consistency.
23283 (Error, Warning): Remove unneeded Tc argument.
23285 * assign.cs, literal.cs, constant.cs: Update to new calling
23288 * codegen.cs: EmitContext now contains a flag indicating whether
23289 code is being generated in a static method or not.
23291 * cs-parser.jay: DecomposeQI, new function that replaces the old
23292 QualifiedIdentifier. Now we always decompose the assembled
23293 strings from qualified_identifier productions into a group of
23296 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23298 * rootcontext.cs: Deal with field-less struct types correctly now
23299 by passing the size option to Define Type.
23301 * class.cs: Removed hack that created one static field.
23303 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23305 * statement.cs: Moved most of the code generation here.
23307 2001-10-09 Ravi Pratap <ravi@ximian.com>
23309 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23312 (ElementAccess): Remove useless bits for now - keep checks as the spec
23315 2001-10-08 Ravi Pratap <ravi@ximian.com>
23317 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23318 and start performing checks according to the spec.
23320 2001-10-07 Ravi Pratap <ravi@ximian.com>
23322 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23323 rank_specifiers instead.
23325 (rank_specifiers): Change the order in which the rank specifiers are stored
23327 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23329 * expression.cs (ElementAccess): Implement the LValue interface too.
23331 2001-10-06 Ravi Pratap <ravi@ximian.com>
23333 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23334 except that user defined conversions are not included.
23336 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23337 perform the conversion of the return type, if necessary.
23339 (New::DoResolve): Check whether we are creating an array or an object
23340 and accordingly do the needful.
23342 (New::Emit): Same here.
23344 (New::DoResolve): Implement guts of array creation.
23346 (New::FormLookupType): Helper function.
23348 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23350 * codegen.cs: Removed most of the code generation here, and move the
23351 corresponding code generation bits to the statement classes.
23353 Added support for try/catch/finalize and throw.
23355 * cs-parser.jay: Added support for try/catch/finalize.
23357 * class.cs: Catch static methods having the flags override,
23358 virtual or abstract.
23360 * expression.cs (UserCast): This user cast was not really doing
23361 what it was supposed to do. Which is to be born in fully resolved
23362 state. Parts of the resolution were being performed at Emit time!
23366 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23368 * expression.cs: Implicity convert the result from UserCast.
23370 2001-10-05 Ravi Pratap <ravi@ximian.com>
23372 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23373 prevented it from working correctly.
23375 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23376 merely ConvertImplicit.
23378 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23380 * typemanager.cs: Make the LookupTypeContainer function static,
23381 and not per-instance.
23383 * class.cs: Make static FindMembers (the one that takes a Type
23386 * codegen.cs: Add EmitForeach here.
23388 * cs-parser.jay: Make foreach a toplevel object instead of the
23389 inline expansion, as we need to perform semantic analysis on it.
23391 2001-10-05 Ravi Pratap <ravi@ximian.com>
23393 * expression.cs (Expression::ImplicitUserConversion): Rename to
23394 UserDefinedConversion.
23396 (Expression::UserDefinedConversion): Take an extra argument specifying
23397 whether we look for explicit user conversions too.
23399 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23401 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23403 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23404 with the appropriate arguments.
23406 * cs-parser.jay (cast_expression): Record location too.
23408 * expression.cs (Cast): Record location info.
23410 (Expression::ConvertExplicit): Take location argument.
23412 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23413 to determine if we are doing explicit conversions.
23415 (UserCast::Emit): Update accordingly.
23417 (Expression::ConvertExplicit): Report an error if everything fails.
23419 * ../errors/cs0030.cs : Add.
23421 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23423 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23424 virtual and newslot bits.
23426 * class.cs (TypeContainer::RegisterRequiredImplementations):
23427 Record methods we need.
23429 (TypeContainer::MakeKey): Helper function to make keys for
23430 MethodBases, since the Methodbase key is useless.
23432 (TypeContainer::Populate): Call RegisterRequiredImplementations
23433 before defining the methods.
23435 Create a mapping for method_builders_to_methods ahead of time
23436 instead of inside a tight loop.
23438 (::RequireMethods): Accept an object as the data to set into the
23439 hashtable so we can report interface vs abstract method mismatch.
23441 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23443 * report.cs: Make all of it static.
23445 * rootcontext.cs: Drop object_type and value_type computations, as
23446 we have those in the TypeManager anyways.
23448 Drop report instance variable too, now it is a global.
23450 * driver.cs: Use try/catch on command line handling.
23452 Add --probe option to debug the error reporting system with a test
23455 * report.cs: Add support for exiting program when a probe
23456 condition is reached.
23458 2001-10-03 Ravi Pratap <ravi@ximian.com>
23460 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23461 we do a forcible conversion regardless of type, to check if
23462 ForceConversion returns a null.
23464 (Binary::error19): Use location to report error.
23466 (Unary::error23): Use location here too.
23468 * ../errors/cs0019.cs : Check in.
23470 * ../errors/cs0023.cs : Check in.
23472 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23473 case of a non-null MethodInfo object with a length of 0 !
23475 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23476 an applicable member - according to the spec :-)
23477 Also fix logic to find members in base types.
23479 (Unary::ResolveOperator): Same here.
23481 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23482 as I was getting thoroughly confused between this and error19 :-)
23484 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23485 (::FindMostEncompassedType): Implement.
23486 (::FindMostEncompassingType): Implement.
23487 (::StandardConversionExists): Implement.
23489 (UserImplicitCast): Re-vamp. We now need info about most specific
23490 source and target types so that we can do the necessary conversions.
23492 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23493 mathematical union with no duplicates.
23495 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23497 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23498 in order from base classes to child classes, so that we can in
23499 child classes look up in our parent for method names and
23500 attributes (required for handling abstract, virtual, new, override
23501 constructs: we need to instrospect our base class, and if we dont
23502 populate the classes in order, the introspection might be
23503 incorrect. For example, a method could query its parent before
23504 the parent has any methods and would determine that the parent has
23505 no abstract methods (while it could have had them)).
23507 (RootContext::CreateType): Record the order in which we define the
23510 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23512 * class.cs (TypeContainer::Populate): Also method definitions can
23513 fail now, keep track of this.
23515 (TypeContainer::FindMembers): Implement support for
23516 DeclaredOnly/noDeclaredOnly flag.
23518 (Constructor::Emit) Return the ConstructorBuilder.
23520 (Method::Emit) Return the MethodBuilder.
23521 Check for abstract or virtual methods to be public.
23523 * rootcontext.cs (RootContext::CreateType): Register all the
23524 abstract methods required for the class to be complete and the
23525 interface methods that must be implemented.
23527 * cs-parser.jay: Report error 501 (method requires body if it is
23528 not marked abstract or extern).
23530 * expression.cs (TypeOf::Emit): Implement.
23532 * typemanager.cs: runtime_handle_type, new global type.
23534 * class.cs (Property::Emit): Generate code for properties.
23536 2001-10-02 Ravi Pratap <ravi@ximian.com>
23538 * expression.cs (Unary::ResolveOperator): Find operators on base type
23539 too - we now conform exactly to the spec.
23541 (Binary::ResolveOperator): Same here.
23543 * class.cs (Operator::Define): Fix minor quirk in the tests.
23545 * ../errors/cs0215.cs : Added.
23547 * ../errors/cs0556.cs : Added.
23549 * ../errors/cs0555.cs : Added.
23551 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23553 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23554 single integer which is really efficient
23556 2001-10-01 Ravi Pratap <ravi@ximian.com>
23558 * expression.cs (Expression::ImplicitUserConversion): Use location
23559 even in the case when we are examining True operators.
23561 * class.cs (Operator::Define): Perform extensive checks to conform
23562 with the rules for operator overloading in the spec.
23564 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23565 some of the other conversions mentioned in the spec.
23567 * typemanager.cs (array_type): New static member for the System.Array built-in
23570 (cloneable_interface): For System.ICloneable interface.
23572 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23573 we start resolving the tree and populating types.
23575 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23577 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23579 * expression.cs (Expression::ExprClassFromMemberInfo,
23580 Expression::Literalize): Create literal expressions from
23581 FieldInfos which are literals.
23583 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23584 type casts, because they were wrong. The test suite in tests
23587 (ImplicitNumericConversion): ushort to ulong requires a widening
23590 Int32 constant to long requires widening cast as well.
23592 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23593 for integers because the type on the stack is not i4.
23595 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23597 * expression.cs (report118): require location argument.
23599 * parameter.cs: Do not dereference potential null value.
23601 * class.cs: Catch methods that lack the `new' keyword when
23602 overriding a name. Report warnings when `new' is used without
23603 anything being there to override.
23605 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23607 * class.cs: Only add constructor to hashtable if it is non-null
23608 (as now constructors can fail on define).
23610 (TypeManager, Class, Struct): Take location arguments.
23612 Catch field instance initialization in structs as errors.
23614 accepting_filter: a new filter for FindMembers that is static so
23615 that we dont create an instance per invocation.
23617 (Constructor::Define): Catch errors where a struct constructor is
23620 * cs-parser.jay: Pass location information for various new
23623 * delegate.cs (Delegate): take a location argument.
23625 * driver.cs: Do not call EmitCode if there were problesm in the
23626 Definition of the types, as many Builders wont be there.
23628 * decl.cs (Decl::Decl): Require a location argument.
23630 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23631 into integers, and find the most appropiate integer for it.
23633 * literal.cs: Implement ULongLiteral.
23635 * rootcontext.cs: Provide better information about the location of
23636 failure when CreateType fails.
23638 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23640 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23643 * expression.cs (Binary::CheckShiftArguments): Add missing type
23645 (Binary::ResolveOperator): Add type to the logical and and logical
23646 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23649 (Binary::DoNumericPromotions): In the case where either argument
23650 is ulong (and most signed types combined with ulong cause an
23651 error) perform implicit integer constant conversions as well.
23653 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23655 * expression.cs (UserImplicitCast): Method should always be
23657 (Invocation::BetterConversion): Simplified test for IntLiteral.
23659 (Expression::ImplicitNumericConversion): Split this routine out.
23660 Put the code that performs implicit constant integer conversions
23663 (Expression::Resolve): Become a wrapper around DoResolve so we can
23664 check eclass and type being set after resolve.
23666 (Invocation::Badness): Remove this dead function
23668 (Binary::ResolveOperator): Do not compute the expensive argumnets
23669 unless we have a union for it.
23671 (Probe::Emit): Is needs to do an isinst and then
23672 compare against null.
23674 (::CanConvert): Added Location argument. If the Location argument
23675 is null (Location.Null), then we do not report errors. This is
23676 used by the `probe' mechanism of the Explicit conversion. We do
23677 not want to generate an error for something that the user
23678 explicitly requested to be casted. But the pipeline for an
23679 explicit cast first tests for potential implicit casts.
23681 So for now, if the Location is null, it means `Probe only' to
23682 avoid adding another argument. Might have to revise this
23685 (ClassCast): New class used to type cast objects into arbitrary
23686 classes (used in Explicit Reference Conversions).
23688 Implement `as' as well.
23690 Reverted all the patches from Ravi below: they were broken:
23692 * The use of `level' as a mechanism to stop recursive
23693 invocations is wrong. That was there just to catch the
23694 bug with a strack trace but not as a way of addressing
23697 To fix the problem we have to *understand* what is going
23698 on and the interactions and come up with a plan, not
23699 just get things going.
23701 * The use of the type conversion cache that I proposed
23702 last night had an open topic: How does this work across
23703 protection domains. A user defined conversion might not
23704 be public in the location where we are applying the
23705 conversion, a different conversion might be selected
23706 (ie, private A->B (better) but public B->A (worse),
23707 inside A, A->B applies, but outside it, B->A will
23710 * On top of that (ie, even if the above is solved),
23711 conversions in a cache need to be abstract. Ie, `To
23712 convert from an Int to a Short use an OpcodeCast', not
23713 `To convert from an Int to a Short use the OpcodeCast on
23714 the variable 5' (which is what this patch was doing).
23716 2001-09-28 Ravi Pratap <ravi@ximian.com>
23718 * expression.cs (Invocation::ConversionExists): Re-write to use
23719 the conversion cache
23721 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23722 cache all conversions done, not just user-defined ones.
23724 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23725 to determine if a conversion exists instead of acutually trying to
23726 perform the conversion. It's faster too.
23728 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23729 and only then attempt the implicit conversion.
23731 2001-09-28 Ravi Pratap <ravi@ximian.com>
23733 * expression.cs (ConvertImplicit): Use a cache for conversions
23734 already found. Check level of recursion and bail out if necessary.
23736 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23738 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23739 Export standard methods that we expect for string operations.
23741 * statement.cs (Block::UsageWarning): Track usage of variables and
23742 report the errors for not used variables.
23744 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23747 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23749 * codegen.cs: remove unnneded code
23751 * expression.cs: Removed BuiltinTypeAccess class
23753 Fix the order in which implicit conversions are
23756 The previous fixed dropped support for boxed conversions (adding a
23757 test to the test suite now)
23759 (UserImplicitCast::CanConvert): Remove test for source being null,
23760 that code is broken. We should not feed a null to begin with, if
23761 we do, then we should track the bug where the problem originates
23762 and not try to cover it up here.
23764 Return a resolved expression of type UserImplicitCast on success
23765 rather than true/false. Ravi: this is what I was talking about,
23766 the pattern is to use a static method as a "constructor" for
23769 Also, do not create arguments until the very last minute,
23770 otherwise we always create the arguments even for lookups that
23771 will never be performed.
23773 (UserImplicitCast::Resolve): Eliminate, objects of type
23774 UserImplicitCast are born in a fully resolved state.
23776 * typemanager.cs (InitCoreTypes): Init also value_type
23777 (System.ValueType).
23779 * expression.cs (Cast::Resolve): First resolve the child expression.
23781 (LValue): Add new method AddressOf to be used by
23784 Change the argument of Store to take an EmitContext instead of an
23785 ILGenerator, because things like FieldExpr need to be able to call
23786 their children expression to generate the instance code.
23788 (Expression::Error, Expression::Warning): Sugar functions for
23791 (Expression::MemberLookup): Accept a TypeContainer instead of a
23792 Report as the first argument.
23794 (Expression::ResolvePrimary): Killed. I still want to improve
23795 this as currently the code is just not right.
23797 (Expression::ResolveMemberAccess): Simplify, but it is still
23800 (Unary::Resolve): Catch errors in AddressOf operators.
23802 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23803 index to a byte for the short-version, or the compiler will choose
23804 the wrong Emit call, which generates the wrong data.
23806 (ParameterReference::Emit, ::Store): same.
23808 (FieldExpr::AddressOf): Implement.
23810 * typemanager.cs: TypeManager: made public variable instead of
23813 * driver.cs: document --fatal.
23815 * report.cs (ErrorMessage, WarningMessage): new names for the old
23816 Error and Warning classes.
23818 * cs-parser.jay (member_access): Turn built-in access to types
23819 into a normal simplename
23821 2001-09-27 Ravi Pratap <ravi@ximian.com>
23823 * expression.cs (Invocation::BetterConversion): Fix to cope
23824 with q being null, since this was introducing a bug.
23826 * expression.cs (ConvertImplicit): Do built-in conversions first.
23828 2001-09-27 Ravi Pratap <ravi@ximian.com>
23830 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23832 2001-09-27 Ravi Pratap <ravi@ximian.com>
23834 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23835 I had introduced long ago (what's new ?).
23837 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23838 the work of all the checking.
23839 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23840 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23842 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23843 that is the right way.
23845 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23846 overloading resolution. Use everywhere instead of cutting and pasting code.
23848 (Binary::ResolveOperator): Use MakeUnionSet.
23850 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23851 we have to convert to bool types. Not complete yet.
23853 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23855 * typemanager.cs (TypeManager::CSharpName): support ushort.
23857 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23858 to provide an expression that performsn an implicit constant int
23859 conversion (section 6.1.6).
23860 (Expression::ConvertImplicitRequired): Reworked to include
23861 implicit constant expression conversions.
23863 (Expression::ConvertNumericExplicit): Finished.
23865 (Invocation::Emit): If InstanceExpression is null, then it means
23866 that we perform a call on this.
23868 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23870 * expression.cs (Unary::Emit): Remove some dead code.
23871 (Probe): Implement Resolve and Emit for `is'.
23872 (Expression::ConvertImplicitRequired): Attempt to do constant
23873 expression conversions here. Maybe should be moved to
23874 ConvertImplicit, but I am not sure.
23875 (Expression::ImplicitLongConstantConversionPossible,
23876 Expression::ImplicitIntConstantConversionPossible): New functions
23877 that tell whether is it possible to apply an implicit constant
23878 expression conversion.
23880 (ConvertNumericExplicit): Started work on explicit numeric
23883 * cs-parser.jay: Update operator constants.
23885 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23886 (Parameters::GetSignature): Hook up VerifyArgs here.
23887 (Parameters::VerifyArgs): Verifies that no two arguments have the
23890 * class.cs (Operator): Update the operator names to reflect the
23891 ones that the spec expects (as we are just stringizing the
23894 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23895 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23896 previous usage did only work for our methods.
23897 (Expression::ConvertImplicit): Handle decimal implicit numeric
23898 conversions as well.
23899 (Expression::InternalTypeConstructor): Used to invoke constructors
23900 on internal types for default promotions.
23902 (Unary::Emit): Implement special handling for the pre/post
23903 increment/decrement for overloaded operators, as they need to have
23904 the same semantics as the other operators.
23906 (Binary::ResolveOperator): ditto.
23907 (Invocation::ConversionExists): ditto.
23908 (UserImplicitCast::Resolve): ditto.
23910 2001-09-26 Ravi Pratap <ravi@ximian.com>
23912 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23913 operator, return after emitting body. Regression tests pass again !
23915 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23916 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23917 (Invocation::OverloadResolve): Ditto.
23918 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23920 * everywhere : update calls to the above methods accordingly.
23922 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23924 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23926 * expression.cs (ExpressionStatement): New base class used for
23927 expressions that can appear in statements, so that we can provide
23928 an alternate path to generate expression that do not leave a value
23931 (Expression::Emit, and all the derivatives): We no longer return
23932 whether a value is left on the stack or not. Every expression
23933 after being emitted leaves a single value on the stack.
23935 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23936 facilties of ExpressionStatement if possible.
23938 * cs-parser.jay: Update statement_expression.
23940 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23942 * driver.cs: Change the wording of message
23944 2001-09-25 Ravi Pratap <ravi@ximian.com>
23946 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23947 the type of the expression to the return type of the method if
23948 we have an overloaded operator match ! The regression tests pass again !
23949 (Unary::ResolveOperator): Ditto.
23951 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23952 to find "op_Implicit", not "implicit" ;-)
23953 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23954 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23956 * everywhere : Correct calls to the above accordingly.
23958 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23959 (ConvertImplicit): Do user-defined conversion if it exists.
23961 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23963 * assign.cs: track location.
23964 (Resolve): Use implicit conversions on assignment.
23966 * literal.cs: Oops. Not good, Emit of short access values should
23967 pass (Bytes) or the wrong argument will be selected.
23969 * expression.cs (Unary::Emit): Emit code for -expr.
23971 (Unary::ResolveOperator): Handle `Substract' for non-constants
23972 (substract from zero from the non-constants).
23973 Deal with Doubles as well.
23975 (Expression::ConvertImplicitRequired): New routine that reports an
23976 error if no implicit conversion exists.
23978 (Invocation::OverloadResolve): Store the converted implicit
23979 expressions if we make them
23981 2001-09-24 Ravi Pratap <ravi@ximian.com>
23983 * class.cs (ConstructorInitializer): Take a Location argument.
23984 (ConstructorBaseInitializer): Same here.
23985 (ConstructorThisInitializer): Same here.
23987 * cs-parser.jay : Update all calls accordingly.
23989 * expression.cs (Unary, Binary, New): Take location argument.
23990 Update accordingly everywhere.
23992 * cs-parser.jay : Update all calls to the above to take a location
23995 * class.cs : Ditto.
23997 2001-09-24 Ravi Pratap <ravi@ximian.com>
23999 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24000 (Invocation::BetterConversion): Same here
24001 (Invocation::ConversionExists): Ditto.
24003 (Invocation::ConversionExists): Implement.
24005 2001-09-22 Ravi Pratap <ravi@ximian.com>
24007 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24008 Also take an additional TypeContainer argument.
24010 * All over : Pass in TypeContainer as argument to OverloadResolve.
24012 * typemanager.cs (CSharpName): Update to check for the string type and return
24015 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24018 2001-09-21 Ravi Pratap <ravi@ximian.com>
24020 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24021 (Invocation::BetterFunction): Implement.
24022 (Invocation::BetterConversion): Implement.
24023 (Invocation::ConversionExists): Skeleton, no implementation yet.
24025 Okay, things work fine !
24027 2001-09-21 Miguel de Icaza <miguel@ximian.com>
24029 * typemanager.cs: declare and load enum_type, delegate_type and
24032 * expression.cs (Expression::Emit): Now emit returns a value that
24033 tells whether a value is left on the stack or not. This strategy
24034 might be reveted tomorrow with a mechanism that would address
24035 multiple assignments.
24036 (Expression::report118): Utility routine to report mismatches on
24039 (Unary::Report23): Report impossible type/operator combination
24042 (Unary::IsIncrementableNumber): Whether the type can be
24043 incremented or decremented with add.
24044 (Unary::ResolveOperator): Also allow enumerations to be bitwise
24046 (Unary::ResolveOperator): Implement ++, !, ~,
24048 (Invocation::Emit): Deal with new Emit convetion.
24050 * All Expression derivatives: Updated their Emit method to return
24051 whether they leave values on the stack or not.
24053 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24054 stack for expressions that are statements.
24056 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24058 * expression.cs (LValue): New interface. Must be implemented by
24060 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24063 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24064 interface for generating code, simplifies the code.
24066 2001-09-20 Ravi Pratap <ravi@ximian.com>
24068 * expression.cs (everywhere): Comment out return statements in ::Resolve
24069 methods to avoid the warnings.
24071 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24073 * driver.cs (parse): Report error 2001 if we can not open the
24076 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24079 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24082 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24083 otherwise nested blocks end up with the same index.
24085 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24087 * expression.cs: Instead of having FIXMEs in the Resolve
24088 functions, throw exceptions so it is obvious that we are facing a
24091 * cs-parser.jay (invocation_expression): Pass Location information.
24093 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24094 Use a basename for those routines because .NET does not like paths
24097 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24100 2001-09-19 Miguel de Icaza <miguel@ximian.com>
24102 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24103 are loading the correct data types (throws an exception if not).
24104 (TypeManager::InitCoreTypes): Use CoreLookupType
24106 * expression.cs (Unary::ResolveOperator): return the child
24107 expression for expressions which are just +expr.
24108 (Unary::ResolveOperator): Return negative literals for -LITERAL
24109 expressions (otherwise they are Unary {Literal}).
24110 (Invocation::Badness): Take into account `Implicit constant
24111 expression conversions'.
24113 * literal.cs (LongLiteral): Implement long literal class.
24114 (IntLiteral): export the `Value' of the intliteral.
24116 2001-09-19 Ravi Pratap <ravi@ximian.com>
24118 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24120 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
24121 instead of 'Operator'
24123 * expression.cs (Binary::ResolveOperator): Update accordingly.
24124 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24127 * cs-parser.jay (unary_expression): Update to use the new names.
24129 * gen-treedump.cs (GetUnary): Same here.
24131 * expression.cs (Unary::Resolve): Implement.
24132 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
24133 operators are found instead of making noise ;-)
24134 (Unary::ResolveOperator): New method to do precisely the same thing which
24135 Binary::ResolveOperator does for Binary expressions.
24136 (Unary.method, .Arguments): Add.
24137 (Unary::OperName): Implement.
24138 (Unary::ForceConversion): Copy and Paste !
24140 * class.cs (Operator::Define): Fix a small bug for the case when we have
24143 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24144 for the inbuilt operators. Only overloading works for now ;-)
24146 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24148 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24149 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24151 * expression.cs (This::Emit): Implement.
24152 (This::Resolve): Implement.
24153 (TypeOf:Resolve): Implement.
24154 (Expression::ResolveSimpleName): Add an implicit this to instance
24156 (MemberAccess::Resolve): Deal with Parameters and Fields.
24157 Bind instance variable to Field expressions.
24158 (FieldExpr::Instance): New field used to track the expression that
24159 represents the object instance.
24160 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24162 (FieldExpr::Emit): Implement.
24164 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24165 the last instruction contains a return opcode to avoid generating
24166 the last `ret' instruction (this generates correct code, and it is
24167 nice to pass the peverify output).
24169 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24170 initializer for static and instance variables.
24171 (Constructor::Emit): Allow initializer to be null in the case of
24172 static constructors. Only emit initializer for instance
24175 (TypeContainer::FindMembers): Return a null array if there are no
24178 Also fix the code for the MemberTypes.Method branch, as it was not
24179 scanning that for operators (or tried to access null variables before).
24181 * assign.cs (Assign::Emit): Handle instance and static fields.
24185 * driver.cs: Stop compilation if there are parse errors.
24187 * cs-parser.jay (constructor_declaration): Provide default base
24188 initializer for non-static constructors.
24189 (constructor_declarator): Do not provide a default base
24190 initializers if none was specified.
24191 Catch the fact that constructors should not have parameters.
24193 * class.cs: Do not emit parent class initializers for static
24194 constructors, that should be flagged as an error.
24196 2001-09-18 Ravi Pratap <ravi@ximian.com>
24198 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24199 Move back code into TypeContainer::Populate.
24201 2001-09-18 Ravi Pratap <ravi@ximian.com>
24203 * class.cs (TypeContainer::AddConstructor): Fix the check to
24204 compare against Name, not Basename.
24205 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24207 * cs-parser.jay : Update accordingly.
24209 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24210 for methods, don't forget to look into the operators too.
24211 (RegisterMethodBuilder): Helper method to take care of this for
24212 methods, constructors and operators.
24213 (Operator::Define): Completely revamp.
24214 (Operator.OperatorMethod, MethodName): New fields.
24215 (TypeContainer::Populate): Move the registering of builders into
24216 RegisterMethodBuilder.
24217 (Operator::Emit): Re-write.
24219 * expression.cs (Binary::Emit): Comment out code path to emit method
24220 invocation stuff for the case when we have a user defined operator. I am
24221 just not able to get it right !
24223 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24225 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24228 (Expression::MemberLookup): Provide a version that allows to
24229 specify the MemberTypes and BindingFlags.
24231 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24232 so it was not fetching variable information from outer blocks.
24234 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24235 Beforefieldinit as it was buggy.
24237 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24238 that Ravi put here.
24240 * class.cs (Constructor::Emit): Only emit if block is not null.
24241 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24242 deal with this by semantically definining it as if the user had
24245 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24246 constructors as we now "emit" them at a higher level.
24248 (TypeContainer::DefineDefaultConstructor): Used to define the
24249 default constructors if none was provided.
24251 (ConstructorInitializer): Add methods Resolve and Emit.
24253 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24255 2001-09-17 Ravi Pratap <ravi@ximian.com>
24257 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24258 the default constructor builder with our hashtable for methodbuilders
24261 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24262 and argument_count is 0 in which case we have a match.
24263 (Binary::ResolveOperator): More null checking and miscellaneous coding
24266 2001-09-17 Ravi Pratap <ravi@ximian.com>
24268 * rootcontext.cs (IsNameSpace): Compare against null.
24270 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24272 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24273 and Unary::Operator.
24275 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24278 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24279 we have overloaded operators.
24280 (Binary::ResolveOperator): Implement the part which does the operator overload
24283 * class.cs (Operator::Emit): Implement.
24284 (TypeContainer::Emit): Emit the operators we have too.
24286 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24287 the case when we have a user-defined operator.
24289 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24291 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24293 2001-09-16 Ravi Pratap <ravi@ximian.com>
24295 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24296 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24297 (Constructor::Emit): Implement.
24298 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24299 if we have no work to do.
24300 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24303 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24304 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24306 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24309 2001-09-15 Ravi Pratap <ravi@ximian.com>
24311 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24313 (Tree::RecordNamespace): Method to do what the name says ;-)
24314 (Tree::Namespaces): Property to get at the namespaces hashtable.
24316 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24319 * rootcontext.cs (IsNamespace): Fixed it :-)
24321 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24323 * class.cs (TypeContainer::FindMembers): Add support for
24325 (MethodCore): New class that encapsulates both the shared aspects
24326 of a Constructor and a Method.
24327 (Method, Constructor): Factored pieces into MethodCore.
24329 * driver.cs: Added --fatal which makes errors throw exceptions.
24330 Load System assembly as well as part of the standard library.
24332 * report.cs: Allow throwing exceptions on errors for debugging.
24334 * modifiers.cs: Do not use `parent', instead use the real type
24335 container to evaluate permission settings.
24337 * class.cs: Put Ravi's patch back in. He is right, and we will
24338 have to cope with the
24340 2001-09-14 Ravi Pratap <ravi@ximian.com>
24342 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24343 FamORAssem, not FamANDAssem.
24345 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24347 * driver.cs: Added --parse option that only parses its input files
24350 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24351 incorrect. IsTopLevel is not used to tell whether an object is
24352 root_types or not (that can be achieved by testing this ==
24353 root_types). But to see if this is a top-level *class* (not
24354 necessarly our "toplevel" container).
24356 2001-09-14 Ravi Pratap <ravi@ximian.com>
24358 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24359 parent instead of a direct call to GetType.
24361 2001-09-14 Ravi Pratap <ravi@ximian.com>
24363 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24364 Modifiers.TypeAttr. This should just be a call to that method.
24366 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24367 object so that we can determine if we are top-level or not.
24369 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24372 * enum.cs (Enum::Define): Ditto.
24374 * modifiers.cs (FieldAttr): Re-write.
24376 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24377 (TypeContainer::HaveStaticConstructor): New property to provide access
24378 to precisely that info.
24380 * modifiers.cs (MethodAttr): Re-write.
24381 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24383 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24384 of top-level types as claimed.
24386 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24388 * expression.cs (MemberLookup): Fruitless attempt to lookup
24389 constructors. Maybe I need to emit default constructors? That
24390 might be it (currently .NET emits this for me automatically).
24391 (Invocation::OverloadResolve): Cope with Arguments == null.
24392 (Invocation::EmitArguments): new function, shared by the new
24393 constructor and us.
24394 (Invocation::Emit): Handle static and instance methods. Emit
24395 proper call instruction for virtual or non-virtual invocations.
24396 (New::Emit): Implement.
24397 (New::Resolve): Implement.
24398 (MemberAccess:Resolve): Implement.
24399 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24400 to track instances.
24401 (FieldExpr::Resolve): Set type.
24403 * support.cs: Handle empty arguments.
24405 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24406 SimpleLookup): Auxiliary routines to help parse a qualifier
24409 Update qualifier_identifier rule.
24411 * codegen.cs: Removed debugging messages.
24413 * class.cs: Make this a global thing, this acts just as a "key" to
24414 objects that we might have around.
24416 (Populate): Only initialize method_builders_to_methods once.
24418 * expression.cs (PropertyExpr): Initialize type from the
24421 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24422 Resolve pattern. Attempt to implicitly convert value to boolean.
24425 * expression.cs: Set the type for the int32/int32 argument case.
24426 (Binary::ResolveOperator): Set the return type to boolean for
24427 comparission operators
24429 * typemanager.cs: Remove debugging print code.
24431 (Invocation::Resolve): resolve type.
24433 * class.cs: Allocate a MemberInfo of the correct size, as the code
24434 elsewhere depends on the test to reflect the correct contents.
24436 (Method::) Keep track of parameters, due to System.Reflection holes
24438 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24441 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24442 of the exact size and return that.
24444 (Class::LookupMethodByBuilder): New function that maps
24445 MethodBuilders to its methods. Required to locate the information
24446 on methods because System.Reflection bit us again.
24448 * support.cs: New file, contains an interface ParameterData and
24449 two implementations: ReflectionParameters and InternalParameters
24450 used to access Parameter information. We will need to grow this
24453 * expression.cs (Invocation::GetParameterData): implement a cache
24454 and a wrapper around the ParameterData creation for methods.
24455 (Invocation::OverloadResolve): Use new code.
24457 2001-09-13 Ravi Pratap <ravi@ximian.com>
24459 * class.cs (TypeContainer::EmitField): Remove and move into
24460 (Field::Define): here and modify accordingly.
24461 (Field.FieldBuilder): New member.
24462 (TypeContainer::Populate): Update accordingly.
24463 (TypeContainer::FindMembers): Implement.
24465 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24467 * statement.cs: (VariableInfo::VariableType): New field to be
24468 initialized with the full type once it is resolved.
24470 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24472 * parameter.cs (GetParameterInfo): Use a type cache to compute
24473 things only once, and to reuse this information
24475 * expression.cs (LocalVariableReference::Emit): Implement.
24476 (OpcodeCast::Emit): fix.
24478 (ParameterReference::Resolve): Implement.
24479 (ParameterReference::Emit): Implement.
24481 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24482 that are expressions need to stay as Expressions.
24484 * typemanager.cs (CSharpName): Returns the C# name of a type if
24487 * expression.cs (Expression::ConvertImplicit): New function that
24488 implements implicit type conversions.
24490 (Expression::ImplicitReferenceConversion): Implements implicit
24491 reference conversions.
24493 (EmptyCast): New type for transparent casts.
24495 (OpcodeCast): New type for casts of types that are performed with
24496 a sequence of bytecodes.
24498 (BoxedCast): New type used for casting value types into reference
24499 types. Emits a box opcode.
24501 (Binary::DoNumericPromotions): Implements numeric promotions of
24502 and computation of the Binary::Type.
24504 (Binary::EmitBranchable): Optimization.
24506 (Binary::Emit): Implement code emission for expressions.
24508 * typemanager.cs (TypeManager): Added two new core types: sbyte
24511 2001-09-12 Ravi Pratap <ravi@ximian.com>
24513 * class.cs (TypeContainer::FindMembers): Method which does exactly
24514 what Type.FindMembers does, only we don't have to use reflection. No
24515 implementation yet.
24517 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24518 typecontainer objects as we need to get at them.
24519 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24521 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24522 typecontainer object.
24524 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24525 of just a Report object.
24527 2001-09-11 Ravi Pratap <ravi@ximian.com>
24529 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24531 (TypeContainer::Populate): Now define the delegates of the type too.
24532 (TypeContainer.Delegates): Property to access the list of delegates defined
24535 * delegates.cs (Delegate::Define): Implement partially.
24537 * modifiers.cs (TypeAttr): Handle more flags.
24539 2001-09-11 Ravi Pratap <ravi@ximian.com>
24541 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24543 (Operator::Define): Re-write logic to get types by using the LookupType method
24544 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24545 (Indexer::Define): Ditto.
24546 (Event::Define): Ditto.
24547 (Property::Define): Ditto.
24549 2001-09-10 Ravi Pratap <ravi@ximian.com>
24551 * class.cs (TypeContainer::Populate): Now define operators too.
24552 (TypeContainer.Operators): New property to access the list of operators
24554 (Operator.OperatorMethodBuilder): New member to hold the method builder
24555 for the operator we are defining.
24556 (Operator::Define): Implement.
24558 2001-09-10 Ravi Pratap <ravi@ximian.com>
24560 * class.cs (Event::Define): Make the prefixes of the accessor methods
24561 addOn_ and removeOn_
24563 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24564 of the location being passed in too. Ideally, this should go later since all
24565 error reporting should be done through the Report object.
24567 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24568 (Populate): Iterate thru the indexers we have and define them too.
24569 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24570 for the get and set accessors.
24571 (Indexer::Define): Implement.
24573 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24575 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24576 my previous implementation, did not work.
24578 * typemanager.cs: Add a couple of missing types (the longs).
24580 * literal.cs: Use TypeManager.bool_type instead of getting it.
24582 * expression.cs (EventExpr): New kind of expressions.
24583 (Expressio::ExprClassFromMemberInfo): finish
24585 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24587 * assign.cs: Emit stores to static fields differently.
24589 2001-09-08 Ravi Pratap <ravi@ximian.com>
24591 * Merge in changes and adjust code to tackle conflicts. Backed out my
24592 code in Assign::Resolve ;-)
24594 2001-09-08 Ravi Pratap <ravi@ximian.com>
24596 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24597 instead Report.Error and also pass in the location.
24598 (CSharpParser::Lexer): New readonly property to return the reference
24599 to the Tokenizer object.
24600 (declare_local_variables): Use Report.Error with location instead of plain
24604 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24605 (Operator.CheckBinaryOperator): Ditto.
24607 * cs-parser.jay (operator_declarator): Update accordingly.
24609 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24610 (CheckBinaryOperator): Same here.
24612 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24613 on the name without any prefixes of namespace names etc. This is because we
24614 already might have something already fully qualified like
24615 'System.Console.WriteLine'
24617 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24619 2001-09-07 Ravi Pratap <ravi@ximian.com>
24621 * cs-tokenizer.cs (location): Return a string which also contains
24624 * expression.cs (ElementAccess): New class for expressions of the
24625 type 'element access.'
24626 (BaseAccess): New class for expressions of the type 'base access.'
24627 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24630 * cs-parser.jay (element_access): Implement action.
24631 (base_access): Implement actions.
24632 (checked_expression, unchecked_expression): Implement.
24634 * cs-parser.jay (local_variable_type): Correct and implement.
24635 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24637 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24639 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24640 name and the specifiers.
24642 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24644 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24645 making them all public ;-)
24647 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24650 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24652 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24654 (FieldExpr, PropertyExprs): New resolved expressions.
24655 (SimpleName::MemberStaticCheck): Perform static checks for access
24656 to non-static fields on static methods. Maybe this should be
24657 generalized for MemberAccesses.
24658 (SimpleName::ResolveSimpleName): More work on simple name
24661 * cs-parser.jay (primary_expression/qualified_identifier): track
24662 the parameter index.
24664 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24665 (EmitContext::EmitBoolExpression): Chain to expression generation
24666 instead of temporary hack.
24667 (::EmitStatementExpression): Put generic expression code generation.
24669 * assign.cs (Assign::Emit): Implement variable assignments to
24670 local variables, parameters and fields.
24672 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24674 * statement.cs (Block::GetVariableInfo): New method, returns the
24675 VariableInfo for a variable name in a block.
24676 (Block::GetVariableType): Implement in terms of GetVariableInfo
24678 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24679 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24681 2001-09-06 Ravi Pratap <ravi@ximian.com>
24683 * cs-parser.jay (operator_declaration): Continue on my quest : update
24684 to take attributes argument.
24685 (event_declaration): Ditto.
24686 (enum_declaration): Ditto.
24687 (indexer_declaration): Ditto.
24689 * class.cs (Operator::Operator): Update constructor accordingly.
24690 (Event::Event): Ditto.
24692 * delegate.cs (Delegate::Delegate): Same here.
24694 * enum.cs (Enum::Enum): Same here.
24696 2001-09-05 Ravi Pratap <ravi@ximian.com>
24698 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24700 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24702 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24703 being passed around as an arraylist.
24704 (Attributes::AddAttribute): Method to add attribute sections.
24706 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24707 (struct_declaration): Update accordingly.
24708 (constant_declaration): Update.
24709 (field_declaration): Update.
24710 (method_header): Update.
24711 (fixed_parameter): Update.
24712 (parameter_array): Ditto.
24713 (property_declaration): Ditto.
24714 (destructor_declaration): Ditto.
24716 * class.cs (Struct::Struct): Update constructors accordingly.
24717 (Class::Class): Ditto.
24718 (Field::Field): Ditto.
24719 (Method::Method): Ditto.
24720 (Property::Property): Ditto.
24721 (TypeContainer::OptAttribute): update property's return type.
24723 * interface.cs (Interface.opt_attributes): New member.
24724 (Interface::Interface): Update to take the extra Attributes argument.
24726 * parameter.cs (Parameter::Parameter): Ditto.
24728 * constant.cs (Constant::Constant): Ditto.
24730 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24731 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24732 the attributes as a parameter.
24733 (InterfaceProperty): Update constructor call.
24734 (InterfaceEvent): Ditto.
24735 (InterfaceMethod): Ditto.
24736 (InterfaceIndexer): Ditto.
24738 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24739 pass the attributes too.
24740 (interface_event_declaration): Ditto.
24741 (interface_property_declaration): Ditto.
24742 (interface_method_declaration): Ditto.
24743 (interface_declaration): Ditto.
24745 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24747 * class.cs (Method::Define): Track the "static Main" definition to
24748 create an entry point.
24750 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24751 EntryPoint if we find it.
24753 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24754 (EmitContext::ig): Make this variable public.
24756 * driver.cs: Make the default output file be the first file name
24757 with the .exe extension.
24759 Detect empty compilations
24761 Handle various kinds of output targets. Handle --target and
24762 rename -t to --dumper.
24764 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24765 methods inherited from Expression return now an Expression. This
24766 will is used during the tree rewriting as we resolve them during
24769 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24770 the spec. Missing entirely is the information about
24771 accessability of elements of it.
24773 (Expression::ExprClassFromMemberInfo): New constructor for
24774 Expressions that creates a fully initialized Expression based on
24775 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24778 (Invocation::Resolve): Begin implementing resolution of invocations.
24780 * literal.cs (StringLiteral): Implement Emit.
24782 2001-09-05 Ravi Pratap <ravi@ximian.com>
24784 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24787 2001-09-04 Ravi Pratap <ravi@ximian.com>
24789 * cs-parser.jay (attribute_arguments): Implement actions.
24790 (attribute): Fix bug in production. Implement action.
24791 (attribute_list): Implement.
24792 (attribute_target): Implement.
24793 (attribute_target_specifier, opt_target_specifier): Implement
24794 (CheckAttributeTarget): New method to check if the attribute target
24796 (attribute_section): Implement.
24797 (opt_attributes): Implement.
24799 * attribute.cs : New file to handle attributes.
24800 (Attribute): Class to hold attribute info.
24802 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24803 (attribute_section): Modify production to use 2 different rules to
24804 achieve the same thing. 1 s/r conflict down !
24805 Clean out commented, useless, non-reducing dimension_separator rules.
24807 * class.cs (TypeContainer.attributes): New member to hold list
24808 of attributes for a type.
24809 (Struct::Struct): Modify to take one more argument, the attribute list.
24810 (Class::Class): Ditto.
24811 (Field::Field): Ditto.
24812 (Method::Method): Ditto.
24813 (Property::Property): Ditto.
24815 * cs-parser.jay (struct_declaration): Update constructor call to
24816 pass in the attributes too.
24817 (class_declaration): Ditto.
24818 (constant_declaration): Ditto.
24819 (field_declaration): Ditto.
24820 (method_header): Ditto.
24821 (fixed_parameter): Ditto.
24822 (parameter_array): Ditto.
24823 (property_declaration): Ditto.
24825 * constant.cs (Constant::Constant): Update constructor similarly.
24826 Use System.Collections.
24828 * parameter.cs (Parameter::Parameter): Update as above.
24830 2001-09-02 Ravi Pratap <ravi@ximian.com>
24832 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24833 (TypeContainer.delegates): New member to hold list of delegates.
24835 * cs-parser.jay (delegate_declaration): Implement the action correctly
24836 this time as I seem to be on crack ;-)
24838 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24840 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24841 tell whether an identifier represents a namespace.
24843 * expression.cs (NamespaceExpr): A namespace expression, used only
24844 temporarly during expression resolution.
24845 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24846 utility functions to resolve names on expressions.
24848 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24850 * codegen.cs: Add hook for StatementExpressions.
24852 * class.cs: Fix inverted test for static flag in methods.
24854 2001-09-02 Ravi Pratap <ravi@ximian.com>
24856 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24857 to make it coincide with MS' number.
24858 (Operator::CheckBinaryOperator): Ditto.
24860 * ../errors/errors.txt : Remove error numbers added earlier.
24862 * ../errors/cs1019.cs : Test case for error # 1019
24864 * ../errros/cs1020.cs : Test case for error # 1020
24866 * cs-parser.jay : Clean out commented cruft.
24867 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24868 used anywhere - non-reducing rule.
24869 (namespace_declarations): Non-reducing rule - comment out.
24871 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24872 with TypeContainer::AddEnum.
24874 * delegate.cs : New file for delegate handling classes.
24875 (Delegate): Class for declaring delegates.
24877 * makefile : Update.
24879 * cs-parser.jay (delegate_declaration): Implement.
24881 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24883 * class.cs (Event::Define): Implement.
24884 (Event.EventBuilder): New member.
24886 * class.cs (TypeContainer::Populate): Update to define all enums and events
24888 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24889 readonly fields for all these cases ?
24891 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24893 * class.cs (Property): Revamp to use the convention of making fields readonly.
24894 Accordingly modify code elsewhere.
24896 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24897 the Define method of the Property class.
24899 * class.cs : Clean up applied patch and update references to variables etc. Fix
24901 (TypeContainer::Populate): Update to define all the properties we have. Also
24902 define all enumerations.
24904 * enum.cs (Define): Implement.
24906 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24908 * cs-parser.jay (overloadable_operator): The semantic value is an
24909 enum of the Operator class.
24910 (operator_declarator): Implement actions.
24911 (operator_declaration): Implement.
24913 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24914 validity of definitions.
24915 (Operator::CheckBinaryOperator): Static method to check for binary operators
24916 (TypeContainer::AddOperator): New method to add an operator to a type.
24918 * cs-parser.jay (indexer_declaration): Added line to actually call the
24919 AddIndexer method so it gets added ;-)
24921 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24922 already taken care of by the MS compiler ?
24924 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24926 * class.cs (Operator): New class for operator declarations.
24927 (Operator::OpType): Enum for the various operators.
24929 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24931 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24932 ostensibly handle this in semantic analysis.
24934 * cs-parser.jay (general_catch_clause): Comment out
24935 (specific_catch_clauses, specific_catch_clause): Ditto.
24936 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24937 (catch_args, opt_catch_args): New productions.
24938 (catch_clause): Rewrite to use the new productions above
24939 (catch_clauses): Modify accordingly.
24940 (opt_catch_clauses): New production to use in try_statement
24941 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24942 and re-write the code in the actions to extract the specific and
24943 general catch clauses by being a little smart ;-)
24945 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24946 Hooray, try and catch statements parse fine !
24948 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24950 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24951 string from the hashtable of variables.
24953 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24954 I end up making that mistake ;-)
24955 (catch_clauses): Fixed gross error which made Key and Value of the
24956 DictionaryEntry the same : $1 !!
24958 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24960 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24962 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24963 when the add and remove accessors are specified.
24965 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24967 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24968 information about indexer_declarator.
24969 (indexer_declarator): Implement actions.
24970 (parsing_indexer): New local boolean used to keep track of whether
24971 we are parsing indexers or properties. This is necessary because
24972 implicit_parameters come into picture even for the get accessor in the
24973 case of an indexer.
24974 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24976 * class.cs (Indexer): New class for indexer declarations.
24977 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24978 (TypeContainer::indexers): New member to hold list of indexers for the
24981 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24983 * cs-parser.jay (add_accessor_declaration): Implement action.
24984 (remove_accessor_declaration): Implement action.
24985 (event_accessors_declaration): Implement
24986 (variable_declarators): swap statements for first rule - trivial.
24988 * class.cs (Event): New class to hold information about event
24990 (TypeContainer::AddEvent): New method to add an event to a type
24991 (TypeContainer::events): New member to hold list of events.
24993 * cs-parser.jay (event_declaration): Implement actions.
24995 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24997 * cs-parser.jay (dim_separators): Implement. Make it a string
24998 concatenating all the commas together, just as they appear.
24999 (opt_dim_separators): Modify accordingly
25000 (rank_specifiers): Update accordingly. Basically do the same
25001 thing - instead, collect the brackets here.
25002 (opt_rank_sepcifiers): Modify accordingly.
25003 (array_type): Modify to actually return the complete type string
25004 instead of ignoring the rank_specifiers.
25005 (expression_list): Implement to collect the expressions
25006 (variable_initializer): Implement. We make it a list of expressions
25007 essentially so that we can handle the array_initializer case neatly too.
25008 (variable_initializer_list): Implement.
25009 (array_initializer): Make it a list of variable_initializers
25010 (opt_array_initializer): Modify accordingly.
25012 * expression.cs (New::NType): Add enumeration to help us
25013 keep track of whether we have an object/delegate creation
25014 or an array creation.
25015 (New:NewType, New::Rank, New::Indices, New::Initializers): New
25016 members to hold data about array creation.
25017 (New:New): Modify to update NewType
25018 (New:New): New Overloaded contructor for the array creation
25021 * cs-parser.jay (array_creation_expression): Implement to call
25022 the overloaded New constructor.
25024 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
25026 * class.cs (TypeContainer::Constructors): Return member
25027 constructors instead of returning null.
25029 2001-08-26 Miguel de Icaza <miguel@ximian.com>
25031 * typemanager.cs (InitCoreTypes): Initialize the various core
25032 types after we have populated the type manager with the user
25033 defined types (this distinction will be important later while
25034 compiling corlib.dll)
25036 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25037 on Expression Classification. Now all expressions have a method
25038 `Resolve' and a method `Emit'.
25040 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25041 generation from working. Also add some temporary debugging
25044 2001-08-24 Miguel de Icaza <miguel@ximian.com>
25046 * codegen.cs: Lots of code generation pieces. This is only the
25047 beginning, will continue tomorrow with more touches of polish. We
25048 handle the fundamentals of if, while, do, for, return. Others are
25049 trickier and I need to start working on invocations soon.
25051 * gen-treedump.cs: Bug fix, use s.Increment here instead of
25054 * codegen.cs (EmitContext): New struct, used during code
25055 emission to keep a context. Most of the code generation will be
25058 * cs-parser.jay: Add embedded blocks to the list of statements of
25059 this block. So code generation proceeds in a top down fashion.
25061 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25063 * statement.cs: Add support for multiple child blocks.
25065 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25067 * codegen.cs (EmitCode): New function, will emit the code for a
25068 Block of code given a TypeContainer and its ILGenerator.
25070 * statement.cs (Block): Standard public readonly optimization.
25071 (Block::Block constructors): Link children.
25072 (Block::Child): Child Linker.
25073 (Block::EmitVariables): Emits IL variable declarations.
25075 * class.cs: Drop support for MethodGroups here, delay until
25077 (Method::): Applied the same simplification that I did before, and
25078 move from Properties to public readonly fields.
25079 (Method::ParameterTypes): Returns the parameter types for the
25080 function, and implements a cache that will be useful later when I
25081 do error checking and the semantic analysis on the methods is
25083 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25084 and made a method, optional argument tells whether this is a class
25085 or a structure to apply the `has-this' bit.
25086 (Method::GetCallingConvention): Implement, returns the calling
25088 (Method::Define): Defines the type, a second pass is performed
25089 later to populate the methods.
25091 (Constructor::ParameterTypes): implement a cache similar to the
25092 one on Method::ParameterTypes, useful later when we do semantic
25095 (TypeContainer::EmitMethod): New method. Emits methods.
25097 * expression.cs: Removed MethodGroup class from here.
25099 * parameter.cs (Parameters::GetCallingConvention): new method.
25101 2001-08-21 Miguel de Icaza <miguel@ximian.com>
25103 * class.cs (TypeContainer::Populate): Drop RootContext from the
25106 (Constructor::CallingConvention): Returns the calling convention.
25107 (Constructor::ParameterTypes): Returns the constructor parameter
25110 (TypeContainer::AddConstructor): Keep track of default constructor
25111 and the default static constructor.
25113 (Constructor::) Another class that starts using `public readonly'
25114 instead of properties.
25116 (Constructor::IsDefault): Whether this is a default constructor.
25118 (Field::) use readonly public fields instead of properties also.
25120 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25121 track of static constructors; If none is used, turn on
25122 BeforeFieldInit in the TypeAttributes.
25124 * cs-parser.jay (opt_argument_list): now the return can be null
25125 for the cases where there are no arguments.
25127 (constructor_declarator): If there is no implicit `base' or
25128 `this', then invoke the default parent constructor.
25130 * modifiers.cs (MethodAttr): New static function maps a set of
25131 modifiers flags into a MethodAttributes enum
25132 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
25133 MethodAttr, TypeAttr to represent the various mappings where the
25134 modifiers are used.
25135 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
25137 2001-08-19 Miguel de Icaza <miguel@ximian.com>
25139 * parameter.cs (GetParameterInfo): Fix bug where there would be no
25142 * interface.cs (PopulateIndexer): Implemented the code generator
25143 for interface indexers.
25145 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25147 * interface.cs (InterfaceMemberBase): Now we track the new status
25150 (PopulateProperty): Implement property population. Woohoo! Got
25151 Methods and Properties going today.
25153 Removed all the properties for interfaces, and replaced them with
25154 `public readonly' fields.
25156 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25158 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25159 initialize their hashtables/arraylists only when they are needed
25160 instead of doing this always.
25162 * parameter.cs: Handle refs and out parameters.
25164 * cs-parser.jay: Use an ArrayList to construct the arguments
25165 instead of the ParameterCollection, and then cast that to a
25168 * parameter.cs: Drop the use of ParameterCollection and use
25169 instead arrays of Parameters.
25171 (GetParameterInfo): Use the Type, not the Name when resolving
25174 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25176 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25177 and instead use public readonly fields.
25179 * class.cs: Put back walking code for type containers.
25181 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25183 * class.cs (MakeConstant): Code to define constants.
25185 * rootcontext.cs (LookupType): New function. Used to locate types
25188 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25190 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25191 this System.Reflection code is. Kudos to Microsoft
25193 * typemanager.cs: Implement a type cache and avoid loading all
25194 types at boot time. Wrap in LookupType the internals. This made
25195 the compiler so much faster. Wow. I rule!
25197 * driver.cs: Make sure we always load mscorlib first (for
25198 debugging purposes, nothing really important).
25200 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25201 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25203 * rootcontext.cs: Lookup types on their namespace; Lookup types
25204 on namespaces that have been imported using the `using' keyword.
25206 * class.cs (TypeContainer::TypeAttr): Virtualize.
25207 (Class::TypeAttr): Return attributes suitable for this bad boy.
25208 (Struct::TypeAttr): ditto.
25209 Handle nested classes.
25210 (TypeContainer::) Remove all the type visiting code, it is now
25211 replaced with the rootcontext.cs code
25213 * rootcontext.cs (GetClassBases): Added support for structs.
25215 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25217 * interface.cs, statement.cs, class.cs, parameter.cs,
25218 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25219 Drop use of TypeRefs, and use strings instead.
25221 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25225 * class.cs (Struct::Struct): set the SEALED flags after
25226 checking the modifiers.
25227 (TypeContainer::TypeAttr): new property, returns the
25228 TypeAttributes for a class.
25230 * cs-parser.jay (type_list): Oops, list production was creating a
25231 new list of base types.
25233 * rootcontext.cs (StdLib): New property.
25234 (GetInterfaceTypeByName): returns an interface by type name, and
25235 encapsulates error handling here.
25236 (GetInterfaces): simplified.
25237 (ResolveTree): Encapsulated all the tree resolution here.
25238 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25241 * driver.cs: Add support for --nostdlib, to avoid loading the
25242 default assemblies.
25243 (Main): Do not put tree resolution here.
25245 * rootcontext.cs: Beginning of the class resolution.
25247 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25249 * rootcontext.cs: Provide better error reporting.
25251 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25253 * rootcontext.cs (CreateInterface): Handle the case where there
25254 are no parent interfaces.
25256 (CloseTypes): Routine to flush types at the end.
25257 (CreateInterface): Track types.
25258 (GetInterfaces): Returns an array of Types from the list of
25259 defined interfaces.
25261 * typemanager.c (AddUserType): Mechanism to track user types (puts
25262 the type on the global type hash, and allows us to close it at the
25265 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25267 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25268 RecordInterface instead.
25270 * cs-parser.jay: Updated to reflect changes above.
25272 * decl.cs (Definition): Keep track of the TypeBuilder type that
25273 represents this type here. Not sure we will use it in the long
25274 run, but wont hurt for now.
25276 * driver.cs: Smaller changes to accomodate the new code.
25278 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25281 * rootcontext.cs (CreateInterface): New method, used to create
25282 the System.TypeBuilder type for interfaces.
25283 (ResolveInterfaces): new entry point to resolve the interface
25285 (CodeGen): Property, used to keep track of the code generator.
25287 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25289 * cs-parser.jay: Add a second production for delegate_declaration
25292 (enum_body): Put an opt_comma here instead of putting it on
25293 enum_body or enum_member_declarations so we can handle trailing
25294 commas on enumeration members. Gets rid of a shift/reduce.
25296 (type_list): Need a COMMA in the middle.
25298 (indexer_declaration): Tell tokenizer to recognize get/set
25300 * Remove old targets.
25302 * Re-add the parser target.
25304 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25306 * cs-parser.jay: Add precendence rules for a number of operators
25307 ot reduce the number of shift/reduce conflicts in the grammar.
25309 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25311 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25314 Get rid of old crufty code.
25316 * rootcontext.cs: Use this to keep track of the parsed
25317 representation and the defined types available to the program.
25319 * gen-treedump.cs: adjust for new convention.
25321 * type.cs: Split out the type manager, and the assembly builder
25324 * typemanager.cs: the type manager will live here now.
25326 * cil-codegen.cs: And the code generator here.
25328 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25330 * makefile: Fixed up for easy making.
25332 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25334 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25337 (unary_expression): Expand pre_increment_expression and
25338 post_decrement_expression to reduce a shift/reduce.
25340 2001-07-11 Simon Cozens
25342 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25344 Improve allow_keyword_as_indent name.
25346 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25348 * Adjustments for Beta2.
25350 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25352 * decl.cs: Added `Define' abstract method.
25353 (InTransit): new property, used to catch recursive definitions.
25355 * interface.cs: Implement `Define'.
25357 * modifiers.cs: Map Modifiers.constants to
25358 System.Reflection.TypeAttribute flags.
25360 * class.cs: Keep track of types and user-defined types.
25361 (BuilderInit): New method for creating an assembly
25362 (ResolveType): New function to launch the resolution process, only
25363 used by interfaces for now.
25365 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25366 that are inserted into the name space.
25368 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25370 * ARGH. I have screwed up my tree so many times due to the use of
25371 rsync rather than using CVS. Going to fix this at once.
25373 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25376 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25378 * Experiment successful: Use System.Type rather that our own
25381 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25383 * cs-parser.jay: Removed nsAliases from here.
25385 Use new namespaces, handle `using XXX;'
25387 * namespace.cs: Reimplemented namespace handling, use a recursive
25388 definition of the class. Now we can keep track of using clauses
25389 and catch invalid using clauses.
25391 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25393 * gen-treedump.cs: Adapted for all the renaming.
25395 * expression.cs (Expression): this class now has a Type property
25396 which returns an expression Type.
25398 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25399 `Type', as this has a different meaning now in the base
25401 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25403 * interface.cs, class.cs: Removed from all the sources the
25404 references to signature computation, as we can not do method
25405 signature computation during the parsing time, as we are not
25406 trying to solve at that point distinguishing:
25410 void a (NS.Blah x) {}
25413 Which depending on the context might be valid or not, as we do not
25414 know if Blah is the same thing as NS.Blah at that point.
25416 * Redid everything so the code uses TypeRefs now instead of
25417 Types. TypeRefs are just temporary type placeholders, that need
25418 to be resolved. They initially have a pointer to a string and the
25419 current scope in which they are used. This is used later by the
25420 compiler to resolve the reference to an actual Type.
25422 * DeclSpace is no longer a CIR.Type, and neither are
25423 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25424 are all DeclSpaces, but no Types.
25426 * type.cs (TypeRefManager): This implements the TypeRef manager,
25427 which keeps track of all the types that need to be resolved after
25428 the parsing has finished.
25430 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25432 * ARGH. We are going to have to store `foreach' as a class rather
25433 than resolving it, as we need to verify error 1579 after name
25434 resolution. *OR* we could keep a flag that says `This request to
25435 IEnumerator comes from a foreach statement' which we can then use
25436 to generate the error.
25438 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25440 * class.cs (TypeContainer.AddMethod): we now add methods to the
25441 MethodGroup instead of the method hashtable.
25443 * expression.cs: Add MethodGroup abstraction, which gets us one
25444 step closer to the specification in the way we handle method
25447 * cs-parser.jay (primary_expression): qualified_identifier now
25448 tried to match up an identifier to a local variable reference or
25449 to a parameter reference.
25451 current_local_parameters is now a parser global variable that
25452 points to the current parameters for the block, used during name
25455 (property_declaration): Now creates an implicit `value' argument to
25458 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25460 * parameter.cs: Do not use `param' arguments as part of the
25461 signature, per the spec.
25463 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25465 * decl.cs: Base class for classes, structs and interfaces. This
25466 is the "Declaration Space"
25468 * cs-parser.jay: Use CheckDef for checking declaration errors
25469 instead of having one on each function.
25471 * class.cs: Factor out some code for handling error handling in
25472 accordance to the "Declarations" section in the "Basic Concepts"
25473 chapter in the ECMA C# spec.
25475 * interface.cs: Make all interface member classes derive from
25476 InterfaceMemberBase.
25478 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25480 * Many things: all interfaces are parsed and generated in
25481 gen-treedump. Support for member variables, constructors,
25482 destructors, properties, constants is there.
25484 Beginning of the IL backend, but very little done, just there for
25487 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25489 * cs-parser.jay: Fix labeled statement.
25491 * cs-tokenizer.cs (escape): Escape " and ' always.
25492 ref_line, ref_name: keep track of the line/filename as instructed
25493 by #line by the compiler.
25496 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25498 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25499 to match the values in System.CodeDOM.
25501 Divid renamed to Divide.
25503 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25505 (Statements.set): remove.
25507 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25510 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25511 falseStatements always have valid values.
25513 * cs-parser.jay: Use System.CodeDOM now.