1 2005-12-03 Ben Maurer <bmaurer@ximian.com>
3 * anonymous.cs: Have the param code handle leaving copies on the
4 stack etc. Allows anonymous params to take part in the assignment
5 code (++, +=, etc). Fixes bug #76550
7 * expression.cs: Handle the prepare_for_load/leave_copy by passing
8 it down to the anon code.
10 * iterators.cs: Use dummy var here
12 * codegen.cs: Handle new vars
14 2005-12-01 Marek Safar <marek.safar@seznam.cz>
17 * class.cs (MethodData.Define): Set proper Obsolete context.
19 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
21 (FieldExpr.DoResolve): Ditto.
23 2005-12-01 Marek Safar <marek.safar@seznam.cz>
26 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
27 parent is not obsolete.
29 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
31 * doc.cs : (FindDocumentedMember) find parameterless members first
32 and get CS0419 in the early stage. Fixed first case of bug #76727.
34 2005-11-30 Marek Safar <marek.safar@seznam.cz>
37 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
38 no error was reported.
40 *expression.cs (Binary.DoResolve): left can be null.
42 2005-11-22 Marek Safar <marek.safar@seznam.cz>
45 * class.cs (MethodData.Emit): Parameters should be labeled first.
47 2005-11-21 Marek Safar <marek.safar@seznam.cz>
50 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
52 2005-11-18 Marek Safar <marek.safar@seznam.cz>
54 * attribute.cs (AreParametersCompliant): Moved to Parameter.
56 * class.cs (MethodCore): Parameter clean up.
57 (IMethodData): Added ParameterInfo.
58 (MethodData): Parameter clean up.
59 (Indexer.Define): Parameter clean up.
71 * typemanager.cs: Parameter clean up.
73 * delegate.cs (Define): Get rid of duplicated code.
75 * expression.cs (ParameterReference): Removed useless parameters
79 * parameter.cs (ParamsParameter): New class, params specialization.
80 (ArglistParameter): Attemp to separate arglist.
81 (Parameter): Refactored to be reusable and faster.
82 (Parameter.Modifier): Made understandable.
83 (Parameters): Changed to be used as a class for `this' assembly
84 parameters. Refactored to use new specialized classes.
86 * support.cs (ParameterData): Added Types property.
87 (InternalParameters): Deleted.
89 2005-08-20 Martin Baulig <martin@ximian.com>
91 Merging this patch from GMCS to fix #75867.
93 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
94 scope if we don't already have it.
96 2005-11-17 Martin Baulig <martin@ximian.com>
99 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
100 inherit the scope from our parent. Fixes #76653.
102 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
104 * doc.cs : the previous patch does not actually fix the bug.
105 PropertyInfo override check is now implemented and really fixed it.
106 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
108 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
110 * doc.cs : apply "override filter" also to properties.
113 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
115 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
116 no need to check overrides. For classes, omit those results from
117 interfaces since they must exist in the class. Fixed bug #76726.
119 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
121 * typemanager.cs : (GetFullNameSignature) differentiate indexers
122 with different parameters. Fixed the second problem in #76685.
124 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
126 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
127 get expected 'protected' access in CheckValidFamilyAccess()).
130 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
132 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
133 Fixed bug #76705. CS1569 was incorrectly commented out.
135 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
137 * doc.cs : use Invocation.IsOverride() to do real override check.
138 * expression.cs : made Invocation.IsOverride() internal.
140 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
142 * doc.cs : use TypeManager.FindMembers() instead of (possible)
143 TypeBuilder.FindMembers() and filter overriden base members out.
146 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
148 * doc.cs : ref/out parameters are represented as '@' (instead of
149 '&' in type FullName). Fixed bug #76630 (additionally crefs).
151 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
153 * doc.cs : when there was no '.' in cref to methods in doc comment,
154 then parameters were missing in the output. Fixed bug #76691.
156 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
158 * driver.cs : don't output docs when there is an error.
161 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
164 Now it should detect indexers. Fixed primary concern in bug #76685.
165 Fixed CS0419 message to not show the identical member signature in
168 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
170 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
171 instead of Type.FindMembers() since it does not handle events.
174 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
176 * codegen.cs: Fixed typo (speficied -> specified).
178 2005-11-11 Marek Safar <marek.safar@seznam.cz>
181 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
183 2005-11-11 Marek Safar <marek.safar@seznam.cz>
185 * attribute.cs: Changed error message.
187 * cs-tokenizer.cs: One more check.
189 2005-11-10 Marek Safar <marek.safar@seznam.cz>
191 * statement.cs (Block.Resolve): Ignore empty statement.
193 2005-11-10 Marek Safar <marek.safar@seznam.cz>
195 * report.cs: Made error/warning methods more strict to avoid
198 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
199 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
200 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
201 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
203 2005-11-08 Marek Safar <marek.safar@seznam.cz>
205 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
206 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
208 * class.cs (TypeContainer.IsComImport): New property.
209 (Constructor.Define): Create proper ctor for ComImport types.
211 * expression.cs (New.CheckComImport): Fixed.
213 2005-11-07 Miguel de Icaza <miguel@novell.com>
215 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
216 that a parameter has been captured does not mean that we do not
217 have to do the rest of the processing. This fixes the second part
218 of #76592. If there was another anonymous method capturing
219 values in the past, the Scope would never be set for the second
220 method that captured the same parameter.
222 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
223 properly manipulate the stack. Second part of fix for #76592.
225 * expression.cs (New): Add support for invoking "new" on
226 interfaces that have been flagged with the ComImport attribute and
227 the CoClass. Fixes #76637
229 * statement.cs (Try.DoEmit): When a variable is captured, do not
230 try to emit the vi.LocalBuilder variable as it has been captured.
231 Create a temporary variable and store the results on the
232 FieldBuilder. Fixes #76642
234 2005-11-07 Marek Safar <marek.safar@seznam.cz>
236 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
238 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
240 * expression.cs (Binary.DoResolve): Added && optimalization.
242 * typemanager.cs (AddUserType): Removed useless argument.
244 2005-11-04 Marek Safar <marek.safar@seznam.cz>
246 * statement.cs (Block.variables): Uses ListDictionary.
248 2005-11-03 Marek Safar <marek.safar@seznam.cz>
251 * class.cs (PartialContainer.EmitType): Customized to emit
253 (ClassPart.ApplyAttributeBuilder): Transform security attribute
256 2005-11-03 Marek Safar <marek.safar@seznam.cz>
259 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
260 access has to be fixed.
262 * typemanager.cs (IsUnmanagedType): Wrong common field type.
264 2005-11-01 Marek Safar <marek.safar@seznam.cz>
267 * ecore.cs (NullCast.Reduce): Implemented.
269 * expression.cs (ArrayCreation.CheckIndices): Correcly check
272 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
274 (Foreach.Resolve): Catch null properly.
276 2005-10-29 Marek Safar <marek.safar@seznam.cz>
278 * cs-tokenizer.cs: Warning text fix.
280 * driver.cs: AllWarningNumbers exposed on public interface.
282 * report.cs (): Reviewed warning numbers.
283 (IsValidWarning): Use binary search.
285 2005-10-29 Marek Safar <marek.safar@seznam.cz>
287 * driver.cs: Implemeted resource visibility.
288 (Resources): New class for code sharing between /res: and
291 2005-10-28 Marek Safar <marek.safar@seznam.cz>
294 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
297 * convert (Convert.ImplicitReferenceConversion): NullCast holds
300 * ecore.cs (NullCast): Child is contant only.
302 * literal.cs (NullLiteral.Reduce): null can be converted to any
305 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
307 * driver.cs: Use Encoding.Default as default code page instead
310 2005-10-27 Raja R Harinath <rharinath@novell.com>
313 * expression.cs (Invocation.Error_InvalidArguments): Handle
314 __arglist parameters.
315 (Invocation.VerifyArgumentsCompat): Likewise.
316 * support.cs (ReflectionParameters.GetSignatureForError): Print
317 __arglist parameters.
318 (InternalParamters.GetSignatureForError): Likewise.
319 * parameter.cs (Parameters.GetSignatureForError): Likewise.
321 2005-10-26 Marek Safar <marek.safar@seznam.cz>
323 * attribute.cs (GetPropertyValue): Made public.
325 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
327 Add new property WrapNonExceptionThrows to handle 2.0 assembly
329 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
332 * driver.cs: Reflect method name change.
334 * statement.cs (Try.Resolve): Warn when try has both general
337 * typemanager.cs: runtime_compatibility_attr_type new predefined
340 2005-10-26 Raja R Harinath <harinath@gmail.com>
343 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
344 treat it as an empty parameter list.
346 2005-10-26 Raja R Harinath <rharinath@novell.com>
349 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
350 ResolveAsTypeStep silent.
351 * statement.cs (Block.AddConstant): Mark block as used.
352 (Block.ResolveMeta): Avoid piling on error messages
353 if a constant initializer resolution fails.
355 2005-10-25 Raja R Harinath <rharinath@novell.com>
357 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
359 (NamespaceEntry.VerifyAllUsing): New.
360 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
361 behaviour. Delegates actual resolution of alias to ...
362 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
363 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
365 * driver.cs (Driver.MainDriver): Update.
367 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
368 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
370 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
372 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
373 RootNamespace.DefineNamespacesForAll.
375 2005-10-24 Raja R Harinath <harinath@gmail.com>
377 * typemanager.cs (assemblies, external_aliases, modules)
378 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
379 (ComputeNamespaces, GetRootNamespace): Remove extra staging
380 overhead. Move resposibility ...
381 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
382 * driver.cs, attribute.cs, codegen.cs: Update to changes.
384 2005-10-23 Raja R Harinath <harinath@gmail.com>
386 * namespace.cs (RootNamespace.all_namespaces): Renamed from
387 cached_namespaces. Improve usage.
388 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
389 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
390 Move from GlobalRootNamespace and simplify.
391 (RootNamespace.Global): Make instance variable.
392 (RootNamespace.RootNamespace): Add "alias name" parameter.
393 (GlobalRootNamespace): Simplify drastically.
394 (Namespace.Lookup): Don't use GetNamespace.
395 * typemanager.cs (GetRootNamespace): Rename from
396 ComputeNamespaceForAlias.
397 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
399 2005-10-23 Marek Safar <marek.safar@seznam.cz>
401 * anonymous.cs (AnonymousContainer): Don't crash when container
404 2005-10-23 Marek Safar <marek.safar@seznam.cz>
406 * expression.cs (Binary.DoResolve): Warn when comparing same
409 2005-10-23 Marek Safar <marek.safar@seznam.cz>
412 * expression.cs (Binary.DoResolve): It looks like there are no
413 convetsion rules in enum context.
415 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
417 Add support for extern alias qualifiers.
418 * typemanager.cs: Move some LookupTypeReflection code
419 to namespace.cs, to have cleaner code. Added some methods
420 to help us keep track of the extern aliased references.
421 * driver.cs: Add suport for extern alias assemblies on command
422 line and check for their warnings/errors. Also keep track of the
423 extern aliased assemblies.
424 * namespace.cs: Move the global functionality of Namespace
425 to GlobalRootNamespace/RootNamespace. Now the global namespace
426 is GlobalRootNamespace.Globa. Also the code moved from
427 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
428 Finally added LocalAliasEntry (AliasEntry before) and
429 ExternAliasEntry, to handle alias statements.
430 * cs-parser.jay: Add support in the grammar for extern alias
432 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
433 Update callings to Namespace (now in GlobalRootNamespace).
435 2005-10-18 Raja R Harinath <rharinath@novell.com>
438 * class.cs (TypeContainer.DefineType): Move updating of
439 topological sort earlier in the code.
440 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
442 2005-10-18 Marek Safar <marek.safar@seznam.cz>
445 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
447 * constant.cs (Constant.TryReduce): Moved from Cast class.
448 (Reduce): Made little bit more OO and fixed missing conversions.
450 * ecore.cs (Reduce): Implemented.
451 (Binary.EnumLiftUp): New method to upgrade values to enum values.
453 * literal.cs (Reduce): Implemented.
455 * class.cs: Reverted Miguel's wrong commit.
457 2005-10-14 Miguel de Icaza <miguel@novell.com>
459 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
461 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
463 * cs-parser.jay, expression.cs : CS0214 was missing error location
464 for constants. Fixed bug #76404.
466 2005-10-11 Marek Safar <marek.safar@seznam.cz>
469 * convert.cs (ExplicitConversionCore): Fixed object->enum
472 2005-10-10 Raja R Harinath <rharinath@novell.com>
474 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
476 (PropertyExpr.EmitCall): Likewise.
477 * expression.cs (Invocation.EmitArguments): Handle case where
479 (Invocation.EmitCall): Avoid allocating temporary variable if
480 there are no arguments.
482 2005-10-07 Raja R Harinath <rharinath@novell.com>
485 * convert.cs (ImplicitConversionStandard): Move conversion of
486 void* to arbitrary pointer types ...
487 (ExplicitConversionStandard): .. here.
488 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
489 error to always print typenames.
491 2005-10-07 Raja R Harinath <rharinath@novell.com>
493 * convert.cs (GetConversionOperator): Rename from
494 GetConversionOperators. Move operator selection code from ...
495 (UserDefinedConversion): ... here.
497 2005-10-06 Marek Safar <marek.safar@seznam.cz>
499 * convert.cs (ExplicitConversionCore): Removed duplicate enum
502 2005-10-05 Marek Safar <marek.safar@seznam.cz>
504 * assign.cs (Assign.DoResolve): Error method changed.
506 * cfold.cs (DoConstantNumericPromotions): Error method changed.
508 * const.cs (ResolveValue): Reset in_transit immediately.
510 * constant.cs: Error method changed.
512 * convert.cs: Removed useless location parameter.
513 (ExplicitNumericConversion): Don't do double enum check.
514 (ExplicitConversionCore): Renamed from ExplicitConversion.
515 (ExplicitUnsafe): Extracted from ExplicitConversion.
516 (ExplicitConversion): Uses for error reporting.
518 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
520 (ResolveBoolean): Uses common error method.
521 (CastToDecimal): Get rid of ec.
522 (CastFromDecimal): Optimized.
523 (ConvCast): Get rid of ec.
525 * enum.cs (ResolveValue): Reset in_transit immediately.
526 (Emit): Return after first error.
528 * expression.cs: Convert changes.
530 * literal.cs: Error method changed.
532 * statement.cs: Error method changed.
534 2005-10-03 Raja R Harinath <rharinath@novell.com>
536 * support.cs (SeekableStreamReader.Position): Don't error out when
537 the requested position is just beyond the end of the current
540 2005-09-28 Raja R Harinath <rharinath@novell.com>
542 * support.cs (SeekableStreamReader): Simplify drastically. Don't
543 try to keep in sync with the byte count of the underlying Stream.
544 However, this limits us to a window size of 2048 characters: i.e.,
545 the maximum lookahead of our lexer/parser can be 2048 characters.
547 2005-09-28 Marek Safar <marek.safar@seznam.cz>
550 * driver.cs: Fix compilation files with full root path.
552 2005-09-25 Miguel de Icaza <miguel@novell.com>
554 * report.cs (SymbolRelatedToPreviousError): Format the output so
555 it does not use an open parenthesis that is never closed.
557 * driver.cs: Follow coding guidelines
559 2005-09-27 Marek Safar <marek.safar@seznam.cz>
562 * const.cs (Const.ResolveValue): Check for assigning non-null
563 value to reference type.
565 2005-09-27 Marek Safar <marek.safar@seznam.cz>
567 * anonymous.cs: Implemented ExprClassName.
569 * assign.cs (Assign.DoResolve): Don't chrash when type is not
572 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
575 * class.cs (StaticClass.DefineContainerMembers): Report protected
578 * codegen.cs: if(ed) PRODUCTION.
580 * convert.cs (Error_CannotImplicitConversion): Better error
583 * cs-parser.jay: More error checks.
585 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
587 * driver.cs (CSCParseOption): Enabled wrong option check.
589 * ecore.cs (Expression.ExprClassName): Turned to property.
590 (MemberExpr.CheckIntermediateModification): For checking boxed
591 value types modification.
593 * statement.cs (Fixed.Resolve): Expression type must be
594 convertible to fixed type.
595 (CollectionForeach.GetEnumeratorFilter,TryType):
596 Small refactoring for easier error checking.
598 2005-09-26 Marek Safar <marek.safar@seznam.cz>
600 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
603 * class.cs (GeneratedBaseInitializer): New class for customization
604 compiler generated initializers.
605 (MemberBase.DoDefine): Check Obsolete attribute here.
606 (FieldMember.DoDefine): Ditto.
608 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
611 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
612 (MemberCore.GetObsoleteAttribute): Removed argument.
613 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
614 (MemberCore.CheckObsoleteType): New helper.
618 * statement.cs: Updates after MemberCore changes.
620 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
621 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
623 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
624 obsolete attribute for compiler construct.
625 (As.DoResolve): Cache result.
627 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
629 2005-09-26 Raja R Harinath <rharinath@novell.com>
632 * expression.cs (This.VerifyFixed): In a value type T, the type of
633 'this' is T&, iow, 'this' is either an out or ref parameter. In a
634 value type R, 'this' is treated as a value parameter.
636 2005-09-22 Miguel de Icaza <miguel@novell.com>
638 * statement.cs (Lock): Use the TemporaryVariable class instead of
639 manually using local variables as those do not work when variables
642 * ecore.cs: Moved the TemporaryVariable class from being a nested
643 class inside Foreach to be a public class that can be employed in
646 2005-09-19 Marek Safar <marek.safar@seznam.cz>
648 * cs-parser.jay: interface_accessors replaced by
649 accessor_declarations.
651 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
654 * statement.cs (GotoCase.Resolve): Convert null constant to
656 (SwitchLabel.ResolveAndReduce): Ditto.
657 (SwitchLabel.NullStringCase): Custom null stamp.
658 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
660 typemanager.cs (CSharpSignature): Don't skip first argument
663 2005-09-18 Miguel de Icaza <miguel@novell.com>
665 * driver.cs: Set InEmacs based on the environment variable EMACS.
667 * location.cs (InEmacs): in this mode, do not report column
668 location as it confuses Emacs.
670 2005-09-16 Marek Safar <marek.safar@seznam.cz>
672 * cfold.cs, constant.cs, convert.cs, ecore.cs,
673 expression.cs, iterators.cs, literal.cs: Store constants and
676 * class.cs (MemberBase.ShortName): Pass location.
678 * cs-parser.jay: Some location fixes.
680 * ecore.cs (Expression.Location): Made virtual.
682 2005-09-05 Miguel de Icaza <miguel@novell.com>
684 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
685 if the underlying types are the same, otherwise we need to produce
686 code that will do the proper cast.
688 This was exposed by Marek's constant rewrite which produced
689 invalid code for the call site:
696 This fixes test-49.cs
698 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
700 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
701 Type/Object should be allowed as well. Fixed bug #75968.
703 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
705 * expression.cs : (Binary.DoResolve): when one is enum constant and
706 another is constant 0, then return enum one *as enum type*.
709 2005-09-02 Raja R Harinath <rharinath@novell.com>
711 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
715 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
716 flow-branching for LocalVariableReferences in case we were invoked
718 * expression.cs (LocalVariableReference.VerifyAssigned): New.
720 (LocalVariableReference.DoResolveBase): ... this.
721 (MemberAccess.Resolve): Do the check that was disabled during
724 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
727 (PartialContainer.Create): check abstract/sealed/static strictly
728 but abstract/sealed can exist only at one side. Fixed bug #75883.
730 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
733 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
734 specified, don't default to UnmanagedType.I4.
736 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
738 * expression.cs : conditional operator should check possibly
739 incorrect assign expression. Fixed bug #75946.
741 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
743 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
744 Reverting the change. gmcs is much complex than mcs on this matter.
746 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
748 * cs-tokenizer.cs : To read another token ahead of the actual
749 consumption, use new SavedToken and cache token instead of moving
750 back the stream with SeekableStreamReader (it seemed problematic).
752 driver.cs : Thus use StreamReader directly.
753 * support.cs : Thus removed SeekableStreamReader.
755 2005-08-30 Raja R Harinath <rharinath@novell.com>
758 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
759 (ScopeInfo.EmitScopeType): Use it to construct field names from
760 names of captured locals.
763 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
764 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
765 Pass 'target_type' to BoxedCast. Don't default to 'object'.
766 (ExplicitConversion): Remove enum cases already handled by
767 implicit conversion. Move implicit conversion check to the beginning.
768 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
769 * expression.cs (ArrayCreation.EmitDynamicInitializers):
770 Don't treat System.Enum as a struct.
772 2005-08-30 Jb Evain <jbevain@gmail.com>
774 * attribute.cs: handles as expression in parameters.
776 2005-08-30 Raja R Harinath <rharinath@novell.com>
779 * class.cs (TypeContainer.VerifyClsName): Don't use a
780 PartialContainer when verifying CLS compliance.
781 (AbstractPropertyEventMethod): Set Parent here, ...
782 (PropertyMethod): ... not here.
784 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
786 * attribute.cs : escaped attribute name should not be allowed to be
787 resolved (e.g. @class as classAttribute). Fixed bug #75930.
789 2005-08-29 Raja R Harinath <rharinath@novell.com>
792 * convert.cs (ImplicitStandardConversionExists): Allow zero also
793 when converting a long constant to unsigned long.
794 * expression.cs (Invocation.OverloadResolve): Add sanity check to
795 detect where IsApplicable and VerifyArgumentsCompat disagree.
797 2005-08-29 Raja R Harinath <rharinath@novell.com>
798 and Carlos Alberto Cortez <carlos@unixmexico.org>
801 * class.cs (TypeContainer.CanElideInitializer): New helper.
802 (TypeContainer.EmitFieldInitializers): Use it to determine if we
803 can safely emitting the initializer of a field.
805 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
807 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
808 allowed inside a switch (without loop). Fixed bug #75433.
810 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
812 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
813 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
815 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
817 * driver.cs : kinda reverting the default encoding changes (not exact
818 revert since I noticed that "codepage:reset" might not work fine).
820 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
822 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
823 Location. Now getter and setter store location correctly.
824 (errors/cs0111-12.cs now reports the expected location.)
826 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
828 * driver.cs : Use default encoding on the environment.
829 Removed (now that) extra parameter for SeekableStreamReader.
830 * support.cs : (SeekableStreamReader) third .ctor() argument for
831 StreamReader is not required (always true). preamble size could
832 be acquired in simpler and safe way.
834 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
836 * cs-parser.jay: report CS0642 at warning level 3
837 and report CS0642 for an if else statement also
838 fixes bug #74745. Patch by John Luke (and a bit
840 Removed extra CS0642 warning check for "while",
842 * statement.cs: In Block.Resolve(), CS0642 check
843 is reimplemented to check a sequence of an empty
844 statement and a block.
848 2005-08-24 Marek Safar <marek.safar@seznam.cz>
850 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
851 detection until I fix it.
853 * cs-tokenizer.cs: Changed error message.
855 * cs-parser.jay: Fixed 2 error locations.
857 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
858 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
861 * enum.cs (GetSignatureForError): Fixed.
863 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
867 * typemanager.cs (RegisterProperty): Removed.
869 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
871 2005-08-24 Raja R Harinath <rharinath@novell.com>
874 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
875 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
877 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
879 * expression.cs : tiny fix is required for not warning positive ulong.
882 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
884 * expression.cs : add CS0652 check for constant and integral
885 expression. Fixed bug #53974.
887 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
889 * expression.cs : in DoNumericPromotions(), check if there is implicit
890 conversion overload for string (to check CS0034). Fixed bug #52492.
892 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
894 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
896 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
898 * ecore.cs : report location when it is *not* Null.
900 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
906 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
907 correctly. Fixed bug #75721.
909 2005-08-23 Raja R Harinath <rharinath@novell.com>
911 * support.cs (SeekableStreamReader.Position): Avoid an expensive
912 loop that performs 'min (pos, char_count)'.
915 * expression.cs (Unary.ResolveOperator): Don't discard implicit
916 converted value in Operator.OnesComplement.
918 2005-08-22 Ben Maurer <bmaurer@ximian.com>
920 * anonymous.cs: If the anon method is pulled into a helper class,
921 it needs to be `internal' not `private'. Fixes runtime behavior on
924 2005-08-20 Martin Baulig <martin@ximian.com>
926 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
927 scope if we don't already have it.
929 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
930 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
933 2005-08-17 Marek Safar <marek.safar@seznam.cz>
936 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
939 2005-08-16 Marek Safar <marek.safar@seznam.cz>
941 The big constants rewrite
942 Fix #75746, #75685 and more
943 As a side effect saved 1MB for MWF ;-)
945 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
946 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
947 enum based for corlib compilation.
949 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
952 * class.cs (FixedField.Define): Use ResolveAsConstant.
954 * const.cs (IConstant): Interface constants and enums.
955 (Const.ResolveValue): New method for constant resolvning.
956 (ExternalConstant): Constants from imported assemblies.
958 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
959 conversion; like enums.
960 (Constant.ToType): Converts this constant to different type.
961 (Constant.Increment): Adds 1.
963 * convert.cs (ImplicitConversionRequired): Simplified.
965 * cs-parser.jay: Create EnumMember directly.
967 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
969 * doc.cs (GenerateEnumDocComment): Removed.
971 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
972 (ConvertIntLiteral): Removed.
973 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
975 * enum.cs (EnumMember): Implement IConstant.
976 (Enum.IsValidEnumConstant): Removed.
977 (Enum.GetNextDefaultValue): Removed.
978 (Enum.FindMembers): Updated.
979 (Enum.GenerateDocComment): Iterate enum members.
981 * expression.cs (Cast.TryReduce): Handle enums correctly.
982 (New.Constantify): Made public.
983 (MemberAccess.DoResolve): Removed contant specific if(s).
985 * literal.cs (NullLiteral): Implement new abstract methods.
987 * statement.cs (GotoCase.Resolve): Use new constant methods.
988 (SwitchLabel.ResolveAndReduce): Use new constant methods.
990 * typemanager.cs (LookupEnum): Removed.
991 (IsEnumType): Fixed to work with corlib.
992 (RegisterConstant): Removed.
993 (LookupConstant): Removed.
994 (GetConstant): Changed to work with IConstant.
996 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
998 * location.cs : Fixed overflown (>255) column number.
1000 2005-08-03 Raja R Harinath <rharinath@novell.com>
1002 First cut of the qualified-alias-member feature.
1003 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1005 * cs-parser.jay (DOUBLE_COLON): New token.
1006 (namespace_or_type_name): Add rule for recognizing
1007 qualified-alias-members.
1008 (primary_expression): Likewise.
1009 (element_access): Allow QualifiedAliasMember as a possible
1010 type-bearing expression.
1011 (local_variable_type, local_variable_pointer_type): Likewise.
1012 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
1013 aliases in the current and enclosing namespace declarations.
1014 (NamespaceEntry.UsingAlias): Add CS0440 warning.
1015 * decl.cs (MemberName.is_double_colon): New.
1016 (MemberName.MemberName): Add new constructor for alias-member.
1017 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1018 * expression.cs (QualifiedAliasMember): New expression type.
1020 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1022 * location.cs : it borked when no argument was specified.
1024 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1026 * location.cs : tiny ToString() format fix.
1028 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1030 * statement.cs : oops, it was missing.
1032 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1034 A set of fixes for precise line/column location.
1037 "token" field now holds a file/line "delta", a line number offset
1038 from the segment, and a column number. See also:
1039 http://lists.ximian.com/pipermail/mono-devel-list/2004-
1040 December/009508.html
1041 Removed static IsNull. Use instance IsNull property instead.
1043 For some tokens it stores Location. For Identifier it stores
1044 LocatedToken which is a pair of string name and location.
1045 Column numbers are adjusted only at getChar().
1047 Use Location.ToString() for reporting (it now contains column).
1049 Largely modified to use LocatedToken instead of
1050 string (IDENTIFIER), and to acquire Location from some tokens.
1051 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
1052 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
1054 Now MemberName holds Location. DeclSpace.ctor() receives Location
1055 as a parameter. Removed extra parameters to all derived classes.
1056 Replaced Location.IsNull() with instance property.
1057 * assign.cs, expression.cs :
1058 Added .ctor() overload that omits Location.
1060 Added "nameEscaped" flag that indicates the identifier was escaped
1061 in the source file. This fixes bug #57047.
1063 2005-08-02 Marek Safar <marek.safar@seznam.cz>
1065 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
1066 New method, looking for lo-case imported cls type.
1068 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
1071 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
1073 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
1075 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
1077 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
1079 Optimized to save 3.5 MB for SWF compilation.
1081 2005-08-01 Marek Safar <marek.safar@seznam.cz>
1083 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
1084 (PartialContainer.Create): Moved logic AddToContainer.
1085 (PartialContainer.MarkForDuplicationCheck): Shares name.
1087 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
1090 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
1092 (Namespace.GetSignatureForError): New method.
1094 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
1095 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
1097 2005-08-01 Raja R Harinath <rharinath@novell.com>
1100 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
1101 member lookup rather than qualifier_type, since qualifier_type can
1104 2005-08-01 Marek Safar <marek.safar@seznam.cz>
1106 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
1109 2005-07-31 Miguel de Icaza <miguel@novell.com>
1111 * statement.cs: Copy the local exception into the exception
1112 captured local. Fixes 75674
1114 2005-07-31 Raja R Harinath <harinath@gmail.com>
1117 * expression.cs (Invocation.OverloadResolve): Don't report error
1118 CS1501 if error CS1502 has been reported.
1119 (New.DoResolve): Delegate CS1501 reporting to
1120 Invocation.OverloadResolve.
1123 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
1124 invariant-meaning-in-block property in an enclosing block if
1127 2005-07-29 Marek Safar <marek.safar@seznam.cz>
1129 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
1130 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
1131 (Switch.CheckSwitch): Just save 50kb for SWF.
1133 2005-07-27 Martin Baulig <martin@ximian.com>
1135 * anonymous.cs (CaptureContext.AddField): Added
1136 `AnonymousContainer am' argument; compute its toplevel scope if
1137 it's not already computed. Fixes #75649.
1139 2005-07-26 Raja R Harinath <rharinath@novell.com>
1142 * class.cs (Constructor.Emit): Reset block to null if the block
1145 2005-07-25 Marek Safar <marek.safar@seznam.cz>
1147 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1149 2005-07-25 Marek Safar <marek.safar@seznam.cz>
1151 * class.cs (MethodData.Define): Check whether accessor implementing
1152 interface is public.
1154 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1156 2005-07-22 Marek Safar <marek.safar@seznam.cz>
1159 * namespace.cs (LookupType): Moved same type check to...
1161 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1164 2005-07-21 Raja R Harinath <rharinath@novell.com>
1166 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1167 already found a typebuilder.
1168 * class.cs (MethodCore.IsDuplicateImplementation): Compare
1169 MemberNames, not strings.
1171 * const.cs (Error_ExpressionMustBeConst):
1172 Rename from Error_EpressionMustBeConst.
1173 * const.cs, class.cs, statement.cd: Update.
1175 2005-07-21 Marek Safar <marek.safar@seznam.cz>
1179 * const.cs (Const.LookupConstantValue): Report missing contant expression
1181 (Error_EpressionMustBeConstant): Only one error method.
1183 * class.cs, statement.c: Updated.
1185 2005-07-20 Raja R Harinath <rharinath@novell.com>
1187 * statement.cs (Block.Flags): Add back HasVarargs.
1188 (Block.flags): Make protected.
1189 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1191 * typemanager.cs (types, typecontainers, user_types): Remove.
1192 (UserTypes, TypeContainers): Likewise.
1193 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1194 (CleanUp, Reset): Update.
1195 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
1196 (GetNestedType): Use Type.GetNestedType.
1197 (CoreLookupType): Take two arguments, the namespace and the
1198 basename of the type. Update to use the Namespace.Lookup
1200 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1201 (RealMemberLookup): Use IsNestedChildOf instead of playing with
1202 string concatenation and substring matches.
1203 * class.cs, enum.cs, delegate.cs: Update to changes.
1205 2005-07-20 Marek Safar <marek.safar@seznam.cz>
1207 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1208 Expression and made virtual.
1210 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1211 (ImplicitStandardConversionExists): Fixed `byte' typo ?
1213 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1215 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1218 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1221 2005-07-18 Marek Safar <marek.safar@seznam.cz>
1224 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1225 AssemblyCultureAttribute is not used on executable.
1228 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1230 2005-07-16 Raja R Harinath <rharinath@novell.com>
1233 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1234 New. Reports CS0252/CS0253.
1235 Mostly taken from preliminary patch by Duncak Mak.
1236 (Binary.DoResolveOperator): Store results of operator lookup.
1237 Use them to detect if we need to warn about unintended reference
1240 2005-07-15 Raja R Harinath <rharinath@novell.com>
1243 * namespace.cs (Namespace.Lookup): Add back location parameter.
1244 (Namespace.LookupType): Add CS0436 report. Add location parameter.
1245 * delegate.cs, ecore.cs, expression.cs: Update to changes.
1247 * codegen.cs (EmitContext.DeclSpace): Make readonly.
1248 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1249 (Namespace.LookupType): ... this.
1250 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1252 * typemanager.cs (LookupTypeReflection): Remove buggy code that
1253 purported to handle pointers.
1254 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1257 2005-07-15 Marek Safar <marek.safar@seznam.cz>
1259 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1262 2005-07-15 Raja R Harinath <rharinath@novell.com>
1264 * namespace.cs (Namespace.Lookup): Drop location parameter.
1265 (NamespaceEntry.LookupAlias): Remove. Merge into ...
1266 (NamespaceEntry.Lookup): ... this.
1267 (NamespaceEntry.Error_AmbiguousTypeReference):
1268 Move here from DeclSpace.
1269 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1271 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1272 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1273 Move to NamespaceEntry.
1274 * delegate.cs, expression.cs: Update to changes.
1276 2005-07-14 Marek Safar <marek.safar@seznam.cz>
1278 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1279 CheckAttributeType and refactored.
1280 (Attribute.ResolvePossibleAttributeType): Changed to reuse
1281 ResolveAsTypeTerminal error handling.
1282 (ResolveAsTypeTerminal): Introduced because of global attributes extra
1284 (GetSignatureForError): Print errors in same way.
1287 * codegen.cs: Reflect attribute GetSignatureForError change.
1290 * expression.cs: Add silent parameter to ResolveAsTypeStep.
1292 * namespace.cs (UsingEntry): Refactored to make fields private.
1295 statement.cs: Error_UnexpectedKind has extra parameter.
1297 2005-07-14 Raja R Harinath <rharinath@novell.com>
1299 * ecore.cs (IAlias): Remove.
1300 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
1301 that implement the interface.
1302 * namespace.cs (Namespace): Likewise.
1303 (Namespace.declspaces): Renamed from 'defined_names'.
1304 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
1305 DeclSpace instead of an IAlias.
1306 * tree.cs (Tree.AddDecl): Update.
1308 2005-07-12 Raja R Harinath <rharinath@novell.com>
1310 * statement.cs (Block.Flags); Remove HasVarargs.
1311 (Block.HasVarargs): Move to ToplevelBlock.
1312 (Block.ThisVariable, Block.AddThisVariable): Likewise.
1313 (Block.Variables): Make protected. Initialize variable hashtable
1315 (Block.AddVariable): Update.
1316 (Block.Resolve): Update to changes.
1317 (ToplevelBlock.HasVarargs): New boolean.
1318 (ToplevelBlock.ThisVariable): Move here from Block.
1319 (ToplevelBlock.AddThisVariable): Likewise.
1320 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
1321 * expression.cs (This.ResolveBase): Update to changes.
1322 (ArglistAccess.DoResolve): Likewise.
1324 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1327 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1329 * class.cs (TypeContainer.VerifyMembers): Distinguish between
1330 not used and not used & assigned.
1331 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1333 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1336 * expression.cs (Is.DoResolve): null is never provided type.
1338 2005-07-08 Marek Safar <marek.safar@seznam.cz>
1341 * cs-parser.jay: Less strict event error rule to catch more errors.
1343 2005-07-08 Martin Baulig <martin@ximian.com>
1345 Fix test-iter-10.cs - distinguish whether we `yield' in a property
1346 gettter (allowed) or setter (not allowed).
1348 * class.cs (Accessor): Implement IIteratorContainer.
1349 (Accessor.Yields): New public field.
1350 (PropertyBase.PropertyMethod.Define): Handle iterators on a
1354 (get_accessor_declaration, set_accessor_declaration): Set the
1355 `yields' flag on the accessor, not the property.
1356 (property_declaration): Do the iterators check on a per-accessor
1357 basis and not for the whole property.
1359 2005-07-08 Martin Baulig <martin@ximian.com>
1361 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1362 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1364 2005-07-07 Marek Safar <marek.safar@seznam.cz>
1367 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1368 (ExtractSecurityPermissionSet): Cope with self referencing security
1369 attributes properly.
1371 * driver.cs (SetOutputFile): Made public property OutputFile.
1373 2005-07-07 Raja R Harinath <rharinath@novell.com>
1376 * class.cs (TypeContainer.first_nonstatic_field): Rename from
1377 has_nonstatic_fields. Make into a FieldBase pointer.
1378 (TypeContainer.AddField): Add CS0282 check.
1379 (TypeContainer.EmitType): Update.
1381 2005-07-06 Miguel de Icaza <miguel@novell.com>
1383 * cs-tokenizer.cs (consume_identifier): Do not create strings to
1384 compare if they start with __.
1386 2005-07-06 Raja R Harinath <rharinath@novell.com>
1388 * statement.cs (Switch.SwitchGoverningType): Only look at
1389 UserCasts that don't need implicit standard conversions to one of
1390 the allowed switch types (Fixes test-322.cs).
1391 (LocalInfo.Resolve): Re-enable sanity-test.
1393 2005-07-06 Marek Safar <marek.safar@seznam.cz>
1395 * cs-tokenizer.cs (consume_identifier): Detect double undescores
1397 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1399 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1401 2005-07-06 Raja R Harinath <rharinath@novell.com>
1404 * ecore.cs (SimpleName.GetSignatureForError): Add.
1405 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1406 (MemberAccess.GetSignatureForError): Add.
1408 2005-07-05 Marek Safar <marek.safar@seznam.cz>
1410 The big error and warning messages review.
1440 * typemanager.cs: Updated.
1442 * class.cs: (MethodCore.SetYields): Moved here to share.
1443 (PropertyMethod.Define): Moved iterator setup here.
1445 * iterators.cs: Add orig_method to have full access to parent
1448 2005-07-05 Raja R Harinath <rharinath@novell.com>
1450 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1451 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1452 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1453 variable of struct type.
1454 * expression.cs (Unary.ResolveOperator): Update to change.
1455 (Indirection.VerifyFixed): Likewise.
1456 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1457 (ParameterReference.VerifyFixed): Value parameters are fixed.
1458 (This.VerifyFixed): Treat 'this' as a value parameter.
1459 * statement.cs (LocalInfo.IsFixed): Remove.
1461 2005-07-01 Martin Baulig <martin@ximian.com>
1463 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1464 `ec.EmitThis ()' to get the correct scope.
1466 2005-07-01 Martin Baulig <martin@ximian.com>
1468 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1469 instance is a ParameterReference; fixes #75299.
1471 2005-07-01 Martin Baulig <martin@ximian.com>
1473 Reverted Marek's latest patch (r46725):
1474 - it contains structural changes which are neither mentioned in
1475 the ChangeLog nor explained anywhere; for example the additional
1476 argument of EmitContext's and Iterator's .ctor's and the
1477 TypeContainer.DefineMembers() change.
1478 - structural changes like this should go in in seperate patches
1479 and not be hidden in a huge patch which just seems to affect
1480 warnings and errors.
1481 a big and hard to understand patch.
1482 - it breaks iterators and causes regressions, for instance in
1485 2005-06-30 Raja R Harinath <rharinath@novell.com>
1488 * expression.cs (Indexers.map): Remove.
1489 (Indexers.Append): Filter out inaccessible setters and getters.
1490 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1493 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
1495 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1496 (FieldExpr.Emit, PropertyExpr.Emit): Update.
1497 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1498 * expression.cs (Invocation.EmitCall): Add CS0120 check.
1500 2005-06-30 Marek Safar <marek.safar@seznam.cz>
1503 * class.cs (FieldBase.GetInitializerExpression): One more field
1506 2005-06-28 Miguel de Icaza <miguel@novell.com>
1508 * pending.cs: Do not define a proxy if the base method is virtual,
1509 it will be picked up by the runtime (bug 75270).
1511 2005-06-08 Martin Baulig <martin@ximian.com>
1513 The big Iterators rewrite :-)
1515 * iterators.cs: Rewrite this to use the anonymous methods framework.
1517 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1518 before the TypeContainers; see 2test-21.cs.
1521 (TypeContainer.DefineType): Don't create a new EmitContext if we
1522 already have one (this only happens if we're an Iterator).
1523 (TypeContainer.Define): Also call Define() on all our iterators.
1524 (Method.CreateEmitContext): Added support for iterators.
1527 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1528 (AnonymousContainer.CreateMethodHost): Moved here from
1529 AnonymousMethod and made abstract.
1530 (AnonymousContainer.CreateScopeType): New abstract method.
1531 (AnonymousContainer.IsIterator): New public property.
1532 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1533 get the ScopeTypeBuilder rather than manually defining it here.
1534 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1537 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1538 before RootContext.DefineTypes().
1540 * codegen.cs (EmitContext.RemapToProxy): Removed.
1541 (EmitContext.CurrentAnonymousMethod): Changed type from
1542 AnonymousMethod -> AnonymousContainer.
1543 (EmitContext.ResolveTopBlock): Protect from being called twice.
1544 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1545 (EmitContext.EmitThis): Removed the iterators hacks; use the
1546 anonymous methods framework for that.
1549 (ToplevelBlock.Container): Make this a property, not a field.
1550 (ToplevelBlock.ReParent): New public method; move the
1551 ToplevelBlock into a new container.
1552 (Foreach.TemporaryVariable): Simplify.
1554 2005-06-05 Martin Baulig <martin@ximian.com>
1556 * statement.cs (LocalInfo.CompilerGenerated): New flag.
1557 (Block.AddTemporaryVariable): New public method; creates a new
1558 `LocalInfo' for a temporary variable.
1559 (Block.EmitMeta): Create the LocalBuilders for all the temporary
1561 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1562 non-iterator variables.
1564 2005-06-05 Martin Baulig <martin@ximian.com>
1566 * statement.cs (Foreach.TemporaryVariable): Create the
1567 LocalBuilder in the Emit phase and not in Resolve since in some
1568 situations, we don't have an ILGenerator during Resolve; see
1569 2test-19.cs for an example.
1571 2005-06-04 Martin Baulig <martin@ximian.com>
1573 **** Merged r45395 from GCS ****
1575 The big Foreach rewrite - Part II.
1577 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1578 with `PropertyInfo ienumerator_getcurrent'.
1580 * codegen.cs (VariableStorage): Removed.
1583 (Foreach): Derive from Statement, not ExceptionStatement.
1584 (Foreach.CollectionForeach): New nested class. Moved all the code
1585 dealing with collection foreach here.
1586 (Foreach.ForeachHelperMethods): Removed.
1587 (Foreach.TemporaryVariable): Implement IMemoryLocation.
1589 2005-05-23 Martin Baulig <martin@ximian.com>
1591 * statement.cs (Try.DoResolve): Don't create a `finally' if we
1592 don't need to. Fix #75014.
1594 2005-05-20 Martin Baulig <martin@ximian.com>
1596 Merged r44808 from GMCS.
1598 * class.cs (TypeContainer.CircularDepException): Removed.
1599 (TypeContainer.DefineType): Removed the `InTransit' stuff.
1600 (TypeContainer.CheckRecursiveDefinition): Check for circular class
1601 (CS0146) and interface (CS0529) dependencies here.
1603 2005-06-21 Raja R Harinath <rharinath@novell.com>
1605 * expression.cs (Invocation.EmitCall): Fix initialization
1606 'this_call' to reflect current behaviour. Fix indentation.
1608 * convert.cs (FindMostEncompassedType): Add two trivial special
1609 cases (number_of_types == 0 || number_of_types == 1).
1610 (FindMostEncompasingType): Likewise.
1612 2005-06-17 Raja R Harinath <rharinath@novell.com>
1614 Some cleanups preparing for the fix of #75283.
1615 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1617 (EventExpr.InstanceResolve): Likewise.
1618 (EventExpr.DoResolve): Remove redundant checks.
1620 2005-06-10 Duncan Mak <duncan@novell.com>
1622 * cs-tokenizer.cs (process_directives): New flag for controlling
1623 the processing of preprocessor directives.
1624 (x_token): After seeing a '#', return Token.NONE instead of going
1625 to handle_preprocessing_directive() when not processing
1626 directives. This avoids unnecessary processing during the token peek in
1631 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1632 the existing error reporting methods instead of Report.Error.
1634 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1635 after Raja's rewrite.
1637 2005-06-08 Miguel de Icaza <miguel@novell.com>
1639 * class.cs: Small fix.
1641 2005-06-08 Raja R Harinath <rharinath@novell.com>
1644 * class.cs (GetPartialBases): Fix return value check of
1647 2005-06-07 Raja R Harinath <rharinath@novell.com>
1649 Ensure that partial classes are registered in their enclosing
1650 namespace. Initial part of fix of #75160.
1651 * tree.cs (Tree.RecordDecl): Add new namespace argument.
1652 Register declspace with namespace here, not in
1653 DeclSpace.RecordDecl.
1654 * cs-parser.jay: Pass namespace to RecordDecl.
1655 * class.cs (PartialContainer.Create): Likewise.
1656 (ClassPart.DefineType): New sanity-check. Throws an exception if
1658 * decl.cs (Declspace.RecordDecl): Remove.
1659 * namespace.cs (NamespaceEntry.DefineName): Remove.
1661 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1663 * rootcontext.cs: Reset TargetExt as well.
1665 2005-06-03 Raja R Harinath <rharinath@novell.com>
1667 * ecore.cs (Expression.Resolve): Emit CS0654 error when
1670 2005-06-02 Raja R Harinath <rharinath@novell.com>
1672 Fix #75080, cs0119.cs.
1673 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
1675 (Expression.Resolve): ... this. Use it. Remove bogus code
1676 allowing ExprClass.Type and ExprClass.Namespace for
1677 ResolveFlags.VariableOrValue.
1678 (Expression.Resolve) [1-argument variant]: Change default resolve
1679 flags based on language version.
1680 (Expression.Error_UnexpectedKind): Use a simple string array
1681 rather than an ArrayList.
1682 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1684 (TypeOfVoid.DoResolve): Likewise.
1685 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
1686 flags argument -- it always has the same value.
1688 2005-05-31 Raja R Harinath <rharinath@novell.com>
1691 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1692 Use it in the error message.
1693 * assign.cs, expression.cs, statement.cs: Update.
1695 2005-05-30 Raja R Harinath <rharinath@novell.com>
1698 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1699 the "almostMatchedMember" case too.
1700 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1701 that failed the accessibility checks to 'almost_match'.
1703 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
1705 * attribute.cs: Use internal MethodBuilder methods to set
1706 ExactSpelling and SetLastError on PInvoke methods, instead
1707 of passing them via charset. Fixes #75060.
1709 2005-05-27 Raja R Harinath <rharinath@novell.com>
1711 * parameter.cs (Parameter): Remove TODO comment.
1712 (Parameter.DefineParameter): Remove Location parameter.
1713 (Parameters.LabelParameters): Likewise.
1714 * class.cs (Constructor.Emit): Update to change.
1715 (MethodData.Emit): Likewise.
1716 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
1717 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1719 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
1722 Removed Parameters.Location and added Parameter.Location instead.
1723 Removed Location parameter from Emit() and GetSignature().
1730 Modified all related calls.
1732 2005-05-26 Raja R Harinath <rharinath@novell.com>
1734 Improve user-defined conversion handling.
1735 * convert.cs (GetConversionOperators): Rewrite. Return only the
1736 applicable operators.
1737 (AddConversionOperators): New. Helper for GetConversionOperators.
1738 (FindMostEncompassedType, FindMostEncompassingType): Verify that
1739 there is only one most encompassed/encompassing type.
1740 (FindMostSpecificSource, FindMostSpecificTarget): Remove
1741 "applicable operator" handling.
1742 (UserConversion): Move cache here from GetConversionOperators.
1743 Directly cache the chosen operator, rather than the whole
1745 (ExplicitNumericConversion): Fix buggy implementation of Decimal
1746 case. Allow conversion of decimal to sbyte and byte too.
1747 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1748 New static methods. Used to avoid allocating EmptyExpressions in
1751 2005-05-24 Duncan Mak <duncan@novell.com>
1753 * ecore.cs (CastFromDecimal): New class for casting a decimal to
1754 another class, used in Convert.ExplicitNumericConversion.
1755 (CastToDecimal): New class, similar to above, but casts to
1756 System.Decimal, used in Convert.ImplicitNumericConversion and also
1757 in explicit convesion from double/float to decimal.
1759 * convert.cs (ImplicitNumericConversion): Handle implicit
1760 conversions to System.Decimal.
1761 (ExplicitNumericConversion): handle explicit conversions to
1766 2005-05-20 Miguel de Icaza <miguel@novell.com>
1768 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1769 know the type at this stage, just break through. Fixes #75008
1771 2005-05-19 Martin Baulig <martin@ximian.com>
1774 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1775 to disable error reporting.
1777 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1778 here since we don't want to report an error; see the new test-336.cs.
1780 2005-05-19 Raja R Harinath <rharinath@novell.com>
1782 * statement.cs (ToplevelBlock.GetParameterReference)
1783 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1784 Move here from class Block.
1785 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1786 * expression.cs (ParameterReference.DoResolveBase): Likewise.
1788 2005-05-18 Martin Baulig <martin@ximian.com>
1793 (FlowBranching.Reachability): Add non-static public And() and Or()
1795 (FlowBranchingSwitch): New class; do the `break_origins' thing
1796 like in FlowBranchingLoop.
1797 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1798 reachability, not just locals and parameters.
1799 (FlowBranching.MergeChild): Remove some of the hacks for loop and
1800 switch; MergeBreakOrigins() now takes care of that.
1802 2005-05-18 Martin Baulig <martin@ximian.com>
1804 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1805 a loop and may leave it, reset the barrier; fixes #74974.
1807 2005-05-17 Marek Safar <marek.safar@seznam.cz>
1809 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1812 * cs-parser.jay: Catch more lexical errors.
1814 * report.cs: Add one more Error method.
1817 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1819 2005-05-17 Martin Baulig <martin@ximian.com>
1821 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1824 2005-05-16 Raja R Harinath <rharinath@novell.com>
1826 Fix test-382.cs. Emit values of decimal constants.
1827 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1829 (TypeContainer.AddField): ... this.
1830 (TypeContainer.EmitFieldInitializers): Allow the list of fields
1831 with initializers to include 'Const's.
1832 (ClassPart.RegisterFieldForInitialization): Forward to
1834 * const.cs (Const.Const): Pass initializer to base class.
1835 (Const.Define): In case of decimal constants, register them for
1836 initialization in a static constructor.
1838 2005-05-14 Martin Baulig <martin@ximian.com>
1840 * statement.cs (Block.Resolve): Correctly handle unreachable code;
1841 do not call ResolveUnreachable() on unreachable statements in
1842 here, see the comment in the source code.
1844 2005-05-13 Raja R Harinath <rharinath@novell.com>
1847 * expression.cs (BinaryResolveOperator): If one of the operands of
1848 an equality comparison is 'null' and the other is a pointer type,
1849 convert the null to a NullPointer.
1850 * convert.cs (ImplicitReferenceConversion): If the expression is a
1851 NullLiteral and the target type is a pointer type, return a
1852 NullPointer instead.
1853 (ImplicitConversionStandard): Likewise.
1855 2005-05-13 Marek Safar <marek.safar@seznam.cz>
1857 * cs-parser.jay: Set readonly context based on special constructs.
1859 * expression.cs (LocalVariableReference.DoResolveBase): Improved
1860 readonly variable error handling.
1862 * rootcontext.cs (EmitCode): Don't verify members when error
1865 * statement.cs (LocalInfo): Add reaodnly context information.
1866 (SetReadOnlyContext, GetReadOnlyContext): New methods.
1868 2005-05-13 Raja R Harinath <rharinath@novell.com>
1870 * statement.cs (Block.Resolve): Revert change below. Modify fix
1871 for #74041 to initialize 'resolved' to false only for explicit
1872 blocks. Fixes #74873.
1874 2005-05-12 Raja R Harinath <harinath@gmail.com>
1877 * typemanager.cs (unmanaged_enclosing_types): New.
1878 (IsUnmanagedType): Avoid infloops by using
1879 'unmanaged_enclosing_types' to talk with recursive invocations.
1881 2005-05-13 Martin Baulig <martin@ximian.com>
1883 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1884 instance variable, not a local. Fix #74873.
1885 (Block.ResolveUnreachable): Set it to true here.
1887 2005-05-11 Duncan Mak <duncan@novell.com>
1889 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1890 continuing to process for 'arg'.
1891 (handle_preprocessing_directive): Check the argument of the #endif
1892 directive and report error CS1025 if there are any trailing
1895 According to the C# spec, having even whitespace after the #endif
1896 directive is illegal; however, because we call arg.TrimEnd ()
1897 beforehand, we have the same behavior as csc, allowing whitespace
1898 after the directive.
1902 2005-05-11 Marek Safar <marek.safar@seznam.cz>
1906 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1907 (Constructor.GetObsoleteAttribute): Implemented correctly.
1909 2005-05-10 Martin Baulig <martin@ximian.com>
1911 * support.cs (ReflectionParameters.ParameterModifier): Use
1912 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1913 and `ParameterAttributes.In'. Fixes #74884.
1915 2005-05-10 Marek Safar <marek.safar@seznam.cz>
1917 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1919 * expression.cs (Argument.GetParameterModifier): Turned to property.
1920 (Invocation.Error_InvalidArguments): Add more descriptive errors.
1922 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1925 2005-05-09 Raja R Harinath <rharinath@novell.com>
1928 * decl.cs (MemberCache.AddMethods): Register override methods,
1929 rather than non-override methods.
1930 * typemanager.cs (RegisterOverride): New.
1931 (IsOverride): Update.
1933 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1937 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1938 recursive declaration.
1940 * statement.cs (Block.ResolveMeta): Report any error in resolving.
1942 2005-05-06 Marek Safar <marek.safar@seznam.cz>
1944 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1946 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1948 2005-05-05 Raja R Harinath <rharinath@novell.com>
1951 * decl.cs (DeclSpace.FamilyAccessible):
1952 Use TypeManager.IsNestedFamilyAccessible.
1954 Fix reopened #64812.
1955 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1958 2005-05-04 Raja R Harinath <rharinath@novell.com>
1959 Abin Thomas <projectmonokochi@rediffmail.com>
1960 Anoob V E <projectmonokochi@rediffmail.com>
1961 Harilal P R <projectmonokochi@rediffmail.com>
1964 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1965 allow access to all static members.
1967 2005-05-04 Martin Baulig <martin@ximian.com>
1969 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1971 2005-05-04 Martin Baulig <martin@ximian.com>
1975 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1976 section at the end; make things work if `default' is not the last
1979 2005-05-04 Martin Baulig <martin@ximian.com>
1983 * statement.cs (Switch): Replaced the `got_default' field with a
1984 `default_section' one.
1985 (Switch.CheckSwitch): Set `default_section' here.
1986 (Switch.Resolve): If we're a constant switch and the constant is
1987 not found, use the default section.
1989 2005-05-03 Martin Baulig <martin@ximian.com>
1991 * expression.cs (ArrayAccess.EmitGetLength): New public method.
1993 * statement.cs (Foreach.ArrayForeach): New nested class.
1994 (Foreach.TemporaryVariable): New nested class.
1995 (Foreach.EmitArrayForeach): Removed; this is now in the new
1998 2005-05-03 Raja R Harinath <rharinath@novell.com>
2000 * pending.cs (BaseImplements): Move the #74773 fix here. This is
2002 (VerifyPendingMethods): Revert change below.
2004 * typemanager.cs (IsOverride, RegisterNonOverride): New.
2005 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2006 that used to trigger warning -28. Remove warning -28.
2007 * expression.cs (Invocation.OverloadResolve): Use
2008 TypeManager.IsOverride to distinguish override methods.
2011 * pending.cs (VerifyPendingMethods): If a base type implements the
2012 requested interface, don't bother checking individual methods of
2013 the base type. As a side-effect, this prevents the creation of
2014 unnecessary proxies.
2016 2005-05-02 Martin Baulig <martin@ximian.com>
2020 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2021 Also `And' the locals if the old vector is null.
2022 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2023 null; in this case we basically reset all the variables.
2025 2005-05-02 Martin Baulig <martin@ximian.com>
2029 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2030 Added `FlowBranching branching' argument; always `and' the
2031 variables instead of `or'ing them unless we're an infinite loop.
2033 * statement.cs (While.Resolve): Create a new sibling unless we're
2036 2005-05-02 Martin Baulig <martin@ximian.com>
2040 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2041 arguments; use it instead of creating a new TopLevelBlock.
2042 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2043 our ConstructorInitializer.
2046 (TopLevelBlock.TopLevelBranching): New public property.
2047 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2048 and create our `TopLevelBranching'.
2050 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2051 anonymous method host, use `block.TopLevelBranching' rather than
2052 creating a new branching.
2054 2005-04-20 Miguel de Icaza <miguel@novell.com>
2056 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2057 a ScopeInfo, if any of the current children is a child of the new
2058 entry, move those children there.
2060 2005-04-30 Martin Baulig <martin@ximian.com>
2062 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2063 at the beginning of a SwitchSection. Fix #73335.
2065 2005-04-27 Marek Safar <marek.safar@seznam.cz>
2068 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2070 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2071 (FieldExpr.DoResolve): Obsolete members are ignored for field
2074 2005-04-26 Marek Safar <marek.safar@seznam.cz>
2076 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2077 of arrays detection.
2079 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2081 (Field.VerifyClsCompliance): Volatile fields are not compliant.
2083 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2086 2005-04-25 Ben Maurer <bmaurer@ximian.com>
2088 * cs-parser.jay: Use the prefered version of -unsafe in error
2091 2005-04-22 Marek Safar <marek.safar@seznam.cz>
2093 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2096 2005-04-20 John Luke <john.luke@gmail.com>
2098 * driver.cs: fix typo in error message, --outout to --output
2100 2005-04-20 Marek Safar <marek.safar@seznam.cz>
2102 * codegen.cs (InRefOutArgumentResolving): New field.
2104 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2105 fields outside contructor.
2107 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2109 2005-04-19 Miguel de Icaza <miguel@novell.com>
2111 * anonymous.cs (CaptureContext.EmitParameterInstance): The
2112 parameter code was not completed ever, so it was not as up-to-date
2113 as local variables. Must finish it.
2115 The bug fix was to compare the Toplevel of the block, not the
2116 current block. Thanks for Ben for pointing this out.
2118 2005-04-19 Raja R Harinath <rharinath@novell.com>
2120 * decl.cs (AddMethods): Use the declaring type of the problem
2121 method to determine if we want to squash a warning.
2123 2005-04-19 Marek Safar <marek.safar@seznam.cz>
2125 * attribute.cs: Removed debug output.
2127 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2129 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2132 2005-04-18 Raja R Harinath <rharinath@novell.com>
2135 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2136 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2137 all null comparisons against reference types.
2139 2005-04-18 Marek Safar <marek.safar@seznam.cz>
2142 * class.cs (TypeContainer.CircularDepException) New nested
2144 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2145 (TypeContainer.DefineType): Removed error, reset InTransit before
2147 (Class.DefineType): Throw exception when is in Transit.
2148 Catch exception and report error.
2149 (Struct.DefineType): Throw exception when is in Transit.
2150 Catch exception and report error.
2151 (Interface.DefineType): Throw exception when is in Transit.
2152 Catch exception and report error.
2154 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2155 handle nested exception handlers.
2157 * flowanalysis.cs (InTryWithCatch): New method, search for try with
2160 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2161 InFinally and InCatch storage.
2163 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2164 (Catch.Resolve): Set and Restore ec.InCatch.
2165 (Try.Resolve): Set and Restore ec.InFinally.
2166 (Try.HasCatch): True when try has catch.
2168 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
2170 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2171 for the same event member, so exclude such cases from warning 419.
2174 2005-04-16 Miguel de Icaza <miguel@novell.com>
2176 * expression.cs (Binary.ResolveOperator): Apply patch from John
2177 Luke to fix bug 59864: operators &, | and ^ on enumerations
2178 require that the same enum type on both sides.
2180 * driver.cs: Add warnings to old flag usage, this is to assist
2181 people who produce Makefiles and hope that the Makefiles will be
2184 * class.cs (TypeContainer.EmitType): Moved the definition of the
2185 special $PRIVATE$ field from the resolve phase to the Emit phase.
2186 During resolve we do not know if we are a struct with
2187 HasExplicitLayout, we know this only after the attributes for the
2190 Set the FieldOffset to zero on the dummy field that we create for
2191 the class. Fixes 74590.
2193 2005-04-16 Raja R Harinath <rharinath@novell.com>
2196 * ecore.cs (PropertyExpr.resolved): New.
2197 (DoResolve): Use it to handle a case of double resolution here.
2198 Handle a case of identical-name-and-type-name.
2199 * expression.cs (ArrayCreation.CheckIndices): Avoid double
2200 resolution by storing the results of expression resolution back
2201 into the "probes" array.
2203 2005-04-15 Raja R Harinath <rharinath@novell.com>
2205 Fix cs0208-7.cs and cs0208-8.cs.
2206 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2207 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
2208 error reporting to point out the reason a struct is not unmanaged.
2210 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2212 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
2213 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2215 2005-04-13 Raja R Harinath <rharinath@novell.com>
2218 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2219 IdenticalNameAndTypeName here.
2220 (EventExpr.InstanceResolve): Likewise.
2222 2005-04-13 Marek Safar <marek.safar@seznam.cz>
2224 C# 2.0 DefaultCharSetAttribute implementation
2226 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2227 which allows us to set GlobalNamespace for every resolve.
2228 (Attribute.ResolveArguments): Cut from Resolve.
2229 (Attribute.GetCharSetValue): Returns CharSet named argument.
2230 (Attribute.DefinePInvokeMethod): Gets default charset from
2232 (GlobalAttribute.ResolveAsTypeStep): Override.
2233 (GlobalAttribute.ResolveArguments): Override.
2235 * class.cs (TypeAttr): Is protected.
2237 * codegen.cs (ModuleClass.DefaultCharSet): New member.
2238 (ModuleClass.DefaultCharSetType): New memeber.
2239 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2241 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2242 charset from module.
2244 * delegate.cs (TypeAttr): Override.
2245 (Delegate.DefineType): Use this TypeAttr.
2247 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2248 at very early stage (before types are defined) to resolve model
2249 module attributes. It will probably not work with corlib but it
2252 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2253 charset from module.
2255 * typemanager.cs (default_charset_type): New type.
2257 2005-04-13 Raja R Harinath <rharinath@novell.com>
2259 * decl.cs (MemberCache.AddMethods): Don't warn if
2260 System.Object.Finalize has buggy MethodAttributes.
2262 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2265 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2267 * doc.cs : detect ambiguous reference to overloaded members.
2268 Fixed bug #71603. MS 1.1 csc does not detect it.
2270 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2272 * doc.cs : delegates must not be referenced with parameters.
2275 2005-04-12 Miguel de Icaza <miguel@novell.com>
2277 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2279 2005-04-10 Miguel de Icaza <miguel@novell.com>
2281 * driver.cs (MainDriver): Stop processing if the CLS stage found
2284 (CompilerCallableEntryPoint.InvokeCompiler): Always
2285 reset after execution; Take a TextWriter argument for the
2288 * report.cs: Use the error stream instead of hardcoding stderr.
2290 2005-04-09 Miguel de Icaza <miguel@novell.com>
2292 * class.cs: Reduce code paths to test, too small of an
2293 optimization to make it worth the extra testing. Always perform
2296 2005-04-08 Raja R Harinath <rharinath@novell.com>
2299 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2300 operators that had errors reported on them.
2302 2005-04-08 Marek Safar <marek.safar@seznam.cz>
2304 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2306 (Attribute.Resolve): Add named argument type checking.
2308 * class.cs (FixedField.Define): Use IsPrimitiveType
2310 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2312 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2313 unsafe parameter types.
2315 * statement.cs (Using.ResolveExpression): Add better error description.
2317 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2319 2005-04-08 Raja R Harinath <rharinath@novell.com>
2322 * attribute.cs (Attribute.GetAttributeUsage): Resolve
2323 AttributeUsageAttribute in the emitcontext of the attribute class,
2324 not in the emitcontext of the attributable entity it was attached to.
2325 * cs-parser.jay: Use 'current_class', not 'current_container',
2326 when creating a GlobalAttribute.
2328 2005-04-08 Alp Toker <alp@atoker.com>
2330 * pending.cs: The fix to #58413 failed to compile methods implementing
2331 interfaces with/without params modifiers and vice versa, even though
2332 params modifiers aren't part of the signature. Make the modifier check
2333 less strict as in csc.
2335 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
2336 Anoob V E <projectmonokochi@rediffmail.com>
2337 Harilal P R <projectmonokochi@rediffmail.com>
2340 * pending.cs (TypeAndMethods.mods): New. Store the parameter
2341 modifiers of pending methods.
2342 (PendingImplementation.PendingImplementation): Initialize it.
2343 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2344 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2345 with ParameterData. Add check for modifiers.
2346 * class.cs (MethodData.Define): Update to changes.
2348 2005-04-07 Raja R Harinath <rharinath@novell.com>
2350 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2352 2005-04-07 Marek Safar <marek.safar@seznam.cz>
2354 * class.cs (PropertyMethod.Define): Check private accessor in abstract
2357 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2360 * typemanager.cs: Registered RequiredAttributeAttribute.
2362 2005-04-06 Marek Safar <marek.safar@seznam.cz>
2364 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2365 Warning CS0169 is back at level 3.
2366 (IMethodData.SetMemberIsUsed): New method.
2368 * decl.cs (IsUsed): New value; moved from FieldBase.Status
2369 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2371 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2373 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2375 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2378 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2381 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2382 to avoid the problems with nested types.
2384 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
2385 Anoob V.E <projectmonokochi@rediffmail.com>
2386 Harilal P.R <projectmonokochi@rediffmail.com>
2387 Raja R Harinath <rharinath@novell.com>
2390 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2392 * typemanager (GetConstructor): Make public.
2394 2005-04-05 John Luke <john.luke@gmail.com>
2395 Raja R Harinath <rharinath@novell.com>
2398 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2399 struct too. Return false quicker in a few cases.
2400 (VerifyUnManaged): Use it.
2402 2005-04-05 Raja R Harinath <rharinath@novell.com>
2405 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2406 not 'unreachable_seen'.
2408 2005-04-04 Marek Safar <marek.safar@seznam.cz>
2410 * attribute.cs (Attribute.GetValue): Removed unused.
2412 * codegen.cs (CodeGen.TrimExt): Removed unused.
2414 * cs-parser.jay (output): Removed unused.
2416 * cs-tokenizer.cs (hex_digits): Removed unused.
2418 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2420 * expression.cs (Indirection.LoadExprValue): Removed unused.
2421 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2423 * iterators.cs (Iterator.param_types): Removed unused.
2425 * statement.cs (Goto.block): Removed unused.
2426 (ToplevelBlock.did): Removed unused.
2427 (Switch.ResolveConstantSwitch): Removed unused.
2429 2005-04-01 Ben Maurer <bmaurer@ximian.com>
2431 * rootcontext.cs: Allow mcs to bootstrap with the compilation
2434 2005-04-01 Raja R Harinath <rharinath@novell.com>
2436 Fix #74232 and cs0208-3.cs.
2437 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2438 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2439 unmanaged type. Don't use FieldBuilders when 't' is a
2440 TypeBuilder. Use ModFlags and MemberType fields.
2441 * class.cs (MemberBase.member_type): Rename from MemberType.
2442 (MemberBase.MemberType): New property. Determines member_type on
2444 (MemberBase.DoDefine): Don't initialize MemberType here.
2445 (FieldMember.Define): Likewise.
2447 2005-04-01 Marek Safar <marek.safar@seznam.cz>
2450 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2451 Attributes are emitted there.
2453 2005-04-01 Raja R Harinath <rharinath@novell.com>
2455 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2456 keyword in 'partial enum' too.
2457 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2459 Report from Kamil Skalski <nazgul@omega.pl>.
2462 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2463 have partial containers too.
2465 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2466 in block' checks to Block.CheckInvariantMeaningInBlock.
2467 * statement.cs (Block.GetKnownVariableInfo): Make private.
2468 (Block.IsVariableUsedInChildBlock): Remove.
2469 (Block.IsVariableUsedInBlock): Likewise.
2470 (Block.CheckInvariantMeaningInBlock): New. Show location of
2471 conflicting declaration.
2472 (Block.AddVariable): Make error messages less long-winded and more
2473 specific. Show location of conflicting declaration.
2474 * parameter.cs (Parameters.Location): New readonly property.
2476 2005-03-31 Raja R Harinath <rharinath@novell.com>
2478 Clean up semantics of invoking ResolveMemberAccess.
2479 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2480 can have an instance, ensure that we pass in a non-TypeExpression
2481 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
2482 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2483 argument. Update to changes and simplify.
2484 (FieldExpr.Emitinstance): Remove CS0120 check.
2485 (PropertyExpr.EmitInstance): Likewise.
2486 * expression.cs (Argument.Resolve): Likewise.
2487 (Invocation.DoResolve): Update to changes in semantics of
2490 2005-03-31 Marek Safar <marek.safar@seznam.cz>
2493 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2496 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2498 2005-03-31 Raja R Harinath <rharinath@novell.com>
2500 Fix difference in behaviour with commandline invocation.
2501 * driver.cs (Driver.Reset): New.
2502 (CompilerCallableEntryPoint): Call it.
2504 * statement.cs (If.Resolve): Avoid spurious "uninitialized
2505 variable" warnings if the boolean expression failed to resolve.
2507 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
2509 * attribute.cs: Fix the union of several permissions when some of them
2510 are unrestricted (so the result isn't an unrestricted permission set).
2513 2005-03-30 Raja R Harinath <rharinath@novell.com>
2515 * ecore.cs (MemberExpr): New class. Convert from interface
2517 (MemberExpr.ResolveMemberAccess): Refactor and move here from
2518 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
2520 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2521 (MethodGroupExpr.IsExplicitImpl): Remove.
2522 (Expression.GetFieldFromEvent): Remove.
2523 (SimpleName.MemberStaticCheck): Remove.
2524 (SimpleName.DoSimpleNameResolve): Update to changes.
2525 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2526 (MemberAccess.IdenticalNameAndTypeName): Remove.
2527 (MemberAccess.error176): Move to MemberExpr.
2528 (MemberAccess.DoResolve): Update to changes.
2529 (BaseAccess.DoResolve): Likewise.
2531 2005-03-30 Marek Safar <marek.safar@seznam.cz>
2533 C# 2.0 Conditional attribute class implementation
2535 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2536 Analyzes class whether it has attribute which has ConditionalAttribute
2537 and its condition is not defined.
2539 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2540 (Class.IsExcluded): New method. Search for at least one defined
2541 condition in ConditionalAttribute of attribute class.
2543 2005-03-30 Raja R Harinath <rharinath@novell.com>
2545 * ecore.cs (PropertyExpr): Derive from Expression, not
2546 ExpressionStatement.
2547 (PropertyExpr.EmitStatement): Remove.
2549 2005-03-29 Raja R Harinath <rharinath@novell.com>
2552 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2553 internal field "value__" of an enum be private. The examples for
2554 "value__" that I found on MSDN all used FieldAttributes.Private.
2556 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2557 Don't mention IL method attribute names.
2559 Fix #47991. Remove a TODO.
2560 * statement.cs (Block.Toplevel): Make into a field.
2561 (Block.Parameters): Move into ToplevelBlock.
2562 (Block.known_variables): Rename from child_variable_names.
2563 (Block.Block): Remove variants that take Parameters. Initialize
2564 'Toplevel' with the immediately surrounding toplevel block.
2565 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
2566 LocalInfo parameter.
2567 (Block.GetKnownVariableInfo): New.
2568 (Block.IsVariableNameUsedInChildBlock): Update.
2569 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
2570 the block, even though it may not be in scope.
2571 (Block.AddVariable): Remove Parameters parameter. Use
2572 Toplevel.Parameters instead.
2573 (Block.AddConstant): Remove Parameters parameter.
2574 (Block.GetParameterReference): Update to use Toplevel.Parameters.
2575 (Block.IsParamaterReference): Likewise.
2576 (Block.IsLocalParameter): Likewise. Simplify a lot.
2577 (ToplevelBlock.Parameters): New. Moved from Block.
2578 (ToplevelBlock.ToplevelBlock): Update to changes. Always
2579 initialize Parameters to a non-null value.
2580 * cs-parser.jay: Update to changes.
2581 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2582 simple names that mean different things in the same block. Use
2583 Block.IsVariableNameUsedInBlock.
2585 2005-03-28 Raja R Harinath <rharinath@novell.com>
2587 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2588 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2589 GetTypeHandle. It is possible for a reflected type to derive from
2590 a TypeBuilder (e.g., int[] derives from the TypeBuilder
2591 System.Array during mscorlib compilation).
2592 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2593 contain a method_hash, don't create one either. Don't create a
2594 deep copy of the base cache's method_hash.
2595 (MemberCache.SetupCache): Rename back from DeepCopy.
2596 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2597 already initialized. If we see an override function, add its
2598 underlying base virtual function to the member_hash too.
2600 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2602 2005-03-26 Raja R Harinath <harinath@acm.org>
2605 * assign.cs (Assign.DoResolve): When the RHS of an assignment
2606 fails to resolve, ensure that the LHS is still resolved as an
2609 2005-03-25 Raja R Harinath <harinath@acm.org>
2611 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2613 (Enum.current_ec): Remove.
2614 (Enum.LookupEnumValue): Remove EmitContext argument.
2615 Just uses the one created during DefineType.
2616 (Enum.FindMembers): Update.
2617 * expression.cs (MemberAccess.DoResolve): Update.
2619 2005-03-22 Marek Safar <marek.safar@seznam.cz>
2621 * assign.cs (Assign.DoResolve): Check for CS1717 when
2622 source and target are same (uses Equals).
2624 * expression.cs (LocalVariableReference, ParameterReference,
2625 This): Implemented Equals, GetHashCode.
2627 * statement.cs (Block.GetParameterReference): Removed useless
2630 2005-03-22 Raja R Harinath <rharinath@novell.com>
2633 * statement.cs (Block.AddVariable): Ensure that we skip implicit
2634 blocks before deciding whether the error is cs0136 or cs0128.
2636 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2637 (using_alias_directive, using_namespace_directive): Pass
2638 MemberName, not an expression to Namespace.UsingAlias and
2640 (MakeName): Use the MemberName of the namespace.
2641 * namespace.cs (Namespace.MemberName): New.
2642 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2643 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2645 * decl.cs (MemberName.Name): Make readonly.
2646 (MemberName.FromDotted): New "constructor".
2647 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2648 (MemberCore.Name): Compute from MemberName on demand.
2649 (MemberCore.SetMemberName): Provide a way to change the
2651 (MemberCore.AddToContainer): Don't take a fullname parameter.
2652 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2653 fully qualified name of the container to the member name.
2654 (TypeContainer.AddToTypeContainer): Use a fully qualified name
2655 only if the type is a member of the root container.
2656 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2657 MemberName.Left rather than searching for an embedded ".".
2658 (PartialContainer.CreatePart): Update to changes in RootContext.
2659 (MemberBase.ShortName): Turn into a property. Use
2660 MemberCore.SetMemberName.
2661 (MemberBase.ExplicitInterfaceName): Remove.
2662 (MemberBase.UpdateMemberName): Remove.
2663 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2664 (PropertyBase.SetMemberName): New override.
2665 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2666 (Tree.GetDecl): New.
2667 (Tree.AllDecls): Rename from Decls.
2668 * attribute.cs, enum.cs, report.cs: Update to changes.
2669 * driver.cs (MainDriver): Use MemberName.FromDotted on
2670 RootContext.MainClass.
2672 2005-03-21 Marek Safar <marek.safar@seznam.cz>
2674 * class.cs (FixedField.Define): Check for CS1664 and more sanity
2677 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2679 2005-03-18 Marek Safar <marek.safar@seznam.cz>
2681 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2682 property accessor modifiers.
2684 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2685 fixed buffer attribute (CS1716).
2686 (PropertyMethod.HasCustomAccessModifier): When property accessor
2687 has custom modifier.
2689 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2691 (PropertyExpr.DoResolveLValue): Add CS0272.
2693 2005-03-17 Miguel de Icaza <miguel@novell.com>
2695 * convert.cs: When converting to a pointer, use the proper Conv.U
2696 or Conv.I depending on the source data type.
2698 * cs-tokenizer.cs: Make the size for large decimal constants,
2701 2005-03-17 Martin Baulig <martin@ximian.com>
2703 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2704 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
2706 2005-03-17 Martin Baulig <martin@ximian.com>
2708 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2709 to bool so we can return an error condition.
2710 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2713 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
2715 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2718 2005-03-16 Raja R Harinath <rharinath@novell.com>
2720 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2721 Refactor to avoid traversing the list of assemblies, and to avoid
2722 string concatenation.
2723 * typemanager.cs (guid_attr_type): Remove.
2724 (negative_hits, pointers, references): Remove hashes.
2726 (GetConstructedType): New. Uses type_hash to handle constructed
2727 types (arrays, references, pointers).
2728 (GetReferenceType, GetPointerType): Use it.
2729 (GetNestedType): New. Uses type_hash to handle nested types of
2731 (LookupType, LookupTypeDirect): Remove.
2732 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
2733 'types' hash and LookupTypeReflection directly.
2734 (params_string, params_object): Use GetConstructedType.
2735 * namespace.cs (Namespace.cached_types): New. Cache of reflected
2737 (Namespace.Lookup): Use cached_types.
2738 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2739 provided by old TypeManager.LookupType.
2740 * rootcontext.cs (MakeFQN): Remove.
2741 * decl.cs (DeclSpace.MakeFQN): Likewise.
2742 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2743 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2744 TypeManager.GetConstructedType.
2745 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2747 2005-03-15 Marek Safar <marek.safar@seznam.cz>
2749 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2752 * cs-parser.jay: Reports CS1527 for any namespace element.
2754 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2757 * expression.cs (ParameterReference.IsAssigned): Changed error to
2759 (Error_WrongNumArguments): Moved CS0245 detection here.
2761 * statement.cs (Return.Resolve): Add CS1622 report.
2763 2005-03-11 Marek Safar <marek.safar@seznam.cz>
2765 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2767 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
2769 * attribute.cs expression.cs: Get rid of some allocations.
2771 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
2773 * doc.cs : just eliminate the latest change.
2775 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2777 * doc.cs : commented out the latest change. It breaks xml-030.cs
2779 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2781 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2782 fail. So invoke CreateType() in FindDocumentedType().
2784 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2786 * cs-tokenizer.cs : added IsKeyword().
2787 * doc.cs : Detect keyword incorrectly used as identifier.
2788 Allow identifiers prefixed by @.
2790 2005-03-10 Marek Safar <marek.safar@seznam.cz>
2792 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2793 It caused exception in namespace resolving (again!).
2795 * class.cs (Class.ctor): Removed exit.
2796 (PropertyMethod.ctor): ditto.
2798 * codegen.cs (Codegen.Reset): Reset static data.
2799 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2801 * cs-tokenizer.cs (Cleanup): Removed.
2803 * driver.cs (GetSystemDir): Rewrote to one line command.
2804 It caused problem with unloaded dynamic modules.
2805 (UnixParseOption): Removed Exit.
2806 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2807 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2808 Now can be mcs used as library.
2810 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2813 * location.cs (Reset): Reset static data.
2815 * namespace.cs (Reset): Reset static data.
2817 * report.cs (Report.Reset): Reset static data.
2819 * rootcontext.cs (RootContext.Reset): Reset static data.
2821 * tree.cs (RootTypes.ctor): Use Location.Null
2823 * typemanager.cs (TypeManager.Reset): Reset static data.
2824 (CoreLookupType): Removed Exit.
2825 (TypeHandle.Reset): Reset static data.
2827 2005-03-10 Raja R Harinath <rharinath@novell.com>
2830 * typemanager.cs (ComputeNamespaces): Import namespaces from
2831 referenced modules too.
2833 2005-03-09 Raja R Harinath <rharinath@novell.com>
2835 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2838 2005-03-09 Raja R Harinath <rharinath@novell.com>
2840 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2841 enclosing DeclSpace. This ensures that a name-lookup populates
2842 more caches and there are fewer 'TypeExpression's. Carve out
2843 nested type lookup into ...
2844 (LookupNestedTypeInHierarchy): ... this.
2846 2005-03-09 Raja R Harinath <rharinath@novell.com>
2848 Clean up a few partial-class semantics.
2849 Fixes test-357.cs and cs1618-2.cs.
2850 * cs-parser.jay (struct_declaration): Use 'current_class' as
2851 parent of newly-created struct. Remove call to Register ().
2852 Use 'pop_current_class' to complete handing the current struct.
2853 (interface_declaration): Likewise.
2854 (class_declaration): Likewise.
2855 (enum_declaration): Use 'current_class' as parent of newly created
2857 (delegate_declaration): Likewise.
2858 (pop_current_class): New function. This is used to handle closing
2859 up the 'current_class' and 'current_container', and pointing them
2860 to the enclosing class/container.
2861 (CSharpParser): Initialize 'current_class' too.
2862 * decl.cs (MemberCore): Add check for invariant: a partial
2863 container is not a parsed entity, and thus does not enclose any
2865 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2866 (DeclSpace.BaseTypeExpr): Use it.
2867 (DeclSpace.LookupType): Add check for invariant.
2868 * class.cs (TypeContainer): Add check for invariant: a nested
2869 class should have the same NamespaceEntry as its enclosing class.
2870 (TypeContainer.EmitFieldInitializers): Make virtual.
2871 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2873 (TypeContainer.Register): Remove.
2874 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2875 null. Use TypeResolveEmitContext for resolving base types and
2876 interfaces. Move initialization of Parts.TypeBuilder here from
2878 (TypeContainer.DefineNestedTypes): ... here.
2879 (PartialContainer): Take a Namespace not a NamespaceEntry.
2880 (PartialContainer.Create): Don't use Register. Call the
2881 appropriate Add... function directly.
2882 (ClassPart): Take both the PartialContainer and the enclosing
2883 class as constructor arguments.
2884 (ClassPart.EmitFieldInitializers): Override.
2885 (ClassPart.PartFindNestedTypes): Remove.
2886 (FieldBase.GetInitializerExpression): Resolve the initializer
2887 expression in the emit context of the enclosing class.
2888 * tree.cs (RootTypes): Remove Register ().
2890 2005-03-08 Marek Safar <marek.safar@seznam.cz>
2892 * cs-parser.jay: Removed CS0134.
2894 * driver.cs: Removed CS1901.
2896 * expression.cs (SizeOf.DoResolve): Don't report CS0233
2897 for predefined types.
2899 2005-03-07 Duncan Mak <duncan@novell.com>
2901 * codegen.cs (Save): Catch UnauthorizedAccessException as
2902 well. Fixes bug #73454.
2904 2005-03-07 Marek Safar <marek.safar@seznam.cz>
2906 * cs-tokenizer.cs (xtoken): Add CS1035.
2908 * class.cs (MethodData.Define): Add CS0683.
2909 (FieldMember.ctor): Add CS0681.
2911 2005-03-07 Raja R Harinath <rharinath@novell.com>
2913 * ecore.cs (SimpleName.DoResolve): Rename from
2914 SimpleName.DoResolveAllowStatic.
2915 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2916 Pass 'intermediate' flag to MemberStaticCheck.
2917 (SimpleName.MemberStaticCheck): Skip "static check" only in case
2918 of "intermediate" lookups via MemberAccess.
2919 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
2920 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2922 2005-03-07 Raja R Harinath <rharinath@novell.com>
2925 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2926 slipped in because of variable names that are identical to a
2927 builtin type's BCL equivalent ('string String;', 'int Int32;').
2928 (PropertyExpr.EmitInstance): Likewise.
2930 2005-03-04 Marek Safar <marek.safar@seznam.cz>
2932 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2934 * report.cs (warning_ignore_table): Made public.
2936 2005-03-04 Raja R Harinath <rharinath@novell.com>
2939 * class.cs (MethodData.Emit): Pass 'container' to
2940 container.GetObsoleteAttribute instead of 'container.Parent'.
2942 2005-03-03 Marek Safar <marek.safar@seznam.cz>
2944 * cs-parser.jay: Add 1534 error test.
2946 * iterators.cs (Yield.CheckContext): Add error 1629.
2947 (Iterator.ctor): Save unsafe modifier.
2948 (MoveNextMethod.DoEmit): Restore unsafe context.
2950 * namespace.cs (UsingAlias): Better error message.
2952 2005-03-03 Dan Winship <danw@novell.com>
2954 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2955 the warning message [#73219]
2957 2005-03-03 Raja R Harinath <rharinath@novell.com>
2959 Fix compile with MCS 1.0.0.0.
2960 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2961 w_restore to not depend on string constant folding.
2963 2005-03-03 Raja R Harinath <rharinath@novell.com>
2965 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
2966 CS0246 check to users who passed 'silent = false'.
2967 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2969 (SimpleName.SimpleNameResolve): Update.
2970 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2971 (MemberAccess.IdenticalNameAndTypeName): Update.
2972 * doc.cs (FindDocumentedTypeNonArray): Update.
2974 2005-03-03 Raja R Harinath <rharinath@novell.com>
2976 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2977 * parameters.cs (ComputeAndDefineParameters): Remove.
2978 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2979 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2980 Use GetParameterInfo.
2982 2005-03-02 Marek Safar <marek.safar@seznam.cz>
2984 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2986 2005-03-02 Raja R Harinath <rharinath@novell.com>
2988 Unify DeclSpace.LookupType and DeclSpace.FindType.
2989 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
2990 is in charge of defining nested types on demand.
2991 (DeclSpace.LookupType): Use it when the current_type is a
2992 TypeBuilder. Use LookupTypeDirect for reflected types.
2993 (DeclSpace.FindType): Remove.
2994 (DeclSpace.LookupInterfaceOrClass): Likewise.
2995 (DeclSpace.DefineTypeAndParents): Likewise.
2996 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2997 DeclSpace.LookupType.
2998 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2999 * typemanager.cs (LookupType): Simplify.
3000 (AddUserType): Remove type from negative_hits.
3001 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3002 * class.cs (TypeContainer.FindMembers): Move handling of nested
3004 (TypeContainer.FindMembers_NestedTypes): ... here.
3005 (TypeContainer.FindNestedType): Implement override.
3006 (ClassPart.FindNestedType): Delegate to PartialContainer.
3007 (ClassPart.PartFindNestedType): Looks up the nested types of the
3010 2005-03-02 Martin Baulig <martin@ximian.com>
3012 * class.cs (TypeContainer.DoDefineMembers): We also need a default
3013 static constructor in static classes.
3015 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
3017 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3018 sizeParamIndex is not specified.
3020 2005-03-01 Marek Safar <marek.safar@seznam.cz>
3023 * report.cs (WarningMessage.IsEnabled): Missing null check.
3025 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3027 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3028 in the fields and not in the properties.
3030 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
3032 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
3035 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3037 * attribute.cs: Small refactoring (improved robustness).
3038 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3039 (ValidateGuid): Removed.
3040 (Resolve): Removed referenced to above mentioned.
3041 (GetAttributeUsage): Made private and changed to work without
3043 (GetIndexerAttributeValue): Don't crash.
3044 (GetConditionalAttributeValue): Ditto.
3045 (GetClsCompliantAttributeValue): Ditto.
3046 (ExtractSecurityPermissionSet): All attributes exceptions are
3048 (GetPropertyValue): New helper.
3049 (GetMethodImplOptions): New method.
3050 (DefinePInvokeMethod): Reuse common code. Implemented handling of
3051 some missing properties.
3053 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3054 (Method.ApplyAttributeBuilder): Updated.
3056 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3059 2005-02-28 Raja R Harinath <rharinath@novell.com>
3062 * report.cs (Report.SymbolRelatedToPreviousError): Handle
3063 non-simple types (array, pointer, reference).
3065 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3067 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3069 * class.cs (MethodCore.IsDuplicateImplementation): Special error
3071 (Method.CheckBase): Catch wrong destructor here.
3072 (MethodData.Define): Add errors 550, 668.
3074 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3076 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3078 * pending.cs (VerifyPendingMethods): Add error 551.
3080 * typemanager.cs (CSharpName): Next error report helper.
3082 2005-02-25 Marek Safar <marek.safar@seznam.cz>
3084 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3085 attributes. Removed useless attribute double check.
3086 It saves almost 2MBs for corlib.
3088 2005-02-25 Raja R Harinath <rharinath@novell.com>
3091 * statement.cs (ExpressionStatement.Resolve): Make robust to being
3092 called twice in case of error.
3094 2005-02-23 Chris Toshok <toshok@ximian.com>
3096 Fix compiler portions of #72827.
3097 * statement.cs (Block.Emit): call Begin/EndScope on the
3098 EmitContext instead of the ILGenerator.
3100 * codegen.cs (EmitContext.BeginScope): new method, call
3101 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3103 (EmitContext.BeginScope): same, but EndScope and CloseScope
3105 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3106 offset and call the superclass's OpenScope(int) with it.
3107 (SymbolWriter.CloseScope): get the current il
3108 offset and call superclass's CloseScope(int) with it.
3110 2005-02-23 Marek Safar <marek.safar@seznam.cz>
3112 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3113 CS1677 for out and ref as well.
3115 * class.cs (Method.Define): Add error CS1599 detection.
3117 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3119 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3121 * delegate.cs (Delegate.Define): Add error CS1599 detection.
3123 * support.cs.cs (ModifierDesc): New helper method.
3125 2005-02-23 Raja R Harinath <rharinath@novell.com>
3126 Abin Thomas <projectmonokochi@rediffmail.com>
3127 Anoob V E <projectmonokochi@rediffmail.com>
3128 Harilal P R <projectmonokochi@rediffmail.com>
3131 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3132 MemberLookup (used for error reporting) actually returns a result.
3133 Fix error report number (122, not 112).
3135 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
3136 Anoob V E <projectmonokochi@rediffmail.com>
3137 Harilal P R <projectmonokochi@rediffmail.com>
3140 * pending.cs (PendingImplementation.GetAbstractMethods):
3141 Find NonPublic members too.
3143 2005-02-22 Marek Safar <marek.safar@seznam.cz>
3145 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3148 * class.cs (MethodCore.CheckMethodAgainstBase):
3149 Add error 239 report.
3151 2005-02-21 Raja R Harinath <rharinath@novell.com>
3154 * expression.cs (Invocation.IsApplicable): Make public.
3155 (Invocation.IsParamsMethodApplicable): Likewise.
3156 * delegate.cs (Delegate.VerifyApplicability): Don't use
3157 Invocation.VerifyArgumentCompat for parameter applicability
3158 testing. Use Invocation.IsApplicable and
3159 Invocation.IsParamsMethodApplicable.
3161 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3163 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3165 * class.cs (Operator.Define): Add error 217 report.
3167 2005-02-21 Raja R Harinath <rharinath@novell.com>
3169 * namespace.cs (UsingEntry.Resolve): Undo change below.
3171 2005-02-21 Raja R Harinath <rharinath@novell.com>
3174 * ecore.cs (Expression.MemberLookupFailed): Add argument to
3175 disable the error message when the extended MemberLookup also
3177 (Expression.MemberLookupFinal): Update.
3178 (SimpleName.DoSimpleNameResolve): Update.
3179 * expression.cs (MemberAccess.ResolveNamespaceOrType):
3180 Don't use MemberLookupFinal.
3181 (New.DoResolve): Update.
3182 (BaseAccess.CommonResolve): Update.
3184 2005-02-21 Raja R Harinath <rharinath@novell.com>
3187 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3188 occured previously, don't resolve again.
3190 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3193 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3194 argument. Call ResolveAttributeUsage for unresolved.
3195 when types doesn't match ctor arguments.
3197 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3198 for nested attribute classes.
3199 (Class.attribute_usage): Removed.
3200 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3201 for attribute class.
3203 * ecore.cs (IsAttribute): Removed.
3205 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3207 * rootcontext.cs (RegisterAttribute): Removed, attributes are
3209 (attribute_types): Removed.
3210 (EmitCode): Global attributes are emited as the latest.
3212 2005-02-18 Marek Safar <marek.safar@seznam.cz>
3214 * class.cs (EmitFieldInitializers): Don't emit field initializer
3215 for default values when optimilization is on.
3217 * constant.cs (Constant.IsDefaultValue): New property.
3219 * driver.cs: Add /optimize handling.
3223 * literal.cs: Implement new IsDefaultValue property.
3225 * rootcontext.cs (Optimize): New field, holds /optimize option.
3227 2005-02-18 Raja R Harinath <rharinath@novell.com>
3229 Fix crasher in re-opened #72347.
3230 * namespace.cs (Namespace.Lookup): Return null if
3231 DeclSpace.DefineType returns null.
3234 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3236 2005-02-18 Raja R Harinath <rharinath@novell.com>
3238 Fix remainder of #63202. Change semantics of DoResolveLValue: it
3239 now returns null if it cannot resolve to an lvalue.
3240 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3241 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3242 returned null. Remove check for SimpleName.
3243 (EventExpr.DoResolveLValue): New.
3244 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3245 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
3247 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
3249 (Unary.ResolveOperator): Move CS0211 check ...
3250 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
3252 (Unary.DoResolveLValue): Simplify.
3253 (AddressOf.DoResolveLValue): New.
3254 (ArrayAccess.DoResolveLValue): New.
3256 2005-02-16 Marek Safar <marek.safar@seznam.cz>
3258 * attribute.cs (Attribute.Resolve): Add arguments casting for
3259 when types doesn't match ctor arguments.
3261 2005-02-16 Raja R Harinath <rharinath@novell.com>
3263 Fix parts of #63202.
3264 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3265 lookup of operator in base type. Ensure that all checks happen
3266 when the operator resolves to an "op_..." method.
3268 2005-02-15 Raja R Harinath <rharinath@novell.com>
3271 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3272 'ignore_cs0104' parameter. Pass it to ...
3273 (NamespaceEntry.Lookup): ... this.
3274 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3275 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3276 (TypeLookupExpression.DoResolveAsTypeStep): Update.
3277 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3278 Update. Request that cs0104 errors be ignored.
3279 (ComposedCast.ResolveAsTypeStep): Update.
3281 2005-02-14 Raja R Harinath <rharinath@novell.com>
3284 * expression.cs (Invocation.BetterFunction): Remove support for
3285 comparing virtual functions and their overrides.
3286 (Invocation.IsOverride): New.
3287 (Invocation.OverloadResolve): Don't consider 'override' functions
3288 during candidate selection. Store them in a lookaside list.
3289 If the selected method is a 'virtual' function, use the list to
3290 find any overrides that are closer to the LHS type.
3292 2005-02-14 Marek Safar <marek.safar@seznam.cz>
3294 * expression.cs (New.DoResolve): Add complex core type reduction.
3295 (New.Constantify): Converts complex core type syntax like 'new int ()'
3298 2005-02-14 Raja R Harinath <rharinath@novell.com>
3300 * decl.cs (EntryType.EntryType): New constructor to create an
3301 updated copy of a cache entry.
3302 (MemberCache.AddMethods): Use it.
3303 (MemberCache.ClearDeclaredOnly): Remove.
3304 (MemberCache.MemberCache): Update.
3306 2005-02-11 Miguel de Icaza <miguel@novell.com>
3308 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3309 variable. This one is represents the actual low-level declaration
3310 of the method, as opposed to the semantic level `IsStatic'.
3312 An anonymous method which is hosted into a static method might be
3313 actually an instance method. IsStatic would reflect the
3314 container, while MethodIsStatic represents the actual code
3317 * expression.cs (ParameterReference): Use the new MethodIsStatic
3318 instead of IsStatic.
3320 * anonymous.cs (AnonymousMethod.Compatible): Pass the
3321 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3322 set on the current EmitContext.
3324 * expression.cs (Cast): Overload DoResolveLValue so we can pass
3325 resolve our casted expression as an LValue. This triggers the
3326 proper LValue processing that is later required by Assign.
3330 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3332 2005-02-11 Marek Safar <marek.safar@seznam.cz>
3334 C# 2.0 Fixed buffer implementation
3336 * anonymous.cs: Update after RegisterHelperClass renaming.
3338 * attribute.cs (AttributeTester.fixed_buffer_cache):
3339 Cache of external fixed buffers.
3340 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3341 implementation if field is fixed buffer else null.
3344 (TypeContainer.AddField): Accept FieldMember instead of Field.
3345 (FieldBase.IsFieldClsCompliant): Extracted code from
3346 VerifyClsCompliance descendant customization.
3347 (FixedField): New class handles fixed buffer fields.
3348 (FixedFieldExternal): Keeps information about imported fixed
3350 (IFixedField): Make access to internal or external fixed buffer
3353 * cs-parser.jay: Add fixed buffer parsing.
3355 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3358 * expression.cs (Indirection): Extended implementation to accept
3360 (PointerArithmetic.Emit): Get element from fixed buffer as well.
3361 (ElementAccess.MakePointerAccess): Get type as parameter.
3362 (DoResolve): Add fixed buffer field expression conversion.
3363 (DoResolveLValue): Ditto.
3364 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3365 (ArrayPtr): Derives from FixedBufferPtr.
3366 (ArrayPtr.Emit): Add extra emit for array elements.
3368 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3370 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3371 for compiler generated types.
3372 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3374 * statement.cs (Fixed): Refactored to be easier add fixed buffer
3375 and consume less memory.
3376 (Fixed.Resolve): Add fixed buffer case.
3378 * typemanager.cs (compiler_generated_attr_ctor,
3379 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3380 (HasElementType): Add our own implementation to work on every
3383 2005-02-11 Miguel de Icaza <miguel@novell.com>
3385 * anonymous.cs (CaptureContext): Track whether `this' has been
3388 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
3389 only captured `this' if it was implicitly done (instance
3390 methods/variables were used).
3392 * codegen.cs (EmitContext.CaptureThis): New method to flag that
3393 `this' must be captured.
3395 2005-01-30 Miguel de Icaza <miguel@novell.com>
3397 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3398 is null it means that there has been no need to capture anything,
3399 so we just create a sibling.
3401 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3403 Just a partial fix. The other half is fairly elusive.
3405 2005-02-10 Raja R Harinath <rharinath@novell.com>
3407 Fix #52586, cs0121-4.cs.
3408 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
3409 and return a hashtable.
3410 (MemberCache.ClearDeclaredOnly): New.
3411 (MemberCache.MemberCache): Update to change. Make a deep copy of
3412 the method_hash of a base type too.
3413 (MemberCache.AddMethods): Adapt to having a deep copy of the base
3414 type methods. Overwrite entries with the same MethodHandle so
3415 that the ReflectedType is correct. The process leaves in base
3416 virtual functions and their overrides as distinct entries.
3417 (CacheEntry): Now a class instead of a struct. It shouldn't alter
3418 matters since it was boxed in a ArrayList before.
3419 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3421 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
3422 case of a virtual function and its override (choose the overload
3424 (Invocation.OverloadResolve): Avoid 'override' members during
3425 'applicable_type' calculation.
3427 2005-02-09 Raja R Harinath <rharinath@novell.com>
3429 Combine two near-redundant caches.
3430 * typemanager.cs (method_params): Rename from method_internal_params.
3431 (TypeManager.GetParameterData): New. Replace
3432 Invocation.GetParameterData.
3433 (TypeManager.LookupParametersByBuilder): Remove.
3434 * expression.cs (Invocation.method_parameter_cache): Remove.
3435 (Invocation.GetParameterData): Remove.
3437 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3440 2005-02-08 Raja R Harinath <rharinath@novell.com>
3443 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3444 TypeManager.multicast_delegate_type is null, resolve it by looking
3445 up "System.MulticastDelegate".
3446 * rootcontext.cs (RootContext.ResolveCore): Simplify.
3448 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
3449 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
3450 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
3453 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3454 (LabeledStatement.AddReference): New. Set 'referenced'.
3455 (Goto.Resolve): Use it.
3457 2005-02-05 John Luke <john.luke@gmail.com>
3459 * driver.cs: remove duplicate -doc line in Usage ()
3461 2005-02-04 Raja R Harinath <rharinath@novell.com>
3463 * location.cs (Location.AddFile): Fix CS2002 error report.
3465 2005-02-02 Martin Baulig <martin@ximian.com>
3467 * delegate.cs (Delegate.DefineType): Report an internal error if
3468 TypeManager.multicast_delegate_type is null. See bug #72015 for
3471 2005-02-02 Raja R Harinath <rharinath@novell.com>
3473 Fix a crasher in a variant of #31984.
3474 * const.cs (Constant.CheckBase): New override that defers the
3475 new-or-override check in case the base type hasn't been populated
3477 (Constant.Define): Ensure the new-or-override check is performed.
3479 2005-02-01 Duncan Mak <duncan@ximian.com>
3481 * const.cs (LookupConstantValue): Check that `ce' is not null
3482 before calling GetValue ().
3484 2005-02-01 Raja R Harinath <rharinath@novell.com>
3486 Fix test-334.cs (#69519).
3487 * cs-parser.jay (using_alias_directive): Pass in an expression to
3488 NamespaceEntry.UsingAlias.
3489 (using_namespace_directive): Pass in an expression to
3490 NamespaceEntry.Using.
3491 (namespace_name): Don't flatten to a string.
3492 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3493 (NamespaceEntry.AliasEntry.Resolve): Lookup using
3495 (NamespaceEntry.UsingEntry): Likewise.
3496 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3498 (NamespaceEntry.LookupForUsing): Remove.
3499 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3501 (NamespaceEntry.Lookup): Remove support for dotted names.
3503 2005-02-01 Raja R Harinath <rharinath@novell.com>
3505 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3507 (NamespaceEntry.ImplicitParent): Compute on demand.
3508 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3509 parallels the current.
3510 (NamespaceEntry.LookupForUsing): Use it.
3511 (NamespaceEntry.Lookup): If the current namespace-entry is
3512 implicit, don't search aliases and using tables.
3514 2005-02-01 Raja R Harinath <rharinath@novell.com>
3517 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3519 (TypeContainer.BaseCache): Compute on demand.
3520 (TypeContainer.FindMembers): Define constants and types if they're
3521 not already created.
3522 (FieldMember.Define): Move resetting of ec.InUnsafe before error
3524 * const.cs (Constant.Define): Make idempotent.
3526 2005-01-29 Miguel de Icaza <miguel@novell.com>
3528 * pending.cs: Produce better code (no nops produced by using Ldarg
3531 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3532 i - 1' it should be arg + 1.
3536 2005-01-28 Raja R Harinath <rharinath@novell.com>
3538 * attribute.cs (Attribute.CheckAttributeType): Make private
3540 (Attribute.ResolveType): Make virtual.
3541 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3542 handling of RootContext.Tree.Types.
3544 2005-01-27 Raja R Harinath <rharinath@novell.com>
3546 Update attribute-handling to use the SimpleName/MemberAccess
3548 * cs-parser.jay (attribute): Pass in an expression to the
3549 constructors of Attribute and GlobalAttribute.
3550 * attribute.cs (Attribute): Take an expression for the name.
3551 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
3552 passed in attribute name expression.
3553 (Attribute.CheckAttributeType): Use it.
3554 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3555 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3556 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
3557 argument to prevent error messages if the lookup fails.
3559 2005-01-27 Marek Safar <marek.safar@seznam.cz>
3561 * expression.cs (Indirection): Implemented IVariable interface
3562 to support indirection in AddressOf operator.
3563 (PointerArithmetic.Emit): Add optimalization for case where
3564 result can be precomputed.
3566 2005-01-26 Martin Baulig <martin@ximian.com>
3568 * class.cs (TypeContainer.AttributeTargets): Return the correct
3569 AttributeTargets depending on our `Kind' instead of throwing an
3570 exception; fixes #71632.
3572 2005-01-26 Marek Safar <marek.safar@seznam.cz>
3575 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3578 2005-01-25 Raja R Harinath <rharinath@novell.com>
3581 * expression.cs (MemberAccess.DoResolve): Don't complain with
3582 cs0572 when the LHS of a member access has identical name and type
3585 2005-01-25 Marek Safar <marek.safar@seznam.cz>
3588 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3590 Create custom PermissionSet only for PermissionSetAttribute.
3592 2005-01-24 Marek Safar <marek.safar@seznam.cz>
3595 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3596 delegates in static class.
3598 2005-01-24 Martin Baulig <martin@ximian.com>
3600 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3601 merging an implicit block, just use its reachability.
3603 * statement.cs (Block.Resolve): Make the unreachable code check
3604 work wrt. implicit blocks; see test-337 from #63842.
3606 2005-01-21 Alp Toker <alp@atoker.com>
3608 * cs-parser.jay: destructor_declaration's container is PartialContainer
3609 not Class when partial types are used, so use Kind prop instead of
3612 2005-01-22 Miguel de Icaza <miguel@ximian.com>
3614 * cs-parser.jay: Improve error reporting when an interface
3617 2005-01-20 Dick Porter <dick@ximian.com>
3619 * support.cs: SeekableStreamReader fix from Sandor Dobos
3620 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3621 chars are read. Fixes bug 70369.
3623 2005-01-20 Raja R Harinath <rharinath@novell.com>
3625 * cs-parser.jay (catch_clause): Simplify current_block handling
3628 2005-01-17 Miguel de Icaza <miguel@ximian.com>
3630 * convert.cs (ImplicitStandardConversionExists): Synchronize the
3631 code with ImplicitStandardConversion to handle the implicit
3632 conversion of method groups into valid delegate invocations.
3634 The problem is that in parameter handling we were using this code
3635 path. Fixes bug #64698
3637 2005-01-19 Raja R Harinath <rharinath@novell.com>
3639 * cs-parser.jay: Fix several infelicities.
3640 - Avoid assigning to the parser value stack. Code like
3641 '$3 = null' is unclean. Synthesize a value for the code block
3643 - Avoid using oob_stack for storing location information. Use ...
3644 (_mark_): ... this. New (empty) rule. Saves the current location
3646 (foreach_statement): Avoid using oob_stack for current_block
3647 handling. Use technique used in for_statement and
3648 using_statement. Synthesize a value for the code block to store
3649 additional intermediate information.
3651 2005-01-13 Miguel de Icaza <miguel@ximian.com>
3653 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3654 of a different type is only allowed to private fields of a
3655 containing type, not on fields of a base class.
3657 See test-174.cs and error cs0122-9.cs
3659 2005-01-13 Raja R Harinath <rharinath@novell.com>
3661 Fix test-335.cs (bug #58126).
3662 * cs-parser.jay (argument): Split out non-expression parts of the
3663 rule into 'non_simple_argument'.
3664 (invocation_expression): Support parenthesized invocations with
3665 multiple arguments, and with single non-simple arguments.
3667 2005-01-13 Raja R Harinath <rharinath@novell.com>
3669 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3672 2005-01-12 Raja R Harinath <rharinath@novell.com>
3674 Fix cs0038-1.cs, cs1640-6.cs.
3675 * ecore.cs (Expression.Resolve): Remove special-case for
3676 SimpleName in error-handling.
3677 (Expression.almostMatchedMembers): Relax access permission to
3679 (Expression.MemberLookupFailed): Handle duplicates in
3680 almostMatchedMembers list.
3681 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3682 * expression.cs (New.DoResolve): Report CS1540 for more cases.
3683 * typemanager.cs (GetFullNameSignature): Use the MethodBase
3684 overload if the passed in MemberInfo is a MethodBase.
3686 2005-01-12 Marek Safar <marek.safar@seznam.cz>
3689 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3690 for non-CAS & merge permission sets properly.
3692 2005-01-11 Raja R Harinath <rharinath@novell.com>
3694 Improve standard-compliance of simple name and member access
3695 resolution. Fixes bugs #52697, #57200, #67520, #69519.
3696 * ecore.cs (FullNamedExpression): New abstract base class
3697 for Namespaces and TypeExpressions.
3698 (ResolveFlags.SimpleName): Remove.
3699 (SimpleName): Remove support for dotted names.
3700 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
3701 DeclSpace.FindType and DeclSpace.LookupType.
3702 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3703 (Expression.ExprClassName): Make member function.
3704 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3705 a namespace. Remove creation of dotted "SimpleName"s.
3706 (MemberAccess.DoResolve): Likewise.
3707 * decl.cs (DeclSpace.Cache): Make private.
3708 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3709 (DeclSpace.FindType): Update.
3710 (DeclSpace.LookupType): Move here from RootContext. Return a
3711 FullNamedExpression.
3712 * namespace.cs (Namespace): Derive from FullNamedExpression
3713 so that it can be part of expression resolution.
3714 (Namespace.Lookup): Return an FullNamedExpression.
3715 (NamespaceEntry.LookupAlias): Lookup aliases only in current
3717 * rootcontext.cs (NamespaceLookup): Remove.
3718 (LookupType): Move to DeclSpace.
3719 * attribute.cs (CheckAttributeType): Update.
3720 * doc.cs (FindDocumentedType): Remove allowAlias argument.
3721 (FindDocumentedTypeNonArray): Likewise.
3723 2005-01-11 Raja R Harinath <rharinath@novell.com>
3725 Fix cs0509.cs, cs1632.cs.
3726 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3727 is the same as IsInterface.
3728 (TypeContainer.GetClassBases): Likewise.
3729 * statement.cs (LabeledStatement.ig): New field.
3730 (LabeledStatement.LabelTarget): Save ILGenerator which created the
3732 (LabeledStatement.DoEmit): Check that the label was created with
3733 the same ILGenerator.
3735 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3738 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3739 accessors to its properties.
3741 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3742 from accessors to property.
3744 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3747 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3750 2005-01-08 Miguel de Icaza <miguel@ximian.com>
3752 * attribute.cs: Check for null and empty strings.
3754 I have lost another battle to Paolo.
3756 2005-01-07 Marek Safar <marek.safar@seznam.cz>
3759 * class.cs (PropertyMethod): Set Parent field in ctors.
3760 (SetMethod.InternalParameters): Add unsafe switch hack.
3761 Override MarkForDuplicationCheck where it is appropriate.
3763 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3764 It says whether container allows members with the same name.
3766 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3767 Removed is_method parameter.
3769 2005-01-06 Duncan Mak <duncan@ximian.com>
3771 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3772 because the previous change led to incorrect reporting of CS1032
3773 ("Cannot define/undefine preprocessor symbols after first token in
3774 file"). Instead of using `tokens_seen' as the only flag that
3775 triggers CS1040, introduce `comments_seen'. This new flag is used
3776 to signify having seen comments on the current line, so it is
3777 unset after a newline.
3779 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
3781 * doc.cs : When searching for a type, find nested type too.
3782 This fixes bug #71040.
3784 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
3787 - Warn missing member comment on those classes which also does not
3788 have doc comments. Fixed bug #71041.
3789 - Don't warn missing doc comment on default constructor.
3792 2005-01-06 Duncan Mak <duncan@ximian.com>
3794 * cs-tokenizer.cs (xtoken): After handling traditional C-style
3795 comments, set `tokens_seen' to true. This allows us to detect
3796 misplaced preprocessor directives (i.e. not at the beginning of
3797 the a line, nor after whitespaces). In that case, report error
3798 CS1040. This fixes bug #56460.
3800 * cs-parser.jay (interface_member_declaration): Add checks for
3801 IsExplicitImpl, and report CS0541 error if an interface member is
3802 defined as an explicit interface declaration.
3804 2005-01-06 Marek Safar <marek.safar@seznam.cz>
3807 * class.cs (PropertyMethod): Set Parent field in ctors.
3808 (SetMethod.InternalParameters): Add unsafe switch hack.
3810 * decl.cs (MemberCore.Parent): Cannot be readonly.
3812 2005-01-06 Raja R Harinath <rharinath@novell.com>
3814 * decl.cs (DeclSpace.ResolveType): Remove.
3815 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3816 Merge in code from ...
3817 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
3818 * class.cs, enum.cs: Update to changes.
3820 2005-01-06 Miguel de Icaza <miguel@ximian.com>
3822 * anonymous.cs: Ensure that we init the scope of our parent if it
3823 has not been initialized yet.
3825 2004-12-30 Duncan Mak <duncan@ximian.com>
3827 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3828 if field.FieldBuilder is null. Fixes #70758.
3830 * convert.cs: Fixed some typos and updated some of the comments.
3831 (ImplicitStandardConversionExists):
3832 (TryImplicitIntConversion): If `target_type' is an interface and
3833 the type of `ic' implements this interface, return true or a new
3834 BoxedCast instead of null. This fixes #70468.
3836 2004-12-29 Duncan Mak <duncan@ximian.com>
3838 * expression.cs (Argument.Emit): Check that Expr is
3839 IMemoryLocation before casting to it, and report CS1510 otherwise.
3843 2004-12-21 Ben Maurer <bmaurer@ximian.com>
3845 * statement.cs (Block.ThisVariable): remove the recursion here, to
3846 make the --profile more sane.
3848 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
3850 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3851 assembly, by JB Evain.
3853 2004-12-17 Raja R Harinath <rharinath@novell.com>
3855 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
3856 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3857 "parent" refers to enclosing type/class. "base" refers to superclass.
3859 2004-12-17 Raja R Harinath <rharinath@novell.com>
3861 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3862 Ensure that we only have GlobalAttributes.
3863 * attribute.cs (Attribute.Emit): Make non-virtual.
3864 (GlobalAttribute.Emit): Remove.
3865 (Attribute.Resolve): Make virtual.
3866 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
3867 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3868 the argument. Don't create one.
3869 (Attribute.GetObsoleteAttribute): Likewise.
3870 (Attribute.GetClsCompliantAttributeValue): Likewise.
3871 * class.cs, decl.cs: Update to changes.
3873 2004-12-17 Marek Safar <marek.safar@seznam.cz>
3875 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3877 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3879 * statement.cs (Foreach.Resolve): Add error 186 report.
3881 2004-12-16 Marek Safar <marek.safar@seznam.cz>
3883 * expression.cs (Conditional.DoResolve): Add warning 429.
3885 * statement.cs (If.Resolve): Add warning 665.
3887 2004-12-16 Raja R Harinath <rharinath@novell.com>
3889 New invariant: RootContext.Tree.Types.NamespaceEntry == null
3890 except when in the parser, and in GlobalAttribute.
3891 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3892 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3893 RootContext.Tree.Types.NamespaceEntry once work is done.
3894 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
3895 and resets RootContext.Tree.Types.NamespaceEntry.
3897 2004-12-15 Marek Safar <marek.safar@seznam.cz>
3899 * cs-parser.jay: Don't create a block for every variable.
3901 2004-12-14 Miguel de Icaza <miguel@ximian.com>
3903 * location.cs: Provide extra information.
3905 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3906 variables from the captured environment, it is the ldarg_0.
3908 2004-12-14 Marek Safar <marek.safar@seznam.cz>
3910 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3913 * class.cs: Changed warning level for 169 to avoid developer
3914 displeasure from warning flooding. It will be changed back when they
3915 fix most of current BCL warnings.
3917 * RootContext.cs: Pushed default WarningLevel to 3.
3919 * statement.cs: Removed unused variable.
3921 2004-12-14 Marek Safar <marek.safar@seznam.cz>
3923 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3924 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3925 Add error 502 report.
3926 (StaticClass.DefineType): Add error 441 report.
3927 (Class.AllowedModifiersProp): New virtual property as temporary
3928 extension to AllowedModifiers.
3929 (Class.DefineType): Add error 418 report. Moved ModFlags check here
3930 to share implementation with StaticClass and don't call virtual
3933 * driver.cs (MainDriver): Add error 1558 test.
3935 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3936 report. Moved error 36 test here.
3938 * statement.cs (Throw.Resolve): Add error 724 report.
3940 * typemanager.cs: Add out_attribute_type core type.
3942 2004-12-13 Marek Safar <marek.safar@seznam.cz>
3944 * class.cs (TypeContainer.VerifyClsCompliance): Add error
3946 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3948 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3951 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3953 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
3954 Add error 3023 report.
3955 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3957 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3960 2004-12-12 John Luke <john.luke@gmail.com>
3962 * driver.cs (AddArgs): take -- into account when
3963 adding arguments, fixes bug 65710
3965 2004-12-12 Martin Baulig <martin@ximian.com>
3967 * expression.cs (Unary.TryReduceNegative): Added support for
3968 SByteConstant and ByteConstant.
3969 (Unary.Reduce): Check error values from TryReduceNegative().
3971 2004-12-10 Marek Safar <marek.safar@seznam.cz>
3973 * attributes.cs (Attribute.Resolve): Avoid multiple error report
3974 and report exception as error 182.
3976 2004-12-10 Raja R Harinath <rharinath@novell.com>
3978 * driver.cs (Main): Fix message when there are warnings.
3980 2004-12-09 Miguel de Icaza <miguel@ximian.com>
3982 * delegate.cs: Fixed my fix from yesterday, sorry about that.
3984 2004-12-09 Marek Safar <marek.safar@seznam.cz>
3986 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
3987 Reduced number of warnings.
3989 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3991 2004-12-08 Miguel de Icaza <miguel@ximian.com>
3993 * driver.cs: Removed message.
3995 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3997 2004-12-08 <vargaz@freemail.hu>
3999 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4001 2004-12-08 Martin Baulig <martin@ximian.com>
4003 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4004 instead of a CS3002 for properties and indexer.
4006 2004-12-08 Martin Baulig <martin@ximian.com>
4008 * decl.cs (MemberName.ToString): Make this work again.
4010 2004-12-08 Marek Safar <marek.safar@seznam.cz>
4012 * attribute.cs (Resolve): Add error 591 detection.
4014 * class.cs (FieldMember.Define): Add error 1547 detection.
4015 (Indexer.Define): Add error 620 detection.
4016 (Operator.Define): Add error 590 detection.
4018 * ecore.cs: Missing argument for error 79.
4020 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4023 2004-12-07 Marek Safar <marek.safar@seznam.cz>
4026 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4029 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4031 * cs-parser.jay : handle doc comments on implicit/explicit operators.
4032 Some operator comments were suppressed.
4033 * doc.cs : Implicit/explicit operator name in doc comments are like
4034 "op_Explicit(type)~returnType", so added suffix handling.
4036 2004-12-07 Martin Baulig <martin@ximian.com>
4039 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4040 (MemberCore.GetClsCompliantAttributeValue): Likewise.
4041 (DeclSpace.ec): New protected field; store the EmitContext here.
4042 (DeclSpace.EmitContext): New public property; moved here from
4044 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4047 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4048 (Enum.Emit): Don't create a new EmitContext.
4050 * delegate.cs (Delegate.DefineType): Always create the
4053 * iterators.cs (Iterators.DefineIterator): Create a new
4054 EmitContext and store it in `ec'.
4056 2004-08-24 Martin Baulig <martin@ximian.com>
4059 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
4060 this for accessibility checks.
4061 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
4062 IsNestedFamilyAccessible.
4063 (TypeManager.IsSubclassOf): New method, do what the name actually
4066 2004-12-06 Raja R Harinath <rharinath@novell.com>
4068 Fix crash on cs0657-17.cs.
4069 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4070 Use RootContext.Tree.Types, not 'new RootTypes ()'.
4071 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4072 the case where the NamespaceEntry gets overwritten.
4074 2004-12-06 Marek Safar <marek.safar@seznam.cz>
4076 Fixed #69195, #56821
4077 * ecore.cs (ResolveBoolean): Tiny refactoring.
4079 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4080 of right expression resolving when left is false constant and
4081 operator is LogicalAnd OR true constant and operator is LogicalOr.
4083 * statement.cs (ResolveUnreachable): Always reports warning.
4085 2004-12-05 Miguel de Icaza <miguel@ximian.com>
4087 * class.cs: Distinguish between 1721 and 1722 (just a little help
4088 for the programmer).
4090 2004-12-03 Miguel de Icaza <miguel@ximian.com>
4092 * delegate.cs: Only allow this on new versions of the language.
4094 2004-12-02 Duncan Mak <duncan@ximian.com>
4096 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4098 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4099 here as a static method. Take an additional bool out parameter
4100 `must_do_cs1540_check' for signaling to InstanceResolve.
4101 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4102 member field from PropertyExpr class and made it an argument of
4104 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4105 check for MarshalByRefObject, and report CS0122 instead of CS1540.
4106 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4107 and `remove_accessor' as well as InstanceResolve: report CS0122
4112 2004-12-03 Raja R Harinath <rharinath@novell.com>
4114 Fix test-327.cs, test-328.cs, and put in early infrastructure
4115 for eventually fixing #52697.
4116 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4117 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4119 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4120 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4121 (VerifyUsing, error246): Update.
4122 * rootcontext.cs (RootContext.NamespaceLookup): Just use
4123 'NamespaceEntry.LookupNamespaceOrType'.
4125 2004-12-03 Martin Baulig <martin@ximian.com>
4127 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4128 method as our child, call AnonymousMethod.Compatible() on it.
4130 2004-12-03 Raja R Harinath <rharinath@novell.com>
4132 Disable XML documentation support in 'basic' profile.
4133 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
4134 Redirect XmlElement to System.Object.
4135 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
4136 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
4137 * mcs.exe.sources: Add doc-bootstrap.cs.
4138 * doc-bootstrap.cs: New file. Contains empty stub implementation
4141 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
4143 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4144 comments are allowed.
4146 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4148 * delegate.cs: Add checks for subtypes in paramaters and return values
4149 in VerifyMethod () to add support for Covariance/Contravariance
4152 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4154 * report.cs: Remove extra closing parenthesis.
4156 * convert.cs (Error_CannotImplicitConversion): If the name of the
4157 types are the same, provide some extra information.
4159 * class.cs (FieldBase): Use an unused bit field from the field to
4160 encode the `has_offset' property from the FieldMember. This saves
4161 a couple of Ks on bootstrap compilation.
4163 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4164 method as our child, return the AnonymousMethod resolved
4167 * expression.cs (New.DoResolve): Allow return values from
4168 NewDelegate to also include AnonymousMethods.
4172 2004-12-02 Marek Safar <marek.safar@seznam.cz>
4175 * attribute.cs (Resolve): Improved implementation of params
4176 attribute arguments.
4178 * support.cs (ParameterData): Add HasParams to be faster.
4180 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
4182 all things are for /doc support:
4184 * doc.cs: new file that supports XML documentation generation.
4185 * mcs.exe.sources: added doc.cs.
4187 Handle /doc command line option.
4188 Report error 2006 instead of 5 for missing file name for /doc.
4189 Generate XML documentation when required, after type resolution.
4191 Added support for picking up documentation (/// and /** ... */),
4192 including a new XmlCommentState enumeration.
4194 Added lines to fill Documentation element for field, constant,
4195 property, indexer, method, constructor, destructor, operator, event
4196 and class, struct, interface, delegate, enum.
4197 Added lines to warn incorrect comment.
4199 Added Documentation field (passed only when /doc was specified).
4201 Added DocComment, DocCommentHeader, GenerateDocComment() and
4202 OnGenerateDocComment() and some supporting private members for
4203 /doc feature to MemberCore.
4205 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4207 Added overriden DocCommentHeader.
4209 Added overriden DocCommentHeader and GenerateDocComment().
4211 2004-12-01 Miguel de Icaza <miguel@ximian.com>
4213 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4214 unwrapping the enumeration values, chain to
4215 DoConstantNumericPromotions again, so we can promote things to the
4216 fundamental types (takes care of enums that are bytes, sbytes).
4220 2004-12-01 Raja R Harinath <rharinath@novell.com>
4222 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4223 Fix long-standing bug in type-lookup. Use FindType instead of
4224 LookupType when ec.ResolvingTypeTree.
4225 (Attribute.ResolveType, Attribute.Resolve)
4226 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4228 (Attributes.Search): Remove internal version. Update.
4229 (Attributes.SearchMulti): Update.
4230 (Attributes.GetClsCompliantAttribute): Remove.
4231 (Attributes.GetIndexerNameAttribute): Remove.
4232 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4233 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4234 * class.cs (Indexer.Define): Likewise.
4236 2004-12-01 Marek Safar <marek.safar@seznam.cz>
4239 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4240 MarshallByReference members access.
4242 * expression.cs: Use CheckMarshallByRefAccess;
4243 Better error CS0197 message.
4245 * report.cs: Print whole related error message.
4247 2004-11-30 Raja R Harinath <rharinath@novell.com>
4249 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
4250 the current directory to help debugging.
4252 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4254 * class (GetClassBases): Better error 60 report.
4255 (EventProperty): Disabled warning 67 detection.
4257 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4260 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4262 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4265 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4268 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4270 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4272 2004-11-26 Miguel de Icaza <miguel@ximian.com>
4274 * attribute.cs (Attribute.Resolve): Refine error reporting and
4275 report a cs0117 if the identifier does not exist, to distinguish
4276 from 0617 which is a miss-use of the actual identifier.
4278 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4279 between cs0070 and cs0079.
4281 * class.cs (MemberBase.DoDefine): When reporting a wrong
4282 accessibility level, we use MethodCore to compare instead of
4283 Method (this was a regression in some refactoring effort).
4285 So now we correctly report cs0056 again.
4287 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4288 testing the target_type (which was known to be object_type) and
4289 not the source type (which is anonymous_method).
4291 Fixed reporting of error cs1660.
4293 * expression.cs (UserCast.Source): Expose the underlying cast.
4295 * statement.cs (Switch.SwitchGoverningType): Sort the list of
4296 allowed types to find a match to int32 first (most common).
4298 In addition, it ignores any ImplicitUserConversions that did an
4299 internal implicit conversion (as the switch statement allows only
4300 one integral conversion to exist).
4302 * class.cs (PartialContainer.Create): rename `name' to
4303 `member_name' for clarity. Then replace the string calls with a
4304 call to MemberName.GetPartialName, as now using
4305 MemberName.ToString is an error (this is due to the side effects
4306 it had, that were fixed in the past).
4308 This will restore the error reporting on a number of partial class
4309 errors that were missusing this (and getting an exception as a
4310 results, which is now just a plain textual warning, because
4311 yyparse debug output would crash otherwise).
4313 2004-11-26 Raja R Harinath <rharinath@novell.com>
4315 * Makefile (PROGRAM_INSTALL_DIR): Remove.
4317 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4319 * rootcontext.cs (LookupType): Make sure to cache lookups that
4320 don't give us a negative result. This saves about 5% of corlib
4323 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4325 * report.cs (AbstractMessage.Print): messages are sent to stderr
4327 * class.cs (TypeContainer.GetClassBases): It is an error to have a
4328 non-interface in the list of interfaces (at this point, either
4329 parent was properly set, or a base class is being listed in the
4330 interfaces section).
4332 This flags error 1722, and resolves the crash from bug 69259.
4334 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4336 * statement.cs (Using.EmitExpressionFinally): make this work right
4337 for valuetypes. Fixes 69926.
4339 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4341 * const.cs (Const.ChangeType): Cope with the "0 literal can be
4342 converted to an enum" here, before we try to change the underlying
4343 type. This code exists, but it is a different code path than the
4344 one used while encoding constants.
4346 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4347 old bug: when converting from the null literal to a pointer,
4348 return an EmptyCast, not the NullLiteral.
4350 This fixes #69921, the recent null_type changes probably made this
4353 (ImplicitReferenceConversionExists): In addition, resynchronized
4354 the code here, so it matches the same code in
4355 ImplicitReferenceConversionExists for the `from any class-type S
4356 to any interface-type T'.
4359 2004-11-25 Marek Safar <marek.safar@seznam.cz>
4361 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4363 2004-11-24 Miguel de Icaza <miguel@ximian.com>
4365 * cs-parser.jay: Use verbosity accordingly.
4367 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4369 * expression.cs (Unary.ResolveOperator): Do not report warning;
4370 AddressOf reads from variable.
4372 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4374 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4378 * attribute.cs (Attributable): Removed CheckTargets.
4379 (Attributes.Emit): Explicit attribute targets are tested here.
4381 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4382 not enabled for interfaces.
4384 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4385 (GetAssemblyName): Ouch next bug there.
4387 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4389 * expression.cs: Error 275 added.
4391 2004-11-23 Marek Safar <marek.safar@seznam.cz>
4393 Fix bug #69177 (Implemented decimal constant support)
4395 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4396 (BinaryFold): Add DecimalConstant.
4398 * const.cs (Define): Decimal constant
4400 (ChangeType): Add decimal type handling.
4401 (LookupConstantValue): Don't set value for decimal type but
4402 emit DecimalConstantAttribute. Needed for constant optimization.
4404 * constant.cs (ToDecimal): New method.
4405 (ConvertToDecimal): New method.
4406 (IntConstant): Implemented ConvertToDecimal.
4407 (DecimalConstant.Emit): Emit optimized version for decimals in
4410 * expression.cs (ResolveOperator): Changed order of constant
4411 reduction to work correctly with native types which have
4412 overloaded operators.
4413 (ResolveMemberAccess): Extract constant value from attribute
4416 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4418 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4419 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4420 (ChangeType): Decimal is special.
4421 (TypeToCoreType): Add decimal type.
4423 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4425 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4428 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4430 * class.cs (EventField.ApplyAttributeBuilder): Fix error
4433 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4435 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4437 * pending.cs (PendingImplementation): Grab only interfaces.
4439 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4441 * statement.cs (ForeachHelperMethods): Add location member and
4442 error 202 detection.
4444 2004-11-19 Raja R Harinath <rharinath@novell.com>
4446 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
4447 automatically handled by executable.make.
4448 (PROGRAM): Make profile-specific.
4450 2004-11-18 Marek Safar <marek.safar@seznam.cz>
4452 * expression.cs (DoResolveBase): Fixed wrong warning for out
4455 2004-11-18 Martin Baulig <martin@ximian.com>
4457 Merged latest changes into gmcs. Please keep this comment in
4458 here, it makes it easier for me to see what changed in MCS since
4459 the last time I merged.
4461 2004-11-17 Raja R Harinath <rharinath@novell.com>
4463 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4464 (TypeHandle.GetMemberCache): New.
4465 (TypeHandle.TypeHandle): Update.
4466 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4467 (TypeManager.LookupParentInterfacesCache):
4468 Rename from LookupInterfaceCache. Optimize slightly.
4469 (TypeManager.MemberLookup_FindMembers): Update.
4470 * decl.cs (MemberCache.MemberCache): Set Container to null in the
4472 (AddCacheContents): Rename from AddHashtable.
4473 * class.cs (TypeContainer.parent_container): Remove.
4474 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4475 (TypeContainer.DoDefineMembers): Don't initialize it.
4476 Update to name changes.
4478 2004-11-17 Miguel de Icaza <miguel@ximian.com>
4480 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4481 that factors the code to check access modifiers on override.
4483 (PropertyBase): Use the code here.
4485 Patch from Lluis S'anchez, fixes bug #69361.
4487 2004-11-15 Miguel de Icaza <miguel@ximian.com>
4489 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4490 routine that is used to report the use of a captured variable
4491 whose address has been taken.
4493 There are two checks: one when variables are being captured and
4494 the other check is when the address of a variable is taken.
4496 (because an anonymous methods might be resolved before *or* after
4497 the address has been taken) and
4499 * expression.cs (Conditional.DoResolve): Remove the special
4500 casing that Martin added to trueExpr and falseExpr being both
4501 NullLiteral. We get the right behavior now just by introducing
4502 the null_type into the compiler.
4504 * convert.cs (ExplicitConversion): Change the code to use
4505 null_type instead of testing `expr is NullLiteral'.
4506 (ImplicitConversionStandard): use null_type too.
4507 (ImplicitReferenceConversionExists): use null_type too.
4508 (ImplicitReferenceConversion): use null_type too.
4510 * literal.cs: The type of `NullLiteral' is now null_type instead
4512 (Resolve): Set the type here.
4514 * typemanager.cs: Introduce null_type.
4516 2004-11-17 Martin Baulig <martin@ximian.com>
4518 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4519 direction, like FindMembers() does. Fixes #69546, testcase is in
4522 2004-11-16 Martin Baulig <martin@ximian.com>
4524 This is based on a patch from Marek Safar, see bug #69082.
4525 Fixes bugs #63705 and #67130.
4527 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4528 method; create a MemberCache for an interface type and cache the
4531 * decl.cs (IMemberContainer.ParentContainer): Removed.
4532 (IMemberContainer.ParentCache): New property.
4533 (MemberCache.SetupCacheForInterface): Removed.
4534 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4535 to create a cache for an interface's "parent".
4537 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4540 2004-11-16 Martin Baulig <martin@ximian.com>
4542 Merged back from gmcs; these changes already went into gmcs a
4543 couple of weeks ago.
4546 (TypeManager.AddUserType): Removed the `ifaces' argument.
4547 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4549 (TypeManager.AddUserInterface): Removed.
4550 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4552 (TypeManager.GetInterfaces): Likewise.
4553 (TypeManager.GetExplicitInterfaces): Likewise.
4555 * ecore.cs (TypeExpr.GetInterfaces): Removed.
4557 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4558 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4560 2004-11-14 Ben Maurer <bmaurer@ximian.com>
4562 * statement.cs: Avoid adding bools to a hashtable.
4564 2004-11-07 Miguel de Icaza <miguel@ximian.com>
4566 * expression.cs (Invocation.OverloadResolve): Flag error if we are
4567 calling an unsafe method from a safe location.
4569 2004-11-06 Marek Safar <marek.safar@seznam.cz>
4572 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4574 2004-11-06 Miguel de Icaza <miguel@ximian.com>
4576 * namespace.cs (VerifyUsing): use GetPartialName instead of
4579 2004-11-05 Miguel de Icaza <miguel@ximian.com>
4581 * statement.cs (Return.Resolve): Fix regression in typo: if
4582 `in_exc', we have to request a NeedReturnLabel, this was a typo
4583 introduced in the anonymous method check-in. Fixes #69131.
4585 * Indexers were using the ShortName when defining themselves,
4586 causing a regression in the compiler bootstrap when applying the
4587 patch from 2004-11-02 (first part), now they use their full name
4588 and the bug is gone.
4590 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
4592 * driver.cs: Strip the path from the names of embedded resources. Fixes
4595 2004-11-04 Raja R Harinath <rharinath@novell.com>
4597 Fix error message regression: cs0104-2.cs.
4598 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4599 (AliasEntry.Resolve): Update.
4600 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
4602 (RootContext.LookupType): Update.
4604 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
4606 * cs-parser.jay: Add support for handling accessor modifiers
4607 * class: Add support port accessor modifiers and error checking,
4608 define PropertyMethod.Define as virtual (not abstract anymore)
4609 * ecore.cs: Add checking for proeprties access with access modifiers
4610 * iterators.cs: Modify Accessor constructor call based in the modified
4612 2004-11-02 Ben Maurer <bmaurer@ximian.com>
4614 * expression.cs (StringConcat): Handle being called twice,
4615 as when we have a concat in a field init with more than two
4618 2004-11-02 Miguel de Icaza <miguel@ximian.com>
4620 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4621 special case explicit implementations, we should always produce
4622 the .property or .event declaration.
4624 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4625 since it will not return correct data if people use this
4626 unresolved in the presence of using statements (see test-313).
4628 * class.cs (MethodData.Define): If we are an explicit interface
4629 implementation, set the method name to the full name of the
4630 interface plus the name of the method.
4632 Notice that using the method.MethodName.GetFullName() does not
4633 work, as it will only contain the name as declared on the source
4634 file (it can be a shorthand in the presence of using statements)
4635 and not the fully qualifed type name, for example:
4639 class D : ICloneable {
4640 object ICloneable.Clone () {
4644 Would produce a method called `ICloneable.Clone' instead of
4645 `System.ICloneable.Clone'.
4647 * namespace.cs (Alias.Resolve): Use GetPartialName.
4649 2004-11-01 Marek Safar <marek.safar@seznam.cz>
4651 * cs-parser.jay: Add error 1055 report.
4653 2004-11-01 Miguel de Icaza <miguel@ximian.com>
4655 * assign.cs (Assign.DoResolve): Only do the transform of
4656 assignment into a New if the types are compatible, if not, fall
4657 through and let the implicit code deal with the errors and with
4658 the necessary conversions.
4660 2004-11-01 Marek Safar <marek.safar@seznam.cz>
4662 * cs-parser.jay: Add error 1031 report.
4664 * cs-tokenizer.cs: Add location for error 1038.
4666 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4668 * cs-parser.jay: Add error 1016 report.
4670 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4672 * cs-parser.jay: Add errors 1575,1611 report.
4674 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4676 * cs-parser.jay: Add error 1001 report.
4678 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4681 * attribute.cs (GetMarshal): Add method argument for
4682 caller identification.
4684 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4685 agument for GetMarshal and RuntimeMissingSupport.
4687 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4689 * attribute.cs (ExtractSecurityPermissionSet): Removed
4690 TypeManager.code_access_permission_type.
4692 * typemanager.cs: Removed TypeManager.code_access_permission_type.
4694 2004-10-27 Miguel de Icaza <miguel@ximian.com>
4696 * expression.cs (LocalVariableReference.DoResolveLValue): Check
4697 for obsolete use of a variable here. Fixes regression on errors
4698 cs0619-25 and cs0619-26.
4700 2004-10-27 Marek Safar <marek.safar@seznam.cz>
4702 Fix #62358, implemented security attribute encoding.
4704 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4705 Tests permitted SecurityAction for assembly or other types.
4706 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4707 data from SecurityPermissionAttribute to PermisionSet class.
4709 * class.cs (ApplyAttributeBuilder): Added special handling
4710 for System.Security.Permissions.SecurityAttribute based types.
4712 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4713 special handling for System.Security.Permissions.SecurityAttribute
4716 * enum.cs (ApplyAttributeBuilder): Added special handling
4717 for System.Security.Permissions.SecurityAttribute based types.
4719 * parameter.cs (ApplyAttributeBuilder): Added special handling
4720 for System.Security.Permissions.SecurityAttribute based types.
4722 * rootcontext.cs: Next 2 core types.
4724 * typemanager.cs (TypeManager.security_permission_attr_type):
4725 Built in type for the SecurityPermission Attribute.
4726 (code_access_permission_type): Build in type.
4728 2004-10-17 Miguel de Icaza <miguel@ximian.com>
4730 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4731 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4732 all of this information into
4733 EmitContext.EmitCapturedVariableInstance.
4735 * codegen.cs (EmitCapturedVariableInstance): move here the
4736 funcionality of emitting an ldarg.0 in the presence of a
4737 remapping. This centralizes the instance emit code.
4739 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4740 then emit a load of this: it means that we have reached the
4741 topmost ScopeInfo: the one that contains the pointer to the
4742 instance of the class hosting the anonymous method.
4744 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4745 captures to the topmost CaptureContext.
4747 2004-10-12 Miguel de Icaza <miguel@ximian.com>
4749 * expression.cs (LocalVariableReference): Move the knowledge about
4750 the iterators into codegen's EmitCapturedVariableInstance.
4752 2004-10-11 Miguel de Icaza <miguel@ximian.com>
4754 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4755 all code paths return a value from an anonymous method (it is the
4756 same as the 161 error, but for anonymous methods).
4758 2004-10-08 Miguel de Icaza <miguel@ximian.com>
4760 The introduction of anonymous methods in the compiler changed
4761 various ways of doing things in the compiler. The most
4762 significant one is the hard split between the resolution phase
4763 and the emission phases of the compiler.
4765 For instance, routines that referenced local variables no
4766 longer can safely create temporary variables during the
4767 resolution phase: they must do so from the emission phase,
4768 since the variable might have been "captured", hence access to
4769 it can not be done with the local-variable operations from the runtime.
4773 (Block.Flags): New flag `IsTopLevel' to indicate that this block
4774 is a toplevel block.
4776 (ToplevelBlock): A new kind of Block, these are the blocks that
4777 are created by the parser for all toplevel method bodies. These
4778 include methods, accessors and anonymous methods.
4780 These contain some extra information not found in regular blocks:
4781 A pointer to an optional CaptureContext (for tracking captured
4782 local variables and parameters). A pointer to the parent
4785 (Return.Resolve): Catch missmatches when returning a value from an
4786 anonymous method (error 1662).
4787 Invoke NeedReturnLabel from the Resolve phase instead of the emit
4790 (Break.Resolve): ditto.
4792 (SwitchLabel): instead of defining the labels during the
4793 resolution phase, we now turned the public ILLabel and ILLabelCode
4794 labels into methods called GetILLabelCode() and GetILLabel() that
4795 only define the label during the Emit phase.
4797 (GotoCase): Track the SwitchLabel instead of the computed label
4798 (its contained therein). Emit the code by using
4799 SwitchLabel.GetILLabelCode ().
4801 (LocalInfo.Flags.Captured): A new flag has been introduce to track
4802 whether the Local has been captured or not.
4804 (LocalInfo.IsCaptured): New property, used to tell whether the
4805 local has been captured.
4807 * anonymous.cs: Vastly updated to contain the anonymous method
4810 The main classes here are: CaptureContext which tracks any
4811 captured information for a toplevel block and ScopeInfo used to
4812 track the activation frames for various local variables.
4814 Each toplevel block has an optional capture context associated
4815 with it. When a method contains an anonymous method both the
4816 toplevel method and the anonymous method will create a capture
4817 context. When variables or parameters are captured, they are
4818 recorded on the CaptureContext that owns them, for example:
4822 MyDelegate d = delegate {
4827 Here `a' will be recorded as captured on the toplevel
4828 CapturedContext, the inner captured context will not have anything
4829 (it will only have data if local variables or parameters from it
4830 are captured in a nested anonymous method.
4832 The ScopeInfo is used to track the activation frames for local
4833 variables, for example:
4835 for (int i = 0; i < 10; i++)
4836 for (int j = 0; j < 10; j++){
4837 MyDelegate d = delegate {
4842 At runtime this captures a single captured variable `i', but it
4843 captures 10 different versions of the variable `j'. The variable
4844 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4845 recorded on a child.
4847 The toplevel ScopeInfo will also track information like the `this'
4848 pointer if instance variables were referenced (this is necessary
4849 as the anonymous method lives inside a nested class in the host
4850 type of the method).
4852 (AnonymousMethod): Expanded to track the Toplevel, implement
4853 `AnonymousMethod.Compatible' to tell whether an anonymous method
4854 can be converted to a target delegate type.
4856 The routine now also produces the anonymous method content
4858 (AnonymousDelegate): A helper class that derives from
4859 DelegateCreation, this is used to generate the code necessary to
4860 produce the delegate for the anonymous method that was created.
4862 * assign.cs: API adjustments for new changes in
4863 Convert.ImplicitStandardConversionExists.
4865 * class.cs: Adjustments to cope with the fact that now toplevel
4866 blocks are of type `ToplevelBlock'.
4868 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4869 insteda of standard blocks.
4871 Flag errors if params arguments are passed to anonymous methods.
4873 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4874 `CurrentAnonymousMethod' which points to the current Anonymous
4875 Method. The variable points to the AnonymousMethod class that
4876 holds the code being compiled. It is set in the new EmitContext
4877 created for the anonymous method.
4879 (EmitContext.Phase): Introduce a variable and an enumeration to
4880 assist in enforcing some rules about when and where we are allowed
4881 to invoke certain methods (EmitContext.NeedsReturnLabel is the
4882 only one that enfonces this right now).
4884 (EmitContext.HaveCaptureInfo): new helper method that returns
4885 whether we have a CapturedContext initialized.
4887 (EmitContext.CaptureVariable): New method used to register that a
4888 LocalInfo must be flagged for capturing.
4890 (EmitContext.CapturedParameter): New method used to register that a
4891 parameters must be flagged for capturing.
4893 (EmitContext.CapturedField): New method used to register that a
4894 field must be flagged for capturing.
4896 (EmitContext.HaveCapturedVariables,
4897 EmitContext.HaveCapturedFields): Return whether there are captured
4898 variables or fields.
4900 (EmitContext.EmitMethodHostInstance): This is used to emit the
4901 instance for the anonymous method. The instance might be null
4902 (static methods), this (for anonymous methods that capture nothing
4903 and happen to live side-by-side with the current method body) or a
4904 more complicated expression if the method has a CaptureContext.
4906 (EmitContext.EmitTopBlock): Routine that drives the emission of
4907 code: it will first resolve the top block, then emit any metadata
4908 and then emit the code. The split is done so that we can extract
4909 any anonymous methods and flag any captured variables/parameters.
4911 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4912 during this phase, the ILGenerator should not be used as labels
4913 and local variables declared here might not be accessible to any
4914 code that is part of an anonymous method.
4916 Exceptions to this include the temporary variables that are
4917 created by some statements internally for holding temporary
4920 (EmitContext.EmitMeta): New routine, in charge of emitting all the
4923 (EmitContext.TemporaryReturn): This method is typically called
4924 from the Emit phase, and its the only place where we allow the
4925 ReturnLabel to be defined other than the EmitMeta. The reason is
4926 that otherwise we would have to duplicate a lot of logic in the
4927 Resolve phases of various methods that today is on the Emit
4930 (EmitContext.NeedReturnLabel): This no longer creates the label,
4931 as the ILGenerator is not valid during the resolve phase.
4933 (EmitContext.EmitThis): Extended the knowledge in this class to
4934 work in anonymous methods in addition to iterators.
4936 (EmitContext.EmitCapturedVariableInstance): This emits whatever
4937 code is necessary on the stack to access the instance to a local
4938 variable (the variable will be accessed as a field).
4940 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4941 EmitContext.EmitAddressOfParameter): Routines to support
4942 parameters (not completed at this point).
4944 Removals: Removed RemapLocal and RemapLocalLValue. We probably
4945 will also remove the parameters.
4947 * convert.cs (Convert): Define a `ConstantEC' which points to a
4948 null. This is just to prefity some code that uses
4949 ImplicitStandardConversion code and do not have an EmitContext
4952 The idea is to flag explicitly that at that point in time, it is
4953 known that the conversion will not trigger the delegate checking
4954 code in implicit conversions (which requires a valid
4957 Everywhere: pass new EmitContext parameter since
4958 ImplicitStandardConversionExists now requires it to check for
4959 anonymous method conversions.
4961 (Convert.ImplicitStandardConversionExists): If the type of an
4962 expression is the anonymous_method_type, and the type is a
4963 delegate, we invoke the AnonymousMethod.Compatible method to check
4964 whether an implicit conversion is possible.
4966 (Convert.ImplicitConversionStandard): Only do implicit method
4967 group conversions if the language level is not ISO_1.
4969 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4970 MethodInfo for the Invoke method. used by Delegate and
4973 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4974 method conversions if the target type is a delegate.
4976 Removed extra debugging nops.
4978 (LocalVariableReference): Turn the `local_info' into a public
4981 Add `prepared' field, the same hack used for FieldExprs to cope
4982 with composed assignments, as Local variables do not necessarily
4983 operate purely on the stack as they used to: they can be captured
4986 Add `temp' for a temporary result, like fields.
4988 Refactor DoResolve and DoResolveLValue into DoResolveBase.
4990 It now copes with Local variables that are captured and emits the
4991 proper instance variable to load it from a field in the captured
4994 (ParameterReference.DoResolveBase): During the resolve phase,
4995 capture parameters if we are in an anonymous method.
4997 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4998 anonymous method, use the EmitContext helper routines to emit the
4999 parameter reference.
5001 * iterators.cs: Set RemapToProxy to true/false during the
5004 * parameters.cs (GetParameterByName): New helper method.
5006 * typemanager.cs (anonymous_method_type) a new type that
5007 represents an anonyous method. This is always an internal type,
5008 used as a fencepost to test against the anonymous-methodness of an
5011 2004-10-20 Marek Safar <marek.safar@seznam.cz>
5013 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5015 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5017 2004-10-18 Martin Baulig <martin@ximian.com>
5019 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5020 `Type' directly, but call ResolveType() on it.
5021 (Catch.Resolve): Likewise.
5022 (Foreach.Resolve): Likewise.
5024 2004-10-18 Martin Baulig <martin@ximian.com>
5026 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5027 `Type' directly, but call ResolveType() on it.
5028 (Probe.DoResolve): Likewise.
5029 (ArrayCreation.LookupType): Likewise.
5030 (TypeOf.DoResolve): Likewise.
5031 (SizeOf.DoResolve): Likewise.
5033 2004-10-18 Martin Baulig <martin@ximian.com>
5035 * expression.cs (Invocation.BetterFunction): Put back
5036 TypeManager.TypeToCoreType().
5038 2004-10-18 Raja R Harinath <rharinath@novell.com>
5040 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5043 2004-10-18 Martin Baulig <martin@ximian.com>
5045 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
5046 `Type' directly, but call ResolveType() on it.
5048 2004-10-18 Martin Baulig <martin@ximian.com>
5050 * class.cs (FieldMember.Define): Don't access the TypeExpr's
5051 `Type' directly, but call ResolveType() on it.
5052 (MemberBase.DoDefine): Likewise.
5054 * expression.cs (New.DoResolve): Don't access the TypeExpr's
5055 `Type' directly, but call ResolveType() on it.
5056 (ComposedCast.DoResolveAsTypeStep): Likewise.
5058 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5059 `Type' directly, but call ResolveType() on it.
5061 2004-10-17 John Luke <john.luke@gmail.com>
5063 * class.cs (Operator.GetSignatureForError): use CSharpName
5065 * parameter.cs (Parameter.GetSignatureForError): Returns
5066 correct name even if was not defined.
5068 2004-10-13 Raja R Harinath <rharinath@novell.com>
5071 * class.cs (TypeContainer.EmitContext): New property.
5072 (DefineNestedTypes): Create an emitcontext for each part.
5073 (MethodCore.DoDefineParameters): Use container's emitcontext.
5074 Pass type array to InternalParameters.
5075 (MemberBase.DoDefine): Use container's emitcontext.
5076 (FieldMember.Define): Likewise.
5077 (Event.Define): Likewise.
5078 (SetMethod.GetParameterInfo): Change argument to EmitContext.
5079 Pass type array to InternalParameters.
5080 (SetIndexerMethod.GetParameterInfo): Likewise.
5081 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5082 * delegate.cs (Define): Pass emitcontext to
5083 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
5084 array to InternalParameters.
5085 * expression.cs (ParameterReference.DoResolveBase): Pass
5086 emitcontext to GetParameterInfo.
5087 (ComposedCast.DoResolveAsTypeStep): Remove check on
5088 ec.ResolvingTypeTree.
5089 * parameter.cs (Parameter.Resolve): Change argument to
5090 EmitContext. Use ResolveAsTypeTerminal.
5091 (Parameter.GetSignature): Change argument to EmitContext.
5092 (Parameters.ComputeSignature): Likewise.
5093 (Parameters.ComputeParameterTypes): Likewise.
5094 (Parameters.GetParameterInfo): Likewise.
5095 (Parameters.ComputeAndDefineParameterTypes): Likewise.
5096 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
5097 * support.cs (InternalParameters..ctor): Remove variant that takes
5099 * typemanager.cs (system_intptr_expr): New.
5100 (InitExpressionTypes): Initialize it.
5102 2004-10-12 Chris Toshok <toshok@ximian.com>
5104 * cs-parser.jay: fix location for try_statement and catch_clause.
5106 2004-10-11 Martin Baulig <martin@ximian.com>
5108 * report.cs: Don't make --fatal abort on warnings, we have
5109 -warnaserror for that.
5111 2004-10-07 Raja R Harinath <rharinath@novell.com>
5113 More DeclSpace.ResolveType avoidance.
5114 * decl.cs (MemberCore.InUnsafe): New property.
5115 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
5116 with newly created EmitContext.
5117 (FieldMember.Define): Likewise.
5118 * delegate.cs (Delegate.Define): Likewise.
5119 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5120 only if normal name-lookup fails.
5121 (TypeExpr.DoResolve): Enable error-checking.
5122 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5123 (SizeOf.DoResolve): Likewise.
5124 (ComposedCast.DoResolveAsTypeStep): Likewise.
5125 (StackAlloc.DoResolve): Likewise.
5126 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5127 (Block.Unsafe): New property.
5128 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5129 (Unsafe): Set 'unsafe' flag of contained block.
5130 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5131 (Fixed.Resolve): Likewise.
5132 (Catch.Resolve): Likewise.
5133 (Using.ResolveLocalVariableDecls): Likewise.
5134 (Foreach.Resolve): Likewise.
5136 2004-10-05 John Luke <john.luke@gmail.com>
5138 * cs-parser.jay: add location to error CS0175
5140 2004-10-04 Miguel de Icaza <miguel@ximian.com>
5142 * ecore.cs (Expression.Constantity): Add support for turning null
5145 * const.cs (Const.Define): Allow constants to be reference types
5146 as long as the value is Null.
5148 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
5150 * namespace.cs (NamespaceEntry.Using): No matter which warning
5151 level is set, check if this namespace name has already been added.
5153 2004-10-03 Ben Maurer <bmaurer@ximian.com>
5155 * expression.cs: reftype [!=]= null should always use br[true,false].
5158 2004-10-03 Marek Safar <marek.safar@seznam.cz>
5161 * attribute.cs: Enum conversion moved to
5162 GetAttributeArgumentExpression to be applied to the all
5165 2004-10-01 Raja R Harinath <rharinath@novell.com>
5167 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5168 * class.c (TypeContainer.DefineType): Flag error if
5169 base types aren't accessible due to access permissions.
5170 * decl.cs (DeclSpace.ResolveType): Move logic to
5171 Expression.ResolveAsTypeTerminal.
5172 (DeclSpace.ResolveTypeExpr): Thin layer over
5173 Expression.ResolveAsTypeTerminal.
5174 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5175 Refactor code into NestedAccess. Use it.
5176 (DeclSpace.NestedAccess): New.
5177 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5178 argument to silence errors. Check access permissions.
5179 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5180 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5181 (Cast.DoResolve): Likewise.
5182 (New.DoResolve): Likewise.
5183 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5184 (TypeOf.DoResolve): Likewise.
5186 * expression.cs (Invocation.BetterConversion): Return the Type of
5187 the better conversion. Implement section 14.4.2.3 more faithfully.
5188 (Invocation.BetterFunction): Make boolean. Make correspondence to
5189 section 14.4.2.2 explicit.
5190 (Invocation.OverloadResolve): Update.
5191 (Invocation): Remove is_base field.
5192 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
5193 (Invocation.Emit): Likewise.
5195 2004-09-27 Raja R Harinath <rharinath@novell.com>
5197 * README: Update to changes.
5199 2004-09-24 Marek Safar <marek.safar@seznam.cz>
5201 * cs-parser.jay: Reverted 642 warning fix.
5203 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5206 * decl.cs (FindMemberWithSameName): Indexer can have more than
5209 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5211 * expression.cs (LocalVariableReference.DoResolveLValue):
5212 Do not report warning 219 for out values.
5213 (EmptyExpression.Null): New member to avoid extra allocations.
5215 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5217 * cs-parser.jay: Fix wrong warning 642 report.
5219 * cs-tokenizer.cs (CheckNextToken): New helper;
5220 Inspect next character if is same as expected.
5222 2004-09-23 Martin Baulig <martin@ximian.com>
5224 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5225 (Convert.ImplicitReferenceConversionExists): Likewise.
5227 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5229 * class.cs (Operator.Define): Add error 448 and 559 report.
5231 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5233 * class.cs (MemberBase.IsTypePermitted): New protected
5234 method for checking error CS0610.
5236 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5238 * class.cs (TypeContainer.HasExplicitLayout): New property
5239 Returns whether container has StructLayout attribute set Explicit.
5240 (FieldMember): New abstract class for consts and fields.
5241 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5242 (Field): Reuse FieldMember.
5244 * const.cs (Const): Reuse FieldMember.
5246 * rootcontext.cs: EmitConstants call moved to class.
5248 2004-09-22 Martin Baulig <martin@ximian.com>
5250 Thanks to Peter Sestoft for this bug report.
5252 * expression.cs (Conditional): If both the `trueExpr' and the
5253 `falseExpr' is a NullLiteral, return a NullLiteral.
5255 2004-09-22 Martin Baulig <martin@ximian.com>
5257 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5258 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5259 for the "get_Current" call.
5261 2004-09-22 Martin Baulig <martin@ximian.com>
5263 Marek and me just fixed one of our oldest bugs: #28562 :-)
5265 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5267 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5268 we're an EnumConstant, just return that.
5269 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5270 an EnumConstant. In this case, we need to use GetValueAsEnumType()
5271 to get the value which'll actually be written into the attribute.
5272 However, we have to use GetValue() to access the attribute's value
5275 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5277 * constant.cs (Constant.IsNegative): New abstract property
5280 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5281 (StackAlloc.DoResolve): Reused IsNegative.
5283 2004-09-21 Martin Baulig <martin@ximian.com>
5285 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5286 if we're used in an iterator, we may be called from different
5289 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5290 we actually have an exception block.
5292 2004-09-20 John Luke <jluke@cfl.rr.com>
5294 * class.cs, cs-parser.jay: Improve the error report for 1520:
5295 report the actual line where the error happens, not where the
5298 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5299 Pass location information that was available elsewhere.
5301 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
5303 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5304 runtime to delay sign assemblies.
5306 2004-09-19 Miguel de Icaza <miguel@ximian.com>
5308 * cs-parser.jay: Do not report the stack trace, this is barely
5311 2004-08-22 John Luke <john.luke@gmail.com>
5313 * driver.cs : check that a resource id is not already used
5314 before adding it, report CS1508 if it is, bug #63637
5316 2004-09-19 Miguel de Icaza <miguel@ximian.com>
5318 * ecore.cs: Removed dead code.
5320 2004-09-18 Marek Safar <marek.safar@seznam.cz>
5322 * class.cs: Do not report warning CS0067 on the interfaces.
5324 2004-09-16 Marek Safar <marek.safar@seznam.cz>
5326 * cs-parser.jay: Add error 504 report.
5328 2004-09-16 Marek Safar <marek.safar@seznam.cz>
5330 * rootcontext.cs: WarningLevel is 4 by default now.
5332 * statement.cs (Fixed.Resolve): Do not null
5335 2004-09-16 Marek Safar <marek.safar@seznam.cz>
5338 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5339 deep search when property is not virtual.
5340 (PropertyExpr.ResolveAccessors): Make one call for both
5343 2004-09-15 Marek Safar <marek.safar@seznam.cz>
5346 * statement.cs: Error 152 report constains also location.
5348 2004-09-15 Marek Safar <marek.safar@seznam.cz>
5351 * const.cs: Explicitly set constant as static.
5353 2004-09-15 Marek Safar <marek.safar@seznam.cz>
5356 * cs-parser.jay: Add error 1017 report.
5358 2004-09-15 Marek Safar <marek.safar@seznam.cz>
5360 Fixed bug #59980, #64224
5361 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5363 * typemanager.cs (IsSpecialMethod): Simplified
5365 2004-09-14 Marek Safar <marek.safar@seznam.cz>
5367 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5368 condition with better params.
5370 2004-09-14 Marek Safar <marek.safar@seznam.cz>
5373 * attribute.cs (Resolve): Property has to have both
5376 2004-09-14 Martin Baulig <martin@ximian.com>
5378 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5380 2004-09-14 Marek Safar <marek.safar@seznam.cz>
5383 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5384 called and is obsolete then this member suppress message
5385 when call is inside next [Obsolete] method or type.
5387 * expression.cs: Use TestObsoleteMethodUsage member.
5389 2004-09-14 Martin Baulig <martin@ximian.com>
5391 * cs-parser.jay: Sync a bit with the GMCS version.
5393 2004-09-14 Martin Baulig <martin@ximian.com>
5395 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5396 (CSharpParser.yacc_verbose_flag): New public field.
5398 * genericparser.cs: Removed.
5400 2004-09-14 Raja R Harinath <rharinath@novell.com>
5402 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5404 2004-09-13 Marek Safar <marek.safar@seznam.cz>
5406 * class.cs (MethodCore.CheckBase): Fix bug #65757.
5408 2004-09-10 Martin Baulig <martin@ximian.com>
5410 Backported my MemberName changes from GMCS into MCS.
5412 - we are now using a special `MemberName' class instead of using
5413 strings; in GMCS, the `MemberName' also contains the type
5416 - changed the grammar rules a bit:
5417 * the old `member_name' is now a `namespace_or_type_name':
5418 The rule is that we use `namespace_or_type_name' everywhere
5419 where we expect either a "member name" (GetEnumerator) or a
5420 "member name" with an explicit interface name
5421 (IEnumerable.GetEnumerator).
5422 In GMCS, the explicit interface name may include type arguments
5423 (IEnumerable<T>.GetEnumerator).
5424 * we use `member_name' instead of just `IDENTIFIER' for
5426 The rule is that we use `member_name' wherever a member may
5427 have type parameters in GMCS.
5429 * decl.cs (MemberName): New public class.
5430 (MemberCore.MemberName): New public readonly field.
5431 (MemberCore.ctor): Take a `MemberName' argument, not a string.
5432 (DeclSpace): Likewise.
5434 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5435 * enum.cs (Enum.ctor): Likewise.
5437 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5439 (AliasEntry.ctor): Take a MemberName, not an Expression.
5440 (AliasEntry.UsingAlias): Likewise.
5442 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5443 (IMethodData.MemberName): Changed type from string to MemberName.
5444 (MemberBase.ExplicitInterfaceName): Likewise.
5445 (AbstractPropertyEventMethod.SetupName): Make this private.
5446 (AbstractPropertyEventMethod.ctor): Added `string prefix'
5447 argument; compute the member name here.
5448 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5449 on the `member.MemberName' and the `prefix'.
5451 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5453 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5454 thus, we get a `MemberName' instead of a `string'. These
5455 declarations may have type parameters in GMCS.
5456 (interface_method_declaration, delegate_declaration): Likewise.
5457 (class_declaration, interface_declaration): Likewise.
5458 (method_header): Use `namespace_or_type_name' instead of
5459 `member_name'. We may be an explicit interface implementation.
5460 (property_declaration, event_declaration): Likewise.
5461 (member_name): This is now just an `IDENTIFIER', not a
5462 `namespace_or_type_name'.
5463 (type_name, interface_type): Removed.
5464 (namespace_or_type_name): Return a MemberName, not an Expression.
5465 (primary_expression): Use `member_name' instead of `IDENTIFIER';
5466 call GetTypeExpression() on the MemberName to get an expression.
5467 (IndexerDeclaration.interface_type): Changed type from string to
5469 (MakeName): Operate on MemberName's instead of string's.
5471 2004-09-13 Raja R Harinath <rharinath@novell.com>
5474 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5475 (NamespaceEntry.Lookup): Add new argument to flag if we want the
5476 lookup to avoid symbols introduced by 'using'.
5477 * rootcontext.cs (NamespaceLookup): Update.
5479 2004-09-12 Marek Safar <marek.safar@seznam.cz>
5481 * class.cs (TypeContainer.DoDefineMembers): Do not call
5482 DefineDefaultConstructor for static classes.
5484 2004-09-12 Marek Safar <marek.safar@seznam.cz>
5486 * attribute.cs (Attribute.Resolve): Add error 653 report.
5488 * class.cs (Class.ApplyAttributeBuilder): Add error 641
5490 (Method.ApplyAttributeBuilder): Add error 685 report.
5491 (Operator.Define): Add error 564 report.
5493 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5495 * expression.cs (Invocation.DoResolve): Add error
5498 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5501 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5503 * class.cs (ConstructorInitializer.Resolve):
5504 Wrong error number (515->516).
5506 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5508 * class.cs (Indexer.Define): Add error 631 report.
5510 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5512 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5514 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5516 * expression.cs (Probe.DoResolve): Add error CS0241 report.
5518 2004-09-10 Marek Safar <marek.safar@seznam.cz>
5520 * cs-parser.jay: Added error CS0241 report.
5522 2004-09-10 Raja R Harinath <rharinath@novell.com>
5524 * cs-parser.jay (fixed_statement): Introduce a scope for the
5525 declaration in the 'fixed' statement.
5527 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5529 * cs-parser.jay: Added CS0230 error report.
5531 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5533 * cs-parser.jay: Added errors CS0231 and CS0257 report.
5535 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5537 * expression.cs (Argument.Resolve): Added error CS0192 and
5540 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5542 C# 2.0 #pragma warning feature
5544 * cs-tokenizer.cs (PreProcessPragma): New method;
5545 Handles #pragma directive.
5547 * report.cs (WarningRegions): New class; Support
5548 class for #pragma warning directive. It tests whether
5549 warning is enabled for a given line.
5551 2004-09-08 Miguel de Icaza <miguel@ximian.com>
5553 * const.cs: Add more descriptive error report, tahnks to
5556 2004-09-08 Marek Safar <marek.safar@seznam.cz>
5558 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5560 2004-09-07 Miguel de Icaza <miguel@ximian.com>
5562 * expression.cs: Apply patch from Ben: Remove dead code from
5563 ArrayCreation, and remove the TurnintoConstant call in const.cs,
5564 as that code just threw an exception anwyays.
5566 * const.cs: Remove the call to the turnintoconstant, for details
5569 * literal.cs: The type of the null-literal is the null type; So
5570 we use a placeholder type (literal.cs:System.Null, defined here)
5573 * expression.cs (Conditional.DoResolve): Remove some old code that
5574 is no longer needed, conversions have been fixed.
5576 (ArrayCreationExpression.DoResolve): Return false if we fail to
5577 resolve the inner expression.
5579 2004-09-07 Raja R Harinath <rharinath@novell.com>
5582 * cs-parser.jay (delegate_declaration): Record a delegate
5583 declaration as a type declaration.
5584 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5586 2004-09-06 Miguel de Icaza <miguel@ximian.com>
5588 * parameter.cs: Do not crash if the type can not be resolved.
5590 * expression.cs: Report errors with unsafe pointers, fixes #64896
5592 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
5594 * expression.cs: Pointer arith always needs to do a conv.i
5595 if the operand is a long. fix 65320
5597 2004-09-04 Marek Safar <marek.safar@seznam.cz>
5599 Fixed cs0619-37.cs, cs0619-38.cs
5601 * enum.cs (GetObsoleteAttribute): Removed.
5603 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5604 on Enum member is double staged. The first is tested member
5607 2004-09-04 Marek Safar <marek.safar@seznam.cz>
5609 Fixed #56986, #63631, #65231
5611 * class.cs: (TypeContainer.AddToMemberContainer): New method,
5612 adds member to name container.
5613 (TypeContainer.AddToTypeContainer): New method, adds type to
5615 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5616 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5617 AddOperator): Simplified by reusing AddToMemberContainer.
5618 (TypeContainer.UserDefinedStaticConstructor): Changed to property
5620 (Method.CheckForDuplications): Fixed implementation to test all
5622 (MemberBase): Detection whether member is explicit interface
5623 implementation is now in constructor.
5624 (MemberBase.UpdateMemberName): Handles IndexerName.
5625 (Accessor): Changed to keep also location information.
5626 (AbstractPropertyEventMethod): Is derived from MemberCore.
5627 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5628 will be emited or not.
5629 (PropertyBase.AreAccessorsDuplicateImplementation):
5630 Tests whether accessors are not in collision with some method.
5631 (Operator): Is derived from MethodCore to simplify common
5634 * decl.cs (Flags.TestMethodDuplication): Test for duplication
5636 (DeclSpace.AddToContainer): Adds the member to defined_names
5637 table. It tests for duplications and enclosing name conflicts.
5639 * enum.cs (EnumMember): Clean up to reuse the base structures
5641 2004-09-03 Martin Baulig <martin@ximian.com>
5643 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5644 into TypeContainer, to make partial classes work again.
5646 2004-09-03 Martin Baulig <martin@ximian.com>
5648 * rootcontext.cs (RootContext.V2): Removed.
5650 2004-03-23 Martin Baulig <martin@ximian.com>
5652 * expression.cs (Invocation.OverloadResolve): Added `bool
5653 may_fail' argument and use it instead of the Location.IsNull() hack.
5655 2004-09-03 Martin Baulig <martin@ximian.com>
5657 Merged latest changes into gmcs. Please keep this comment in
5658 here, it makes it easier for me to see what changed in MCS since
5659 the last time I merged.
5661 2004-09-03 Raja R Harinath <rharinath@novell.com>
5664 * expression.cs (BetterConversion): Don't allow either conversion
5665 to be null. Remove redundant implicit conversion test when 'q ==
5666 null' -- when this function is invoked, we already know that the
5667 implicit conversion exists.
5668 (BetterFunction): Assume that 'best' is non-null. Remove
5669 redundant reimplementation of IsApplicable when 'best' is null.
5670 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5671 number of arguments.
5672 (IsAncestralType): Extract from OverloadResolve.
5673 (OverloadResolve): Make robust to the MethodGroupExpr being
5674 unsorted. Implement all the logic of Section 14.5.5.1, and
5675 support overloading of methods from multiple applicable types.
5676 Clean up logic somewhat. Don't pass null methods to BetterFunction.
5678 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5679 (RealError, Warning): Append type of report to related symbol.
5681 2004-09-03 Marek Safar <marek.safar@seznam.cz>
5683 * enum.cs: Fixed CLS-Compliance checks for enum members.
5684 Error tests cs3008-8.cs, cs3014-8.cs
5686 2004-09-02 Marek Safar <marek.safar@seznam.cz>
5688 Fixed bug #62342, #63102
5689 * class.cs: ImplementIndexer uses member.IsExplicitImpl
5690 like ImplementMethod.
5692 2004-09-02 Marek Safar <marek.safar@seznam.cz>
5694 * attribute.cs (Attribute.GetAttributeArgumentExpression):
5697 2004-09-02 Martin Baulig <martin@ximian.com>
5699 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5700 TypeManager.GetArgumentTypes() rather than calling GetParameters()
5703 2004-09-01 Marek Safar <marek.safar@seznam.cz>
5705 C# 2.0 Static classes implemented
5707 * class.cs (TypeContainer): instance_constructors,
5708 initialized_fields, initialized_static_fields,
5709 default_constructor, base_inteface_types are protected to be
5710 accessible from StaticClass.
5711 (TypeContainer.DefineDefaultConstructor): New virtual method
5712 for custom default constructor generating
5713 (StaticClass): New class to handle "Static classes" feature.
5715 * cs-parser.jay: Handle static keyword on class like instance
5718 * driver.cs: Added "/langversion" command line switch with two
5719 options (iso-1, default).
5721 2004-08-31 Marek Safar <marek.safar@seznam.cz>
5723 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5725 2004-08-31 Miguel de Icaza <miguel@ximian.com>
5727 * delegate.cs: Style.
5729 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
5731 * delegate.cs: Add seperate instance expr field for miguel.
5733 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
5735 * PointerArithmetic (Resolve): make sure we are not doing
5736 pointer arith on void*. Also, make sure we are resolved
5737 by not setting eclass until resolve.
5739 All callers: Make sure that PointerArithmetic gets resolved.
5741 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
5743 * ArrayCreation (LookupType): If the type does not resolve
5744 to an array, give an error.
5746 2004-08-27 Marek Safar <marek.safar@seznam.cz>
5748 * statement.cs (Try.Resolve): Fixed bug #64222
5750 2004-08-27 Martin Baulig <martin@ximian.com>
5753 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5756 2004-08-26 Marek Safar <marek.safar@seznam.cz>
5758 * ecore.cs (Constantify): Get underlying type via
5759 System.Enum.GetUnderlyingType to avoid StackOverflow on the
5760 Windows in special cases.
5762 2004-08-26 Marek Safar <marek.safar@seznam.cz>
5764 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5765 for obtaining also private methods.
5766 (GetRemoveMethod): Used GetRemoveMethod (true)
5767 for obtaining also private methods.
5769 2004-08-24 Martin Baulig <martin@ximian.com>
5771 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5772 MethodAttributes.HideBySig for operators.
5774 2004-08-23 Martin Baulig <martin@ximian.com>
5776 Back to the old error reporting system :-)
5778 * report.cs (Message): Removed.
5779 (Report.MessageData, ErrorData, WarningData): Removed.
5780 (Report.Error, Warning): Back to the old system.
5782 2004-08-23 Martin Baulig <martin@ximian.com>
5784 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5786 * class.cs (TypeContainer.ParentContainer): New public virtual
5787 method; replaces the explicit interface implementation.
5788 (ClassPart.ParentContainer): Override.
5790 2004-08-23 Martin Baulig <martin@ximian.com>
5792 * statement.cs (Switch): Added support for constant switches; see
5793 #59428 or test-285.cs.
5795 2004-08-22 Marek Safar <marek.safar@seznam.cz>
5798 * statement.cs (GetEnumeratorFilter): Removed useless
5799 logic because C# specs is strict. GetEnumerator must be
5802 2004-08-22 Martin Baulig <martin@ximian.com>
5804 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5805 a switch and may break, reset the barrier. Fixes #59867.
5807 2004-08-22 Marek Safar <marek.safar@seznam.cz>
5809 CLS-Compliance speed up (~5% for corlib)
5811 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5812 New method. Tests container for CLS-Compliant names
5814 * class.cs (TypeContainer.VerifyClsName): New method.
5815 Checks whether container name is CLS Compliant.
5816 (Constructor): Implements IMethodData.
5818 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5819 low-case table for CLS Compliance test.
5820 (MemberCache.VerifyClsParameterConflict): New method.
5821 Checks method parameters for CS3006 error.
5823 * enum.cs (EnumMember): Is derived from MemberCore.
5824 (Enum.VerifyClsName): Optimized for better performance.
5826 2004-08-06 Marek Safar <marek.safar@seznam.cz>
5828 * report.cs: Renamed Error_T to Error and changed all
5831 2004-08-06 Marek Safar <marek.safar@seznam.cz>
5833 * class.cs (TypeContainer.IndexerArrayList): New inner class
5834 container for indexers.
5835 (TypeContainer.DefaultIndexerName): New constant for default
5836 indexer name. Replaced all "Item" with this constant.
5837 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5839 * typemanager.cs (TypeManager.default_member_ctor): Cache here
5840 DefaultMemberAttribute constructor.
5842 2004-08-05 Martin Baulig <martin@ximian.com>
5844 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5847 2004-08-05 Marek Safar <marek.safar@seznam.cz>
5849 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5850 multi platforms problem.
5852 * compiler.csproj: Included shared files.
5854 2004-08-04 Marek Safar <marek.safar@seznam.cz>
5856 Fix bug 60333, 55971 in the more general way
5857 * attribute.cs (Attribute.GetAttributeArgumentExpression):
5858 Added arg_type argument for constant conversion.
5859 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5861 2004-08-04 Marek Safar <marek.safar@seznam.cz>
5864 * class.cs (TypeContainer ): New inner classes MethodArrayList,
5865 OperatorArrayList, MethodCoreArrayList for typecontainer
5866 containers. Changed class member types to these new types.
5867 (MethodArrayList.DefineMembers): Added test for CS0659.
5869 2004-08-04 Miguel de Icaza <miguel@ximian.com>
5871 * cfold.cs: Synchronize the folding with the code in expression.cs
5872 Binary.DoNumericPromotions for uint operands.
5874 * attribute.cs: Revert patch from Raja, it introduced a regression
5875 while building Blam-1.2.1 (hard to isolate a test case).
5877 2004-08-04 Marek Safar <marek.safar@seznam.cz>
5881 (TypeContainer.Define): Renamed to DefineContainerMembers because of
5883 (MethodCore.parent_method): New member. The method we're overriding
5884 if this is an override method.
5885 (MethodCore.CheckBase): Moved from Method class and made common.
5886 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5888 (MethodCore.CheckForDuplications): New abstract method. For custom
5889 member duplication search in a container
5890 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5891 method and its return type.
5892 (Event.conflict_symbol): New member. Symbol with same name in the
5896 (MemberCache.FindMemberWithSameName): New method. The method
5897 is looking for conflict with inherited symbols.
5899 2004-08-04 Martin Baulig <martin@ximian.com>
5901 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5903 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5905 2004-08-03 Marek Safar <marek.safar@seznam.cz>
5907 * report.cs (Message): New enum for better error, warning reference in
5909 (MessageData): New inner abstract class. It generally handles printing of
5910 error and warning messages.
5911 Removed unused Error, Warning, Message methods.
5913 2004-08-03 Marek Safar <marek.safar@seznam.cz>
5915 Fix for cs0592-8.cs test
5917 (Attributable.ValidAttributeTargets): Made public.
5918 (Attribute.ExplicitTarget): New member for explicit target value.
5919 (Attribute.CheckTargets): Now we translate explicit attribute
5920 target to Target here.
5922 2004-08-03 Ben Maurer <bmaurer@ximian.com>
5924 * ecore.cs (MethodGroupExpr): new IsBase property.
5926 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5928 * delegate.cs (DelegateCreation): store a MethodGroupExpr
5929 rather than an instance expr.
5931 (DelegateCreation.Emit): Use the method group rather than
5932 the instance expression. Also, if you have base.Foo as the
5933 method for a delegate, make sure to emit ldftn, not ldftnvirt.
5935 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
5937 (NewDelegate.DoResolve): Only check for the existance of Invoke
5938 if the method is going to be needed. Use MethodGroupExpr.
5940 (NewDelegate.Emit): Remove, DelegateCreation implements this.
5942 * expression.cs: For pointer arith., make sure to use
5943 the size of the type, not the size of the pointer to
5946 2004-08-03 Marek Safar <marek.safar@seznam.cz>
5949 * class.cs (Class): Added error CS0502 test.
5951 2004-08-03 John Luke <jluke@cfl.rr.com>
5952 Raja R Harinath <rharinath@novell.com>
5955 * attribute.cs (Attribute.complained_before): New flag.
5956 (Attribute.ResolveType, Attribute.Resolve),
5957 (Attribute.DefinePInvokeMethod): Set it.
5958 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5960 2004-08-03 Martin Baulig <martin@ximian.com>
5962 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5963 use a user-defined operator; we still need to do numeric
5964 promotions in case one argument is a builtin type and the other
5965 one has an implicit conversion to that type. Fixes #62322.
5967 2004-08-02 Martin Baulig <martin@ximian.com>
5969 * statement.cs (LocalInfo.Flags): Added `IsThis'.
5970 (LocalInfo.IsThis): New public property.
5971 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5973 2004-08-01 Martin Baulig <martin@ximian.com>
5975 * class.cs (TypeContainer.GetClassBases): Don't set the default
5976 here since we may get called from GetPartialBases().
5977 (TypeContainer.DefineType): If GetClassBases() didn't return a
5978 parent, use the default one.
5980 2004-07-30 Duncan Mak <duncan@ximian.com>
5982 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5984 2004-07-30 Martin Baulig <martin@ximian.com>
5986 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5988 * class.cs (SourceMethod): New public class, derive from the
5989 symbol writer's ISourceMethod.
5990 (Method): Use the new symbol writer API.
5992 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5993 as argument and use the new symbol writer.
5996 (SourceFile): Implement the symbol writer's ISourceFile.
5997 (Location.SymbolDocument): Removed.
5998 (Location.SourceFile): New public property.
6000 * symbolwriter.cs: Use the new symbol writer API.
6002 2004-07-30 Raja R Harinath <rharinath@novell.com>
6004 * Makefile (install-local): Remove. Functionality moved to
6007 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
6009 * Makefile: Install mcs.exe.config file together with mcs.exe.
6010 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6011 correct runtime version.
6013 2004-07-25 Martin Baulig <martin@ximian.com>
6016 (TypeContainer.RegisterOrder): Removed, this was unused.
6017 (TypeContainer, interface_order): Removed.
6018 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6019 TypeContainer as argument since we can also be called with a
6020 `PartialContainer' for a partial class/struct/interface.
6021 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6022 of checking whether we're an `Interface' - we could be a
6024 (PartialContainer.Register): Override; call
6025 AddClass()/AddStruct()/AddInterface() on our parent.
6027 * cs-parser.jay (interface_member_declaration): Add things to the
6028 `current_container', not the `current_class'.
6030 * rootcontext.cs (RegisterOrder): The overloaded version which
6031 takes an `Interface' was unused, removed.
6033 * typemanager.cs (TypeManager.LookupInterface): Return a
6034 `TypeContainer', not an `Interface'.
6035 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6036 contain a `PartialContainer' for an interface, so check it's
6037 `Kind' to figure out what it is.
6039 2004-07-25 Martin Baulig <martin@ximian.com>
6041 * class.cs (Class.DefaultTypeAttributes): New public constant.
6042 (Struct.DefaultTypeAttributes): Likewise.
6043 (Interface.DefaultTypeAttributes): Likewise.
6044 (PartialContainer.TypeAttr): Override this and add the
6045 DefaultTypeAttributes.
6047 2004-07-25 Martin Baulig <martin@ximian.com>
6049 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6050 we can just use the `Parent' field instead.
6052 2004-07-25 Martin Baulig <martin@ximian.com>
6054 * class.cs (TypeContainer.Emit): Renamed to EmitType().
6056 2004-07-25 Martin Baulig <martin@ximian.com>
6058 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6059 our parts before defining any methods.
6060 (TypeContainer.VerifyImplements): Make this virtual.
6061 (ClassPart.VerifyImplements): Override and call VerifyImplements()
6062 on our PartialContainer.
6064 2004-07-25 Martin Baulig <martin@ximian.com>
6066 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6068 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6069 argument, we can just use the `Parent' field instead.
6072 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
6073 (MemberBase.DoDefine): Likewise.
6075 2004-07-24 Martin Baulig <martin@ximian.com>
6077 * decl.cs (MemberCore.Parent): New public field.
6078 (DeclSpace.Parent): Moved to MemberCore.
6080 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6081 (MemberBase.ctor): Added TypeContainer argument, pass it to our
6083 (FieldBase, Field, Operator): Likewise.
6084 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6085 (EventField, Event): Likewise.
6087 2004-07-23 Martin Baulig <martin@ximian.com>
6089 * class.cs (PartialContainer): New public class.
6090 (ClassPart): New public class.
6091 (TypeContainer): Added support for partial classes.
6092 (TypeContainer.GetClassBases): Splitted some of the functionality
6093 out into GetNormalBases() and GetPartialBases().
6095 * cs-tokenizer.cs (Token.PARTIAL): New token.
6096 (Tokenizer.consume_identifier): Added some hacks to recognize
6097 `partial', but only if it's immediately followed by `class',
6098 `struct' or `interface'.
6100 * cs-parser.jay: Added support for partial clases.
6102 2004-07-23 Martin Baulig <martin@ximian.com>
6104 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6105 a `DeclSpace' and also made it readonly.
6106 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6107 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6108 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6110 * cs-parser.jay: Pass the `current_class', not the
6111 `current_container' (at the moment, this is still the same thing)
6112 to a new Method, Property, Event, Indexer or Constructor.
6114 2004-07-23 Martin Baulig <martin@ximian.com>
6116 * cs-parser.jay (CSharpParser): Added a new `current_class' field
6117 and removed the `current_interface' one.
6118 (struct_declaration, class_declaration, interface_declaration):
6119 Set `current_class' to the newly created class/struct/interface;
6120 set their `Bases' and call Register() before parsing their body.
6122 2004-07-23 Martin Baulig <martin@ximian.com>
6124 * class.cs (Kind): New public enum.
6125 (TypeContainer): Made this class abstract.
6126 (TypeContainer.Kind): New public readonly field.
6127 (TypeContainer.CheckDef): New public method; moved here from
6129 (TypeContainer.Register): New public abstract method.
6130 (TypeContainer.GetPendingImplementations): New public abstract
6132 (TypeContainer.GetClassBases): Removed the `is_class' and
6133 `is_iface' parameters.
6134 (TypeContainer.DefineNestedTypes): Formerly known as
6136 (ClassOrStruct): Made this class abstract.
6138 * tree.cs (RootTypes): New public type.
6140 2004-07-20 Martin Baulig <martin@ximian.com>
6142 * tree.cs (Tree.RecordNamespace): Removed.
6143 (Tree.Namespaces): Removed.
6145 * rootcontext.cs (RootContext.IsNamespace): Removed.
6147 * cs-parser.jay (namespace_declaration): Just create a new
6148 NamespaceEntry here.
6150 2004-07-20 Martin Baulig <martin@ximian.com>
6152 * statement.cs (ExceptionStatement): New abstract class. This is
6153 now used as a base class for everyone who's using `finally'.
6154 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
6155 our local variables before using them.
6157 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
6158 virtual method. This is used by Yield.Resolve() to "steal" an
6159 outer block's `finally' clauses.
6160 (FlowBranchingException): The .ctor now takes an ExceptionStatement
6163 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
6164 version which takes an ExceptionStatement. This version must be
6165 used to create exception branchings.
6168 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
6169 (Iterator.EmitMoveNext): Added exception support; protect the
6170 block with a `fault' clause, properly handle 'finally' clauses.
6171 (Iterator.EmitDispose): Run all the `finally' clauses here.
6173 2004-07-20 Martin Baulig <martin@ximian.com>
6175 * iterator.cs: This is the first of a set of changes in the
6176 iterator code. Match the spec more closely: if we're an
6177 IEnumerable, then GetEnumerator() must be called. The first time
6178 GetEnumerator() is called, it returns the current instance; all
6179 subsequent invocations (if any) must create a copy.
6181 2004-07-19 Miguel de Icaza <miguel@ximian.com>
6183 * expression.cs: Resolve the constant expression before returning
6186 2004-07-19 Martin Baulig <martin@ximian.com>
6188 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
6189 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
6190 the return type of the new EmitContext.
6192 2004-07-18 Martin Baulig <martin@ximian.com>
6194 * class.cs (Property.Define): Fix iterators.
6196 * iterators.cs (Iterator.Define): Moved the
6197 `container.AddInterator (this)' call here from the .ctor; only do
6198 it if we resolved successfully.
6200 2004-07-17 Miguel de Icaza <miguel@ximian.com>
6202 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
6203 `true' for preprocessing directives that we parse. The return
6204 value indicates whether we should return to regular tokenizing or
6205 not, not whether it was parsed successfully.
6207 In the past if we were in: #if false ... #line #endif, we would
6208 resume parsing after `#line'. See bug 61604.
6210 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
6211 building: IsEnumType should return true only for enums, not for
6212 enums or System.Enum itself. This fixes #61593.
6214 Likely what happened is that corlib was wrong: mcs depended on
6215 this bug in some places. The bug got fixed, we had to add the
6216 hack, which caused bug 61593.
6218 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
6219 that was a workaround for the older conditions.
6221 2004-07-16 Ben Maurer <bmaurer@ximian.com>
6223 * assign.cs: IAssignMethod has a new interface, as documented
6224 inline. All assignment code now uses this new api.
6226 * ecore.cs, expression.cs: All classes which implement
6227 IAssignMethod now use the new interface.
6229 * expression.cs (Invocation): add a hack to EmitCall so that
6230 IndexerAccess can be the target of a compound assignment without
6231 evaluating its arguments twice.
6233 * statement.cs: Handle changes in Invocation api.
6235 2004-07-16 Martin Baulig <martin@ximian.com>
6237 * iterators.cs: Rewrote this. We're now using one single Proxy
6238 class for both the IEnumerable and the IEnumerator interface and
6239 `Iterator' derives from Class so we can use the high-level API.
6241 * class.cs (TypeContainer.AddIterator): New method.
6242 (TypeContainer.DoDefineType): New protected virtual method, which
6243 is called from DefineType().
6244 (TypeContainer.DoDefineMembers): Call DefineType() and
6245 DefineMembers() on all our iterators.
6246 (TypeContainer.Emit): Call Emit() on all our iterators.
6247 (TypeContainer.CloseType): Call CloseType() on all our iterators.
6249 * codegen.cs (EmitContext.CurrentIterator): New public field.
6251 2004-07-15 Martin Baulig <martin@ximian.com>
6254 (TypeManager.not_supported_exception_type): New type.
6256 2004-07-14 Martin Baulig <martin@ximian.com>
6258 * iterators.cs: Use real error numbers.
6260 2004-07-14 Martin Baulig <martin@ximian.com>
6262 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6263 requires this to be a System.Collection.IEnumerable and not a
6264 class implementing that interface.
6265 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
6267 2004-07-13 Marek Safar <marek.safar@seznam.cz>
6269 * class.cs: Fixed previous fix, it broke some error tests.
6271 2004-07-12 Martin Baulig <martin@ximian.com>
6273 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6276 2004-07-09 Miguel de Icaza <miguel@ximian.com>
6278 * assign.cs (LocalTemporary): Add new argument: is_address,If
6279 `is_address' is true, then the value that we store is the address
6280 to the real value, and not the value itself.
6282 * ecore.cs (PropertyExpr): use the new local temporary
6283 stuff to allow us to handle X.Y += z (where X is a struct)
6285 2004-07-08 Martin Baulig <martin@ximian.com>
6287 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6288 not always return, just like we're doing in Using.Resolve().
6290 2004-07-07 Miguel de Icaza <miguel@ximian.com>
6292 * cs-parser.jay (fixed_statement): flag this as Pinned.
6294 2004-07-06 Miguel de Icaza <miguel@ximian.com>
6296 * typemanager.cs (TypeManager): Removed MakePinned method, this
6297 mechanism is replaced with the .NET 2.x compatible mechanism of
6298 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6300 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
6301 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6302 `IsFixed' property which has a different meaning.
6304 2004-07-02 Raja R Harinath <rharinath@novell.com>
6306 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6307 visible from inside a nested class, not just the names of the
6308 immediately enclosing class.
6311 2004-06-24 Raja R Harinath <rharinath@novell.com>
6313 * expression.cs (BetterConversion): Remove buggy special-case
6314 handling of "implicit constant expression conversions". At this
6315 point, we already know that the conversion is possible -- we're
6316 only checking to see which is better.
6318 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6320 * cs-parser.jay: Added error CS0210 test.
6322 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6324 * cs-parser.jay: Added error CS0134 test.
6326 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6329 * cs-parser.jay: Added error CS0145 test.
6331 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6333 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6335 2004-06-23 Ben Maurer <bmaurer@ximian.com>
6337 * expression.cs (StackAlloc.Resolve): The argument may not
6338 be a constant; deal with this case.
6340 2004-06-23 Marek Safar <marek.safar@seznam.cz>
6342 * attribute.cs (IndexerName_GetIndexerName): Renamed to
6343 GetIndexerAttributeValue.
6344 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6346 * class.cs (Indexer.Define): Added error tests for CS0415,
6349 2004-06-23 Miguel de Icaza <miguel@ximian.com>
6351 * attribute.cs (Attribute.Resolve): Keep field code in sync with
6354 2004-06-23 Martin Baulig <martin@ximian.com>
6356 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6357 neither return nor throw, reset the barrier as well. Fixes #60457.
6359 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
6361 * class.cs : EventAttributes is now set to None by default.
6362 This fixes bug #60459.
6364 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6367 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6368 Don't throw exception but return null (it's sufficient now).
6370 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6372 * typemanager.cs (GetArgumentTypes): Faster implementation.
6374 2004-06-18 Martin Baulig <martin@ximian.com>
6376 * attribute.cs (Attribute.Resolve): Check whether we're an
6377 EmptyCast which a Constant child. Fixes #60333.
6379 2004-06-17 Ben Maurer <bmaurer@ximian.com>
6381 * statement.cs (EmitCollectionForeach): Account for the fact that
6382 not all valuetypes are in areas which we can take the address of.
6383 For these variables, we store to a temporary variable. Also, make
6384 sure that we dont emit a `callvirt' on a valuetype method.
6386 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6388 * expression.cs (StackAlloc.DoReSolve): Added test for
6389 negative parameter (CS0247).
6391 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6394 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6396 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6399 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6402 2004-06-14 Marek Safar <marek.safar@seznam.cz>
6404 Fix bug #58254 & cs1555.cs, cs1556.cs
6405 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6407 2004-06-14 Marek Safar <marek.safar@seznam.cz>
6409 * cs-parser.jay: Added error CS1669 test for indexers.
6411 2004-06-11 Martin Baulig <martin@ximian.com>
6413 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6414 call this twice: for params and varargs methods.
6416 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6419 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6421 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6423 * attribute.cs (Attribute.GetValidTargets): Made public.
6426 (AbstractPropertyEventMethod): New class for better code sharing.
6427 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6429 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6431 2004-06-11 Raja R Harinath <rharinath@novell.com>
6434 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6435 that the call to Resolve is part of a MemberAccess.
6436 (Expression.Resolve): Use it for SimpleName resolution.
6437 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6438 Add 'intermediate' boolean argument.
6439 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
6440 error message when the SimpleName can be resolved ambiguously
6441 between an expression and a type.
6442 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6444 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6445 call on the left-side.
6447 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6450 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6452 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6454 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6456 2004-06-11 Martin Baulig <martin@ximian.com>
6458 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6459 varargs methods if applicable.
6461 2004-06-11 Martin Baulig <martin@ximian.com>
6463 * expression.cs (Invocation.EmitCall): Don't use
6464 `method.CallingConvention == CallingConventions.VarArgs' since the
6465 method could also have `CallingConventions.HasThis'.
6467 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6469 * class.cs (Event.GetSignatureForError): Implemented.
6470 Fixed crash in error test cs3010.cs
6472 2004-06-10 Miguel de Icaza <miguel@ximian.com>
6474 * cs-tokenizer.cs: Change the way we track __arglist to be
6475 consistent with the other keywords.
6477 2004-06-09 Miguel de Icaza <miguel@ximian.com>
6479 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6482 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
6484 * codegen.cs: Check that all referenced assemblies have a strongname
6485 before strongnaming the compiled assembly. If not report error CS1577.
6486 Fix bug #56563. Patch by Jackson Harper.
6487 * typemanager.cs: Added a method to return all referenced assemblies.
6488 Fix bug #56563. Patch by Jackson Harper.
6490 2004-06-08 Marek Safar <marek.safar@seznam.cz>
6493 (Method.ApplyAttributeBuilder): Moved and added conditional
6494 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6497 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6499 2004-06-08 Marek Safar <marek.safar@seznam.cz>
6502 * class.cs: (EventField.attribute_targets): Changed default target.
6504 2004-06-08 Martin Baulig <martin@ximian.com>
6506 * expression.cs (Invocation.EmitCall): Enable varargs methods.
6508 2004-06-08 Martin Baulig <martin@ximian.com>
6510 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6512 2004-06-07 Martin Baulig <martin@ximian.com>
6514 Added support for varargs methods.
6516 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6519 * cs-parser.jay: Added support for `__arglist'.
6521 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6523 * expression.cs (Argument.AType): Added `ArgList'.
6524 (Invocation): Added support for varargs methods.
6525 (ArglistAccess): New public class.
6526 (Arglist): New public class.
6528 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6530 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
6531 a method's top-level block if the method has varargs.
6533 * support.cs (ReflectionParameters, InternalParameters): Added
6534 support for varargs methods.
6536 2004-06-07 Miguel de Icaza <miguel@ximian.com>
6538 * class.cs: Provide location in indexer error report.
6540 * driver.cs: Use standard names.
6542 * namespace.cs: Catch the use of using after a namespace has been
6543 declared also on using aliases.
6545 2004-06-03 Raja R Harinath <rharinath@novell.com>
6548 * typemanager.cs (closure_private_ok, closure_invocation_type)
6549 (closure_qualifier_type, closure_invocation_assembly)
6550 (FilterWithClosure): Move to ...
6551 (Closure): New internal nested class.
6552 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6553 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6554 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6555 (MemberLookup, MemberLookupFailed): Use it.
6556 * expression.cs (New.DoResolve): Treat the lookup for the
6557 constructor as being qualified by the 'new'ed type.
6558 (Indexers.GetIndexersForTypeOrInterface): Update.
6560 2004-06-03 Marek Safar <marek.safar@seznam.cz>
6563 (GetConditionalAttributeValue): New method. Returns
6564 condition of ConditionalAttribute.
6565 (SearchMulti): New method. Returns all attributes of type 't'.
6566 Use it when attribute is AllowMultiple = true.
6567 (IsConditionalMethodExcluded): New method.
6570 (Method.IsExcluded): Implemented. Returns true if method has conditional
6571 attribute and the conditions is not defined (method is excluded).
6572 (IMethodData): Extended interface for ConditionalAttribute support.
6573 (PropertyMethod.IsExcluded): Implemented.
6576 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6579 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6582 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
6584 * expression.cs (ArrayCreationExpression): Make this just an
6585 `expression'. It can't be a statement, so the code here was
6588 2004-06-02 Marek Safar <marek.safar@seznam.cz>
6591 * typemanager.cs (GetFullNameSignature): New method for
6594 2004-06-02 Marek Safar <marek.safar@seznam.cz>
6597 * class.cs (MemberBase.GetSignatureForError): New virtual method.
6598 Use this method when MethodBuilder is null.
6599 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6600 Added test for error CS0626 (MONO reports error for this situation).
6601 (IMethodData.GetSignatureForError): Extended interface.
6603 2004-06-01 Marek Safar <marek.safar@seznam.cz>
6606 (AttributeTester.GetObsoleteAttribute): Returns instance of
6607 ObsoleteAttribute when type is obsolete.
6610 (TypeContainer.VerifyObsoleteAttribute): Override.
6611 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6612 (MethodCode.VerifyObsoleteAttribute): Override.
6613 (MemberBase.VerifyObsoleteAttribute): Override.
6616 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6617 and report proper error.
6620 Delegate.VerifyObsoleteAttribute): Override.
6623 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6624 and report proper error.
6625 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6628 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6632 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6633 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6634 Added test for ObsoleteAttribute.
6637 (Catch): Derived from Statement.
6639 2004-06-01 Marek Safar <marek.safar@seznam.cz>
6641 Fixed bug #59071 & cs0160.cs
6643 * statement.cs (Try.Resolve): Check here whether order of catch
6644 clauses matches their dependencies.
6646 2004-05-31 Miguel de Icaza <miguel@ximian.com>
6648 * Reverted patch to namespace.cs (Use lookuptypedirect). This
6649 caused a regression: #59343. Referencing nested classes from an
6650 assembly stopped working.
6652 2004-05-31 Martin Baulig <martin@ximian.com>
6654 MCS is now frozen for beta 2.
6656 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6658 * convert.cs: add a trivial cache for overload operator resolution.
6660 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6662 * decl.cs: If possible, use lookuptypedirect here. We can only do
6663 this if there is no `.' after the namespace. Avoids using
6664 LookupType, which does lots of slow processing.
6665 (FindNestedType) New method, does what it says :-).
6666 * namespace.cs: use LookupTypeDirect.
6667 * rootcontext.cs: use membercache, if possible.
6668 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6670 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6673 According to the spec,
6675 In a member access of the form E.I, if E is a single identifier,
6676 and if the meaning of E as a simple-name (§7.5.2) is a constant,
6677 field, property, localvariable, or parameter with the same type as
6678 the meaning of E as a type-name (§3.8), then both possible
6679 meanings of E are permitted.
6681 We did not check that E as a simple-name had the same type as E as
6684 This trivial check gives us 5-7% on bootstrap time.
6686 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6688 * expression.cs (Invocation.OverloadResolve): Avoid the
6689 use of hashtables and boxing here by allocating on demand.
6691 2004-05-30 Martin Baulig <martin@ximian.com>
6693 * rootcontext.cs (RootContext.LookupType): Don't cache things if
6694 we're doing a silent lookup. Don't try to lookup nested types in
6695 TypeManager.object_type (thanks to Ben Maurer).
6697 2004-05-30 Martin Baulig <martin@ximian.com>
6699 Committing a patch from Ben Maurer.
6701 * rootcontext.cs (RootContext.LookupType): Cache negative results.
6703 2004-05-29 Martin Baulig <martin@ximian.com>
6705 * class.cs (IMethodData.ShouldIgnore): New method.
6707 * typemanager.cs (TypeManager.MethodFlags): Don't take a
6708 `Location' argument, we don't need it anywhere. Use
6709 `IMethodData.ShouldIgnore ()' instead of
6710 `MethodData.GetMethodFlags ()'.
6711 (TypeManager.AddMethod): Removed.
6712 (TypeManager.AddMethod2): Renamed to AddMethod.
6714 2004-05-29 Martin Baulig <martin@ximian.com>
6716 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6718 * convert.cs (Convert.ImplicitReferenceConversion): If we're
6719 converting from a class type S to an interface type and we already
6720 have an object on the stack, don't box it again. Fixes #52578.
6722 2004-05-29 Martin Baulig <martin@ximian.com>
6724 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6725 Added support for `params' parameters. Fixes #59267.
6727 2004-05-29 Martin Baulig <martin@ximian.com>
6729 * literal.cs (NullPointer): Provide a private .ctor which sets
6730 `type' to TypeManager.object_type. Fixes #59048.
6732 2004-05-29 Martin Baulig <martin@ximian.com>
6734 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6735 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
6737 * ecore.cs (EventExpr.instance_expr): Make the field private.
6739 2004-05-26 Marek Safar <marek.safar@seznam.cz>
6741 Fixed bug #50080 & cs0214-2.cs
6742 * expression.cs (Cast.DoResolve): Check unsafe context here.
6744 * statement.cs (Resolve.DoResolve): Likewise.
6746 2004-05-26 Martin Baulig <martin@ximian.com>
6748 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6750 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6751 (RootContext.LookupType): Pass down the `silent' flag.
6753 2004-05-25 Martin Baulig <martin@ximian.com>
6756 (MethodGroupExpr.IdenticalTypeName): New public property.
6757 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6758 expression actually refers to a type.
6760 2004-05-25 Martin Baulig <martin@ximian.com>
6762 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6763 for #56176 and made it actually work.
6765 2004-05-25 Martin Baulig <martin@ximian.com>
6767 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6768 (FieldExpr, PropertyExpr): Override and implement
6769 CacheTemporaries. Fixes #52279.
6771 2004-05-25 Miguel de Icaza <miguel@ximian.com>
6773 * location.cs: In the new compiler listing a file twice is a
6774 warning, not an error.
6776 2004-05-24 Martin Baulig <martin@ximian.com>
6778 * enum.cs (Enum.DefineType): For the `BaseType' to be a
6779 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
6781 2004-05-24 Martin Baulig <martin@ximian.com>
6783 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6784 walking the `using' list. Fixes #53921.
6786 2004-05-24 Martin Baulig <martin@ximian.com>
6788 * const.cs (Const.LookupConstantValue): Added support for
6789 EmptyCast's; fixes #55251.
6791 2004-05-24 Martin Baulig <martin@ximian.com>
6793 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6794 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6795 which does the CS0135 check. The reason is that we first need to
6796 check whether the variable actually exists.
6798 2004-05-24 Martin Baulig <martin@ximian.com>
6800 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6801 than RootContext.LookupType() to find the explicit interface
6804 2004-05-24 Raja R Harinath <rharinath@novell.com>
6806 * Makefile: Simplify. Use executable.make.
6807 * mcs.exe.sources: New file. List of sources of mcs.exe.
6809 2004-05-24 Anders Carlsson <andersca@gnome.org>
6813 Use the invariant culture when doing String.Compare for CLS case
6816 2004-05-23 Martin Baulig <martin@ximian.com>
6818 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6819 don't have any dots. Fixes #52622, added cs0246-8.cs.
6821 * namespace.cs (NamespaceEntry.Lookup): Likewise.
6823 2004-05-23 Marek Safar <marek.safar@seznam.cz>
6825 * class.cs (MemberBase.Define): Reuse MemberType member for
6826 resolved type. Other methods can use it too.
6828 2004-05-23 Martin Baulig <martin@ximian.com>
6830 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6831 the variable also exists in the current block (otherwise, we need
6832 to report a CS0103). Fixes #58670.
6834 2004-05-23 Martin Baulig <martin@ximian.com>
6836 * flowanalysis.cs (Reachability.Reachable): Compute this
6837 on-the-fly rather than storing it as a field.
6839 2004-05-23 Martin Baulig <martin@ximian.com>
6841 * flowanalysis.cs (Reachability.And): Manually compute the
6842 resulting `barrier' from the reachability.
6844 2004-05-23 Marek Safar <marek.safar@seznam.cz>
6847 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6848 instance of ObsoleteAttribute when symbol is obsolete.
6851 (IMethodData): Extended interface for ObsoleteAttribute support.
6853 2004-05-22 Marek Safar <marek.safar@seznam.cz>
6855 * attribute.cs: Fix bug #55970
6857 2004-05-22 Marek Safar <marek.safar@seznam.cz>
6861 (GetObsoleteAttribute): New method. Creates the instance of
6863 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6864 ObsoleteAttribute when member is obsolete.
6865 (AttributeTester.Report_ObsoleteMessage): Common method for
6866 Obsolete error/warning reporting.
6869 (TypeContainer.base_classs_type): New member for storing parent type.
6872 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6873 for this MemberCore.
6875 2004-05-21 Marek Safar <marek.safar@seznam.cz>
6877 * attribute.cs, const.cs: Fix bug #58590
6879 2004-05-21 Martin Baulig <martin@ximian.com>
6881 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6882 out parameters if the end of the method is unreachable. Fixes
6885 2004-05-21 Marek Safar <marek.safar@seznam.cz>
6887 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6888 Hari was right, why extra method.
6890 2004-05-21 Marek Safar <marek.safar@seznam.cz>
6892 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6894 2004-05-20 Martin Baulig <martin@ximian.com>
6896 Merged this back from gmcs to keep the differences to a minumum.
6898 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6899 instead of a Declspace.
6900 (Attribute.ResolveType): Likewise.
6901 (Attributes.Search): Likewise.
6902 (Attributes.Contains): Likewise.
6903 (Attributes.GetClsCompliantAttribute): Likewise.
6905 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6907 (MethodData.ApplyAttributes): Take an EmitContext instead of a
6910 2004-05-19 Marek Safar <marek.safar@seznam.cz>
6912 Fix bug #58688 (MCS does not report error when the same attribute
6915 * attribute.cs (Attribute.Emit): Distinction between null and default.
6917 2004-05-19 Raja R Harinath <rharinath@novell.com>
6919 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6920 of a top-level attribute without an attribute target.
6921 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
6923 (Attribute.Conditional_GetConditionName),
6924 (Attribute.Obsolete_GetObsoleteMessage): Update.
6925 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
6926 part of ScanForIndexerName.
6927 (Attribute.CanIgnoreInvalidAttribute): New function.
6928 (Attribute.ScanForIndexerName): Move to ...
6929 (Attributes.ScanForIndexerName): ... here.
6930 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6931 (Attributes.Search): New internal variant that can choose not to
6932 complain if types aren't resolved. The original signature now
6934 (Attributes.GetClsCompliantAttribute): Use internal variant, with
6935 complaints suppressed.
6936 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6937 only if it not useful.
6938 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6939 top-level for attributes that are shared between the assembly
6940 and a top-level class.
6941 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6942 * class.cs: Update to reflect changes.
6943 (DefineIndexers): Fuse loops.
6944 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
6945 a couple more variants of attribute names.
6947 2004-05-18 Marek Safar <marek.safar@seznam.cz>
6949 Fix bug #52585 (Implemented explicit attribute declaration)
6952 (Attributable.ValidAttributeTargets): New abstract method. It gets
6953 list of valid attribute targets for explicit target declaration.
6954 (Attribute.Target): It holds target itself.
6955 (AttributeSection): Removed.
6956 (Attribute.CheckTargets): New method. It checks whether attribute
6957 target is valid for the current element.
6960 (EventProperty): New class. For events that are declared like
6961 property (with add and remove accessors).
6962 (EventField): New class. For events that are declared like field.
6965 * cs-parser.jay: Implemented explicit attribute target declaration.
6967 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
6968 Override ValidAttributeTargets.
6971 (ReturnParameter): Class for applying custom attributes on
6973 (ParameterAtribute): New class. Class for applying custom
6974 attributes on the parameter type.
6976 2004-05-17 Miguel de Icaza <miguel@ximian.com>
6978 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6981 (Method): Allow UNSAFE here.
6983 * modifiers.cs: Support unsafe reporting.
6985 2004-05-17 Marek Safar <marek.safar@seznam.cz>
6987 * decl.cs: Fix bug #58478.
6989 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6991 * statement.cs: When checking for unreachable code on an EmptyStatement,
6992 set the location. Fixes bug #58488.
6994 2004-05-13 Miguel de Icaza <miguel@ximian.com>
6996 * driver.cs: Add -pkg handling.
6998 From Gonzalo: UseShelLExecute=false
7000 2004-05-12 Marek Safar <marek.safar@seznam.cz>
7003 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7005 (Attribute.IsClsCompliaceRequired): Moved to base for better
7007 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7008 when attribute is AttributeUsageAttribute.
7009 (Attribute.GetValidTargets): Simplified.
7010 (Attribute.GetAttributeUsage): New method returns AttributeUsage
7011 attribute for this type.
7012 (Attribute.ApplyAttributes): Method renamed to Emit and make
7014 (GlobalAttributeSection): New class for special handling of global
7015 attributes (assembly, module).
7016 (AttributeSection.Emit): New method.
7018 * class.cs: Implemented Attributable abstract methods.
7019 (MethodCore.LabelParameters): Moved to Parameter class.
7020 (Accessor): Is back simple class.
7021 (PropertyMethod): Implemented Attributable abstract class.
7022 (DelegateMethod): Implemented Attributable abstract class.
7023 (Event): New constructor for disctintion between normal Event
7024 and Event with accessors.
7026 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7028 * codegen.cs, const.cs, decl.cs, delegate.cs:
7029 (CommonAssemblyModulClass): Implemented Attributable abstract class
7032 * enum.cs: Implement IAttributeSupport interface.
7033 (EnumMember): New class for emum members. Implemented Attributable
7037 (ParameterBase): Is abstract.
7038 (ReturnParameter): New class for easier [return:] attribute handling.
7040 * typemanager.cs: Removed builder_to_attr.
7042 2004-05-11 Raja R Harinath <rharinath@novell.com>
7045 * attribute.cs (Attribute.GetPositionalValue): New function.
7046 * class.cs (TypeContainer.VerifyMembers): New function.
7047 (TypeContainer.Emit): Use it.
7048 (ClassOrStruct): New base class for Class and Struct.
7049 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
7050 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7052 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7053 then each non-static field should have a FieldOffset attribute.
7054 Otherwise, none of the fields should have a FieldOffset attribute.
7055 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
7056 and FieldOffset attributes.
7057 * typemanager.cs (TypeManager.struct_layout_attribute_type)
7058 (TypeManager.field_offset_attribute_type): New core types.
7059 (TypeManager.InitCoreTypes): Initialize them.
7061 2004-05-11 Michal Moskal <malekith@pld-linux.org>
7063 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7064 Return correct type.
7067 2004-05-09 Miguel de Icaza <miguel@ximian.com>
7069 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7070 be implicitly converted to ulong.
7072 * expression.cs: The logic for allowing operator &, | and ^ worked
7073 was wrong, it worked before because we did not report an error in
7074 an else branch. Fixes 57895.
7076 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7077 allow volatile fields to be reference types.
7079 2004-05-07 Miguel de Icaza <miguel@ximian.com>
7081 * driver.cs: Add support for /debug-
7083 2004-05-07 Raja R Harinath <rharinath@novell.com>
7085 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
7086 Add a 'complain' parameter to silence errors.
7087 (Attribute.Resolve): Update to changes. Put in sanity check to catch
7088 silently overlooked type-resolutions.
7089 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7091 (Attributes.Search): New function.
7092 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7093 (Attributes.GetAttributeFullName): Remove hack.
7094 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
7095 Update to reflect changes.
7096 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7097 Use Attributes.Search instead of nested loops.
7099 2004-05-07 Marek Safar <marek.safar@seznam.cz>
7102 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7103 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7104 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7106 * report.cs: (Report.Warning): Renamed to Warning_T because of
7107 parameter collision.
7109 2004-05-05 Raja R Harinath <rharinath@novell.com>
7111 * expression.cs (MemberAccess.ResolveMemberAccess):
7112 Exit with non-zero status after Report.Error.
7113 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7115 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7117 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7119 * support.cs: Don't hang when the file is empty.
7121 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7123 * support.cs: In SeekableStreamReader, compute the preamble size of the
7124 underlying stream. Position changes should take into account that initial
7127 2004-05-03 Todd Berman <tberman@sevenl.net>
7129 * driver.cs: remove unused GetSysVersion function.
7131 2004-05-03 Todd Berman <tberman@sevenl.net>
7133 * driver.cs: Remove the hack from saturday, as well as the hack
7134 from jackson (LoadAssemblyFromGac), also adds the CWD to the
7135 link_paths to get that bit proper.
7137 2004-05-01 Todd Berman <tberman@sevenl.net>
7139 * driver.cs: Try a LoadFrom before a Load, this checks the current
7140 path. This is currently a bug in mono that is be fixed, however, this
7141 provides a workaround for now. This will be removed when the bug
7144 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
7146 * CryptoConvert.cs: Updated to latest version. Fix issue with
7147 incomplete key pairs (#57941).
7149 2004-05-01 Todd Berman <tberman@sevenl.net>
7151 * driver.cs: Remove '.' from path_chars, now System.* loads properly
7154 2004-04-30 Jackson Harper <jackson@ximian.com>
7156 * codegen.cs: Open keys readonly.
7158 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7160 * typemanager.cs: don't report cyclic struct layout when a struct
7161 contains 2 or more fields of the same type. Failed for Pango.AttrShape
7162 which has 2 Pango.Rectangle fields.
7164 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
7166 * expression.cs: Handle IntPtr comparisons with IL code
7167 rather than a method call.
7169 2004-04-29 Martin Baulig <martin@ximian.com>
7171 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
7172 the list of PropertyInfo's in class hierarchy and find the
7173 accessor. Fixes #56013.
7175 2004-04-29 Martin Baulig <martin@ximian.com>
7177 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7179 2004-04-29 Martin Baulig <martin@ximian.com>
7181 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7183 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7185 2004-04-29 Martin Baulig <martin@ximian.com>
7187 * class.cs (ConstructorInitializer.Resolve): Check whether the
7188 parent .ctor is accessible. Fixes #52146.
7190 2004-04-29 Martin Baulig <martin@ximian.com>
7192 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7194 * statement.cs (Using.EmitLocalVariableDecls): Use
7195 TypeManager.idisposable_type, not typeof (IDisposable).
7196 (Foreach.EmitCollectionForeach): Added support for valuetypes.
7198 2004-04-29 Martin Baulig <martin@ximian.com>
7200 * class.cs (Event.Define): Don't emit the field and don't set
7201 RTSpecialName and SpecialName for events on interfaces. Fixes
7204 2004-04-29 Raja R Harinath <rharinath@novell.com>
7206 Refactor Attribute.ApplyAttributes.
7207 * attribute.cs (Attributable): New base class for objects that can
7208 have Attributes applied on them.
7209 (Attribute): Make AttributeUsage fields public.
7210 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7211 (Attribute.IsInternalCall): New property.
7212 (Attribute.UsageAttr): Convert to a public read-only property.
7213 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7214 (Attribute.ResolveType, Attribute.Resolve)
7215 (Attribute.ScanForIndexerName): Update to reflect changes.
7216 (Attribute.CheckAttributeTarget): Re-format.
7217 (Attribute.ApplyAttributes): Refactor, to various
7218 Attributable.ApplyAttributeBuilder methods.
7219 * decl.cs (MemberCore): Make Attributable.
7220 * class.cs (Accessor): Make Attributable.
7221 (MethodData.ApplyAttributes): Use proper attribute types, not
7223 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7224 (TypeContainer.ApplyAttributeBuilder)
7225 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7226 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
7227 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7228 (Operator.ApplyAttributeBuilder): New factored-out methods.
7229 * const.cs (Const.ApplyAttributeBuilder): Likewise.
7230 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7231 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7232 * parameter.cs (ParameterBase): New Attributable base class
7233 that can also represent Return types.
7234 (Parameter): Update to the changes.
7236 2004-04-29 Jackson Harper <jackson@ximian.com>
7238 * driver.cs: Prefer the corlib system version when looking for
7239 assemblies in the GAC. This is still a hack, but its a better hack
7242 2004-04-29 Marek Safar <marek.safar@seznam.cz>
7244 * decl.cs, enum.cs: Improved error 3005 reporting.
7246 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7247 (related_symbols): New private member for list of symbols
7248 related to reported error/warning.
7250 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7252 2004-04-29 Martin Baulig <martin@ximian.com>
7254 * ecore.cs (Expression.Constantify): If we're an enum and
7255 TypeManager.TypeToCoreType() doesn't give us another type, use
7256 t.UnderlyingSystemType. Fixes #56178.
7258 2004-04-29 Martin Baulig <martin@ximian.com>
7260 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7261 interfaces and for each interface, only add members directly
7262 declared in that interface. Fixes #53255.
7264 2004-04-28 Martin Baulig <martin@ximian.com>
7266 * expression.cs (ConditionalLogicalOperator): Use a temporary
7267 variable for `left' to avoid that we evaluate it more than once;
7270 2004-04-28 Martin Baulig <martin@ximian.com>
7272 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7275 2004-04-28 Martin Baulig <martin@ximian.com>
7277 * statement.cs (LocalInfo.Resolve): Check whether the type is not
7280 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7281 whether the type is not void (CS1547).
7283 2004-04-28 Martin Baulig <martin@ximian.com>
7285 * expression.cs (Unary.DoResolveLValue): Override this and report
7286 CS0131 for anything but Operator.Indirection.
7288 2004-04-28 Martin Baulig <martin@ximian.com>
7290 Committing a patch from Ben Maurer; see bug #50820.
7292 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7295 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7298 2004-04-28 Martin Baulig <martin@ximian.com>
7300 Committing a patch from Ben Maurer; see bug #50820.
7302 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7305 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7308 2004-04-28 Martin Baulig <martin@ximian.com>
7310 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7311 (Block.AddLabel): Call DoLookupLabel() to only search in the
7314 2004-04-28 Martin Baulig <martin@ximian.com>
7316 * cfold.cs (ConstantFold.BinaryFold): Added special support for
7317 comparing StringConstants and NullLiterals in Equality and Inequality.
7319 2004-04-28 Jackson Harper <jackson@ximian.com>
7321 * driver.cs: Attempt to load referenced assemblies from the
7322 GAC. This is the quick and dirty version of this method that
7323 doesnt take into account versions and just takes the first
7324 canidate found. Will be good enough for now as we will not have more
7325 then one version installed into the GAC until I update this method.
7327 2004-04-28 Martin Baulig <martin@ximian.com>
7329 * typemanager.cs (TypeManager.CheckStructCycles): New public
7330 static method to check for cycles in the struct layout.
7332 * rootcontext.cs (RootContext.PopulateTypes): Call
7333 TypeManager.CheckStructCycles() for each TypeContainer.
7334 [Note: We only need to visit each type once.]
7336 2004-04-28 Martin Baulig <martin@ximian.com>
7338 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7340 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7341 success and added `out object value'. Use a `bool resolved' field
7342 to check whether we've already been called rather than
7343 `ConstantValue != null' since this breaks for NullLiterals.
7345 2004-04-28 Raja R Harinath <rharinath@novell.com>
7347 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7348 setting of this flag, since the 'set' method may be non-public.
7350 2004-04-28 Raja R Harinath <rharinath@novell.com>
7352 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7353 check on current_vector.Block.
7355 2004-04-27 Martin Baulig <martin@ximian.com>
7357 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7358 a field initializer. Fixes #56459.
7360 2004-04-27 Martin Baulig <martin@ximian.com>
7362 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7363 we're not attempting to use an indexer. Fixes #52154.
7365 2004-04-27 Martin Baulig <martin@ximian.com>
7367 * statement.cs (Return): Don't create a return label if we don't
7368 need it; reverts my change from January 20th. Thanks to Ben
7371 2004-04-27 Martin Baulig <martin@ximian.com>
7373 According to the spec, `goto' can only leave a nested scope, but
7376 * statement.cs (Block.LookupLabel): Only lookup in the current
7377 block, don't recurse into parent or child blocks.
7378 (Block.AddLabel): Check in parent and child blocks, report
7379 CS0140/CS0158 if we find a duplicate.
7380 (Block): Removed this indexer for label lookups.
7381 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7382 this already does the error reporting for us.
7385 (FlowBranching.UsageVector.Block): New public variable; may be null.
7386 (FlowBranching.CreateSibling): Added `Block' argument.
7387 (FlowBranching.LookupLabel): New public virtual method. Lookup a
7388 label for the target of a `goto' and check whether we're not
7389 leaving a `finally'.
7391 2004-04-27 Martin Baulig <martin@ximian.com>
7393 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7394 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7397 2004-04-27 Martin Baulig <martin@ximian.com>
7399 * statement.cs (Block.AddLabel): Also check for implicit blocks
7400 and added a CS0158 check.
7402 2004-04-27 Martin Baulig <martin@ximian.com>
7404 * flowanalysis.cs (FlowBranchingLoop): New class.
7405 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7406 UsageVector's instead of an ArrayList.
7407 (FlowBranching.Label): Likewise.
7408 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7409 (FlowBranching.AddBreakVector): New method.
7411 2004-04-27 Miguel de Icaza <miguel@ximian.com>
7413 * attribute.cs: Small regression fix: only convert the type if we
7414 the type is different, fixes System.Drawing build.
7416 2004-04-27 Martin Baulig <martin@ximian.com>
7418 * attribute.cs (Attribute.Resolve): If we have a constant value
7419 for a named field or property, implicity convert it to the correct
7422 2004-04-27 Raja R Harinath <rharinath@novell.com>
7424 * statement.cs (Block.Block): Implicit blocks share
7425 'child_variable_names' fields with parent blocks.
7426 (Block.AddChildVariableNames): Remove.
7427 (Block.AddVariable): Mark variable as "used by a child block" in
7428 every surrounding block.
7429 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7430 been used in a child block, complain about violation of "Invariant
7431 meaning in blocks" rule.
7432 * cs-parser.jay (declare_local_variables): Don't use
7433 AddChildVariableNames.
7434 (foreach_statement): Don't create an implicit block: 'foreach'
7437 2004-04-23 Miguel de Icaza <miguel@ximian.com>
7439 * convert.cs (ImplicitNumericConversion): 0 is also positive when
7440 converting from 0L to ulong. Fixes 57522.
7442 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7444 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7445 derived class hides via 'new' keyword field from base class (test-242.cs).
7446 TODO: Handle this in the more general way.
7448 * class.cs (CheckBase): Ditto.
7450 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7452 * decl.cs (caching_flags): New member for storing cached values
7454 (MemberCore.Flags): New enum where bit flags for caching_flags
7456 (MemberCore.cls_compliance): Moved to caching_flags.
7457 (DeclSpace.Created): Moved to caching_flags.
7459 * class.cs: Use caching_flags instead of DeclSpace.Created
7461 2004-04-21 Miguel de Icaza <miguel@ximian.com>
7463 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7464 if we are only a derived class, not a nested class.
7466 * typemanager.cs: Same as above, but do this at the MemberLookup
7467 level (used by field and methods, properties are handled in
7468 PropertyExpr). Allow for the qualified access if we are a nested
7471 2004-04-21 Marek Safar <marek.safar@seznam.cz>
7473 * class.cs: Refactoring.
7474 (IMethodData): New inteface; Holds links to parent members
7475 to avoid member duplication (reduced memory allocation).
7476 (Method): Implemented IMethodData interface.
7477 (PropertyBase): New inner classes for get/set methods.
7478 (PropertyBase.PropertyMethod): Implemented IMethodData interface
7479 (Event): New inner classes for add/remove methods.
7480 (Event.DelegateMethod): Implemented IMethodData interface.
7482 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7483 EmitContext (related to class.cs refactoring).
7485 2004-04-21 Raja R Harinath <rharinath@novell.com>
7487 * delegate.cs (Delegate.VerifyApplicability): If the number of
7488 arguments are the same as the number of parameters, first try to
7489 verify applicability ignoring any 'params' modifier on the last
7493 2004-04-16 Raja R Harinath <rharinath@novell.com>
7495 * class.cs (TypeContainer.AddIndexer): Use
7496 'ExplicitInterfaceName' to determine if interface name was
7497 explicitly specified. 'InterfaceType' is not initialized at this time.
7498 (TypeContainer.DefineIndexers): Remove use of temporary list. The
7499 Indexers array is already in the required order. Initialize
7500 'IndexerName' only if there are normal indexers.
7501 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7502 (TypeContainer.Emit): Emit DefaultMember attribute only if
7503 IndexerName is initialized.
7506 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
7508 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7511 2004-04-15 Raja R Harinath <rharinath@novell.com>
7513 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7517 * attribute.cs (Attribute.Resolve): Check for duplicate named
7521 2004-04-15 Miguel de Icaza <miguel@ximian.com>
7523 * iterators.cs (MarkYield): track whether we are in an exception,
7524 and generate code accordingly. Use a temporary value to store the
7525 result for our state.
7527 I had ignored a bit the interaction of try/catch with iterators
7528 since their behavior was not entirely obvious, but now it is
7529 possible to verify that our behavior is the same as MS .NET 2.0
7533 2004-04-14 Miguel de Icaza <miguel@ximian.com>
7535 * iterators.cs: Avoid creating temporaries if there is no work to
7538 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7539 Enumerations, use TypeManager.EnumToUnderlying and call
7542 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7545 (This.Emit): Use EmitContext.EmitThis to emit our
7548 (This.EmitAssign): Ditto.
7550 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7551 codepaths, we will move all the functionality into
7554 (FieldExpr.EmitAssign): Ditto.
7556 This fixes several hidden bugs that I uncovered while doing a code
7557 review of this today.
7559 * codegen.cs (EmitThis): reworked so the semantics are more clear
7560 and also support value types "this" instances.
7562 * iterators.cs: Changed so that for iterators in value types, we
7563 do not pass the value type as a parameter.
7565 Initialization of the enumerator helpers is now done in the caller
7566 instead of passing the parameters to the constructors and having
7567 the constructor set the fields.
7569 The fields have now `assembly' visibility instead of private.
7571 2004-04-11 Miguel de Icaza <miguel@ximian.com>
7573 * expression.cs (Argument.Resolve): Check if fields passed as ref
7574 or out are contained in a MarshalByRefObject.
7576 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7577 another compiler type.
7579 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
7581 * class.cs (Indexer.Define): use the new name checking method.
7582 Also, return false on an error.
7583 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7584 (is_identifier_[start/part]_character): make static.
7586 2004-04-10 Miguel de Icaza <miguel@ximian.com>
7588 * expression.cs (Binary.ResolveOperator): Do no append strings
7589 twice: since we can be invoked more than once (array evaluation)
7590 on the same concatenation, take care of this here. Based on a fix
7591 from Ben (bug #56454)
7593 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
7595 * codegen.cs: Fix another case where CS1548 must be reported (when
7596 delay-sign isn't specified and no private is available #56564). Fix
7597 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
7598 error when MCS is used on the MS runtime and we need to delay-sign
7599 (which seems unsupported by AssemblyBuilder - see #56621).
7601 2004-04-08 Marek Safar <marek.safar@seznam.cz>
7603 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7604 (TypeManager.ComputeNamespaces): Faster implementation for
7607 * compiler.csproj: Updated AssemblyName to mcs.
7609 2004-04-07 Miguel de Icaza <miguel@ximian.com>
7611 * rootcontext.cs: Add new types to the boot resolution.
7613 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7614 MulticastDelegate is not allowed.
7616 * typemanager.cs: Add new types to lookup: System.TypedReference
7619 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7620 check for TypedReference or ArgIterator, they are not allowed.
7622 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7623 makes us properly catch 1510 in some conditions (see bug 56016 for
7626 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
7628 * CryptoConvert.cs: update from corlib version
7631 2004-04-05 Miguel de Icaza <miguel@ximian.com>
7633 * class.cs (Indexer.Define): Check indexername declaration
7635 2004-04-05 Marek Safar <marek.safar@seznam.cz>
7637 * attribute.cs (IsClsCompliant): Fixed problem with handling
7638 all three states (compliant, not-compliant, undetected).
7640 2004-03-30 Marek Safar <marek.safar@seznam.cz>
7642 * attribute.cs (Attribute): Location is now public.
7643 (Resolve): Store resolved arguments (pos_values) in attribute class.
7644 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7645 (GetClsCompliantAttributeValue): New method that gets
7646 CLSCompliantAttribute value.
7647 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7648 if exists else null.
7649 (AttributeTester): New class for CLS-Compliant verification routines.
7651 * class.cs (Emit): Add CLS-Compliant verification.
7652 (Method.GetSignatureForError): Implemented.
7653 (Constructor.GetSignatureForError): Implemented
7654 (Constructor.HasCompliantArgs): Returns if constructor has
7655 CLS-Compliant arguments.
7656 (Constructor.Emit): Override.
7657 (Construcor.IsIdentifierClsCompliant): New method; For constructors
7658 is needed to test only parameters.
7659 (FieldBase.GetSignatureForError): Implemented.
7660 (TypeContainer): New member for storing base interfaces.
7661 (TypeContainer.FindMembers): Search in base interfaces too.
7663 * codegen.cs (GetClsComplianceAttribute): New method that gets
7664 assembly or module CLSCompliantAttribute value.
7665 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7667 (ModuleClass.Emit): Add error 3012 test.
7669 * const.cs (Emit): Override and call base for CLS-Compliant tests.
7671 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7672 state for all decl types.
7673 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7674 if CLS-Compliant tests are required.
7675 (IsClsCompliaceRequired): New method. Analyze whether code
7676 must be CLS-Compliant.
7677 (IsExposedFromAssembly): New method. Returns true when MemberCore
7678 is exposed from assembly.
7679 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7680 value or gets cached value.
7681 (HasClsCompliantAttribute): New method. Returns true if MemberCore
7682 is explicitly marked with CLSCompliantAttribute.
7683 (IsIdentifierClsCompliant): New abstract method. This method is
7684 used to testing error 3005.
7685 (IsIdentifierAndParamClsCompliant): New method. Common helper method
7686 for identifier and parameters CLS-Compliant testing.
7687 (VerifyClsCompliance): New method. The main virtual method for
7688 CLS-Compliant verifications.
7689 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7690 null. I don't know why is null (too many public members !).
7691 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7692 and get value of first CLSCompliantAttribute that found.
7694 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7695 (VerifyClsCompliance): Override and add extra tests.
7697 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7698 clscheck- disable CLS-Compliant verification event if assembly is has
7699 CLSCompliantAttribute(true).
7701 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7702 ApllyAttribute is now called in emit section as in the other cases.
7703 Possible future Emit integration.
7704 (IsIdentifierClsCompliant): New override.
7705 (VerifyClsCompliance): New override.
7706 (GetEnumeratorName): Returns full enum name.
7708 * parameter.cs (GetSignatureForError): Implemented.
7710 * report.cs (WarningData): New struct for Warning message information.
7711 (LocationOfPreviousError): New method.
7712 (Warning): New method. Reports warning based on the warning table.
7713 (Error_T): New method. Reports error based on the error table.
7715 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7716 verifications are done here.
7718 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7720 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7721 CLSCompliantAttribute.
7722 (all_imported_types): New member holds all imported types from other
7724 (LoadAllImportedTypes): New method fills static table with exported types
7725 from all referenced assemblies.
7726 (Modules): New property returns all assembly modules.
7728 2004-03-30 Miguel de Icaza <miguel@ximian.com>
7730 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7731 throwing a parser error.
7733 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7734 which removes the hardcoded get_/set_ prefixes for properties, as
7735 IL allows for the properties to be named something else.
7739 * expression.cs: Do not override operand before we know if it is
7742 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
7744 * typemanager.cs: support for pinned variables.
7746 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
7748 * decl.cs, typemanager.cs: Avoid using an arraylist
7749 as a buffer if there is only one result set.
7751 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
7753 * expression.cs: Make sure you cant call a static method
7754 with an instance expression, bug #56174.
7756 2004-03-29 Miguel de Icaza <miguel@ximian.com>
7758 * class.cs (IsDuplicateImplementation): Improve error reporting to
7759 flag 663 (method only differs in parameter modifier).
7761 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7762 in preprocessor directives.
7764 * location.cs (LookupFile): Allow for the empty path.
7766 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
7767 better approach for some of that patch, but its failing with the
7768 CharSet enumeration. For now try/catch will do.
7770 * typemanager.cs: Do not crash if a struct does not have fields.
7773 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
7775 * expression.cs: cs0213, cant fix a fixed expression.
7778 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
7780 * cs-parser.jay: detect invalid embeded statements gracefully.
7783 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
7785 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7788 the invocation type may not be a subclass of the tye of the item/
7789 The type of the item must be a subclass of the invocation item.
7794 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
7796 * attribute.cs: Added methods to get a string and a bool from an
7797 attribute. Required to information from AssemblyKeyFileAttribute,
7798 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7799 * codegen.cs: Modified AssemblyName creation to include support for
7800 strongnames. Catch additional exceptions to report them as CS1548.
7801 * compiler.csproj: Updated include CryptoConvert.cs.
7802 * compiler.csproj.user: Removed file - user specific configuration.
7803 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
7804 Mono.Security assembly. The original class is maintained and tested in
7805 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7806 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7807 like CSC 8.0 (C# v2) supports.
7808 * Makefile: Added CryptoConvert.cs to mcs sources.
7809 * rootcontext.cs: Added new options for strongnames.
7811 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
7813 * driver.cs: For --expect-error, report error code `2'
7814 if the program compiled with no errors, error code `1' if
7815 it compiled with an error other than the one expected.
7817 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
7819 * compiler.csproj: Updated for Visual Studio .NET 2003.
7820 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7821 * compiler.sln: Updated for Visual Studio .NET 2003.
7823 2004-03-24 Ravi Pratap M <ravi@ximian.com>
7825 * expression.cs: Fix bug #47234. We basically need to apply the
7826 rule that we prefer the conversion of null to a reference type
7827 when faced with a conversion to 'object' (csc behaviour).
7829 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
7831 * statement.cs: Shorter form for foreach, eliminates
7832 a local variable. r=Martin.
7834 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
7836 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7837 checks if we can use brtrue/brfalse to test for 0.
7838 * expression.cs: use the above in the test for using brtrue/brfalse.
7841 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
7843 * expression.cs: Rewrite string concat stuff. Benefits:
7845 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7846 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7847 rather than a concat chain.
7849 * typemanager.cs: Add lookups for more concat overloads.
7851 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
7853 * expression.cs: Emit shorter il code for array init.
7870 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
7872 * statement.cs: Before, two switch blocks would be merged if the
7873 total size of the blocks (end_item - begin_item + 1) was less than
7874 two times the combined sizes of the blocks.
7876 Now, it will only merge if after the merge at least half of the
7881 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
7883 * class.cs : csc build fix for GetMethods(). See bug #52503.
7885 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
7887 * expression.cs: Make sure fp comparisons work with NaN.
7888 This fixes bug #54303. Mig approved this patch a long
7889 time ago, but we were not able to test b/c the runtime
7892 2004-03-19 Miguel de Icaza <miguel@ximian.com>
7894 * ecore.cs (TypExpr.GetHashCode): implement this overload.
7896 2004-03-19 Martin Baulig <martin@ximian.com>
7898 * class.cs (MemberCore.IsDuplicateImplementation): Report the
7899 error here and not in our caller.
7901 2004-03-19 Martin Baulig <martin@ximian.com>
7903 * interface.cs: Completely killed this file.
7904 (Interface): We're now a TypeContainer and live in class.cs.
7906 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7907 argument; we're now also called for interfaces.
7908 (TypeContainer.DefineMembers): Allow this method being called
7910 (TypeContainer.GetMethods): New public method; formerly known as
7911 Interface.GetMethod(). This is used by PendingImplementation.
7912 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7913 it's now private and non-static.
7914 (Interface): Moved this here; it's now implemented similar to
7916 (Method, Property, Event, Indexer): Added `bool is_interface'
7917 argument to their .ctor's.
7918 (MemberBase.IsInterface): New public field.
7920 * cs-parser.jay: Create normal Method, Property, Event, Indexer
7921 instances instead of InterfaceMethod, InterfaceProperty, etc.
7922 (opt_interface_base): Removed; we now use `opt_class_base' instead.
7923 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7925 2004-03-19 Martin Baulig <martin@ximian.com>
7927 * class.cs (MethodCore.IsDuplicateImplementation): New private
7928 method which does the CS0111 checking.
7929 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7930 Use IsDuplicateImplementation().
7932 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
7934 * decl.cs (FindMemberToOverride): New method to find the correct
7935 method or property to override in the base class.
7937 - Make Method/Property use the above method to find the
7938 version in the base class.
7939 - Remove the InheritableMemberSignatureCompare as it is now
7942 This patch makes large code bases much faster to compile, as it is
7943 O(n) rather than O(n^2) to do this validation.
7945 Also, it fixes bug 52458 which is that nested classes are not
7946 taken into account when finding the base class member.
7948 Reviewed/Approved by Martin.
7950 2004-03-17 Marek Safar <marek.safar@seznam.cz>
7952 * interface.cs: In all interface classes removed redundant
7953 member initialization.
7955 2004-03-16 Martin Baulig <martin@ximian.com>
7957 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7959 2004-03-15 Miguel de Icaza <miguel@ximian.com>
7961 * decl.cs (DefineTypeAndParents): New helper method to define a
7962 type's containers before the type itself is defined; This is a
7963 bug exposed by the recent changes to Windows.Forms when an
7964 implemented interface was defined inside a class that had not been
7967 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7969 (Check): Loop correctly to report errors modifiers
7970 (UNSAFE was not in the loop, since it was the same as TOP).
7972 * interface.cs: Every interface member now takes a ModFlags,
7973 instead of a "is_new" bool, which we set on the base MemberCore.
7975 Every place where we called "UnsafeOk" in the interface, now we
7976 call the proper member (InterfaceMethod.UnsafeOK) instead to get
7977 the unsafe settings from the member declaration instead of the
7978 container interface.
7980 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
7982 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7983 `set_indexer_name' to the pending bits (one per type).
7985 We fixed a bug today that was picking the wrong method to
7986 override, since for properties the existing InterfaceMethod code
7987 basically ignored the method name. Now we make sure that the
7988 method name is one of the valid indexer names.
7990 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
7992 * support.cs (SeekableStreamReader): Keep track of stream byte
7993 positions and don't mix them with character offsets to the buffer.
7995 Patch from Gustavo Giráldez
7997 2004-03-15 Marek Safar <marek.safar@seznam.cz>
7999 * interface.cs (InterfaceSetGetBase): Removed double member
8000 initialization, base class does it as well.
8002 2004-03-13 Martin Baulig <martin@ximian.com>
8004 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8005 when compiling corlib.
8007 2004-03-13 Miguel de Icaza <miguel@ximian.com>
8009 * convert.cs (ExplicitConversion): We were reporting an error on
8010 certain conversions (object_type source to a value type, when the
8011 expression was `null') before we had a chance to pass it through
8012 the user defined conversions.
8014 * driver.cs: Replace / and \ in resource specifications to dots.
8017 * class.cs: Add check for duplicate operators. Fixes 52477
8019 2004-03-11 Miguel de Icaza <miguel@ximian.com>
8021 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8022 that are in the middle of the statements, not only at the end.
8025 * class.cs (TypeContainer.AddField): No longer set the
8026 `HaveStaticConstructor' flag, now we call it
8027 `UserDefineStaticConstructor' to diferentiate the slightly
8028 semantic difference.
8030 The situation is that we were not adding BeforeFieldInit (from
8031 Modifiers.TypeAttr) to classes that could have it.
8032 BeforeFieldInit should be set to classes that have no static
8037 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8039 And most importantly Zoltan's comment:
8041 http://bugzilla.ximian.com/show_bug.cgi?id=44229
8043 "I think beforefieldinit means 'it's ok to initialize the type sometime
8044 before its static fields are used', i.e. initialization does not need
8045 to be triggered by the first access to the type. Setting this flag
8046 helps the JIT to compile better code, since it can run the static
8047 constructor at JIT time, and does not need to generate code to call it
8048 (possibly lots of times) at runtime. Unfortunately, mcs does not set
8049 this flag for lots of classes like String.
8051 csc sets this flag if the type does not have an explicit static
8052 constructor. The reasoning seems to be that if there are only static
8053 initalizers for a type, and no static constructor, then the programmer
8054 does not care when this initialization happens, so beforefieldinit
8057 This bug prevents the AOT compiler from being usable, since it
8058 generates so many calls to mono_runtime_class_init that the AOT code
8059 is much slower than the JITted code. The JITted code is faster,
8060 because it does not generate these calls if the vtable is type is
8061 already initialized, which is true in the majority of cases. But the
8062 AOT compiler can't do this."
8064 2004-03-10 Miguel de Icaza <miguel@ximian.com>
8066 * class.cs (MethodData.Emit): Refactor the code so symbolic
8067 information is generated for destructors; For some reasons we
8068 were taking a code path that did not generate symbolic information
8071 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
8073 * class.cs: Create a Constructor.CheckBase method that
8074 takes care of all validation type code. The method
8075 contains some code that was moved from Define.
8077 It also includes new code that checks for duplicate ctors.
8078 This fixes bug #55148.
8080 2004-03-09 Joshua Tauberer <tauberer@for.net>
8082 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8083 a { ... }-style array creation invokes EmitStaticInitializers
8084 which is not good for reference-type arrays. String, decimal
8085 and now null constants (NullCast) are not counted toward
8086 static initializers.
8088 2004-03-05 Martin Baulig <martin@ximian.com>
8090 * location.cs (SourceFile.HasLineDirective): New public field;
8091 specifies whether the file contains or is referenced by a "#line"
8093 (Location.DefineSymbolDocuments): Ignore source files which
8094 either contain or are referenced by a "#line" directive.
8096 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
8098 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8099 direct access to our parent, so check the method inline there.
8101 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
8103 * expression.cs (Invocation.EmitCall): Miguel's last commit
8104 caused a regression. If you had:
8109 In Foo the implict this would be null.
8111 2004-02-27 Miguel de Icaza <miguel@ximian.com>
8113 * expression.cs (Invocation.EmitCall): If the method is not
8114 virtual, do not emit a CallVirt to it, use Call.
8116 * typemanager.cs (GetFullNameSignature): Improve the method to
8117 cope with ".ctor" and replace it with the type name.
8119 * class.cs (ConstructorInitializer.Resolve): Now the method takes
8120 as an argument the ConstructorBuilder where it is being defined,
8121 to catch the recursive constructor invocations.
8123 2004-02-26 Miguel de Icaza <miguel@ximian.com>
8125 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8126 routines to check if a type is an enumerable/enumerator allow
8127 classes that implement the IEnumerable or IEnumerator interfaces.
8129 * class.cs (Property, Operator): Implement IIteratorContainer, and
8130 implement SetYields.
8132 (Property.Define): Do the block swapping for get_methods in the
8133 context of iterators. We need to check if Properties also
8134 include indexers or not.
8136 (Operator): Assign the Block before invoking the
8137 OperatorMethod.Define, so we can trigger the Iterator code
8140 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
8141 Property and Operator classes are not created when we parse the
8142 declarator but until we have the block completed, so we use a
8143 singleton SimpleIteratorContainer.Simple to flag whether the
8144 SetYields has been invoked.
8146 We propagate this setting then to the Property or the Operator to
8147 allow the `yield' to function.
8149 2004-02-25 Marek Safar <marek.safar@seznam.cz>
8151 * codegen.cs: Implemented attribute support for modules.
8152 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8153 Assembly/Module functionality.
8155 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8156 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8157 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8159 2004-02-16 Marek Safar <marek.safar@seznam.cz>
8161 * interface.cs (FindMembers): The operation is performed on all base
8162 interfaces and not only on the first. It is required for future CLS Compliance patch.
8164 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
8166 * statement.cs, codegen.cs:
8167 This patch deals with patterns such as:
8169 public class List : IEnumerable {
8171 public MyEnumerator GetEnumerator () {
8172 return new MyEnumerator(this);
8175 IEnumerator IEnumerable.GetEnumerator () {
8179 public struct MyEnumerator : IEnumerator {
8184 Before, there were a few things we did wrong:
8185 1) we would emit callvirt on a struct, which is illegal
8186 2) we emited ldarg when we needed to emit ldarga
8187 3) we would mistakenly call the interface methods on an enumerator
8188 type that derived from IEnumerator and was in another assembly. For example:
8190 public class MyEnumerator : IEnumerator
8192 Would have the interface methods called, even if there were public impls of the
8193 method. In a struct, this lead to invalid IL code.
8195 2004-02-11 Marek Safar <marek.safar@seznam.cz>
8197 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8200 * delegate.cs (Define): Fixed crash when delegate type is undefined.
8202 2004-02-11 Miguel de Icaza <miguel@ximian.com>
8204 * cs-parser.jay: Fix small regression: we were not testing V2
8205 compiler features correctly.
8207 * interface.cs: If the emit context is null, then create one
8209 2004-02-09 Marek Safar <marek.safar@seznam.cz>
8211 * decl.cs (GetSignatureForError): New virtual method to get full name
8214 * attribute.cs (IAttributeSupport): New interface for attribute setting.
8215 Now it is possible to rewrite ApplyAttributes method to be less if/else.
8217 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8218 Duplicated members and code in these classes has been removed.
8219 Better encapsulation in these classes.
8221 2004-02-07 Miguel de Icaza <miguel@ximian.com>
8223 * assign.cs (Assign.DoResolve): When dealing with compound
8224 assignments, there is a new rule in ECMA C# 2.4 (might have been
8225 there before, but it is documented here) that states that in:
8229 If b is of type int, and the `op' is a shift-operator, then the
8230 above is evaluated as:
8234 * expression.cs (Binary.ResolveOperator): Instead of testing for
8235 int/uint/long/ulong, try to implicitly convert to any of those
8236 types and use that in pointer arithmetic.
8238 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8239 method to print information for from the type, not from the
8240 null-method we were given.
8242 2004-02-01 Duncan Mak <duncan@ximian.com>
8244 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8245 parsing for cmd, fixes bug #53694.
8247 2004-02-04 Marek Safar <marek.safar@seznam.cz>
8249 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8250 in the member name duplication tests. Property and operator name duplication
8251 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8253 2004-02-03 Marek Safar <marek.safar@seznam.cz>
8255 * interface.cs (PopulateMethod): Fixed crash when interface method
8256 returns not existing type (error test cs0246-3.cs).
8258 2004-02-02 Ravi Pratap M <ravi@ximian.com>
8260 * cs-parser.jay (interface_accessors): Re-write actions to also
8261 store attributes attached to get and set methods. Fix spelling
8264 (inteface_property_declaration): Modify accordingly.
8266 (InterfaceAccessorInfo): New helper class to store information to pass
8267 around between rules that use interface_accessors.
8269 * interface.cs (Emit): Apply attributes on the get and set
8270 accessors of properties and indexers too.
8272 * attribute.cs (ApplyAttributes): Modify accordingly to use the
8273 right MethodBuilder when applying attributes to the get and set accessors.
8275 2004-01-31 Miguel de Icaza <miguel@ximian.com>
8277 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8279 2004-01-26 Miguel de Icaza <miguel@ximian.com>
8281 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8283 2004-01-25 Miguel de Icaza <miguel@ximian.com>
8285 * cs-parser.jay: Remove YIELD token, instead use the new grammar
8286 changes that treat `yield' specially when present before `break'
8289 * cs-tokenizer.cs: yield is no longer a keyword.
8291 2004-01-23 Marek Safar <marek.safar@seznam.cz>
8293 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8294 setting for default constructors.
8295 For default constructors are almost every time set wrong Modifier. The
8296 generated IL code has been alright. But inside mcs this values was
8297 wrong and this was reason why several of my CLS Compliance tests
8300 2004-01-22 Martin Baulig <martin@ximian.com>
8302 * cs-parser.jay (namespace_or_type_name): Return an Expression,
8303 not a QualifiedIdentifier. This is what `type_name_expression'
8304 was previously doing.
8305 (type_name_expression): Removed; the code is now in
8306 `namespace_or_type_name'.
8307 (qualified_identifier): Removed, use `namespace_or_type_name'
8309 (QualifiedIdentifier): Removed this class.
8311 2004-01-22 Martin Baulig <martin@ximian.com>
8313 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8314 not a string as alias name.
8316 2004-01-21 Miguel de Icaza <miguel@ximian.com>
8318 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8319 #52730 bug, and instead compute correctly the need to use a
8320 temporary variable when requesting an address based on the
8321 static/instace modified of the field and the constructor.
8323 2004-01-21 Martin Baulig <martin@ximian.com>
8325 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8326 class and namespace before looking up aliases. Fixes #52517.
8328 2004-01-21 Martin Baulig <martin@ximian.com>
8330 * flowanalysis.cs (UsageVector.Merge): Allow variables being
8331 assinged in a 'try'; fixes exception4.cs.
8333 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8334 * class.cs : Implemented parameter-less constructor for TypeContainer
8336 * decl.cs: Attributes are now stored here. New property OptAttributes
8338 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8340 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8342 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8344 * typemanager.cs (CSharpSignature): Now reports also inner class name.
8345 (CSharpSignature): New method for indexer and property signature.
8347 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8349 * pending.cs (IsVirtualFilter): Faster implementation.
8351 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8353 * typemanager.cs: Avoid inclusion of same assembly more than once.
8355 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8357 * cs-parser.jay: Fixed problem where the last assembly attribute
8358 has been applied also to following declaration (class, struct, etc.)
8360 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8362 * class.cs: Added error CS0538, CS0539 reporting.
8363 Fixed crash on Microsoft runtime when field type is void.
8365 * cs-parser.jay: Added error CS0537 reporting.
8367 * pending.cs: Added error CS0535 reporting.
8368 Improved error report for errors CS0536, CS0534.
8370 2004-01-20 Miguel de Icaza <miguel@ximian.com>
8372 Merge a few bits from the Anonymous Method MCS tree.
8374 * statement.cs (ToplevelBlock): New class for toplevel methods,
8375 will hold anonymous methods, lifted variables.
8377 * cs-parser.jay: Create toplevel blocks for delegates and for
8378 regular blocks of code.
8380 2004-01-20 Martin Baulig <martin@ximian.com>
8382 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8383 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8384 and `NeedExplicitReturn'; added `IsLastStatement'.
8385 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8386 have a `ReturnLabel' or we're not unreachable.
8388 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8389 child's reachability; don't just override ours with it. Fixes
8390 #58058 (lluis's example).
8391 (FlowBranching): Added public InTryOrCatch(), InCatch(),
8392 InFinally(), InLoop(), InSwitch() and
8393 BreakCrossesTryCatchBoundary() methods.
8395 * statement.cs (Return): Do all error checking in Resolve().
8396 Unless we are the last statement in a top-level block, always
8397 create a return label and jump to it.
8398 (Break, Continue): Do all error checking in Resolve(); also make
8399 sure we aren't leaving a `finally'.
8400 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8401 statement in a top-level block.
8402 (Block.Flags): Added `IsDestructor'.
8403 (Block.IsDestructor): New public property.
8405 2004-01-20 Martin Baulig <martin@ximian.com>
8407 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8409 2004-01-20 Martin Baulig <martin@ximian.com>
8411 * statement.cs (Statement.ResolveUnreachable): New public method.
8412 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8413 (Block.Resolve): Resolve unreachable statements.
8415 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
8417 * expression.cs: We need to fix the case where we do
8418 not have a temp variable here.
8420 * assign.cs: Only expression compound assignments need
8421 temporary variables.
8423 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
8425 * flowanalysis.cs: Reduce memory allocation in a few ways:
8426 - A block with no variables should not allocate a bit
8428 - A method with no out parameters does not need any tracking
8429 for assignment of the parameters, so we need not allocate
8432 public readonly Type[] VariableTypes;
8433 public readonly string[] VariableNames;
8434 Are redundant. The data is already stored in the variable
8435 map, so we need not allocate another array for it.
8436 - We need to add alot of checks for if (params | locals) == null
8437 due to the first two changes.
8439 2004-01-18 Miguel de Icaza <miguel@ximian.com>
8441 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8442 implement IMemoryLocation, we store a copy on a local variable and
8443 take the address of it. Patch from Benjamin Jemlich
8445 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8446 to use a special "type_name_expression" rule which reduces the
8447 number of "QualifiedIdentifier" classes created, and instead
8448 directly creates MemberAccess expressions.
8450 2004-01-17 Miguel de Icaza <miguel@ximian.com>
8452 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8453 that fixes #52853. Null literal assignment to ValueType
8455 * class.cs (MethodData.Emit): Instead of checking the name of the
8456 method to determine if its a destructor, create a new derived
8457 class from Method called Destructor, and test for that.
8459 * cs-parser.jay: Create a Destructor object instead of a Method.
8461 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8465 2004-01-16 Miguel de Icaza <miguel@ximian.com>
8467 * expression.cs (Binary.ResolveOperator): Perform an implicit
8468 conversion from MethodGroups to their delegate types on the
8471 * delegate.cs: Introduce a new class DelegateCreation that is the
8472 base class for `NewDelegate' and `ImplicitDelegateCreation',
8473 factor some code in here.
8475 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8476 conversion from MethodGroups to compatible delegate types.
8478 * ecore.cs (Expression.Resolve): Do not flag error 654
8479 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8480 we allow conversions from MethodGroups to delegate types now.
8482 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8483 assignments in v2 either.
8485 2004-01-10 Miguel de Icaza <miguel@ximian.com>
8487 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8488 static read-only fields in ctors.
8490 Applied patch from Benjamin Jemlich
8492 * expression.cs (UnaryMutator): Avoid leaking local variables.
8494 2004-01-09 Miguel de Icaza <miguel@ximian.com>
8496 * cs-tokenizer.cs (IsCastToken): Allow the various native types
8497 here to return true, as they can be used like this:
8501 Fixed 49836 and all the other dups
8503 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
8505 * driver.cs: Implement /win32res and /win32icon.
8507 2004-01-08 Miguel de Icaza <miguel@ximian.com>
8509 * cs-parser.jay: Add a rule to improve error handling for the
8510 common mistake of placing modifiers after the type.
8512 2004-01-07 Miguel de Icaza <miguel@ximian.com>
8514 * cs-parser.jay (interface_event_declaration): Catch
8515 initialization of events on interfaces, and report cs0068
8517 * cs-parser.jay (interface_event_declaration): Catch
8518 initialization of events.
8520 * ecore.cs: Better report missing constructors.
8522 * expression.cs (Binary.ResolveOperator): My previous bug fix had
8523 the error reporting done in the wrong place. Fix.
8525 * expression.cs (Binary.ResolveOperator): Catch the
8526 operator + (E x, E y) error earlier, and later allow for implicit
8527 conversions in operator +/- (E e, U x) from U to the underlying
8530 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8531 52596, if the container class is abstract, the default constructor
8532 is protected otherwise its public (before, we were always public).
8534 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8537 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8538 Jemlich that fixes bug #52597, MCS was generating invalid code for
8539 idisposable structs. Thanks to Ben for following up with this
8542 2004-01-06 Miguel de Icaza <miguel@ximian.com>
8544 * driver.cs: Allow assemblies without code to be generated, fixes
8547 2004-01-07 Nick Drochak <ndrochak@gol.com>
8549 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8551 2004-01-05 Miguel de Icaza <miguel@ximian.com>
8553 * cs-parser.jay: Add rules to improve error reporting if fields or
8554 methods are declared at the namespace level (error 116)
8556 * Add rules to catch event add/remove
8558 2004-01-04 David Sheldon <dave-mono@earth.li>
8560 * expression.cs: Added matching ")" to error message for
8563 2004-01-03 Todd Berman <tberman@gentoo.org>
8565 * ecore.cs, attribute.cs:
8566 Applying fix from #52429.
8568 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
8570 * ecore.cs, expression.cs, statement.cs:
8571 Total rewrite of how we handle branching. We
8572 now handle complex boolean expressions with fewer
8573 jumps. As well if (x == 0) no longer emits a ceq.
8575 if (x is Foo) is much faster now, because we generate
8578 Overall, we get a pretty big improvement on our benchmark
8579 tests. The code we generate is smaller and more readable.
8581 I did a full two-stage bootstrap. The patch was reviewed
8582 by Martin and Miguel.
8584 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
8586 * cs-parser.jay: Make primary_expression not take a QI.
8587 we dont need this because the member_access rule covers
8588 us here. So we replace the rule with just IDENTIFIER.
8590 This has two good effects. First, we remove a s/r conflict.
8591 Second, we allocate many fewer QualifiedIdentifier objects.
8593 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
8595 * attribute.cs: Handle MarshalAs attributes as pseudo, and
8596 set the correct information via SRE. This prevents
8597 hanging on the MS runtime. Fixes #29374.
8599 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
8601 * convert.cs: correctly handle conversions to value types
8602 from Enum and ValueType as unboxing conversions.
8604 Fixes bug #52569. Patch by Benjamin Jemlich.
8606 2004-01-02 Ravi Pratap <ravi@ximian.com>
8608 * expression.cs (BetterConversion): Prefer int -> uint
8609 over int -> ulong (csc's behaviour). This fixed bug #52046.
8611 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
8613 * decl.cs (MemberCache.FindMembers): now returns a
8616 * typemanager.cs: In general, go with with ^^.
8617 (CopyNewMethods): take an IList.
8618 (RealMemberLookup): Only allocate an arraylist
8619 if we copy from two sets of methods.
8621 This change basically does two things:
8622 1) Fewer array lists allocated due to CopyNewMethods.
8623 2) the explicit cast in MemberList costed ALOT.
8625 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
8627 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8628 a hashtable to avoid needless string allocations when an identifier is
8629 used more than once (the common case).
8631 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
8633 * pending.cs: MS's TypeBuilder.GetInterfaces ()
8634 is broken, it will not return anything. So, we
8635 have to use the information we have in mcs to
8638 * typemanager.cs: Add a cache for GetInterfaces,
8639 since this will now be used more often (due to ^^)
8641 (GetExplicitInterfaces) New method that gets the
8642 declared, not effective, interfaces on a type
8643 builder (eg, if you have interface IFoo, interface
8644 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8647 This patch makes MCS able to bootstrap itself on
8650 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
8652 * expression.cs: Remove the Nop's that Miguel put
8655 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
8657 * report.cs, codegen.cs: Give the real stack trace to
8658 the error when an exception is thrown.
8660 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
8662 * decl.cs: only allocate hashtables for ifaces if
8665 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
8667 * expression.cs: fix the error from cs0121-2.cs
8668 (a parent interface has two child interfaces that
8669 have a function with the same name and 0 params
8670 and the function is called through the parent).
8672 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
8674 * class.cs, rootcontext.cs, typmanager.cs: do not
8677 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
8679 * codegen.cs: remove stack for the ec flow branching.
8680 It is already a linked list, so no need.
8682 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
8684 * Makefile: Allow custom profiler here.
8686 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
8688 * typemanager.cs (LookupType):
8689 - Use a static char [], because split takes
8690 a param array for args, so it was allocating
8692 - Do not store true in a hashtable, it boxes.
8694 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
8696 * flowanalysis.cs: bytify common enums.
8698 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
8700 * modifiers.cs: Add a new set of flags for the
8701 flags allowed on explicit interface impls.
8702 * cs-parser.jay: catch the use of modifiers in
8703 interfaces correctly.
8704 * class.cs: catch private void IFoo.Blah ().
8706 All related to bug #50572.
8708 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
8710 * decl.cs: Rewrite the consistant accessability checking.
8711 Accessability is not linear, it must be implemented in
8712 a tableish way. Fixes #49704.
8714 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
8716 * expression.cs: Handle negation in a checked context.
8717 We must use subtraction from zero. Fixes #38674.
8719 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
8721 * class.cs: Ignore static void main in DLLs.
8722 * rootcontext.cs: Handle the target type here,
8723 since we are have to access it from class.cs
8724 * driver.cs: account for the above.
8726 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
8728 * report.cs: Give line numbers and files if available.
8730 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
8732 * driver.cs: Implement /addmodule.
8734 * typemanager.cs: Change 'modules' field so it now contains Modules not
8737 2003-12-20 Martin Baulig <martin@ximian.com>
8739 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8740 (FieldBase.IsAssigned): Removed this field.
8741 (FieldBase.SetAssigned): New public method.
8742 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8744 2003-12-20 Martin Baulig <martin@ximian.com>
8746 * expression.cs (LocalVariableReference.DoResolve): Don't set
8747 `vi.Used' if we're called from DoResolveLValue().
8749 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8750 returns the usage vector it just merged into the current one -
8751 pass this one to UsageWarning().
8752 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8753 of the `EmitContext', don't call this recursively on our children.
8755 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
8757 * driver.cs: Implement /target:module.
8759 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
8761 * support.cs (CharArrayHashtable): New helper class.
8763 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
8764 char arrays, not strings, so we can avoid creating a string in
8765 consume_identifier if the identifier is a keyword.
8767 2003-12-16 Martin Baulig <martin@ximian.com>
8769 * statement.cs (LocalInfo.Assigned): Removed this property.
8770 (LocalInfo.Flags): Removed `Assigned'.
8771 (LocalInfo.IsAssigned): New public method; takes the EmitContext
8772 and uses flow analysis.
8773 (Block.UsageWarning): Made this method private.
8774 (Block.Resolve): Call UsageWarning() if appropriate.
8776 * expression.cs (LocalVariableReference.DoResolve): Always set
8777 LocalInfo.Used here.
8779 2003-12-13 Martin Baulig <martin@ximian.com>
8781 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8782 any value here; we're now using flow analysis to figure out
8783 whether a statement/block returns a value.
8785 2003-12-13 Martin Baulig <martin@ximian.com>
8787 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8789 (FlowBranching.MergeFinally): Don't call
8790 `branching.CheckOutParameters()' here, this is called in
8792 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8793 when adding the `finally' vector.
8795 2003-12-13 Martin Baulig <martin@ximian.com>
8798 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8799 actually work and also fix #48962.
8801 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
8803 * decl.cs: Do not check System.Object for nested types,
8804 since we know it does not have any. Big bang for buck:
8809 corlib: 17.99 seconds
8813 corlib: 17.39 seconds
8815 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
8817 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8818 time we are returning 0 members, so we save alot here.
8820 2003-12-11 Martin Baulig <martin@ximian.com>
8822 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8823 `MergeChild()', also just take the `FlowBranching' as argument;
8824 call Merge() on it and return the result.
8825 (FlowBranching.Merge): We don't need to do anything if we just
8828 2003-12-11 Martin Baulig <martin@ximian.com>
8830 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8831 them in an `ArrayList' to reduce memory usage. Thanks to Ben
8832 Maurer for this idea.
8834 2003-12-11 Martin Baulig <martin@ximian.com>
8836 * flowanalysis.cs (MergeResult): This class is now gone; we now
8837 use the `UsageVector' for this. The reason for this is that if a
8838 branching just has one sibling, we don't need to "merge" them at
8839 all - that's the next step to do.
8840 (FlowBranching.Merge): We now return a `UsageVector' instead of a
8843 2003-12-11 Martin Baulig <martin@ximian.com>
8845 Reworked flow analyis and made it more precise and bug-free. The
8846 most important change is that we're now using a special `Reachability'
8847 class instead of having "magic" meanings of `FlowReturns'. I'll
8848 do some more cleanups and optimizations and also add some more
8849 documentation this week.
8851 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8852 largely reworked this class.
8853 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8854 the new `Reachability' class instead of having "magic" values here.
8855 (FlowBranching): We're now using an instance of `Reachability'
8856 instead of having separate `Returns', `Breaks' etc. fields.
8858 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8859 based on flow analysis; ignore the return value of block.Emit ().
8861 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
8863 * driver.cs typemanager.cs: Find the mono extensions to corlib even
8864 if they are private.
8866 2003-12-09 Martin Baulig <martin@ximian.com>
8868 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8869 call them directly on the UsageVector.
8871 2003-12-09 Martin Baulig <martin@ximian.com>
8873 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8874 Changed return type from `FlowReturns' to `Reachability'.
8876 2003-12-09 Martin Baulig <martin@ximian.com>
8878 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8879 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8880 `Reachable' fields with a single `Reachability' one.
8882 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
8884 * class.cs (FindMembers): Remove foreach's.
8897 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
8902 This patch does a few things:
8903 1. EmptyStatement is now a singleton, so it is never reallocated.
8904 2. All blah is EmptyStatement constructs have been changed to
8905 blah == EmptyStatement.Value, which is much faster and valid
8906 now that EmptyStatement is a singleton.
8907 3. When resolving a block, rather than allocating a new array for
8908 the non-empty statements, empty statements are replaced with
8909 EmptyStatement.Value
8910 4. Some recursive functions have been made non-recursive.
8911 Mainly the performance impact is from (3), however (1) and (2) are needed for
8912 this to work. (4) does not make a big difference in normal situations, however
8913 it makes the profile look saner.
8918 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8919 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8920 Total memory allocated: 56397 KB
8923 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8924 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8925 Total memory allocated: 55666 KB
8927 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
8929 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8930 than the hashtable in a hashtable version
8932 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8933 we always end up concating a string. This results in a huge perf
8934 loss, because many strings have to be tracked by the GC. In this
8935 patch, we first use a hashtable that works with two keys, so that
8936 the strings do not need to be concat'ed.
8947 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
8949 * Makefile: Add a new target `do-time' that does a quick and simple
8950 profile, leaving easy to parse output.
8952 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
8954 * codegen.cs (Init): Create the dynamic assembly with
8955 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8957 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
8959 * support.cs: Make the PtrHashtable use only one
8960 instance of its comparer.
8962 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
8964 * typemanager.cs: Fix lookup of GetNamespaces.
8966 2003-11-29 Miguel de Icaza <miguel@ximian.com>
8968 * expression.cs: Removed redundant line.
8970 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8971 ArrayLists, use for loops with bounds.
8973 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8976 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8977 arraylists, use for loop with bounds.
8979 The above three changes give us a 0.071 second performance
8980 improvement out of 3.294 seconds down to 3.223. On my machine
8981 the above changes reduced the memory usage by 1,387 KB during
8984 * cs-parser.jay (QualifiedIdentifier): New class used to represent
8985 QualifiedIdentifiers. Before we created a new string through
8986 concatenation, and mostly later on, the result would be
8987 manipulated by DecomposeQI through string manipulation.
8989 This reduced the compiler memory usage for bootstrapping from
8990 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8991 compile times in 0.05 seconds.
8993 2003-11-28 Dick Porter <dick@ximian.com>
8995 * support.cs: Do string compares with the Invariant culture.
9003 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9004 the comparison is done with the Invariant culture.
9006 2003-11-27 Miguel de Icaza <miguel@ximian.com>
9008 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9009 GetEnumerator method.
9011 (ProbeCollectionType): Iterate starting at the most specific type
9012 upwards looking for a GetEnumerator
9014 * expression.cs: Shift count can be up to 31 for int/uint and 63
9017 2003-11-26 Miguel de Icaza <miguel@ximian.com>
9019 * statement.cs (Block.LookupLabel): Also look for the label on the
9020 children blocks. Use a hash table to keep track of visited
9023 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9024 we actually did transform the other operand, otherwise fall back
9025 to the common codepath that casts to long.
9027 * cs-tokenizer.cs: Use the same code pattern as the int case.
9028 Maybe I should do the parsing myself, and avoid depending on the
9029 Parse routines to get this done.
9031 2003-11-25 Miguel de Icaza <miguel@ximian.com>
9033 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
9034 which fixes bug 51347. This time test it.
9036 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9037 attributes for example can not tell the difference between these.
9038 The difference was only a syntax feature of the language.
9040 * attribute.cs: Apply attributes to delegates.
9042 * delegate.cs: Call the apply attributes method.
9044 2003-11-24 Miguel de Icaza <miguel@ximian.com>
9046 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9047 comparing 0 vs Byte.MinValue, not the value
9049 (ImplicitConversionRequired): When reporting a conversion error,
9050 use error 31 to print out the constant error instead of the
9053 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
9054 which fixes bug 51347.
9056 2003-11-22 Miguel de Icaza <miguel@ximian.com>
9058 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
9059 which fixes the -warnaserror command line option.
9061 2003-11-21 Miguel de Icaza <miguel@ximian.com>
9063 * cfold.cs (DoNumericPromotions): During constant folding of
9064 additions on UIntConstant, special case intconstants with
9065 IntConstants like we do on the expression binary operator.
9067 2003-11-12 Miguel de Icaza <miguel@ximian.com>
9069 * convert.cs (ImplicitReferenceConversion): We were missing a case
9070 (System.Enum are not value types or class types, so we need to
9071 classify them separatedly).
9073 * driver.cs: We do not support error 2007.
9075 2003-11-12 Jackson Harper <jackson@ximian.com>
9077 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9078 system directory. Also use the full file name so users can
9079 libraries names mscorlib-o-tron.dll in a non system dir.
9081 2003-11-10 Martin Baulig <martin@ximian.com>
9083 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9084 (TypeManager.InitCoreTypes): Initialize them here, but instead of
9085 calling `ResolveType()' on them, directly assign their `Type'.
9087 2003-11-08 Martin Baulig <martin@ximian.com>
9089 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9090 return value and the `out parent' parameter.
9091 (TypeContainer.DefineType): Moved the CS0644 check into
9092 GetClassBases(). Don't pass the interface types to the
9093 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9094 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9096 * ecore.cs (TypeExpr.IsAttribute): New property.
9097 (TypeExpr.GetInterfaces): New method.
9099 * interface.cs (Interface.GetInterfaceTypeByName): Return a
9100 TypeExpr instead of a Type.
9101 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9102 (Interface.DefineType): Don't pass the interface types to the
9103 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9104 them later and then call `TypeBulider.AddInterfaceImplementation()'.
9106 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9107 instead of a `Type[]'.
9108 (TypeManager.RegisterBuilder): Likewise.
9109 (TypeManager.AddUserInterface): Likewise.
9110 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9111 `Type[]' and also return a `TypeExpr[]'.
9112 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9114 2003-11-08 Martin Baulig <martin@ximian.com>
9116 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9119 2003-11-08 Martin Baulig <martin@ximian.com>
9121 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9122 TypeManager.ResolveExpressionTypes().
9124 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9125 instead of an Expression.
9126 (TypeExpr): This is now an abstract base class for `TypeExpression'.
9127 (TypeExpression): New public class; formerly known as `TypeExpr'.
9129 * expression.cs (ComposedCast): Derive from TypeExpr.
9131 * typemanager.cs (TypeManager.system_*_expr): These are now
9132 TypExpr's instead of Expression's.
9133 (TypeManager.ResolveExpressionTypes): New public static function;
9134 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9137 2003-11-06 Miguel de Icaza <miguel@ximian.com>
9139 * expression.cs (New.DoResolve): Do not dereference value that
9140 might be a null return.
9142 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9143 sure that the constant value has the right type. Fixes an
9144 unreported bug, similar to 50425.
9146 * const.cs (Const.LookupConstantValue): Call
9147 ImplicitStandardConversionExists before doing a conversion to
9148 avoid havng the TypeManager.ChangeType do conversions.
9150 Reduced the number of casts used
9152 (Const.ChangeType): New routine to enable reuse of the constant
9153 type changing code from statement.
9155 * typemanager.cs (ChangeType): Move common initialization to
9156 static global variables.
9160 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9161 every value type to go through, even if it was void. Fix that.
9163 * cs-tokenizer.cs: Use is_identifier_start_character on the start
9164 character of the define, and the is_identifier_part_character for
9165 the rest of the string.
9167 2003-11-05 Miguel de Icaza <miguel@ximian.com>
9169 * expression.cs (UnaryMutator.EmitCode): When I updated
9170 LocalVariableReference.DoResolve, I overdid it, and dropped an
9171 optimization done on local variable references.
9173 2003-11-04 Miguel de Icaza <miguel@ximian.com>
9175 * ecore.cs: Convert the return from Ldlen into an int.
9177 2003-10-20 Miguel de Icaza <miguel@ximian.com>
9179 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9180 the accessibility, this is a special case for toplevel non-public
9181 classes (internal for instance).
9183 2003-10-20 Nick Drochak <ndrochak@gol.com>
9185 * ecore.cs: Fix typo and build. Needed another right paren.
9187 2003-10-19 Miguel de Icaza <miguel@ximian.com>
9189 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
9190 `internal' case regular and protected, but not allowing protected
9191 to be evaluated later. Bug 49840
9193 2003-10-15 Miguel de Icaza <miguel@ximian.com>
9195 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9196 to kb.Nlast, and not the kb.nFirst to isolate the switch
9199 Extract the underlying type, so enumerations of long/ulong are
9200 treated like long/ulong.
9202 2003-10-14 Miguel de Icaza <miguel@ximian.com>
9204 * expression.cs (New): Overload the meaning of RequestedType to
9205 track the possible creation of the NewDelegate type, since
9206 DoResolve is invoked more than once for new constructors on field
9209 See bugs: #48800 and #37014
9211 * cs-parser.jay (declare_local_constants): Take an arraylist
9212 instead of a single constant.
9214 (local_constant_declaration): It should take a
9215 constant_declarators, not a constant_declarator. Fixes 49487
9217 * convert.cs: Fix error report.
9219 2003-10-13 Jackson Harper <jackson@ximian.com>
9221 * typemanager.cs (TypeToCoreType): Add float and double this fixes
9224 2003-10-09 Martin Baulig <martin@ximian.com>
9226 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9228 (MethodCore.DoDefineParameters): Removed the TypeContainer
9229 argument; use the DeclSpace which was passed to the .ctor instead.
9230 (MethodCore.CheckParameter): Take a DeclSpace instead of a
9231 TypeContainer; we only need a DeclSpace here.
9233 2003-10-09 Martin Baulig <martin@ximian.com>
9235 * class.cs (MethodData): Added additional `DeclSpace ds' argument
9237 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9238 EmitContext's .ctor.
9240 2003-10-09 Martin Baulig <martin@ximian.com>
9242 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9243 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9244 AsAccessible(), moved them as well.
9246 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9248 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9250 * cs-parser.jay : Renamed yyName to yyNames related to jay.
9252 2003-10-07 Miguel de Icaza <miguel@ximian.com>
9254 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9255 generation for >=, as spotted by Paolo, bug 48679.
9256 Patch from David Waite.
9258 * cs-tokenizer.cs: Add handling for #pragma.
9260 * cs-parser.jay: Allow for both yield and yield return in the
9261 syntax. The anti-cobolization of C# fight will go on!
9263 * class.cs (TypeBuilder.DefineType): Catch error condition here
9264 (Parent.DefineType erroring out and returning null).
9266 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9267 coping with enumerations variables, we were mistakenly processing
9268 them as a regular value type instead of built-in types. Fixes the
9271 * typemanager.cs (IsBuiltinOrEnum): New method.
9273 2003-09-30 Miguel de Icaza <miguel@ximian.com>
9275 * cs-parser.jay: Upgrade: yield now needs the return clause.
9277 2003-09-19 Martin Baulig <martin@ximian.com>
9279 * decl.cs (MemberCache.SetupCacheForInterface): Take a
9280 `MemberCache parent' argument. Normally, an interface doesn't
9281 have a parent type except System.Object, but we use this in gmcs
9282 for generic type parameters.
9284 2003-09-18 Martin Baulig <martin@ximian.com>
9286 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9287 on `type.IsInterface'; don't check whether the type has a parent
9288 to determine whether it's an interface.
9290 2003-09-15 Martin Baulig <martin@ximian.com>
9292 * class.cs (TypeContainer.DefineType): Added an error flag to
9293 avoid reporting duplicate CS0146's ("class definition is
9296 * driver.cs (Driver.MainDriver): Abort if
9297 RootContext.ResolveTree() reported any errors.
9299 2003-09-07 Martin Baulig <martin@ximian.com>
9301 * report.cs (Error, Warning): Added overloaded versions which take
9302 a `params object[] args' and call String.Format().
9304 2003-09-07 Martin Baulig <martin@ximian.com>
9306 * decl.cs (DeclSpace..ctor): Don't call
9307 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9308 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
9309 (DeclSpace.RecordDecl): New method.
9311 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9313 2003-09-02 Ravi Pratap <ravi@ximian.com>
9315 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9316 value attributes to be applied to ParameterBuilders.
9318 * class.cs (MethodCore.LabelParameters): Make static and more
9319 generic so that it can be used from other places - like interface
9320 methods, for instance.
9322 * interface.cs (Interface.Emit): Call LabelParameters before
9323 emitting attributes on the InterfaceMethod.
9325 2003-08-26 Martin Baulig <martin@ximian.com>
9327 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9328 resolving aliases; fixes #47927.
9330 2003-08-26 Martin Baulig <martin@ximian.com>
9332 * statement.cs (Using.DoResolve): This is internally emitting a
9333 try/finally clause, so we need to set ec.NeedExplicitReturn if we
9334 do not always return. Fixes #47681.
9336 2003-08-26 Martin Baulig <martin@ximian.com>
9338 * decl.cs (MemberCore): Moved WarningNotHiding(),
9339 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9341 (AdditionResult): Make this nested in DeclSpace.
9342 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9343 argument; call NamespaceEntry.Define() unless we're nested in a
9346 * namespace.cs (Namespace.DefineName): New public function. This
9347 is called from DeclSpace's .ctor to add
9348 (Namespace.Lookup): Include DeclSpaces in the lookup.
9350 * class.cs (Operator): Derive from MemberBase, not MemberCore.
9352 * const.cs (Const): Derive from MemberBase, not MemberCore.
9354 2003-08-25 Martin Baulig <martin@ximian.com>
9356 * convert.cs (Convert.ExplicitReferenceConversion): When
9357 converting from an interface type to a class, unbox if the target
9358 type is a struct type. Fixes #47822.
9360 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9362 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9365 2003-08-22 Martin Baulig <martin@ximian.com>
9367 * class.cs (TypeManager.DefineType): When defining a nested type,
9368 call DefineType() on our parent; fixes #47801.
9370 2003-08-22 Martin Baulig <martin@ximian.com>
9372 * class.cs (MethodData.Define): While checking if a method is an
9373 interface implementation, improve the test a bit more to fix #47654.
9375 2003-08-22 Martin Baulig <martin@ximian.com>
9377 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9378 correctly; fixes #47722.
9380 2003-08-22 Martin Baulig <martin@ximian.com>
9382 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9383 LocalVariableReference, ensure it's not read-only. Fixes #47536.
9385 * statement.cs (Fixed.DoResolve): Make all variables read-only.
9387 2003-08-22 Martin Baulig <martin@ximian.com>
9389 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9390 can only be assigned in static constructors. Fixes #47161.
9392 2003-08-22 Martin Baulig <martin@ximian.com>
9394 Rewrote and improved the flow analysis code.
9396 * flowbranching.cs (FlowBranching): Make this class abstract.
9397 (FlowBranching.CreateBranching): New static function to create a
9399 (FlowBranchingBlock, FlowBranchingException): New classes.
9400 (FlowBranching.UsageVector.Type): New public readonly field.
9401 (FlowBranching.UsageVector.Breaks): Removed the setter.
9402 (FlowBranching.UsageVector.Returns): Removed the setter.
9403 (FlowBranching.UsageVector): Added Break(), Return(),
9404 NeverReachable() and Throw() methods to modify the reachability.
9405 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9406 done by FlowBranching.Merge().
9407 (FlowBranching.UsageVector.MergeChild): New method; merges the
9408 merge result into the current vector.
9409 (FlowBranching.Merge): New abstract method to merge a branching.
9411 2003-08-12 Martin Baulig <martin@ximian.com>
9413 * expression.cs (Indirection.CacheTemporaries): Create the
9414 LocalTemporary with the pointer type, not its element type.
9416 2003-08-10 Miguel de Icaza <miguel@ximian.com>
9418 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9419 token was a keyword or not.
9421 Add `error' options where an IDENTIFIER was expected; Provide
9422 CheckToken and CheckIdentifierToken convenience error reporting
9425 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9427 * decl.cs: Rename `NamespaceEntry Namespace' public field into
9428 NameSpaceEntry NameSpaceEntry.
9430 (LookupInterfaceOrClass): Avoid creating a full qualified name
9431 from namespace and name: avoid doing lookups when we know the
9432 namespace is non-existant. Use new Tree.LookupByNamespace which
9433 looks up DeclSpaces based on their namespace, name pair.
9435 * driver.cs: Provide a new `parser verbose' to display the
9436 exception thrown during parsing. This is turned off by default
9437 now, so the output of a failure from mcs is more graceful.
9439 * namespace.cs: Track all the namespaces defined in a hashtable
9442 (IsNamespace): New method
9444 2003-08-09 Miguel de Icaza <miguel@ximian.com>
9446 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
9447 we know that we need to concatenate (full typename can never be
9452 * statement.cs: Use a bitfield; Do not initialize to null things
9453 which are done by the constructor by default.
9455 * cs-parser.jay: bug fix, parameter was 4, not 3.
9457 * expression.cs: Just use the property;
9459 * statement.cs: No need for GetVariableInfo method.
9461 2003-08-08 Martin Baulig <martin@ximian.com>
9463 * flowanalysis.cs (FlowReturns): This is now nested in the
9464 `FlowBranching' class.
9465 (MyBitVector): Moved this here from statement.cs.
9466 (FlowBranching.SiblingType): New enum type.
9467 (FlowBranching.CreateSibling): Added `SiblingType' argument.
9469 2003-08-07 Martin Baulig <martin@ximian.com>
9471 * flowanalysis.cs (FlowBranchingType): This is now nested in the
9472 `FlowBranching' class and called `BranchingType'.
9474 2003-08-07 Martin Baulig <martin@ximian.com>
9476 * flowanalysis.cs: Moved all the control flow analysis code into
9479 2003-08-07 Martin Baulig <martin@ximian.com>
9481 * assign.cs (Assign.DoResolve): `target' must either be an
9482 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
9485 2003-08-07 Miguel de Icaza <miguel@ximian.com>
9487 * expression.cs (BinaryMethod): This kind of expression is created by the
9488 Binary class if it determines that the operator has to be handled
9491 (BinaryDelegate): This kind of expression is created if we are
9492 dealing with a + or - operator on delegates.
9494 (Binary): remove method, argumetns, and DelegateOperator: when
9495 dealing with methods,
9497 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9499 * statement.cs (Block): use bitfields for the three extra booleans
9500 we had in use. Remove unused topblock parameter.
9502 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9504 * assign.cs: Drop extra unneeded tests.
9506 2003-08-06 Miguel de Icaza <miguel@ximian.com>
9508 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9510 * statement.cs (Foreach): Use VariableStorage instead of
9513 * codegen.cs (VariableStorage): New class used by clients that
9514 require a variable stored: locals or fields for variables that
9515 need to live across yield.
9517 Maybe provide a convenience api for EmitThis+EmitLoad?
9519 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9522 2003-08-05 Miguel de Icaza <miguel@ximian.com>
9524 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9525 RemapParameterLValue): New methods that are used to turn a
9526 precomputed FieldInfo into an expression like this:
9530 The idea is to use this instead of making LocalVariableReference
9531 have more than one meaning.
9533 * cs-parser.jay: Add error production to BASE.
9535 * ecore.cs: Deal with TypeManager.GetField returning null, which
9536 is now a valid return value.
9538 (FieldExprNoAddress): New expression for Fields whose address can
9541 * expression.cs (LocalVariableReference): During the resolve
9542 phases, create new expressions if we are in a remapping context.
9543 Remove code that dealt with remapping here.
9545 (ParameterReference): same.
9547 (ProxyInstance): New expression, like the `This' expression, but
9548 it is born fully resolved. We know what we are doing, so remove
9549 the errors that are targeted to user-provided uses of `this'.
9551 * statement.cs (Foreach): our variable is now stored as an
9552 Expression; During resolution, follow the protocol, dont just
9553 assume it will return this.
9555 2003-08-06 Martin Baulig <martin@ximian.com>
9557 * support.cs (SeekableStreamReader.cs): New public class.
9559 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9560 SeekableStreamReader instead of the normal StreamReader.
9562 2003-08-04 Martin Baulig <martin@ximian.com>
9564 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9565 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9566 deambiguate casts and delegate invocations.
9567 (parenthesized_expression): Use the new tokens to ensure this is
9568 not a cast of method invocation.
9570 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9571 when reading a `)' and Deambiguate_CloseParens () was previously
9574 * expression.cs (ParenthesizedExpression): New class. This is
9575 just used for the CS0075 test.
9576 (Binary.DoResolve): Check for CS0075.
9578 2003-07-29 Ravi Pratap <ravi@ximian.com>
9580 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9581 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9582 reference comparison.
9584 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9585 examine the ReturnType for equality - this is necessary in the
9586 cases of implicit and explicit operators whose signature also
9587 includes the return type.
9589 2003-07-26 Miguel de Icaza <miguel@ximian.com>
9591 * namespace.cs: Cache the result of the namespace computation,
9592 instead of computing it every time.
9594 2003-07-24 Miguel de Icaza <miguel@ximian.com>
9596 * decl.cs: Use a global arraylist that we reuse over invocations
9597 to avoid excesive memory consumption. Reduces memory usage on an
9598 mcs compile by one meg (45 average).
9600 * typemanager.cs (LookupTypeReflection): In .NET pointers are
9601 private, work around that.
9603 2003-07-23 Miguel de Icaza <miguel@ximian.com>
9605 * literal.cs (IntLiteral): Define Zero and One static literals.
9607 * cs-parser.jay (integer_literal): use static literals to reduce
9608 memory usage for the most used literals (0, 1 and -1). 211kb
9609 reduced in memory usage.
9611 Replace all calls to `new ArrayList' with `new
9612 ArrayList(4)' which is a good average number for most allocations,
9613 and also requires only 16 bytes of memory for its buffer by
9616 This reduced MCS memory usage in seven megabytes for the RSS after
9619 2003-07-28 Ravi Pratap <ravi@ximian.com>
9621 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9622 handle params methods the correct way by forming only one
9623 applicable set with params and normal methods in them. Earlier we
9624 were looking at params methods only if we found no normal methods
9625 which was not the correct thing to do.
9627 (Invocation.BetterFunction): Take separate arguments indicating
9628 when candidate and the best method are params methods in their
9631 This fixes bugs #43367 and #46199.
9633 * attribute.cs: Documentation updates.
9635 (CheckAttribute): Rename to CheckAttributeTarget.
9636 (GetValidPlaces): Rename to GetValidTargets.
9638 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9639 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9643 2003-07-28 Martin Baulig <martin@ximian.com>
9645 * class.cs (TypeContainer.DefineMembers): Use the base type's full
9646 name when looking up the base class of a nested class. Fixes #46977.
9648 2003-07-26 Martin Baulig <martin@ximian.com>
9650 * expression.cs (Indexers.Indexer): New nested struct; contains
9651 getter, setter and the indexer's type.
9652 (Indexers.Properties): This is now an ArrayList of
9654 (IndexerAccess.DoResolveLValue): Correctly set the type if the
9655 indexer doesn't have any getters.
9657 * assign.cs (Assign.DoResolve): Also do the implicit conversions
9658 for embedded property and indexer assignments.
9660 2003-07-26 Martin Baulig <martin@ximian.com>
9662 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9663 preprocessor directive is not the first non-whitespace character
9666 2003-07-26 Martin Baulig <martin@ximian.com>
9668 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9669 namespace parsing, follow the spec more closely.
9671 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9672 NamespaceEntry.Lookup().
9674 2003-07-25 Martin Baulig <martin@ximian.com>
9676 * MethodCore.cs (OverridesSomething): New public field; it's set
9677 from TypeContainer.DefineMembers if this method overrides
9678 something (which doesn't need to be a method). Fix #39462.
9680 2003-07-25 Ravi Pratap <ravi@ximian.com>
9682 * typemanager.cs (GetMembers): Ensure that the list of members is
9683 reversed. This keeps things in sync.
9685 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9686 find an AttributeUsage attribute.
9688 * expression.cs (Invocation.OverloadResolve): Perform the check
9689 which disallows Invoke to be directly called on a Delegate.
9691 (Error_InvokeOnDelegate): Report error cs1533.
9693 2003-07-25 Martin Baulig <martin@ximian.com>
9695 * expression.cs (Indexers.GetIndexersForType): Only look in the
9696 interface hierarchy if the requested type is already an
9697 interface. Fixes #46788 while keeping #46502 fixed.
9699 2003-07-25 Martin Baulig <martin@ximian.com>
9701 * class.cs (TypeContainer.DefineMembers): Check whether all
9702 readonly fields have been assigned and report warning CS0649 if
9705 * statement.cs (LocalInfo.IsFixed): Always return true if this is
9708 2003-07-24 Ravi Pratap <ravi@ximian.com>
9710 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9711 returned from GetMethods to make things consistent with the
9712 assumptions MCS makes about ordering of methods.
9714 This should comprehensively fix bug #45127 and it does :-)
9716 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9717 ordering is actually reverse.
9719 * Clean up some debug messages I left lying around.
9721 * interface.cs (Populate*): Get rid of code which emits attributes
9722 since the stage in which we emit attributes is the 'Emit' stage,
9723 not the define stage.
9725 (Emit): Move attribute emission for interface members here.
9727 2003-07-22 Ravi Pratap <ravi@ximian.com>
9729 * expression.cs (Invocation.OverloadResolve): Follow the spec more
9730 closely: we eliminate methods in base types when we have an
9731 applicable method in a top-level type.
9733 Please see section 14.5.5.1 for an exact description of what goes
9736 This fixes bug #45127 and a host of other related to corlib compilation.
9738 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9739 array is the method corresponding to the top-level type (this is
9740 because of the changes made to icall.c) so we change this
9743 (MethodGroupExpr.Name): This too.
9745 * typemanager.cs (GetElementType): New method which does the right
9746 thing when compiling corlib.
9748 * everywhere: Make use of the above in the relevant places.
9750 2003-07-22 Martin Baulig <martin@ximian.com>
9752 * cs-parser.jay (invocation_expression): Moved
9753 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9754 `cast_expression', but create a InvocationOrCast which later
9755 resolves to either an Invocation or a Cast.
9757 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9758 method; call this before EmitStatement() to make sure that this
9759 expression can be used as a statement.
9761 * expression.cs (InvocationOrCast): New class; resolves to either
9762 an Invocation or a Cast.
9764 * statement.cs (StatementExpression): Call ResolveStatement() on
9765 the ExpressionStatement before emitting it.
9767 2003-07-21 Martin Baulig <martin@ximian.com>
9769 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9770 `ref' and `out' attributes match; fixes #46220.
9771 (MemberAccess.ResolveMemberAccess): You can't reference a type
9772 through an expression; fixes #33180.
9773 (Indexers.GetIndexersForType): Don't return the indexers from
9774 interfaces the class implements; fixes #46502.
9776 2003-07-21 Martin Baulig <martin@ximian.com>
9778 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9779 CS0661 checks; fixes bug #30442.
9781 2003-07-21 Martin Baulig <martin@ximian.com>
9783 * decl.cs (AdditionResult): Added `Error'.
9785 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9787 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9788 makes cs0031.cs actually work.
9790 2003-07-20 Martin Baulig <martin@ximian.com>
9792 * namespace.cs: Fixed that bug which caused a crash when compiling
9795 2003-07-20 Miguel de Icaza <miguel@ximian.com>
9797 * typemanager.cs (LookupTypeReflection): Never expose types which
9798 are NotPublic, NestedPrivate, NestedAssembly, or
9799 NestedFamANDAssem. We used to return these, and later do a check
9800 that would report a meaningful error, but the problem is that we
9801 would not get the real match, if there was a name override.
9803 2003-07-18 Miguel de Icaza <miguel@ximian.com>
9805 * namespace.cs (Namespace, Name): Do not compute the namespace
9806 name dynamically, compute it in the constructor. This reduced
9807 memory usage by 1697 KB.
9809 * driver.cs: Use --pause to pause at the end.
9811 2003-07-17 Peter Williams <peter@newton.cx>
9813 * Makefile: Change the name of the test target so that it doesn't
9814 conflict with the recursive test target.
9816 2003-07-17 Miguel de Icaza <miguel@ximian.com>
9818 * expression.cs (LocalVariableReference.Emit, EmitAssign,
9819 AddressOf): Do not use EmitThis, that was wrong, use the actual
9822 2003-07-15 Miguel de Icaza <miguel@ximian.com>
9824 * class.cs (MethodData.Define): While checking if a method is an
9825 interface implementation, improve the test: If we are not public
9826 (use new test here: use the computed MethodAttributes directly,
9827 instead of the parsed modifier flags) check if the `implementing'
9828 method comes from an interface or not.
9830 * pending.cs (VerifyPendingMethods): Slightly better error
9833 * makefile: add test target that does the mcs bootstrap.
9835 2003-07-16 Ravi Pratap <ravi@ximian.com>
9837 * interface.cs (Define): Do nothing here since there are no
9838 members to populate etc. Move the attribute emission out of here
9839 since this was just totally the wrong place to put it. Attribute
9840 application happens during the 'Emit' phase, not in the 'Define'
9843 (Emit): Add this method and move the attribute emission here
9845 * rootcontext.cs (EmitCode): Call the Emit method on interface
9848 2003-07-14 Ravi Pratap M <ravi@ximian.com>
9850 * expression.cs (OverloadResolve): Report error only if Location
9851 is not 'Null' which means that there was a probe going on.
9853 2003-07-14 Martin Baulig <martin@ximian.com>
9855 * expression.cs (ConditionalLogicalOperator): New public class to
9856 implement user defined conditional logical operators.
9857 This is section 14.11.2 in the spec and bug #40505.
9859 2003-07-14 Martin Baulig <martin@ximian.com>
9861 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9863 2003-07-14 Martin Baulig <martin@ximian.com>
9865 * codegen.cs (EmitContext.InFixedInitializer): New public field.
9867 * ecore.cs (IVariable.VerifyFixed): New interface method.
9869 * expression.cs (Unary.ResolveOperator): When resolving the `&'
9870 operator, check whether the variable is actually fixed. Fixes bug
9871 #36055. Set a variable definitely assigned when taking its
9872 address as required by the spec.
9874 * statement.cs (LocalInfo.IsFixed): New field.
9875 (LocalInfo.MakePinned): Set `IsFixed' to true.
9877 2003-07-14 Ravi Pratap M <ravi@ximian.com>
9879 * attribute.cs (Attribute.Resolve): While doing a Member lookup
9880 for .ctors, ensure that we only ask for members declared in the
9881 attribute type (BindingFlags.DeclaredOnly).
9885 * expression.cs (Error_WrongNumArguments): Report error 1501
9886 correctly the way CSC does.
9888 2003-07-13 Martin Baulig <martin@ximian.com>
9890 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9891 lookup on the fully qualified name, to make things like "X.X" work
9892 where "X.X" is a fully qualified type name, but we also have a
9893 namespace "X" in the using list. Fixes #41975.
9895 2003-07-13 Martin Baulig <martin@ximian.com>
9897 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9898 function. If we're a CompoundAssign, we need to create an embedded
9899 CompoundAssign, not an embedded Assign.
9900 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9903 2003-07-13 Martin Baulig <martin@ximian.com>
9905 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9906 work to fix bug #46088.
9908 2003-07-13 Ravi Pratap <ravi@ximian.com>
9910 * class.cs (Operator.Emit): Do not emit attributes here - it is
9911 taken care of by the Method class that we delegate too. This takes
9914 2003-07-10 Martin Baulig <martin@ximian.com>
9916 * expression.cs (TypeOfVoid): New class.
9917 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
9919 2003-07-10 Martin Baulig <martin@ximian.com>
9921 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9924 2003-07-10 Martin Baulig <martin@ximian.com>
9926 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9927 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9929 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9931 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9933 2003-07-10 Martin Baulig <martin@ximian.com>
9935 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9936 of decimal. Fixes #42850.
9938 NOTE: I also fixed the created byte blob, but this doesn't work on
9939 the MS runtime and csc never produces any byte blobs for decimal
9942 2003-07-10 Martin Baulig <martin@ximian.com>
9944 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9945 structs; fixes #32068.
9946 (Block.AddChildVariableNames): Fixed #44302.
9948 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9950 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9952 2003-07-07 Miguel de Icaza <miguel@ximian.com>
9954 * attribute.cs: And this test is onger needed.
9956 2003-07-08 Martin Baulig <martin@ximian.com>
9958 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9959 inaccessible types. Fixes #36313.
9961 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9963 * namespace.cs (NamespaceEntry): Create implicit entries for all
9964 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9965 implicit entries for N1.N2 and N1.
9967 2003-07-08 Martin Baulig <martin@ximian.com>
9969 Rewrote the handling of namespaces to fix a lot of the issues
9970 wrt. `using' aliases etc.
9972 * namespace.cs (Namespace): Splitted this class into a
9973 per-assembly `Namespace' and a per-file `NamespaceEntry'.
9975 * typemanager.cs (TypeManager.IsNamespace): Removed.
9976 (TypeManager.ComputeNamespaces): Only compute namespaces from
9977 loaded assemblies here, not the namespaces from the assembly we're
9978 currently compiling.
9980 2003-07-08 Martin Baulig <martin@ximian.com>
9982 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9984 2003-07-07 Miguel de Icaza <miguel@ximian.com>
9986 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9989 I thought about the memory savings here, but LookupTypeReflection
9990 is used under already very constrained scenarios. Compiling
9991 corlib or mcs only exposes one hit, so it would not really reduce
9992 any memory consumption.
9994 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9996 * typemanager.cs: fixes bug #45889 by only adding public types from
9997 other assemblies to the list of known types.
9999 2003-07-07 Miguel de Icaza <miguel@ximian.com>
10001 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10002 on the type we resolved.
10004 2003-07-05 Martin Baulig <martin@ximian.com>
10006 * pending.cs (PendingImplementation.ParentImplements): Don't
10007 create the proxy if the parent is abstract.
10009 * class.cs (TypeContainer.DefineIndexers): Process explicit
10010 interface implementations first. Fixes #37714.
10012 2003-07-04 Miguel de Icaza <miguel@ximian.com>
10014 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10015 defined recursively; but since we modify the input parameters
10016 (left is set to `this' temporarily), we reset this value if the
10017 left_is_explicit is false, which gives the original semantics to
10020 * literal.cs (NullPointer): new class used to represent a null
10021 literal in a pointer context.
10023 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10024 type is a pointer, use a NullPointer object instead of a
10025 NullLiteral. Closes 43687
10027 (ExplicitConversion): Convert pointer values using
10028 the conv opcode to the proper type.
10030 * ecore.cs (New): change ValueTypeVariable property into a method,
10031 that returns whether the valuetype is suitable for being used.
10033 * expression.cs (Binary.DoNumericPromotions): Only return if we
10034 the int constant was a valid uint, and we can return both left and
10035 right as uints. If not, we continue processing, to trigger the
10036 type conversion. This fixes 39018.
10038 * statement.cs (Block.EmitMeta): During constant resolution, set
10039 the CurrentBlock property on the emitcontext, so that we resolve
10040 constants propertly.
10042 2003-07-02 Martin Baulig <martin@ximian.com>
10044 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10045 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10047 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10048 than emitting it here.
10050 * statement.cs: Fixed some more flow analysis bugs.
10052 2003-07-02 Martin Baulig <martin@ximian.com>
10054 * class.cs (MethodData.Define): When implementing interface
10055 methods, set Final unless we're Virtual.
10057 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10058 check work for interface methods.
10060 2003-07-01 Martin Baulig <martin@ximian.com>
10062 * ecore.cs (EmitContext.This): Replaced this property with a
10063 GetThis() method which takes a Location argument. This ensures
10064 that we get the correct error location for a CS0188.
10066 2003-07-01 Miguel de Icaza <miguel@ximian.com>
10068 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10069 ImplicitStandardConversion.
10071 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10073 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
10075 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10078 2003-06-30 Miguel de Icaza <miguel@ximian.com>
10080 * class.cs (Constructor.Define): Turn off initlocals for unsafe
10083 (MethodData.Define): Turn off initlocals for unsafe methods.
10085 2003-06-29 Miguel de Icaza <miguel@ximian.com>
10087 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10088 complete; Fixes #37521.
10090 * delegate.cs: Use Modifiers.TypeAttr to compute the
10091 TypeAttributes, instead of rolling our own. This makes the flags
10092 correct for the delegates.
10094 2003-06-28 Miguel de Icaza <miguel@ximian.com>
10096 * class.cs (Constructor.Define): Set the private flag for static
10097 constructors as well.
10099 * cs-parser.jay (statement_expression): Set the return value to
10100 null, to avoid a crash when we catch an error.
10102 2003-06-24 Miguel de Icaza <miguel@ximian.com>
10104 * cs-parser.jay: Applied patch from Jackson that adds support for
10105 extern and unsafe modifiers to destructor declarations.
10107 * expression.cs: Report error 21 if the user is trying to index a
10110 * driver.cs: Add an error message, suggested by the bug report.
10112 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10113 if we do not have a ": this ()" constructor initializer. Fixes 45149
10115 2003-06-14 Miguel de Icaza <miguel@ximian.com>
10117 * namespace.cs: Add some information to reduce FAQs.
10119 2003-06-13 Miguel de Icaza <miguel@ximian.com>
10121 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10122 underlying enumeration types. Fixes #43915.
10124 * expression.cs: Treat ushort/short as legal values to be used in
10125 bitwise operations.
10127 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10129 * delegate.cs: transfer custom attributes for paramenters from
10130 the delegate declaration to Invoke and BeginInvoke.
10132 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10134 * attribute.cs: handle custom marshalers and emit marshal info
10137 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
10139 * makefile.gnu: Added anonymous.cs to the compiler sources.
10141 2003-05-28 Miguel de Icaza <miguel@ximian.com>
10143 * iterators.cs: Change the name of the proxy class to include two
10146 * cs-parser.jay: Update grammar to include anonymous methods.
10148 * anonymous.cs: new file.
10150 2003-05-27 Miguel de Icaza <miguel@ximian.com>
10152 * class.cs (Field.Define): Add missing test for pointers and
10155 2003-05-27 Ravi Pratap <ravi@ximian.com>
10157 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10158 we use the stobj opcode.
10160 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10161 since it wasn't the correct fix.
10163 It still is puzzling that we are required to use stobj for IntPtr
10164 which seems to be a ValueType.
10166 2003-05-26 Miguel de Icaza <miguel@ximian.com>
10168 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10169 during regular simple name resolution. Now, the trick is that
10170 instead of returning for processing the simplename, we do a
10171 TypeManager.LookupType (ie, a rooted lookup as opposed to a
10172 contextual lookup type). If a match is found, return that, if
10173 not, return for further composition.
10175 This fixes long-standing 30485.
10177 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10178 using the address to initialize an object, do an Stobj instead of
10179 using the regular Stelem.
10181 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10182 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10183 Because if we are a BaseIndexerAccess that value will be true.
10186 * statement.cs (GotoCase.Resolve): Return after reporting an
10187 error, do not attempt to continue.
10189 * expression.cs (PointerArithmetic.Emit): If our operand is a
10190 long, convert our constants to match the operand before
10191 multiplying. Convert to I type before adding. Fixes 43670.
10193 2003-05-14 Ravi Pratap <ravi@ximian.com>
10195 * enum.cs (ImplicitConversionExists) : Rename to
10196 ImplicitEnumConversionExists to remove ambiguity.
10198 * ecore.cs (NullCast): New type of cast expression class which
10199 basically is very similar to EmptyCast with the difference being
10200 it still is a constant since it is used only to cast a null to
10202 (eg. (string) null)
10204 * convert.cs (ImplicitReferenceConversion): When casting a null
10205 literal, we return a NullCast.
10207 * literal.cs (NullLiteralTyped): Remove - I don't see why this
10208 should be around anymore.
10210 The renaming (reported was slightly wrong). Corrections:
10212 ConvertImplicitStandard -> ImplicitConversionStandard
10213 ConvertExplicitStandard -> ExplicitConversionStandard
10215 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10216 before passing them in !
10218 * convert.cs (ImplicitConversionStandard): When comparing for
10219 equal expr and target types, ensure that expr is not a
10222 In general, we must not be checking (expr_type ==
10223 target_type) in the top level conversion methods
10224 (ImplicitConversion, ExplicitConversion etc). This checking is
10225 done in the methods that they delegate to.
10227 2003-05-20 Miguel de Icaza <miguel@ximian.com>
10229 * convert.cs: Move Error_CannotConvertType,
10230 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10231 ImplicitNumericConversion, ImplicitConversionExists,
10232 ImplicitUserConversionExists, StandardConversionExists,
10233 FindMostEncompassedType, FindMostSpecificSource,
10234 FindMostSpecificTarget, ImplicitUserConversion,
10235 ExplicitUserConversion, GetConversionOperators,
10236 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10237 TryImplicitIntConversion, Error_CannotConvertImplicit,
10238 ConvertImplicitRequired, ConvertNumericExplicit,
10239 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10240 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10243 Perform the following renames:
10245 StandardConversionExists -> ImplicitStandardConversionExists
10246 ConvertImplicit -> ImplicitConversion
10247 ConvertImplicitStandard -> ImplicitStandardConversion
10248 TryImplicitIntConversion -> ImplicitIntConversion
10249 ConvertImplicitRequired -> ImplicitConversionRequired
10250 ConvertNumericExplicit -> ExplicitNumericConversion
10251 ConvertReferenceExplicit -> ExplicitReferenceConversion
10252 ConvertExplicit -> ExplicitConversion
10253 ConvertExplicitStandard -> ExplicitStandardConversion
10255 2003-05-19 Martin Baulig <martin@ximian.com>
10257 * statement.cs (TypeInfo.StructInfo): Made this type protected.
10258 (TypeInfo): Added support for structs having structs as fields.
10260 * ecore.cs (FieldExpr): Implement IVariable.
10261 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10262 VariableInfo for the field.
10264 2003-05-18 Martin Baulig <martin@ximian.com>
10266 * expression.cs (This.DoResolve): Report a CS0027 if we're
10267 emitting a field initializer.
10269 2003-05-18 Martin Baulig <martin@ximian.com>
10271 * expression.cs (This.ResolveBase): New public function.
10272 (This.DoResolve): Check for CS0188.
10274 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10277 * ecore.cs (MethodGroupExpr.DoResolve): Set the
10278 `instance_expression' to null if we don't have any non-static
10281 2003-05-18 Martin Baulig <martin@ximian.com>
10283 Reworked the way how local variables and parameters are handled by
10284 the flow analysis code.
10286 * statement.cs (TypeInfo, VariableMap): New public classes.
10287 (VariableInfo): New public class. This is now responsible for
10288 checking whether a variable has been assigned. It is used for
10289 parameters and local variables.
10290 (Block.EmitMeta): Take the InternalParameters as argument; compute
10291 the layout of the flow vectors here.
10292 (Block.LocalMap, Block.ParameterMap): New public properties.
10293 (FlowBranching): The .ctor doesn't get the InternalParameters
10294 anymore since Block.EmitMeta() now computes the layout of the flow
10296 (MyStructInfo): This class is now known as `StructInfo' and nested
10297 in `TypeInfo'; we don't access this directly anymore.
10299 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10300 property and removed IsAssigned(), IsFieldAssigned(),
10301 SetAssigned() and SetFieldAssigned(); we now call them on the
10302 VariableInfo so we don't need to duplicate this code everywhere.
10304 * expression.cs (ParameterReference): Added `Block block' argument
10306 (LocalVariableReference, ParameterReference, This): The new
10307 VariableInfo class is now responsible for all the definite
10310 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10311 IsParameterAssigned, SetParameterAssigned): Removed.
10313 2003-05-18 Martin Baulig <martin@ximian.com>
10315 * typemanager.cs (InitCoreTypes): Try calling
10316 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10317 the 3-args-version. Corlib now also needs our `void_type'.
10318 (GetMethod): Added overloaded version which takes an optional
10319 `bool report_errors' to allow lookups of optional methods.
10321 2003-05-12 Martin Baulig <martin@ximian.com>
10323 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10324 only used for locals and not for parameters.
10326 2003-05-12 Miguel de Icaza <miguel@ximian.com>
10328 * support.cs (InternalParameters.ParameterType): Return the
10329 ExternalType of the parameter.
10331 * parameter.cs (Parameter.ExternalType): drop the two arguments,
10334 2003-05-11 Miguel de Icaza <miguel@ximian.com>
10336 * class.cs (MethodData.Define): Do not set the `newslot' on
10337 interface members, if they are also flagged as "override".
10339 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10340 better code for ++i and i++. This only works for static fields
10341 and local variables.
10343 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10344 want to pull the DeclSpace out of the builder_to_declspace instead
10345 of the TypeBuilder (like in TypeContainer.FindMembers).
10347 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10348 instead of LookupTypeContainer. Fixes the crash on .NET for
10349 looking up interface members.
10351 * const.cs: Create our own emit context during the Definition
10352 stage, so that constants are evaluated in the proper context, when
10353 a recursive definition happens.
10355 2003-05-11 Martin Baulig <martin@ximian.com>
10357 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
10358 new block for a switch section.
10359 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10360 the adding/lookup in the switch block. Fixes #39828.
10362 2003-05-09 Miguel de Icaza <miguel@ximian.com>
10364 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10365 functionality: I needed to convert the data after I had performed
10366 the add/sub operation into the operands type size.
10368 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10369 pass the type for the box operation, otherwise the resulting
10370 object would have been of type object.
10372 (BoxedCast): Add constructor to specify the type to box as.
10374 2003-05-07 Miguel de Icaza <miguel@ximian.com>
10376 * iterators.cs: I was reusing the `count' variable inadvertently,
10377 take steps to not allow this to happen.
10379 2003-05-06 Miguel de Icaza <miguel@ximian.com>
10381 * attribute.cs (Attribute.Resolve): Params attributes are encoded
10382 by creating an array at the point where the params starts and
10383 putting all those arguments there, then adjusting the size of the
10386 2003-05-05 Miguel de Icaza <miguel@ximian.com>
10388 * expression.cs (New.AddressOf): Implement interface
10389 IMemoryLocation. This is used when the `new' operator is used in
10390 the context of an invocation to a method on a value type.
10392 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10395 * namespace.cs: Also check the using aliases here.
10397 * driver.cs: Move the test for using validity after the types have
10398 been entered, so we do a single pass that also includes the using
10401 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10402 in the regular case. CreateSiblingForFinally is doing extra
10405 * attribute.cs (GetAttributeArgumentExpression): Store the result
10406 on an out value, and use the return value to indicate failure
10407 instead of using null (which is a valid return for Constant.GetValue).
10409 * statement.cs: Perform the analysis flow for the increment
10410 portion after the statement, because this will be the real flow of
10411 execution. Fixes #42385
10413 * codegen.cs (EmitContext.EmitArgument,
10414 EmitContext.EmitStoreArgument): New helper functions when the
10415 RemapToProxy flag is set.
10417 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10420 Add support for remapping parameters.
10422 * iterators.cs: Propagate parameter values; Store parameter
10423 values in the proxy classes.
10425 2003-05-04 Miguel de Icaza <miguel@ximian.com>
10427 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
10428 need a proxy reference; I do not know what I was thinking
10430 * cs-parser.jay (constructor_initializer): catch another error,
10431 and display nice message.
10433 (field_declaration): catch void field declaration
10434 to flag a better error.
10436 * class.cs (MemberBase.CheckBase): Report an error instead of a
10437 warning if a new protected member is declared in a struct.
10438 (Field.Define): catch the error of readonly/volatile.
10440 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10442 (FieldExpr.AddressOf): ditto. Catch error where the address of a
10443 volatile variable is taken
10445 2003-05-02 Miguel de Icaza <miguel@ximian.com>
10447 * statement.cs (Fixed.Resolve): Report an error if we are not in
10450 2003-05-01 Miguel de Icaza <miguel@ximian.com>
10452 * typemanager.cs: reuse the code that handles type clashes for
10453 delegates and enumerations.
10455 * class.cs (Report28): Always report.
10457 * expression.cs (EncodeAsAttribute): Allow nulls here.
10459 2003-04-28 Miguel de Icaza <miguel@ximian.com>
10461 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10462 the functionality for testing whether an expression is valid for
10463 an attribute here. Also handle the case of arrays of elements
10466 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10467 encoding a linear array into an array of objects that are suitable
10468 to be passed to an CustomAttributeBuilder.
10470 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10472 * ecore.cs: (FieldExpr): Handle field remapping here.
10474 * iteratators.cs: Pass the instance variable (if the method is an
10475 instance method) to the constructors, so we can access the field
10476 variables on the class.
10478 TODO: Test this with structs. I think the THIS variable on
10479 structs might have to be a pointer, and not a refenrece
10481 2003-04-27 Miguel de Icaza <miguel@ximian.com>
10483 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10484 local variables to fields in a proxy class.
10486 * iterators.cs (PopulateProxy): Rename our internal fields to
10488 Create a <THIS> field if we are an instance method, so we can
10489 reference our parent container variables.
10490 (MapVariable): Called back from the EmitContext code to enter a
10491 new variable to field mapping into the proxy class (we just create
10495 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10496 for using the remapped locals to fields.
10498 I placed the code here, because that gives the same semantics to
10499 local variables, and only changes the Emit code.
10501 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10502 statements inside iterators.
10503 (VariableInfo): Add a FieldBuilder for the cases when we are
10504 remapping local variables to fields in a proxy class
10506 * ecore.cs (SimpleNameResolve): Avoid testing two times for
10507 current_block != null.
10509 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10510 not cope with strings, as it has been moved to the
10511 TableSwitchEmit. Fixed bug in switch generation.
10513 * expression.cs (New.DoResolve): Provide more context for the user
10514 when reporting an error.
10516 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10519 * expression.cs (MemberAccess.DoResolve): When we get a type back,
10520 check the permissions for it. Note than in a type-resolution
10521 context the check was already present in DeclSpace.ResolveType,
10522 but was missing from the MemberAccess.
10524 (ArrayCreation.CheckIndices): warn if the user has
10525 more nested levels of expressions, but there are no more
10526 dimensions specified. Avoids crash on bug 41906.
10528 2003-04-26 Miguel de Icaza <miguel@ximian.com>
10530 * statement.cs (Block): replace Implicit bool, for a generic
10532 New flag: `Unchecked'. This is used during the EmitMeta phase
10533 (which is out-of-line with the regular Resolve/Emit process for a
10534 statement, as this is done ahead of time, but still gets a chance
10535 to call constant resolve).
10537 (Block.Flags): new enum for adding a new flag.
10539 (Block.EmitMeta): track the state of unchecked.
10541 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10542 to enable constant resolution to work there as well.
10544 2003-04-22 Miguel de Icaza <miguel@ximian.com>
10546 * typemanager.cs (ienumerable_type): Also look up
10547 System.Collections.IEnumerable.
10549 2003-04-21 Miguel de Icaza <miguel@ximian.com>
10551 TODO: Test more than one conditional per method.
10553 * class.cs (Indexer.Define): Report the location where the user is
10554 referencing the unsupported feature.
10556 (MethodData): Overload the use of `conditionals' to
10557 minimize the creation of needless ArrayLists. This saves roughly
10558 212kb on my machine.
10560 (Method): Implement the new IIteratorContainer interface.
10561 (Method.SetYields): Implement the method by setting the ModFlags
10562 to contain METHOD_YIELDS.
10564 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10565 which just got set to null.
10567 * iterators.cs: New file.
10569 (Yield, YieldBreak): New statements.
10571 * statement.cs (Return.Resolve): Flag an error if we are used in
10572 an iterator method.
10574 * codegen.cs (InIterator): New flag set if the code is being
10575 compiled in an iterator method.
10577 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
10578 internal modifier, and we just use it to avoid adding extra
10579 fields, as this is seldom used.
10581 * cs-parser.jay: Add yield_statement (yield and yield break).
10583 * driver.cs: New flag -v2 to turn on version 2 features.
10585 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10586 hashtable when v2 is enabled.
10588 2003-04-20 Miguel de Icaza <miguel@ximian.com>
10590 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10591 there is already a namespace defined with this name.
10593 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10594 people upgraded their corlibs.
10596 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10597 always use fully qualified types, no need to use the compiler
10600 (TypeManager.IsNamespace): Use binarysearch.
10602 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10603 AddDelegate): I did not quite use the new IsValid API properly: I
10604 have to pass the short-name and the fullname. I was passing only
10605 the basename instead of the fullname sometimes.
10607 (TypeContainer.DefineType): call NamespaceClash.
10609 * interface.cs (Interface.DefineType): use NamespaceClash before
10612 * delegate.cs (Delegate.DefineType): use NamespaceClash before
10615 * enum.cs: (Enum.DefineType): use NamespaceClash before
10618 * typemanager.cs (: 3-line patch that gives us some tasty 11%
10619 speed increase. First, use the negative_hits cache when we get a
10620 negative. Second, add the type with its full original name
10621 instead of the new . and + encoded name (reflection uses + to
10622 separate type from a nested type). Use LookupTypeReflection
10623 directly which bypasses the type->name hashtable (that we already
10624 know does not contain the type.
10626 * decl.cs (DeclSpace.ResolveTypeExpr): track the
10627 location/container type.
10629 * driver.cs: When passing utf8, use directly the UTF8Encoding.
10631 2003-04-19 Miguel de Icaza <miguel@ximian.com>
10633 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10635 * delegate.cs (NewDelegate.Resolve): Test whether an instance
10636 method is being referenced in the method group from a static
10637 context, and report error 120 if so.
10639 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10642 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10643 is created, we create the A namespace).
10645 * cs-parser.jay: A namespace also introduces a DeclarationFound.
10648 2003-04-18 Miguel de Icaza <miguel@ximian.com>
10650 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10651 invocation to ModuleBuilder.GetType with the same values will
10652 return a new type instance, so we need to cache its return
10655 * expression.cs (Binary.ResolveOperator): Only allow the compare
10656 operators on enums if they are of the same type.
10658 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10659 types of ValueType on their own case. Before we were giving them
10660 the same treatment as objects.
10662 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10663 fullname. Short name is used to compare against container name.
10664 Fullname is used to check against defined namespace names.
10666 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10667 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10669 (Method.CheckBase): Call parent.
10670 (MemberBase.CheckBase): Check for protected members on sealed
10672 (PropertyBase.CheckBase): Call parent.
10673 (Field.Define): Call parent.
10675 * report.cs: Negative error codes are now mapped to 8000 - code,
10676 so that the display is render more nicely.
10678 * typemanager.cs: Do not use try/catch, instead report a regular
10681 (GetPointerType, GetReferenceType): These methods provide
10682 mechanisms to obtain the T* and T& from a T. We had the code
10683 previously scattered around the code base, and it also used
10684 TypeManager.LookupType that would go through plenty of caches.
10685 This one goes directly to the type source.
10687 In some places we did the Type.GetType followed by
10688 ModuleBuilder.GetType, but not in others, so this unifies the
10689 processing as well.
10691 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10692 statements now that we have namespace information.
10694 * typemanager.cs (IsNamespace): New method, returns whether the
10695 string presented is a namespace or not.
10697 (ComputeNamespaces): New public entry point, computes the list of
10698 available namespaces, using the GetNamespaces API call in Mono, or
10699 the slower version in MS.NET.
10701 Now before we start the semantic analysis phase, we have a
10702 complete list of namespaces including everything that the user has
10705 Deleted old code to cache namespaces in .nsc files.
10707 2003-04-17 Miguel de Icaza <miguel@ximian.com>
10709 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10710 class/struct location definition Location for the implicit
10711 constructor location.
10713 (Operator.Define): Use the location of the operator for the
10714 implicit Method definition.
10716 (Constructor.Emit): use the constructor location for the implicit
10717 base initializer constructor.
10719 * ecore.cs: Remove ITypeExpression. This interface is now gone,
10720 and the Expression class now contains two new methods:
10722 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
10723 isolate type lookup from the rest of the resolution process.
10725 Since we use Expressions to hold type definitions due to the way
10726 we parse the input we have historically overloaded Resolve to
10727 perform the Type lookups if a special flag is passed. Now this is
10728 eliminated and two methods take their place.
10730 The differences in the two methods between xStep and xTerminal is
10731 that xStep is involved in our current lookup system that uses
10732 SimpleNames to compose a name, while xTerminal is used just to
10733 catch the case where the simplename lookup failed.
10735 2003-04-16 Miguel de Icaza <miguel@ximian.com>
10737 * expression.cs (ResolveMemberAccess): Remove redundant code.
10738 TypeExpr expressions are always born fully resolved.
10740 * interface.cs (PopulateMethod): Do not lookup the types twice.
10741 We were doing it once during SemanticAnalysis and once during
10744 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10745 in local variable type definitions, were being returned as a
10746 SimpleName (we decomposed everything into a string), that is
10747 because primary_expression was being used instead of a type in the
10748 grammar (reduce/reduce conflicts).
10750 The part that was wrong is that we converted the expression into a
10751 string (an oversimplification in one hand, compounded with primary
10752 expressions doing string concatenation).
10758 Would return "A.B.C[]" as a SimpleName. This stopped things like
10759 using clauses from working on this particular context. And a type
10760 was being matched directly against "A.B.C[]".
10762 We now use the correct approach, and allow for ComposedCast to be
10763 part of the unary expression. So the "A.B.C []" become a composed
10764 cast of "A.B.C" (as a nested group of MemberAccess with a
10765 SimpleName at the end) plus the rank composition "[]".
10769 2003-04-10 Miguel de Icaza <miguel@ximian.com>
10771 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10772 for the access level checking.
10774 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
10775 `TypeContainer container', because I kept getting confused when I
10776 was debugging this code.
10778 * expression.cs (Indexers): Instead of tracking getters/setters,
10779 we now track them in parallel. We create one arraylist less, but
10780 most importantly it is possible now for the LValue code to find a
10781 matching get for a set.
10783 (IndexerAccess.DoResolveLValue): Update the code.
10784 GetIndexersForType has been modified already to extract all the
10785 indexers from a type. The code assumed it did not.
10787 Also make the code set the correct return type for the indexer.
10788 This was fixed a long time ago for properties, but was missing for
10789 indexers. It used to be void_type.
10791 (Binary.Emit): Test first for doubles instead of
10792 floats, as they are more common.
10794 (Binary.EmitBranchable): Use the .un version of the branch opcodes
10795 when dealing with floats and the <=, >= operators. This fixes bug
10798 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10799 to load the array value by emitting a load on the foreach variable
10800 type. This was incorrect.
10802 We now emit the code to load an element using the the array
10803 variable type, and then we emit the conversion operator.
10807 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
10809 * attribute.cs: Avoid allocation of ArrayLists in the common case.
10811 2003-04-09 Miguel de Icaza <miguel@ximian.com>
10813 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10814 test for protection before we test for signatures.
10816 (MethodSignature.ToString): implement.
10818 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10819 to the case where we reduced into a LongConstant.
10821 * decl.cs (CheckAccessLevel): If the type is an array, we can not
10822 depend on whether the information is acurrate, because the
10823 Microsoft runtime will always claim that the array type is public,
10824 regardless of the real state.
10826 If the type is a pointer, another problem happens: the type is
10827 reported as non-public in Microsoft.
10829 In both cases we have to call CheckAccessLevel recursively with
10830 the underlying type as the argument to be tested.
10832 2003-04-08 Miguel de Icaza <miguel@ximian.com>
10834 * assign.cs (Assign.Emit): If we are dealing with a compound
10835 assignment expression, we should use the code path that stores the
10836 intermediate result in a temporary value. This fixes #40903.
10838 *expression.cs (Indirection.ToString): Provide ToString method for
10841 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
10843 * class.cs: Null out fields holding references to Block objects so
10844 they can be garbage collected.
10846 * expression.cs (OverloadResolve): Remove unused local.
10848 2003-04-07 Martin Baulig <martin@ximian.com>
10850 * codegen.cs (EmitContext.CurrentFile): New public field.
10851 (EmitContext.Mark): Use the CurrentFile to check whether the
10852 location is in the correct file.
10853 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10855 2003-04-07 Martin Baulig <martin@ximian.com>
10857 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10859 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10860 location. [FIXME: The location argument which gets passed to this
10861 method is sometimes wrong!]
10863 2003-04-07 Nick Drochak <ndrochak@gol.com>
10865 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10867 2003-04-07 Miguel de Icaza <miguel@ximian.com>
10869 * expression.cs (Indirection.EmitAssign): We were using the
10870 temporary, but returning immediately instead of continuing the
10873 2003-04-06 Martin Baulig <martin@ximian.com>
10875 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10876 if it's a nested child, but also deriving from the outer class.
10879 * typemanager.cs (IsNestedChildOf): Make this work if it's a
10880 nested child, but also deriving from the outer class. See
10882 (FilterWithClosure): We may access private members of the outer
10883 class if we're a nested child and deriving from the outer class.
10884 (RealMemberLookup): Only set `closure_private_ok' if the
10885 `original_bf' contained BindingFlags.NonPublic.
10887 2003-04-05 Martin Baulig <martin@ximian.com>
10889 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10891 2003-04-02 Miguel de Icaza <miguel@ximian.com>
10893 * class.cs (Event.Define): Do not allow abstract events to have
10896 2003-04-01 Miguel de Icaza <miguel@ximian.com>
10898 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10899 block in event declarations.
10901 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10902 value type, get its address.
10904 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10905 leaving a class on the stack instead of a boolean value (int
10906 0/1). Change the code so we compare against null, and then the
10907 result against zero.
10909 * class.cs (TypeContainer.GetClassBases): We were checking for the
10910 parent class being sealed too late.
10912 * expression.cs (Binary.Emit): For <= and >= when dealing with
10913 floating point values, use cgt.un and clt.un instead of cgt and
10916 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
10918 * statement.cs: Apply the same optimization as MS: skip the
10919 GetEnumerator returning an IEnumerator, and use the one returning a
10920 CharEnumerator instead. This allows us to avoid the try-finally block
10923 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
10925 * cs-parser.jay: Attributes cannot be applied to
10926 namespaces. Fixes #40473
10928 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10931 (Add*): check if the name is valid using the full name for constants,
10932 fields, properties and events.
10934 2003-03-28 Miguel de Icaza <miguel@ximian.com>
10936 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10937 char constants to be part of the enumeration.
10939 * expression.cs (Conditional.DoResolve): Add support for operator
10940 true. Implements the missing functionality from 14.12
10942 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10943 operator true/false as required by the spec.
10945 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10946 implicit conversion to boolean.
10948 * statement.cs (Statement.ResolveBoolean): A boolean expression is
10949 also one where the type implements `operator true'.
10951 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10952 get an expression that will invoke operator true based on an
10955 (GetConversionOperators): Removed the hack that called op_True
10958 (Expression.ResolveBoolean): Move this from Statement.
10960 2003-03-17 Miguel de Icaza <miguel@ximian.com>
10962 * ecore.cs (FieldExpr): do not allow initialization of initonly
10963 fields on derived classes
10965 2003-03-13 Martin Baulig <martin@ximian.com>
10967 * statement.cs (Block.Emit): Call ig.BeginScope() and
10968 ig.EndScope() when compiling with debugging info; call
10969 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10971 2003-03-08 Miguel de Icaza <miguel@ximian.com>
10973 * expression.cs (Indexers): Do not construct immediately, allow
10974 for new members to be appended as we go. Fixes 38143
10976 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10978 * expression.cs: save/restore context when resolving an unchecked
10981 2003-03-05 Miguel de Icaza <miguel@ximian.com>
10983 * cfold.cs: Catch division by zero in modulus operator during
10986 2003-03-03 Miguel de Icaza <miguel@ximian.com>
10988 * interface.cs (Interface.DefineMembers): Avoid defining members
10991 2003-02-27 Miguel de Icaza <miguel@ximian.com>
10993 * driver.cs: handle the +/- options for -noconfig
10995 * statement.cs (Unckeched.Resolve): Also track the state of
10996 unchecked in the Resolve phase.
10998 2003-02-27 Martin Baulig <martin@ximian.com>
11000 * ecore.cs (Expression.MemberLookup): Don't create a
11001 MethodGroupExpr for something which is not a method. Fixes #38291.
11003 2003-02-25 Miguel de Icaza <miguel@ximian.com>
11005 * class.cs (MemberBase.CheckParameters): Also check that the type
11006 is unmanaged if it is a pointer.
11008 * expression.cs (SizeOf.Resolve): Add location information.
11010 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11011 a managed type is declared.
11013 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11014 parameter modifiers as well. Fixes bug 38606
11016 * class.cs: Very sad. Am backing out the speed up changes
11017 introduced by the ArrayList -> Array in the TypeContainer, as they
11018 were not actually that much faster, and introduced a bug (no error
11019 reports on duplicated methods).
11021 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11022 source first, this will guarantee that we have a valid expression
11023 before calling in lower levels functions that will require a
11024 resolved object. Then use this original_source in the
11025 target.ResolveLValue instead of the original source that was
11028 Another change. Use target.Resolve instead of LValueResolve.
11029 Although we are resolving for LValues, we will let the Assign code
11030 take care of that (it will be called again from Resolve). This
11031 basically allows code like this:
11033 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11034 class Y { void A (X x) { x [0] += o; }
11036 The problem was that the indexer was trying to resolve for
11037 set_Item (idx, object o) and never finding one. The real set_Item
11038 was set_Item (idx, X). By delaying the process we get the right
11043 2003-02-23 Martin Baulig <martin@ximian.com>
11045 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11046 while calling DoEmit ().
11048 * codegen.cs (EmitContext.Mark): Don't mark locations in other
11049 source files; if you use the #line directive inside a method, the
11050 compiler stops emitting line numbers for the debugger until it
11051 reaches the end of the method or another #line directive which
11052 restores the original file.
11054 2003-02-23 Martin Baulig <martin@ximian.com>
11056 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11058 2003-02-23 Martin Baulig <martin@ximian.com>
11060 * statement.cs (Block.AddChildVariableNames): We need to call this
11061 recursively, not just for our immediate children.
11063 2003-02-23 Martin Baulig <martin@ximian.com>
11065 * class.cs (Event.Define): Always make the field private, like csc does.
11067 * typemanager.cs (TypeManager.RealMemberLookup): Make events
11068 actually work, fixes bug #37521.
11070 2003-02-23 Miguel de Icaza <miguel@ximian.com>
11072 * delegate.cs: When creating the various temporary "Parameters"
11073 classes, make sure that we call the ComputeAndDefineParameterTypes
11074 on those new parameters (just like we do with the formal ones), to
11075 allow them to be resolved in the context of the DeclSpace.
11077 This fixes the bug that Dick observed in Bugzilla #38530.
11079 2003-02-22 Miguel de Icaza <miguel@ximian.com>
11081 * expression.cs (ResolveMemberAccess): When resolving a constant,
11082 do not attempt to pull a constant if the value was not able to
11083 generate a valid constant.
11085 * const.cs (LookupConstantValue): Do not report more errors than required.
11087 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11089 * expression.cs: fixes bug #38328.
11091 2003-02-18 Miguel de Icaza <miguel@ximian.com>
11093 * class.cs: Changed all the various members that can be part of a
11094 class from being an ArrayList to be an Array of the right type.
11095 During the DefineType type_list, interface_list, delegate_list and
11096 enum_list are turned into types, interfaces, delegates and enums
11099 And during the member population, indexer_list, event_list,
11100 constant_list, field_list, instance_constructor_list, method_list,
11101 operator_list and property_list are turned into their real arrays.
11103 Although we could probably perform this operation earlier, for
11104 good error reporting we need to keep the lists and remove the
11105 lists for longer than required.
11107 This optimization was triggered by Paolo profiling the compiler
11108 speed on the output of `gen-sample-program.pl' perl script.
11110 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11111 not crash in methods like MemberLookupFailed that use this field.
11113 This problem arises when the compiler fails to resolve a type
11114 during interface type definition for example.
11116 2003-02-18 Miguel de Icaza <miguel@ximian.com>
11118 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11119 inherit from System.Object, so we have to stop at null, not only
11120 when reaching System.Object.
11122 2003-02-17 Miguel de Icaza <miguel@ximian.com>
11124 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11125 DeclaredOnly because the parent indexer might have had a different
11126 name, but did not loop until the top of the hierarchy was reached.
11128 The problem this one fixes is 35492: when a class implemented an
11129 indexer from an interface, we were getting the interface method
11130 (which was abstract) and we were flagging an error (can not invoke
11133 This also keeps bug 33089 functioning, and test-148 functioning.
11135 * typemanager.cs (IsSpecialMethod): The correct way of figuring
11136 out if a method is special is to see if it is declared in a
11137 property or event, or whether it is one of the predefined operator
11138 names. This should fix correctly #36804.
11140 2003-02-15 Miguel de Icaza <miguel@ximian.com>
11142 The goal here is to remove the dependency on EmptyCast.Peel ().
11143 Killing it completely.
11145 The problem is that currently in a number of places where
11146 constants are expected, we have to "probe" for an EmptyCast, and
11147 Peel, which is not the correct thing to do, as this will be
11148 repetitive and will likely lead to errors.
11150 The idea is to remove any EmptyCasts that are used in casts that
11151 can be reduced to constants, so we only have to cope with
11154 This bug hunt was triggered by Bug 37363 and the desire to remove
11155 the duplicate pattern where we were "peeling" emptycasts to check
11156 whether they were constants. Now constants will always be
11159 * ecore.cs: Use an enumconstant here instead of wrapping with
11162 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11163 throwing me off. By handling this we can get rid of a few hacks.
11165 * statement.cs (Switch): Removed Peel() code.
11167 2003-02-14 Miguel de Icaza <miguel@ximian.com>
11169 * class.cs: Location information for error 508
11171 * expression.cs (New.DoResolve): Add a guard against double
11172 resolution of an expression.
11174 The New DoResolve might be called twice when initializing field
11175 expressions (see EmitFieldInitializers, the call to
11176 GetInitializerExpression will perform a resolve on the expression,
11177 and later the assign will trigger another resolution
11179 This leads to bugs (#37014)
11181 * delegate.cs: The signature for EndInvoke should contain any ref
11182 or out parameters as well. We were not doing this in the past.
11184 * class.cs (Field.Define): Do not overwrite the type definition
11185 inside the `volatile' group. Turns out that volatile enumerations
11186 were changing the type here to perform a validity test, which
11189 2003-02-12 Miguel de Icaza <miguel@ximian.com>
11191 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11192 and structs, we do not want to load the instance variable
11194 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11195 enum_type has to be handled like an object reference (implicit
11196 conversions exists from this to object), but the regular IsClass
11197 and IsValueType tests will never return true for this one.
11199 Also we use TypeManager.IsValueType instead of type.IsValueType,
11200 just for consistency with the rest of the code (this is only
11201 needed if we ever use the construct exposed by test-180.cs inside
11202 corlib, which we dont today).
11204 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
11206 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11209 2003-02-09 Martin Baulig <martin@ximian.com>
11211 * namespace.cs (Namespace..ctor): Added SourceFile argument.
11212 (Namespace.DefineNamespaces): New static public method; this is
11213 called when we're compiling with debugging to add all namespaces
11214 to the symbol file.
11216 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11217 pass it to the Namespace's .ctor.
11219 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11220 and MethodBase arguments; pass the namespace ID to the symwriter;
11221 pass the MethodBase instead of the token to the symwriter.
11222 (SymbolWriter.DefineNamespace): New method to add a namespace to
11225 2003-02-09 Martin Baulig <martin@ximian.com>
11227 * symbolwriter.cs: New file. This is a wrapper around
11228 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
11229 methods here in near future.
11231 2003-02-09 Martin Baulig <martin@ximian.com>
11233 * codegen.cs (EmitContext.Mark): Just pass the arguments to
11234 ILGenerator.MarkSequencePoint() which are actually used by the
11237 2003-02-09 Martin Baulig <martin@ximian.com>
11239 * location.cs (SourceFile): New public sealed class. This
11240 contains the name and an index which is used in the location's token.
11241 (Location): Reserve an appropriate number of bits in the token for
11242 the source file instead of walking over that list, this gives us a
11243 really huge performance improvement when compiling with debugging.
11245 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11246 `SourceFile' argument instead of a string.
11247 (Driver.ProcessFile): Add all the files via Location.AddFile(),
11248 but don't parse/tokenize here, we need to generate the list of all
11249 source files before we do that.
11250 (Driver.ProcessFiles): New static function. Parses/tokenizes all
11253 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11254 instead of a string.
11256 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11259 2003-02-09 Martin Baulig <martin@ximian.com>
11261 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11262 filename on `#line default'.
11264 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11266 * statement.cs: don't clear the pinned var when the fixed statement
11267 returns from the method (fixes bug#37752).
11269 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11271 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
11274 2003-02-07 Martin Baulig <martin@ximian.com>
11276 * driver.cs: Removed the `--debug-args' command line argument.
11278 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11279 automatically by the AsssemblyBuilder.
11280 (CodeGen.InitializeSymbolWriter): We don't need to call any
11281 initialization function on the symbol writer anymore. This method
11282 doesn't take any arguments.
11284 2003-02-03 Miguel de Icaza <miguel@ximian.com>
11286 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11287 from referenced assemblies as well.
11289 2003-02-02 Martin Baulig <martin@ximian.com>
11291 * class.cs (MethodData.Emit): Generate debugging info for external methods.
11293 2003-02-02 Martin Baulig <martin@ximian.com>
11295 * class.cs (Constructor.Emit): Open the symbol writer before
11296 emitting the constructor initializer.
11297 (ConstructorInitializer.Emit): Call ec.Mark() to allow
11298 single-stepping through constructor initializers.
11300 2003-01-30 Miguel de Icaza <miguel@ximian.com>
11302 * class.cs: Handle error 549: do not allow virtual methods in
11305 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11307 * decl.cs: Check access levels when resolving types
11309 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11311 * statement.cs: Add parameters and locals set in catch blocks that might
11312 return to set vector
11314 2003-01-29 Miguel de Icaza <miguel@ximian.com>
11316 * class.cs (Operator): Set the SpecialName flags for operators.
11318 * expression.cs (Invocation.DoResolve): Only block calls to
11319 accessors and operators on SpecialName methods.
11321 (Cast.TryReduce): Handle conversions from char constants.
11324 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11326 * statement.cs: small memory and time optimization in FlowBranching.
11328 2003-01-28 Pedro Mart <yoros@wanadoo.es>
11330 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11331 problem that the last fix but in the other sid (Set).
11333 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11334 access when there is no indexer in the hierarchy.
11336 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11338 * class.cs: Combine some if statements.
11340 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11342 * driver.cs: fixed bug #37187.
11344 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
11346 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11347 any indexer, it's needed to build a list with all the indexers in the
11348 hierarchy (AllGetters), else we have problems. Fixes #35653.
11350 2003-01-23 Miguel de Icaza <miguel@ximian.com>
11352 * class.cs (MethodData.Define): It is wrong for an interface
11353 implementation to be static in both cases: explicit and implicit.
11354 We were only handling this in one case.
11356 Improve the if situation there to not have negations.
11358 * class.cs (Field.Define): Turns out that we do not need to check
11359 the unsafe bit on field definition, only on usage. Remove the test.
11361 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11363 * driver.cs: use assembly.Location instead of Codebase (the latest
11364 patch made mcs fail when using MS assemblies).
11366 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
11368 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11369 get the path to *corlib.dll.
11371 2003-01-21 Nick Drochak <ndrochak@gol.com>
11375 * typemanager.cs: Remove compiler warnings
11377 2003-01-20 Duncan Mak <duncan@ximian.com>
11379 * AssemblyInfo.cs: Bump the version number to 0.19.
11381 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11383 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11385 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
11387 * class.cs (Constructor::Emit): Emit debugging info for constructors.
11389 2003-01-17 Miguel de Icaza <miguel@ximian.com>
11391 * cs-parser.jay: Small fix: we were not comparing the constructor
11392 name correctly. Thanks to Zoltan for the initial pointer.
11394 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11396 * cs-tokenizer.cs: Set file name when specified with #line
11398 2003-01-15 Miguel de Icaza <miguel@ximian.com>
11400 * cs-parser.jay: Only perform the constructor checks here if we
11401 are named like the class; This will help provider a better
11402 error. The constructor path is taken when a type definition is
11403 not found, but most likely the user forgot to add the type, so
11404 report that rather than the constructor error.
11406 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11408 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11411 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11413 * cs-parser.jay: Add cleanup call.
11415 2003-01-13 Duncan Mak <duncan@ximian.com>
11417 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11418 consistent with other methods.
11420 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11422 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11424 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11426 * attribute.cs: only set GuidAttr to true when we have a
11429 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11433 * typemanager.cs: fixes to allow mcs compile corlib with the new
11434 Type.IsSubclassOf fix.
11436 2003-01-08 Miguel de Icaza <miguel@ximian.com>
11438 * expression.cs (LocalVariableReference.DoResolve): Classify a
11439 constant as a value, not as a variable. Also, set the type for
11442 * cs-parser.jay (fixed_statement): take a type instead of a
11443 pointer_type, so we can produce a better error message later.
11445 * statement.cs (Fixed.Resolve): Flag types that are not pointers
11448 (For.DoEmit): Make inifinite loops have a
11449 non-conditional branch back.
11451 (Fixed.DoEmit): First populate the pinned variables, then emit the
11452 statement, then clear the variables. Before I was emitting the
11453 code once for each fixed piece.
11456 2003-01-08 Martin Baulig <martin@ximian.com>
11458 * statement.cs (FlowBranching.MergeChild): A break in a
11459 SWITCH_SECTION does not leave a loop. Fixes #36155.
11461 2003-01-08 Martin Baulig <martin@ximian.com>
11463 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11464 lives in the same number space than `param_map'. Fixes #36154.
11466 2003-01-07 Miguel de Icaza <miguel@ximian.com>
11468 * cs-parser.jay (constructor_declaration): Set the
11469 Constructor.ModFlags before probing for it. This makes the
11470 compiler report 514, 515 and 132 (the code was there, but got
11473 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11474 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11475 (GotoCase.Resolve): Set `Returns' to ALWAYS.
11477 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11479 * enum.cs: create the enum static fields using the enum type.
11481 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11483 * class.cs: don't try to create the ParamBuilder for the return
11484 type if it's not needed (and handle it breaking for the ms runtime
11487 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11489 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11491 2002-12-29 Miguel de Icaza <miguel@ximian.com>
11493 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11494 the command. This showed up while compiling the JANET source
11495 code, which used \r as its only newline separator.
11497 2002-12-28 Miguel de Icaza <miguel@ximian.com>
11499 * class.cs (Method.Define): If we are an operator (because it
11500 reuses our code), then set the SpecialName and HideBySig. #36128
11502 2002-12-22 Miguel de Icaza <miguel@ximian.com>
11504 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11505 exception, report error 120 `object reference required'.
11507 * driver.cs: Add --pause option, used during to measure the size
11508 of the process as it goes with --timestamp.
11510 * expression.cs (Invocation.DoResolve): Do not allow methods with
11511 SpecialName to be invoked.
11513 2002-12-21 Miguel de Icaza <miguel@ximian.com>
11515 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11516 number before adding it.
11518 2002-12-21 Ravi Pratap <ravi@ximian.com>
11520 * ecore.cs (StandardImplicitConversion): When in an unsafe
11521 context, we allow conversion between void * to any other pointer
11522 type. This fixes bug #35973.
11524 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11526 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11527 is not thrown when extensionless outputs are used
11529 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11531 * rootcontext.cs: fixed compilation of corlib.
11533 2002-12-19 Miguel de Icaza <miguel@ximian.com>
11535 * attribute.cs (Attributes.Contains): Add new method.
11537 * class.cs (MethodCore.LabelParameters): if the parameter is an
11538 `out' parameter, check that no attribute `[In]' has been passed.
11540 * enum.cs: Handle the `value__' name in an enumeration.
11542 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
11544 * decl.cs: Added special case to allow overrides on "protected
11547 2002-12-18 Ravi Pratap <ravi@ximian.com>
11549 * attribute.cs (Attributes.AddAttributeSection): Rename to this
11550 since it makes much more sense.
11552 (Attributes.ctor): Don't require a Location parameter.
11554 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11556 * attribute.cs (ApplyAttributes): Remove extra Location parameters
11557 since we already have that information per attribute.
11559 * everywhere : make appropriate changes.
11561 * class.cs (LabelParameters): Write the code which actually
11562 applies attributes to the return type. We can't do this on the MS
11563 .NET runtime so we flag a warning in the case an exception is
11566 2002-12-18 Miguel de Icaza <miguel@ximian.com>
11568 * const.cs: Handle implicit null conversions here too.
11570 2002-12-17 Ravi Pratap <ravi@ximian.com>
11572 * class.cs (MethodCore.LabelParameters): Remove the extra
11573 Type [] parameter since it is completely unnecessary. Instead
11574 pass in the method's attributes so that we can extract
11575 the "return" attribute.
11577 2002-12-17 Miguel de Icaza <miguel@ximian.com>
11579 * cs-parser.jay (parse): Use Report.Error to flag errors instead
11580 of ignoring it and letting the compile continue.
11582 * typemanager.cs (ChangeType): use an extra argument to return an
11583 error condition instead of throwing an exception.
11585 2002-12-15 Miguel de Icaza <miguel@ximian.com>
11587 * expression.cs (Unary.TryReduce): mimic the code for the regular
11588 code path. Perform an implicit cast in the cases where we can
11589 implicitly convert to one of the integral types, and then reduce
11590 based on that constant. This fixes bug #35483.
11592 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11594 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11596 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11598 * namespace.cs: fixed bug #35489.
11600 2002-12-12 Miguel de Icaza <miguel@ximian.com>
11602 * class.cs: Remove some dead code.
11604 * cs-parser.jay: Estimate the number of methods needed
11605 (RootContext.MethodCount);
11607 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11608 numbers instead of StringBuilders.
11610 * support.cs (PtrHashtable): Add constructor with initial size;
11611 We can now reduce reallocations of the method table.
11613 2002-12-10 Ravi Pratap <ravi@ximian.com>
11615 * attribute.cs (ApplyAttributes): Keep track of the emitted
11616 attributes on a per-target basis. This fixes bug #35413.
11618 2002-12-10 Miguel de Icaza <miguel@ximian.com>
11620 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11621 default to the Windows 1252 encoding.
11623 (UnixParseOption): Support version, thanks to Alp for the missing
11626 * AssemblyInfo.cs: Add nice assembly information.
11628 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11631 * cs-parser.jay: Allow a trailing comma before the close bracked
11632 in the attribute_section production.
11634 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11635 address of the instance was being taken, I will take this out,
11636 because we take the address of the object immediately here.
11638 2002-12-09 Ravi Pratap <ravi@ximian.com>
11640 * typemanager.cs (AreMultipleAllowed): Take care of the most
11641 obvious case where attribute type is not in the current assembly -
11644 2002-12-08 Miguel de Icaza <miguel@ximian.com>
11646 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11647 definitions, instead of doing that afterwards.
11649 Also we use a nice little hack, depending on the constructor, we
11650 know if we are a "composed" name or a simple name. Hence, we
11651 avoid the IndexOf test, and we avoid
11653 * codegen.cs: Add code to assist in a bug reporter to track down
11654 the source of a compiler crash.
11656 2002-12-07 Ravi Pratap <ravi@ximian.com>
11658 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11659 types have been emitted for a given element and flag an error
11660 if something which does not have AllowMultiple set is used more
11663 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11664 attribute types and their corresponding AllowMultiple properties
11666 (AreMultipleAllowed): Check the property for a given type.
11668 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11669 property in the case we have a TypeContainer.
11671 (Attributes.AddAttribute): Detect duplicates and just skip on
11672 adding them. This trivial fix catches a pretty gross error in our
11673 attribute emission - global attributes were being emitted twice!
11675 Bugzilla bug #33187 is now fixed.
11677 2002-12-06 Miguel de Icaza <miguel@ximian.com>
11679 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11680 instead of pp_and).
11682 * expression.cs (Binary.ResolveOperator): I can only use the
11683 Concat (string, string, string) and Concat (string, string,
11684 string, string) if the child is actually a concatenation of
11687 2002-12-04 Miguel de Icaza <miguel@ximian.com>
11689 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11690 context where we need a 2-character lookahead.
11692 * pending.cs (PendingImplementation): Rework so we can keep track
11693 of interface types all the time, and flag those which were
11694 implemented by parents as optional.
11696 2002-12-03 Miguel de Icaza <miguel@ximian.com>
11698 * expression.cs (Binary.ResolveOperator): Use
11699 String.Concat(string,string,string) or
11700 String.Concat(string,string,string,string) when possible.
11702 * typemanager: More helper methods.
11705 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11707 * pending.cs: remove the bogus return from GetMissingInterfaces()
11708 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11710 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11712 * namespace.cs: avoid duplicated 'using xxx' being added to
11713 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11714 when we get more than one 'using' statement for the same namespace.
11715 Report a CS0105 warning for it.
11717 2002-11-30 Miguel de Icaza <miguel@ximian.com>
11719 * cs-tokenizer.cs (consume_identifier): use read directly, instead
11720 of calling getChar/putback, uses internal knowledge of it.
11722 (xtoken): Reorder tokenizer so most common patterns are checked
11723 first. This reduces the compilation time in another 5% (from 8.11s
11724 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11726 The parsing time is 22% of the compilation in mcs, and from that
11727 64% is spent on the tokenization process.
11729 I tried using a binary search for keywords, but this is slower
11730 than the hashtable. Another option would be to do a couple of
11733 * Not use a StringBuilder, instead use an array of chars,
11734 with a set value. Notice that this way we could catch
11735 the 645 error without having to do it *afterwards*.
11737 * We could write a hand-parser to avoid the hashtable
11738 compares altogether.
11740 The identifier consumption process takes 37% of the tokenization
11741 time. Another 15% is spent on is_number. 56% of the time spent
11742 on is_number is spent on Int64.Parse:
11744 * We could probably choose based on the string length to
11745 use Int32.Parse or Int64.Parse and avoid all the 64-bit
11748 Another 3% is spend on wrapping `xtoken' in the `token' function.
11750 Handle 0xa0 as whitespace (#34752)
11752 2002-11-26 Miguel de Icaza <miguel@ximian.com>
11754 * typemanager.cs (IsCLRType): New routine to tell whether a type
11755 is one of the builtin types.
11757 Maybe it needs to use TypeCodes to be faster. Maybe we could use
11758 typecode in more places instead of doing pointer comparissions.
11759 We could leverage some knowledge about the way the typecodes are
11762 New code to cache namespaces in assemblies, it is currently not
11763 invoked, to be used soon.
11765 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11767 * expression.cs (Binary.ResolveOperator): specially handle
11768 strings, and do not perform user-defined operator overloading for
11771 2002-11-24 Miguel de Icaza <miguel@ximian.com>
11773 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11774 internalcall as it is a pretty simple operation; Avoid whenever
11775 possible to call Char.IsLetter.
11777 (consume_identifier): Cut by half the number of
11778 hashtable calls by merging the is_keyword and GetKeyword behavior.
11780 Do not short-circuit, because if we do, we
11781 report errors (ie, #if false && true would produce an invalid
11785 2002-11-24 Martin Baulig <martin@ximian.com>
11787 * expression.cs (Cast.TryReduce): If we're in checked syntax,
11788 check constant ranges and report a CS0221. Fixes #33186.
11790 2002-11-24 Martin Baulig <martin@ximian.com>
11792 * cs-parser.jay: Make this work for uninitialized variable
11793 declarations in the `for' initializer. Fixes #32416.
11795 2002-11-24 Martin Baulig <martin@ximian.com>
11797 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11798 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
11800 2002-11-24 Martin Baulig <martin@ximian.com>
11802 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11803 argument; if true, we also check for user-defined conversions.
11804 This is only needed if both arguments are of a user-defined type.
11805 Fixes #30443, added test-175.cs.
11806 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11808 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11810 2002-11-24 Martin Baulig <martin@ximian.com>
11812 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11813 function to get the store opcode.
11814 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11815 only emit the Ldelema if the store opcode is Stobj. You must run
11816 both test-34 and test-167 to test this. Fixes #34529.
11818 2002-11-23 Martin Baulig <martin@ximian.com>
11820 * ecore.cs (Expression.MemberLookup): Added additional
11821 `qualifier_type' argument which is used when we're being called
11822 from MemberAccess.DoResolve() and null if we're called from a
11824 (Expression.MemberLookupFailed): New method to report errors; this
11825 does the CS1540 check and reports the correct error message.
11827 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11828 argument for the CS1540 check and redone the way how we're dealing
11829 with private members. See the comment in the source code for details.
11830 (FilterWithClosure): Reverted this back to revision 1.197; renamed
11831 `closure_start_type' to `closure_qualifier_type' and check whether
11832 it's not null. It was not this filter being broken, it was just
11833 being called with the wrong arguments.
11835 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11836 and pass it the correct `qualifier_type'; this also does the error
11839 2002-11-22 Miguel de Icaza <miguel@ximian.com>
11841 * expression.cs (Invocation.EmitParams): If the we are dealing
11842 with a non-built-in value type, load its address as well.
11844 (ArrayCreation): Use a a pretty constant instead
11845 of the hardcoded value 2. Use 6 instead of 2 for the number of
11846 static initializers.
11848 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11849 because they are not really value types, just glorified integers.
11851 * driver.cs: Do not append .exe, the CSC compiler does not do it.
11853 * ecore.cs: Remove redundant code for enumerations, make them use
11854 the same code path as everything else, fixes the casting issue
11855 with enumerations in Windows.Forms.
11857 * attribute.cs: Do only cast to string if it is a string, the
11858 validation happens later.
11860 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11861 people upgrade their corlibs.
11863 * ecore.cs: Oops, enumerations were not following the entire code path
11865 2002-11-21 Miguel de Icaza <miguel@ximian.com>
11867 * typemanager.cs (FilterWithClosure): Commented out the test for
11868 1540 in typemanager.cs, as it has problems when accessing
11869 protected methods from a parent class (see test-174.cs).
11871 * attribute.cs (Attribute.ValidateGuid): new method.
11872 (Attribute.Resolve): Use above.
11874 2002-11-19 Miguel de Icaza <miguel@ximian.com>
11876 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11878 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11879 handling for enumerations, as we only needed the TypeContainer
11880 functionality to begin with (this is required for the fix below to
11881 work for enums that reference constants in a container class for
11884 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11886 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11887 a valid TypeBuilder to perform lookups on.o
11889 * class.cs (InheritableMemberSignatureCompare): Use true in the
11890 call to GetGetMethod and GetSetMethod, because we are comparing
11891 the signature, and we need to get the methods *even* if they are
11894 (PropertyBase.CheckBase): ditto.
11896 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11897 GotoCase.Resolve): Use Peel on EmpytCasts.
11899 * ecore.cs (EmptyCast): drop child, add Peel method.
11901 2002-11-17 Martin Baulig <martin@ximian.com>
11903 * ecore.cs (EmptyCast.Child): New public property.
11905 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11906 label resolved to an EmptyCast. Fixes #34162.
11907 (GotoCase.Resolve): Likewise.
11908 (Block.EmitMeta): Likewise.
11910 2002-11-17 Martin Baulig <martin@ximian.com>
11912 * expression.cs (Invocation.BetterConversion): Prefer int over
11913 uint; short over ushort; long over ulong for integer literals.
11914 Use ImplicitConversionExists instead of StandardConversionExists
11915 since we also need to check for user-defined implicit conversions.
11916 Fixes #34165. Added test-173.cs.
11918 2002-11-16 Martin Baulig <martin@ximian.com>
11920 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11921 with the `true' and `false' literals. Fixes #33151.
11923 2002-11-16 Martin Baulig <martin@ximian.com>
11925 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11926 October 22nd; don't do the cs1540 check for static members.
11928 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11929 now using our own filter here and doing the cs1540 check again.
11931 2002-11-16 Martin Baulig <martin@ximian.com>
11933 * support.cs (InternalParameters): Don't crash if we don't have
11934 any fixed parameters. Fixes #33532.
11936 2002-11-16 Martin Baulig <martin@ximian.com>
11938 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11939 when looking up static methods to make this work on Windows.
11942 2002-11-16 Martin Baulig <martin@ximian.com>
11944 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11945 a setter rather than using PropertyInfo.CanWrite.
11947 2002-11-15 Nick Drochak <ndrochak@gol.com>
11949 * class.cs: Allow acces to block member by subclasses. Fixes build
11952 2002-11-14 Martin Baulig <martin@ximian.com>
11954 * class.cs (Constructor.Emit): Added the extern/block check.
11957 2002-11-14 Martin Baulig <martin@ximian.com>
11959 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11960 iteration while looking for indexers, this is needed because the
11961 indexer may have a different name in our base classes. Fixed the
11962 error reporting (no indexers at all, not get accessor, no
11963 overloaded match). Fixes bug #33089.
11964 (IndexerAccess.DoResolveLValue): Likewise.
11966 2002-11-14 Martin Baulig <martin@ximian.com>
11968 * class.cs (PropertyBase.CheckBase): Make this work for multiple
11969 indexers. Fixes the first part of bug #33089.
11970 (MethodSignature.InheritableMemberSignatureCompare): Added support
11973 2002-11-13 Ravi Pratap <ravi@ximian.com>
11975 * attribute.cs (Attribute.Resolve): Catch the
11976 NullReferenceException and report it since it isn't supposed to
11979 2002-11-12 Miguel de Icaza <miguel@ximian.com>
11981 * expression.cs (Binary.EmitBranchable): Also handle the cases for
11982 LogicalOr and LogicalAnd that can benefit from recursively
11983 handling EmitBranchable. The code now should be nice for Paolo.
11985 2002-11-08 Miguel de Icaza <miguel@ximian.com>
11987 * typemanager.cs (LookupType): Added a negative-hit hashtable for
11988 the Type lookups, as we perform quite a number of lookups on
11989 non-Types. This can be removed once we can deterministically tell
11990 whether we have a type or a namespace in advance.
11992 But this might require special hacks from our corlib.
11996 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11997 and double which avoids a conversion from an integer to a double.
11999 * expression.cs: tiny optimization, avoid calling IsConstant,
12000 because it effectively performs the lookup twice.
12002 2002-11-06 Miguel de Icaza <miguel@ximian.com>
12004 But a bogus return here to keep the semantics of the old code
12005 until the Mono runtime is fixed.
12007 * pending.cs (GetMissingInterfaces): New method used to remove all
12008 the interfaces that are already implemented by our parent
12009 classes from the list of pending methods.
12011 * interface.cs: Add checks for calls after ResolveTypeExpr.
12013 2002-11-05 Miguel de Icaza <miguel@ximian.com>
12015 * class.cs (Class.Emit): Report warning 67: event not used if the
12016 warning level is beyond 3.
12018 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12019 being a NullLiteral.
12021 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12024 * class.cs (TypeContainer.GetClassBases): Cover a missing code
12025 path that might fail if a type can not be resolved.
12027 * expression.cs (Binary.Emit): Emit unsigned versions of the
12030 * driver.cs: use error 5.
12032 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12034 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12036 2002-11-01 Miguel de Icaza <miguel@ximian.com>
12038 * cs-parser.jay (switch_section): A beautiful patch from Martin
12039 Baulig that fixed 33094.
12041 2002-10-31 Miguel de Icaza <miguel@ximian.com>
12043 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12044 Check whether the base is abstract and report an error if so.
12046 * expression.cs (IndexerAccess.DoResolveLValue,
12047 IndexerAccess.DoResolve): ditto.
12049 (Invocation.DoResolve): ditto.
12051 (Invocation.FullMethodDesc): Improve the report string.
12053 * statement.cs (Block): Eliminate IsVariableDefined as it is
12054 basically just a wrapper for GetVariableInfo.
12056 * ecore.cs (SimpleName): Use new
12058 * support.cs (ReflectionParamter.ParameterType): We unwrap the
12059 type, as we return the actual parameter ref/unref state on a
12062 2002-10-30 Miguel de Icaza <miguel@ximian.com>
12064 * support.cs: Return proper flags REF/OUT fixing the previous
12067 * expression.cs: Reverted last patch, that was wrong. Is_ref is
12068 not used to mean `ref' but `ref or out' in ParameterReference
12070 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12071 full type signature instead of calling TypeManger.CSharpName
12074 * support.cs (InternalParameters.ParameterDesc): Do not compare
12075 directly to the modflags, because REF/OUT will actually be bitsets
12078 * delegate.cs (VerifyMethod): Check also the modifiers.
12080 * cs-tokenizer.cs: Fix bug where floating point values with an
12081 exponent where a sign was missing was ignored.
12083 * driver.cs: Allow multiple assemblies to be specified in a single
12086 2002-10-28 Miguel de Icaza <miguel@ximian.com>
12088 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
12089 because identifiers after a parenthesis would end up in this kind
12090 of production, and we needed to desamiguate it for having casts
12093 (UserDefinedType *) xxx
12095 2002-10-24 Miguel de Icaza <miguel@ximian.com>
12097 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12098 we should set on the Bindingflags.NonPublic, but not turn on
12099 private_ok. private_ok controls whether a Private member is
12100 returned (this is chekced on the filter routine), while the
12101 BindingFlags.NonPublic just controls whether private/protected
12102 will be allowed. This fixes the problem part of the problem of
12103 private properties being allowed to be used in derived classes.
12105 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12106 so we can call the children DoResolveLValue method (this will
12107 properly signal errors on lvalue assignments to base properties)
12109 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12110 getter are null, and we have a property info, we know that this
12111 happened because the lookup failed, so we report an error 122 for
12112 protection level violation.
12114 We also silently return if setter and getter are null in the
12115 resolve functions, this condition only happens if we have flagged
12116 the error before. This is the other half of the problem.
12118 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12119 not have accessibility information, that is why we were returning
12120 true in the filter function in typemanager.cs.
12122 To properly report 122 (property is inaccessible because of its
12123 protection level) correctly, we report this error in ResolveAccess
12124 by failing if both the setter and the getter are lacking (ie, the
12127 DoResolve and DoLResolve have been modified to check for both
12128 setter/getter being null and returning silently, the reason being
12129 that I did not want to put the knowledge about this error in upper
12132 int old = Report.Errors;
12133 x = new PropertyExpr (...);
12134 if (old != Report.Errors)
12139 So the property expr is returned, but it is invalid, so the error
12140 will be flagged during the resolve process.
12142 * class.cs: Remove InheritablePropertySignatureCompare from the
12143 class, as we no longer depend on the property signature to compute
12144 whether it is possible to implement a method or not.
12146 The reason is that calling PropertyInfo.GetGetMethod will return
12147 null (in .NET, in Mono it works, and we should change this), in
12148 cases where the Get Method does not exist in that particular
12153 class X { public virtual int A { get { return 1; } } }
12155 class Z : Y { public override int A { get { return 2; } } }
12157 Would fail in Z because the parent (Y) would not have the property
12158 defined. So we avoid this completely now (because the alternative
12159 fix was ugly and slow), and we now depend exclusively on the
12162 (PropertyBase.CheckBase): Use a method-base mechanism to find our
12163 reference method, instead of using the property.
12165 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12166 routines are gone now.
12168 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12169 names, they were incorrectly named.
12171 * cs-tokenizer.cs: Return are more gentle token on failure.
12173 * pending.cs (PendingImplementation.InterfaceMethod): This routine
12174 had an out-of-sync index variable, which caused it to remove from
12175 the list of pending methods the wrong method sometimes.
12177 2002-10-22 Miguel de Icaza <miguel@ximian.com>
12179 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12180 CanWrite, because those refer to this particular instance of the
12181 property, and do not take into account the fact that we can
12182 override single members of a property.
12184 Constructor requires an EmitContext. The resolution process does
12185 not happen here, but we need to compute the accessors before,
12186 because the resolution does not always happen for properties.
12188 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12189 subclass, before we did not update this flag, but we did update
12192 (GetAccessors): Drop this routine, as it did not work in the
12193 presence of partially overwritten set/get methods.
12195 Notice that this broke the cs1540 detection, but that will require
12198 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12202 * driver.cs: issue a warning instead of an error if we don't support
12203 debugging for the platform. Also ignore a couple of errors that may
12204 arise when trying to write the symbols. Undo my previous patch.
12206 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12208 * driver.cs: ignore /debug switch except for Unix platforms.
12210 2002-10-23 Nick Drochak <ndrochak@gol.com>
12212 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12214 2002-10-21 Miguel de Icaza <miguel@ximian.com>
12216 * driver.cs: Do not make mcs-debug conditional, so we do not break
12217 builds that use it.
12219 * statement.cs (UsageVector.MergeChildren): I would like Martin to
12220 review this patch. But basically after all the children variables
12221 have been merged, the value of "Breaks" was not being set to
12222 new_breaks for Switch blocks. I think that it should be set after
12223 it has executed. Currently I set this to the value of new_breaks,
12224 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12225 conservative, but I do not understand this code very well.
12227 I did not break anything in the build, so that is good ;-)
12229 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12231 2002-10-20 Mark Crichton <crichton@gimp.org>
12233 * cfold.cs: Fixed compile blocker. Really fixed it this time.
12235 2002-10-20 Nick Drochak <ndrochak@gol.com>
12237 * cfold.cs: Fixed compile blocker.
12239 2002-10-20 Miguel de Icaza <miguel@ximian.com>
12241 * driver.cs: I was chekcing the key, not the file.
12243 2002-10-19 Ravi Pratap <ravi@ximian.com>
12245 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12246 message that we were generating - we just need to silently return
12249 2002-10-19 Miguel de Icaza <miguel@ximian.com>
12251 * class.cs (Event.Define): Change my previous commit, as this
12252 breaks the debugger. This is a temporary hack, as it seems like
12253 the compiler is generating events incorrectly to begin with.
12255 * expression.cs (Binary.ResolveOperator): Added support for
12256 "U operator - (E x, E y)"
12258 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12261 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12262 init-only variables, but this path did not take into account that
12263 there might be also instance readonly variables. Correct this
12266 This fixes bug 32253
12268 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12271 * driver.cs: Change the extension for modules to `netmodule'
12273 * cs-parser.jay: Improved slightly the location tracking for
12274 the debugger symbols.
12276 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12277 modifiers that were specified instead of the hardcoded value
12278 (FamAndAssem). This was basically ignoring the static modifier,
12279 and others. Fixes 32429.
12281 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12282 fixed a bug in the process (32476)
12284 * expression.cs (ArrayAccess.EmitAssign): Patch from
12285 hwang_rob@yahoo.ca that fixes bug 31834.3
12287 2002-10-18 Miguel de Icaza <miguel@ximian.com>
12289 * driver.cs: Make the module extension .netmodule.
12291 2002-10-16 Miguel de Icaza <miguel@ximian.com>
12293 * driver.cs: Report an error if the resource file is not found
12294 instead of crashing.
12296 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12297 false, like Emit does.
12299 2002-10-16 Nick Drochak <ndrochak@gol.com>
12301 * typemanager.cs: Remove unused private member. Also reported mcs
12302 bug to report this as a warning like csc.
12304 2002-10-15 Martin Baulig <martin@gnome.org>
12306 * statement.cs (Statement.Emit): Made this a virtual method; emits
12307 the line number info and calls DoEmit().
12308 (Statement.DoEmit): New protected abstract method, formerly knows
12309 as Statement.Emit().
12311 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12313 2002-10-11 Miguel de Icaza <miguel@ximian.com>
12315 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12316 have fixed a remaining problem: not every AddXXXX was adding a
12317 fully qualified name.
12319 Now everyone registers a fully qualified name in the DeclSpace as
12320 being defined instead of the partial name.
12322 Downsides: we are slower than we need to be due to the excess
12323 copies and the names being registered this way.
12325 The reason for this is that we currently depend (on the corlib
12326 bootstrap for instance) that types are fully qualified, because
12327 we dump all the types in the namespace, and we should really have
12328 types inserted into the proper namespace, so we can only store the
12329 basenames in the defined_names array.
12331 2002-10-10 Martin Baulig <martin@gnome.org>
12333 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12334 from bug #31834, see the bug report for a testcase which is
12337 2002-10-10 Martin Baulig <martin@gnome.org>
12339 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12340 flow analysis code for this.
12342 * statement.cs (Do, While, For): Tell the flow analysis code about
12344 (FlowBranching.UsageVector): Added support for infinite loops.
12345 (Block.Resolve): Moved the dead code elimination here and use flow
12348 2002-10-09 Miguel de Icaza <miguel@ximian.com>
12350 * class.cs (Field.Define): Catch cycles on struct type
12353 * typemanager.cs (IsUnmanagedtype): Do not recursively check
12354 fields if the fields are static. We only need to check instance
12357 * expression.cs (As.DoResolve): Test for reference type.
12359 * statement.cs (Using.ResolveExpression): Use
12360 ConvertImplicitRequired, not ConvertImplicit which reports an
12362 (Using.ResolveLocalVariableDecls): ditto.
12364 * expression.cs (Binary.ResolveOperator): Report errors in a few
12365 places where we had to.
12367 * typemanager.cs (IsUnmanagedtype): Finish implementation.
12369 2002-10-08 Miguel de Icaza <miguel@ximian.com>
12371 * expression.cs: Use StoreFromPtr instead of extracting the type
12372 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
12374 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12375 an enumeration value to a System.Enum, but System.Enum is not a
12376 value type, but an class type, so we need to box.
12378 (Expression.ConvertExplicit): One codepath could return
12379 errors but not flag them. Fix this. Fixes #31853
12381 * parameter.cs (Resolve): Do not allow void as a parameter type.
12383 2002-10-06 Martin Baulig <martin@gnome.org>
12385 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12386 if it's a class type and not a struct. Fixes #31815.
12388 2002-10-06 Martin Baulig <martin@gnome.org>
12390 * statement.cs: Reworked the flow analysis code a bit to make it
12391 usable for dead code elimination.
12393 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12395 * cs-parser.jay: allow empty source files. Fixes bug #31781.
12397 2002-10-04 Miguel de Icaza <miguel@ximian.com>
12399 * expression.cs (ComposedCast.DoResolveType): A quick workaround
12400 to fix the test 165, will investigate deeper.
12402 2002-10-04 Martin Baulig <martin@gnome.org>
12404 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12405 finally blocks actually work.
12406 (Try.Resolve): We don't need to create a sibling for `finally' if
12407 there is no finally block.
12409 2002-10-04 Martin Baulig <martin@gnome.org>
12411 * class.cs (Constructor.Define): The default accessibility for a
12412 non-default constructor is private, not public.
12414 2002-10-04 Miguel de Icaza <miguel@ximian.com>
12416 * class.cs (Constructor): Make AllowedModifiers public, add
12419 * cs-parser.jay: Perform the modifiers test here, as the
12420 constructor for the Constructor class usually receives a zero
12421 because of the way we create it (first we create, later we
12422 customize, and we were never checking the modifiers).
12424 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12425 is a version of LookupTypeReflection that includes the type-name
12426 cache. This can be used as a fast path for functions that know
12427 the fully qualified name and are only calling into *.GetType() to
12428 obtain a composed type.
12430 This is also used by TypeManager.LookupType during its type
12433 (LookupType): We now also track the real type name, as sometimes
12434 we can get a quey for the real type name from things like
12435 ComposedCast. This fixes bug 31422.
12437 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12438 complete type fullname, it does not have to go through the type
12439 resolution system to obtain the composed version of the type (for
12440 obtaining arrays or pointers).
12442 (Conditional.Emit): Use the EmitBoolExpression to
12443 generate nicer code, as requested by Paolo.
12445 (ArrayCreation.CheckIndices): Use the patch from
12446 hwang_rob@yahoo.ca to validate the array initializers.
12448 2002-10-03 Miguel de Icaza <miguel@ximian.com>
12450 * class.cs (ConstructorInitializer.Emit): simplify code by using
12451 Invocation.EmitCall, and at the same time, fix the bugs in calling
12452 parent constructors that took variable arguments.
12454 * ecore.cs (Expression.ConvertNumericExplicit,
12455 Expression.ImplicitNumericConversion): Remove the code that
12456 manually wrapped decimal (InternalTypeConstructor call is now gone
12459 * expression.cs (Cast.TryReduce): Also handle decimal types when
12460 trying to perform a constant fold on the type.
12462 * typemanager.cs (IsUnmanagedtype): Partially implemented.
12464 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12465 that only turned off an error report, and did nothing else.
12467 2002-10-02 Miguel de Icaza <miguel@ximian.com>
12469 * driver.cs: Handle and ignore /fullpaths
12471 2002-10-01 Miguel de Icaza <miguel@ximian.com>
12473 * expression.cs (Binary.ResolveOperator): Catch the case where
12474 DoNumericPromotions returns true,
12476 (Binary.DoNumericPromotions): Simplify the code, and the tests.
12478 2002-09-27 Miguel de Icaza <miguel@ximian.com>
12480 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12483 2002-09-26 Miguel de Icaza <miguel@ximian.com>
12485 * ecore.cs (ConvertNumericExplicit): It is not enough that the
12486 conversion exists, but it is also required that the conversion be
12487 performed. This manifested in "(Type64Enum) 2".
12489 * class.cs (TypeManager.AddMethod): The fix is not to change
12490 AddEnum, because that one was using a fully qualified name (every
12491 DeclSpace derivative does), but to change the AddMethod routine
12492 that was using an un-namespaced name. This now correctly reports
12493 the duplicated name.
12495 Revert patch until I can properly fix it. The issue
12496 is that we have a shared Type space across all namespaces
12497 currently, which is wrong.
12499 Options include making the Namespace a DeclSpace, and merge
12500 current_namespace/current_container in the parser.
12502 2002-09-25 Miguel de Icaza <miguel@ximian.com>
12504 * cs-parser.jay: Improve error reporting when we get a different
12505 kind of expression in local_variable_type and
12506 local_variable_pointer_type.
12508 Propagate this to avoid missleading errors being reported.
12510 * ecore.cs (ImplicitReferenceConversion): treat
12511 TypeManager.value_type as a target just like object_type. As
12516 Is valid, and needs to result in the int 1 being boxed before it
12517 is assigned to the value type v.
12519 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12520 to validate the enumeration name.
12522 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12523 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
12524 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12526 * ecore.cs (TryImplicitIntConversion): When doing an
12527 implicit-enumeration-conversion, check if the type is 64-bits and
12528 perform a conversion before passing to EnumConstant.
12530 2002-09-23 Miguel de Icaza <miguel@ximian.com>
12532 * decl.cs (Error_AmbiguousTypeReference); New routine used to
12533 report ambiguous type references. Unlike the MS version, we
12534 report what the ambiguity is. Innovation at work ;-)
12536 (DeclSpace.FindType): Require a location argument to
12537 display when we display an ambiguous error.
12539 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12541 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12543 * expression.cs (EmitDynamicInitializers): Apply patch from
12544 hwang_rob@yahoo.ca that fixes the order in which we emit our
12547 2002-09-21 Martin Baulig <martin@gnome.org>
12549 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12550 delegate takes no arguments.
12552 2002-09-20 Miguel de Icaza <miguel@ximian.com>
12554 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12557 * expression.cs: Extract the underlying type.
12559 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12561 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12563 2002-09-19 Miguel de Icaza <miguel@ximian.com>
12565 * class.cs (TypeContainer.DefineType): We can not use the nice
12566 PackingSize with the size set to 1 DefineType method, because it
12567 will not allow us to define the interfaces that the struct
12570 This completes the fixing of bug 27287
12572 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12573 means also structs. This fixes part of the problem.
12574 (Expresion.ImplicitReferenceConversionExists): ditto.
12576 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12577 error if there were no errors reported during the type lookup
12578 process, to avoid duplicates or redundant errors. Without this
12579 you would get an ambiguous errors plus a type not found. We have
12580 beaten the user enough with the first error.
12582 (DeclSparce.FindType): Emit a warning if we have an ambiguous
12585 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12586 during the resolution process, stop the lookup, this avoids
12587 repeated error reports (same error twice).
12589 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12591 * typemanager.cs (LookupType): Redo the type lookup code to match
12592 the needs of System.Reflection.
12594 The issue is that System.Reflection requires references to nested
12595 types to begin with a "+" sign instead of a dot. So toplevel
12596 types look like: "NameSpace.TopLevelClass", and nested ones look
12597 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12600 2002-09-19 Martin Baulig <martin@gnome.org>
12602 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12603 says that a method always returns or always throws an exception,
12604 don't report the CS0161.
12606 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12607 set `Returns = new_returns'.
12609 2002-09-19 Martin Baulig <martin@gnome.org>
12611 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12612 to an enum constant, check for a CS0176.
12614 2002-09-18 Miguel de Icaza <miguel@ximian.com>
12616 * class.cs (TypeContainer.CheckPairedOperators): Now we check
12617 for operators that must be in pairs and report errors.
12619 * ecore.cs (SimpleName.DoResolveType): During the initial type
12620 resolution process, when we define types recursively, we must
12621 check first for types in our current scope before we perform
12622 lookups in the enclosing scopes.
12624 * expression.cs (MakeByteBlob): Handle Decimal blobs.
12626 (Invocation.VerifyArgumentsCompat): Call
12627 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12628 I thought we were supposed to always call this, but there are a
12629 few places in the code where we dont do it.
12631 2002-09-17 Miguel de Icaza <miguel@ximian.com>
12633 * driver.cs: Add support in -linkres and -resource to specify the
12634 name of the identifier.
12636 2002-09-16 Miguel de Icaza <miguel@ximian.com>
12638 * ecore.cs (StandardConversionExists): Sync with the conversion
12639 code: allow anything-* to void* conversions.
12641 (FindMostSpecificSource): Use an Expression argument
12642 instead of a Type, because we might be handed over a Literal which
12643 gets a few more implicit conversions that plain types do not. So
12644 this information was being lost.
12646 Also, we drop the temporary type-holder expression when not
12649 2002-09-17 Martin Baulig <martin@gnome.org>
12651 * class.cs (PropertyBase.CheckBase): Don't check the base class if
12652 this is an explicit interface implementation.
12654 2002-09-17 Martin Baulig <martin@gnome.org>
12656 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12657 different `IndexerName' attributes.
12659 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12660 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12661 virtual CommonResolve().
12663 2002-09-16 Miguel de Icaza <miguel@ximian.com>
12665 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12666 and convert that to the UnderlyingType.
12668 * statement.cs (Foreach.Resolve): Indexers are just like variables
12669 or PropertyAccesses.
12671 * cs-tokenizer.cs (consume_string): Track line numbers and columns
12672 inside quoted strings, we were not doing this before.
12674 2002-09-16 Martin Baulig <martin@gnome.org>
12676 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12677 resolve it. This is needed for the definite assignment check of the
12678 instance expression, fixes bug #29846.
12679 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12681 2002-09-16 Nick Drochak <ndrochak@gol.com>
12683 * parameter.cs: Fix compile error. Cannot reference static member
12684 from an instance object. Is this an mcs bug?
12686 2002-09-14 Martin Baulig <martin@gnome.org>
12688 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12689 multiple times. Fixes bug #30295, added test-166.cs.
12691 2002-09-14 Martin Baulig <martin@gnome.org>
12693 * statement.cs (Block.Emit): Don't emit unreachable code.
12694 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12695 `break' statements.
12696 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12698 2002-09-14 Martin Baulig <martin@gnome.org>
12700 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12703 2002-09-14 Martin Baulig <martin@gnome.org>
12705 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12706 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12707 be false on the ms runtime.
12709 2002-09-13 Martin Baulig <martin@gnome.org>
12711 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12712 the CS0038 error message.
12714 2002-09-12 Miguel de Icaza <miguel@ximian.com>
12716 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12717 constant inside, return it.
12719 2002-09-12 Martin Baulig <martin@gnome.org>
12721 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12722 implicit conversion can be done between enum types.
12724 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12725 check whether an implicit conversion to the current enum's UnderlyingType
12726 exists and report an error if not.
12728 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12729 without debugging support.
12731 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12732 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
12734 2002-09-12 Martin Baulig <martin@gnome.org>
12736 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12738 * ecore.cs (IMemberExpr.DeclaringType): New property.
12739 (SimpleName.SimpleNameResolve): Check whether we're accessing a
12740 nonstatic member of an outer type (CS0038).
12742 2002-09-11 Miguel de Icaza <miguel@ximian.com>
12744 * driver.cs: Activate the using-error detector at warning level
12745 4 (at least for MS-compatible APIs).
12747 * namespace.cs (VerifyUsing): Small buglett fix.
12749 * pending.cs (PendingImplementation): pass the container pointer.
12751 * interface.cs (GetMethods): Allow for recursive definition. Long
12752 term, I would like to move every type to support recursive
12753 definitions, not the current ordering mechanism that we have right
12756 The situation is this: Attributes are handled before interfaces,
12757 so we can apply attributes to interfaces. But some attributes
12758 implement interfaces, we will now handle the simple cases
12759 (recursive definitions will just get an error).
12761 * parameter.cs: Only invalidate types at the end if we fail to
12764 2002-09-09 Martin Baulig <martin@gnome.org>
12766 * ecore.cs (PropertyExpr.Emit): Also check for
12767 TypeManager.system_int_array_get_length so this'll also work when
12768 compiling corlib. Fixes #30003.
12770 2002-09-09 Martin Baulig <martin@gnome.org>
12772 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12773 and throw an exception if we can't get the type's size. Fixed #30040,
12776 2002-09-09 Martin Baulig <martin@gnome.org>
12778 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12780 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12781 context. Fixes bug #30027.
12783 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12784 virtual functions. Fixes bug #30043, added test-164.cs.
12786 2002-09-08 Ravi Pratap <ravi@ximian.com>
12788 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12790 2002-09-08 Nick Drochak <ndrochak@gol.com>
12792 * driver.cs: Use an object to get the windows codepage since it's not a
12795 2002-09-08 Miguel de Icaza <miguel@ximian.com>
12797 * statement.cs (For.Emit): for infinite loops (test == null)
12798 return whether there is a break inside, not always "true".
12800 * namespace.cs (UsingEntry): New struct to hold the name of the
12801 using definition, the location where it is defined, and whether it
12802 has been used in a successful type lookup.
12804 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12809 2002-09-06 Ravi Pratap <ravi@ximian.com>
12811 * attribute.cs : Fix incorrect code which relied on catching
12812 a NullReferenceException to detect a null being passed in
12813 where an object was expected.
12815 2002-09-06 Miguel de Icaza <miguel@ximian.com>
12817 * statement.cs (Try): flag the catch variable as assigned
12819 * expression.cs (Cast): Simplified by using ResolveType instead of
12820 manually resolving.
12822 * statement.cs (Catch): Fix bug by using ResolveType.
12824 2002-09-06 Ravi Pratap <ravi@ximian.com>
12826 * expression.cs (BetterConversion): Special case for when we have
12827 a NullLiteral as the argument and we have to choose between string
12828 and object types - we choose string the way csc does.
12830 * attribute.cs (Attribute.Resolve): Catch the
12831 NullReferenceException and report error #182 since the Mono
12832 runtime no more has the bug and having this exception raised means
12833 we tried to select a constructor which takes an object and is
12836 2002-09-05 Ravi Pratap <ravi@ximian.com>
12838 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12839 message (1502, 1503) when we can't locate a method after overload
12840 resolution. This is much more informative and closes the bug
12843 * interface.cs (PopulateMethod): Return if there are no argument
12844 types. Fixes a NullReferenceException bug.
12846 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12847 expressions too. Previously we were checking only in one place for
12848 positional arguments leaving out named arguments.
12850 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12851 type to the enum type is not allowed. Remove code corresponding to
12854 (ConvertNumericExplicit): Allow explicit conversions from
12855 the underlying type to enum type. This precisely follows the spec
12856 and closes a bug filed by Gonzalo.
12858 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12861 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12863 2002-09-03 Miguel de Icaza <miguel@ximian.com>
12865 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12866 it was important that we stored the right value after the
12867 reduction in `converted'.
12869 2002-09-04 Martin Baulig <martin@gnome.org>
12871 * location.cs (Location.SymbolDocument): Use full pathnames for the
12874 2002-08-30 Miguel de Icaza <miguel@ximian.com>
12876 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12877 of the expression resolve mechanism, because that will catch the
12878 SimpleName error failures.
12880 (Conditional): If we can not resolve the
12881 expression, return, do not crash.
12883 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12886 (location): display token name instead of its number.
12888 2002-08-28 Martin Baulig <martin@gnome.org>
12890 * expression.cs (Binary.ResolveOperator): Don't silently return
12891 but return an error if an operator cannot be applied between two
12894 2002-08-28 Martin Baulig <martin@gnome.org>
12896 * class.cs (Constructor.Define): Set the permission attributes
12897 correctly instead of making all constructors public.
12899 2002-08-28 Martin Baulig <martin@gnome.org>
12901 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12902 for private members before reporting a CS0103; if we find anything,
12905 2002-08-28 Martin Baulig <martin@gnome.org>
12907 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12908 to check whether `closure_start_type == closure_invocation_type',
12909 we also need to check whether `m.DeclaringType == closure_invocation_type'
12910 before bypassing the permission checks. We might be accessing
12911 protected/private members from the base class.
12912 (TypeManager.RealMemberLookup): Only set private_ok if private
12913 members were requested via BindingFlags.NonPublic.
12915 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12917 * expression.cs (MemberAccess.ResolveMemberAccess): Set
12918 MethodGroupExpr.IsExplicitImpl if appropriate.
12919 (Invocation.DoResolve): Don't report the CS0120 for explicit
12920 interface implementations.
12922 2002-08-27 Martin Baulig <martin@gnome.org>
12924 * expression.cs (Invocation.DoResolve): If this is a static
12925 method and we don't have an InstanceExpression, we must report
12928 2002-08-25 Martin Baulig <martin@gnome.org>
12930 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12931 `==' between a valuetype and an object.
12933 2002-08-25 Miguel de Icaza <miguel@ximian.com>
12935 * ecore.cs (TypeExpr): Provide a ToString method.
12937 2002-08-24 Martin Baulig <martin@gnome.org>
12939 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12940 now called proggie.dbg and it's a binary file.
12942 2002-08-23 Martin Baulig <martin@gnome.org>
12944 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12946 2002-08-23 Martin Baulig <martin@gnome.org>
12948 * struct.cs (MyStructInfo.ctor): Make this work with empty
12949 structs; it's not allowed to use foreach() on null.
12951 2002-08-23 Martin Baulig <martin@gnome.org>
12953 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12954 writer the full pathname of the generated assembly.
12956 2002-08-23 Martin Baulig <martin@gnome.org>
12958 * statements.cs (FlowBranching.UsageVector.MergeChildren):
12959 A `finally' block never returns or breaks; improved handling of
12962 2002-08-23 Martin Baulig <martin@gnome.org>
12964 * statement.cs (Throw.Resolve): Allow `throw null'.
12966 2002-08-23 Martin Baulig <martin@gnome.org>
12968 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12969 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12970 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
12971 MemberLookup would return a wrong event if this is an explicit
12972 interface implementation and the class has an event with the same
12975 2002-08-23 Martin Baulig <martin@gnome.org>
12977 * statement.cs (Block.AddChildVariableNames): New public method.
12978 (Block.AddChildVariableName): Likewise.
12979 (Block.IsVariableNameUsedInChildBlock): Likewise.
12980 (Block.AddVariable): Check whether a variable name has already
12981 been used in a child block.
12983 * cs-parser.jay (declare_local_variables): Mark all variable names
12984 from the current block as being used in a child block in the
12987 2002-08-23 Martin Baulig <martin@gnome.org>
12989 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12990 find the symbol writer.
12992 * driver.cs: csc also allows the arguments to /define being
12993 separated by commas, not only by semicolons.
12995 2002-08-23 Martin Baulig <martin@gnome.org>
12997 * interface.cs (Interface.GetMembers): Added static check for events.
12999 2002-08-15 Martin Baulig <martin@gnome.org>
13001 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13002 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13004 * ecore.cs (Expression.MemberLookup): Added documentation and explained
13005 why the MethodData.EmitDestructor() change was necessary.
13007 2002-08-20 Martin Baulig <martin@gnome.org>
13009 * class.cs (TypeContainer.FindMembers): Added static check for events.
13011 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13013 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13014 use Type.GetEvents(), not Type.FindMembers().
13016 2002-08-20 Martin Baulig <martin@gnome.org>
13018 * decl.cs (MemberCache): Added a special method cache which will
13019 be used for method-only searched. This ensures that a method
13020 search will return a MethodInfo with the correct ReflectedType for
13023 2002-08-20 Martin Baulig <martin@gnome.org>
13025 * decl.cs (DeclSpace.FindMembers): Made this public.
13027 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13029 * delegate.cs: fixed build on windows.
13030 [FIXME: Filed as bug #29150: MCS must report these errors.]
13032 2002-08-19 Ravi Pratap <ravi@ximian.com>
13034 * ecore.cs (StandardConversionExists): Return a false
13035 if we are trying to convert the void type to anything else
13036 since that is not allowed.
13038 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13039 we flag error 70 in the event an event is trying to be accessed
13040 directly from outside the declaring type.
13042 2002-08-20 Martin Baulig <martin@gnome.org>
13044 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13045 MemberCache from typemanager.cs to decl.cs.
13047 2002-08-19 Martin Baulig <martin@gnome.org>
13049 * class.cs (TypeContainer): Implement IMemberContainer.
13050 (TypeContainer.DefineMembers): Create the MemberCache.
13051 (TypeContainer.FindMembers): Do better BindingFlags checking; only
13052 return public members if BindingFlags.Public was given, check
13053 whether members are static.
13055 2002-08-16 Martin Baulig <martin@gnome.org>
13057 * decl.cs (DeclSpace.Define): Splitted this in Define and
13058 DefineMembers. DefineMembers is called first and initializes the
13061 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
13062 DefineMembers() on all our DeclSpaces.
13064 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13065 but call DefineMembers() on all nested interfaces. We call their
13066 Define() in our new Define() function.
13068 * interface.cs (Interface): Implement IMemberContainer.
13069 (Interface.Define): Moved all code except the attribute stuf to
13071 (Interface.DefineMembers): Initialize the member cache.
13073 * typemanager.cs (IMemberFinder): Removed this interface, we don't
13074 need this anymore since we can use MemberCache.FindMembers directly.
13076 2002-08-19 Martin Baulig <martin@gnome.org>
13078 * typemanager.cs (MemberCache): When creating the cache for an
13079 interface type, add all inherited members.
13080 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13081 to `out bool used_cache' and documented it.
13082 (TypeManager.MemberLookup): If we already used the cache in the first
13083 iteration, we don't need to do the interfaces check.
13085 2002-08-19 Martin Baulig <martin@gnome.org>
13087 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
13088 here from IMemberFinder and don't implement this interface anymore.
13089 (DeclSpace.MemberCache): Moved here from IMemberFinder.
13091 * typemanager.cs (IMemberFinder): This interface is now only used by
13092 classes which actually support the member cache.
13093 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13094 since we only put DeclSpaces into this Hashtable.
13095 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13096 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13098 2002-08-16 Martin Baulig <martin@gnome.org>
13100 * typemanager.cs (ICachingMemberFinder): Removed.
13101 (IMemberFinder.MemberCache): New property.
13102 (TypeManager.FindMembers): Merged this with RealFindMembers().
13103 This function will never be called from TypeManager.MemberLookup()
13104 so we can't use the cache here, just the IMemberFinder.
13105 (TypeManager.MemberLookup_FindMembers): Check whether the
13106 IMemberFinder has a MemberCache and call the cache's FindMembers
13108 (MemberCache): Rewrote larger parts of this yet another time and
13109 cleaned it up a bit.
13111 2002-08-15 Miguel de Icaza <miguel@ximian.com>
13113 * driver.cs (LoadArgs): Support quoting.
13115 (Usage): Show the CSC-like command line arguments.
13117 Improved a few error messages.
13119 2002-08-15 Martin Baulig <martin@gnome.org>
13121 * typemanager.cs (IMemberContainer.Type): New property.
13122 (IMemberContainer.IsInterface): New property.
13124 The following changes are conditional to BROKEN_RUNTIME, which is
13125 defined at the top of the file.
13127 * typemanager.cs (MemberCache.MemberCache): Don't add the base
13128 class'es members, but add all members from TypeHandle.ObjectType
13129 if we're an interface.
13130 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13131 is the current type.
13132 (MemberCache.CacheEntry.Container): Removed this field.
13133 (TypeHandle.GetMembers): Include inherited members.
13135 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13137 * typemanager.cs: fixed compilation and added a comment on a field that
13140 2002-08-15 Martin Baulig <martin@gnome.org>
13142 * class.cs (ConstructorInitializer.Resolve): In the
13143 Expression.MemberLookup call, use the queried_type as
13146 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13147 declared' attribute, it's always true.
13148 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13149 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13150 temporary wrapper for FindMembers which tells MemberLookup whether
13151 members from the base classes are included in the return value.
13152 This will go away soon.
13153 (TypeManager.MemberLookup): Use this temporary hack here; once the
13154 new MemberCache is completed, we don't need to do the DeclaredOnly
13155 looping here anymore since the MemberCache will take care of this.
13156 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13157 (MemberCache): When creating the MemberCache for a class, get
13158 members from the current class and all its base classes.
13159 (MemberCache.CacheEntry.Container): New field. This is a
13160 temporary hack until the Mono runtime is fixed to distinguish
13161 between ReflectedType and DeclaringType. It allows us to use MCS
13162 with both the MS runtime and the unfixed Mono runtime without
13163 problems and without accecting performance.
13164 (MemberCache.SearchMembers): The DeclaredOnly looping from
13165 TypeManager.MemberLookup is now done here.
13167 2002-08-14 Martin Baulig <martin@gnome.org>
13169 * statement.cs (MyStructInfo.MyStructInfo): Don't call
13170 Type.GetFields on dynamic types but get the fields from the
13171 corresponding TypeContainer.
13172 (MyStructInfo.GetStructInfo): Added check for enum types.
13174 * typemanager.cs (MemberList.IsSynchronized): Implemented.
13175 (MemberList.SyncRoot): Implemented.
13176 (TypeManager.FilterWithClosure): No need to check permissions if
13177 closure_start_type == closure_invocation_type, don't crash if
13178 closure_invocation_type is null.
13180 2002-08-13 Martin Baulig <martin@gnome.org>
13182 Rewrote TypeContainer.FindMembers to use a member cache. This
13183 gives us a speed increase of about 35% for the self-hosting MCS
13184 build and of about 15-20% for the class libs (both on GNU/Linux).
13186 * report.cs (Timer): New class to get enhanced profiling. This
13187 whole class is "TIMER" conditional since it remarkably slows down
13190 * class.cs (MemberList): New class. This is an IList wrapper
13191 which we're now using instead of passing MemberInfo[]'s around to
13192 avoid copying this array unnecessarily.
13193 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13194 (ICachingMemberFinder, IMemberContainer): New interface.
13195 (TypeManager.FilterWithClosure): If `criteria' is null, the name
13196 has already been checked, otherwise use it for the name comparision.
13197 (TypeManager.FindMembers): Renamed to RealMemberFinder and
13198 provided wrapper which tries to use ICachingMemberFinder.FindMembers
13199 if possible. Returns a MemberList, not a MemberInfo [].
13200 (TypeHandle): New class, implements IMemberContainer. We create
13201 one instance of this class per type, it contains a MemberCache
13202 which is used to do the member lookups.
13203 (MemberCache): New class. Each instance of this class contains
13204 all members of a type and a name-based hash table.
13205 (MemberCache.FindMembers): This is our new member lookup
13206 function. First, it looks up all members of the requested name in
13207 the hash table. Then, it walks this list and sorts out all
13208 applicable members and returns them.
13210 2002-08-13 Martin Baulig <martin@gnome.org>
13212 In addition to a nice code cleanup, this gives us a performance
13213 increase of about 1.4% on GNU/Linux - not much, but it's already
13214 half a second for the self-hosting MCS compilation.
13216 * typemanager.cs (IMemberFinder): New interface. It is used by
13217 TypeManager.FindMembers to call FindMembers on a TypeContainer,
13218 Enum, Delegate or Interface.
13219 (TypeManager.finder_to_member_finder): New PtrHashtable.
13220 (TypeManager.finder_to_container): Removed.
13221 (TypeManager.finder_to_delegate): Removed.
13222 (TypeManager.finder_to_interface): Removed.
13223 (TypeManager.finder_to_enum): Removed.
13225 * interface.cs (Interface): Implement IMemberFinder.
13227 * delegate.cs (Delegate): Implement IMemberFinder.
13229 * enum.cs (Enum): Implement IMemberFinder.
13231 * class.cs (TypeContainer): Implement IMemberFinder.
13233 2002-08-12 Martin Baulig <martin@gnome.org>
13235 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13237 2002-08-12 Martin Baulig <martin@gnome.org>
13239 * ecore.cs (ITypeExpression): New interface for expressions which
13241 (TypeExpression): Renamed to TypeLookupExpression.
13242 (Expression.DoResolve): If we're doing a types-only lookup, the
13243 expression must implement the ITypeExpression interface and we
13244 call DoResolveType() on it.
13245 (SimpleName): Implement the new ITypeExpression interface.
13246 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13247 hack, the situation that we're only looking up types can't happen
13248 anymore when this method is called. Moved the type lookup code to
13249 DoResolveType() and call it.
13250 (SimpleName.DoResolveType): This ITypeExpression interface method
13251 is now doing the types-only lookup.
13252 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13253 (ResolveFlags): Added MaskExprClass.
13255 * expression.cs (MemberAccess): Implement the ITypeExpression
13257 (MemberAccess.DoResolve): Added support for a types-only lookup
13258 when we're called via ITypeExpression.DoResolveType().
13259 (ComposedCast): Implement the ITypeExpression interface.
13261 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
13262 Expression.Resolve() with ResolveFlags.Type instead.
13264 2002-08-12 Martin Baulig <martin@gnome.org>
13266 * interface.cs (Interface.Define): Apply attributes.
13268 * attribute.cs (Attribute.ApplyAttributes): Added support for
13269 interface attributes.
13271 2002-08-11 Martin Baulig <martin@gnome.org>
13273 * statement.cs (Block.Emit): Only check the "this" variable if we
13274 do not always throw an exception.
13276 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13277 whether the property has a set accessor.
13279 2002-08-11 Martin Baulig <martin@gnome.org>
13281 Added control flow analysis support for structs.
13283 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13284 with control flow analysis turned off.
13285 (IVariable): New interface.
13286 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13287 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13288 (FieldExpr.DoResolve): Resolve the instance expression with flow
13289 analysis turned off and do the definite assignment check after the
13290 resolving when we know what the expression will resolve to.
13292 * expression.cs (LocalVariableReference, ParameterReference):
13293 Implement the new IVariable interface, only call the flow analysis
13294 code if ec.DoFlowAnalysis is true.
13295 (This): Added constructor which takes a Block argument. Implement
13296 the new IVariable interface.
13297 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13298 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13299 This does the definite assignment checks for struct members.
13301 * class.cs (Constructor.Emit): If this is a non-static `struct'
13302 constructor which doesn't have any initializer, call
13303 Block.AddThisVariable() to tell the flow analysis code that all
13304 struct elements must be initialized before control returns from
13307 * statement.cs (MyStructInfo): New public class.
13308 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13309 argument to this indexer. If non-zero, check an individual struct
13310 member, not the whole struct.
13311 (FlowBranching.CheckOutParameters): Check struct members.
13312 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13313 overloaded versions of these methods which take an additional
13314 `int field_idx' argument to check struct members.
13315 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13316 overloaded versions of these methods which take an additional
13317 `string field_name' argument to check struct member.s
13318 (VariableInfo): Implement the IVariable interface.
13319 (VariableInfo.StructInfo): New public property. Returns the
13320 MyStructInfo instance of the variable if it's a struct or null.
13321 (Block.AddThisVariable): New public method. This is called from
13322 Constructor.Emit() for non-static `struct' constructor which do
13323 not have any initializer. It creates a special variable for the
13324 "this" instance variable which will be checked by the flow
13325 analysis code to ensure that all of the struct's fields are
13326 initialized before control returns from the constructor.
13327 (UsageVector): Added support for struct members. If a
13328 variable/parameter is a struct with N members, we reserve a slot
13329 in the usage vector for each member. A struct is considered fully
13330 initialized if either the struct itself (slot 0) or all its
13331 members are initialized.
13333 2002-08-08 Martin Baulig <martin@gnome.org>
13335 * driver.cs (Driver.MainDriver): Only report an error CS5001
13336 if there were no compilation errors.
13338 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13339 `UnsafeContext' property to determine whether the parent is in
13340 unsafe context rather than checking the parent's ModFlags:
13341 classes nested in an unsafe class are unsafe as well.
13343 2002-08-08 Martin Baulig <martin@gnome.org>
13345 * statement.cs (UsageVector.MergeChildren): Distinguish between
13346 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13347 we return. Added test17() and test18() to test-154.cs.
13349 2002-08-08 Martin Baulig <martin@gnome.org>
13351 * typemanager.cs (TypeManager.FilterWithClosure): If we have
13352 Family access, make sure the invoking type isn't a subclass of the
13353 queried type (that'd be a CS1540).
13355 * ecore.cs (Expression.MemberLookup): Added overloaded version of
13356 this method which takes an additional `Type invocation_type'.
13358 * expression.cs (BaseAccess.DoResolve): Use the base type as
13359 invocation and query type.
13360 (MemberAccess.DoResolve): If the lookup failed and we're about to
13361 report a CS0122, try a lookup with the ec.ContainerType - if this
13362 succeeds, we must report a CS1540.
13364 2002-08-08 Martin Baulig <martin@gnome.org>
13366 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13367 (MethodGroupExpr): Implement the IMemberExpr interface.
13369 * expression (MemberAccess.ResolveMemberAccess): No need to have
13370 any special code for MethodGroupExprs anymore, they're now
13373 2002-08-08 Martin Baulig <martin@gnome.org>
13375 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13376 Family, FamANDAssem and FamORAssem permissions.
13377 (TypeManager.IsSubclassOrNestedChildOf): New public method.
13379 2002-08-08 Martin Baulig <martin@gnome.org>
13381 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13382 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13385 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13387 * driver.cs: implemented /resource option to embed managed resources.
13389 2002-08-07 Martin Baulig <martin@gnome.org>
13391 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13392 (FieldBase.HasFieldInitializer): New public property.
13393 (FieldBase.GetInitializerExpression): New public method. Resolves and
13394 returns the field initializer and makes sure it is only resolved once.
13395 (TypeContainer.EmitFieldInitializers): Call
13396 FieldBase.GetInitializerExpression to get the initializer, this ensures
13397 that it isn't resolved multiple times.
13399 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
13400 the resolving process (SimpleName/MemberLookup) that we're currently
13401 emitting a field initializer (which must not access any instance members,
13402 this is an error CS0236).
13404 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13405 argument, if the `IsFieldInitializer' flag is set, we must report and
13406 error CS0236 and not an error CS0120.
13408 2002-08-07 Martin Baulig <martin@gnome.org>
13410 * ecore.cs (IMemberExpr): New public interface.
13411 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13412 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13413 if the expression is an IMemberExpr.
13415 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13416 to be null, implicitly default to `this' if we're non-static in
13417 this case. Simplified the code a lot by using the new IMemberExpr
13418 interface. Also fixed bug #28176 here.
13420 2002-08-06 Martin Baulig <martin@gnome.org>
13422 * cs-parser.jay (SimpleLookup): Removed. We need to create
13423 ParameterReferences during semantic analysis so that we can do a
13424 type-only search when resolving Cast, TypeOf and SizeOf.
13425 (block): Pass the `current_local_parameters' to the Block's
13428 * class.cs (ConstructorInitializer): Added `Parameters parameters'
13429 argument to the constructor.
13430 (ConstructorInitializer.Resolve): Create a temporary implicit
13431 block with the parameters.
13433 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13434 references here if we aren't doing a type-only search.
13436 * statement.cs (Block): Added constructor which takes a
13437 `Parameters parameters' argument.
13438 (Block.Parameters): New public property.
13440 * support.cs (InternalParameters.Parameters): Renamed `parameters'
13441 to `Parameters' and made it public readonly.
13443 2002-08-06 Martin Baulig <martin@gnome.org>
13445 * ecore.cs (Expression.Warning): Made this public as well.
13447 * report.cs (Report.Debug): Print the contents of collections.
13449 2002-08-06 Martin Baulig <martin@gnome.org>
13451 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
13452 used to tell Resolve() which kinds of expressions it may return.
13453 (Expression.Resolve): Added overloaded version of this method which
13454 takes a `ResolveFlags flags' argument. This can be used to tell
13455 Resolve() which kinds of expressions it may return. Reports a
13457 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13458 ResolveFlags.SimpleName.
13459 (Expression.Error118): Added overloaded version of this method which
13460 takes a `ResolveFlags flags' argument. It uses the flags to determine
13461 which kinds of expressions are allowed.
13463 * expression.cs (Argument.ResolveMethodGroup): New public method.
13464 Resolves an argument, but allows a MethodGroup to be returned.
13465 This is used when invoking a delegate.
13467 * TODO: Updated a bit.
13469 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13471 Fixed compilation with csc.
13473 * ecore.cs: Expression.Error made public. Is this correct? Should
13474 Warning be made public too?
13476 * expression.cs: use ea.Location instead of ea.loc.
13477 [FIXME: Filed as bug #28607: MCS must report these errors.]
13479 2002-08-06 Martin Baulig <martin@gnome.org>
13481 * ecore.cs (Expression.loc): Moved the location here instead of
13482 duplicating it in all derived classes.
13483 (Expression.Location): New public property.
13484 (Expression.Error, Expression.Warning): Made them non-static and
13485 removed the location argument.
13486 (Expression.Warning): Added overloaded version which takes an
13487 `int level' argument.
13488 (Expression.Error118): Make this non-static and removed the
13489 expression and location arguments.
13490 (TypeExpr): Added location argument to the constructor.
13492 * expression.cs (StaticCallExpr): Added location argument to
13494 (Indirection, PointerArithmetic): Likewise.
13495 (CheckedExpr, UnCheckedExpr): Likewise.
13496 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13497 (StringPtr): Likewise.
13500 2002-08-05 Martin Baulig <martin@gnome.org>
13502 * expression.cs (BaseAccess.DoResolve): Actually report errors.
13504 * assign.cs (Assign.DoResolve): Check whether the source
13505 expression is a value or variable.
13507 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13508 while resolving the corresponding blocks.
13510 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13511 an error, don't silently return null.
13513 * statement.cs (Block.AddVariable): Do the error reporting here
13514 and distinguish between CS0128 and CS0136.
13515 (Block.DoResolve): Report all unused labels (warning CS0164).
13516 (LabeledStatement): Pass the location to the constructor.
13517 (LabeledStatement.HasBeenReferenced): New property.
13518 (LabeledStatement.Resolve): Set it to true here.
13520 * statement.cs (Return.Emit): Return success even after reporting
13521 a type mismatch error (CS0126 or CS0127), this is what csc does and
13522 it avoids confusing the users with any consecutive errors.
13524 2002-08-05 Martin Baulig <martin@gnome.org>
13526 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13528 * const.cs (Const.LookupConstantValue): Catch circular definitions.
13530 * expression.cs (MemberAccess.DoResolve): Silently return if an
13531 error has already been reported.
13533 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13534 error has already been reported.
13536 2002-08-05 Martin Baulig <martin@gnome.org>
13538 * statement.cs (UsageVector): Only initialize the `parameters'
13539 vector if we actually have any "out" parameters.
13541 2002-08-05 Martin Baulig <martin@gnome.org>
13543 * expression.cs (Binary.ResolveOperator): When combining delegates,
13544 they must have the same type.
13546 2002-08-05 Martin Baulig <martin@gnome.org>
13548 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13549 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13550 work with the ms runtime and we also don't need it: if we're a
13551 PropertyBuilder and not in the `indexer_arguments' hash, then we
13552 are a property and not an indexer.
13554 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13555 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13556 since the latter one doesn't work with the ms runtime.
13558 2002-08-03 Martin Baulig <martin@gnome.org>
13560 Fixed bugs #27998 and #22735.
13562 * class.cs (Method.IsOperator): New public field.
13563 (Method.CheckBase): Report CS0111 if there's already a method
13564 with the same parameters in the current class. Report CS0508 when
13565 attempting to change the return type of an inherited method.
13566 (MethodData.Emit): Report CS0179 if a method doesn't have a body
13567 and it's not marked abstract or extern.
13568 (PropertyBase): New abstract base class for Property and Indexer.
13569 (PropertyBase.CheckBase): Moved here from Property and made it work
13571 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13572 the same so we can reuse it there.
13573 (Property, Indexer): Derive from PropertyBase.
13574 (MethodSignature.inheritable_property_signature_filter): New delegate
13575 to find properties and indexers.
13577 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13578 argument and improved error reporting.
13580 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13581 EmptyReadOnlyParameters and made it a property.
13583 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13584 version of this method which takes a `PropertyInfo indexer'.
13585 (TypeManager.RegisterIndexer): New method.
13587 * class.cs: Added myself as author of this file :-)
13589 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13591 * class.cs: fixed compilation on windoze.
13593 2002-08-03 Martin Baulig <martin@gnome.org>
13595 * interface.cs (Interface.GetInterfaceBases): Check whether all
13596 base interfaces are at least as accessible than the current one.
13598 * class.cs (TypeContainer.GetClassBases): Check whether base types
13599 are at least as accessible than the current type.
13600 (TypeContainer.AsAccessible): Implemented and made non-static.
13601 (MemberBase.CheckParameters): Report errors if the accessibility
13604 * delegate.cs (Delegate.Delegate): The default visibility is
13605 internal for top-level types and private for nested types.
13606 (Delegate.Define): Report errors if the accessibility checks fail.
13608 * enum.cs (Enum.Enum): The default visibility is internal for
13609 top-level types and private for nested types.
13610 (Enum.DefineType): Compute the correct visibility.
13612 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13613 function which takes a `bool is_toplevel' instead of a TypeContainer.
13615 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13618 2002-08-02 Martin Baulig <martin@gnome.org>
13620 * expression.cs (LocalVariableReferenc): Added constructor which
13621 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13622 (LocalVariableReference.IsReadOnly): New property.
13623 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13624 variable is readonly, use our own readonly flag to do this; you can
13625 use the new constructor to get a writable reference to a read-only
13628 * cs-parser.jay (foreach_statement, using_statement): Get a writable
13629 reference to the local variable.
13631 2002-08-01 Miguel de Icaza <miguel@ximian.com>
13633 * rootcontext.cs (ResolveCore): Also include System.Exception
13635 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13636 we reach an EmptyStatement.
13638 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13641 * expression.cs (Binary.ResolveOperator): Check error result in
13644 use brtrue/brfalse directly and avoid compares to null.
13646 2002-08-02 Martin Baulig <martin@gnome.org>
13648 * class.cs (TypeContainer.Define): Define all nested interfaces here.
13649 Fixes bug #28407, added test-155.cs.
13651 2002-08-01 Martin Baulig <martin@gnome.org>
13653 * class.cs (Event.EmitDefaultMethod): Make this work with static
13654 events. Fixes #28311, added verify-3.cs.
13656 2002-08-01 Martin Baulig <martin@gnome.org>
13658 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13659 `is_disposable' fields.
13660 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13661 `hm.is_disposable' if we're using the collection pattern.
13662 (Foreach.EmitCollectionForeach): Use the correct type for the
13663 enumerator's local variable, only emit the try/finally block if
13664 necessary (fixes #27713).
13666 2002-08-01 Martin Baulig <martin@gnome.org>
13668 * ecore.cs (Expression.report118): Renamed to Error118 and made
13671 * statement.cs (Throw.Resolve): Check whether the expression is of
13672 the correct type (CS0118) and whether the type derives from
13673 System.Exception (CS0155).
13674 (Catch.Resolve): New method. Do the type lookup here and check
13675 whether it derives from System.Exception (CS0155).
13676 (Catch.CatchType, Catch.IsGeneral): New public properties.
13678 * typemanager.cs (TypeManager.exception_type): Added.
13680 2002-07-31 Miguel de Icaza <miguel@ximian.com>
13682 * driver.cs: Updated About function.
13684 2002-07-31 Martin Baulig <martin@gnome.org>
13686 Implemented Control Flow Analysis.
13688 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13689 (EmitContext.CurrentBranching): Added.
13690 (EmitContext.StartFlowBranching): Added.
13691 (EmitContext.EndFlowBranching): Added.
13692 (EmitContext.KillFlowBranching): Added.
13693 (EmitContext.IsVariableAssigned): Added.
13694 (EmitContext.SetVariableAssigned): Added.
13695 (EmitContext.IsParameterAssigned): Added.
13696 (EmitContext.SetParameterAssigned): Added.
13697 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13698 Added control flow analysis stuff here.
13700 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13701 resolve the expression as lvalue.
13702 (LocalVariableReference.DoResolve): Check whether the variable has
13703 already been assigned.
13704 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13705 the parameter as assigned here.
13706 (ParameterReference.DoResolve): Check whether the parameter has already
13708 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13709 expression as lvalue.
13711 * statement.cs (FlowBranching): New class for the flow analysis code.
13712 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13713 (LabeledStatement.IsDefined): New public property.
13714 (LabeledStatement.AddUsageVector): New public method to tell flow
13715 analyis that the label may be reached via a forward jump.
13716 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13718 (VariableInfo.Number): New public field. This is used by flow analysis
13719 to number all locals of a block.
13720 (Block.CountVariables): New public property. This is the number of
13721 local variables in this block (including the locals from all parent
13723 (Block.EmitMeta): Number all the variables.
13725 * statement.cs: Added flow analysis support to all classes.
13727 2002-07-31 Martin Baulig <martin@gnome.org>
13729 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13730 To get debugging messages, compile mcs with /define:MCS_DEBUG and
13731 then use this argument.
13733 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13735 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13736 use this to specify /define options.
13738 2002-07-29 Martin Baulig <martin@gnome.org>
13740 * statement.cs (Fixed): Moved all code that does variable lookups
13741 and resolvings from Emit to Resolve.
13743 * statement.cs (For): Moved all code that does variable lookups
13744 and resolvings from Emit to Resolve.
13746 * statement.cs (Using): Moved all code that does variable lookups
13747 and resolvings from Emit to Resolve.
13749 2002-07-29 Martin Baulig <martin@gnome.org>
13751 * attribute.cs (Attribute.Resolve): Explicitly catch a
13752 System.NullReferenceException when creating the
13753 CustromAttributeBuilder and report a different warning message.
13755 2002-07-29 Martin Baulig <martin@gnome.org>
13757 * support.cs (ParameterData.ParameterName): Added method to
13758 get the name of a parameter.
13760 * typemanager.cs (TypeManager.IsValueType): New public method.
13762 2002-07-29 Martin Baulig <martin@gnome.org>
13764 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
13765 is a flag which specifies that it's either ref or out.
13766 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13767 the out parameter to `out Parameter.Modifier mod', also set the
13768 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13770 * support.cs (InternalParameters.ParameterModifier): Distinguish
13771 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13772 Parameter.Modifier.ISBYREF flag if it's either ref or out.
13774 * expression.cs (Argument.GetParameterModifier): Distinguish
13775 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13776 Parameter.Modifier.ISBYREF flag if it's either ref or out.
13778 2002-07-29 Martin Baulig <martin@gnome.org>
13780 * expression.cs (ParameterReference.ParameterReference): Added
13781 `Location loc' argument to the constructor.
13783 * cs-parser.jay: Pass location to ParameterReference.
13785 2002-07-28 Miguel de Icaza <miguel@ximian.com>
13787 * statement.cs (Try): Initialize the location.
13789 * cs-parser.jay: pass location to Try.
13791 * expression.cs (Unary.Reduce): Change the prototype to return
13792 whether a constant fold could be performed or not. The result is
13793 returned in an out parameters. In the case of Indirection and
13794 AddressOf, we want to perform the full tests.
13796 2002-07-26 Miguel de Icaza <miguel@ximian.com>
13798 * statement.cs (Statement.Emit): Flag dead code.
13800 2002-07-27 Andrew Birkett <andy@nobugs.org>
13802 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13804 2002-07-27 Martin Baulig <martin@gnome.org>
13806 * class.cs (MethodData.Define): Put back call to
13807 TypeManager.AddMethod(), accidentally commented this out.
13809 * report.cs (Debug): New public method to print debugging information,
13810 this is `[Conditional ("DEBUG")]'.
13812 2002-07-26 Martin Baulig <martin@gnome.org>
13814 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13815 (switch_statement): Push the current_block to the switch_stack and
13816 pop it again when we're done with the switch.
13817 (switch_section): The new block is a child of the current_block.
13818 Fixes bug #24007, added test-152.cs.
13820 2002-07-27 Martin Baulig <martin@gnome.org>
13822 * expression.cs (Invocation.EmitArguments): When calling a varargs
13823 function with only its fixed arguments, we need to pass an empty
13826 2002-07-27 Martin Baulig <martin@gnome.org>
13828 Mono 0.13 has been released.
13830 2002-07-25 Miguel de Icaza <miguel@ximian.com>
13832 * driver.cs: Rename --resource to --linkres, because that is what
13833 we do currently, we dont support --resource yet.
13835 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13837 2002-07-25 Martin Baulig <martin@gnome.org>
13839 * class.cs (MethodData): New public class. This is a `method builder'
13840 class for a method or one accessor of a Property/Indexer/Event.
13841 (MethodData.GetMethodFlags): Moved here from MemberBase.
13842 (MethodData.ApplyAttributes): Likewise.
13843 (MethodData.ApplyObsoleteAttribute): Likewise.
13844 (MethodData.ApplyConditionalAttribute): Likewise.
13845 (MethodData.ApplyDllImportAttribute): Likewise.
13846 (MethodData.CheckAbstractAndExternal): Likewise.
13847 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13848 (MethodData.Emit): Formerly known as Method.Emit().
13849 (MemberBase): Moved everything which was specific to a single
13850 accessor/method to MethodData.
13851 (Method): Create a new MethodData and call Define() and Emit() on it.
13852 (Property, Indexer, Event): Create a new MethodData objects for each
13853 accessor and call Define() and Emit() on them.
13855 2002-07-25 Martin Baulig <martin@gnome.org>
13857 Made MethodCore derive from MemberBase to reuse the code from there.
13858 MemberBase now also checks for attributes.
13860 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13861 (MemberBase.GetMethodFlags): Moved here from class Method and marked
13863 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13864 `CallingConventions cc' and `Attributes opt_attrs' arguments.
13865 (MemberBase.ApplyAttributes): New virtual method; applies the
13866 attributes to a method or accessor.
13867 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13868 (MemberBase.ApplyConditionalAttribute): Likewise.
13869 (MemberBase.ApplyDllImportAttribute): Likewise.
13870 (MemberBase.CheckAbstractAndExternal): Likewise.
13871 (MethodCore.ParameterTypes): This is now a property instead of a
13872 method, it's initialized from DoDefineParameters().
13873 (MethodCore.ParameterInfo): Removed the set accessor.
13874 (MethodCore.DoDefineParameters): New protected virtual method to
13875 initialize ParameterTypes and ParameterInfo.
13876 (Method.GetReturnType): We can now simply return the MemberType.
13877 (Method.GetMethodFlags): Override the MemberBase version and add
13878 the conditional flags.
13879 (Method.CheckBase): Moved some code from Define() here, call
13880 DoDefineParameters() here.
13881 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13882 here to avoid some larger code duplication.
13883 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13884 ensure that abstract and external accessors don't declare a body.
13886 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13887 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13888 lookup in the attribute's parent classes, so we need to abort as soon
13889 as we found the first match.
13890 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13891 the attribute has no arguments.
13893 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13896 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13898 * cs-parser.jay: reverted previous patch.
13900 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13902 * cs-parser.jay: fixed bug #22119.
13904 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13906 * attribute.cs: fixed compilation. The error was:
13907 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
13908 be assigned to before control leaves the current method."
13909 [FIXME: Filed as bug #28186: MCS must report this error.]
13911 2002-07-25 Martin Baulig <martin@gnome.org>
13913 * attribute.cs (Attribute.Conditional_GetConditionName): New static
13914 method to pull the condition name ouf of a Conditional attribute.
13915 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13916 the obsolete message and error flag out of an Obsolete attribute.
13918 * class.cs (Method.GetMethodFlags): New public method to get the
13919 TypeManager.MethodFlags for this method.
13920 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13922 (Method.Define): Get and apply the Obsolete and Conditional attributes;
13923 if we're overriding a virtual function, set the new private variable
13924 `parent_method'; call the new TypeManager.AddMethod().
13926 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
13927 the MethodBuilder and the Method in a PtrHashtable.
13928 (TypeManager.builder_to_method): Added for this purpose.
13929 (TypeManager.MethodFlags): Added IsObsoleteError.
13930 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
13931 Obsolete and Conditional arguments in MethodBuilders. If we discover
13932 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13933 the message from the attribute.
13935 2002-07-24 Martin Baulig <martin@gnome.org>
13937 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13938 preprocessor directives, ensure that the argument to #define/#undef is
13939 exactly one identifier and that it's actually an identifier.
13941 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13944 2002-07-24 Martin Baulig <martin@gnome.org>
13946 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13947 initialize it to TypeManager.object_type in the constructor.
13948 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13949 of the `hm.get_current' method if we're using the collection pattern.
13950 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13951 for the explicit conversion to make it work when we're using the collection
13952 pattern and the `Current' property has a different return type than `object'.
13955 2002-07-24 Martin Baulig <martin@gnome.org>
13957 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13958 does not match, but don't report any errors. This method is called in
13959 order for all methods in a MethodGroupExpr until a matching method is
13960 found, so we don't want to bail out if the first method doesn't match.
13961 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13962 matches, report the 123. Fixes #28070.
13964 2002-07-24 Martin Baulig <martin@gnome.org>
13966 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13967 TypeManager.TypeToCoreType() to the top of the method so the
13968 following equality checks will work. Fixes #28107.
13970 2002-07-24 Martin Baulig <martin@gnome.org>
13972 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13973 operand is of type uint, and the other operand is of type sbyte,
13974 short or int, the operands are converted to type long." -
13975 Actually do what this comment already told us. Fixes bug #28106,
13978 2002-07-24 Martin Baulig <martin@gnome.org>
13980 * class.cs (MethodBase): New abstract class. This is now a base
13981 class for Property, Indexer and Event to avoid some code duplication
13982 in their Define() and DefineMethods() methods.
13983 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13984 generic methods for Define() and DefineMethods().
13985 (FieldBase): Derive from MemberBase, not MemberCore.
13986 (Property): Derive from MemberBase, not MemberCore.
13987 (Property.DefineMethod): Moved all the code from this method to the
13988 new MethodBase.DefineAccessor(), just call it with appropriate
13990 (Property.Define): Call the new Property.DoDefine(), this does some
13991 sanity checks and we don't need to duplicate the code everywhere.
13992 (Event): Derive from MemberBase, not MemberCore.
13993 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13994 accessors, this will also make them work with interface events.
13995 (Indexer): Derive from MemberBase, not MemberCore.
13996 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13997 (Indexer.Define): Use the new MethodBase functions.
13999 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14000 argument to the constructor.
14001 (Interface.FindMembers): Added support for interface events.
14002 (Interface.PopluateEvent): Implemented.
14004 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
14006 2002-07-22 Miguel de Icaza <miguel@ximian.com>
14008 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14009 but this is required to check for a method name being the same as
14010 the containing class.
14014 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14016 * interface.cs: initialize variable.
14018 2002-07-23 Martin Baulig <martin@gnome.org>
14020 Implemented the IndexerName attribute in interfaces.
14022 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14023 name if this is an explicit interface implementation.
14024 (Indexer.InterfaceIndexerName): New public variable. If we're
14025 implementing an interface indexer, this is the IndexerName in that
14026 interface. Otherwise, it's the IndexerName.
14027 (Indexer.DefineMethod): If we're implementing interface indexer,
14028 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
14029 and Pending.ImplementIndexer methods.
14030 (Indexer.Define): Also define the PropertyBuilder if we're
14031 implementing an interface indexer and this is neither an explicit
14032 interface implementation nor do the IndexerName match the one in
14035 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14036 If a method is defined here, then we always need to create a proxy
14037 for it. This is used when implementing interface indexers.
14038 (Pending.IsInterfaceIndexer): New public method.
14039 (Pending.ImplementIndexer): New public method.
14040 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14041 This is used when implementing interface indexers to define a proxy
14043 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14044 define a proxy if necessary.
14046 * interface.cs (Interface.IndexerName): New public variable.
14047 (Interface.PopulateIndexer): Set the IndexerName.
14048 (Interface.DefineIndexers): New private method. Populate all the
14049 indexers and make sure their IndexerNames match.
14051 * typemanager.cs (IndexerPropertyName): Added support for interface
14054 2002-07-22 Martin Baulig <martin@gnome.org>
14056 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14057 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14058 ret if HasReturnLabel.
14059 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14062 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14063 and set the ec.LoopBeginTryCatchLevel.
14064 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14065 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14066 the current ec.TryCatchLevel, the branch goes out of an exception
14067 block. In this case, we need to use Leave and not Br.
14069 2002-07-22 Martin Baulig <martin@gnome.org>
14071 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14072 block unless the block does not always return or it is contained in
14073 another try { ... } catch { ... } block. Fixes bug #26506.
14074 Added verify-1.cs to the test suite.
14076 2002-07-22 Martin Baulig <martin@gnome.org>
14078 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14079 then we do not always return. Fixes bug #24985.
14081 2002-07-22 Martin Baulig <martin@gnome.org>
14083 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14084 lookup on a per-class level; ie. walk up the class hierarchy until we
14085 found at least one applicable method, then choose the best among them.
14086 Fixes bug #24463 and test-29.cs.
14088 2002-07-22 Martin Baulig <martin@gnome.org>
14090 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14091 return types of the methods. The return type is not part of the
14092 signature and we must not check it to make the `new' modifier work.
14093 Fixes bug #27999, also added test-147.cs.
14094 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14096 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14097 on the method's return type.
14099 2002-07-21 Martin Baulig <martin@gnome.org>
14101 * assign.cs: Make this work if the rightmost source is a constant and
14102 we need to do an implicit type conversion. Also adding a few more tests
14103 to test-38.cs which should have caught this.
14105 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14106 target in the makefile for this. The makefile.gnu is primarily intended
14107 for end-users who don't want to debug the compiler.
14109 2002-07-21 Martin Baulig <martin@gnome.org>
14111 * assign.cs: Improved the Assign class so it can now handle embedded
14112 assignments (X = Y = Z = something). As a side-effect this'll now also
14113 consume less local variables. test-38.cs now passes with MCS, added
14114 a few new test cases to that test.
14116 2002-07-20 Martin Baulig <martin@gnome.org>
14118 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14119 instructions. Fixes bug #27977, also added test-146.cs.
14121 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14123 * cs-tokenizer.cs: fixed getHex ().
14125 2002-07-19 Martin Baulig <martin@gnome.org>
14127 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14128 not Type.GetType() to lookup the array type. This is needed when
14129 we're constructing an array of a user-defined type.
14130 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14131 single-dimensional arrays, but also for single-dimensial arrays of
14134 2002-07-19 Martin Baulig <martin@gnome.org>
14136 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14137 this function is called, it's not allowed to share LocalBuilders
14138 among ILGenerators.
14140 2002-07-19 Martin Baulig <martin@gnome.org>
14142 * expression.cs (Argument.Resolve): Report an error 118 when trying
14143 to pass a type as argument.
14145 2002-07-18 Martin Baulig <martin@gnome.org>
14147 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14148 Conv_R_Un for the signed `long' type.
14150 2002-07-15 Miguel de Icaza <miguel@ximian.com>
14152 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14153 `expr' for the temporary result, as that will fail if we do
14154 multiple resolves on the same expression.
14156 2002-07-05 Miguel de Icaza <miguel@ximian.com>
14158 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14159 ec.TypeContainer for looking up aliases.
14161 * class.cs (TypeContainer): Remove LookupAlias from here.
14163 * decl.cs (DeclSpace); Move here.
14165 2002-07-01 Miguel de Icaza <miguel@ximian.com>
14167 * class.cs (FindMembers): Only call filter if the constructor
14168 bulider is not null.
14170 Also handle delegates in `NestedTypes' now. Now we will perform
14171 type lookups using the standard resolution process. This also
14174 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14175 This uses Expressions (the limited kind that can be parsed by the
14176 tree) instead of strings.
14178 * expression.cs (ComposedCast.ToString): Implement, used to flag
14179 errors since now we have to render expressions.
14181 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
14184 * ecore.cs (SimpleName.ToString): ditto.
14186 * cs-parser.jay: Instead of using strings to assemble types, use
14187 Expressions to assemble the type (using SimpleName, ComposedCast,
14188 MemberAccess). This should fix the type lookups in declarations,
14189 because we were using a different code path for this.
14191 * statement.cs (Block.Resolve): Continue processing statements
14192 even when there is an error.
14194 2002-07-17 Miguel de Icaza <miguel@ximian.com>
14196 * class.cs (Event.Define): Also remove the `remove' method from
14197 the list of pending items.
14199 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14200 generate more compact code.
14202 2002-07-17 Martin Baulig <martin@gnome.org>
14204 * const.cs (Const.LookupConstantValue): Add support for constant
14205 `unchecked' and `checked' expressions.
14206 Also adding test case test-140.cs for this.
14208 2002-07-17 Martin Baulig <martin@gnome.org>
14210 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14211 check whether mi.ReturnType implements the IEnumerator interface; the
14212 `==' and the IsAssignableFrom() will fail in this situation.
14214 2002-07-16 Ravi Pratap <ravi@ximian.com>
14216 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
14219 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14221 * expression.cs: fixed bug #27811.
14223 2002-07-14 Miguel de Icaza <miguel@ximian.com>
14225 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14226 Molaro: when we are a ref, the value already contains a pointer
14227 value, do not take the address of it.
14229 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14230 * removed mb-parser.jay and mb-tokenizer.cs
14232 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14234 * expression.cs: check against the building corlib void type.
14236 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14238 * ecore.cs: fix for valuetype static readonly fields: when
14239 initializing them, we need their address, not the address of a copy.
14241 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14243 * typemanager.cs: register also enum_type in corlib.
14245 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14247 * class.cs: allow calling this (but not base) initializers in structs.
14249 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14251 * ecore.cs: make sure we compare against the building base types
14254 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14256 * typemanager.cs: fix TypeToCoreType() to handle void and object
14257 (corlib gets no more typerefs after this change).
14259 2002-07-12 Miguel de Icaza <miguel@ximian.com>
14261 * expression.cs (ArrayCreation.EmitArrayArguments): use
14262 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14264 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14265 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
14266 array indexes, the runtime actually forbids them.
14268 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14269 for array arguments here.
14271 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14272 instead of the default for ValueTypes.
14274 (New.DoEmit): Use IsValueType instead of
14275 IsSubclassOf (value_type)
14276 (New.DoResolve): ditto.
14277 (Invocation.EmitCall): ditto.
14279 * assign.cs (Assign): ditto.
14281 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14282 Statements *are* currently doing part of their resolution during
14285 Expressions do always resolve during resolve, but statements are
14286 only required to propagate resolution to their children.
14288 2002-07-11 Miguel de Icaza <miguel@ximian.com>
14290 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14292 (LoadAssembly): Do not add the dll if it is already specified
14294 (MainDriver): Add the System directory to the link path at the end,
14295 after all the other -L arguments.
14297 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14298 wrong opcode for loading bytes and bools (ldelem.i1 instead of
14299 ldelem.u1) and using the opposite for sbytes.
14301 This fixes Digger, and we can finally run it.
14303 * driver.cs (UnixParseOption): Move the option parsing here.
14304 (CSCParseOption): Implement CSC-like parsing of options.
14306 We now support both modes of operation, the old Unix way, and the
14307 new CSC-like way. This should help those who wanted to make cross
14308 platform makefiles.
14310 The only thing broken is that /r:, /reference: and /lib: are not
14311 implemented, because I want to make those have the same semantics
14312 as the CSC compiler has, and kill once and for all the confussion
14313 around this. Will be doing this tomorrow.
14315 * statement.cs (Unsafe.Resolve): The state is checked during
14316 resolve, not emit, so we have to set the flags for IsUnsfe here.
14318 2002-07-10 Miguel de Icaza <miguel@ximian.com>
14320 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14321 not catch the Error_ObjectRefRequired in SimpleName (as it is
14322 possible to have a class/instance variable name that later gets
14323 deambiguated), we have to check this here.
14325 2002-07-10 Ravi Pratap <ravi@ximian.com>
14327 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14328 make static and put into Expression.
14330 (Event.Define): Register the private field of the event with the
14331 TypeManager so that GetFieldFromEvent can get at it.
14333 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14334 keep track of the private field associated with an event which
14337 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14340 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14342 2002-07-10 Miguel de Icaza <miguel@ximian.com>
14344 * expression.cs (Binary.EmitBranchable): this routine emits the
14345 Binary expression in a branchable context. This basically means:
14346 we need to branch somewhere, not just get the value on the stack.
14348 This works together with Statement.EmitBoolExpression.
14350 * statement.cs (Statement.EmitBoolExpression): Use
14353 2002-07-09 Miguel de Icaza <miguel@ximian.com>
14355 * statement.cs (For): Reduce the number of jumps in loops.
14357 (For): Implement loop inversion for the For statement.
14359 (Break): We can be breaking out of a Try/Catch controlled section
14360 (foreach might have an implicit try/catch clause), so we need to
14361 use Leave instead of Br.
14363 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14364 now). If the instace expression supports IMemoryLocation, we use
14365 the AddressOf method from the IMemoryLocation to extract the
14366 address instead of emitting the instance.
14368 This showed up with `This', as we were emitting the instance
14369 always (Emit) instead of the Address of This. Particularly
14370 interesting when This is a value type, as we dont want the Emit
14371 effect (which was to load the object).
14373 2002-07-08 Miguel de Icaza <miguel@ximian.com>
14375 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14377 * statement.cs (Checked): Set the CheckedState during the resolve
14378 process too, as the ConvCast operations track the checked state on
14379 the resolve process, and not emit.
14381 * cs-parser.jay (namespace_member_declaration): Flag that we have
14382 found a declaration when we do. This is used to flag error 1529
14384 * driver.cs: Report ok when we display the help only.
14386 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
14388 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14390 2002-07-04 Miguel de Icaza <miguel@ximian.com>
14392 * cs-tokenizer.cs (define): We also have to track locally the
14393 defines. AllDefines is just used for the Conditional Attribute,
14394 but we also need the local defines for the current source code.
14396 2002-07-03 Miguel de Icaza <miguel@ximian.com>
14398 * statement.cs (While, For, Do): These loops can exit through a
14399 Break statement, use this information to tell whether the
14400 statement is the last piece of code.
14402 (Break): Flag that we break.
14404 * codegen.cs (EmitContexts): New `Breaks' state variable.
14406 2002-07-03 Martin Baulig <martin@gnome.org>
14408 * class.cs (TypeContainer.MethodModifiersValid): Allow override
14409 modifiers in method declarations in structs. Otherwise, you won't
14410 be able to override things like Object.Equals().
14412 2002-07-02 Miguel de Icaza <miguel@ximian.com>
14414 * class.cs (Method, Property, Indexer): Do not allow the public
14415 modifier to be used in explicit interface implementations.
14417 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14418 override modifiers in method declarations in structs
14420 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
14422 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14423 integer or real overflow, report an error
14425 2002-07-02 Martin Baulig <martin@gnome.org>
14427 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14428 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14429 to tell the runtime about our newly created System.Object and
14430 System.ValueType types.
14432 2002-07-02 Miguel de Icaza <miguel@ximian.com>
14434 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14435 struct instead of Ldarg/Starg.
14437 2002-07-02 Martin Baulig <martin@gnome.org>
14439 * expression.cs (Indirection.Indirection): Call
14440 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14442 2002-07-02 Martin Baulig <martin@gnome.org>
14444 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14445 ValueType, call TypeManager.TypeToCoreType() on it.
14446 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14447 the OpCodes.Newarr argument.
14449 2002-07-02 Martin Baulig <martin@gnome.org>
14451 * expression.cs (Invocation.EmitCall): When compiling corlib,
14452 replace all calls to the system's System.Array type to calls to
14453 the newly created one.
14455 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14456 System.Array methods.
14457 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14458 from the system's System.Array type which must be replaced.
14460 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14462 * typemanager.cs: load unverifiable_code_ctor so we can build
14463 corlib using the correct type. Avoid using GetTypeCode() with
14465 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14466 TypeManager.object_type to allow building corlib.
14468 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14470 * ecore.cs: handle System.Enum separately in LoadFromPtr().
14472 2002-07-01 Martin Baulig <martin@gnome.org>
14474 * class.cs: Make the last change actually work, we need to check
14475 whether `ifaces != null' to avoid a crash.
14477 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14479 * class.cs: when we build structs without fields that implement
14480 interfaces, we need to add the interfaces separately, since there is
14481 no API to both set the size and add the interfaces at type creation
14484 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14486 * expression.cs: the dimension arguments to the array constructors
14487 need to be converted if they are a long.
14489 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14491 * class.cs: don't emit ldarg.0 if there is no parent constructor
14492 (fixes showstopper for corlib).
14494 2002-06-29 Martin Baulig <martin@gnome.org>
14496 MCS now compiles corlib on GNU/Linux :-)
14498 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14499 ie. check for MethodImplOptions.InternalCall.
14501 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14502 and TypeManager.attribute_type are null, so we must explicitly check
14503 whether parent is not null to find out whether it's an attribute type.
14504 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14505 and SetBuilder, not only if the property is neither abstract nor external.
14506 This is necessary to set the MethodImplOptions on the accessor methods.
14507 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14508 SetBuilder, see Property.Emit().
14510 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14511 populate "System.Object", "System.ValueType" and "System.Attribute" since
14512 they've already been populated from BootCorlib_PopulateCoreTypes().
14514 2002-06-29 Martin Baulig <martin@gnome.org>
14516 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14517 is the NullLiteral, we also need to make sure that target_type is not
14520 2002-06-29 Martin Baulig <martin@gnome.org>
14522 * rootcontext.cs (RootContext.ResolveCore): We must initialize
14523 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14524 before calling BootstrapCorlib_ResolveDelegate ().
14526 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14528 * statement.cs: fixed build-breaker. All tests passed ok.
14530 2002-06-27 Martin Baulig <martin@gnome.org>
14532 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14533 for System.Decimal when compiling corlib.
14535 2002-06-27 Martin Baulig <martin@gnome.org>
14537 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14538 switch blocks which contain nothing but a default clause.
14540 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
14542 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14544 2002-06-27 Martin Baulig <martin@gnome.org>
14546 * ecore.cs (PropertyExpr.PropertyExpr): Call
14547 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14549 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14550 is already a TypeBuilder.
14552 2002-06-27 Martin Baulig <martin@gnome.org>
14554 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14555 `target_type == TypeManager.array_type', not IsAssignableFrom() in
14556 the "from an array-type to System.Array" case. This makes it work
14557 when compiling corlib.
14559 2002-06-27 Martin Baulig <martin@gnome.org>
14561 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14562 non-static PropertyExpr, set its InstanceExpression. This makes
14563 the `ICollection.Count' property work in System/Array.cs.
14565 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
14567 * driver.cs: Made error handling more consistent. Errors now
14568 tracked by Report class, so many methods which used to return int
14569 now return void. Main() now prints success/failure and
14570 errors/warnings message.
14572 Renamed '--probe' compiler argument to '--expect-error'. Removed
14573 the magic number return values (123 and 124). Now, if the
14574 expected error occurs, the compiler exits with success (exit value
14575 0). If the compilation completes without seeing that particular
14576 error, the compiler exits with failure (exit value 1). The
14577 makefile in mcs/errors has been changed to handle the new behaviour.
14579 * report.cs: Made 'expected error' number a property and renamed
14580 it from 'Probe' to 'ExpectedError'.
14582 * genericparser.cs: Removed error handling support, since it is
14583 now all done by Report class.
14585 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14586 class, so parse() no longer returns an int.
14588 * namespace.cs: Use Report.Error instead of GenericParser.error
14590 2002-06-22 Miguel de Icaza <miguel@ximian.com>
14592 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14593 TypeContainer.AddOperator): At the front of the list put the
14594 explicit implementations, so they get resolved/defined first.
14596 2002-06-21 Miguel de Icaza <miguel@ximian.com>
14598 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14599 interface type is implemented by this TypeContainer. Used during
14600 explicit interface implementation.
14602 (Property.Define, Indexer.Define, Method.Define): Validate that
14603 the given interface in the explicit implementation is one of the
14604 base classes for the containing type.
14606 Also if we are explicitly implementing an interface, but there is
14607 no match in the pending implementation table, report an error.
14609 (Property.Define): Only define the property if we are
14610 not explicitly implementing a property from an interface. Use the
14611 correct name also for those properties (the same CSC uses,
14612 although that is really not needed).
14614 (Property.Emit): Do not emit attributes for explicitly implemented
14615 properties, as there is no TypeBuilder.
14617 (Indexer.Emit): ditto.
14619 Hiding then means that we do not really *implement* a pending
14620 implementation, which makes code fail.
14622 2002-06-22 Martin Baulig <martin@gnome.org>
14624 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14625 the return value of Object.GetType(). [FIXME: we need to do this whenever
14626 we get a type back from the reflection library].
14628 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14630 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14632 2002-06-20 Miguel de Icaza <miguel@ximian.com>
14634 * attribute.cs: Return null if we can not look up the type.
14636 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14637 the interface types found.
14639 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14640 interface types found.
14642 * typemanager.cs (GetInterfaces): Make this routine returns alll
14643 the interfaces and work around the lame differences between
14644 System.Type and System.Reflection.Emit.TypeBuilder in the results
14645 result for GetInterfaces.
14647 (ExpandInterfaces): Given an array of interface types, expand and
14648 eliminate repeated ocurrences of an interface. This expands in
14649 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14652 2002-06-21 Martin Baulig <martin@gnome.org>
14654 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14657 2002-06-21 Martin Baulig <martin@gnome.org>
14659 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
14660 and called with one of the core types, return the corresponding typebuilder for
14663 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14666 2002-06-21 Martin Baulig <martin@gnome.org>
14668 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14669 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14670 (Expression.ConvertReferenceExplicit): Likewise.
14672 * expression.cs (ElementAccess.DoResolve): Likewise.
14673 (ElementAccess.DoResolveLValue): Likewise.
14675 2002-06-10 Martin Baulig <martin@gnome.org>
14677 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14678 add the "value" parameter to the parameter list.
14680 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14683 2002-06-19 Miguel de Icaza <miguel@ximian.com>
14685 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14686 the argument to an int, uint, long or ulong, per the spec. Also
14687 catch negative constants in array creation.
14689 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14691 * class.cs: do not allow the same interface to appear twice in
14692 the definition list.
14694 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14696 * ecore.cs: don't use ldlen with System.Array.
14698 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14700 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14702 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14704 * modifiers.cs: produce correct field attributes for protected
14705 internal. Easy fix so miguel can work on ther harder stuff:-)
14707 2002-06-18 Miguel de Icaza <miguel@ximian.com>
14709 * pending.cs: New file. Move the code from class.cs here.
14710 Support clearning the pending flag for all methods (when not doing
14711 explicit interface implementation).
14713 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14715 * rootcontext.cs: added a couple more types needed to bootstrap.
14717 2002-06-17 Miguel de Icaza <miguel@ximian.com>
14719 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14720 constructor in the type, instead of any constructor in the type
14721 hierarchy. Thanks to Paolo for finding this bug (it showed up as
14722 a bug in the Mono runtime when applying the params attribute).
14724 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14725 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14727 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
14729 * expression.cs (Unary.ResolveOperator): Use TypeManager
14730 to resolve the type.
14732 2002-06-13 Ravi Pratap <ravi@ximian.com>
14734 * cs-parser.jay (enum_member_declaration): Pass in the attributes
14737 * enum.cs (AddEnumMember): Add support to store the attributes associated
14738 with each member too.
14740 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14741 field builders too - this takes care of the enum member case.
14743 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
14745 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14746 address-of operator on both value types and pointers.
14748 2002-06-10 Martin Baulig <martin@gnome.org>
14750 * interface.cs (Interface.PopulateIndexer): Add the indexer's
14751 PropertyBuilder to the `property_builders' list.
14753 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14754 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14755 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
14756 find any indexers which are inherited from an interface.
14758 2002-06-09 Martin Baulig <martin@gnome.org>
14760 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14761 the same type as the constant if necessary. There's also a test-130.cs
14764 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14766 * typemanager.cs (TypeManager.ChangeType): Previously known as
14767 Enum.ChangeEnumType().
14769 2002-06-09 Martin Baulig <martin@gnome.org>
14771 * expression.cs (Cast.TryReduce): Added support for consts.
14773 2002-06-08 Ravi Pratap <ravi@ximian.com>
14775 * class.cs (Accessor): Hold attributes information so we can pass
14778 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14779 Modify to pass in attributes attached to the methods.
14781 (add_accessor_declaration, remove_accessor_declaration): Ditto.
14783 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14784 to handle the Accessor kind :-)
14786 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14788 2002-06-08 Martin Baulig <martin@gnome.org>
14790 * expression.cs (Unary.TryReduceNegative): Added support for
14793 2002-06-08 Martin Baulig <martin@gnome.org>
14795 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14796 name can't be found in the `defined_names' - the caller will do a
14797 MemberLookup in this case and thus find methods in System.Enum
14798 such as Enum.IsDefined().
14800 2002-06-08 Martin Baulig <martin@gnome.org>
14802 * enum.cs (Enum.ChangeEnumType): This is a custom version of
14803 Convert.ChangeType() which works with TypeBuilder created types.
14804 (Enum.LookupEnumValue, Enum.Define): Use it here.
14806 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14807 `TypeBuilder.BaseType != null' check.
14808 (TypeContainer.FindMembers): Only lookup parent members if we
14809 actually have a parent.
14810 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14811 (ConstructorInitializer.Resolve): Likewise.
14813 * interface.cs (Interface.FindMembers): Added
14814 `TypeBuilder.BaseType != null' check.
14816 * rootcontext.cs (RootContext.ResolveCore): Added
14817 "System.Runtime.CompilerServices.IndexerNameAttribute" to
14818 classes_second_stage.
14820 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14821 debug_type and trace_type when compiling with --nostdlib.
14823 2002-06-07 Martin Baulig <martin@gnome.org>
14825 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14826 (AddField): Set it to true when adding a non-static field.
14827 (DefineType): Use `have_nonstatic_fields' to find out whether we
14828 have non-static fields, not `Fields != null'.
14830 2002-06-02 Miguel de Icaza <miguel@ximian.com>
14832 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14833 dereferencing a null on the static-field code path)
14835 2002-05-30 Martin Baulig <martin@gnome.org>
14837 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14838 to take command line arguments. Use reflection to call the new
14839 custom `Initialize' function on the symbol writer and pass it the
14840 command line arguments.
14842 * driver.cs (--debug-args): New command line argument to pass command
14843 line arguments to the symbol writer.
14845 2002-05-28 Miguel de Icaza <miguel@ximian.com>
14847 * assign.cs (DoResolve): Forgot to do the implicit conversion to
14848 the target type for indexers and properties. Thanks to Joe for
14851 2002-05-27 Miguel de Icaza <miguel@ximian.com>
14853 * typemanager.cs (MethodFlags): returns the method flags
14854 (Obsolete/ShouldIgnore) that control warning emission and whether
14855 the invocation should be made, or ignored.
14857 * expression.cs (Invocation.Emit): Remove previous hack, we should
14858 not do this on matching a base type, we should do this based on an attribute
14860 Only emit calls to System.Diagnostics.Debug and
14861 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14862 on the command line.
14864 * rootcontext.cs: Global settings for tracing and debugging.
14866 * cs-tokenizer.cs (define): New utility function to track
14867 defines. Set the global settings for TRACE and DEBUG if found.
14869 2002-05-25 Ravi Pratap <ravi@ximian.com>
14871 * interface.cs (Populate*): Pass in the TypeContainer as well as
14872 the DeclSpace as parameters so that we can create EmitContexts and
14873 then use that to apply attributes etc.
14875 (PopulateMethod, PopulateEvent, PopulateProperty)
14876 (PopulateIndexer): Apply attributes everywhere.
14878 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14881 (ApplyAttributes): Update accordingly.
14883 We now apply interface attributes for all members too.
14885 2002-05-26 Miguel de Icaza <miguel@ximian.com>
14887 * class.cs (Indexer.Define); Correctly check if we are explicit
14888 implementation (instead of checking the Name for a ".", we
14889 directly look up if the InterfaceType was specified).
14891 Delay the creation of the PropertyBuilder.
14893 Only create the PropertyBuilder if we are not an explicit
14894 interface implementation. This means that explicit interface
14895 implementation members do not participate in regular function
14896 lookups, and hence fixes another major ambiguity problem in
14897 overload resolution (that was the visible effect).
14899 (DefineMethod): Return whether we are doing an interface
14902 * typemanager.cs: Temporary hack until we get attributes in
14903 interfaces (Ravi is working on that) and we get IndexerName
14904 support in interfaces.
14906 * interface.cs: Register the indexers as properties.
14908 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14909 warning, I have verified that this is a bug in the .NET runtime
14910 (JavaScript suffers of the same problem).
14912 * typemanager.cs (MemberLookup): When looking up members for
14913 interfaces, the parent of an interface is the implicit
14914 System.Object (so we succeed in searches of Object methods in an
14915 interface method invocation. Example: IEnumerable x; x.ToString
14918 2002-05-25 Miguel de Icaza <miguel@ximian.com>
14920 * class.cs (Event): Events should also register if they do
14921 implement the methods that an interface requires.
14923 * typemanager.cs (MemberLookup); use the new GetInterfaces
14926 (GetInterfaces): The code used to lookup interfaces for a type is
14927 used in more than one place, factor it here.
14929 * driver.cs: Track the errors at the bottom of the file, we kept
14932 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14933 instance if the method we are calling is static!
14935 2002-05-24 Miguel de Icaza <miguel@ximian.com>
14937 * attribute.cs (ApplyAttributes): Make this function filter out
14938 the IndexerName attribute (as that attribute in reality is never
14939 applied) and return the string constant for the IndexerName
14942 * class.cs (TypeContainer.Emit): Validate that all the indexers
14943 have the same IndexerName attribute, and if so, set the
14944 DefaultName attribute on the class.
14946 * typemanager.cs: The return value might contain other stuff (not
14947 only methods). For instance, consider a method with an "Item"
14948 property and an Item method.
14950 * class.cs: If there is a problem with the parameter types,
14953 2002-05-24 Ravi Pratap <ravi@ximian.com>
14955 * ecore.cs (ImplicitConversionExists): Wrapper function which also
14956 looks at user defined conversion after making a call to
14957 StandardConversionExists - we need this for overload resolution.
14959 * expression.cs : Update accordingly the various method calls.
14961 This fixes 2 bugs filed against implicit user defined conversions
14963 2002-05-22 Miguel de Icaza <miguel@ximian.com>
14965 * statement.cs: Track the result of the assignment.
14967 2002-05-21 Miguel de Icaza <miguel@ximian.com>
14969 * expression.cs (MemberAccess): Improved error reporting for
14970 inaccessible members.
14972 2002-05-22 Martin Baulig <martin@gnome.org>
14974 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
14975 itself with debugging support.
14977 2002-05-22 Martin Baulig <martin@gnome.org>
14979 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14980 Removed, this isn't needed anymore.
14982 2002-05-20 Martin Baulig <martin@gnome.org>
14984 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14985 be underlying type for an enum.
14987 2002-05-20 Miguel de Icaza <miguel@ximian.com>
14989 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14990 that splits out the loading of just the core types.
14992 * rootcontext.cs (ResolveCore): Split the struct resolution in
14993 two, so we can load the enumeration underlying types before any
14996 * expression.cs (Is): Bandaid until we fix properly Switch (see
14997 bug #24985 for details).
14999 * typemanager.cs (ImplementsInterface): The hashtable will contain
15000 a null if there are no interfaces implemented.
15002 2002-05-18 Miguel de Icaza <miguel@ximian.com>
15004 * cs-parser.jay (indexer_declarator): It is fine to have array
15007 2002-05-17 Miguel de Icaza <miguel@ximian.com>
15009 * typemanager.cs: (RegisterBuilder): New function used to register
15010 TypeBuilders that implement interfaces. Since
15011 TypeBuilder.GetInterfaces (as usual) does not work with lame
15013 (AddUserType): register interfaces.
15015 (ImplementsInterface): Use the builder_to_ifaces hash if we are
15016 dealing with TypeBuilder. Also, arrays are showing up as
15017 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15018 methods can not be invoked on them!
15020 * ecore.cs (ExplicitReferenceConversionExists): Made public.
15021 (ImplicitReferenceConversionExists): Split out from
15022 StandardConversionExists.
15024 * expression.cs (As): We were only implementing one of the three
15025 cases for the as operator. We now implement them all.
15026 (Is): Implement the various other cases for Is as well.
15028 * typemanager.cs (CACHE): New define used to control if we want or
15029 not the FindMembers cache. Seems to have a negative impact on
15030 performance currently
15032 (MemberLookup): Nested types have full acess to
15033 enclosing type members
15035 Remove code that coped with instance/static returns for events, we
15036 now catch this in RealFindMembers.
15038 (RealFindMembers): only perform static lookup if the instance
15039 lookup did not return a type or an event.
15041 2002-05-17 Miguel de Icaza <miguel@ximian.com>
15043 * assign.cs (CompoundAssign): We pass more semantic information
15044 now to Compound Assignments than we did before: now we have all
15045 the information at hand, and now we resolve the target *before* we
15046 do the expression expansion, which allows the "CacheValue" method
15047 to have the effect we intended (before, a [x] += 1 would generate
15048 two differen ArrayAccess expressions from the ElementAccess,
15049 during the resolution process).
15051 (CompoundAssign.DoResolve): Resolve target and original_source here.
15053 2002-05-16 Miguel de Icaza <miguel@ximian.com>
15055 * expression.cs (ArrayAccess): dropped debugging information.
15057 * typemanager.cs: Small bug fix: I was always returning i_members,
15058 instead of one of i_members or s_members (depending on which had
15061 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
15062 method is invoked before any code generation takes place, and it
15063 is a mechanism to inform that the expression will be invoked more
15064 than once, and that the method should use temporary values to
15065 avoid having side effects
15067 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15069 * ecore.cs (Expression.CacheTemporaries): Provide empty default
15072 * expression.cs (Indirection, ArrayAccess): Add support for
15073 CacheTemporaries in these two bad boys.
15075 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15076 ldobj or ldind_ref.
15077 (StoreFromPtr): Handle stobj as well.
15079 * expression.cs (UnaryMutator): Share more code.
15081 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15082 down: I was not tracking the Filter function as well, which
15083 was affecting the results of the cache.
15085 2002-05-15 Miguel de Icaza <miguel@ximian.com>
15087 * attribute.cs: Remove the hack to handle the CharSet property on
15090 2002-05-14 Miguel de Icaza <miguel@ximian.com>
15092 * attribute.cs (DoResolve): More uglyness, we now only try to
15093 resolve the attribute partially, to extract the CharSet
15094 information (only if we are a StructLayout attribute). Otherwise
15096 (GetExtraTypeInfo): Add some code to conditionally kill in the
15097 future this. I am more and more convinced that the .NET
15098 framework has special code to handle the attribute setting on
15101 * expression.cs (IsParamsMethodApplicable): Revert my previous
15102 foreach change here, it was wrong.
15104 2002-05-13 Miguel de Icaza <miguel@ximian.com>
15106 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15107 (pp_expr): do not abort on unknown input, just return.
15108 (eval): abort if there are pending chars.
15110 * attribute.cs (Attribute.Resolve): Positional parameters are
15111 optional. Deal with that case.
15113 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15114 the Ansi/Unicode/Auto information for the type.
15116 (TypeContainer.DefineType): instantiate the EmitContext here, as
15117 we will be using it during the type definition (to resolve
15118 attributes) and during the emit phase.
15120 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15121 to pull type information out of the attributes
15123 (Attribute.Resolve): track the constructor builder, and allow for
15124 multiple invocations (structs and classes will use this).
15126 * ecore.cs (MemberLookupFinal): new version with all the
15127 parameters customizable.
15129 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15130 constructors. Return if the result value is null (as the error
15131 would have been flagged already by MemberLookupFinal)
15133 Do not allow instances of abstract classes or interfaces to be
15136 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15137 We have to compare the assembly property here when dealing with
15138 FamANDAssem and Assembly access modifiers, because we might be
15139 creating an assembly from *modules* (that means that we are not
15140 getting TypeBuilders for types defined in other modules that are
15141 part of this assembly).
15143 (Method.Emit): If the method is marked abstract and has a body,
15146 (TypeContainer.DefineMembers): If both the defined member and the
15147 parent name match are methods, then do not emit any warnings: let
15148 the Method.Define routine take care of flagging warnings. But if
15149 there is a mismatch (method overrides something else, or method is
15150 overriwritten by something, then emit warning).
15152 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15153 set to null, this means `do not check for the return type on the
15156 (Method.Define): set the return type for the method signature to
15157 null, so that we get methods with the same name and parameters and
15158 different return types. This is used to flag warning 114 (you are
15159 hiding a method, and you probably want to use the new/override
15162 * typemanager.cs (MemberLookup): Implemented proper access
15163 control, closing a long standing set of bug reports. The problem
15164 was that the Framework only has two bits: Public and NonPublic,
15165 and NonPublic includes private and protected methods, but we need
15166 to enforce the FamANDAssem, FamOrAssem and Family.
15168 2002-05-11 Miguel de Icaza <miguel@ximian.com>
15170 * statement.cs (GotoCase): Return true: Ammounts to giving up
15171 knowledge on whether we return or not, and letting the other case
15172 be responsible for it.
15174 2002-05-10 Miguel de Icaza <miguel@ximian.com>
15176 * driver.cs: Do not load directories for each file processed, only
15177 do it if there is a pattern.
15179 * ecore.cs: Report readonly assigns here as well, as we might have
15180 been resolved only by MemberAccess.
15182 (SimpleName.SimpleNameResolve): Also be useful for LValue
15183 resolution. We need this to propagate assign to local readonly variables
15185 * typemanager.cs: Use a ptrhashtable for the criteria, because we
15186 do not want to reuse potential criteria memory.
15188 * class.cs (MyEventBuilder): Set reflected_type;
15190 * ecore.cs (Constantify): Added support for constifying bools.
15192 (RootContext.LookupType): Added a cache for values looked up in
15193 the declaration space.
15195 * typemanager.cs (FindMembers): Now is a front-end to
15196 RealFindMembers, and provides a two-level hashtable-based cache to
15199 15% performance improvement: from 22.5 to 19.2 seconds.
15201 * expression.cs (IsParamsMethodApplicable): use foreach.
15202 (Invocation.DoResolve): ditto.
15203 (New.DoResolve): ditto.
15204 (ArrayCreation.DoResolve): ditto.
15206 * ecore.cs (FindMostEncompassingType): use foreach.
15208 * delegate.cs (NewDelegate.DoResolve): Use foreach
15210 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15211 (RemoveMethods): use foreach.
15213 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15214 nested foreach statements instead of for, and also break out of
15215 the inner loop once a match is found.
15217 (Invocation.OverloadResolve): Use foreach, simplify the code.
15219 2002-05-08 Miguel de Icaza <miguel@ximian.com>
15221 * cfold.cs (BinaryFold): During an enumeration evaluation context,
15222 we actually unwrap the expression to allow for extra information
15225 * expression.cs: Use Shr_Un on unsigned operations.
15227 2002-05-08 Ravi Pratap <ravi@ximian.com>
15229 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
15230 applicable operators was not being considered correctly. This closes
15231 the bug Miguel reported.
15233 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15235 * attribute.cs: check that the type derives from System.Attribute
15236 and report the correct error in that case (moved the duplicate code to
15237 its own method, too).
15239 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15241 * attribute.cs: lookup attribute type name as the spec says: first the
15242 bare attribute name and then name + "Attribute" (nant compiles with
15243 mcs after this fix).
15245 2002-05-07 Miguel de Icaza <miguel@ximian.com>
15247 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
15248 Because of the way we parse things, we should try to see if a
15249 UIntConstant can fit in an integer.
15251 2002-05-07 Ravi Pratap <ravi@ximian.com>
15253 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15254 when we are in an explicit context.
15256 (ConvertReferenceExplicit): When converting from Iface type S to Class
15257 T make sure the rules are implemented as an OR.
15259 * parameter.cs (ParameterType): Make it a property for now although the
15260 purpose really isn't anything immediate.
15262 * expression.cs (Is*Applicable): Do better checking on the parameter type
15263 of a ref/out parameter. The ones from the system assemblies are already
15264 marked with the correct type so we don't need to do any correction.
15266 * ecore.cs (StandardConversionExists): Conversion from Interface types to
15267 the object type is standard too so include that.
15269 2002-05-06 Miguel de Icaza <miguel@ximian.com>
15271 * ecore.cs (StandardConversionExists): Augment with missing code:
15272 deal with IntConstant, LongConstants and Enumerations.
15274 * assign.cs: Report the error, instead of failing silently
15276 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15277 typecontainer that they are declared, because the
15278 typecontainer/namespace will have the list of using clauses that
15279 need to be applied.
15281 Assembly Attributes were escaping the normal registration
15284 (EmitCode): Apply attributes within an EmitContext that represents
15285 the container they were declared on.
15287 * cs-parser.jay: Track bases for structs. How did I get this wrong?
15289 2002-05-06 Ravi Pratap <ravi@ximian.com>
15291 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15292 Revamp completely - make much cleaner as we now operate only
15295 (FindMostSpecificSource, FindMostSpecificTarget): New methods
15296 to implement the logic detailed in the spec more correctly.
15298 (UserDefinedConversion): Update accordingly.
15300 2002-05-06 Miguel de Icaza <miguel@ximian.com>
15302 * statement.cs: Return flow analysis information up.
15304 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15307 (token): Do not consume an extra character before calling
15310 2002-05-06 Piers Haken <piersh@friskit.com>
15312 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15314 2002-05-06 Miguel de Icaza <miguel@ximian.com>
15316 * class.cs (Constructor.Emit): Set the IsStatic flag in the
15317 EmitContext during the instance constructor initializer
15318 resolution, to stop access to instance variables.
15320 This is mandated by the spec, last paragraph of the `constructor
15321 initializers' section.
15323 2002-05-05 Miguel de Icaza <miguel@ximian.com>
15325 * cs-parser.jay, class.cs (Accessor): new class used to represent
15326 an accessor (get or set). In the past we used `null' to represent
15327 a missing accessor. But this is ambiguous because there was no
15328 way to tell in abstract indexers/properties if one of them was
15331 Now there is a way of addressing that.
15333 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15334 instead of FindMembers.
15336 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15337 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15339 * attribute.cs: Treat indexers and properties as the same in terms
15340 of applying attributes
15342 * ecore.cs (FindMostEncompassedType): Use statically initialized
15343 EmptyExpressions()s like we do elsewhere to avoid creating useless
15344 objects (and we take this out of the tight loop).
15346 (GetConversionOperators): Move the code to extract the actual
15347 operators to a separate routine to clean things up.
15349 2002-05-04 Miguel de Icaza <miguel@ximian.com>
15351 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15352 events are always registered FieldBuilders.
15354 * class.cs (FieldBase): New class shared by Fields
15356 * delegate.cs: If we are a toplevel delegate, use our full name.
15357 If we are a nested delegate, then only use our tail name.
15359 2002-05-02 Ravi Pratap <ravi@ximian.com>
15361 * expression.cs (IsApplicable): Ensure that we add the "&" to
15362 ref/out types before comparing it with the type of the argument.
15364 (IsParamsMethodApplicable): Ditto.
15366 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
15369 * delegate.cs : Handle the case when we have more than one applicable
15370 method. Flag an error only when we finish checking all.
15372 2002-05-02 Miguel de Icaza <miguel@ximian.com>
15374 * expression.cs: Add support for boolean static initializers.
15376 2002-05-01 Miguel de Icaza <miguel@ximian.com>
15378 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15380 * parameter.cs (ComputeParameterTypes,
15381 ComputeAndDefineParameterTypes): Better error handling: now we
15382 clear the `types' cache if we fail during any of the type lookups.
15383 We also return the status code correctly to our caller
15385 * delegate.cs: If we fail to define a delegate, abort the extra
15388 * expression.cs (Binary.ResolveOperator): for
15389 operator==(object,object) and operator !=(object, object) we also
15390 have to verify that there is an implicit conversion from one to
15393 (ArrayAccess.DoResolve): Array Access can operate on
15396 2002-04-30 Miguel de Icaza <miguel@ximian.com>
15398 * assign.cs (CompoundAssign): A new class used as a "flag" that
15399 the assignment actually is happening as part of a compound
15400 assignment operator.
15402 During compound assignment, a few new rules exist to enable things
15409 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15410 to the type of x) if y is implicitly convertible to the type of x,
15411 and the operator is a builtin operator and the return type of the
15412 operator is explicitly convertible to the type of x.
15414 * rootcontext.cs: Reset warning level to 2. 4 catches various
15415 "interesting" features in mcs, we must clean this up at some
15416 point, but currently am trying to kill other bugs ;-)
15418 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15419 in container classes as well.
15421 * expression.cs (Binary.ResolveOperator): Handle string case
15422 before anything else (as operator overloading does emit an error
15423 before doing anything else).
15425 This code could go away when we move to a table driven model, but
15426 i could not come up with a good plan last night.
15428 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
15430 * typemanager.cs (CSharpName): reimplementation using regex.
15431 * class.cs: added null check for fields in Emit
15432 * rootcontext.cs: set warninglevel to 4
15434 2002-04-29 Miguel de Icaza <miguel@ximian.com>
15436 * typemanager.cs (CSharpName): reimplemented with Lupus
15439 2002-04-28 Miguel de Icaza <miguel@ximian.com>
15441 * statement.cs (If): correclty implement Resolve, because we were
15442 not catching sem errors in there. The same process is needed
15444 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15447 (Statement.Warning_DeadCodeFound): Factorize code.
15448 (While): Report dead code here too.
15450 (Statement): Added Resolve virtual method to allow
15451 for resolution split from the emit code.
15453 2002-04-26 Miguel de Icaza <miguel@ximian.com>
15455 * statement.cs (EmitBoolExpression): No longer try to resolve the
15457 (MakeBoolean): New utility function that resolve, implicitly
15458 converts to boolean and tags the expression.
15461 (If, Do): Implement dead code elimination.
15462 (While): Implement loop inversion
15464 (Do, While, For, If): Resolve the expression prior to calling our
15467 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
15470 - added method Report28 (warning: program has more than one entry point)
15471 - added method IsEntryPoint, implements paragraph 10.1 of the spec
15472 - modified method Method.Define, the part at the end of the method
15474 * rootcontext.cs: added static public Location EntryPointLocation;
15476 * ../errors/cs0028.cs : Add test case for the above warning.
15479 - modified method CSharpName to allow arrays of primitive type to
15480 be printed nicely (e.g. instead of System.Int32[][] it now prints
15482 - added method CSharpSignature: returns the signature of a method
15483 in string format to be used in reporting errors, warnings, etc.
15485 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15488 2002-04-26 Ravi Pratap <ravi@ximian.com>
15490 * delegate.cs (Define): Fix extremely silly bug where I was
15491 setting the type of the 'object' parameter of the BeginInvoke
15492 method to System.IAsyncResult instead of System.Object ;-)
15494 2002-04-26 Miguel de Icaza <miguel@ximian.com>
15496 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15499 (Constructor.Emit): return if we fail to initialize the
15500 constructor. Another door closed!
15502 * expression.cs (New.DoResolve): Improve error message (from -6 to
15503 1501). Use DeclaredOnly lookup to find the exact constructor.
15505 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15506 loop. This is useful.
15508 * cs-parser.jay: Adjust the default parameters so that destructors
15509 have the proper signature.
15511 2002-04-26 Martin Baulig <martin@gnome.org>
15513 * driver.cs (LoadAssembly): If `assembly' contains any characters
15514 which are only valid in path names and not in assembly names
15515 (currently slash, backslash and point), use Assembly.LoadFrom ()
15516 instead of Assembly.Load () on the `assembly' (before iteration
15517 over the link_paths).
15519 2002-04-26 Martin Baulig <martin@gnome.org>
15521 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15523 2002-04-25 Miguel de Icaza <miguel@ximian.com>
15525 * class.cs (Property): use the new typemanager.MemberLookup
15527 (TypeContainer.MemberLookup): Implement using the
15528 TypeManager.MemberLookup now.
15530 * typemanager.cs: Make MemberLookup a function of the TypeManager,
15531 and return MemberInfos, so that these can be used without an
15532 EmitContext (what we had before).
15534 2002-04-24 Miguel de Icaza <miguel@ximian.com>
15536 * expression.cs: Fix the case where the argument to params if the
15537 type of the params. I omitted handling this before. Fixed
15539 2002-04-22 Miguel de Icaza <miguel@ximian.com>
15541 * driver.cs: Call BootCorlib_PopulateCoreType
15543 * class.cs (Property.CheckBase): Check for properties only, not
15546 * interface.cs: Temporary hack: try/catch around the
15547 CustomAttributeBuilder, because I am getting an exception that I
15550 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15551 types whose definitions are required to be there (attributes are
15552 defined before standard types).
15554 Compute definitions as we boot the various types, as they are used
15555 immediately (value_type class will need object_type, but if we do
15556 not initialize object_type, we will pass a null, which will let
15557 the runtime pick the System.Object from the existing corlib, which
15558 is not what we want).
15560 2002-04-22 Patrik Torstensson <totte@labs2.com>
15562 * cs-tokenizer.cs: fixed a number of trim() issues.
15564 2002-04-22 Ravi Pratap <ravi@ximian.com>
15566 * expression.cs (Argument.Type): Ensure that we return the correct
15567 type when we have out or ref parameters [in which case we
15570 2002-04-22 Miguel de Icaza <miguel@ximian.com>
15572 * class.cs (Property, Indexer): Allow extern modifier in there.
15574 * typemanager.cs (InitBaseTypes): Initializes object_type and
15575 value_type, since those will be used early on during the bootstrap
15576 process to compile corlib.
15578 (InitCoreTypes): Move code from here to InitBaseTypes.
15580 2002-04-21 Miguel de Icaza <miguel@ximian.com>
15582 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15583 single-dimension arrays as using the ldlen opcode.
15585 Daniel Lewis discovered this optimization.
15587 * typemanager.cs: Add signature for System.Array::get_Length
15589 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15591 * statement.cs: report the error when the foreach does not apply to an
15592 array nor a collection.
15594 2002-04-19 Miguel de Icaza <miguel@ximian.com>
15596 * expression.cs: Add implicit conversions to the operator ~.
15598 * constant.cs (DecimalConstant.Emit): Emit decimal value.
15600 * typemanager.cs: Locate the decimal constructor.
15602 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15604 * attribute.cs: use the new property of TypeOf.
15605 * expression.cs: added 'get' property around typearg.
15607 These changes fix a build breaker reported by NickD. Is this the
15608 correct way to fix? If not, please, revert my changes and make it
15611 2002-04-17 Miguel de Icaza <miguel@ximian.com>
15613 * attribute.cs: Add support for typeof in attribute invocations.
15614 I am not sure that this is right though.
15616 2002-04-14 Duncan Mak <duncan@ximian.com>
15618 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15619 Binary.Operator.Division case.
15621 2002-04-13 Ravi Pratap <ravi@ximian.com>
15623 * class.cs (DefineType): Ensure that we do a proper check on
15624 attribute types and also register it with the TypeManager.
15626 (TypeContainer.Targets): The default for attribute types is
15627 AttributeTargets.All.
15629 * attribute.cs (ApplyAttributes): Registering the attribute type
15630 is done elsewhere, not when we discover we have a Usage attribute.
15632 2002-04-12 Ravi Pratap <ravi@ximian.com>
15634 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15635 and get rid of is_delegate parameter.
15637 * everywhere : update.
15639 2002-04-12 Ravi Pratap <ravi@ximian.com>
15641 * cs-parser.jay (compilation_unit): Revamp completely to use
15642 some new ideas that I got from Rhys' grammar to solve the problems
15643 with assembly level attributes.
15645 (outer_declaration): New grammar production.
15647 (attribute_sections): Add.
15649 (opt_attributes): Base on attribute_sections
15651 (namespace_declaration): Allow opt_attributes to tackle the case
15652 when we have assembly level attributes - we are clever in this
15655 * attribute.cs (ApplyAttributes): Do not worry about assembly
15656 attributes in the non-global context.
15658 * rootcontext.cs (AddGlobalAttributes): Go back to using this
15659 instead of SetGlobalAttributes.
15661 * class.cs, rootcontext.cs : Ensure we define and generate
15662 attribute types before anything else.
15664 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15665 and flag the new error -20 for the case when the attribute type
15666 does not have valid targets specified. csc does not catch this.
15668 * ../errors/errors.txt : update for error # -20
15670 2002-04-11 Ravi Pratap <ravi@ximian.com>
15672 * support.cs (InternalParameters.ParameterModifier): Do some null
15673 checking and return sane values.
15675 * class.cs (Method.Define): If we are a PInvoke method, ensure
15676 that we are static and extern. Report error # 601
15678 * ../errors/cs0601.cs : Add test case for the above error.
15680 2002-04-07 Ravi Pratap <ravi@ximian.com>
15682 * rootcontext.cs (attribute_types): We need to keep type of
15683 all attribute types separately and emit code for them first.
15685 (RegisterAttribute) : Implement.
15687 * class.cs (DefineType): Check if the current Type is a custom
15688 attribute type and register it accordingly.
15690 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15691 adding the first attribute twice and rename to
15693 (SetGlobalAttributes): this.
15695 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15698 * attribute.cs (ApplyAttributes): Take an additional argument telling us
15699 if we are processing global arguments. Hmm, I am unsure of this.
15701 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15703 * expression.cs: added static array of strings to avoid calling
15704 Enum.ToString () for Operator in Binary. Significant recover of
15707 2002-04-10 Miguel de Icaza <miguel@ximian.com>
15709 * class.cs (FindMembers): Allow the Builders of the various
15710 members to be null. If they are skip them. This only happens
15711 during the PInvoke declaration.
15713 2002-04-09 Miguel de Icaza <miguel@ximian.com>
15715 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15716 failure, so we do not keep going afterwards.
15718 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15719 wanted to pass `false' as the `is_delegate' argument. If this is
15720 the case, why not use delegate_type == null to mean `is_delegate =
15721 false' and anything else as is_delegate = true.
15723 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
15725 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15726 code for the section, not the beginning of the tests.
15728 2002-04-08 Miguel de Icaza <miguel@ximian.com>
15730 * cfold.cs: Handle operator + (Enum x, Underlying x)
15732 * expression.cs (Binary): same. Warn about errors where we have
15733 Enum/Enum in operator + as well.
15735 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
15738 - added support for switch(bool)
15739 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15740 - add TableSwitchEmit() to handle table-based switch statements
15742 2002-04-05 Ravi Pratap <ravi@ximian.com>
15744 * expression.cs (Invocation.OverloadResolve): Factor out code which
15745 does parameter compatibility checking with arguments so that we can
15746 re-use the code even from Delegate.VerifyApplicability
15748 (VerifyArgumentsCompat): Move above code here.
15750 * delegate.cs (VerifyApplicability): Get rid of duplicate code
15751 and instead make a call to the above method.
15753 2002-03-31 Ravi Pratap <ravi@ximian.com>
15755 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15756 We use it to keep track of classes which are attribute types.
15758 2002-04-02 Miguel de Icaza <miguel@ximian.com>
15760 * delegate.cs (Delegate.Define): Correctly define the types in the
15761 presence of fixed and array parameters.
15763 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15766 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15767 include NonPublic after the first iteration.
15769 * class.cs (Indexer.CheckBase): Only check if both parents are
15772 * cs-parser.jay (accessor_body): If empty, set to null.
15774 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15775 same code path here to resolve constants names that we did have in
15776 MemberAccess.DoResolve. There is too much code duplicated here.
15778 2002-04-01 Miguel de Icaza <miguel@ximian.com>
15780 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15782 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15785 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15786 tokens, numbers and strings.
15788 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15791 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15792 asyncronous parameters and the regular parameters.
15794 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15795 specify the target directory.
15797 * expression.cs: (This.DoResolve): Simplify
15798 (As.Emit): Optimize, do not generate IsInst if the expression is
15799 always of the given type.
15801 (Is.DoResolve): Bug fix, we were reporting both always/never for
15804 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15805 creating too many unnecessary arrays.
15807 2002-03-31 Miguel de Icaza <miguel@ximian.com>
15809 * class.cs (EmitFieldInitializer): Use Assign expression to assign
15810 fields instead of rolling our own initializer. Takes care of all
15811 implicit conversions, and drops unnecessary static checks/argument.
15813 2002-03-31 Dick Porter <dick@ximian.com>
15815 * driver.cs: use the GetDirectories() return values properly, and
15816 use "/" as path separator.
15818 2002-03-30 Miguel de Icaza <miguel@ximian.com>
15820 * expression.cs (Unary): Optimize - - expr into expr.
15821 (Binary): Optimize a + (-b) into a -b.
15823 * codegen.cs (CodeGen): Made all methods static.
15825 2002-03-29 Miguel de Icaza <miguel@ximian.com>
15829 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15830 TypeBuilder property.
15832 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15835 * tree.cs: Removed the various RecordXXXX, and replaced with a
15836 single RecordDecl. Removed all the accessor methods, and just
15837 left a single access point Type
15839 * enum.cs: Rename DefineEnum to DefineType.
15841 * decl.cs: New abstract method `DefineType' used to unify the
15842 Defines for Enumerations, Interfaces, TypeContainers and
15845 (FindType): Moved LookupInterfaceOrClass here. Moved the
15846 LookupBaseClasses method that used to live in class.cs and
15847 interface.cs here, and renamed to FindType.
15849 * delegate.cs: Implement DefineType. Take advantage of the
15850 refactored pattern for locating the parent builder without taking
15851 the parent_builder argument (which we know does not work if we are
15852 nested, and triggering a toplevel definition).
15854 2002-03-28 Miguel de Icaza <miguel@ximian.com>
15856 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15857 accessibility of a member has changed during override and report
15860 * class.cs (Method.Define, Property.Define): Only complain on
15861 overrides if the method is private, any other accessibility is
15862 fine (and since we just checked the permission is the same, we are
15865 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15866 and elif are processed always. The other pre-processing
15867 directives are only processed if we are "taking" the path
15869 2002-03-29 Martin Baulig <martin@gnome.org>
15871 * class.cs (Method.Emit): Only emit symbolic debugging info if the
15872 current location is not Null.
15874 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15875 a separate method so we can profile it.
15877 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15878 `span.Seconds' are just seconds, but no minutes or hours.
15879 (MainDriver): Profile the CodeGen.SaveSymbols calls.
15881 2002-03-28 Miguel de Icaza <miguel@ximian.com>
15883 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15884 Remove the gratuitous set of Final:
15886 // If an interface implementation, then we can set Final.
15887 if (((flags & MethodAttributes.Abstract) == 0) &&
15888 implementing.DeclaringType.IsInterface)
15889 flags |= MethodAttributes.Final;
15891 I do not know what I was smoking when I used that.
15894 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15895 step into fixing the name resolution issues for delegates and
15896 unifying the toplevel name resolution.
15898 2002-03-28 Martin Baulig <martin@gnome.org>
15900 * class.cs (Method.Emit): If we have a symbol writer, call its
15901 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15902 tell it about the current method.
15904 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15905 writer that we're going to emit the first byte of IL code for a new
15906 statement (a new source line).
15907 (EmitContext.EmitTopBlock): If we have a symbol writer, call
15908 EmitContext.Mark() before emitting any code.
15910 * location.cs (SymbolDocument): Return null when we're Null.
15912 * statement.cs (Statement): Moved the `Location loc' variable here.
15913 (Statement.EmitBoolExpression): If we have a symbol writer, call
15914 ec.Mark() before emitting any code to tell it that we're at the
15915 beginning of a new statement.
15916 (StatementExpression): Added `Location' argument to the constructor.
15917 (Block): Added public readonly variable `StartLocation' and public
15918 variable `EndLocation'. The latter is to be set using SetEndLocation().
15919 (Block): Added constructor which takes a start and end location.
15920 (Block.SetEndLocation): New method. This sets the end location.
15921 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15922 local variables we create.
15923 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15924 each statement and do also mark the begin and end of the block.
15926 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15927 tell it the current lexer.Location, use Location.Null for the end of the
15929 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15930 current block, set its end location using SetEndLocation().
15931 (statement_expression): StatementExpression constructor now takes the
15932 lexer.Location as additional argument.
15933 (for_statement, declare_local_variables): Likewise.
15934 (declare_local_variables): When creating a new implicit block, use the
15935 new Block constructor and pass it the lexer.Location.
15937 2002-03-28 Miguel de Icaza <miguel@ximian.com>
15939 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15940 members also on the parent interfaces recursively.
15942 2002-03-27 Miguel de Icaza <miguel@ximian.com>
15944 * report.cs: Use new formats, since Gonzalo finished the missing
15947 * expression.cs (Binary.ResolveOperator): added missing operator|
15948 operator& and operator^ for bool/bool.
15950 * cs-parser.jay: CheckDef now takes a Location argument that is
15951 used to report errors more precisly (instead of reporting the end
15952 of a definition, we try to track something which is a lot closer
15953 to the source of the problem).
15955 * cs-tokenizer.cs: Track global token use, so we can properly flag
15956 the use of #define/#undef after the first token has been seen.
15958 Also, rename the reportXXXX to Error_DescriptiveName
15960 * decl.cs (DeclSpace.IsTopLevel): Move property here from
15961 TypeContainer, so that Enum and Interface can use this too.
15963 * class.cs (TypeContainer.LookupInterfaceOrClass,
15964 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15965 `builder' argument. Typically this was used to pass the parent
15966 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15969 The problem is that a nested class could trigger the definition of
15970 a toplevel class, and the builder would be obviously wrong in that
15973 So we drop this argument, and we compute dynamically the
15974 TypeBuilder/ModuleBuilder (the correct information was available
15975 to us anyways from DeclSpace.Parent)
15977 * interface.cs (Interface.DefineInterface): Drop builder
15978 parameter cleanup like class.cs
15980 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
15983 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15986 (Try.Emit): Propagate the returns value from the statement.
15988 (Return.Emit): Even if we are leavning
15990 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15992 * modifiers.cs: Fix the computation of MethodAttributes flags.
15994 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15996 * driver.cs: allow compilation of files that start with '/'.
15997 Add a default case when checking the argument of --target.
15999 2002-03-25 Miguel de Icaza <miguel@ximian.com>
16001 * interface.cs: Implement the same search algorithm for types in
16002 the interface code.
16004 * delegate.cs: Do not allow multiple definition.
16006 * Recovered ChangeLog that got accidentally amputated
16008 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16010 * rootcontext.cs: Load manually enum to allow core classes to
16011 contain enumerations.
16013 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16014 Update to new static methods in TypeManager.
16016 * typemanager.cs (GetMethod, GetConstructor): Use our
16017 implementation of FindMembers to find the members, since during
16018 corlib compilation, the types are TypeBuilders and GetMethod and
16019 GetConstructor do not work.
16021 Make all methods in TypeManager static.
16023 (InitCodeHelpers): Split the functionality from
16024 the InitCodeTypes function.
16026 * driver.cs: Call InitCodeHelpers after we have populated the
16029 * cs-parser.jay (delegate_declaration): we did not used to compute
16030 the delegate name correctly for void delegates.
16032 2002-03-24 Miguel de Icaza <miguel@ximian.com>
16034 * rootcontext.cs (RootContext): Init the interface_resolve_order
16035 and type_container_resolve_order always.
16037 (ResolveCore, BootstrapCorlib_ResolveClass,
16038 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16039 compiler when compiling with --nostdlib
16041 * class.cs (TypeContainer.DefineType): Check that our parent is
16042 not null. This test is most important when we are bootstraping
16045 * codegen.cs: Split out the symbol writing code.
16047 2002-03-25 Martin Baulig <martin@gnome.org>
16049 * driver.cs (-g): Made -g an alias for --debug.
16051 2002-03-24 Martin Baulig <martin@gnome.org>
16053 * codegen.cs (SymbolWriter): New public variable. Returns the
16054 current symbol writer.
16055 (CodeGen): Added `bool want_debugging_support' argument to the
16056 constructor. If true, tell the ModuleBuild that we want debugging
16057 support and ask it for the ISymbolWriter.
16058 (Save): If we have a symbol writer, call it's Close() method after
16059 saving the assembly.
16061 * driver.c (--debug): New command line argument to create a
16062 debugger information file.
16064 * location.cs (SymbolDocument): New public property. Returns an
16065 ISymbolDocumentWriter object for the current source file or null
16066 if we don't have a symbol writer.
16068 2002-03-21 Miguel de Icaza <miguel@ximian.com>
16070 * driver.cs (LoadAssembly): Correctly return when all the paths
16071 have been tried and not before.
16073 * statement.cs (Switch.Emit): return the actual coverage for this
16074 statement (returns/not-returns)
16076 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16077 switch of the statement if we are the last switch section. That
16078 kills two problems: try/catch problems (we used to emit an empty
16079 nop at the end) and switch statements where all branches would
16082 2002-03-19 Miguel de Icaza <miguel@ximian.com>
16084 * driver.cs: Add default assemblies (the equivalent to the
16085 Microsoft CSC.RSP file)
16087 * cs-tokenizer.cs: When updating `cols and setting it to zero,
16088 also update tokens_seen and set it to false.
16090 * driver.cs: Implement --recurse for Mike.
16092 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16093 correctly splitting out the paths.
16095 2002-03-18 Miguel de Icaza <miguel@ximian.com>
16097 * interface.cs (Interface.PopulateProperty): Instead of using
16098 `parent' as the declaration space for the set parameters, use
16101 * support.cs (InternalParameters): InternalParameters constructor
16102 takes a DeclSpace instead of a TypeContainer.
16104 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16105 types are being initialized, load the address of it before calling
16108 (New): Provide a mechanism to disable the generation of local
16109 value type temporaries when the caller will be providing us with
16110 an address to store it.
16112 (ArrayCreation.EmitDynamicInitializers): Use it.
16114 2002-03-17 Miguel de Icaza <miguel@ximian.com>
16116 * expression.cs (Invocation.EmitArguments): Only probe for array
16117 property if there is more than one argument. Sorry about that.
16119 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16120 empty param arrays.
16122 * class.cs (Method.LabelParameters): Fix incorrect code path that
16123 prevented the `ParamArrayAttribute' from being applied to the
16126 2002-03-16 Miguel de Icaza <miguel@ximian.com>
16128 * support.cs (ReflectionParameters): Correctly compute whether the
16129 last argument is a params array. Fixes the problem with
16132 * typemanager.cs: Make the assemblies array always be non-null
16133 (empty, but non-null)
16135 * tree.cs (RecordDecl): New function that abstracts the recording
16136 of names. This reports error 101, and provides a pointer to the
16137 previous declaration. Fixes a crash in the compiler.
16139 * cs-parser.jay (constructor_declaration): Update to new grammar,
16140 and provide a constructor_body that can be empty.
16142 2002-03-15 Miguel de Icaza <miguel@ximian.com>
16144 * driver.cs: Add support for --resources.
16146 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16147 Make all types for the various array helper methods be integer.
16149 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16150 CheckState to ConvCast.
16152 (ConvCast): Now it takes a `checked' state argument, to avoid
16153 depending on the emit context for the conversion, and just using
16154 the resolve time setting.
16156 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16157 instead of Invocation.EmitArguments. We do not emit the original
16158 arguments, instead we emit those which have been converted to
16159 unsigned int expressions.
16161 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16163 * codegen.cs: ditto.
16165 * expression.cs (LocalVariableReference): Drop the use of the
16166 Store function that depended on the variable index.
16168 * statement.cs (VariableInfo): Drop the `Idx' property from this
16169 class, as this is not taking into account the indexes for
16170 temporaries tat we generate during the execution, getting the
16173 * class.cs: First emit class initializers, then call the parent
16176 * expression.cs (Binary): Fix opcode emision.
16177 (UnaryMutator.EmitCode): Support checked code generation
16179 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16180 matches for events for both the Static and Instance scans,
16181 pointing to the same element. Fix that.
16183 2002-03-14 Miguel de Icaza <miguel@ximian.com>
16185 * rootcontext.cs (ResolveTree): Always set the
16186 interface_resolve_order, because nested interfaces will be calling
16189 * class.cs (GetInterfaceOrClass): Track the same resolution
16190 process used by TypeManager.LookupType. This fixes the nested
16191 type lookups in class declarations (separate path from
16194 (TypeContainer.DefineType): Also define nested interfaces.
16195 (TypeContainer.RegisterOrder): New public function used to
16196 register the order in which child interfaces need to be closed.
16198 Nested interfaces need to be closed after their parents have been
16201 * interface.cs (InterfaceAttr): Put all the logic for computing
16202 the interface attribute here.
16204 (DefineInterface): Register our interface order with the
16205 RootContext or with the TypeContainer depending on the case.
16207 2002-03-12 Miguel de Icaza <miguel@ximian.com>
16209 * cs-parser.jay: rework foreach statement to work with the new
16210 changes to the policy on SimpleNames.
16212 * report.cs: support Stacktrace on warnings as well.
16214 * makefile: drop --unsafe and /unsafe from the compile.
16216 2002-03-13 Ravi Pratap <ravi@ximian.com>
16218 * ecore.cs (StandardConversionExists): Modify to take an Expression
16219 as the first parameter. Ensure we do null -> reference type conversion
16222 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16223 temporary Expression objects.
16225 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16227 * interface.cs: workaround bug in method overloading resolution
16228 (there is already a bugzilla bug for it).
16230 2002-03-12 Miguel de Icaza <miguel@ximian.com>
16232 We could also solve this problem by having a separate path for
16233 performing type lookups, instead of DoResolve, we could have a
16234 ResolveType entry point, and only participating pieces of the
16235 production (simplename, deref, array) would implement this.
16237 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16238 signal SimpleName to only resolve type names and not attempt to
16239 resolve anything else.
16241 * expression.cs (Cast): Set the flag.
16243 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16245 * class.cs: Only report 108 if there is no `new' modifier.
16247 * cs-parser.jay: rework foreach statement to work with the new
16248 changes to the policy on SimpleNames.
16250 * report.cs: support Stacktrace on warnings as well.
16252 * makefile: drop --unsafe and /unsafe from the compile.
16254 2002-03-11 Miguel de Icaza <miguel@ximian.com>
16256 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16257 lookups here, instead of doing that at parse time. This means
16258 that our grammar will not introduce `LocalVariableReferences' as
16259 expressions at this point. That solves the problem of code like
16263 static void Main ()
16267 This is only half the fix. The full fix requires parameters to
16268 also be handled in this way.
16270 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16271 makes the use more obvious of the DeclSpace. The
16272 ec.TypeContainer.TypeBuilder is now only used to pull the
16273 TypeBuilder for it.
16275 My theory is that I can get rid of the TypeBuilder completely from
16276 the EmitContext, and have typecasts where it is used (from
16277 DeclSpace to where it matters).
16279 The only pending problem is that the code that implements Aliases
16280 is on TypeContainer, and probably should go in DeclSpace.
16282 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16283 lookups here, instead of doing that at parse time. This means
16284 that our grammar will not introduce `LocalVariableReferences' as
16285 expressions at this point. That solves the problem of code like
16289 static void Main ()
16293 This is only half the fix. The full fix requires parameters to
16294 also be handled in this way.
16296 * class.cs (Property.DefineMethod): When implementing an interface
16297 method, set newslot, when implementing an abstract method, do not
16298 set the flag (before we tried never setting it, or always setting
16299 it, which is the difference).
16300 (Indexer.DefineMethod): same.
16301 (Method.DefineMethod): same.
16303 * ecore.cs: Only set the status used flag if we get back a Field.
16305 * attribute.cs: Temporary hack, so Paolo can keep working.
16307 2002-03-08 Ravi Pratap <ravi@ximian.com>
16309 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16310 the unmanaged type in the case we have a MarshalAs attribute.
16312 (Resolve): Handle the case when we are parsing the special MarshalAs
16313 attribute [we need to store the unmanaged type to use later]
16315 * typemanager.cs (marshal_as_attr_type): Built in type for the
16316 MarshalAs Attribute.
16318 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
16319 on parameters and accordingly set the marshalling info.
16321 2002-03-09 Miguel de Icaza <miguel@ximian.com>
16323 * class.cs: Optimizing slightly by removing redundant code after
16324 we switched to the `NoTypes' return value.
16325 (Property.DefineMethod): use NoTypes here too.
16327 This fixes the bug I introduced in my last batch of changes.
16329 2002-03-05 Ravi Pratap <ravi@ximian.com>
16331 * tree.cs (RecordEnum): Add. We now keep track of enums too.
16333 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16334 Enums since those are types too.
16336 * cs-parser.jay (enum_declaration): Record enums as we parse them.
16338 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
16339 thanks to a call during the lookup process.
16341 2002-03-07 Miguel de Icaza <miguel@ximian.com>
16343 * statement.cs (Foreach): Lots of work to accomodate a particular
16344 kind of foreach statement that I had not kept in mind. It is
16345 possible to have foreachs on classes that provide a GetEnumerator
16346 method that return objects that implement the "pattern" for using
16347 a foreach, there is no need to support GetEnumerator
16350 This is needed to compile nant.
16352 * decl.cs: Only report 114 if the member is not `Finalize' and if
16353 the warning level is at least 2.
16355 * class.cs: Moved the compare function from Method to
16358 (MethodSignature.InheritableMemberSignatureCompare): Add new
16359 filter function that is used to extract inheritable methods from a
16362 (Method.Define): Use the new `inheritable_method_signature_filter'
16365 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16368 2002-03-06 Miguel de Icaza <miguel@ximian.com>
16370 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16372 * cs-parser.jay: Add opt_semicolon to the interface declaration.
16374 * expression.cs: Pass location information to
16375 ConvertImplicitStandard.
16377 * class.cs: Added debugging code to track return values from
16380 2002-03-05 Miguel de Icaza <miguel@ximian.com>
16382 * expression.cs (Is.DoResolve): If either side of the `is' is an
16383 interface, do not flag the warning.
16385 * ecore.cs (ImplicitReferenceConversion): We need a separate test
16388 * report.cs: Allow for --fatal to be used with --probe.
16390 * typemanager.cs (NoTypes): Move the definition for the empty Type
16393 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16395 (TypeContainer.DefineProxy): New function used to proxy to parent
16396 implementations when implementing interfaces.
16397 (TypeContainer.ParentImplements): used to lookup if our parent
16398 implements a public function that is required by an interface.
16399 (TypeContainer.VerifyPendingMethods): Hook this up.
16401 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16402 `modules' and `assemblies' arraylists into arrays. We only grow
16403 these are the very early start up of the program, so this improves
16404 the speedof LookupType (nicely measured).
16406 * expression.cs (MakeByteBlob): Replaced unsafe code with
16407 BitConverter, as suggested by Paolo.
16409 * cfold.cs (ConstantFold.Binary): Special case: perform constant
16410 folding of string concatenation, but if either side is a string,
16411 and the other is not, then return null, and let the runtime use
16412 the concatenation on the string plus the object (using
16413 `Object.ToString').
16415 2002-03-04 Miguel de Icaza <miguel@ximian.com>
16417 Constant Folding has been implemented now.
16419 * expression.cs (Unary.Reduce): Do not throw an exception, catch
16420 the error instead on types that are not supported in one's
16423 * constant.cs (Constant and all children): New set of functions to
16424 perform implict and explicit conversions.
16426 * ecore.cs (EnumConstant): Implement the new functions to perform
16427 conversion by proxying to the child expression.
16429 * codegen.cs: (ConstantCheckState): Constant evaluation has its
16430 own separate setting that can not be turned off from the command
16431 line using --unchecked or --checked and is only controlled using
16432 the checked/unchecked statements and expressions. This setting is
16433 used by the constant folder to flag errors.
16435 * expression.cs (CheckedExpr, UncheckedExpr): Set the
16436 ConstantCheckState as well.
16438 During Resolve, they also have to flag the state, because the
16439 constant folder runs completely in the Resolve phase.
16441 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16444 2002-03-01 Miguel de Icaza <miguel@ximian.com>
16446 * cfold.cs: New file, this file contains the constant folder.
16448 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16449 argument to track whether we are using the resulting address to
16450 load or store a value and provide better error messages.
16452 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16453 new AddressOf arguments.
16455 * statement.cs (Foreach.EmitCollectionForeach): Update
16457 * expression.cs (Argument.Emit): Call AddressOf with proper
16458 arguments to track usage.
16460 (New.DoEmit): Call AddressOf with new arguments.
16462 (Unary.Emit): Adjust AddressOf call.
16464 2002-03-01 Ravi Pratap <ravi@ximian.com>
16466 * cs-parser.jay (member_access): Change the case for pre-defined types
16467 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
16470 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16473 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16474 essentially like methods and apply attributes like MethodImplOptions to them too.
16476 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16479 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16480 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16483 * Update code everywhere accordingly.
16485 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16487 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16489 2002-02-28 Ravi Pratap <ravi@ximian.com>
16491 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16492 try performing lookups against those instead of jumping straight into using
16493 the 'using' clauses.
16495 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16497 (LookupType): Perform lookups in implicit parents too.
16499 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16500 sequence as RootContext.LookupType.
16502 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
16503 the various cases of namespace lookups into this method.
16505 2002-03-01 Miguel de Icaza <miguel@ximian.com>
16507 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16508 in positional arguments)
16510 * class.cs (Operator): Update the AllowedModifiers to contain
16513 * cs-parser.jay: Update operator declaration to allow for the
16514 operator body to be empty.
16516 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16519 2002-02-27 Miguel de Icaza <miguel@ximian.com>
16521 * class.cs (Method.Emit): Label parameters.
16523 * driver.cs: Return 1 or 0 as the program exit code.
16525 2002-02-26 Miguel de Icaza <miguel@ximian.com>
16527 * expression.cs: Special case the `null' object when trying to
16528 auto-compute the type, as anything can be explicitly converted to
16531 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16532 spotting this Paolo.
16534 (Expression.ImplicitNumericConversion): Perform comparissions of
16535 the type using the underlying type in the case of an enumeration
16536 rather than using the enumeration type for the compare.
16538 Cope with the underlying == type case, which is not possible to
16541 (Expression.ConvertNumericExplicit): Perform comparissions of
16542 the type using the underlying type in the case of an enumeration
16543 rather than using the enumeration type for the compare.
16545 * driver.cs: If the user does not supply an extension, assume .exe
16547 * cs-parser.jay (if_statement): Rewrote so that we can track the
16548 location for the if statement.
16550 * expression.cs (Binary.ConstantFold): Only concat strings when
16551 the operation is "+", not everything ;-)
16553 * statement.cs (Statement.EmitBoolExpression): Take a location
16555 (If, While, Do): Track location.
16557 * expression.cs (Binary.ResolveOperator): In the object + string
16558 case, I was missing a call to ConvertImplicit
16560 2002-02-25 Ravi Pratap <ravi@ximian.com>
16562 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16563 Location arguments. Ensure we use RootContext.LookupType to do our work
16564 and not try to do a direct Type.GetType and ModuleBuilder.GetType
16566 * interface.cs (PopulateMethod): Handle the type of the parameter being
16569 * expression.cs (Invocation.BetterFunction): Handle the case when we
16570 have a params method with no fixed arguments and a call is made with no
16573 2002-02-25 Miguel de Icaza <miguel@ximian.com>
16575 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16576 the verbatim-string-literal
16578 * support.cs (InternalParameters.ParameterModifier): handle null
16580 (InternalParameters.ParameterType): ditto.
16582 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16583 duplicating the name of the variable parameter.
16584 (GetParameterByName): Fix bug where we were not looking up array
16585 paramters if they were the only present (thanks Paolo!).
16586 (GetParameterInfo): We only have an empty set of types if both
16587 fixed and array are set to null.
16588 (GetParameterInfo-idx): Handle FixedParameter == null
16590 * cs-parser.jay: Handle the case where there is no catch
16591 statements (missing null test).
16593 2002-02-22 Miguel de Icaza <miguel@ximian.com>
16595 * driver.cs (MainDriver): Be conservative on our command line
16598 Catch DirectoryNotFoundException when calling GetFiles.
16600 (SplitPathAndPattern): Used to split the input specification into
16601 a path and a pattern that we can feed to Directory.GetFiles.
16603 2002-02-21 Miguel de Icaza <miguel@ximian.com>
16605 * statement.cs (Fixed): Implement the last case of the Fixed
16606 statement (string handling).
16608 * expression.cs (StringPtr): New class used to return a char * to
16609 a string; Used by the Fixed statement.
16611 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
16613 * expression.cs (Binary.ResolveOperator): Remove redundant
16614 MemberLookup pn parent type.
16615 Optimize union call, we do not need a union if the types are the same.
16616 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16619 Specialize the use of MemberLookup everywhere, instead of using
16620 the default settings.
16622 (StackAlloc): Implement stackalloc keyword.
16624 * cs-parser.jay: Add rule to parse stackalloc.
16626 * driver.cs: Handle /h, /help, /?
16628 * expression.cs (MakeByteBlob): Removed the hacks we had in place
16629 before we supported unsafe code.
16631 * makefile: add --unsafe to the self compilation of mcs.
16633 2002-02-20 Miguel de Icaza <miguel@ximian.com>
16635 * expression.cs (PointerArithmetic): New class that is used to
16636 perform pointer arithmetic.
16637 (Binary.Resolve): Handle pointer arithmetic
16638 Handle pointer comparission.
16639 (ArrayPtr): Utility expression class that is used to take the
16640 address of an array.
16642 (ElementAccess): Implement array access for pointers
16644 * statement.cs (Fixed): Implement fixed statement for arrays, we
16645 are missing one more case before we are done.
16647 * expression.cs (Indirection): Implement EmitAssign and set the
16648 ExprClass to Variable. This allows pointer dereferences to be
16649 treated as variables, and to have values assigned to them.
16651 * ecore.cs (Expression.StoreFromPtr): New utility function to
16652 store values dereferencing.
16654 2002-02-20 Ravi Pratap <ravi@ximian.com>
16656 * expression.cs (Binary.ResolveOperator): Ensure that we are
16657 not trying to operate on a void type - this fixes the reported
16660 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16661 the parent implementation is sealed.
16663 * ../errors/cs0239.cs : Add.
16665 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16667 * typemanager.cs (unverifiable_code_type): Corresponds to
16668 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16669 which have unsafe code in them.
16671 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
16674 2002-02-19 Miguel de Icaza <miguel@ximian.com>
16676 * cs-tokenizer.cs: Add support for @"litreal strings"
16678 Make tokenizer accept pre-processor directives
16679 on any column (remove the old C-like limitation).
16681 * rootcontext.cs (EmitCode): Emit any global attributes.
16682 (AddGlobalAttributes): Used to keep track of assembly attributes.
16684 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16686 * cs-parser.jay: Add support for global attributes.
16688 2002-02-17 Miguel de Icaza <miguel@ximian.com>
16690 * expression.cs (Indirection): New helper class. Unary will
16691 create Indirection classes to be able to implement the
16692 IMemoryLocation interface on it.
16694 2002-02-16 Miguel de Icaza <miguel@ximian.com>
16696 * cs-parser.jay (fixed_statement): reference the right statement.
16698 * statement.cs (Fixed.Emit): Finish implementing the fixed
16699 statement for the &x case.
16701 2002-02-14 Miguel de Icaza <miguel@ximian.com>
16703 * class.cs (Property.Define, Method.Define): Remove newslot when
16706 * modifiers.cs: My use of NewSlot when `Abstract' was set was
16707 wrong. NewSlot should only be used if the `new' keyword is present.
16709 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16710 locating our system dir. Sorry about this.
16712 2002-02-13 Miguel de Icaza <miguel@ximian.com>
16714 * driver.cs (GetSystemDir): Compute correctly the location of our
16715 system assemblies. I was using the compiler directory instead of
16716 the library directory.
16718 2002-02-13 Ravi Pratap <ravi@ximian.com>
16720 * expression.cs (BetterFunction): Put back in what Miguel commented out
16721 since it is the correct fix. The problem is elsewhere ;-)
16723 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16724 parameters of the parms method are themselves compatible or not !
16726 (StandardConversionExists): Fix very dangerous bug where we were forgetting
16727 to check that a class implements an interface before saying that an implicit
16728 conversion was allowed. Use ImplementsInterface to do the checking.
16730 2002-02-13 Miguel de Icaza <miguel@ximian.com>
16732 * class.cs (Method.Define): Track whether we are an explicit
16733 implementation or not. And only call DefineMethodOverride if we
16734 are an explicit implementation.
16736 (Property.DefineMethod): Ditto.
16738 2002-02-11 Ravi Pratap <ravi@ximian.com>
16740 * expression.cs (BetterFunction): Catch hideous bug which was
16741 preventing us from detecting ambiguous calls due to implicit casts i.e
16744 2002-01-29 Miguel de Icaza <miguel@ximian.com>
16746 * support.cs (Pair): Remove un-needed method. I figured why I was
16747 getting the error in cs-parser.jay, the variable in a foreach loop
16748 is readonly, and the compiler does not really treat this as a variable.
16750 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
16751 instead of EQUALS in grammar.
16753 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16755 * expression.cs (Unary.DoResolve): Check whether the argument is
16758 2002-01-28 Miguel de Icaza <miguel@ximian.com>
16760 * support.cs: Api for Pair to set a value. Despite the fact that
16761 the variables are public the MS C# compiler refuses to compile
16762 code that accesses the field if the variable is part of a foreach
16765 * statement.cs (Fixed): Begin implementation of the fixed
16768 (Block.AddVariable): Return the VariableInfo on success and null
16769 on failure instead of true/false.
16771 * cs-parser.jay (foreach): Catch errors on variables already
16772 defined (we were ignoring this value before) and properly unwind
16773 the block hierarchy
16775 (fixed_statement): grammar for the fixed statement.
16777 2002-01-25 Miguel de Icaza <miguel@ximian.com>
16779 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16780 pointer types to be incretemented.
16782 (SizeOf): Implement.
16784 * cs-parser.jay (pointer_member_access): Implement
16785 expr->IDENTIFIER production.
16787 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16788 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16791 (Unary): Implement indirection.
16793 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16794 use in non-unsafe context).
16796 (SimpleName.DoResolve): Check for pointers in field access on safe
16799 (Expression.LoadFromPtr): Factor the load-indirect code in this
16800 function. This was duplicated in UnboxCast and ParameterReference
16802 2002-01-24 Miguel de Icaza <miguel@ximian.com>
16804 * expression.cs (ComposedCast): report an error if a pointer cast
16805 is used in a safe region.
16807 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16808 pointer type casts in unsafe context.
16810 * codegen.cs (EmitContext): Set up IsUnsafe.
16812 * cs-parser.jay (non_expression_type): Add productions for pointer
16815 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16816 code. We should not use force into static mode if the method is
16817 not virtual. Fixes bug in MIS
16819 * statement.cs (Do.Emit, While.Emit, For.Emit,
16820 Statement.EmitBoolExpression): Add support to Do and While to
16821 propagate infinite loop as `I do return' semantics.
16823 Improve the For case to also test for boolean constants.
16825 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16826 to the list of attributes we can add.
16828 Remove `EmitContext' argument.
16830 * class.cs (Method.Define): Apply parameter attributes.
16831 (Constructor.Define): Apply parameter attributes.
16832 (MethodCore.LabelParameters): Move here the core of labeling
16835 * support.cs (ReflectionParameters.ParameterModifier,
16836 InternalParameters.ParameterModifier): Use IsByRef on the type and
16837 only return the OUT bit for these parameters instead of in/out/ref
16840 This is because I miss-understood things. The ParameterInfo.IsIn
16841 and IsOut represent whether the parameter has the [In] and [Out]
16844 2002-01-22 Miguel de Icaza <miguel@ximian.com>
16846 * ecore.cs (FieldExpr.Emit): Release temporaries.
16848 * assign.cs (LocalTemporary.Release): new function.
16850 * codegen.cs (EmitContext.GetTemporaryStorage,
16851 EmitContext.FreeTemporaryStorage): Rework the way we deal with
16852 temporary storage. Now we can "put back" localbuilders when we
16855 2002-01-21 Miguel de Icaza <miguel@ximian.com>
16857 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16858 need to make a copy of the variable to generate verifiable code.
16860 2002-01-19 Miguel de Icaza <miguel@ximian.com>
16862 * driver.cs: Compute dynamically the system directory.
16864 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16865 Slower, but more generally useful. Used by the abstract
16866 registering implementation.
16868 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16869 the rules for the special rule on Type/instances. First check if
16870 we have the same name, and if so, try that special static path
16871 rather than the instance path.
16873 2002-01-18 Miguel de Icaza <miguel@ximian.com>
16875 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16878 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16879 Enum, ValueType, Delegate or Array for non-corlib compiles.
16881 * cs-tokenizer.cs: Catch long identifiers (645)
16883 * typemanager.cs (IndexerPropetyName): Ravi never tested this
16886 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16887 fix, we were returning too early, so we were not registering
16888 pending methods from abstract classes.
16890 Do not register pending methods if the class is abstract.
16892 * expression.cs (Conditional.DoResolve): Report circular implicit
16893 conversions when we neecd to compute it for conditional
16896 (Is.DoResolve): If the expression is always of the provided type,
16897 flag warning 183. If the expression can not ever be of the
16898 provided type flag warning 184.
16900 * class.cs: Catch 169 as well.
16902 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16905 2002-01-18 Nick Drochak <ndrochak@gol.com>
16907 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
16909 2002-01-17 Miguel de Icaza <miguel@ximian.com>
16911 * interface.cs: (PopulateMethod): Check for pointers being defined
16912 only if the unsafe context is active.
16913 (PopulateProperty): ditto.
16914 (PopulateIndexer): ditto.
16916 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16917 specified. If pointers are present, make sure that they are
16918 present in an unsafe context.
16919 (Constructor, Constructor.Define): ditto.
16920 (Field, Field.Define): ditto.
16921 (Property, Property.Define): ditto.
16922 (Event, Event.Define): ditto.
16924 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16925 hashtable if there are classes or structs defined.
16927 * expression.cs (LocalVariableReference.DoResolve): Simplify this
16928 code, as the constant resolution moved.
16930 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16931 the metadata, so we can flag error 133.
16933 * decl.cs (MemberCore.UnsafeOK): New function to test that a
16934 pointer is being declared in an unsafe context.
16936 2002-01-16 Miguel de Icaza <miguel@ximian.com>
16938 * modifiers.cs (Modifiers.Check): Require a Location argument.
16939 Report error 227 for Unsafe use.
16941 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16943 * statement.cs (For.Emit): If the test is null, then report that
16944 we do `return', as we wont reach anything afterwards.
16946 (Switch.SwitchGoverningType): Track the expression that matched
16949 * driver.cs: Allow negative numbers as an error code to flag.
16951 * cs-parser.jay: Handle 1551.
16953 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16955 2002-01-15 Miguel de Icaza <miguel@ximian.com>
16957 * cs-parser.jay: Report 1518 (type declaration can only contain
16958 class, struct, interface, enum or delegate)
16960 (switch_label): Report 1523 (keywords `case' or `default' must
16963 (opt_switch_sections): Report 1522 (empty switch)
16965 * driver.cs: Report 1515 (response file specified multiple times)
16966 Report 1516 (Source file specified multiple times).
16968 * expression.cs (Argument.Resolve): Signal 1510
16970 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16971 access not allowed in static code)
16973 2002-01-11 Ravi Pratap <ravi@ximian.com>
16975 * typemanager.cs (IsPointerType): Utility method which we are going
16978 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16979 the object type, so we take care of that.
16981 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16983 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16984 added to non-params parameters :-)
16986 * typemanager.cs (CSharpName): Include 'void' type too.
16988 (void_ptr_type): Include in the set of core types.
16990 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
16993 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
16996 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
16997 completely forgotten about it.
16999 2002-01-10 Ravi Pratap <ravi@ximian.com>
17001 * cs-parser.jay (pointer_type): Add. This begins our implementation
17002 of parsing rules for unsafe code.
17004 (unsafe_statement): Implement.
17006 (embedded_statement): Modify to include the above.
17008 * statement.cs (Unsafe): Implement new class for unsafe blocks.
17010 * codegen.cs (EmitContext.InUnsafe): Add. This determines
17011 if the current context is an unsafe one.
17013 * cs-parser.jay (local_variable_pointer_type): Since local variable types
17014 are handled differently, we need separate rules for them.
17016 (local_variable_declaration): Update to use local_variable_pointer_type
17017 to allow variable declarations of unmanaged pointer types.
17019 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17020 in unsafe contexts.
17022 * ../errors/cs0214.cs : Add.
17024 2002-01-16 Nick Drochak <ndrochak@gol.com>
17026 * makefile: remove 'response' file when cleaning.
17028 2002-01-15 Miguel de Icaza <miguel@ximian.com>
17030 * cs-parser.jay: Report 1524.
17032 2002-01-14 Miguel de Icaza <miguel@ximian.com>
17034 * typemanager.cs (RegisterMethod): drop checking if we have
17035 registered this from here
17037 2002-01-12 Miguel de Icaza <miguel@ximian.com>
17039 * class.cs (Method.EmitDestructor): Implement calling our base
17042 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17043 value of InFinally.
17045 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17046 this routine and will wrap the call in a try/catch block. Deal
17049 2002-01-11 Miguel de Icaza <miguel@ximian.com>
17051 * ecore.cs (Expression.MemberLookup): instead of taking a
17052 parameter `same_type' that was used to tell whether we could
17053 access private members we compute our containing type from the
17056 (FieldExpr): Added partial support for volatile fields. This does
17057 not work for volatile fields exposed from assemblies, as I can not
17058 figure out how to extract the modreq from it.
17060 Updated all the source files to use this.
17062 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17063 because it is referenced by MemberLookup very often.
17065 2002-01-09 Ravi Pratap <ravi@ximian.com>
17067 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17068 TypeBuilder.GetCustomAttributes to retrieve what we need.
17070 Get rid of redundant default_member_attr_type as this is the same as
17071 default_member_type which already exists.
17073 * interface.cs, attribute.cs : Update accordingly.
17075 2002-01-08 Miguel de Icaza <miguel@ximian.com>
17077 * typemanager.cs: Enable IndexerPropertyName again. It does not
17078 work for TYpeBuilders though. Ravi, can you please fix this?
17080 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17082 * expression.cs (Argument.Emit): Handle the case of ref objects
17083 being passed to ref functions;
17085 (ParameterReference.EmitLoad): Loads the content of the pointer
17086 without dereferencing.
17088 2002-01-07 Miguel de Icaza <miguel@ximian.com>
17090 * cs-tokenizer.cs: Implemented the pre-processing expressions.
17092 2002-01-08 Ravi Pratap <ravi@ximian.com>
17094 * class.cs (Indexer.DefineMethod): Incorporate the interface
17095 type in the name of the method if we are doing explicit interface
17098 * expression.cs (ConversionExists): Remove as it is completely obsolete.
17100 (BetterConversion): Fix extremely trivial bug where we were referring to
17101 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17104 * ../errors/bug16.cs : Add although we have fixed it.
17106 2002-01-07 Miguel de Icaza <miguel@ximian.com>
17108 * expression.cs (BaseIndexer): Begin implementation.
17110 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17112 * cs-parser.jay (indexer_declarator): Use qualified_identifier
17113 production directly to remove a shift/reduce, and implement
17114 explicit interface implementation.
17116 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17117 after a floating point suffix.
17119 * expression.cs (DoNumericPromotions): Improved the conversion for
17120 uint/uint. If we have a constant, we avoid doing a typecast to a
17123 * class.cs (Indexer): Implement explicit interface implementation
17126 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17128 * class.cs: make the default instance constructor public and hidebysig.
17130 2001-01-03 Ravi Pratap <ravi@ximian.com>
17132 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17133 so we can call it from elsewhere.
17135 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17136 we emit it internally if the class has a defined indexer; otherwise the user
17137 emits it by decorating the class definition with the DefaultMemberAttribute.
17139 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17140 attribute is not used on a type which defines an indexer.
17142 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17143 character when we skip whitespace.
17145 * ../errors/cs0646.cs : Add.
17147 2002-01-03 Miguel de Icaza <miguel@ximian.com>
17149 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17152 * makefile: Add practical target `mcs3.exe' which builds the third
17153 generation compiler.
17155 * expression.cs (New): Fix structures constructor calling.
17157 * class.cs (Property, Method, Indexer): Emit Final flag on the
17158 method if we are an interface implementation and we are not
17161 * ecore.cs (PropertyExpr): New public field `IsBase', tells
17162 whether this property is referencing a `base' method.
17164 * expression.cs (Invocation.EmitCall): take an extra argument:
17165 is_base, this is used to determine whether the `call' or
17166 `callvirt' opcode should be used.
17169 * delegate.cs: update EmitCall.
17171 * class.cs (Method.Define): Set NewSlot for the cases where we are
17172 not implementing an interface method.
17174 (Property.Define): ditto.
17176 2002-01-02 Miguel de Icaza <miguel@ximian.com>
17178 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17179 'r'. Allows mcs to parse itself fully.
17181 2002-01-02 Ravi Pratap <ravi@ximian.com>
17183 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17184 of the number of initializers that require the InitializeArray method.
17186 (CheckIndices): Store the Expression in all cases - not the plain value. Also
17187 update the above field where necessary.
17189 (MakeByteBlob): Update accordingly.
17191 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
17194 (EmitDynamicInitializers): Update in accordance with the new optimization.
17196 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17197 same OpCode applies.
17199 * cs-parser.jay : Fix some glaring errors I introduced.
17201 2002-01-01 Ravi Pratap <ravi@ximian.com>
17203 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17204 so that we can check for name clashes there too.
17206 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17207 for interface indexers.
17209 * interfaces.cs (Define): Emit the default member attribute.
17211 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17212 variable was being referred to while setting the value ;-)
17214 2002-01-01 Miguel de Icaza <miguel@ximian.com>
17216 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17217 byte-by-byte information when we know the data is zero.
17219 Make the block always a multiple of 4, because
17220 DefineInitializedData has a bug.
17222 * assign.cs: Fix, we should assign from the temporary, not from
17225 * expression.cs (MakeByteBlob): Fix my incorrect code.
17227 2001-12-31 Miguel de Icaza <miguel@ximian.com>
17229 * typemanager.cs (EnumToUnderlying): This function is used to get
17230 the underlying type from an enumeration, because it does not
17233 * constant.cs: Use the I4_S form for values between -128 and 127.
17235 * statement.cs (Block.LookupLabel): Looks up a label.
17236 (Block): Drop support for labeled blocks.
17238 (LabeledStatement): New kind of statement that represents a label
17241 (Goto): Finally implement this bad boy.
17243 * cs-parser.jay: Update to reflect new mechanism to implement
17246 2001-12-30 Miguel de Icaza <miguel@ximian.com>
17248 * codegen.cs (EmitContext.This): a codegen property that keeps the
17249 a single instance of this instead of creating many different this
17252 * delegate.cs (Delegate.DoResolve): Update to use the property;
17254 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17256 * expression.cs (BaseAccess.DoResolve): Ditto.
17258 2001-12-29 Ravi Pratap <ravi@ximian.com>
17260 * typemanager.cs (methodimpl_attr_type): Add to hold the type
17261 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17263 (InitCoreTypes): Update accordingly.
17265 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17266 so we can quickly store the state.
17268 (ApplyAttributes): Set the correct implementation flags
17269 for InternalCall methods.
17271 2001-12-29 Miguel de Icaza <miguel@ximian.com>
17273 * expression.cs (EmitCall): if a method is not virtual, then do
17274 not use callvirt on it.
17276 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17277 user defined stuff) requires the use of stobj, which takes an
17278 address on the stack instead of an array and an index. So emit
17279 the Ldelema operation for it.
17281 (EmitStoreOpcode): Use stobj for valuetypes.
17283 (UnaryMutator.EmitCode): Use the right 1 value depending on
17284 whether we are dealing with int64/uint64, float or doubles.
17286 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17287 constructors that I implemented last night.
17289 (Constructor.IsDefault): Fix to work properly for static
17292 * cs-parser.jay (CheckDef): report method signature errors.
17293 Update error number 103 to be 132.
17295 * decl.cs: New AdditionResult enumeration value: MethodExists.
17296 Although we do this check for methods later on in the semantic
17297 analysis, catching repeated default constructors is so easy that
17298 we catch these here.
17300 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17303 (ParameterReference.EmitAssign, Emit): handle
17306 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17307 (ArrayAccess.EmitStoreOpcode): ditto.
17309 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17311 * expression.cs (MakeByteBlob): Complete all the missing types
17312 (uint, short, ushort, byte, sbyte)
17314 * class.cs: Only init instance field initializers on instance
17317 Rename `constructors' to instance_constructors.
17319 (TypeContainer.AddConstructor): Only add constructors to the list
17320 if it is not static.
17322 Make sure that we handle default_static_constructor independently
17323 everywhere where we handle instance_constructors
17325 2001-12-28 Miguel de Icaza <miguel@ximian.com>
17327 * class.cs: Do not lookup or create a base initializer for a
17328 static constructor.
17330 (ConstructorInitializer.Resolve): use the proper type to lookup
17333 * cs-parser.jay: Report error 1585 (modifiers between type and name).
17335 * enum.cs, interface.cs: Remove CloseType, this is taken care by
17338 * decl.cs: CloseType is now an virtual method, the default
17339 implementation just closes this type.
17341 2001-12-28 Ravi Pratap <ravi@ximian.com>
17343 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17344 to PreserveSig by default. Also emit HideBySig on such methods.
17346 Basically, set the defaults to standard values.
17348 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17349 argument, if candidate is better, it can't be worse than the best !
17351 (Invocation): Re-write bits to differentiate between methods being
17352 applicable in their expanded form and their normal form - for params
17355 Get rid of use_standard everywhere as only standard conversions are allowed
17356 in overload resolution.
17358 More spec conformance.
17360 2001-12-27 Miguel de Icaza <miguel@ximian.com>
17362 * driver.cs: Add --timestamp, to see where the compiler spends
17365 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17366 `this' in static code.
17368 (SimpleName.DoResolve): Implement in terms of a helper function
17369 that allows static-references to be passed upstream to
17372 (Expression.ResolveWithSimpleName): Resolve specially simple
17373 names when called by MemberAccess to implement the special
17376 (Expression.ImplicitReferenceConversion): Handle conversions from
17377 Null to reference types before others, as Null's type is
17380 * expression.cs (Invocation.EmitCall): Handle the special case of
17381 calling methods declared on a reference type from a ValueType
17382 (Base classes System.Object and System.Enum)
17384 (MemberAccess.Resolve): Only perform lookups on Enumerations if
17385 the left hand side is a TypeExpr, not on every enumeration.
17387 (Binary.Resolve): If types are reference types, then do a cast to
17388 object on operators != and == of both arguments.
17390 * typemanager.cs (FindMembers): Extract instance and static
17391 members if requested.
17393 * interface.cs (PopulateProperty): Use void_type instead of null
17394 as the return type for the setter method.
17396 (PopulateIndexer): ditto.
17398 2001-12-27 Ravi Pratap <ravi@ximian.com>
17400 * support.cs (ReflectionParameters): Fix minor bug where we
17401 were examining the wrong parameter for the ParamArray attribute.
17403 Cope with requests for the type of the parameter at position
17404 greater than the params parameter's. We now return the element
17405 type of the params array as that makes more sense.
17407 * expression.cs (Invocation.IsParamsMethodApplicable): Update
17408 accordingly as we no longer have to extract the element type
17411 (Invocation.OverloadResolve): Update.
17413 2001-12-27 Miguel de Icaza <miguel@ximian.com>
17415 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17416 against IEnumerator, test whether the return value is a descendant
17417 of the IEnumerator interface.
17419 * class.cs (Indexer.Define): Use an auxiliary method to implement
17420 the other bits of the method definition. Begin support for
17421 explicit interface implementation.
17423 (Property.DefineMethod): Use TypeManager.void_type instead of null
17424 for an empty return value.
17426 2001-12-26 Miguel de Icaza <miguel@ximian.com>
17428 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17429 dealing with a FieldExpr which is composed of a FieldBuilder, in
17430 the code path we did extract the constant, but we should have
17431 obtained the underlying value to be able to cast it (otherwise we
17432 end up in an infinite loop, this is what Ravi was running into).
17434 (ArrayCreation.UpdateIndices): Arrays might be empty.
17436 (MemberAccess.ResolveMemberAccess): Add support for section
17437 14.5.4.1 that deals with the special case of E.I when E is a type
17438 and something else, that I can be a reference to a static member.
17440 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17441 handle a particular array type to create byte blobs, it is just
17442 something we dont generate byteblobs for.
17444 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17447 * location.cs (Push): remove the key from the hashtable that we
17448 are about to add. This happens for empty files.
17450 * driver.cs: Dispose files after we have parsed them.
17452 (tokenize): new function that only runs the tokenizer on its
17453 input, for speed testing.
17455 2001-12-26 Ravi Pratap <ravi@ximian.com>
17457 * class.cs (Event.Define): Define the private field only if there
17458 are no accessors defined.
17460 * expression.cs (ResolveMemberAccess): If there is no associated
17461 field with the event, that means we have an event defined with its
17462 own accessors and we should flag error cs0070 since transforming
17463 ourselves into a field is not valid in that case.
17465 * ecore.cs (SimpleName.DoResolve): Same as above.
17467 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17468 and charset to sane values.
17470 2001-12-25 Ravi Pratap <ravi@ximian.com>
17472 * assign.cs (DoResolve): Perform check on events only if they
17473 are being accessed outside the declaring type.
17475 * cs-parser.jay (event_declarations): Update rules to correctly
17476 set the type of the implicit parameter etc.
17478 (add_accessor, remove_accessor): Set current local parameters.
17480 * expression.cs (Binary): For delegate addition and subtraction,
17481 cast the return value from the method into the appropriate delegate
17484 2001-12-24 Ravi Pratap <ravi@ximian.com>
17486 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17487 of these as the workaround is unnecessary.
17489 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17490 delegate data - none of that is needed at all.
17492 Re-write bits to extract the instance expression and the delegate method
17495 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
17498 * attribute.cs (ApplyAttributes): New method to take care of common tasks
17499 of attaching attributes instead of duplicating code everywhere.
17501 * everywhere : Update code to do attribute emission using the above method.
17503 2001-12-23 Miguel de Icaza <miguel@ximian.com>
17505 * expression.cs (IsParamsMethodApplicable): if there are not
17506 parameters, return immediately.
17508 * ecore.cs: The 0 literal can be implicity converted to an enum
17511 (SimpleName.DoResolve): First lookup the type, then lookup the
17514 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17515 want to get its address. If the InstanceExpression is not
17516 addressable, store the result in a temporary variable, then get
17519 * codegen.cs: Only display 219 errors on warning level or above.
17521 * expression.cs (ArrayAccess): Make it implement the
17522 IMemoryLocation interface.
17524 (Binary.DoResolve): handle the operator == (object a, object b)
17525 and operator != (object a, object b) without incurring into a
17526 BoxedCast (because 5 != o should never be performed).
17528 Handle binary enumerator operators.
17530 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17531 value type, otherwise use Ldelem_ref.
17533 Use precomputed names;
17535 (AddressOf): Implement address of
17537 * cs-parser.jay (labeled_statement): Fix recursive block
17538 addition by reworking the production.
17540 * expression.cs (New.DoEmit): New has a special case:
17542 If we are dealing with a ValueType, we have a few
17543 situations to deal with:
17545 * The target of New is a ValueType variable, that is
17546 easy, we just pass this as the variable reference
17548 * The target of New is being passed as an argument,
17549 to a boxing operation or a function that takes a
17552 In this case, we need to create a temporary variable
17553 that is the argument of New.
17556 2001-12-23 Ravi Pratap <ravi@ximian.com>
17558 * rootcontext.cs (LookupType): Check that current_type is not null before
17559 going about looking at nested types.
17561 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17562 not implement the IAssignMethod interface any more.
17564 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17565 where we tranform them into FieldExprs if they are being resolved from within
17566 the declaring type.
17568 * ecore.cs (SimpleName.DoResolve): Do the same here.
17570 * assign.cs (DoResolve, Emit): Clean up code considerably.
17572 * ../errors/bug10.cs : Add.
17574 * ../errors/cs0070.cs : Add.
17576 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17578 * assign.cs : Get rid of EventIsLocal everywhere.
17580 2001-12-23 Miguel de Icaza <miguel@ximian.com>
17582 * ecore.cs (ConvertIntLiteral): finished the implementation.
17584 * statement.cs (SwitchLabel): Convert the value we are using as a
17585 key before looking up the table.
17587 2001-12-22 Miguel de Icaza <miguel@ximian.com>
17589 * codegen.cs (EmitTopBlock): Require a Location argument now.
17591 * cs-parser.jay (constructor_declarator): We need to setup
17592 current_local_parameters before we parse the
17593 opt_constructor_initializer, to allow the variables to be bound
17594 to the constructor arguments.
17596 * rootcontext.cs (LookupType): First lookup nested classes in our
17597 class and our parents before we go looking outside our class.
17599 * expression.cs (ConstantFold): Extract/debox the values at the
17602 * rootcontext.cs (EmitCode): Resolve the constants first before we
17603 resolve the types. This is not really needed, but it helps debugging.
17605 * statement.cs: report location.
17607 * cs-parser.jay: pass location to throw statement.
17609 * driver.cs: Small bug fix.
17611 * report.cs: Updated format to be 4-zero filled digits.
17613 2001-12-22 Ravi Pratap <ravi@ximian.com>
17615 * expression.cs (CheckIndices): Fix minor bug where the wrong
17616 variable was being referred to ;-)
17618 (DoEmit): Do not call EmitStaticInitializers when the
17619 underlying type is System.Object.
17621 2001-12-21 Ravi Pratap <ravi@ximian.com>
17623 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17624 and do the usual workaround for SRE.
17626 * class.cs (MyEventBuilder.EventType): New member to get at the type
17627 of the event, quickly.
17629 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17631 * assign.cs (Assign.DoResolve): Handle the case when the target
17632 is an EventExpr and perform the necessary checks.
17634 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17637 (SimpleName.MemberStaticCheck): Include check for EventExpr.
17639 (EventExpr): Set the type in the constructor itself since we
17640 are meant to be born fully resolved.
17642 (EventExpr.Define): Revert code I wrote earlier.
17644 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17645 instance expression is null. The instance expression is a This in that case
17646 or a null, depending on whether it is a static method or not.
17648 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17649 refers to more than one method.
17651 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17652 and accordingly flag errors.
17654 2001-12-21 Miguel de Icaza <miguel@ximian.com>
17656 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17658 2001-12-22 Miguel de Icaza <miguel@ximian.com>
17660 * location.cs (ToString): Provide useful rutine.
17662 2001-12-21 Miguel de Icaza <miguel@ximian.com>
17664 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17665 objects, return the actual integral boxed.
17667 * statement.cs (SwitchLabel): define an ILLabel for each
17670 (Switch.CheckSwitch): If the value is a Literal, extract
17671 the underlying literal.
17673 Also in the unused hashtable we had, add the SwitchLabel so we can
17674 quickly look this value up.
17676 * constant.cs: Implement a bunch of new constants. Rewrite
17677 Literal based on this. Made changes everywhere to adapt to this.
17679 * expression.cs (Expression.MakeByteBlob): Optimize routine by
17680 dereferencing array only once, and also copes with enumrations.
17682 bytes are two bytes wide, not one.
17684 (Cast): Perform constant conversions.
17686 * ecore.cs (TryImplicitIntConversion): Return literals instead of
17687 wrappers to the literals here.
17689 * expression.cs (DoNumericPromotions): long literals can converted
17690 to ulong implicity (this is taken care of elsewhere, but I was
17691 missing this spot).
17693 * ecore.cs (Expression.Literalize): Make the return type Literal,
17694 to improve type checking.
17696 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17698 2001-12-20 Miguel de Icaza <miguel@ximian.com>
17700 * literal.cs: Revert code from ravi that checked the bounds. The
17701 bounds are sane by the definition of the type itself.
17703 * typemanager.cs: Fix implementation of ImplementsInterface. We
17704 need to actually look up in our parent hierarchy for interfaces
17707 * const.cs: Use the underlying type for enumerations
17709 * delegate.cs: Compute the basename for the delegate creation,
17710 that should fix the delegate test case, and restore the correct
17711 Type Lookup semantics in rootcontext
17713 * rootcontext.cs: Revert Ravi's last patch. The correct way of
17714 referencing a nested type with the Reflection API is using the "+"
17717 * cs-parser.jay: Do not require EOF token at the end.
17719 2001-12-20 Ravi Pratap <ravi@ximian.com>
17721 * rootcontext.cs (LookupType): Concatenate type names with
17722 a '.' instead of a '+' The test suite passes again.
17724 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17725 field of the enumeration.
17727 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17728 the case when the member is an EventExpr.
17730 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17731 static has an associated instance expression.
17733 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17735 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17737 * class.cs (Event.Define): Register event and perform appropriate checks
17740 We define the Add and Remove methods even if the use provides none because
17741 in that case, we provide default implementations ourselves.
17743 Define a private field of the type of the event. This is done by the CSC compiler
17744 and we should be doing it too ;-)
17746 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17747 More methods we use in code we generate.
17749 (multicast_delegate_type, delegate_type): Two separate types since the distinction
17752 (InitCoreTypes): Update accordingly for the above.
17754 * class.cs (Event.Emit): Generate code for default accessors that we provide
17756 (EmitDefaultMethod): Do the job in the above.
17758 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
17761 2001-12-20 Miguel de Icaza <miguel@ximian.com>
17763 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17764 builders even if we were missing one.
17766 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17767 pass the Basename as our class name instead of the Name. The
17768 basename will be correctly composed for us.
17770 * parameter.cs (Paramters): Now takes a Location argument.
17772 * decl.cs (DeclSpace.LookupType): Removed convenience function and
17773 make all the code call directly LookupType in RootContext and take
17774 this chance to pass the Location information everywhere.
17776 * Everywhere: pass Location information.
17778 2001-12-19 Miguel de Icaza <miguel@ximian.com>
17780 * class.cs (Constructor.Define): Updated way of detecting the
17781 length of the parameters.
17783 (TypeContainer.DefineType): Use basename as the type name for
17786 (TypeContainer.Define): Do not recursively define types here, as
17787 definition is taken care in order by the RootContext.
17789 * tree.cs: Keep track of namespaces in a per-file basis.
17791 * parameter.cs (Parameter.ComputeSignature): Update to use
17794 (Parameters.GetSignature): ditto.
17796 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17797 instead of a TypeContainer.
17799 (Interface.SemanticAnalysis): Use `this' instead of our parent to
17800 resolve names. Because we need to be resolve in our context, not
17803 * driver.cs: Implement response files.
17805 * class.cs (TypeContainer.DefineType): If we are defined, do not
17806 redefine ourselves.
17808 (Event.Emit): Emit the code for add/remove handlers.
17809 (Event.Define): Save the MethodBuilders for add/remove.
17811 * typemanager.cs: Use pair here too.
17813 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17814 DictionaryEntry requires the first argument to be non-null.
17816 (enum_declaration): Compute full name for registering the
17819 (delegate_declaration): Instead of using
17820 formal_parameter_list, use opt_formal_parameter_list as the list
17823 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17824 (EventParsing): New property that controls whether `add' and
17825 `remove' are returned as tokens or identifiers (for events);
17827 2001-12-19 Ravi Pratap <ravi@ximian.com>
17829 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17830 use MyEventBuilder only and let it wrap the real builder for us.
17832 (MyEventBuilder): Revamp constructor etc.
17834 Implement all operations that we perform on EventBuilder in precisely the same
17837 (FindMembers): Update to use the EventBuilder member.
17839 (Event.Emit): Update accordingly.
17841 2001-12-18 Ravi Pratap <ravi@ximian.com>
17843 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17844 by calling the appropriate methods.
17846 (GetCustomAttributes): Make stubs as they cannot possibly do anything
17849 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17851 2001-12-17 Ravi Pratap <ravi@ximian.com>
17853 * delegate.cs (Delegate.Populate): Check that the return type
17854 and various parameters types are indeed accessible.
17856 * class.cs (Constructor.Define): Same here.
17858 (Field.Define): Ditto.
17860 (Event.Define): Ditto.
17862 (Operator.Define): Check that the underlying Method defined itself
17863 correctly - so it's MethodBuilder should not be null.
17865 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17866 expression happens to be null.
17868 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17869 members but as of now we don't seem to be able to do anything really useful with it.
17871 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17872 not the EventBuilder.
17874 2001-12-18 Miguel de Icaza <miguel@ximian.com>
17876 * cs-tokenizer.cs: Add support for defines.
17877 Add support for #if, #elif, #else, #endif
17879 (eval_var): evaluates a variable.
17880 (eval): stubbed for evaluating functions.
17882 * cs-parser.jay: Pass the defines information
17884 * driver.cs: Add --define command line option.
17886 * decl.cs: Move MemberCore here.
17888 Make it the base class for DeclSpace. This allows us to catch and
17889 report 108 and 109 for everything now.
17891 * class.cs (TypeContainer.Define): Extract all the members
17892 before populating and emit the warning 108 (new keyword required
17893 to override) instead of having each member implement this.
17895 (MemberCore.Define): New abstract method, we will be using this in
17896 the warning reporting engine in Populate.
17898 (Operator.Define): Adjust to new MemberCore protocol.
17900 * const.cs (Const): This does not derive from Expression, it is a
17901 temporary object we use to create fields, it is a MemberCore.
17903 * class.cs (Method.Define): Allow the entry point to be in a
17906 * driver.cs: Rewrite the argument handler to clean it up a bit.
17908 * rootcontext.cs: Made it just an auxiliary namespace feature by
17909 making everything static.
17911 * driver.cs: Adapt code to use RootContext type name instead of
17914 * delegate.cs: Remove RootContext argument.
17916 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17919 * class.cs (Event.Define): The lookup can fail.
17921 * cs-tokenizer.cs: Begin implementation of pre-procesor.
17923 * expression.cs: Resolve the this instance before invoking the code.
17925 2001-12-17 Miguel de Icaza <miguel@ximian.com>
17927 * cs-parser.jay: Add a production in element_access that allows
17928 the thing to become a "type" reference. This way we can parse
17929 things like "(string [])" as a type.
17931 Note that this still does not handle the more complex rules of
17935 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
17937 * ecore.cs: (CopyNewMethods): new utility function used to
17938 assemble the list of methods from running FindMembers.
17940 (MemberLookup): Rework FindMembers so that
17942 2001-12-16 Miguel de Icaza <miguel@ximian.com>
17944 * class.cs (TypeContainer): Remove Delegates who fail to be
17947 * delegate.cs (Populate): Verify that we dont get null return
17948 values. TODO: Check for AsAccessible.
17950 * cs-parser.jay: Use basename to emit error 574 (destructor should
17951 have the same name as container class), not the full name.
17953 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17954 possible representation.
17956 Also implements integer type suffixes U and L.
17958 2001-12-15 Miguel de Icaza <miguel@ximian.com>
17960 * expression.cs (ArrayCreation.DoResolve): We need to do the
17961 argument resolution *always*.
17963 * decl.cs: Make this hold the namespace. Hold the root context as
17965 (LookupType): Move here.
17967 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17969 * location.cs (Row, Name): Fixed the code, it was always returning
17970 references to the first file.
17972 * interface.cs: Register properties defined through interfaces.
17974 * driver.cs: Add support for globbing on the command line
17976 * class.cs (Field): Make it derive from MemberCore as well.
17979 2001-12-15 Ravi Pratap <ravi@ximian.com>
17981 * class.cs (Event::Define): Check that the type of the event is a delegate
17982 type else flag error #66.
17984 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17987 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17988 values of EntryPoint, CharSet etc etc.
17990 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17992 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17993 be null and we should ignore this. I am not sure if this is really clean. Apparently,
17994 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17995 which needs this to do its work.
17997 * ../errors/cs0066.cs : Add.
17999 2001-12-14 Miguel de Icaza <miguel@ximian.com>
18001 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18004 * class.cs: (MethodSignature.MethodSignature): Removed hack that
18005 clears out the parameters field.
18006 (MemberSignatureCompare): Cleanup
18008 (MemberCore): New base class used to share code between MethodCore
18011 (RegisterRequiredImplementations) BindingFlags.Public requires
18012 either BindingFlags.Instace or Static. Use instance here.
18014 (Property): Refactored code to cope better with the full spec.
18016 * parameter.cs (GetParameterInfo): Return an empty array instead
18019 * class.cs (Property): Abstract or extern properties have no bodies.
18021 * parameter.cs (GetParameterInfo): return a zero-sized array.
18023 * class.cs (TypeContainer.MethodModifiersValid): Move all the
18024 method modifier validation to the typecontainer so we can reuse
18025 this on properties.
18027 (MethodCore.ParameterTypes): return an empty sized array of types.
18029 (Property.Define): Test property modifier validity.
18031 Add tests for sealed/override too.
18033 (Method.Emit): abstract or extern methods have no bodies.
18035 2001-12-14 Ravi Pratap <ravi@ximian.com>
18037 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18040 (Method::Define, ::Emit): Modify accordingly.
18042 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18044 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18046 * makefile: Pass in /unsafe.
18048 2001-12-13 Miguel de Icaza <miguel@ximian.com>
18050 * class.cs (MakeKey): Kill routine.
18052 * class.cs (TypeContainer.Define): Correctly define explicit
18053 method implementations (they require the full interface name plus
18056 * typemanager.cs: Deply the PtrHashtable here and stop using the
18057 lame keys. Things work so much better.
18059 This of course broke everyone who depended on `RegisterMethod' to
18060 do the `test for existance' test. This has to be done elsewhere.
18062 * support.cs (PtrHashtable): A hashtable that avoid comparing with
18063 the object stupid Equals method (because, that like fails all over
18064 the place). We still do not use it.
18066 * class.cs (TypeContainer.SetRequiredInterface,
18067 TypeContainer.RequireMethods): Killed these two routines and moved
18068 all the functionality to RegisterRequiredImplementations.
18070 (TypeContainer.RegisterRequiredImplementations): This routine now
18071 registers all the implementations required in an array for the
18072 interfaces and abstract methods. We use an array of structures
18073 which can be computed ahead of time to reduce memory usage and we
18074 also assume that lookups are cheap as most classes will not
18075 implement too many interfaces.
18077 We also avoid creating too many MethodSignatures.
18079 (TypeContainer.IsInterfaceMethod): Update and optionally does not
18080 clear the "pending" bit if we find that there are problems with
18083 (TypeContainer.VerifyPendingMethods): Update to report errors of
18084 methods that look like implementations but are not.
18086 (TypeContainer.Define): Add support for explicit interface method
18089 2001-12-12 Miguel de Icaza <miguel@ximian.com>
18091 * typemanager.cs: Keep track of the parameters here instead of
18092 being a feature of the TypeContainer.
18094 * class.cs: Drop the registration of parameters here, as
18095 InterfaceMethods are also interface declarations.
18097 * delegate.cs: Register methods with the TypeManager not only with
18098 the TypeContainer. This code was buggy.
18100 * interface.cs: Full registation here.
18102 2001-12-11 Miguel de Icaza <miguel@ximian.com>
18104 * expression.cs: Remove reducer for binary expressions, it can not
18107 * const.cs: Put here the code that used to go into constant.cs
18109 * constant.cs: Put here the code for constants, this is a new base
18110 class for Literals.
18112 * literal.cs: Make Literal derive from Constant.
18114 2001-12-09 Miguel de Icaza <miguel@ximian.com>
18116 * statement.cs (Return.Emit): Report error 157 if the user
18117 attempts to return from a finally block.
18119 (Return.Emit): Instead of emitting a return, jump to the end of
18122 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18123 LocalBuilder to store the result of the function. ReturnLabel is
18124 the target where we jump.
18127 2001-12-09 Radek Doulik <rodo@ximian.com>
18129 * cs-parser.jay: remember alias in current namespace
18131 * ecore.cs (SimpleName::DoResolve): use aliases for types or
18134 * class.cs (LookupAlias): lookup alias in my_namespace
18136 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18138 (LookupAlias): lookup alias in this and if needed in parent
18141 2001-12-08 Miguel de Icaza <miguel@ximian.com>
18145 * rootcontext.cs: (ModuleBuilder) Made static, first step into
18146 making things static. I need this to avoid passing the
18147 TypeContainer when calling ParameterType.
18149 * support.cs (InternalParameters.ParameterType): Remove ugly hack
18150 that did string manipulation to compute the type and then call
18151 GetType. Use Parameter.ParameterType instead.
18153 * cs-tokenizer.cs: Consume the suffix for floating values.
18155 * expression.cs (ParameterReference): figure out whether this is a
18156 reference parameter or not. Kill an extra variable by computing
18157 the arg_idx during emission.
18159 * parameter.cs (Parameters.GetParameterInfo): New overloaded
18160 function that returns whether a parameter is an out/ref value or not.
18162 (Parameter.ParameterType): The type of the parameter (base,
18163 without ref/out applied).
18165 (Parameter.Resolve): Perform resolution here.
18166 (Parameter.ExternalType): The full type (with ref/out applied).
18168 * statement.cs (Using.Emit, Using.EmitExpression): Implement
18169 support for expressions on the using statement.
18171 2001-12-07 Miguel de Icaza <miguel@ximian.com>
18173 * statement.cs (Using.EmitLocalVariableDecls): Split the
18174 localvariable handling of the using statement.
18176 (Block.EmitMeta): Keep track of variable count across blocks. We
18177 were reusing slots on separate branches of blocks.
18179 (Try.Emit): Emit the general code block, we were not emitting it.
18181 Check the type of the declaration to be an IDisposable or
18182 something that can be implicity converted to it.
18184 Emit conversions if required.
18186 * ecore.cs (EmptyExpression): New utility class.
18187 (Expression.ImplicitConversionExists): New utility function.
18189 2001-12-06 Miguel de Icaza <miguel@ximian.com>
18191 * statement.cs (Using): Implement.
18193 * expression.cs (LocalVariableReference): Support read only variables.
18195 * statement.cs: Remove the explicit emit for the Leave opcode.
18196 (VariableInfo): Add a readonly field.
18198 2001-12-05 Miguel de Icaza <miguel@ximian.com>
18200 * ecore.cs (ConvCast): new class used to encapsulate the various
18201 explicit integer conversions that works in both checked and
18202 unchecked contexts.
18204 (Expression.ConvertNumericExplicit): Use new ConvCast class to
18205 properly generate the overflow opcodes.
18207 2001-12-04 Miguel de Icaza <miguel@ximian.com>
18209 * statement.cs: The correct type for the EmptyExpression is the
18210 element_type, not the variable type. Ravi pointed this out.
18212 2001-12-04 Ravi Pratap <ravi@ximian.com>
18214 * class.cs (Method::Define): Handle PInvoke methods specially
18215 by using DefinePInvokeMethod instead of the usual one.
18217 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18218 above to do the task of extracting information and defining the method.
18220 2001-12-04 Ravi Pratap <ravi@ximian.com>
18222 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18223 of the condition for string type.
18225 (Emit): Move that here.
18227 (ArrayCreation::CheckIndices): Keep string literals in their expression
18230 (EmitDynamicInitializers): Handle strings appropriately.
18232 2001-12-04 Miguel de Icaza <miguel@ximian.com>
18234 * codegen.cs (EmitContext): Replace multiple variables with a
18235 single pointer to the current Switch statement.
18237 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18240 2001-12-03 Miguel de Icaza <miguel@ximian.com>
18244 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18247 (Foreach.Emit): Foreach on arrays was not setting
18248 up the loop variables (for break/continue).
18250 (GotoCase): Semi-implented.
18252 2001-12-03 Ravi Pratap <ravi@ximian.com>
18254 * attribute.cs (CheckAttribute): Handle system attributes by using
18255 Attribute.GetAttributes to examine information we need.
18257 (GetValidPlaces): Same here.
18259 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18261 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18263 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18265 (Method::Define): Set appropriate flags if we have a DllImport attribute.
18267 (Method::Emit): Handle the case when we are a PInvoke method.
18269 2001-12-03 Miguel de Icaza <miguel@ximian.com>
18271 * expression.cs: Use ResolveWithSimpleName on compound names.
18273 2001-12-02 Ravi Pratap <ravi@ximian.com>
18275 * constant.cs (EmitConstant): Make sure we resolve the associated expression
18276 before trying to reduce it.
18278 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18280 * constant.cs (LookupConstantValue): Implement.
18282 (EmitConstant): Use the above in emitting the constant.
18284 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18285 that are user-defined by doing a LookupConstantValue on them.
18287 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18290 2001-11-29 Miguel de Icaza <miguel@ximian.com>
18292 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18294 (BaseAccess.DoResolve): Implement.
18296 (MemberAccess.DoResolve): Split this routine into a
18297 ResolveMemberAccess routine that can be used independently
18299 2001-11-28 Miguel de Icaza <miguel@ximian.com>
18301 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18302 As that share bits of the implementation. Is returns a boolean,
18303 while As returns the Type that is being probed.
18305 2001-12-01 Ravi Pratap <ravi@ximian.com>
18307 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18308 instead of a Literal - much easier.
18310 (EnumInTransit): Remove - utterly useless :-)
18312 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18314 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18316 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18317 chain when we have no associated expression.
18319 2001-11-30 Ravi Pratap <ravi@ximian.com>
18321 * constant.cs (Define): Use Location while reporting the errror.
18323 Also emit a warning when 'new' is used and there is no inherited
18326 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
18329 (LookupEnumValue): Implement to lookup an enum member's value and define it
18332 (Populate): Re-write accordingly to use the above routine.
18334 2001-11-27 Miguel de Icaza <miguel@ximian.com>
18336 * expression.cs (This): Fix prototype for DoResolveLValue to
18337 override the base class DoResolveLValue.
18339 * cs-parser.cs: Report errors cs574 and cs575 (destructor
18342 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18343 (we need to load the address of the field here). This fixes
18346 (FieldExpr.DoResolveLValue): Call the DoResolve
18347 function to initialize the Instance expression.
18349 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18350 correctly the GetEnumerator operation on a value type.
18352 * cs-parser.jay: Add more simple parsing error catches.
18354 * statement.cs (Switch): Add support for string switches.
18355 Handle null specially.
18357 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
18359 2001-11-28 Ravi Pratap <ravi@ximian.com>
18361 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18363 (declare_local_constant): New helper function.
18365 * statement.cs (AddConstant): Keep a separate record of constants
18367 (IsConstant): Implement to determine if a variable is a constant.
18369 (GetConstantExpression): Implement.
18371 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18373 * statement.cs (IsVariableDefined): Re-write.
18375 2001-11-27 Ravi Pratap <ravi@ximian.com>
18377 * class.cs (TypeContainer::FindMembers): Look for constants
18378 in the case when we are looking for MemberTypes.Field
18380 * expression.cs (MemberAccess::DoResolve): Check that in the
18381 case we are a FieldExpr and a Literal, we are not being accessed
18382 by an instance reference.
18384 * cs-parser.jay (local_constant_declaration): Implement.
18386 (declaration_statement): Implement for constant declarations.
18388 2001-11-26 Miguel de Icaza <miguel@ximian.com>
18390 * statement.cs (Switch): Catch double defaults.
18392 (Switch): More work on the switch() statement
18393 implementation. It works for integral values now, need to finish
18397 2001-11-24 Miguel de Icaza <miguel@ximian.com>
18399 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18400 integer literals into other integer literals. To be used by
18403 2001-11-24 Ravi Pratap <ravi@ximian.com>
18405 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18408 (EmitDynamicInitializers): Cope with the above since we extract data
18409 directly from ArrayData now.
18411 (ExpectInitializers): Keep track of whether initializers are mandatory
18414 (Bounds): Make it a hashtable to prevent the same dimension being
18415 recorded for every element in that dimension.
18417 (EmitDynamicInitializers): Fix bug which prevented the Set array method
18420 Also fix bug which was causing the indices to be emitted in the reverse
18423 2001-11-24 Miguel de Icaza <miguel@ximian.com>
18425 * expression.cs (ArrayCreation): Implement the bits that Ravi left
18426 unfinished. They do not work, because the underlying code is
18429 2001-11-22 Miguel de Icaza <miguel@ximian.com>
18431 * cs-parser.jay: Remove bogus fixme.
18433 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18434 on Switch statement.
18436 2001-11-23 Ravi Pratap <ravi@ximian.com>
18438 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18441 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18442 parameter. Apparently, any expression is allowed.
18444 (ValidateInitializers): Update accordingly.
18446 (CheckIndices): Fix some tricky bugs thanks to recursion.
18448 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
18449 I was being completely brain-dead.
18451 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18452 and re-write acordingly.
18454 (DelegateInvocation): Re-write accordingly.
18456 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18458 (MakeByteBlob): Handle types more correctly.
18460 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18461 initialization from expressions but it is incomplete because I am a complete
18464 2001-11-22 Miguel de Icaza <miguel@ximian.com>
18466 * statement.cs (If.Emit): Fix a bug that generated incorrect code
18467 on If. Basically, we have to return `true' (ie, we do return to
18468 our caller) only if both branches of the if return.
18470 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18471 short-circuit operators, handle them as short circuit operators.
18473 (Cast.DoResolve): Resolve type.
18474 (Cast.Cast): Take an expression as the target type.
18476 * cs-parser.jay (cast_expression): Remove old hack that only
18477 allowed a limited set of types to be handled. Now we take a
18478 unary_expression and we resolve to a type during semantic
18481 Use the grammar productions from Rhys to handle casts (this is
18482 not complete like Rhys syntax yet, we fail to handle that corner
18483 case that C# has regarding (-x), but we will get there.
18485 2001-11-22 Ravi Pratap <ravi@ximian.com>
18487 * class.cs (EmitFieldInitializer): Take care of the case when we have a
18488 field which is an array type.
18490 * cs-parser.jay (declare_local_variables): Support array initialization too.
18492 * typemanager.cs (MakeKey): Implement.
18494 (everywhere): Use the above appropriately.
18496 * cs-parser.jay (for_statement): Update for array initialization while
18497 declaring variables.
18499 * ecore.cs : The error message was correct, it's the variable's names that
18500 were misleading ;-) Make the code more readable.
18502 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18503 the correct type etc.
18505 (ConvertExplicit): Handle Enum types by examining the underlying type.
18507 2001-11-21 Ravi Pratap <ravi@ximian.com>
18509 * parameter.cs (GetCallingConvention): Always return
18510 CallingConventions.Standard for now.
18512 2001-11-22 Miguel de Icaza <miguel@ximian.com>
18514 * expression.cs (Binary.ResolveOperator): Update the values of `l'
18515 and `r' after calling DoNumericPromotions.
18517 * ecore.cs: Fix error message (the types were in the wrong order).
18519 * statement.cs (Foreach.ProbeCollectionType): Need to pass
18520 BindingFlags.Instance as well
18522 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18523 implicit int literal conversion in an empty cast so that we
18524 propagate the right type upstream.
18526 (UnboxCast): new class used to unbox value types.
18527 (Expression.ConvertExplicit): Add explicit type conversions done
18530 (Expression.ImplicitNumericConversion): Oops, forgot to test for
18531 the target type before applying the implicit LongLiterals to ULong
18534 2001-11-21 Miguel de Icaza <miguel@ximian.com>
18536 * cs-parser.jay (for_statement): Reworked the way For works: now
18537 we declare manually any variables that are introduced in
18538 for_initializer to solve the problem of having out-of-band code
18539 emition (that is what got for broken).
18541 (declaration_statement): Perform the actual variable declaration
18542 that used to be done in local_variable_declaration here.
18544 (local_variable_declaration): Do not declare anything, just pass
18545 the information on a DictionaryEntry
18547 2001-11-20 Ravi Pratap <ravi@ximian.com>
18549 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18550 re-write of the logic to now make it recursive.
18552 (UpdateIndices): Re-write accordingly.
18554 Store element data in a separate ArrayData list in the above methods.
18556 (MakeByteBlob): Implement to dump the array data into a byte array.
18558 2001-11-19 Ravi Pratap <ravi@ximian.com>
18560 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18563 * constant.cs (Define): Implement.
18565 (EmitConstant): Re-write fully.
18567 Pass in location info.
18569 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18572 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18573 DictionaryEntry since we need location info too.
18575 (constant_declaration): Update accordingly.
18577 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18578 code into another method : UpdateIndices.
18580 2001-11-18 Ravi Pratap <ravi@ximian.com>
18582 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18583 some type checking etc.
18585 2001-11-17 Ravi Pratap <ravi@ximian.com>
18587 * expression.cs (ArrayCreation::ValidateInitializers): Implement
18588 bits to provide dimension info if the user skips doing that.
18590 Update second constructor to store the rank correctly.
18592 2001-11-16 Ravi Pratap <ravi@ximian.com>
18594 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18595 and try to implement.
18597 * ../errors/cs0150.cs : Add.
18599 * ../errors/cs0178.cs : Add.
18601 2001-11-16 Miguel de Icaza <miguel@ximian.com>
18603 * statement.cs: Implement foreach on multi-dimensional arrays.
18605 * parameter.cs (Parameters.GetParameterByName): Also lookup the
18606 name of the params argument.
18608 * expression.cs: Use EmitStoreOpcode to get the right opcode while
18609 initializing the array.
18611 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18612 we can use this elsewhere.
18614 * statement.cs: Finish implementation of foreach for single
18617 * cs-parser.jay: Use an out-of-band stack to pass information
18618 around, I wonder why I need this.
18620 foreach_block: Make the new foreach_block the current_block.
18622 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18623 function used to return a static Parameters structure. Used for
18624 empty parameters, as those are created very frequently.
18626 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18628 2001-11-15 Ravi Pratap <ravi@ximian.com>
18630 * interface.cs : Default modifier is private, not public. The
18631 make verify test passes again.
18633 2001-11-15 Ravi Pratap <ravi@ximian.com>
18635 * support.cs (ReflectionParameters): Fix logic to determine
18636 whether the last parameter is a params one. Test 9 passes again.
18638 * delegate.cs (Populate): Register the builders we define with
18639 RegisterParameterForBuilder. Test 19 passes again.
18641 * cs-parser.jay (property_declaration): Reference $6 instead
18642 of $$ to get at the location.
18644 (indexer_declaration): Similar stuff.
18646 (attribute): Ditto.
18648 * class.cs (Property): Register parameters for the Get and Set methods
18649 if they exist. Test 23 passes again.
18651 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18652 call to EmitArguments as we are sure there aren't any params arguments.
18653 Test 32 passes again.
18655 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18656 IndexOutOfRangeException.
18658 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18659 Test 33 now passes again.
18661 2001-11-15 Miguel de Icaza <miguel@ximian.com>
18663 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18664 broke a bunch of things. Will have to come up with a better way
18665 of tracking locations.
18667 * statement.cs: Implemented foreach for single dimension arrays.
18669 2001-11-09 Miguel de Icaza <miguel@ximian.com>
18671 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18672 an error. This removes the lookup from the critical path.
18674 * cs-parser.jay: Removed use of temporary_loc, which is completely
18677 2001-11-14 Miguel de Icaza <miguel@ximian.com>
18679 * support.cs (ReflectionParameters.ParameterModifier): Report
18680 whether the argument is a PARAMS argument or not.
18682 * class.cs: Set the attribute `ParamArrayAttribute' on the
18683 parameter argument.
18685 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18686 and cons_param_array_attribute (ConstructorInfo for
18687 ParamArrayAttribute).,
18689 * codegen.cs: Emit the return using the `Return' statement, that
18690 way we can report the error correctly for missing return values.
18692 * class.cs (Method.Emit): Clean up.
18694 * expression.cs (Argument.Resolve): Take another argument: the
18695 location where this argument is used. Notice that this is not
18696 part of the "Argument" class as to reduce the size of the
18697 structure (we know the approximate location anyways).
18699 Test if the argument is a variable-reference, if not, then
18700 complain with a 206.
18702 (Argument.Emit): Emit addresses of variables.
18704 (Argument.FullDesc): Simplify.
18706 (Invocation.DoResolve): Update for Argument.Resolve.
18708 (ElementAccess.DoResolve): ditto.
18710 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18711 method should be virtual, as this method is always virtual.
18713 (NewDelegate.DoResolve): Update for Argument.Resolve.
18715 * class.cs (ConstructorInitializer.DoResolve): ditto.
18717 * attribute.cs (Attribute.Resolve): ditto.
18719 2001-11-13 Miguel de Icaza <miguel@ximian.com>
18721 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18723 * expression.cs (ParameterReference): Drop IStackStorage and implement
18724 IAssignMethod instead.
18726 (LocalVariableReference): ditto.
18728 * ecore.cs (FieldExpr): Drop IStackStorage and implement
18729 IAssignMethod instead.
18731 2001-11-13 Miguel de Icaza <miguel@ximian.com>
18733 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18734 enumerations that are used in heavily used structures derive from
18735 byte in a laughable and pathetic attempt to reduce memory usage.
18736 This is the kind of pre-optimzations that you should not do at
18737 home without adult supervision.
18739 * expression.cs (UnaryMutator): New class, used to handle ++ and
18740 -- separatedly from the other unary operators. Cleans up the
18741 code, and kills the ExpressionStatement dependency in Unary.
18743 (Unary): Removed `method' and `Arguments' from this class, making
18744 it smaller, and moving it all to SimpleCall, so I can reuse this
18745 code in other locations and avoid creating a lot of transient data
18746 strucutres when not required.
18748 * cs-parser.jay: Adjust for new changes.
18750 2001-11-11 Miguel de Icaza <miguel@ximian.com>
18752 * enum.cs (Enum.Populate): If there is a failure during
18755 * cs-parser.jay (opt_enum_base): we used to catch type errors
18756 here, but this is really incorrect. The type error should be
18757 catched during semantic analysis.
18759 2001-12-11 Ravi Pratap <ravi@ximian.com>
18761 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18762 current_local_parameters as expected since I, in my stupidity, had forgotten
18765 * attribute.cs (GetValidPlaces): Fix stupid bug.
18767 * class.cs (Method::Emit): Perform check on applicability of attributes.
18769 (Constructor::Emit): Ditto.
18771 (Field::Emit): Ditto.
18773 (Field.Location): Store location information.
18775 (Property, Event, Indexer, Operator): Ditto.
18777 * cs-parser.jay (field_declaration): Pass in location for each field.
18779 * ../errors/cs0592.cs : Add.
18781 2001-11-12 Ravi Pratap <ravi@ximian.com>
18783 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18785 (InitCoreTypes): Update accordingly.
18787 (RegisterAttrType, LookupAttr): Implement.
18789 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18790 info about the same.
18792 (Resolve): Update to populate the above as necessary.
18794 (Error592): Helper.
18796 (GetValidPlaces): Helper to the above.
18798 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18800 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18802 2001-11-12 Ravi Pratap <ravi@ximian.com>
18804 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18806 * ../errors/cs0617.cs : Add.
18808 2001-11-11 Ravi Pratap <ravi@ximian.com>
18810 * enum.cs (Emit): Rename to Populate to be more consistent with what
18811 we expect it to do and when exactly it is called.
18813 * class.cs, rootcontext.cs : Update accordingly.
18815 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18816 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18818 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18820 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18821 of a fieldinfo using the above, when dealing with a FieldBuilder.
18823 2001-11-10 Ravi Pratap <ravi@ximian.com>
18825 * ../errors/cs0031.cs : Add.
18827 * ../errors/cs1008.cs : Add.
18829 * ../errrors/cs0543.cs : Add.
18831 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18834 (FindMembers): Implement.
18836 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18837 enums and delegates too.
18839 (enum_types): Rename to builder_to_enum.
18841 (delegate_types): Rename to builder_to_delegate.
18843 * delegate.cs (FindMembers): Implement.
18845 2001-11-09 Ravi Pratap <ravi@ximian.com>
18847 * typemanager.cs (IsEnumType): Implement.
18849 * enum.cs (Emit): Re-write parts to account for the underlying type
18850 better and perform checking etc.
18852 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18853 of the underlying type.
18855 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18858 * enum.cs (error31): Helper to report error #31.
18860 * cs-parser.jay (enum_declaration): Store location of each member too.
18862 * enum.cs (member_to_location): New hashtable.
18864 (AddEnumMember): Update location hashtable.
18866 (Emit): Use the location of each member while reporting errors.
18868 2001-11-09 Miguel de Icaza <miguel@ximian.com>
18870 * cs-parser.jay: A for_initializer if is a
18871 local_variable_declaration really ammount to have an implicit
18872 block with the variable declaration and no initializer for for.
18874 * statement.cs (For.Emit): Cope with null initializers.
18876 This fixes the infinite loop on for initializers.
18878 2001-11-08 Miguel de Icaza <miguel@ximian.com>
18880 * enum.cs: More cleanup.
18882 * ecore.cs: Remove dead code.
18884 * class.cs (Property.Emit): More simplification.
18885 (Event.Emit): ditto.
18887 Reworked to have less levels of indentation.
18889 2001-11-08 Ravi Pratap <ravi@ximian.com>
18891 * class.cs (Property): Emit attributes.
18901 * enum.cs (Emit): Ditto.
18903 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18906 * class.cs (Field, Event, etc.): Move attribute generation into the
18907 Emit method everywhere.
18909 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18910 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18911 as we had no way of defining nested enums !
18913 * rootcontext.cs : Adjust code accordingly.
18915 * typemanager.cs (AddEnumType): To keep track of enum types separately.
18917 2001-11-07 Ravi Pratap <ravi@ximian.com>
18919 * expression.cs (EvalConstantExpression): Move into ecore.cs
18921 * enum.cs (Enum): Rename some members and make them public and readonly
18922 according to our convention.
18924 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18927 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18929 (Enum::Emit): Write a simple version for now which doesn't try to compute
18930 expressions. I shall modify this to be more robust in just a while.
18932 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18934 (TypeContainer::CloseType): Create the Enum types too.
18936 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18938 * expression.cs (EvalConstantExpression): Get rid of completely.
18940 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18941 user-defined values and other cases.
18943 (IsValidEnumLiteral): Helper function.
18945 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
18946 out there in the case we had a literal FieldExpr.
18948 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18950 (Literalize): Revamp a bit to take two arguments.
18952 (EnumLiteral): New class which derives from Literal to wrap enum literals.
18954 2001-11-06 Ravi Pratap <ravi@ximian.com>
18956 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18958 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18960 (Resolve): Use the above to ensure we have proper initializers.
18962 2001-11-05 Ravi Pratap <ravi@ximian.com>
18964 * expression.cs (Expression::EvalConstantExpression): New method to
18965 evaluate constant expressions.
18967 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18969 2001-11-07 Miguel de Icaza <miguel@ximian.com>
18971 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18974 (Binary.ResolveOperator): Handle operator != (object a, object b)
18975 and operator == (object a, object b);
18977 (Binary.DoNumericPromotions): Indicate whether the numeric
18978 promotion was possible.
18980 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18983 Made the ArrayAccess implement interface IAssignMethod instead of
18984 IStackStore as the order in which arguments are passed reflects
18987 * assign.cs: Instead of using expr.ExprClass to select the way of
18988 assinging, probe for the IStackStore/IAssignMethod interfaces.
18990 * typemanager.cs: Load InitializeArray definition.
18992 * rootcontext.cs (RootContext.MakeStaticData): Used to define
18993 static data that can be used to initialize arrays.
18995 2001-11-05 Miguel de Icaza <miguel@ximian.com>
18997 * expression.cs: Handle operator== and operator!= for booleans.
18999 (Conditioal.Reduce): Implement reducer for the ?: operator.
19001 (Conditional.Resolve): Implement dead code elimination.
19003 (Binary.Resolve): Catch string literals and return a new
19004 concatenated string.
19006 (Unary.Reduce): Implement reduction of unary expressions.
19008 * ecore.cs: Split out the expression core handling here.
19010 (Expression.Reduce): New method used to perform constant folding
19011 and CSE. This is needed to support constant-expressions.
19013 * statement.cs (Statement.EmitBoolExpression): Pass true and false
19014 targets, and optimize for !x.
19016 2001-11-04 Ravi Pratap <ravi@ximian.com>
19018 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19019 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19020 set custom atttributes.
19022 * literal.cs (Literal::GetValue): New abstract method to return the actual
19023 value of the literal, cast as an object.
19025 (*Literal): Implement GetValue method.
19027 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19028 expressions to the arraylist but objects of type Argument.
19030 * class.cs (TypeContainer::Emit): Emit our attributes too.
19032 (Method::Emit, Constructor::Emit): Ditto.
19034 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19035 to be ignoring earlier.
19037 2001-11-03 Ravi Pratap <ravi@ximian.com>
19039 * attribute.cs (AttributeSection::Define): Implement to do the business
19040 of constructing a CustomAttributeBuilder.
19042 (Attribute): New trivial class. Increases readability of code.
19044 * cs-parser.jay : Update accordingly.
19046 (positional_argument_list, named_argument_list, named_argument): New rules
19048 (attribute_arguments): Use the above so that we are more correct.
19050 2001-11-02 Ravi Pratap <ravi@ximian.com>
19052 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19053 to perform all checks for a method with a params parameter.
19055 (Invocation::OverloadResolve): Update to use the above method and therefore
19056 cope correctly with params method invocations.
19058 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
19061 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19062 constructors in our parent too because we can't afford to miss out on
19065 * attribute.cs (AttributeSection): New name for the class Attribute
19067 Other trivial changes to improve readability.
19069 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19070 use the new class names.
19072 2001-11-01 Ravi Pratap <ravi@ximian.com>
19074 * class.cs (Method::Define): Complete definition for params types too
19076 (Indexer::Define): Ditto.
19078 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19079 Cope everywhere with a request for info about the array parameter.
19081 2001-11-01 Ravi Pratap <ravi@ximian.com>
19083 * tree.cs (RecordNamespace): Fix up to check for the correct key.
19085 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
19086 local_variable_type to extract the string corresponding to the type.
19088 (local_variable_type): Fixup the action to use the new helper method.
19090 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
19093 * expression.cs : Clean out code which uses the above.
19095 2001-10-31 Ravi Pratap <ravi@ximian.com>
19097 * typemanager.cs (RegisterMethod): Check if we already have an existing key
19098 and bale out if necessary by returning a false.
19100 (RegisterProperty): Ditto.
19102 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19103 and print out appropriate error messages.
19105 * interface.cs (everywhere): Ditto.
19107 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19108 location to constructor.
19110 * class.cs (Property, Event, Indexer): Update accordingly.
19112 * ../errors/cs111.cs : Added.
19114 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19115 of a method, as laid down by the spec.
19117 (Invocation::OverloadResolve): Use the above method.
19119 2001-10-31 Ravi Pratap <ravi@ximian.com>
19121 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19122 now take a TypeContainer and a Parameters object.
19124 (ParameterData): Modify return type of ParameterModifier method to be
19125 Parameter.Modifier and not a string.
19127 (ReflectionParameters, InternalParameters): Update accordingly.
19129 * expression.cs (Argument::GetParameterModifier): Same here.
19131 * support.cs (InternalParameters::ParameterType): Find a better way of determining
19132 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19133 symbol in it at all so maybe this is only for now.
19135 2001-10-30 Ravi Pratap <ravi@ximian.com>
19137 * support.cs (InternalParameters): Constructor now takes an extra argument
19138 which is the actual Parameters class.
19140 (ParameterDesc): Update to provide info on ref/out modifiers.
19142 * class.cs (everywhere): Update call to InternalParameters to pass in
19143 the second argument too.
19145 * support.cs (ParameterData): Add ParameterModifier, which is a method
19146 to return the modifier info [ref/out etc]
19148 (InternalParameters, ReflectionParameters): Implement the above.
19150 * expression.cs (Argument::ParameterModifier): Similar function to return
19151 info about the argument's modifiers.
19153 (Invocation::OverloadResolve): Update to take into account matching modifiers
19156 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19157 a new SetFormalParameters object which we pass to InternalParameters.
19159 2001-10-30 Ravi Pratap <ravi@ximian.com>
19161 * expression.cs (NewArray): Merge into the ArrayCreation class.
19163 2001-10-29 Ravi Pratap <ravi@ximian.com>
19165 * expression.cs (NewArray): Merge classes NewBuiltinArray and
19166 NewUserdefinedArray into one as there wasn't much of a use in having
19169 * expression.cs (Argument): Change field's name to ArgType from Type.
19171 (Type): New readonly property which returns the proper type, taking into
19172 account ref/out modifiers.
19174 (everywhere): Adjust code accordingly for the above.
19176 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19177 whether we are emitting for a ref or out parameter.
19179 * expression.cs (Argument::Emit): Use the above field to set the state.
19181 (LocalVariableReference::Emit): Update to honour the flag and emit the
19184 * parameter.cs (Attributes): Set the correct flags for ref parameters.
19186 * expression.cs (Argument::FullDesc): New function to provide a full desc.
19188 * support.cs (ParameterData): Add method ParameterDesc to the interface.
19190 (ReflectionParameters, InternalParameters): Implement the above method.
19192 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19195 (Invocation::FullMethodDesc): Ditto.
19197 2001-10-29 Miguel de Icaza <miguel@ximian.com>
19199 * cs-parser.jay: Add extra production for the second form of array
19202 * expression.cs (ArrayCreation): Update to reflect the above
19205 * Small changes to prepare for Array initialization.
19207 2001-10-28 Miguel de Icaza <miguel@ximian.com>
19209 * typemanager.cs (ImplementsInterface): interface might be null;
19210 Deal with this problem;
19212 Also, we do store negative hits on the cache (null values), so use
19213 this instead of calling t.GetInterfaces on the type everytime.
19215 2001-10-28 Ravi Pratap <ravi@ximian.com>
19217 * typemanager.cs (IsBuiltinType): New method to help determine the same.
19219 * expression.cs (New::DoResolve): Get rid of array creation code and instead
19220 split functionality out into different classes.
19222 (New::FormArrayType): Move into NewBuiltinArray.
19224 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19227 (NewBuiltinArray): New class to handle creation of built-in arrays.
19229 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19230 account creation of one-dimensional arrays.
19232 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19234 (NewUserdefinedArray::DoResolve): Implement.
19236 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19238 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19239 we maintain inside the TypeManager. This is necessary to perform lookups on the
19242 (LookupType): Update to perform GetType on the module builders too.
19244 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19246 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19248 2001-10-23 Ravi Pratap <ravi@ximian.com>
19250 * expression.cs (New::DoResolve): Implement guts of array creation.
19252 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19254 2001-10-27 Miguel de Icaza <miguel@ximian.com>
19256 * expression.cs: Fix bug I introduced lsat night that broke
19259 (Expression.Resolve): Report a 246 error (can not resolve name)
19260 if we find a SimpleName in the stream.
19262 (Expression.ResolveLValue): Ditto.
19264 (Expression.ResolveWithSimpleName): This function is a variant of
19265 ResolveName, this one allows SimpleNames to be returned without a
19266 warning. The only consumer of SimpleNames is MemberAccess
19268 2001-10-26 Miguel de Icaza <miguel@ximian.com>
19270 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19271 might arrive here. I have my doubts that this is correct.
19273 * statement.cs (Lock): Implement lock statement.
19275 * cs-parser.jay: Small fixes to support `lock' and `using'
19277 * cs-tokenizer.cs: Remove extra space
19279 * driver.cs: New flag --checked, allows to turn on integer math
19282 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19283 Threading.Monitor.Exit
19285 2001-10-23 Miguel de Icaza <miguel@ximian.com>
19287 * expression.cs (IndexerAccess::DoResolveLValue): Set the
19288 Expression Class to be IndexerAccess.
19290 Notice that Indexer::DoResolve sets the eclass to Value.
19292 2001-10-22 Miguel de Icaza <miguel@ximian.com>
19294 * class.cs (TypeContainer::Emit): Emit code for indexers.
19296 * assign.cs (IAssignMethod): New interface implemented by Indexers
19297 and Properties for handling assignment.
19299 (Assign::Emit): Simplify and reuse code.
19301 * expression.cs (IndexerAccess, PropertyExpr): Implement
19302 IAssignMethod, clean up old code.
19304 2001-10-22 Ravi Pratap <ravi@ximian.com>
19306 * typemanager.cs (ImplementsInterface): New method to determine if a type
19307 implements a given interface. Provides a nice cache too.
19309 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19312 (ConvertReferenceExplicit): Ditto.
19314 * delegate.cs (Delegate::Populate): Update to define the parameters on the
19315 various methods, with correct names etc.
19317 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
19318 Operator.UnaryNegation.
19320 * cs-parser.jay (operator_declarator): Be a little clever in the case where
19321 we have a unary plus or minus operator.
19323 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
19326 * everywhere : update accordingly.
19328 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19331 * class.cs (Method::Define): For the case where we are implementing a method
19332 inherited from an interface, we need to set the MethodAttributes.Final flag too.
19333 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19335 2001-10-21 Ravi Pratap <ravi@ximian.com>
19337 * interface.cs (FindMembers): Implement to work around S.R.E
19340 * typemanager.cs (IsInterfaceType): Implement.
19342 (FindMembers): Update to handle interface types too.
19344 * expression.cs (ImplicitReferenceConversion): Re-write bits which
19345 use IsAssignableFrom as that is not correct - it doesn't work.
19347 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19348 and accordingly override EmitStatement.
19350 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19351 using the correct logic :-)
19353 2001-10-19 Ravi Pratap <ravi@ximian.com>
19355 * ../errors/cs-11.cs : Add to demonstrate error -11
19357 2001-10-17 Miguel de Icaza <miguel@ximian.com>
19359 * assign.cs (Assign::Resolve): Resolve right hand side first, and
19360 then pass this as a hint to ResolveLValue.
19362 * expression.cs (FieldExpr): Add Location information
19364 (FieldExpr::LValueResolve): Report assignment to readonly
19367 (Expression::ExprClassFromMemberInfo): Pass location information.
19369 (Expression::ResolveLValue): Add new method that resolves an
19372 (Expression::DoResolveLValue): Default invocation calls
19375 (Indexers): New class used to keep track of indexers in a given
19378 (IStackStore): Renamed from LValue, as it did not really describe
19379 what this did. Also ResolveLValue is gone from this interface and
19380 now is part of Expression.
19382 (ElementAccess): Depending on the element access type
19384 * typemanager.cs: Add `indexer_name_type' as a Core type
19385 (System.Runtime.CompilerServices.IndexerNameAttribute)
19387 * statement.cs (Goto): Take a location.
19389 2001-10-18 Ravi Pratap <ravi@ximian.com>
19391 * delegate.cs (Delegate::VerifyDelegate): New method to verify
19392 if two delegates are compatible.
19394 (NewDelegate::DoResolve): Update to take care of the case when
19395 we instantiate a delegate from another delegate.
19397 * typemanager.cs (FindMembers): Don't even try to look up members
19398 of Delegate types for now.
19400 2001-10-18 Ravi Pratap <ravi@ximian.com>
19402 * delegate.cs (NewDelegate): New class to take care of delegate
19405 * expression.cs (New): Split the delegate related code out into
19406 the NewDelegate class.
19408 * delegate.cs (DelegateInvocation): New class to handle delegate
19411 * expression.cs (Invocation): Split out delegate related code into
19412 the DelegateInvocation class.
19414 2001-10-17 Ravi Pratap <ravi@ximian.com>
19416 * expression.cs (New::DoResolve): Implement delegate creation fully
19417 and according to the spec.
19419 (New::DoEmit): Update to handle delegates differently.
19421 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19422 because of which we were printing out arguments in reverse order !
19424 * delegate.cs (VerifyMethod): Implement to check if the given method
19425 matches the delegate.
19427 (FullDelegateDesc): Implement.
19429 (VerifyApplicability): Implement.
19431 * expression.cs (Invocation::DoResolve): Update to accordingly handle
19432 delegate invocations too.
19434 (Invocation::Emit): Ditto.
19436 * ../errors/cs1593.cs : Added.
19438 * ../errors/cs1594.cs : Added.
19440 * delegate.cs (InstanceExpression, TargetMethod): New properties.
19442 2001-10-16 Ravi Pratap <ravi@ximian.com>
19444 * typemanager.cs (intptr_type): Core type for System.IntPtr
19446 (InitCoreTypes): Update for the same.
19448 (iasyncresult_type, asynccallback_type): Ditto.
19450 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19453 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19456 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19457 the builders for the 4 members of a delegate type :-)
19459 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19462 * expression.cs (New::DoResolve): Implement guts for delegate creation.
19464 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19466 2001-10-15 Miguel de Icaza <miguel@ximian.com>
19468 * statement.cs (Break::Emit): Implement.
19469 (Continue::Emit): Implement.
19471 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
19472 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
19473 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
19474 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
19477 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19478 properties that track the label for the current loop (begin of the
19479 loop and end of the loop).
19481 2001-10-15 Ravi Pratap <ravi@ximian.com>
19483 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19484 use of emitting anything at all.
19486 * class.cs, rootcontext.cs : Get rid of calls to the same.
19488 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19490 (Populate): Define the constructor correctly and set the implementation
19493 * typemanager.cs (delegate_types): New hashtable to hold delegates that
19496 (AddDelegateType): Implement.
19498 (IsDelegateType): Implement helper method.
19500 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19502 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19503 and accordingly handle it.
19505 * delegate.cs (Populate): Take TypeContainer argument.
19506 Implement bits to define the Invoke method. However, I still haven't figured out
19507 how to take care of the native int bit :-(
19509 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
19510 Qualify the name of the delegate, not its return type !
19512 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19515 (StandardConversionExists): Checking for array types turns out to be recursive.
19517 (ConvertReferenceExplicit): Implement array conversion.
19519 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19521 2001-10-12 Ravi Pratap <ravi@ximian.com>
19523 * cs-parser.jay (delegate_declaration): Store the fully qualified
19524 name as it is a type declaration.
19526 * delegate.cs (ReturnType, Name): Rename members to these. Make them
19529 (DefineDelegate): Renamed from Define. Does the same thing essentially,
19530 as TypeContainer::DefineType.
19532 (Populate): Method in which all the definition of the various methods (Invoke)
19535 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19538 (CloseDelegate): Finally creates the delegate.
19540 * class.cs (TypeContainer::DefineType): Update to define delegates.
19541 (Populate, Emit and CloseType): Do the same thing here too.
19543 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19544 delegates in all these operations.
19546 2001-10-14 Miguel de Icaza <miguel@ximian.com>
19548 * expression.cs: LocalTemporary: a new expression used to
19549 reference a temporary that has been created.
19551 * assign.cs: Handle PropertyAccess back here, so that we can
19552 provide the proper semantic access to properties.
19554 * expression.cs (Expression::ConvertReferenceExplicit): Implement
19555 a few more explicit conversions.
19557 * modifiers.cs: `NEW' modifier maps to HideBySig.
19559 * expression.cs (PropertyExpr): Make this into an
19560 ExpressionStatement, and support the EmitStatement code path.
19562 Perform get/set error checking, clean up the interface.
19564 * assign.cs: recognize PropertyExprs as targets, and if so, turn
19565 them into toplevel access objects.
19567 2001-10-12 Miguel de Icaza <miguel@ximian.com>
19569 * expression.cs: PropertyExpr::PropertyExpr: use work around the
19572 * typemanager.cs: Keep track here of our PropertyBuilders again to
19573 work around lameness in SRE.
19575 2001-10-11 Miguel de Icaza <miguel@ximian.com>
19577 * expression.cs (LValue::LValueResolve): New method in the
19578 interface, used to perform a second resolution pass for LValues.
19580 (This::DoResolve): Catch the use of this in static methods.
19582 (This::LValueResolve): Implement.
19584 (This::Store): Remove warning, assigning to `this' in structures
19587 (Invocation::Emit): Deal with invocation of
19588 methods on value types. We need to pass the address to structure
19589 methods rather than the object itself. (The equivalent code to
19590 emit "this" for structures leaves the entire structure on the
19591 stack instead of a pointer to it).
19593 (ParameterReference::DoResolve): Compute the real index for the
19594 argument based on whether the method takes or not a `this' pointer
19595 (ie, the method is static).
19597 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19598 value types returned from functions when we need to invoke a
19599 method on the sturcture.
19602 2001-10-11 Ravi Pratap <ravi@ximian.com>
19604 * class.cs (TypeContainer::DefineType): Method to actually do the business of
19605 defining the type in the Modulebuilder or Typebuilder. This is to take
19606 care of nested types which need to be defined on the TypeBuilder using
19607 DefineNestedMethod.
19609 (TypeContainer::GetClassBases): Implement. Essentially the code from the
19610 methods in RootContext, only ported to be part of TypeContainer.
19612 (TypeContainer::GetInterfaceOrClass): Ditto.
19614 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19616 * interface.cs (Interface::DefineInterface): New method. Does exactly
19617 what RootContext.CreateInterface did earlier, only it takes care of nested types
19620 (Interface::GetInterfaces): Move from RootContext here and port.
19622 (Interface::GetInterfaceByName): Same here.
19624 * rootcontext.cs (ResolveTree): Re-write.
19626 (PopulateTypes): Re-write.
19628 * class.cs (TypeContainer::Populate): Populate nested types too.
19629 (TypeContainer::Emit): Emit nested members too.
19631 * typemanager.cs (AddUserType): Do not make use of the FullName property,
19632 instead just use the name argument passed in as it is already fully
19635 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19636 to TypeContainer mapping to see if a type is user-defined.
19638 * class.cs (TypeContainer::CloseType): Implement.
19640 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19641 the default constructor.
19643 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19646 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19648 * interface.cs (CloseType): Create the type here.
19650 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19653 Remove all the methods which are now in TypeContainer.
19655 2001-10-10 Ravi Pratap <ravi@ximian.com>
19657 * delegate.cs (Define): Re-write bits to define the delegate
19660 2001-10-10 Miguel de Icaza <miguel@ximian.com>
19662 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19664 * expression.cs (ImplicitReferenceConversion): handle null as well
19665 as a source to convert to any reference type.
19667 * statement.cs (Return): Perform any implicit conversions to
19668 expected return type.
19670 Validate use of return statement.
19672 * codegen.cs (EmitContext): Pass the expected return type here.
19674 * class.cs (Method, Constructor, Property): Pass expected return
19675 type to EmitContext.
19677 2001-10-09 Miguel de Icaza <miguel@ximian.com>
19679 * expression.cs: Make DoResolve take an EmitContext instead of a
19682 Replaced `l' and `location' for `loc', for consistency.
19684 (Error, Warning): Remove unneeded Tc argument.
19686 * assign.cs, literal.cs, constant.cs: Update to new calling
19689 * codegen.cs: EmitContext now contains a flag indicating whether
19690 code is being generated in a static method or not.
19692 * cs-parser.jay: DecomposeQI, new function that replaces the old
19693 QualifiedIdentifier. Now we always decompose the assembled
19694 strings from qualified_identifier productions into a group of
19697 2001-10-08 Miguel de Icaza <miguel@ximian.com>
19699 * rootcontext.cs: Deal with field-less struct types correctly now
19700 by passing the size option to Define Type.
19702 * class.cs: Removed hack that created one static field.
19704 2001-10-07 Miguel de Icaza <miguel@ximian.com>
19706 * statement.cs: Moved most of the code generation here.
19708 2001-10-09 Ravi Pratap <ravi@ximian.com>
19710 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19713 (ElementAccess): Remove useless bits for now - keep checks as the spec
19716 2001-10-08 Ravi Pratap <ravi@ximian.com>
19718 * expression.cs (ElementAccess::DoResolve): Remove my crap code
19719 and start performing checks according to the spec.
19721 2001-10-07 Ravi Pratap <ravi@ximian.com>
19723 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19724 rank_specifiers instead.
19726 (rank_specifiers): Change the order in which the rank specifiers are stored
19728 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19730 * expression.cs (ElementAccess): Implement the LValue interface too.
19732 2001-10-06 Ravi Pratap <ravi@ximian.com>
19734 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19735 except that user defined conversions are not included.
19737 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
19738 perform the conversion of the return type, if necessary.
19740 (New::DoResolve): Check whether we are creating an array or an object
19741 and accordingly do the needful.
19743 (New::Emit): Same here.
19745 (New::DoResolve): Implement guts of array creation.
19747 (New::FormLookupType): Helper function.
19749 2001-10-07 Miguel de Icaza <miguel@ximian.com>
19751 * codegen.cs: Removed most of the code generation here, and move the
19752 corresponding code generation bits to the statement classes.
19754 Added support for try/catch/finalize and throw.
19756 * cs-parser.jay: Added support for try/catch/finalize.
19758 * class.cs: Catch static methods having the flags override,
19759 virtual or abstract.
19761 * expression.cs (UserCast): This user cast was not really doing
19762 what it was supposed to do. Which is to be born in fully resolved
19763 state. Parts of the resolution were being performed at Emit time!
19767 2001-10-05 Miguel de Icaza <miguel@ximian.com>
19769 * expression.cs: Implicity convert the result from UserCast.
19771 2001-10-05 Ravi Pratap <ravi@ximian.com>
19773 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19774 prevented it from working correctly.
19776 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19777 merely ConvertImplicit.
19779 2001-10-05 Miguel de Icaza <miguel@ximian.com>
19781 * typemanager.cs: Make the LookupTypeContainer function static,
19782 and not per-instance.
19784 * class.cs: Make static FindMembers (the one that takes a Type
19787 * codegen.cs: Add EmitForeach here.
19789 * cs-parser.jay: Make foreach a toplevel object instead of the
19790 inline expansion, as we need to perform semantic analysis on it.
19792 2001-10-05 Ravi Pratap <ravi@ximian.com>
19794 * expression.cs (Expression::ImplicitUserConversion): Rename to
19795 UserDefinedConversion.
19797 (Expression::UserDefinedConversion): Take an extra argument specifying
19798 whether we look for explicit user conversions too.
19800 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19802 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19804 (ExplicitUserConversion): Make it a call to UserDefinedConversion
19805 with the appropriate arguments.
19807 * cs-parser.jay (cast_expression): Record location too.
19809 * expression.cs (Cast): Record location info.
19811 (Expression::ConvertExplicit): Take location argument.
19813 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19814 to determine if we are doing explicit conversions.
19816 (UserCast::Emit): Update accordingly.
19818 (Expression::ConvertExplicit): Report an error if everything fails.
19820 * ../errors/cs0030.cs : Add.
19822 2001-10-04 Miguel de Icaza <miguel@ximian.com>
19824 * modifiers.cs: If the ABSTRACT keyword is present, also set the
19825 virtual and newslot bits.
19827 * class.cs (TypeContainer::RegisterRequiredImplementations):
19828 Record methods we need.
19830 (TypeContainer::MakeKey): Helper function to make keys for
19831 MethodBases, since the Methodbase key is useless.
19833 (TypeContainer::Populate): Call RegisterRequiredImplementations
19834 before defining the methods.
19836 Create a mapping for method_builders_to_methods ahead of time
19837 instead of inside a tight loop.
19839 (::RequireMethods): Accept an object as the data to set into the
19840 hashtable so we can report interface vs abstract method mismatch.
19842 2001-10-03 Miguel de Icaza <miguel@ximian.com>
19844 * report.cs: Make all of it static.
19846 * rootcontext.cs: Drop object_type and value_type computations, as
19847 we have those in the TypeManager anyways.
19849 Drop report instance variable too, now it is a global.
19851 * driver.cs: Use try/catch on command line handling.
19853 Add --probe option to debug the error reporting system with a test
19856 * report.cs: Add support for exiting program when a probe
19857 condition is reached.
19859 2001-10-03 Ravi Pratap <ravi@ximian.com>
19861 * expression.cs (Binary::DoNumericPromotions): Fix the case when
19862 we do a forcible conversion regardless of type, to check if
19863 ForceConversion returns a null.
19865 (Binary::error19): Use location to report error.
19867 (Unary::error23): Use location here too.
19869 * ../errors/cs0019.cs : Check in.
19871 * ../errors/cs0023.cs : Check in.
19873 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19874 case of a non-null MethodInfo object with a length of 0 !
19876 (Binary::ResolveOperator): Flag error if overload resolution fails to find
19877 an applicable member - according to the spec :-)
19878 Also fix logic to find members in base types.
19880 (Unary::ResolveOperator): Same here.
19882 (Unary::report23): Change name to error23 and make first argument a TypeContainer
19883 as I was getting thoroughly confused between this and error19 :-)
19885 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19886 (::FindMostEncompassedType): Implement.
19887 (::FindMostEncompassingType): Implement.
19888 (::StandardConversionExists): Implement.
19890 (UserImplicitCast): Re-vamp. We now need info about most specific
19891 source and target types so that we can do the necessary conversions.
19893 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19894 mathematical union with no duplicates.
19896 2001-10-03 Miguel de Icaza <miguel@ximian.com>
19898 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19899 in order from base classes to child classes, so that we can in
19900 child classes look up in our parent for method names and
19901 attributes (required for handling abstract, virtual, new, override
19902 constructs: we need to instrospect our base class, and if we dont
19903 populate the classes in order, the introspection might be
19904 incorrect. For example, a method could query its parent before
19905 the parent has any methods and would determine that the parent has
19906 no abstract methods (while it could have had them)).
19908 (RootContext::CreateType): Record the order in which we define the
19911 2001-10-02 Miguel de Icaza <miguel@ximian.com>
19913 * class.cs (TypeContainer::Populate): Also method definitions can
19914 fail now, keep track of this.
19916 (TypeContainer::FindMembers): Implement support for
19917 DeclaredOnly/noDeclaredOnly flag.
19919 (Constructor::Emit) Return the ConstructorBuilder.
19921 (Method::Emit) Return the MethodBuilder.
19922 Check for abstract or virtual methods to be public.
19924 * rootcontext.cs (RootContext::CreateType): Register all the
19925 abstract methods required for the class to be complete and the
19926 interface methods that must be implemented.
19928 * cs-parser.jay: Report error 501 (method requires body if it is
19929 not marked abstract or extern).
19931 * expression.cs (TypeOf::Emit): Implement.
19933 * typemanager.cs: runtime_handle_type, new global type.
19935 * class.cs (Property::Emit): Generate code for properties.
19937 2001-10-02 Ravi Pratap <ravi@ximian.com>
19939 * expression.cs (Unary::ResolveOperator): Find operators on base type
19940 too - we now conform exactly to the spec.
19942 (Binary::ResolveOperator): Same here.
19944 * class.cs (Operator::Define): Fix minor quirk in the tests.
19946 * ../errors/cs0215.cs : Added.
19948 * ../errors/cs0556.cs : Added.
19950 * ../errors/cs0555.cs : Added.
19952 2001-10-01 Miguel de Icaza <miguel@ximian.com>
19954 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19955 single integer which is really efficient
19957 2001-10-01 Ravi Pratap <ravi@ximian.com>
19959 * expression.cs (Expression::ImplicitUserConversion): Use location
19960 even in the case when we are examining True operators.
19962 * class.cs (Operator::Define): Perform extensive checks to conform
19963 with the rules for operator overloading in the spec.
19965 * expression.cs (Expression::ImplicitReferenceConversion): Implement
19966 some of the other conversions mentioned in the spec.
19968 * typemanager.cs (array_type): New static member for the System.Array built-in
19971 (cloneable_interface): For System.ICloneable interface.
19973 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19974 we start resolving the tree and populating types.
19976 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19978 2001-10-01 Miguel de Icaza <miguel@ximian.com>
19980 * expression.cs (Expression::ExprClassFromMemberInfo,
19981 Expression::Literalize): Create literal expressions from
19982 FieldInfos which are literals.
19984 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19985 type casts, because they were wrong. The test suite in tests
19988 (ImplicitNumericConversion): ushort to ulong requires a widening
19991 Int32 constant to long requires widening cast as well.
19993 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19994 for integers because the type on the stack is not i4.
19996 2001-09-30 Miguel de Icaza <miguel@ximian.com>
19998 * expression.cs (report118): require location argument.
20000 * parameter.cs: Do not dereference potential null value.
20002 * class.cs: Catch methods that lack the `new' keyword when
20003 overriding a name. Report warnings when `new' is used without
20004 anything being there to override.
20006 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20008 * class.cs: Only add constructor to hashtable if it is non-null
20009 (as now constructors can fail on define).
20011 (TypeManager, Class, Struct): Take location arguments.
20013 Catch field instance initialization in structs as errors.
20015 accepting_filter: a new filter for FindMembers that is static so
20016 that we dont create an instance per invocation.
20018 (Constructor::Define): Catch errors where a struct constructor is
20021 * cs-parser.jay: Pass location information for various new
20024 * delegate.cs (Delegate): take a location argument.
20026 * driver.cs: Do not call EmitCode if there were problesm in the
20027 Definition of the types, as many Builders wont be there.
20029 * decl.cs (Decl::Decl): Require a location argument.
20031 * cs-tokenizer.cs: Handle properly hex constants that can not fit
20032 into integers, and find the most appropiate integer for it.
20034 * literal.cs: Implement ULongLiteral.
20036 * rootcontext.cs: Provide better information about the location of
20037 failure when CreateType fails.
20039 2001-09-29 Miguel de Icaza <miguel@ximian.com>
20041 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20044 * expression.cs (Binary::CheckShiftArguments): Add missing type
20046 (Binary::ResolveOperator): Add type to the logical and and logical
20047 or, Bitwise And/Or and Exclusive Or code paths, it was missing
20050 (Binary::DoNumericPromotions): In the case where either argument
20051 is ulong (and most signed types combined with ulong cause an
20052 error) perform implicit integer constant conversions as well.
20054 2001-09-28 Miguel de Icaza <miguel@ximian.com>
20056 * expression.cs (UserImplicitCast): Method should always be
20058 (Invocation::BetterConversion): Simplified test for IntLiteral.
20060 (Expression::ImplicitNumericConversion): Split this routine out.
20061 Put the code that performs implicit constant integer conversions
20064 (Expression::Resolve): Become a wrapper around DoResolve so we can
20065 check eclass and type being set after resolve.
20067 (Invocation::Badness): Remove this dead function
20069 (Binary::ResolveOperator): Do not compute the expensive argumnets
20070 unless we have a union for it.
20072 (Probe::Emit): Is needs to do an isinst and then
20073 compare against null.
20075 (::CanConvert): Added Location argument. If the Location argument
20076 is null (Location.Null), then we do not report errors. This is
20077 used by the `probe' mechanism of the Explicit conversion. We do
20078 not want to generate an error for something that the user
20079 explicitly requested to be casted. But the pipeline for an
20080 explicit cast first tests for potential implicit casts.
20082 So for now, if the Location is null, it means `Probe only' to
20083 avoid adding another argument. Might have to revise this
20086 (ClassCast): New class used to type cast objects into arbitrary
20087 classes (used in Explicit Reference Conversions).
20089 Implement `as' as well.
20091 Reverted all the patches from Ravi below: they were broken:
20093 * The use of `level' as a mechanism to stop recursive
20094 invocations is wrong. That was there just to catch the
20095 bug with a strack trace but not as a way of addressing
20098 To fix the problem we have to *understand* what is going
20099 on and the interactions and come up with a plan, not
20100 just get things going.
20102 * The use of the type conversion cache that I proposed
20103 last night had an open topic: How does this work across
20104 protection domains. A user defined conversion might not
20105 be public in the location where we are applying the
20106 conversion, a different conversion might be selected
20107 (ie, private A->B (better) but public B->A (worse),
20108 inside A, A->B applies, but outside it, B->A will
20111 * On top of that (ie, even if the above is solved),
20112 conversions in a cache need to be abstract. Ie, `To
20113 convert from an Int to a Short use an OpcodeCast', not
20114 `To convert from an Int to a Short use the OpcodeCast on
20115 the variable 5' (which is what this patch was doing).
20117 2001-09-28 Ravi Pratap <ravi@ximian.com>
20119 * expression.cs (Invocation::ConversionExists): Re-write to use
20120 the conversion cache
20122 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20123 cache all conversions done, not just user-defined ones.
20125 (Invocation::BetterConversion): The real culprit. Use ConversionExists
20126 to determine if a conversion exists instead of acutually trying to
20127 perform the conversion. It's faster too.
20129 (Expression::ConvertExplicit): Modify to use ConversionExists to check
20130 and only then attempt the implicit conversion.
20132 2001-09-28 Ravi Pratap <ravi@ximian.com>
20134 * expression.cs (ConvertImplicit): Use a cache for conversions
20135 already found. Check level of recursion and bail out if necessary.
20137 2001-09-28 Miguel de Icaza <miguel@ximian.com>
20139 * typemanager.cs (string_concat_string_string, string_concat_object_object):
20140 Export standard methods that we expect for string operations.
20142 * statement.cs (Block::UsageWarning): Track usage of variables and
20143 report the errors for not used variables.
20145 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20148 2001-09-27 Miguel de Icaza <miguel@ximian.com>
20150 * codegen.cs: remove unnneded code
20152 * expression.cs: Removed BuiltinTypeAccess class
20154 Fix the order in which implicit conversions are
20157 The previous fixed dropped support for boxed conversions (adding a
20158 test to the test suite now)
20160 (UserImplicitCast::CanConvert): Remove test for source being null,
20161 that code is broken. We should not feed a null to begin with, if
20162 we do, then we should track the bug where the problem originates
20163 and not try to cover it up here.
20165 Return a resolved expression of type UserImplicitCast on success
20166 rather than true/false. Ravi: this is what I was talking about,
20167 the pattern is to use a static method as a "constructor" for
20170 Also, do not create arguments until the very last minute,
20171 otherwise we always create the arguments even for lookups that
20172 will never be performed.
20174 (UserImplicitCast::Resolve): Eliminate, objects of type
20175 UserImplicitCast are born in a fully resolved state.
20177 * typemanager.cs (InitCoreTypes): Init also value_type
20178 (System.ValueType).
20180 * expression.cs (Cast::Resolve): First resolve the child expression.
20182 (LValue): Add new method AddressOf to be used by
20185 Change the argument of Store to take an EmitContext instead of an
20186 ILGenerator, because things like FieldExpr need to be able to call
20187 their children expression to generate the instance code.
20189 (Expression::Error, Expression::Warning): Sugar functions for
20192 (Expression::MemberLookup): Accept a TypeContainer instead of a
20193 Report as the first argument.
20195 (Expression::ResolvePrimary): Killed. I still want to improve
20196 this as currently the code is just not right.
20198 (Expression::ResolveMemberAccess): Simplify, but it is still
20201 (Unary::Resolve): Catch errors in AddressOf operators.
20203 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20204 index to a byte for the short-version, or the compiler will choose
20205 the wrong Emit call, which generates the wrong data.
20207 (ParameterReference::Emit, ::Store): same.
20209 (FieldExpr::AddressOf): Implement.
20211 * typemanager.cs: TypeManager: made public variable instead of
20214 * driver.cs: document --fatal.
20216 * report.cs (ErrorMessage, WarningMessage): new names for the old
20217 Error and Warning classes.
20219 * cs-parser.jay (member_access): Turn built-in access to types
20220 into a normal simplename
20222 2001-09-27 Ravi Pratap <ravi@ximian.com>
20224 * expression.cs (Invocation::BetterConversion): Fix to cope
20225 with q being null, since this was introducing a bug.
20227 * expression.cs (ConvertImplicit): Do built-in conversions first.
20229 2001-09-27 Ravi Pratap <ravi@ximian.com>
20231 * expression.cs (UserImplicitCast::Resolve): Fix bug.
20233 2001-09-27 Ravi Pratap <ravi@ximian.com>
20235 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20236 I had introduced long ago (what's new ?).
20238 * expression.cs (UserImplicitCast::CanConvert): Static method to do
20239 the work of all the checking.
20240 (ConvertImplicit): Call CanConvert and only then create object if necessary.
20241 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20243 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20244 that is the right way.
20246 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
20247 overloading resolution. Use everywhere instead of cutting and pasting code.
20249 (Binary::ResolveOperator): Use MakeUnionSet.
20251 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
20252 we have to convert to bool types. Not complete yet.
20254 2001-09-27 Miguel de Icaza <miguel@ximian.com>
20256 * typemanager.cs (TypeManager::CSharpName): support ushort.
20258 * expression.cs (Expression::TryImplicitIntConversion): Attempts
20259 to provide an expression that performsn an implicit constant int
20260 conversion (section 6.1.6).
20261 (Expression::ConvertImplicitRequired): Reworked to include
20262 implicit constant expression conversions.
20264 (Expression::ConvertNumericExplicit): Finished.
20266 (Invocation::Emit): If InstanceExpression is null, then it means
20267 that we perform a call on this.
20269 2001-09-26 Miguel de Icaza <miguel@ximian.com>
20271 * expression.cs (Unary::Emit): Remove some dead code.
20272 (Probe): Implement Resolve and Emit for `is'.
20273 (Expression::ConvertImplicitRequired): Attempt to do constant
20274 expression conversions here. Maybe should be moved to
20275 ConvertImplicit, but I am not sure.
20276 (Expression::ImplicitLongConstantConversionPossible,
20277 Expression::ImplicitIntConstantConversionPossible): New functions
20278 that tell whether is it possible to apply an implicit constant
20279 expression conversion.
20281 (ConvertNumericExplicit): Started work on explicit numeric
20284 * cs-parser.jay: Update operator constants.
20286 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20287 (Parameters::GetSignature): Hook up VerifyArgs here.
20288 (Parameters::VerifyArgs): Verifies that no two arguments have the
20291 * class.cs (Operator): Update the operator names to reflect the
20292 ones that the spec expects (as we are just stringizing the
20295 * expression.cs (Unary::ResolveOperator): Fix bug: Use
20296 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20297 previous usage did only work for our methods.
20298 (Expression::ConvertImplicit): Handle decimal implicit numeric
20299 conversions as well.
20300 (Expression::InternalTypeConstructor): Used to invoke constructors
20301 on internal types for default promotions.
20303 (Unary::Emit): Implement special handling for the pre/post
20304 increment/decrement for overloaded operators, as they need to have
20305 the same semantics as the other operators.
20307 (Binary::ResolveOperator): ditto.
20308 (Invocation::ConversionExists): ditto.
20309 (UserImplicitCast::Resolve): ditto.
20311 2001-09-26 Ravi Pratap <ravi@ximian.com>
20313 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20314 operator, return after emitting body. Regression tests pass again !
20316 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20317 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20318 (Invocation::OverloadResolve): Ditto.
20319 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20321 * everywhere : update calls to the above methods accordingly.
20323 2001-09-26 Miguel de Icaza <miguel@ximian.com>
20325 * assign.cs (Assign): Make it inherit from ExpressionStatement.
20327 * expression.cs (ExpressionStatement): New base class used for
20328 expressions that can appear in statements, so that we can provide
20329 an alternate path to generate expression that do not leave a value
20332 (Expression::Emit, and all the derivatives): We no longer return
20333 whether a value is left on the stack or not. Every expression
20334 after being emitted leaves a single value on the stack.
20336 * codegen.cs (EmitContext::EmitStatementExpression): Use the
20337 facilties of ExpressionStatement if possible.
20339 * cs-parser.jay: Update statement_expression.
20341 2001-09-25 Miguel de Icaza <miguel@ximian.com>
20343 * driver.cs: Change the wording of message
20345 2001-09-25 Ravi Pratap <ravi@ximian.com>
20347 * expression.cs (Binary::ResolveOperator): Had forgottten to set
20348 the type of the expression to the return type of the method if
20349 we have an overloaded operator match ! The regression tests pass again !
20350 (Unary::ResolveOperator): Ditto.
20352 * expression.cs (Invocation::ConversionExists): Correct the member lookup
20353 to find "op_Implicit", not "implicit" ;-)
20354 (UserImplicitCast): New class to take care of user-defined implicit conversions.
20355 (ConvertImplicit, ForceConversion): Take TypeContainer argument
20357 * everywhere : Correct calls to the above accordingly.
20359 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20360 (ConvertImplicit): Do user-defined conversion if it exists.
20362 2001-09-24 Miguel de Icaza <miguel@ximian.com>
20364 * assign.cs: track location.
20365 (Resolve): Use implicit conversions on assignment.
20367 * literal.cs: Oops. Not good, Emit of short access values should
20368 pass (Bytes) or the wrong argument will be selected.
20370 * expression.cs (Unary::Emit): Emit code for -expr.
20372 (Unary::ResolveOperator): Handle `Substract' for non-constants
20373 (substract from zero from the non-constants).
20374 Deal with Doubles as well.
20376 (Expression::ConvertImplicitRequired): New routine that reports an
20377 error if no implicit conversion exists.
20379 (Invocation::OverloadResolve): Store the converted implicit
20380 expressions if we make them
20382 2001-09-24 Ravi Pratap <ravi@ximian.com>
20384 * class.cs (ConstructorInitializer): Take a Location argument.
20385 (ConstructorBaseInitializer): Same here.
20386 (ConstructorThisInitializer): Same here.
20388 * cs-parser.jay : Update all calls accordingly.
20390 * expression.cs (Unary, Binary, New): Take location argument.
20391 Update accordingly everywhere.
20393 * cs-parser.jay : Update all calls to the above to take a location
20396 * class.cs : Ditto.
20398 2001-09-24 Ravi Pratap <ravi@ximian.com>
20400 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20401 (Invocation::BetterConversion): Same here
20402 (Invocation::ConversionExists): Ditto.
20404 (Invocation::ConversionExists): Implement.
20406 2001-09-22 Ravi Pratap <ravi@ximian.com>
20408 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20409 Also take an additional TypeContainer argument.
20411 * All over : Pass in TypeContainer as argument to OverloadResolve.
20413 * typemanager.cs (CSharpName): Update to check for the string type and return
20416 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20419 2001-09-21 Ravi Pratap <ravi@ximian.com>
20421 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20422 (Invocation::BetterFunction): Implement.
20423 (Invocation::BetterConversion): Implement.
20424 (Invocation::ConversionExists): Skeleton, no implementation yet.
20426 Okay, things work fine !
20428 2001-09-21 Miguel de Icaza <miguel@ximian.com>
20430 * typemanager.cs: declare and load enum_type, delegate_type and
20433 * expression.cs (Expression::Emit): Now emit returns a value that
20434 tells whether a value is left on the stack or not. This strategy
20435 might be reveted tomorrow with a mechanism that would address
20436 multiple assignments.
20437 (Expression::report118): Utility routine to report mismatches on
20440 (Unary::Report23): Report impossible type/operator combination
20443 (Unary::IsIncrementableNumber): Whether the type can be
20444 incremented or decremented with add.
20445 (Unary::ResolveOperator): Also allow enumerations to be bitwise
20447 (Unary::ResolveOperator): Implement ++, !, ~,
20449 (Invocation::Emit): Deal with new Emit convetion.
20451 * All Expression derivatives: Updated their Emit method to return
20452 whether they leave values on the stack or not.
20454 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20455 stack for expressions that are statements.
20457 2001-09-20 Miguel de Icaza <miguel@ximian.com>
20459 * expression.cs (LValue): New interface. Must be implemented by
20461 (LocalVariableReference, ParameterReference, FieldExpr): Implement
20464 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20465 interface for generating code, simplifies the code.
20467 2001-09-20 Ravi Pratap <ravi@ximian.com>
20469 * expression.cs (everywhere): Comment out return statements in ::Resolve
20470 methods to avoid the warnings.
20472 2001-09-20 Miguel de Icaza <miguel@ximian.com>
20474 * driver.cs (parse): Report error 2001 if we can not open the
20477 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20480 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20483 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20484 otherwise nested blocks end up with the same index.
20486 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20488 * expression.cs: Instead of having FIXMEs in the Resolve
20489 functions, throw exceptions so it is obvious that we are facing a
20492 * cs-parser.jay (invocation_expression): Pass Location information.
20494 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20495 Use a basename for those routines because .NET does not like paths
20498 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20501 2001-09-19 Miguel de Icaza <miguel@ximian.com>
20503 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20504 are loading the correct data types (throws an exception if not).
20505 (TypeManager::InitCoreTypes): Use CoreLookupType
20507 * expression.cs (Unary::ResolveOperator): return the child
20508 expression for expressions which are just +expr.
20509 (Unary::ResolveOperator): Return negative literals for -LITERAL
20510 expressions (otherwise they are Unary {Literal}).
20511 (Invocation::Badness): Take into account `Implicit constant
20512 expression conversions'.
20514 * literal.cs (LongLiteral): Implement long literal class.
20515 (IntLiteral): export the `Value' of the intliteral.
20517 2001-09-19 Ravi Pratap <ravi@ximian.com>
20519 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20521 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
20522 instead of 'Operator'
20524 * expression.cs (Binary::ResolveOperator): Update accordingly.
20525 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20528 * cs-parser.jay (unary_expression): Update to use the new names.
20530 * gen-treedump.cs (GetUnary): Same here.
20532 * expression.cs (Unary::Resolve): Implement.
20533 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
20534 operators are found instead of making noise ;-)
20535 (Unary::ResolveOperator): New method to do precisely the same thing which
20536 Binary::ResolveOperator does for Binary expressions.
20537 (Unary.method, .Arguments): Add.
20538 (Unary::OperName): Implement.
20539 (Unary::ForceConversion): Copy and Paste !
20541 * class.cs (Operator::Define): Fix a small bug for the case when we have
20544 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20545 for the inbuilt operators. Only overloading works for now ;-)
20547 2001-09-18 Miguel de Icaza <miguel@ximian.com>
20549 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20550 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20552 * expression.cs (This::Emit): Implement.
20553 (This::Resolve): Implement.
20554 (TypeOf:Resolve): Implement.
20555 (Expression::ResolveSimpleName): Add an implicit this to instance
20557 (MemberAccess::Resolve): Deal with Parameters and Fields.
20558 Bind instance variable to Field expressions.
20559 (FieldExpr::Instance): New field used to track the expression that
20560 represents the object instance.
20561 (FieldExpr::Resolve): Track potential errors from MemberLookup not
20563 (FieldExpr::Emit): Implement.
20565 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20566 the last instruction contains a return opcode to avoid generating
20567 the last `ret' instruction (this generates correct code, and it is
20568 nice to pass the peverify output).
20570 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20571 initializer for static and instance variables.
20572 (Constructor::Emit): Allow initializer to be null in the case of
20573 static constructors. Only emit initializer for instance
20576 (TypeContainer::FindMembers): Return a null array if there are no
20579 Also fix the code for the MemberTypes.Method branch, as it was not
20580 scanning that for operators (or tried to access null variables before).
20582 * assign.cs (Assign::Emit): Handle instance and static fields.
20586 * driver.cs: Stop compilation if there are parse errors.
20588 * cs-parser.jay (constructor_declaration): Provide default base
20589 initializer for non-static constructors.
20590 (constructor_declarator): Do not provide a default base
20591 initializers if none was specified.
20592 Catch the fact that constructors should not have parameters.
20594 * class.cs: Do not emit parent class initializers for static
20595 constructors, that should be flagged as an error.
20597 2001-09-18 Ravi Pratap <ravi@ximian.com>
20599 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20600 Move back code into TypeContainer::Populate.
20602 2001-09-18 Ravi Pratap <ravi@ximian.com>
20604 * class.cs (TypeContainer::AddConstructor): Fix the check to
20605 compare against Name, not Basename.
20606 (Operator::OpType): Change Plus and Minus to Add and Subtract.
20608 * cs-parser.jay : Update accordingly.
20610 * class.cs (TypeContainer::FindMembers): For the case where we are searching
20611 for methods, don't forget to look into the operators too.
20612 (RegisterMethodBuilder): Helper method to take care of this for
20613 methods, constructors and operators.
20614 (Operator::Define): Completely revamp.
20615 (Operator.OperatorMethod, MethodName): New fields.
20616 (TypeContainer::Populate): Move the registering of builders into
20617 RegisterMethodBuilder.
20618 (Operator::Emit): Re-write.
20620 * expression.cs (Binary::Emit): Comment out code path to emit method
20621 invocation stuff for the case when we have a user defined operator. I am
20622 just not able to get it right !
20624 2001-09-17 Miguel de Icaza <miguel@ximian.com>
20626 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20629 (Expression::MemberLookup): Provide a version that allows to
20630 specify the MemberTypes and BindingFlags.
20632 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20633 so it was not fetching variable information from outer blocks.
20635 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20636 Beforefieldinit as it was buggy.
20638 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20639 that Ravi put here.
20641 * class.cs (Constructor::Emit): Only emit if block is not null.
20642 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20643 deal with this by semantically definining it as if the user had
20646 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20647 constructors as we now "emit" them at a higher level.
20649 (TypeContainer::DefineDefaultConstructor): Used to define the
20650 default constructors if none was provided.
20652 (ConstructorInitializer): Add methods Resolve and Emit.
20654 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20656 2001-09-17 Ravi Pratap <ravi@ximian.com>
20658 * class.cs (TypeContainer::EmitDefaultConstructor): Register
20659 the default constructor builder with our hashtable for methodbuilders
20662 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20663 and argument_count is 0 in which case we have a match.
20664 (Binary::ResolveOperator): More null checking and miscellaneous coding
20667 2001-09-17 Ravi Pratap <ravi@ximian.com>
20669 * rootcontext.cs (IsNameSpace): Compare against null.
20671 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20673 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20674 and Unary::Operator.
20676 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20679 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20680 we have overloaded operators.
20681 (Binary::ResolveOperator): Implement the part which does the operator overload
20684 * class.cs (Operator::Emit): Implement.
20685 (TypeContainer::Emit): Emit the operators we have too.
20687 * expression.cs (Binary::Emit): Update to emit the appropriate code for
20688 the case when we have a user-defined operator.
20690 2001-09-17 Miguel de Icaza <miguel@ximian.com>
20692 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20694 2001-09-16 Ravi Pratap <ravi@ximian.com>
20696 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20697 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20698 (Constructor::Emit): Implement.
20699 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20700 if we have no work to do.
20701 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
20704 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20705 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20707 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20710 2001-09-15 Ravi Pratap <ravi@ximian.com>
20712 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20714 (Tree::RecordNamespace): Method to do what the name says ;-)
20715 (Tree::Namespaces): Property to get at the namespaces hashtable.
20717 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
20720 * rootcontext.cs (IsNamespace): Fixed it :-)
20722 2001-09-14 Miguel de Icaza <miguel@ximian.com>
20724 * class.cs (TypeContainer::FindMembers): Add support for
20726 (MethodCore): New class that encapsulates both the shared aspects
20727 of a Constructor and a Method.
20728 (Method, Constructor): Factored pieces into MethodCore.
20730 * driver.cs: Added --fatal which makes errors throw exceptions.
20731 Load System assembly as well as part of the standard library.
20733 * report.cs: Allow throwing exceptions on errors for debugging.
20735 * modifiers.cs: Do not use `parent', instead use the real type
20736 container to evaluate permission settings.
20738 * class.cs: Put Ravi's patch back in. He is right, and we will
20739 have to cope with the
20741 2001-09-14 Ravi Pratap <ravi@ximian.com>
20743 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20744 FamORAssem, not FamANDAssem.
20746 2001-09-14 Miguel de Icaza <miguel@ximian.com>
20748 * driver.cs: Added --parse option that only parses its input files
20751 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
20752 incorrect. IsTopLevel is not used to tell whether an object is
20753 root_types or not (that can be achieved by testing this ==
20754 root_types). But to see if this is a top-level *class* (not
20755 necessarly our "toplevel" container).
20757 2001-09-14 Ravi Pratap <ravi@ximian.com>
20759 * enum.cs (Enum::Define): Modify to call the Lookup method on the
20760 parent instead of a direct call to GetType.
20762 2001-09-14 Ravi Pratap <ravi@ximian.com>
20764 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20765 Modifiers.TypeAttr. This should just be a call to that method.
20767 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20768 object so that we can determine if we are top-level or not.
20770 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
20773 * enum.cs (Enum::Define): Ditto.
20775 * modifiers.cs (FieldAttr): Re-write.
20777 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20778 (TypeContainer::HaveStaticConstructor): New property to provide access
20779 to precisely that info.
20781 * modifiers.cs (MethodAttr): Re-write.
20782 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20784 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20785 of top-level types as claimed.
20787 2001-09-13 Miguel de Icaza <miguel@ximian.com>
20789 * expression.cs (MemberLookup): Fruitless attempt to lookup
20790 constructors. Maybe I need to emit default constructors? That
20791 might be it (currently .NET emits this for me automatically).
20792 (Invocation::OverloadResolve): Cope with Arguments == null.
20793 (Invocation::EmitArguments): new function, shared by the new
20794 constructor and us.
20795 (Invocation::Emit): Handle static and instance methods. Emit
20796 proper call instruction for virtual or non-virtual invocations.
20797 (New::Emit): Implement.
20798 (New::Resolve): Implement.
20799 (MemberAccess:Resolve): Implement.
20800 (MethodGroupExpr::InstanceExpression): used conforming to the spec
20801 to track instances.
20802 (FieldExpr::Resolve): Set type.
20804 * support.cs: Handle empty arguments.
20806 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20807 SimpleLookup): Auxiliary routines to help parse a qualifier
20810 Update qualifier_identifier rule.
20812 * codegen.cs: Removed debugging messages.
20814 * class.cs: Make this a global thing, this acts just as a "key" to
20815 objects that we might have around.
20817 (Populate): Only initialize method_builders_to_methods once.
20819 * expression.cs (PropertyExpr): Initialize type from the
20822 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20823 Resolve pattern. Attempt to implicitly convert value to boolean.
20826 * expression.cs: Set the type for the int32/int32 argument case.
20827 (Binary::ResolveOperator): Set the return type to boolean for
20828 comparission operators
20830 * typemanager.cs: Remove debugging print code.
20832 (Invocation::Resolve): resolve type.
20834 * class.cs: Allocate a MemberInfo of the correct size, as the code
20835 elsewhere depends on the test to reflect the correct contents.
20837 (Method::) Keep track of parameters, due to System.Reflection holes
20839 (TypeContainer::Populate): Keep track of MethodBuilders to Method
20842 (TypeContainer::FindMembers): Use ArrayList and then copy an array
20843 of the exact size and return that.
20845 (Class::LookupMethodByBuilder): New function that maps
20846 MethodBuilders to its methods. Required to locate the information
20847 on methods because System.Reflection bit us again.
20849 * support.cs: New file, contains an interface ParameterData and
20850 two implementations: ReflectionParameters and InternalParameters
20851 used to access Parameter information. We will need to grow this
20854 * expression.cs (Invocation::GetParameterData): implement a cache
20855 and a wrapper around the ParameterData creation for methods.
20856 (Invocation::OverloadResolve): Use new code.
20858 2001-09-13 Ravi Pratap <ravi@ximian.com>
20860 * class.cs (TypeContainer::EmitField): Remove and move into
20861 (Field::Define): here and modify accordingly.
20862 (Field.FieldBuilder): New member.
20863 (TypeContainer::Populate): Update accordingly.
20864 (TypeContainer::FindMembers): Implement.
20866 2001-09-13 Miguel de Icaza <miguel@ximian.com>
20868 * statement.cs: (VariableInfo::VariableType): New field to be
20869 initialized with the full type once it is resolved.
20871 2001-09-12 Miguel de Icaza <miguel@ximian.com>
20873 * parameter.cs (GetParameterInfo): Use a type cache to compute
20874 things only once, and to reuse this information
20876 * expression.cs (LocalVariableReference::Emit): Implement.
20877 (OpcodeCast::Emit): fix.
20879 (ParameterReference::Resolve): Implement.
20880 (ParameterReference::Emit): Implement.
20882 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20883 that are expressions need to stay as Expressions.
20885 * typemanager.cs (CSharpName): Returns the C# name of a type if
20888 * expression.cs (Expression::ConvertImplicit): New function that
20889 implements implicit type conversions.
20891 (Expression::ImplicitReferenceConversion): Implements implicit
20892 reference conversions.
20894 (EmptyCast): New type for transparent casts.
20896 (OpcodeCast): New type for casts of types that are performed with
20897 a sequence of bytecodes.
20899 (BoxedCast): New type used for casting value types into reference
20900 types. Emits a box opcode.
20902 (Binary::DoNumericPromotions): Implements numeric promotions of
20903 and computation of the Binary::Type.
20905 (Binary::EmitBranchable): Optimization.
20907 (Binary::Emit): Implement code emission for expressions.
20909 * typemanager.cs (TypeManager): Added two new core types: sbyte
20912 2001-09-12 Ravi Pratap <ravi@ximian.com>
20914 * class.cs (TypeContainer::FindMembers): Method which does exactly
20915 what Type.FindMembers does, only we don't have to use reflection. No
20916 implementation yet.
20918 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20919 typecontainer objects as we need to get at them.
20920 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20922 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20923 typecontainer object.
20925 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20926 of just a Report object.
20928 2001-09-11 Ravi Pratap <ravi@ximian.com>
20930 * class.cs (Event::Define): Go back to using the prefixes "add_" and
20932 (TypeContainer::Populate): Now define the delegates of the type too.
20933 (TypeContainer.Delegates): Property to access the list of delegates defined
20936 * delegates.cs (Delegate::Define): Implement partially.
20938 * modifiers.cs (TypeAttr): Handle more flags.
20940 2001-09-11 Ravi Pratap <ravi@ximian.com>
20942 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20944 (Operator::Define): Re-write logic to get types by using the LookupType method
20945 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20946 (Indexer::Define): Ditto.
20947 (Event::Define): Ditto.
20948 (Property::Define): Ditto.
20950 2001-09-10 Ravi Pratap <ravi@ximian.com>
20952 * class.cs (TypeContainer::Populate): Now define operators too.
20953 (TypeContainer.Operators): New property to access the list of operators
20955 (Operator.OperatorMethodBuilder): New member to hold the method builder
20956 for the operator we are defining.
20957 (Operator::Define): Implement.
20959 2001-09-10 Ravi Pratap <ravi@ximian.com>
20961 * class.cs (Event::Define): Make the prefixes of the accessor methods
20962 addOn_ and removeOn_
20964 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20965 of the location being passed in too. Ideally, this should go later since all
20966 error reporting should be done through the Report object.
20968 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20969 (Populate): Iterate thru the indexers we have and define them too.
20970 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20971 for the get and set accessors.
20972 (Indexer::Define): Implement.
20974 2001-09-09 Miguel de Icaza <miguel@ximian.com>
20976 * expression.cs (Binary::Resolve): Beginning of it. I scratched
20977 my previous implementation, did not work.
20979 * typemanager.cs: Add a couple of missing types (the longs).
20981 * literal.cs: Use TypeManager.bool_type instead of getting it.
20983 * expression.cs (EventExpr): New kind of expressions.
20984 (Expressio::ExprClassFromMemberInfo): finish
20986 2001-09-08 Miguel de Icaza <miguel@ximian.com>
20988 * assign.cs: Emit stores to static fields differently.
20990 2001-09-08 Ravi Pratap <ravi@ximian.com>
20992 * Merge in changes and adjust code to tackle conflicts. Backed out my
20993 code in Assign::Resolve ;-)
20995 2001-09-08 Ravi Pratap <ravi@ximian.com>
20997 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20998 instead Report.Error and also pass in the location.
20999 (CSharpParser::Lexer): New readonly property to return the reference
21000 to the Tokenizer object.
21001 (declare_local_variables): Use Report.Error with location instead of plain
21005 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21006 (Operator.CheckBinaryOperator): Ditto.
21008 * cs-parser.jay (operator_declarator): Update accordingly.
21010 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21011 (CheckBinaryOperator): Same here.
21013 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21014 on the name without any prefixes of namespace names etc. This is because we
21015 already might have something already fully qualified like
21016 'System.Console.WriteLine'
21018 * assign.cs (Resolve): Begin implementation. Stuck ;-)
21020 2001-09-07 Ravi Pratap <ravi@ximian.com>
21022 * cs-tokenizer.cs (location): Return a string which also contains
21025 * expression.cs (ElementAccess): New class for expressions of the
21026 type 'element access.'
21027 (BaseAccess): New class for expressions of the type 'base access.'
21028 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21031 * cs-parser.jay (element_access): Implement action.
21032 (base_access): Implement actions.
21033 (checked_expression, unchecked_expression): Implement.
21035 * cs-parser.jay (local_variable_type): Correct and implement.
21036 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21038 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21040 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21041 name and the specifiers.
21043 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21045 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
21046 making them all public ;-)
21048 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21051 2001-09-07 Miguel de Icaza <miguel@ximian.com>
21053 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21055 (FieldExpr, PropertyExprs): New resolved expressions.
21056 (SimpleName::MemberStaticCheck): Perform static checks for access
21057 to non-static fields on static methods. Maybe this should be
21058 generalized for MemberAccesses.
21059 (SimpleName::ResolveSimpleName): More work on simple name
21062 * cs-parser.jay (primary_expression/qualified_identifier): track
21063 the parameter index.
21065 * codegen.cs (CodeGen::Save): Catch save exception, report error.
21066 (EmitContext::EmitBoolExpression): Chain to expression generation
21067 instead of temporary hack.
21068 (::EmitStatementExpression): Put generic expression code generation.
21070 * assign.cs (Assign::Emit): Implement variable assignments to
21071 local variables, parameters and fields.
21073 2001-09-06 Miguel de Icaza <miguel@ximian.com>
21075 * statement.cs (Block::GetVariableInfo): New method, returns the
21076 VariableInfo for a variable name in a block.
21077 (Block::GetVariableType): Implement in terms of GetVariableInfo
21079 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21080 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21082 2001-09-06 Ravi Pratap <ravi@ximian.com>
21084 * cs-parser.jay (operator_declaration): Continue on my quest : update
21085 to take attributes argument.
21086 (event_declaration): Ditto.
21087 (enum_declaration): Ditto.
21088 (indexer_declaration): Ditto.
21090 * class.cs (Operator::Operator): Update constructor accordingly.
21091 (Event::Event): Ditto.
21093 * delegate.cs (Delegate::Delegate): Same here.
21095 * enum.cs (Enum::Enum): Same here.
21097 2001-09-05 Ravi Pratap <ravi@ximian.com>
21099 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21101 * ../tests/cs0658.cs : New file to demonstrate error 0658.
21103 * attribute.cs (Attributes): New class to encapsulate all attributes which were
21104 being passed around as an arraylist.
21105 (Attributes::AddAttribute): Method to add attribute sections.
21107 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21108 (struct_declaration): Update accordingly.
21109 (constant_declaration): Update.
21110 (field_declaration): Update.
21111 (method_header): Update.
21112 (fixed_parameter): Update.
21113 (parameter_array): Ditto.
21114 (property_declaration): Ditto.
21115 (destructor_declaration): Ditto.
21117 * class.cs (Struct::Struct): Update constructors accordingly.
21118 (Class::Class): Ditto.
21119 (Field::Field): Ditto.
21120 (Method::Method): Ditto.
21121 (Property::Property): Ditto.
21122 (TypeContainer::OptAttribute): update property's return type.
21124 * interface.cs (Interface.opt_attributes): New member.
21125 (Interface::Interface): Update to take the extra Attributes argument.
21127 * parameter.cs (Parameter::Parameter): Ditto.
21129 * constant.cs (Constant::Constant): Ditto.
21131 * interface.cs (InterfaceMemberBase): New OptAttributes field.
21132 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
21133 the attributes as a parameter.
21134 (InterfaceProperty): Update constructor call.
21135 (InterfaceEvent): Ditto.
21136 (InterfaceMethod): Ditto.
21137 (InterfaceIndexer): Ditto.
21139 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
21140 pass the attributes too.
21141 (interface_event_declaration): Ditto.
21142 (interface_property_declaration): Ditto.
21143 (interface_method_declaration): Ditto.
21144 (interface_declaration): Ditto.
21146 2001-09-05 Miguel de Icaza <miguel@ximian.com>
21148 * class.cs (Method::Define): Track the "static Main" definition to
21149 create an entry point.
21151 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21152 EntryPoint if we find it.
21154 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21155 (EmitContext::ig): Make this variable public.
21157 * driver.cs: Make the default output file be the first file name
21158 with the .exe extension.
21160 Detect empty compilations
21162 Handle various kinds of output targets. Handle --target and
21163 rename -t to --dumper.
21165 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21166 methods inherited from Expression return now an Expression. This
21167 will is used during the tree rewriting as we resolve them during
21170 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21171 the spec. Missing entirely is the information about
21172 accessability of elements of it.
21174 (Expression::ExprClassFromMemberInfo): New constructor for
21175 Expressions that creates a fully initialized Expression based on
21176 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21179 (Invocation::Resolve): Begin implementing resolution of invocations.
21181 * literal.cs (StringLiteral): Implement Emit.
21183 2001-09-05 Ravi Pratap <ravi@ximian.com>
21185 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21188 2001-09-04 Ravi Pratap <ravi@ximian.com>
21190 * cs-parser.jay (attribute_arguments): Implement actions.
21191 (attribute): Fix bug in production. Implement action.
21192 (attribute_list): Implement.
21193 (attribute_target): Implement.
21194 (attribute_target_specifier, opt_target_specifier): Implement
21195 (CheckAttributeTarget): New method to check if the attribute target
21197 (attribute_section): Implement.
21198 (opt_attributes): Implement.
21200 * attribute.cs : New file to handle attributes.
21201 (Attribute): Class to hold attribute info.
21203 * cs-parser.jay (opt_attribute_target_specifier): Remove production
21204 (attribute_section): Modify production to use 2 different rules to
21205 achieve the same thing. 1 s/r conflict down !
21206 Clean out commented, useless, non-reducing dimension_separator rules.
21208 * class.cs (TypeContainer.attributes): New member to hold list
21209 of attributes for a type.
21210 (Struct::Struct): Modify to take one more argument, the attribute list.
21211 (Class::Class): Ditto.
21212 (Field::Field): Ditto.
21213 (Method::Method): Ditto.
21214 (Property::Property): Ditto.
21216 * cs-parser.jay (struct_declaration): Update constructor call to
21217 pass in the attributes too.
21218 (class_declaration): Ditto.
21219 (constant_declaration): Ditto.
21220 (field_declaration): Ditto.
21221 (method_header): Ditto.
21222 (fixed_parameter): Ditto.
21223 (parameter_array): Ditto.
21224 (property_declaration): Ditto.
21226 * constant.cs (Constant::Constant): Update constructor similarly.
21227 Use System.Collections.
21229 * parameter.cs (Parameter::Parameter): Update as above.
21231 2001-09-02 Ravi Pratap <ravi@ximian.com>
21233 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21234 (TypeContainer.delegates): New member to hold list of delegates.
21236 * cs-parser.jay (delegate_declaration): Implement the action correctly
21237 this time as I seem to be on crack ;-)
21239 2001-09-02 Miguel de Icaza <miguel@ximian.com>
21241 * rootcontext.cs (RootContext::IsNamespace): new function, used to
21242 tell whether an identifier represents a namespace.
21244 * expression.cs (NamespaceExpr): A namespace expression, used only
21245 temporarly during expression resolution.
21246 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21247 utility functions to resolve names on expressions.
21249 2001-09-01 Miguel de Icaza <miguel@ximian.com>
21251 * codegen.cs: Add hook for StatementExpressions.
21253 * class.cs: Fix inverted test for static flag in methods.
21255 2001-09-02 Ravi Pratap <ravi@ximian.com>
21257 * class.cs (Operator::CheckUnaryOperator): Correct error number used
21258 to make it coincide with MS' number.
21259 (Operator::CheckBinaryOperator): Ditto.
21261 * ../errors/errors.txt : Remove error numbers added earlier.
21263 * ../errors/cs1019.cs : Test case for error # 1019
21265 * ../errros/cs1020.cs : Test case for error # 1020
21267 * cs-parser.jay : Clean out commented cruft.
21268 (dimension_separators, dimension_separator): Comment out. Ostensibly not
21269 used anywhere - non-reducing rule.
21270 (namespace_declarations): Non-reducing rule - comment out.
21272 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21273 with TypeContainer::AddEnum.
21275 * delegate.cs : New file for delegate handling classes.
21276 (Delegate): Class for declaring delegates.
21278 * makefile : Update.
21280 * cs-parser.jay (delegate_declaration): Implement.
21282 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
21284 * class.cs (Event::Define): Implement.
21285 (Event.EventBuilder): New member.
21287 * class.cs (TypeContainer::Populate): Update to define all enums and events
21289 (Events): New property for the events arraylist we hold. Shouldn't we move to using
21290 readonly fields for all these cases ?
21292 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
21294 * class.cs (Property): Revamp to use the convention of making fields readonly.
21295 Accordingly modify code elsewhere.
21297 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21298 the Define method of the Property class.
21300 * class.cs : Clean up applied patch and update references to variables etc. Fix
21302 (TypeContainer::Populate): Update to define all the properties we have. Also
21303 define all enumerations.
21305 * enum.cs (Define): Implement.
21307 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
21309 * cs-parser.jay (overloadable_operator): The semantic value is an
21310 enum of the Operator class.
21311 (operator_declarator): Implement actions.
21312 (operator_declaration): Implement.
21314 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21315 validity of definitions.
21316 (Operator::CheckBinaryOperator): Static method to check for binary operators
21317 (TypeContainer::AddOperator): New method to add an operator to a type.
21319 * cs-parser.jay (indexer_declaration): Added line to actually call the
21320 AddIndexer method so it gets added ;-)
21322 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
21323 already taken care of by the MS compiler ?
21325 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
21327 * class.cs (Operator): New class for operator declarations.
21328 (Operator::OpType): Enum for the various operators.
21330 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
21332 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21333 ostensibly handle this in semantic analysis.
21335 * cs-parser.jay (general_catch_clause): Comment out
21336 (specific_catch_clauses, specific_catch_clause): Ditto.
21337 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21338 (catch_args, opt_catch_args): New productions.
21339 (catch_clause): Rewrite to use the new productions above
21340 (catch_clauses): Modify accordingly.
21341 (opt_catch_clauses): New production to use in try_statement
21342 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21343 and re-write the code in the actions to extract the specific and
21344 general catch clauses by being a little smart ;-)
21346 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21347 Hooray, try and catch statements parse fine !
21349 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
21351 * statement.cs (Block::GetVariableType): Fix logic to extract the type
21352 string from the hashtable of variables.
21354 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21355 I end up making that mistake ;-)
21356 (catch_clauses): Fixed gross error which made Key and Value of the
21357 DictionaryEntry the same : $1 !!
21359 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
21361 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21363 * cs-parser.jay (event_declaration): Correct to remove the semicolon
21364 when the add and remove accessors are specified.
21366 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
21368 * cs-parser.jay (IndexerDeclaration): New helper class to hold
21369 information about indexer_declarator.
21370 (indexer_declarator): Implement actions.
21371 (parsing_indexer): New local boolean used to keep track of whether
21372 we are parsing indexers or properties. This is necessary because
21373 implicit_parameters come into picture even for the get accessor in the
21374 case of an indexer.
21375 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21377 * class.cs (Indexer): New class for indexer declarations.
21378 (TypeContainer::AddIndexer): New method to add an indexer to a type.
21379 (TypeContainer::indexers): New member to hold list of indexers for the
21382 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
21384 * cs-parser.jay (add_accessor_declaration): Implement action.
21385 (remove_accessor_declaration): Implement action.
21386 (event_accessors_declaration): Implement
21387 (variable_declarators): swap statements for first rule - trivial.
21389 * class.cs (Event): New class to hold information about event
21391 (TypeContainer::AddEvent): New method to add an event to a type
21392 (TypeContainer::events): New member to hold list of events.
21394 * cs-parser.jay (event_declaration): Implement actions.
21396 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
21398 * cs-parser.jay (dim_separators): Implement. Make it a string
21399 concatenating all the commas together, just as they appear.
21400 (opt_dim_separators): Modify accordingly
21401 (rank_specifiers): Update accordingly. Basically do the same
21402 thing - instead, collect the brackets here.
21403 (opt_rank_sepcifiers): Modify accordingly.
21404 (array_type): Modify to actually return the complete type string
21405 instead of ignoring the rank_specifiers.
21406 (expression_list): Implement to collect the expressions
21407 (variable_initializer): Implement. We make it a list of expressions
21408 essentially so that we can handle the array_initializer case neatly too.
21409 (variable_initializer_list): Implement.
21410 (array_initializer): Make it a list of variable_initializers
21411 (opt_array_initializer): Modify accordingly.
21413 * expression.cs (New::NType): Add enumeration to help us
21414 keep track of whether we have an object/delegate creation
21415 or an array creation.
21416 (New:NewType, New::Rank, New::Indices, New::Initializers): New
21417 members to hold data about array creation.
21418 (New:New): Modify to update NewType
21419 (New:New): New Overloaded contructor for the array creation
21422 * cs-parser.jay (array_creation_expression): Implement to call
21423 the overloaded New constructor.
21425 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
21427 * class.cs (TypeContainer::Constructors): Return member
21428 constructors instead of returning null.
21430 2001-08-26 Miguel de Icaza <miguel@ximian.com>
21432 * typemanager.cs (InitCoreTypes): Initialize the various core
21433 types after we have populated the type manager with the user
21434 defined types (this distinction will be important later while
21435 compiling corlib.dll)
21437 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21438 on Expression Classification. Now all expressions have a method
21439 `Resolve' and a method `Emit'.
21441 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21442 generation from working. Also add some temporary debugging
21445 2001-08-24 Miguel de Icaza <miguel@ximian.com>
21447 * codegen.cs: Lots of code generation pieces. This is only the
21448 beginning, will continue tomorrow with more touches of polish. We
21449 handle the fundamentals of if, while, do, for, return. Others are
21450 trickier and I need to start working on invocations soon.
21452 * gen-treedump.cs: Bug fix, use s.Increment here instead of
21455 * codegen.cs (EmitContext): New struct, used during code
21456 emission to keep a context. Most of the code generation will be
21459 * cs-parser.jay: Add embedded blocks to the list of statements of
21460 this block. So code generation proceeds in a top down fashion.
21462 2001-08-23 Miguel de Icaza <miguel@ximian.com>
21464 * statement.cs: Add support for multiple child blocks.
21466 2001-08-22 Miguel de Icaza <miguel@ximian.com>
21468 * codegen.cs (EmitCode): New function, will emit the code for a
21469 Block of code given a TypeContainer and its ILGenerator.
21471 * statement.cs (Block): Standard public readonly optimization.
21472 (Block::Block constructors): Link children.
21473 (Block::Child): Child Linker.
21474 (Block::EmitVariables): Emits IL variable declarations.
21476 * class.cs: Drop support for MethodGroups here, delay until
21478 (Method::): Applied the same simplification that I did before, and
21479 move from Properties to public readonly fields.
21480 (Method::ParameterTypes): Returns the parameter types for the
21481 function, and implements a cache that will be useful later when I
21482 do error checking and the semantic analysis on the methods is
21484 (Constructor::GetCallingConvention): Renamed from CallingConvetion
21485 and made a method, optional argument tells whether this is a class
21486 or a structure to apply the `has-this' bit.
21487 (Method::GetCallingConvention): Implement, returns the calling
21489 (Method::Define): Defines the type, a second pass is performed
21490 later to populate the methods.
21492 (Constructor::ParameterTypes): implement a cache similar to the
21493 one on Method::ParameterTypes, useful later when we do semantic
21496 (TypeContainer::EmitMethod): New method. Emits methods.
21498 * expression.cs: Removed MethodGroup class from here.
21500 * parameter.cs (Parameters::GetCallingConvention): new method.
21502 2001-08-21 Miguel de Icaza <miguel@ximian.com>
21504 * class.cs (TypeContainer::Populate): Drop RootContext from the
21507 (Constructor::CallingConvention): Returns the calling convention.
21508 (Constructor::ParameterTypes): Returns the constructor parameter
21511 (TypeContainer::AddConstructor): Keep track of default constructor
21512 and the default static constructor.
21514 (Constructor::) Another class that starts using `public readonly'
21515 instead of properties.
21517 (Constructor::IsDefault): Whether this is a default constructor.
21519 (Field::) use readonly public fields instead of properties also.
21521 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21522 track of static constructors; If none is used, turn on
21523 BeforeFieldInit in the TypeAttributes.
21525 * cs-parser.jay (opt_argument_list): now the return can be null
21526 for the cases where there are no arguments.
21528 (constructor_declarator): If there is no implicit `base' or
21529 `this', then invoke the default parent constructor.
21531 * modifiers.cs (MethodAttr): New static function maps a set of
21532 modifiers flags into a MethodAttributes enum
21533 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
21534 MethodAttr, TypeAttr to represent the various mappings where the
21535 modifiers are used.
21536 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
21538 2001-08-19 Miguel de Icaza <miguel@ximian.com>
21540 * parameter.cs (GetParameterInfo): Fix bug where there would be no
21543 * interface.cs (PopulateIndexer): Implemented the code generator
21544 for interface indexers.
21546 2001-08-17 Miguel de Icaza <miguel@ximian.com>
21548 * interface.cs (InterfaceMemberBase): Now we track the new status
21551 (PopulateProperty): Implement property population. Woohoo! Got
21552 Methods and Properties going today.
21554 Removed all the properties for interfaces, and replaced them with
21555 `public readonly' fields.
21557 2001-08-16 Miguel de Icaza <miguel@ximian.com>
21559 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21560 initialize their hashtables/arraylists only when they are needed
21561 instead of doing this always.
21563 * parameter.cs: Handle refs and out parameters.
21565 * cs-parser.jay: Use an ArrayList to construct the arguments
21566 instead of the ParameterCollection, and then cast that to a
21569 * parameter.cs: Drop the use of ParameterCollection and use
21570 instead arrays of Parameters.
21572 (GetParameterInfo): Use the Type, not the Name when resolving
21575 2001-08-13 Miguel de Icaza <miguel@ximian.com>
21577 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21578 and instead use public readonly fields.
21580 * class.cs: Put back walking code for type containers.
21582 2001-08-11 Miguel de Icaza <miguel@ximian.com>
21584 * class.cs (MakeConstant): Code to define constants.
21586 * rootcontext.cs (LookupType): New function. Used to locate types
21589 2001-08-08 Miguel de Icaza <miguel@ximian.com>
21591 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
21592 this System.Reflection code is. Kudos to Microsoft
21594 * typemanager.cs: Implement a type cache and avoid loading all
21595 types at boot time. Wrap in LookupType the internals. This made
21596 the compiler so much faster. Wow. I rule!
21598 * driver.cs: Make sure we always load mscorlib first (for
21599 debugging purposes, nothing really important).
21601 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
21602 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
21604 * rootcontext.cs: Lookup types on their namespace; Lookup types
21605 on namespaces that have been imported using the `using' keyword.
21607 * class.cs (TypeContainer::TypeAttr): Virtualize.
21608 (Class::TypeAttr): Return attributes suitable for this bad boy.
21609 (Struct::TypeAttr): ditto.
21610 Handle nested classes.
21611 (TypeContainer::) Remove all the type visiting code, it is now
21612 replaced with the rootcontext.cs code
21614 * rootcontext.cs (GetClassBases): Added support for structs.
21616 2001-08-06 Miguel de Icaza <miguel@ximian.com>
21618 * interface.cs, statement.cs, class.cs, parameter.cs,
21619 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21620 Drop use of TypeRefs, and use strings instead.
21622 2001-08-04 Miguel de Icaza <miguel@ximian.com>
21626 * class.cs (Struct::Struct): set the SEALED flags after
21627 checking the modifiers.
21628 (TypeContainer::TypeAttr): new property, returns the
21629 TypeAttributes for a class.
21631 * cs-parser.jay (type_list): Oops, list production was creating a
21632 new list of base types.
21634 * rootcontext.cs (StdLib): New property.
21635 (GetInterfaceTypeByName): returns an interface by type name, and
21636 encapsulates error handling here.
21637 (GetInterfaces): simplified.
21638 (ResolveTree): Encapsulated all the tree resolution here.
21639 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21642 * driver.cs: Add support for --nostdlib, to avoid loading the
21643 default assemblies.
21644 (Main): Do not put tree resolution here.
21646 * rootcontext.cs: Beginning of the class resolution.
21648 2001-08-03 Miguel de Icaza <miguel@ximian.com>
21650 * rootcontext.cs: Provide better error reporting.
21652 * cs-parser.jay (interface_base): set our $$ to be interfaces.
21654 * rootcontext.cs (CreateInterface): Handle the case where there
21655 are no parent interfaces.
21657 (CloseTypes): Routine to flush types at the end.
21658 (CreateInterface): Track types.
21659 (GetInterfaces): Returns an array of Types from the list of
21660 defined interfaces.
21662 * typemanager.c (AddUserType): Mechanism to track user types (puts
21663 the type on the global type hash, and allows us to close it at the
21666 2001-08-02 Miguel de Icaza <miguel@ximian.com>
21668 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21669 RecordInterface instead.
21671 * cs-parser.jay: Updated to reflect changes above.
21673 * decl.cs (Definition): Keep track of the TypeBuilder type that
21674 represents this type here. Not sure we will use it in the long
21675 run, but wont hurt for now.
21677 * driver.cs: Smaller changes to accomodate the new code.
21679 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21682 * rootcontext.cs (CreateInterface): New method, used to create
21683 the System.TypeBuilder type for interfaces.
21684 (ResolveInterfaces): new entry point to resolve the interface
21686 (CodeGen): Property, used to keep track of the code generator.
21688 2001-07-26 Miguel de Icaza <miguel@ximian.com>
21690 * cs-parser.jay: Add a second production for delegate_declaration
21693 (enum_body): Put an opt_comma here instead of putting it on
21694 enum_body or enum_member_declarations so we can handle trailing
21695 commas on enumeration members. Gets rid of a shift/reduce.
21697 (type_list): Need a COMMA in the middle.
21699 (indexer_declaration): Tell tokenizer to recognize get/set
21701 * Remove old targets.
21703 * Re-add the parser target.
21705 2001-07-13 Simon Cozens <simon@simon-cozens.org>
21707 * cs-parser.jay: Add precendence rules for a number of operators
21708 ot reduce the number of shift/reduce conflicts in the grammar.
21710 2001-07-17 Miguel de Icaza <miguel@ximian.com>
21712 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21715 Get rid of old crufty code.
21717 * rootcontext.cs: Use this to keep track of the parsed
21718 representation and the defined types available to the program.
21720 * gen-treedump.cs: adjust for new convention.
21722 * type.cs: Split out the type manager, and the assembly builder
21725 * typemanager.cs: the type manager will live here now.
21727 * cil-codegen.cs: And the code generator here.
21729 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
21731 * makefile: Fixed up for easy making.
21733 2001-07-13 Simon Cozens <simon@simon-cozens.org>
21735 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21738 (unary_expression): Expand pre_increment_expression and
21739 post_decrement_expression to reduce a shift/reduce.
21741 2001-07-11 Simon Cozens
21743 * cs-tokenizer.cs: Hex numbers should begin with a 0.
21745 Improve allow_keyword_as_indent name.
21747 2001-06-19 Miguel de Icaza <miguel@ximian.com>
21749 * Adjustments for Beta2.
21751 2001-06-13 Miguel de Icaza <miguel@ximian.com>
21753 * decl.cs: Added `Define' abstract method.
21754 (InTransit): new property, used to catch recursive definitions.
21756 * interface.cs: Implement `Define'.
21758 * modifiers.cs: Map Modifiers.constants to
21759 System.Reflection.TypeAttribute flags.
21761 * class.cs: Keep track of types and user-defined types.
21762 (BuilderInit): New method for creating an assembly
21763 (ResolveType): New function to launch the resolution process, only
21764 used by interfaces for now.
21766 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21767 that are inserted into the name space.
21769 2001-06-08 Miguel de Icaza <miguel@ximian.com>
21771 * ARGH. I have screwed up my tree so many times due to the use of
21772 rsync rather than using CVS. Going to fix this at once.
21774 * driver.cs: Objetify driver. Load assemblies, use assemblies to
21777 2001-06-07 Miguel de Icaza <miguel@ximian.com>
21779 * Experiment successful: Use System.Type rather that our own
21782 2001-05-25 Miguel de Icaza <miguel@ximian.com>
21784 * cs-parser.jay: Removed nsAliases from here.
21786 Use new namespaces, handle `using XXX;'
21788 * namespace.cs: Reimplemented namespace handling, use a recursive
21789 definition of the class. Now we can keep track of using clauses
21790 and catch invalid using clauses.
21792 2001-05-24 Miguel de Icaza <miguel@ximian.com>
21794 * gen-treedump.cs: Adapted for all the renaming.
21796 * expression.cs (Expression): this class now has a Type property
21797 which returns an expression Type.
21799 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21800 `Type', as this has a different meaning now in the base
21802 2001-05-22 Miguel de Icaza <miguel@ximian.com>
21804 * interface.cs, class.cs: Removed from all the sources the
21805 references to signature computation, as we can not do method
21806 signature computation during the parsing time, as we are not
21807 trying to solve at that point distinguishing:
21811 void a (NS.Blah x) {}
21814 Which depending on the context might be valid or not, as we do not
21815 know if Blah is the same thing as NS.Blah at that point.
21817 * Redid everything so the code uses TypeRefs now instead of
21818 Types. TypeRefs are just temporary type placeholders, that need
21819 to be resolved. They initially have a pointer to a string and the
21820 current scope in which they are used. This is used later by the
21821 compiler to resolve the reference to an actual Type.
21823 * DeclSpace is no longer a CIR.Type, and neither are
21824 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
21825 are all DeclSpaces, but no Types.
21827 * type.cs (TypeRefManager): This implements the TypeRef manager,
21828 which keeps track of all the types that need to be resolved after
21829 the parsing has finished.
21831 2001-05-13 Miguel de Icaza <miguel@ximian.com>
21833 * ARGH. We are going to have to store `foreach' as a class rather
21834 than resolving it, as we need to verify error 1579 after name
21835 resolution. *OR* we could keep a flag that says `This request to
21836 IEnumerator comes from a foreach statement' which we can then use
21837 to generate the error.
21839 2001-05-10 Miguel de Icaza <miguel@ximian.com>
21841 * class.cs (TypeContainer.AddMethod): we now add methods to the
21842 MethodGroup instead of the method hashtable.
21844 * expression.cs: Add MethodGroup abstraction, which gets us one
21845 step closer to the specification in the way we handle method
21848 * cs-parser.jay (primary_expression): qualified_identifier now
21849 tried to match up an identifier to a local variable reference or
21850 to a parameter reference.
21852 current_local_parameters is now a parser global variable that
21853 points to the current parameters for the block, used during name
21856 (property_declaration): Now creates an implicit `value' argument to
21859 2001-05-09 Miguel de Icaza <miguel@ximian.com>
21861 * parameter.cs: Do not use `param' arguments as part of the
21862 signature, per the spec.
21864 2001-05-08 Miguel de Icaza <miguel@ximian.com>
21866 * decl.cs: Base class for classes, structs and interfaces. This
21867 is the "Declaration Space"
21869 * cs-parser.jay: Use CheckDef for checking declaration errors
21870 instead of having one on each function.
21872 * class.cs: Factor out some code for handling error handling in
21873 accordance to the "Declarations" section in the "Basic Concepts"
21874 chapter in the ECMA C# spec.
21876 * interface.cs: Make all interface member classes derive from
21877 InterfaceMemberBase.
21879 2001-05-07 Miguel de Icaza <miguel@ximian.com>
21881 * Many things: all interfaces are parsed and generated in
21882 gen-treedump. Support for member variables, constructors,
21883 destructors, properties, constants is there.
21885 Beginning of the IL backend, but very little done, just there for
21888 2001-04-29 Miguel de Icaza <miguel@ximian.com>
21890 * cs-parser.jay: Fix labeled statement.
21892 * cs-tokenizer.cs (escape): Escape " and ' always.
21893 ref_line, ref_name: keep track of the line/filename as instructed
21894 by #line by the compiler.
21897 2001-04-27 Miguel de Icaza <miguel@ximian.com>
21899 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21900 to match the values in System.CodeDOM.
21902 Divid renamed to Divide.
21904 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21906 (Statements.set): remove.
21908 * System.CodeDOM/CodeCatchClause.cs: always have a valid
21911 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21912 falseStatements always have valid values.
21914 * cs-parser.jay: Use System.CodeDOM now.