1 2005-11-17 Martin Baulig <martin@ximian.com>
3 * expression.cs (Indexers.GetIndexersForType): Added support for
4 generic parameters; fixes #76587.
6 2005-11-17 Martin Baulig <martin@ximian.com>
9 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
10 inherit the scope from our parent. Fixes #76653.
12 2005-11-15 Martin Baulig <martin@ximian.com>
14 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
15 instead of `ScopeTypeBuilder' to refer to the "current" type.
16 (AnonymousMethod.CreateScopeType): Correctly create the helper
17 class if we're inside a generic type definition.
19 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
21 * doc.cs : use Invocation.IsOverride() to do real override check.
22 * expression.cs : made Invocation.IsOverride() internal.
24 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
26 * doc.cs : use TypeManager.FindMembers() instead of (possible)
27 TypeBuilder.FindMembers() and filter overriden base members out.
30 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
32 * doc.cs : ref/out parameters are represented as '@' (instead of
33 '&' in type FullName). Fixed bug #76630 (additionally crefs).
35 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
37 * doc.cs : when there was no '.' in cref to methods in doc comment,
38 then parameters were missing in the output. Fixed bug #76691.
40 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
42 * driver.cs : don't output docs when there is an error.
45 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
48 Now it should detect indexers. Fixed primary concern in bug #76685.
49 Fixed CS0419 message to not show the identical member signature in
52 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
54 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
55 instead of Type.FindMembers() since it does not handle events.
58 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
60 * codegen.cs: Fixed typo (speficied -> specified).
62 2005-11-11 Marek Safar <marek.safar@seznam.cz>
65 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
67 2005-11-11 Marek Safar <marek.safar@seznam.cz>
69 * attribute.cs: Changed error message.
71 * cs-tokenizer.cs: One more check.
73 2005-11-10 Marek Safar <marek.safar@seznam.cz>
75 * statement.cs (Block.Resolve): Ignore empty statement.
77 2005-11-10 Marek Safar <marek.safar@seznam.cz>
79 * report.cs: Made error/warning methods more strict to avoid
82 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
83 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
84 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
85 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
87 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
89 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
90 Use the more explicit AssemblyName.FullName instead of
91 AssemblyName.Name to report errors.
93 2005-11-11 Marek Safar <marek.safar@seznam.cz>
95 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
98 2005-11-10 Marek Safar <marek.safar@seznam.cz>
108 * report.cs: Fixed error reporting and typos.
110 * generic.cs (TypeParameter.GetSignatureForError): New method.
111 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
113 * typemanager.cs (GetFullName): Refactored.
115 2005-11-08 Marek Safar <marek.safar@seznam.cz>
117 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
118 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
120 * class.cs (TypeContainer.IsComImport): New property.
121 (Constructor.Define): Create proper ctor for ComImport types.
123 * expression.cs (New.CheckComImport): Fixed.
125 2005-11-07 Miguel de Icaza <miguel@novell.com>
127 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
128 that a parameter has been captured does not mean that we do not
129 have to do the rest of the processing. This fixes the second part
130 of #76592. If there was another anonymous method capturing
131 values in the past, the Scope would never be set for the second
132 method that captured the same parameter.
134 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
135 properly manipulate the stack. Second part of fix for #76592.
137 * expression.cs (New): Add support for invoking "new" on
138 interfaces that have been flagged with the ComImport attribute and
139 the CoClass. Fixes #76637
141 * statement.cs (Try.DoEmit): When a variable is captured, do not
142 try to emit the vi.LocalBuilder variable as it has been captured.
143 Create a temporary variable and store the results on the
144 FieldBuilder. Fixes #76642
146 2005-11-07 Marek Safar <marek.safar@seznam.cz>
148 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
150 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
152 * expression.cs (Binary.DoResolve): Added && optimalization.
154 * typemanager.cs (AddUserType): Removed useless argument.
156 2005-11-04 Marek Safar <marek.safar@seznam.cz>
158 * statement.cs (Block.variables): Uses ListDictionary.
160 2005-11-03 Marek Safar <marek.safar@seznam.cz>
163 * class.cs (PartialContainer.EmitType): Customized to emit
165 (ClassPart.ApplyAttributeBuilder): Transform security attribute
168 2005-11-03 Marek Safar <marek.safar@seznam.cz>
171 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
172 access has to be fixed.
174 * typemanager.cs (IsUnmanagedType): Wrong common field type.
176 2005-11-01 Marek Safar <marek.safar@seznam.cz>
179 * ecore.cs (NullCast.Reduce): Implemented.
181 * expression.cs (ArrayCreation.CheckIndices): Correcly check
184 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
186 (Foreach.Resolve): Catch null properly.
188 2005-10-29 Marek Safar <marek.safar@seznam.cz>
190 * cs-tokenizer.cs: Warning text fix.
192 * driver.cs: AllWarningNumbers exposed on public interface.
194 * report.cs (): Reviewed warning numbers.
195 (IsValidWarning): Use binary search.
197 2005-10-29 Marek Safar <marek.safar@seznam.cz>
199 * driver.cs: Implemeted resource visibility.
200 (Resources): New class for code sharing between /res: and
203 2005-11-07 Marek Safar <marek.safar@seznam.cz>
205 decl.cs (CurrentTypeParameters): Fixed to be public.
207 2005-11-07 Marek Safar <marek.safar@seznam.cz>
209 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
211 2005-11-07 Marek Safar <marek.safar@seznam.cz>
213 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
215 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
217 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
219 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
221 Add friend assembly access support.
222 * typemanager.cs: assembly_internals_vis_attrs
223 cache for friend assembly access.
224 (TypeManager.IsFriendAssembly): New method for
225 checking friend assembly access.
226 (TypeManager.Error_FriendAccessNameNotMatching): New
228 (TypeManager.CompareKeyTokens): Likewise.
229 (TypeManager.Filter): Handle friend accessible
232 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
233 friend accessible types.
235 * ecore.cs (Expression.IsAccessorAccessible): Handle
236 friend accessible properties.
238 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
241 2005-10-28 Marek Safar <marek.safar@seznam.cz>
244 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
247 * convert (Convert.ImplicitReferenceConversion): NullCast holds
250 * ecore.cs (NullCast): Child is contant only.
252 * literal.cs (NullLiteral.Reduce): null can be converted to any
255 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
257 * driver.cs: Use Encoding.Default as default code page instead
260 2005-10-27 Raja R Harinath <rharinath@novell.com>
263 * expression.cs (Invocation.Error_InvalidArguments): Handle
264 __arglist parameters.
265 (Invocation.VerifyArgumentsCompat): Likewise.
266 * support.cs (ReflectionParameters.GetSignatureForError): Print
267 __arglist parameters.
268 (InternalParamters.GetSignatureForError): Likewise.
269 * parameter.cs (Parameters.GetSignatureForError): Likewise.
271 2005-10-26 Marek Safar <marek.safar@seznam.cz>
273 * attribute.cs (GetPropertyValue): Made public.
275 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
277 Add new property WrapNonExceptionThrows to handle 2.0 assembly
279 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
282 * driver.cs: Reflect method name change.
284 * statement.cs (Try.Resolve): Warn when try has both general
287 * typemanager.cs: runtime_compatibility_attr_type new predefined
290 2005-10-26 Raja R Harinath <harinath@gmail.com>
293 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
294 treat it as an empty parameter list.
296 2005-10-26 Raja R Harinath <rharinath@novell.com>
299 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
300 ResolveAsTypeStep silent.
301 * statement.cs (Block.AddConstant): Mark block as used.
302 (Block.ResolveMeta): Avoid piling on error messages
303 if a constant initializer resolution fails.
305 2005-10-25 Raja R Harinath <rharinath@novell.com>
307 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
309 (NamespaceEntry.VerifyAllUsing): New.
310 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
311 behaviour. Delegates actual resolution of alias to ...
312 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
313 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
315 * driver.cs (Driver.MainDriver): Update.
317 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
318 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
320 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
322 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
323 RootNamespace.DefineNamespacesForAll.
325 2005-10-24 Raja R Harinath <harinath@gmail.com>
327 * typemanager.cs (assemblies, external_aliases, modules)
328 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
329 (ComputeNamespaces, GetRootNamespace): Remove extra staging
330 overhead. Move resposibility ...
331 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
332 * driver.cs, attribute.cs, codegen.cs: Update to changes.
334 2005-10-23 Raja R Harinath <harinath@gmail.com>
336 * namespace.cs (RootNamespace.all_namespaces): Renamed from
337 cached_namespaces. Improve usage.
338 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
339 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
340 Move from GlobalRootNamespace and simplify.
341 (RootNamespace.Global): Make instance variable.
342 (RootNamespace.RootNamespace): Add "alias name" parameter.
343 (GlobalRootNamespace): Simplify drastically.
344 (Namespace.Lookup): Don't use GetNamespace.
345 * typemanager.cs (GetRootNamespace): Rename from
346 ComputeNamespaceForAlias.
347 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
349 2005-10-23 Marek Safar <marek.safar@seznam.cz>
351 * anonymous.cs (AnonymousContainer): Don't crash when container
354 2005-10-23 Marek Safar <marek.safar@seznam.cz>
356 * expression.cs (Binary.DoResolve): Warn when comparing same
359 2005-10-23 Marek Safar <marek.safar@seznam.cz>
362 * expression.cs (Binary.DoResolve): It looks like there are no
363 convetsion rules in enum context.
365 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
367 Add support for extern alias qualifiers.
368 * typemanager.cs: Move some LookupTypeReflection code
369 to namespace.cs, to have cleaner code. Added some methods
370 to help us keep track of the extern aliased references.
371 * driver.cs: Add suport for extern alias assemblies on command
372 line and check for their warnings/errors. Also keep track of the
373 extern aliased assemblies.
374 * namespace.cs: Move the global functionality of Namespace
375 to GlobalRootNamespace/RootNamespace. Now the global namespace
376 is GlobalRootNamespace.Globa. Also the code moved from
377 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
378 Finally added LocalAliasEntry (AliasEntry before) and
379 ExternAliasEntry, to handle alias statements.
380 * cs-parser.jay: Add support in the grammar for extern alias
382 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
383 Update callings to Namespace (now in GlobalRootNamespace).
385 2005-10-25 Martin Baulig <martin@ximian.com>
387 * convert.cs (ImplicitTypeParameterConversion): Make base
388 interfaces actually work; fixes #76557.
390 2005-10-25 Martin Baulig <martin@ximian.com>
393 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
394 all the type parameters; fixes #76551.
396 2005-10-25 Martin Baulig <martin@ximian.com>
401 (GenericMethod.ctor): Added `Expression return_type' and
402 `Parameters parameters' arguments.
403 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
404 parameter and return types to check their constraints if they're
407 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
410 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
411 constraints of a generic type if `ec.ResolvingGenericMethod'.
413 * class.cs (MethodCore.DoDefineParameters): Set
414 `ec.ResolvingGenericMethod' if we're a generic method.
415 (MemberBase.MemberType): Likewise.
417 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
419 * typemanager.cs (TypeManager): Added
420 TypeManager.internals_visible_attr_type to cache
421 S.R.CompilerServices.InternalsVisibleToAttribute.
423 * codegen.cs (AssemblyClass): Added checks for
424 InternalsVisibleToAttribute in new method
425 CheckInternalsVisibleAttribute () and also cache the
426 AssemblyName in AssemblyClass.Name.
428 2005-10-24 Martin Baulig <martin@ximian.com>
431 (TypeManager.ExpandInterfaces): Added overloaded version which
432 just takes a `Type[]' array.
435 (Constraints.Resolve): Don't expand the interfaces here; ie. we
436 just use the interfaces which were explicitly specified and not
437 the interfaces they inherit. Fixes #76482.
438 (TypeParameter.FindMembers): Expand the interfaces here.
440 2005-10-21 Martin Baulig <martin@ximian.com>
443 (Constraints.Resolve): Also resolve the actual types here.
444 (Constraints.ResolveTypes): Just check the constraints here.
445 Fixes #76363; see gtest-218.cs.
447 2005-10-21 Martin Baulig <martin@ximian.com>
450 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
451 instead of a `BoxedCast'; fixes gtest-217.cs.
453 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
455 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
456 1) "new()" is specified as generic parameter constraint and 2) the
457 type is TypeBuilder and 3) the type is abstract even if it has a
458 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
460 2005-10-20 Martin Baulig <martin@ximian.com>
463 (GenericConstraints.TypeParameter): New public property.
464 (TypeParameter.ctor): Also take a `DeclSpace' argument.
465 (TypeParameter.DeclSpace): New public property.
466 (TypeParameter.DefineType): Inflate the constraints if our
467 `DeclSpace' is an `Iterator'.
469 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
471 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
472 GenericMethod argument to compare methods' generic type arguments.
475 2005-10-19 Martin Baulig <martin@ximian.com>
477 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
478 not ResolveType() when resolving the base type, so we're not
479 checking the constraints here.
480 (TypeContainer.ResolveType): Call ResolveType() on our base_type
483 2005-10-19 Martin Baulig <martin@ximian.com>
485 * generic.cs (ConstructedType.CheckConstraints): Committing
486 untested fix for #76441.
488 2005-10-18 Raja R Harinath <rharinath@novell.com>
491 * class.cs (TypeContainer.DefineType): Move updating of
492 topological sort earlier in the code.
493 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
495 2005-10-18 Marek Safar <marek.safar@seznam.cz>
498 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
500 * constant.cs (Constant.TryReduce): Moved from Cast class.
501 (Reduce): Made little bit more OO and fixed missing conversions.
503 * ecore.cs (Reduce): Implemented.
504 (Binary.EnumLiftUp): New method to upgrade values to enum values.
506 * literal.cs (Reduce): Implemented.
508 * class.cs: Reverted Miguel's wrong commit.
510 2005-10-14 Miguel de Icaza <miguel@novell.com>
512 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
514 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
516 * cs-parser.jay, expression.cs : CS0214 was missing error location
517 for constants. Fixed bug #76404.
519 2005-10-10 Raja R Harinath <rharinath@novell.com>
521 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
523 (PropertyExpr.EmitCall): Likewise.
524 * expression.cs (Invocation.EmitArguments): Handle case where
526 (Invocation.EmitCall): Avoid allocating temporary variable if
527 there are no arguments.
529 2005-10-11 Marek Safar <marek.safar@seznam.cz>
532 * convert.cs (ExplicitConversionCore): Fixed object->enum
535 2005-10-07 Raja R Harinath <rharinath@novell.com>
538 * convert.cs (ImplicitConversionStandard): Move conversion of
539 void* to arbitrary pointer types ...
540 (ExplicitConversionStandard): .. here.
541 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
542 error to always print typenames.
544 2005-10-07 Raja R Harinath <rharinath@novell.com>
546 * convert.cs (GetConversionOperator): Rename from
547 GetConversionOperators. Move operator selection code from ...
548 (UserDefinedConversion): ... here.
550 2005-10-06 Marek Safar <marek.safar@seznam.cz>
552 * convert.cs (ExplicitConversionCore): Removed duplicate enum
555 2005-10-05 Marek Safar <marek.safar@seznam.cz>
557 * assign.cs (Assign.DoResolve): Error method changed.
559 * cfold.cs (DoConstantNumericPromotions): Error method changed.
561 * const.cs (ResolveValue): Reset in_transit immediately.
563 * constant.cs: Error method changed.
565 * convert.cs: Removed useless location parameter.
566 (ExplicitNumericConversion): Don't do double enum check.
567 (ExplicitConversionCore): Renamed from ExplicitConversion.
568 (ExplicitUnsafe): Extracted from ExplicitConversion.
569 (ExplicitConversion): Uses for error reporting.
571 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
573 (ResolveBoolean): Uses common error method.
574 (CastToDecimal): Get rid of ec.
575 (CastFromDecimal): Optimized.
576 (ConvCast): Get rid of ec.
578 * enum.cs (ResolveValue): Reset in_transit immediately.
579 (Emit): Return after first error.
581 * expression.cs: Convert changes.
583 * literal.cs: Error method changed.
585 * statement.cs: Error method changed.
587 2005-10-06 Raja R Harinath <rharinath@novell.com>
589 Fix gtest-131.cs and gtest-211.cs.
590 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
591 Only emit code for a label if it is used. Unreachable code can
592 violate ECMA evaluation stack invariants.
594 2005-09-27 Marek Safar <marek.safar@seznam.cz>
596 * anonymous.cs: Implemented ExprClassName.
598 * assign.cs (Assign.DoResolve): Don't chrash when type is not
601 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
604 * class.cs (StaticClass.DefineContainerMembers): Report protected
607 * codegen.cs: if(ed) PRODUCTION.
609 * convert.cs (Error_CannotImplicitConversion): Better error
612 * cs-parser.jay: More error checks.
614 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
616 * driver.cs (CSCParseOption): Enabled wrong option check.
618 * ecore.cs (Expression.ExprClassName): Turned to property.
619 (MemberExpr.CheckIntermediateModification): For checking boxed
620 value types modification.
622 * statement.cs (Fixed.Resolve): Expression type must be
623 convertible to fixed type.
624 (CollectionForeach.GetEnumeratorFilter,TryType):
625 Small refactoring for easier error checking.
627 2005-09-26 Marek Safar <marek.safar@seznam.cz>
629 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
632 * class.cs (GeneratedBaseInitializer): New class for customization
633 compiler generated initializers.
634 (MemberBase.DoDefine): Check Obsolete attribute here.
635 (FieldMember.DoDefine): Ditto.
637 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
640 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
641 (MemberCore.GetObsoleteAttribute): Removed argument.
642 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
643 (MemberCore.CheckObsoleteType): New helper.
647 * statement.cs: Updates after MemberCore changes.
649 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
650 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
652 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
653 obsolete attribute for compiler construct.
654 (As.DoResolve): Cache result.
656 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
658 2005-10-01 Miguel de Icaza <miguel@novell.com>
660 * expression.cs (Probe): instead of having a "Type probe_type"
661 keep the extra information as a TypeExpr probe_type_expr since the
662 "As" operator needs to perform some type checks.
664 * (As.DoResolve): If the type is a type parameter, ensure that it
665 is constrained by a class.
667 2005-09-22 Miguel de Icaza <miguel@novell.com>
669 * statement.cs (Lock): Use the TemporaryVariable class instead of
670 manually using local variables as those do not work when variables
673 * ecore.cs: Moved the TemporaryVariable class from being a nested
674 class inside Foreach to be a public class that can be employed in
677 2005-09-19 Marek Safar <marek.safar@seznam.cz>
679 * cs-parser.jay: interface_accessors replaced by
680 accessor_declarations.
682 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
685 * statement.cs (GotoCase.Resolve): Convert null constant to
687 (SwitchLabel.ResolveAndReduce): Ditto.
688 (SwitchLabel.NullStringCase): Custom null stamp.
689 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
691 typemanager.cs (CSharpSignature): Don't skip first argument
694 2005-09-16 Marek Safar <marek.safar@seznam.cz>
696 * cfold.cs, constant.cs, convert.cs, ecore.cs,
697 expression.cs, iterators.cs, literal.cs: Store constants and
700 * class.cs (MemberBase.ShortName): Pass location.
702 * cs-parser.jay: Some location fixes.
704 * ecore.cs (Expression.Location): Made virtual.
706 2005-09-27 Marek Safar <marek.safar@seznam.cz>
709 * const.cs (Const.ResolveValue): Check for assigning non-null
710 value to reference type.
712 2005-09-26 Raja R Harinath <rharinath@novell.com>
715 * expression.cs (This.VerifyFixed): In a value type T, the type of
716 'this' is T&, iow, 'this' is either an out or ref parameter. In a
717 value type R, 'this' is treated as a value parameter.
719 2005-09-05 Miguel de Icaza <miguel@novell.com>
721 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
722 if the underlying types are the same, otherwise we need to produce
723 code that will do the proper cast.
725 This was exposed by Marek's constant rewrite which produced
726 invalid code for the call site:
733 This fixes test-49.cs
735 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
737 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
738 Type/Object should be allowed as well. Fixed bug #75968.
740 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
742 * expression.cs : (Binary.DoResolve): when one is enum constant and
743 another is constant 0, then return enum one *as enum type*.
746 2005-10-04 Martin Baulig <martin@ximian.com>
748 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
749 `SetMemberIsUsed()' work for generics, too.
751 2005-10-04 Martin Baulig <martin@ximian.com>
753 * expression.cs (DelegateInvocation.EmitStatement): Make this work
754 for corlib. Fixes #75691.
756 2005-09-28 Marek Safar <marek.safar@seznam.cz>
759 * driver.cs: Fix compilation files with full root path.
761 2005-09-25 Miguel de Icaza <miguel@novell.com>
763 * report.cs (SymbolRelatedToPreviousError): Format the output so
764 it does not use an open parenthesis that is never closed.
766 * driver.cs: Follow coding guidelines
768 2005-09-18 Miguel de Icaza <miguel@novell.com>
770 * driver.cs: Set InEmacs based on the environment variable EMACS.
772 * location.cs (InEmacs): in this mode, do not report column
773 location as it confuses Emacs.
775 2005-10-03 Raja R Harinath <rharinath@novell.com>
777 * support.cs (SeekableStreamReader.Position): Don't error out when
778 the requested position is just beyond the end of the current
781 2005-09-28 Raja R Harinath <rharinath@novell.com>
783 * support.cs (SeekableStreamReader): Simplify drastically. Don't
784 try to keep in sync with the byte count of the underlying Stream.
785 However, this limits us to a window size of 2048 characters: i.e.,
786 the maximum lookahead of our lexer/parser can be 2048 characters.
788 2005-09-22 Martin Baulig <martin@ximian.com>
790 * driver.cs: Removed a debugging FIXME.
792 2005-09-21 Raja R Harinath <rharinath@novell.com>
794 * cs-parser.jay (type_arguments): Add CS1644 check.
795 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
797 2005-09-15 Raja R Harinath <rharinath@novell.com>
799 * Makefile (PROGRAM): Make profile specific.
800 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
801 the current directory.
804 * expression.cs (Invocation.EmitCall): Remove optimization on
805 this_call since it doesn't handle 'this' being a value type.
807 2005-09-05 Geoff Norton <gnorton@customerdna.com>
809 * driver.cs: Ensure file handles are closed after parsing
811 2005-09-05 Miguel de Icaza <miguel@novell.com>
813 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
814 if the underlying types are the same, otherwise we need to produce
815 code that will do the proper cast.
817 This was exposed by Marek's constant rewrite which produced
818 invalid code for the call site:
825 This fixes test-49.cs
827 2005-09-05 Martin Baulig <martin@ximian.com>
829 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
830 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
832 * cs-parser.jay (delegate_declaration): Small fix for #75852.
834 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
836 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
837 to be a pointer type due to the spec 25.2, so check if declaring
838 type is generic type definition. Fixed bug #75772.
840 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
843 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
844 both types are not defined by methods.
845 * expression.cs : (Invocation.IsApplicable): it should work when
846 the argument type is equal to the parameter type, not only when
847 ImplicitConversionExists() returns true.
849 2005-09-02 Raja R Harinath <rharinath@novell.com>
851 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
855 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
856 flow-branching for LocalVariableReferences in case we were invoked
858 * expression.cs (LocalVariableReference.VerifyAssigned): New.
860 (LocalVariableReference.DoResolveBase): ... this.
861 (MemberAccess.Resolve): Do the check that was disabled during
864 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
867 (PartialContainer.Create): check abstract/sealed/static strictly
868 but abstract/sealed can exist only at one side. Fixed bug #75883.
870 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
873 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
874 specified, don't default to UnmanagedType.I4.
876 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
878 * expression.cs : conditional operator should check possibly
879 incorrect assign expression. Fixed bug #75946.
881 2005-08-30 Raja R Harinath <rharinath@novell.com>
884 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
885 (ScopeInfo.EmitScopeType): Use it to construct field names from
886 names of captured locals.
889 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
890 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
891 Pass 'target_type' to BoxedCast. Don't default to 'object'.
892 (ExplicitConversion): Remove enum cases already handled by
893 implicit conversion. Move implicit conversion check to the beginning.
894 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
895 * expression.cs (ArrayCreation.EmitDynamicInitializers):
896 Don't treat System.Enum as a struct.
898 2005-08-30 Jb Evain <jbevain@gmail.com>
900 * attribute.cs: handles as expression in parameters.
902 2005-08-30 Raja R Harinath <rharinath@novell.com>
905 * class.cs (TypeContainer.VerifyClsName): Don't use a
906 PartialContainer when verifying CLS compliance.
907 (AbstractPropertyEventMethod): Set Parent here, ...
908 (PropertyMethod): ... not here.
910 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
912 * attribute.cs : escaped attribute name should not be allowed to be
913 resolved (e.g. @class as classAttribute). Fixed bug #75930.
915 2005-08-29 Raja R Harinath <rharinath@novell.com>
918 * convert.cs (ImplicitStandardConversionExists): Allow zero also
919 when converting a long constant to unsigned long.
920 * expression.cs (Invocation.OverloadResolve): Add sanity check to
921 detect where IsApplicable and VerifyArgumentsCompat disagree.
923 2005-08-29 Raja R Harinath <rharinath@novell.com>
924 and Carlos Alberto Cortez <carlos@unixmexico.org>
927 * class.cs (TypeContainer.CanElideInitializer): New helper.
928 (TypeContainer.EmitFieldInitializers): Use it to determine if we
929 can safely emitting the initializer of a field.
931 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
933 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
934 allowed inside a switch (without loop). Fixed bug #75433.
936 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
938 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
939 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
941 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
943 * driver.cs : kinda reverting the default encoding changes (not exact
944 revert since I noticed that "codepage:reset" might not work fine).
946 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
948 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
949 Location. Now getter and setter store location correctly.
950 (errors/cs0111-12.cs now reports the expected location.)
952 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
954 * driver.cs : Use default encoding on the environment.
955 Removed (now that) extra parameter for SeekableStreamReader.
956 * support.cs : (SeekableStreamReader) third .ctor() argument for
957 StreamReader is not required (always true). preamble size could
958 be acquired in simpler and safe way.
960 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
962 * cs-parser.jay: report CS0642 at warning level 3
963 and report CS0642 for an if else statement also
964 fixes bug #74745. Patch by John Luke (and a bit
966 Removed extra CS0642 warning check for "while",
968 * statement.cs: In Block.Resolve(), CS0642 check
969 is reimplemented to check a sequence of an empty
970 statement and a block.
974 2005-08-24 Marek Safar <marek.safar@seznam.cz>
976 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
977 detection until I fix it.
979 * cs-tokenizer.cs: Changed error message.
981 * cs-parser.jay: Fixed 2 error locations.
983 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
984 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
987 * enum.cs (GetSignatureForError): Fixed.
989 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
993 * typemanager.cs (RegisterProperty): Removed.
995 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
997 2005-08-24 Raja R Harinath <rharinath@novell.com>
1000 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1001 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1003 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1005 * expression.cs : tiny fix is required for not warning positive ulong.
1008 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1010 * expression.cs : add CS0652 check for constant and integral
1011 expression. Fixed bug #53974.
1013 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1015 * expression.cs : in DoNumericPromotions(), check if there is implicit
1016 conversion overload for string (to check CS0034). Fixed bug #52492.
1018 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1020 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1022 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1024 * ecore.cs : report location when it is *not* Null.
1026 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1032 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1033 correctly. Fixed bug #75721.
1035 2005-08-23 Raja R Harinath <rharinath@novell.com>
1037 * support.cs (SeekableStreamReader.Position): Avoid an expensive
1038 loop that performs 'min (pos, char_count)'.
1041 * expression.cs (Unary.ResolveOperator): Don't discard implicit
1042 converted value in Operator.OnesComplement.
1044 2005-08-22 Ben Maurer <bmaurer@ximian.com>
1046 * anonymous.cs: If the anon method is pulled into a helper class,
1047 it needs to be `internal' not `private'. Fixes runtime behavior on
1050 2005-08-17 Marek Safar <marek.safar@seznam.cz>
1053 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1056 2005-08-16 Marek Safar <marek.safar@seznam.cz>
1058 The big constants rewrite
1059 Fix #75746, #75685 and more
1060 As a side effect saved 1MB for MWF ;-)
1062 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1063 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1064 enum based for corlib compilation.
1066 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1069 * class.cs (FixedField.Define): Use ResolveAsConstant.
1071 * const.cs (IConstant): Interface constants and enums.
1072 (Const.ResolveValue): New method for constant resolvning.
1073 (ExternalConstant): Constants from imported assemblies.
1075 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1076 conversion; like enums.
1077 (Constant.ToType): Converts this constant to different type.
1078 (Constant.Increment): Adds 1.
1080 * convert.cs (ImplicitConversionRequired): Simplified.
1082 * cs-parser.jay: Create EnumMember directly.
1084 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1086 * doc.cs (GenerateEnumDocComment): Removed.
1088 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1089 (ConvertIntLiteral): Removed.
1090 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1092 * enum.cs (EnumMember): Implement IConstant.
1093 (Enum.IsValidEnumConstant): Removed.
1094 (Enum.GetNextDefaultValue): Removed.
1095 (Enum.FindMembers): Updated.
1096 (Enum.GenerateDocComment): Iterate enum members.
1098 * expression.cs (Cast.TryReduce): Handle enums correctly.
1099 (New.Constantify): Made public.
1100 (MemberAccess.DoResolve): Removed contant specific if(s).
1102 * literal.cs (NullLiteral): Implement new abstract methods.
1104 * statement.cs (GotoCase.Resolve): Use new constant methods.
1105 (SwitchLabel.ResolveAndReduce): Use new constant methods.
1107 * typemanager.cs (LookupEnum): Removed.
1108 (IsEnumType): Fixed to work with corlib.
1109 (RegisterConstant): Removed.
1110 (LookupConstant): Removed.
1111 (GetConstant): Changed to work with IConstant.
1113 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
1115 * location.cs : Fixed overflown (>255) column number.
1117 2005-08-03 Raja R Harinath <rharinath@novell.com>
1119 First cut of the qualified-alias-member feature.
1120 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1122 * cs-parser.jay (DOUBLE_COLON): New token.
1123 (namespace_or_type_name): Add rule for recognizing
1124 qualified-alias-members.
1125 (primary_expression): Likewise.
1126 (element_access): Allow QualifiedAliasMember as a possible
1127 type-bearing expression.
1128 (local_variable_type, local_variable_pointer_type): Likewise.
1129 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
1130 aliases in the current and enclosing namespace declarations.
1131 (NamespaceEntry.UsingAlias): Add CS0440 warning.
1132 * decl.cs (MemberName.is_double_colon): New.
1133 (MemberName.MemberName): Add new constructor for alias-member.
1134 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1135 * expression.cs (QualifiedAliasMember): New expression type.
1137 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1139 * location.cs : it borked when no argument was specified.
1141 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1143 * location.cs : tiny ToString() format fix.
1145 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1147 * statement.cs : oops, it was missing.
1149 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1151 A set of fixes for precise line/column location.
1154 "token" field now holds a file/line "delta", a line number offset
1155 from the segment, and a column number. See also:
1156 http://lists.ximian.com/pipermail/mono-devel-list/2004-
1157 December/009508.html
1158 Removed static IsNull. Use instance IsNull property instead.
1160 For some tokens it stores Location. For Identifier it stores
1161 LocatedToken which is a pair of string name and location.
1162 Column numbers are adjusted only at getChar().
1164 Use Location.ToString() for reporting (it now contains column).
1166 Largely modified to use LocatedToken instead of
1167 string (IDENTIFIER), and to acquire Location from some tokens.
1168 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
1169 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
1171 Now MemberName holds Location. DeclSpace.ctor() receives Location
1172 as a parameter. Removed extra parameters to all derived classes.
1173 Replaced Location.IsNull() with instance property.
1174 * assign.cs, expression.cs :
1175 Added .ctor() overload that omits Location.
1177 Added "nameEscaped" flag that indicates the identifier was escaped
1178 in the source file. This fixes bug #57047.
1180 2005-09-02 Martin Baulig <martin@ximian.com>
1182 * class.cs: Make CS3005 a warning, not an error.
1184 2005-08-02 Marek Safar <marek.safar@seznam.cz>
1186 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
1187 New method, looking for lo-case imported cls type.
1189 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
1192 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
1194 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
1196 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
1198 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
1200 Optimized to save 3.5 MB for SWF compilation.
1202 2005-08-01 Marek Safar <marek.safar@seznam.cz>
1204 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
1205 (PartialContainer.Create): Moved logic AddToContainer.
1206 (PartialContainer.MarkForDuplicationCheck): Shares name.
1208 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
1211 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
1213 (Namespace.GetSignatureForError): New method.
1215 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
1216 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
1218 2005-08-01 Raja R Harinath <rharinath@novell.com>
1221 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
1222 member lookup rather than qualifier_type, since qualifier_type can
1225 2005-08-01 Marek Safar <marek.safar@seznam.cz>
1227 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
1230 2005-07-31 Miguel de Icaza <miguel@novell.com>
1232 * statement.cs: Copy the local exception into the exception
1233 captured local. Fixes 75674
1235 2005-07-31 Raja R Harinath <harinath@gmail.com>
1238 * expression.cs (Invocation.OverloadResolve): Don't report error
1239 CS1501 if error CS1502 has been reported.
1240 (New.DoResolve): Delegate CS1501 reporting to
1241 Invocation.OverloadResolve.
1244 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
1245 invariant-meaning-in-block property in an enclosing block if
1248 2005-07-29 Marek Safar <marek.safar@seznam.cz>
1250 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
1251 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
1252 (Switch.CheckSwitch): Just save 50kb for SWF.
1254 2005-07-27 Martin Baulig <martin@ximian.com>
1256 * anonymous.cs (CaptureContext.AddField): Added
1257 `AnonymousContainer am' argument; compute its toplevel scope if
1258 it's not already computed. Fixes #75649.
1260 2005-07-26 Raja R Harinath <rharinath@novell.com>
1263 * class.cs (Constructor.Emit): Reset block to null if the block
1266 2005-07-25 Marek Safar <marek.safar@seznam.cz>
1268 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1270 2005-07-25 Marek Safar <marek.safar@seznam.cz>
1272 * class.cs (MethodData.Define): Check whether accessor implementing
1273 interface is public.
1275 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1277 2005-07-22 Marek Safar <marek.safar@seznam.cz>
1280 * namespace.cs (LookupType): Moved same type check to...
1282 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1285 2005-07-21 Raja R Harinath <rharinath@novell.com>
1287 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1288 already found a typebuilder.
1289 * class.cs (MethodCore.IsDuplicateImplementation): Compare
1290 MemberNames, not strings.
1292 * const.cs (Error_ExpressionMustBeConst):
1293 Rename from Error_EpressionMustBeConst.
1294 * const.cs, class.cs, statement.cd: Update.
1296 2005-07-21 Marek Safar <marek.safar@seznam.cz>
1300 * const.cs (Const.LookupConstantValue): Report missing contant expression
1302 (Error_EpressionMustBeConstant): Only one error method.
1304 * class.cs, statement.c: Updated.
1306 2005-07-20 Raja R Harinath <rharinath@novell.com>
1308 * statement.cs (Block.Flags): Add back HasVarargs.
1309 (Block.flags): Make protected.
1310 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1312 * typemanager.cs (types, typecontainers, user_types): Remove.
1313 (UserTypes, TypeContainers): Likewise.
1314 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1315 (CleanUp, Reset): Update.
1316 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
1317 (GetNestedType): Use Type.GetNestedType.
1318 (CoreLookupType): Take two arguments, the namespace and the
1319 basename of the type. Update to use the Namespace.Lookup
1321 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1322 (RealMemberLookup): Use IsNestedChildOf instead of playing with
1323 string concatenation and substring matches.
1324 * class.cs, enum.cs, delegate.cs: Update to changes.
1326 2005-07-20 Marek Safar <marek.safar@seznam.cz>
1328 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1329 Expression and made virtual.
1331 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1332 (ImplicitStandardConversionExists): Fixed `byte' typo ?
1334 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1336 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1339 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1342 2005-07-18 Marek Safar <marek.safar@seznam.cz>
1345 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1346 AssemblyCultureAttribute is not used on executable.
1349 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1351 2005-07-16 Raja R Harinath <rharinath@novell.com>
1354 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1355 New. Reports CS0252/CS0253.
1356 Mostly taken from preliminary patch by Duncak Mak.
1357 (Binary.DoResolveOperator): Store results of operator lookup.
1358 Use them to detect if we need to warn about unintended reference
1361 2005-07-15 Raja R Harinath <rharinath@novell.com>
1364 * namespace.cs (Namespace.Lookup): Add back location parameter.
1365 (Namespace.LookupType): Add CS0436 report. Add location parameter.
1366 * delegate.cs, ecore.cs, expression.cs: Update to changes.
1368 * codegen.cs (EmitContext.DeclSpace): Make readonly.
1369 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1370 (Namespace.LookupType): ... this.
1371 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1373 * typemanager.cs (LookupTypeReflection): Remove buggy code that
1374 purported to handle pointers.
1375 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1378 2005-07-15 Marek Safar <marek.safar@seznam.cz>
1380 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1383 2005-07-15 Raja R Harinath <rharinath@novell.com>
1385 * namespace.cs (Namespace.Lookup): Drop location parameter.
1386 (NamespaceEntry.LookupAlias): Remove. Merge into ...
1387 (NamespaceEntry.Lookup): ... this.
1388 (NamespaceEntry.Error_AmbiguousTypeReference):
1389 Move here from DeclSpace.
1390 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1392 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1393 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1394 Move to NamespaceEntry.
1395 * delegate.cs, expression.cs: Update to changes.
1397 2005-08-31 Martin Baulig <martin@ximian.com>
1399 Committing a patch from Atsushi Enomoto for #75850.
1401 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
1402 Prefer a generic enumerator over a non-generic one.
1404 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
1406 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1407 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1409 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1411 * driver.cs : reverting default encoding change as well as mcs.
1413 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1415 * driver.cs, support.cs : merged r48826.
1417 > could you integrate your mcs changes to gmcs otherwise
1418 > gmcs cannot compile some files.
1420 2005-08-20 Martin Baulig <martin@ximian.com>
1422 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1423 scope if we don't already have it.
1425 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1426 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1429 2005-07-31 Miguel de Icaza <miguel@novell.com>
1431 * statement.cs: Copy the local exception into the exception
1432 captured local. Fixes 75674
1434 2005-07-15 Marek Safar <marek.safar@seznam.cz>
1436 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1439 2005-08-12 Martin Baulig <martin@ximian.com>
1441 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
1442 for nested types here to avoid hitting the cache too early.
1444 2005-08-09 Miguel de Icaza <miguel@novell.com>
1446 * enum.cs: On the new compiler CLS error 3005 is now a warning not
1449 2005-08-03 Martin Baulig <martin@ximian.com>
1451 Make iterators in generic methods work; see gtest-191.cs.
1454 (Constraints.Resolve): Protect against being called twice.
1457 (TypeContainer.GetClassBases): Make this `protected virtual'.
1459 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
1460 (Iterator.GetClassBases): Override this and compute the base
1462 (Iterator.DefineNestedTypes): If we're a generic method, all our
1463 method type parameters become class type parameters on the proxy
1467 (ToplevelBlock.Parameters): Make this a property, not a field.
1468 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
1470 2005-08-03 Martin Baulig <martin@ximian.com>
1472 * typemanager.cs (TypeManager.IsSubclassOf): Use
1473 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
1474 (TypeManager.GetFullName_recursed): Improved.
1476 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1479 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
1480 Private accessor case, using TypeManager.IsPrivateAccessible instead of
1481 invocation_type == mi.DeclaringType, since the first one also checks
1482 other condition used by generic instances.
1484 2005-07-27 Martin Baulig <martin@ximian.com>
1486 * anonymous.cs (CaptureContext.AddField): Added
1487 `AnonymousContainer am' argument; compute its toplevel scope if
1488 it's not already computed. Fixes #75649.
1490 2005-07-14 Marek Safar <marek.safar@seznam.cz>
1492 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1493 CheckAttributeType and refactored.
1494 (Attribute.ResolvePossibleAttributeType): Changed to reuse
1495 ResolveAsTypeTerminal error handling.
1496 (ResolveAsTypeTerminal): Introduced because of global attributes extra
1498 (GetSignatureForError): Print errors in same way.
1501 * codegen.cs: Reflect attribute GetSignatureForError change.
1504 * expression.cs: Add silent parameter to ResolveAsTypeStep.
1506 * namespace.cs (UsingEntry): Refactored to make fields private.
1509 statement.cs: Error_UnexpectedKind has extra parameter.
1511 2005-07-14 Raja R Harinath <rharinath@novell.com>
1513 * ecore.cs (IAlias): Remove.
1514 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
1515 that implement the interface.
1516 * namespace.cs (Namespace): Likewise.
1517 (Namespace.declspaces): Renamed from 'defined_names'.
1518 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
1519 DeclSpace instead of an IAlias.
1520 * tree.cs (Tree.AddDecl): Update.
1522 2005-07-12 Raja R Harinath <rharinath@novell.com>
1524 * statement.cs (Block.Flags); Remove HasVarargs.
1525 (Block.HasVarargs): Move to ToplevelBlock.
1526 (Block.ThisVariable, Block.AddThisVariable): Likewise.
1527 (Block.Variables): Make protected. Initialize variable hashtable
1529 (Block.AddVariable): Update.
1530 (Block.Resolve): Update to changes.
1531 (ToplevelBlock.HasVarargs): New boolean.
1532 (ToplevelBlock.ThisVariable): Move here from Block.
1533 (ToplevelBlock.AddThisVariable): Likewise.
1534 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
1535 * expression.cs (This.ResolveBase): Update to changes.
1536 (ArglistAccess.DoResolve): Likewise.
1538 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1541 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1543 * class.cs (TypeContainer.VerifyMembers): Distinguish between
1544 not used and not used & assigned.
1545 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1547 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1550 * expression.cs (Is.DoResolve): null is never provided type.
1552 2005-07-08 Marek Safar <marek.safar@seznam.cz>
1555 * cs-parser.jay: Less strict event error rule to catch more errors.
1557 2005-07-11 Martin Baulig <martin@ximian.com>
1559 * generic.cs (ConstructedType.CheckConstraints): Improve the check
1560 for the constructor constraint: we do not only have to check
1561 whether the class has a public constructor, but also ensure that
1562 it's parameterless. Fixes #75492.
1564 2005-07-11 Martin Baulig <martin@ximian.com>
1566 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
1567 between type parameters if they either have the reference type
1568 constraint or the class constraint.
1570 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
1572 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
1574 2005-07-07 Marek Safar <marek.safar@seznam.cz>
1577 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1578 (ExtractSecurityPermissionSet): Cope with self referencing security
1579 attributes properly.
1581 * driver.cs (SetOutputFile): Made public property OutputFile.
1583 2005-07-07 Raja R Harinath <rharinath@novell.com>
1586 * class.cs (TypeContainer.first_nonstatic_field): Rename from
1587 has_nonstatic_fields. Make into a FieldBase pointer.
1588 (TypeContainer.AddField): Add CS0282 check.
1589 (TypeContainer.EmitType): Update.
1591 2005-07-06 Miguel de Icaza <miguel@novell.com>
1593 * cs-tokenizer.cs (consume_identifier): Do not create strings to
1594 compare if they start with __.
1596 2005-07-06 Raja R Harinath <rharinath@novell.com>
1598 * statement.cs (Switch.SwitchGoverningType): Only look at
1599 UserCasts that don't need implicit standard conversions to one of
1600 the allowed switch types (Fixes test-322.cs).
1601 (LocalInfo.Resolve): Re-enable sanity-test.
1603 2005-07-06 Marek Safar <marek.safar@seznam.cz>
1605 * cs-tokenizer.cs (consume_identifier): Detect double undescores
1607 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1609 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1611 2005-07-06 Raja R Harinath <rharinath@novell.com>
1614 * ecore.cs (SimpleName.GetSignatureForError): Add.
1615 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1616 (MemberAccess.GetSignatureForError): Add.
1618 2005-07-05 Marek Safar <marek.safar@seznam.cz>
1620 The big error and warning messages review.
1650 * typemanager.cs: Updated.
1652 * class.cs: (MethodCore.SetYields): Moved here to share.
1653 (PropertyMethod.Define): Moved iterator setup here.
1655 * iterators.cs: Add orig_method to have full access to parent
1658 2005-07-05 Raja R Harinath <rharinath@novell.com>
1660 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1661 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1662 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1663 variable of struct type.
1664 * expression.cs (Unary.ResolveOperator): Update to change.
1665 (Indirection.VerifyFixed): Likewise.
1666 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1667 (ParameterReference.VerifyFixed): Value parameters are fixed.
1668 (This.VerifyFixed): Treat 'this' as a value parameter.
1669 * statement.cs (LocalInfo.IsFixed): Remove.
1671 2005-07-01 Martin Baulig <martin@ximian.com>
1673 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1674 `ec.EmitThis ()' to get the correct scope.
1676 2005-07-01 Martin Baulig <martin@ximian.com>
1678 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1679 instance is a ParameterReference; fixes #75299.
1681 2005-06-30 Raja R Harinath <rharinath@novell.com>
1684 * expression.cs (Indexers.map): Remove.
1685 (Indexers.Append): Filter out inaccessible setters and getters.
1686 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1689 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
1691 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1692 (FieldExpr.Emit, PropertyExpr.Emit): Update.
1693 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1694 * expression.cs (Invocation.EmitCall): Add CS0120 check.
1696 2005-06-30 Marek Safar <marek.safar@seznam.cz>
1699 * class.cs (FieldBase.GetInitializerExpression): One more field
1702 2005-06-28 Miguel de Icaza <miguel@novell.com>
1704 * pending.cs: Do not define a proxy if the base method is virtual,
1705 it will be picked up by the runtime (bug 75270).
1707 2005-07-08 Martin Baulig <martin@ximian.com>
1709 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1710 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1712 2005-07-07 Martin Baulig <martin@ximian.com>
1714 * generic.cs (ConstructedType.CheckConstraint): Use
1715 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
1716 called recursively; fixes #75329.
1718 2005-07-06 Martin Baulig <martin@ximian.com>
1720 * generic.cs (TypeManager.InferTypeArguments): Added support for
1721 anonymous methods; fixes #75461.
1723 2005-07-01 Martin Baulig <martin@ximian.com>
1725 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1726 `ec.EmitThis ()' to get the correct scope.
1728 2005-07-01 Martin Baulig <martin@ximian.com>
1730 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
1731 instance is `This'; fixes #75299.
1733 2005-06-30 Martin Baulig <martin@ximian.com>
1735 * class.cs (Indexer): Implement IIteratorContainer; added support
1736 for iterators in indexers.
1739 (EmitContext.CurrentIterator): Make this a property, not a field.
1741 * anonymous.cs (AnonymousContainer.Iterator): New public property.
1743 2005-06-28 Miguel de Icaza <miguel@novell.com>
1745 * pending.cs: Do not define a proxy if the base method is virtual,
1746 it will be picked up by the runtime (bug 75270).
1748 2005-06-28 Martin Baulig <martin@ximian.com>
1750 * cs-parser.jay (interface_method_declaration): Avoid a
1751 reduce/reduce conflict by moving some of the code into a separate
1752 `interface_method_declaration_body' rule; fixes #75368.
1754 2005-06-28 Martin Baulig <martin@ximian.com>
1756 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
1757 array check after the check for TypeBuilder's.
1759 2005-06-21 Raja R Harinath <rharinath@novell.com>
1761 * convert.cs (FindMostEncompassedType): Add two trivial special
1762 cases (number_of_types == 0 || number_of_types == 1).
1763 (FindMostEncompasingType): Likewise.
1765 2005-06-17 Raja R Harinath <rharinath@novell.com>
1767 Some cleanups preparing for the fix of #75283.
1768 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1770 (EventExpr.InstanceResolve): Likewise.
1771 (EventExpr.DoResolve): Remove redundant checks.
1773 2005-06-08 Miguel de Icaza <miguel@novell.com>
1775 * class.cs: Small fix.
1777 2005-06-08 Raja R Harinath <rharinath@novell.com>
1780 * class.cs (GetPartialBases): Fix return value check of
1783 2005-06-07 Raja R Harinath <rharinath@novell.com>
1785 Ensure that partial classes are registered in their enclosing
1786 namespace. Initial part of fix of #75160.
1787 * tree.cs (Tree.RecordDecl): Add new namespace argument.
1788 Register declspace with namespace here, not in
1789 DeclSpace.RecordDecl.
1790 * cs-parser.jay: Pass namespace to RecordDecl.
1791 * class.cs (PartialContainer.Create): Likewise.
1792 (ClassPart.DefineType): New sanity-check. Throws an exception if
1794 * decl.cs (Declspace.RecordDecl): Remove.
1795 * namespace.cs (NamespaceEntry.DefineName): Remove.
1797 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1799 * rootcontext.cs: Reset TargetExt as well.
1801 2005-06-03 Raja R Harinath <rharinath@novell.com>
1803 * ecore.cs (Expression.Resolve): Emit CS0654 error when
1806 2005-06-02 Raja R Harinath <rharinath@novell.com>
1808 Fix #75080, cs0119.cs.
1809 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
1811 (Expression.Resolve): ... this. Use it. Remove bogus code
1812 allowing ExprClass.Type and ExprClass.Namespace for
1813 ResolveFlags.VariableOrValue.
1814 (Expression.Resolve) [1-argument variant]: Change default resolve
1815 flags based on language version.
1816 (Expression.Error_UnexpectedKind): Use a simple string array
1817 rather than an ArrayList.
1818 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1820 (TypeOfVoid.DoResolve): Likewise.
1821 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
1822 flags argument -- it always has the same value.
1824 2005-05-31 Raja R Harinath <rharinath@novell.com>
1827 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1828 Use it in the error message.
1829 * assign.cs, expression.cs, statement.cs: Update.
1831 2005-05-30 Raja R Harinath <rharinath@novell.com>
1834 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1835 the "almostMatchedMember" case too.
1836 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1837 that failed the accessibility checks to 'almost_match'.
1839 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
1841 * attribute.cs: Use internal MethodBuilder methods to set
1842 ExactSpelling and SetLastError on PInvoke methods, instead
1843 of passing them via charset. Fixes #75060.
1845 2005-05-27 Raja R Harinath <rharinath@novell.com>
1847 * parameter.cs (Parameter): Remove TODO comment.
1848 (Parameter.DefineParameter): Remove Location parameter.
1849 (Parameters.LabelParameters): Likewise.
1850 * class.cs (Constructor.Emit): Update to change.
1851 (MethodData.Emit): Likewise.
1852 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
1853 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1855 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
1858 Removed Parameters.Location and added Parameter.Location instead.
1859 Removed Location parameter from Emit() and GetSignature().
1866 Modified all related calls.
1868 2005-06-21 Martin Baulig <martin@ximian.com>
1870 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
1871 left-hand side is not a nullable type; fixes #75328.
1873 2005-06-21 Martin Baulig <martin@ximian.com>
1876 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
1877 (TypeManager.GetFullNameSignature): Likewise.
1879 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
1880 `source.FullName' and `target.FullName' to check whether there are
1881 two conflicting definitions.
1883 2005-06-21 Martin Baulig <martin@ximian.com>
1885 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
1886 a BoxedCast - also for reference types - to be compatible with csc.
1888 2005-06-21 Martin Baulig <martin@ximian.com>
1890 * expression.cs (MemberAccess.DoResolve): Add support for nested
1891 types in a generic instance; fixes #75320.
1893 2005-06-20 Martin Baulig <martin@ximian.com>
1895 * generic.cs (TypeManager.InferType): Also walk the class
1896 hierarchy for generic instances; fixes #75261.
1898 2005-06-17 Martin Baulig <martin@ximian.com>
1900 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
1901 to make things work for corlib.
1903 2005-06-15 Martin Baulig <martin@ximian.com>
1905 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
1906 obsolete `SecurityAction' values.
1908 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1910 * rootcontext.cs: Reset TargetExt as well.
1912 2005-06-09 Martin Baulig <martin@ximian.com>
1914 * delegate.cs (Delegate.VerifyMethod): Added
1915 `MethodGroupExpr old_mg' argument; inherit its
1916 `HasTypeParameters'; fix #75085.
1918 2005-06-09 Martin Baulig <martin@ximian.com>
1920 * expression.cs (Invocation.OverloadResolve): Correctly handle
1921 generic methods for the SetMemberIsUsed(); fix #75064.
1923 2005-06-09 Martin Baulig <martin@ximian.com>
1925 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
1928 2005-06-08 Martin Baulig <martin@ximian.com>
1930 * cs-parser.jay (nullable_type_or_conditional): If we put the
1931 nullable back and our `type' is a `ComposedCast', remove the
1932 nullable from it. Fixes #75156.
1934 * expression.cs (ComposedCast.RemoveNullable): New public method.
1936 2005-06-08 Martin Baulig <martin@ximian.com>
1938 The big Iterators rewrite :-)
1940 * iterators.cs: Rewrite this to use the anonymous methods framework.
1942 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1943 before the TypeContainers; see 2test-21.cs.
1946 (TypeContainer.DefineType): Don't create a new EmitContext if we
1947 already have one (this only happens if we're an Iterator).
1948 (TypeContainer.Define): Also call Define() on all our iterators.
1949 (Method.CreateEmitContext): Added support for iterators.
1952 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1953 (AnonymousContainer.CreateMethodHost): Moved here from
1954 AnonymousMethod and made abstract.
1955 (AnonymousContainer.CreateScopeType): New abstract method.
1956 (AnonymousContainer.IsIterator): New public property.
1957 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1958 get the ScopeTypeBuilder rather than manually defining it here.
1959 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1962 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1963 before RootContext.DefineTypes().
1965 * codegen.cs (EmitContext.RemapToProxy): Removed.
1966 (EmitContext.CurrentAnonymousMethod): Changed type from
1967 AnonymousMethod -> AnonymousContainer.
1968 (EmitContext.ResolveTopBlock): Protect from being called twice.
1969 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1970 (EmitContext.EmitThis): Removed the iterators hacks; use the
1971 anonymous methods framework for that.
1974 (ToplevelBlock.Container): Make this a property, not a field.
1975 (ToplevelBlock.ReParent): New public method; move the
1976 ToplevelBlock into a new container.
1977 (Foreach.TemporaryVariable): Simplify.
1979 2005-06-05 Martin Baulig <martin@ximian.com>
1981 * statement.cs (LocalInfo.CompilerGenerated): New flag.
1982 (Block.AddTemporaryVariable): New public method; creates a new
1983 `LocalInfo' for a temporary variable.
1984 (Block.EmitMeta): Create the LocalBuilders for all the temporary
1986 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1987 non-iterator variables.
1989 2005-06-05 Martin Baulig <martin@ximian.com>
1991 * statement.cs (Foreach.TemporaryVariable): Create the
1992 LocalBuilder in the Emit phase and not in Resolve since in some
1993 situations, we don't have an ILGenerator during Resolve; see
1994 2test-19.cs for an example.
1996 2005-06-04 Martin Baulig <martin@ximian.com>
1998 The big Foreach rewrite - Part II.
2000 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
2001 with `PropertyInfo ienumerator_getcurrent'.
2003 * codegen.cs (VariableStorage): Removed.
2006 (Foreach): Derive from Statement, not ExceptionStatement.
2007 (Foreach.CollectionForeach): New nested class. Moved all the code
2008 dealing with collection foreach here.
2009 (Foreach.ForeachHelperMethods): Removed.
2010 (Foreach.TemporaryVariable): Implement IMemoryLocation.
2012 2005-05-23 Martin Baulig <martin@ximian.com>
2014 * statement.cs (Try.DoResolve): Don't create a `finally' if we
2015 don't need to. Fix #75014.
2017 2005-05-26 Raja R Harinath <rharinath@novell.com>
2019 Improve user-defined conversion handling.
2020 * convert.cs (GetConversionOperators): Rewrite. Return only the
2021 applicable operators.
2022 (AddConversionOperators): New. Helper for GetConversionOperators.
2023 (FindMostEncompassedType, FindMostEncompassingType): Verify that
2024 there is only one most encompassed/encompassing type.
2025 (FindMostSpecificSource, FindMostSpecificTarget): Remove
2026 "applicable operator" handling.
2027 (UserConversion): Move cache here from GetConversionOperators.
2028 Directly cache the chosen operator, rather than the whole
2030 (ExplicitNumericConversion): Fix buggy implementation of Decimal
2031 case. Allow conversion of decimal to sbyte and byte too.
2032 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2033 New static methods. Used to avoid allocating EmptyExpressions in
2036 2005-05-24 Duncan Mak <duncan@novell.com>
2038 * ecore.cs (CastFromDecimal): New class for casting a decimal to
2039 another class, used in Convert.ExplicitNumericConversion.
2040 (CastToDecimal): New class, similar to above, but casts to
2041 System.Decimal, used in Convert.ImplicitNumericConversion and also
2042 in explicit convesion from double/float to decimal.
2044 * convert.cs (ImplicitNumericConversion): Handle implicit
2045 conversions to System.Decimal.
2046 (ExplicitNumericConversion): handle explicit conversions to
2051 2005-05-20 Miguel de Icaza <miguel@novell.com>
2053 * typemanager.cs: Do not throw an exception in the TypeBuilder
2054 case, we take care of it on the TypeCode.
2056 2005-05-17 Marek Safar <marek.safar@seznam.cz>
2058 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2061 * cs-parser.jay: Catch more lexical errors.
2063 * report.cs: Add one more Error method.
2066 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2068 2005-05-20 Martin Baulig <martin@ximian.com>
2070 * class.cs (TypeContainer.CircularDepException): Removed.
2071 (TypeContainer.DefineType): Removed the `InTransit' stuff.
2072 (TypeContainer.CheckRecursiveDefinition): Check for circular class
2073 (CS0146) and interface (CS0529) dependencies here.
2075 2005-05-20 Martin Baulig <martin@ximian.com>
2077 * expression.cs (New.DoResolve): Move the CS0712 check above the
2078 CS0144 check; otherwise it can never be reached.
2080 2005-05-20 Martin Baulig <martin@ximian.com>
2082 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
2084 2005-05-20 Martin Baulig <martin@ximian.com>
2086 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
2088 * typemanager.cs (TypeManager.IsAttributeType): New public method.
2090 2005-05-19 Martin Baulig <martin@ximian.com>
2093 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2094 to disable error reporting.
2096 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2097 here since we don't want to report an error; see the new test-336.cs.
2099 2005-05-19 Raja R Harinath <rharinath@novell.com>
2101 * statement.cs (ToplevelBlock.GetParameterReference)
2102 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2103 Move here from class Block.
2104 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2105 * expression.cs (ParameterReference.DoResolveBase): Likewise.
2107 2005-05-18 Martin Baulig <martin@ximian.com>
2112 (FlowBranching.Reachability): Add non-static public And() and Or()
2114 (FlowBranchingSwitch): New class; do the `break_origins' thing
2115 like in FlowBranchingLoop.
2116 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2117 reachability, not just locals and parameters.
2118 (FlowBranching.MergeChild): Remove some of the hacks for loop and
2119 switch; MergeBreakOrigins() now takes care of that.
2121 2005-05-18 Martin Baulig <martin@ximian.com>
2123 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2124 a loop and may leave it, reset the barrier; fixes #74974.
2126 2005-05-16 Raja R Harinath <rharinath@novell.com>
2128 Fix test-382.cs. Emit values of decimal constants.
2129 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
2131 (TypeContainer.AddField): ... this.
2132 (TypeContainer.EmitFieldInitializers): Allow the list of fields
2133 with initializers to include 'Const's.
2134 (ClassPart.RegisterFieldForInitialization): Forward to
2136 * const.cs (Const.Const): Pass initializer to base class.
2137 (Const.Define): In case of decimal constants, register them for
2138 initialization in a static constructor.
2140 2005-05-14 Martin Baulig <martin@ximian.com>
2142 * statement.cs (Block.Resolve): Correctly handle unreachable code;
2143 do not call ResolveUnreachable() on unreachable statements in
2144 here, see the comment in the source code.
2146 2005-05-13 Raja R Harinath <rharinath@novell.com>
2149 * expression.cs (BinaryResolveOperator): If one of the operands of
2150 an equality comparison is 'null' and the other is a pointer type,
2151 convert the null to a NullPointer.
2152 * convert.cs (ImplicitReferenceConversion): If the expression is a
2153 NullLiteral and the target type is a pointer type, return a
2154 NullPointer instead.
2155 (ImplicitConversionStandard): Likewise.
2157 2005-05-13 Marek Safar <marek.safar@seznam.cz>
2159 * cs-parser.jay: Set readonly context based on special constructs.
2161 * expression.cs (LocalVariableReference.DoResolveBase): Improved
2162 readonly variable error handling.
2164 * rootcontext.cs (EmitCode): Don't verify members when error
2167 * statement.cs (LocalInfo): Add reaodnly context information.
2168 (SetReadOnlyContext, GetReadOnlyContext): New methods.
2170 2005-05-17 Martin Baulig <martin@ximian.com>
2172 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
2175 2005-05-13 Martin Baulig <martin@ximian.com>
2177 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
2178 handle unreachable blocks.
2180 2005-05-13 Martin Baulig <martin@ximian.com>
2183 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
2184 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
2187 2005-05-13 Martin Baulig <martin@ximian.com>
2189 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
2190 instance variable, not a local. Fix #74873.
2191 (Block.ResolveUnreachable): Set it to true here.
2193 2005-05-12 Martin Baulig <martin@ximian.com>
2195 * cs-parser.jay (property_declaration): Pass the `current_class',
2196 not the `current_container' to Property's .ctor. Fixes #74912.
2198 2005-05-11 Martin Baulig <martin@ximian.com>
2200 * typemanager.cs (Closure): Copy this from MCS and merge all the
2201 GMCS-specific changes into it.
2203 2005-05-12 Raja R Harinath <harinath@gmail.com>
2206 * typemanager.cs (unmanaged_enclosing_types): New.
2207 (IsUnmanagedType): Avoid infloops by using
2208 'unmanaged_enclosing_types' to talk with recursive invocations.
2210 2005-05-11 Duncan Mak <duncan@novell.com>
2212 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
2213 continuing to process for 'arg'.
2214 (handle_preprocessing_directive): Check the argument of the #endif
2215 directive and report error CS1025 if there are any trailing
2218 According to the C# spec, having even whitespace after the #endif
2219 directive is illegal; however, because we call arg.TrimEnd ()
2220 beforehand, we have the same behavior as csc, allowing whitespace
2221 after the directive.
2225 2005-05-11 Marek Safar <marek.safar@seznam.cz>
2229 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
2230 (Constructor.GetObsoleteAttribute): Implemented correctly.
2232 2005-05-10 Martin Baulig <martin@ximian.com>
2234 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
2235 resolve the type; fixes #74864.
2236 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
2237 in DoResolve(); fixes #74862.
2239 2005-05-10 Martin Baulig <martin@ximian.com>
2241 * support.cs (ReflectionParameters.ParameterModifier): Use
2242 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
2243 and `ParameterAttributes.In'. Fixes #74884.
2245 2005-05-10 Martin Baulig <martin@ximian.com>
2247 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
2248 the cache if we're just looking for `MemberTypes.NestedType' in a
2251 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2252 constraints if we're still resolving the type tree.
2253 (Expression.MemberLookup): If we're resolving the type tree, only
2254 look for `MemberTypes.NestedType' since we're only interested in
2257 * class.cs (TypeContainer.DefineType): Don't resolve the type
2258 parameters here; do this later in ResolveType() after the type
2259 tree has been resolved.
2260 (TypeContainer.ResolveType): New public method; this is called
2261 after the type tree is resolved and before the types are being
2262 populated. We resolve the generic constraints here.
2263 (TypeContainer.DoDefineMember): Check the constraints on our base
2264 class and interfaces.
2266 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
2267 set the `ResolvingTypeTree' flag on the EmitContext.
2269 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
2271 2005-05-10 Marek Safar <marek.safar@seznam.cz>
2273 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
2275 * expression.cs (Argument.GetParameterModifier): Turned to property.
2276 (Invocation.Error_InvalidArguments): Add more descriptive errors.
2278 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
2281 2005-05-09 Raja R Harinath <rharinath@novell.com>
2284 * decl.cs (MemberCache.AddMethods): Register override methods,
2285 rather than non-override methods.
2286 * typemanager.cs (RegisterOverride): New.
2287 (IsOverride): Update.
2289 2005-05-09 Marek Safar <marek.safar@seznam.cz>
2291 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
2293 2005-05-06 Martin Baulig <martin@ximian.com>
2296 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
2297 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
2299 2005-05-09 Marek Safar <marek.safar@seznam.cz>
2303 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
2304 recursive declaration.
2306 * statement.cs (Block.ResolveMeta): Report any error in resolving.
2308 2005-05-06 Marek Safar <marek.safar@seznam.cz>
2310 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
2312 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
2314 2005-05-05 Raja R Harinath <rharinath@novell.com>
2317 * decl.cs (DeclSpace.FamilyAccessible):
2318 Use TypeManager.IsNestedFamilyAccessible.
2320 Fix reopened #64812.
2321 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
2324 2005-05-04 Raja R Harinath <rharinath@novell.com>
2325 Abin Thomas <projectmonokochi@rediffmail.com>
2326 Anoob V E <projectmonokochi@rediffmail.com>
2327 Harilal P R <projectmonokochi@rediffmail.com>
2330 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
2331 allow access to all static members.
2333 2005-05-04 Martin Baulig <martin@ximian.com>
2335 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
2337 2005-05-04 Martin Baulig <martin@ximian.com>
2341 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
2342 section at the end; make things work if `default' is not the last
2345 2005-05-04 Martin Baulig <martin@ximian.com>
2349 * statement.cs (Switch): Replaced the `got_default' field with a
2350 `default_section' one.
2351 (Switch.CheckSwitch): Set `default_section' here.
2352 (Switch.Resolve): If we're a constant switch and the constant is
2353 not found, use the default section.
2355 2005-05-03 Martin Baulig <martin@ximian.com>
2357 * expression.cs (ArrayAccess.EmitGetLength): New public method.
2359 * statement.cs (Foreach.ArrayForeach): New nested class.
2360 (Foreach.TemporaryVariable): New nested class.
2361 (Foreach.EmitArrayForeach): Removed; this is now in the new
2364 2005-05-03 Raja R Harinath <rharinath@novell.com>
2366 * pending.cs (BaseImplements): Move the #74773 fix here. This is
2368 (VerifyPendingMethods): Revert change below.
2370 * typemanager.cs (IsOverride, RegisterNonOverride): New.
2371 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2372 that used to trigger warning -28. Remove warning -28.
2373 * expression.cs (Invocation.OverloadResolve): Use
2374 TypeManager.IsOverride to distinguish override methods.
2377 * pending.cs (VerifyPendingMethods): If a base type implements the
2378 requested interface, don't bother checking individual methods of
2379 the base type. As a side-effect, this prevents the creation of
2380 unnecessary proxies.
2382 2005-05-02 Martin Baulig <martin@ximian.com>
2386 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2387 Also `And' the locals if the old vector is null.
2388 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2389 null; in this case we basically reset all the variables.
2391 2005-05-02 Martin Baulig <martin@ximian.com>
2395 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2396 Added `FlowBranching branching' argument; always `and' the
2397 variables instead of `or'ing them unless we're an infinite loop.
2399 * statement.cs (While.Resolve): Create a new sibling unless we're
2402 2005-05-02 Martin Baulig <martin@ximian.com>
2406 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2407 arguments; use it instead of creating a new TopLevelBlock.
2408 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2409 our ConstructorInitializer.
2412 (TopLevelBlock.TopLevelBranching): New public property.
2413 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2414 and create our `TopLevelBranching'.
2416 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2417 anonymous method host, use `block.TopLevelBranching' rather than
2418 creating a new branching.
2420 2005-04-20 Miguel de Icaza <miguel@novell.com>
2422 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2423 a ScopeInfo, if any of the current children is a child of the new
2424 entry, move those children there.
2426 2005-04-30 Martin Baulig <martin@ximian.com>
2428 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2429 at the beginning of a SwitchSection. Fix #73335.
2431 2005-04-27 Marek Safar <marek.safar@seznam.cz>
2434 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2436 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2437 (FieldExpr.DoResolve): Obsolete members are ignored for field
2440 2005-04-26 Marek Safar <marek.safar@seznam.cz>
2442 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2443 of arrays detection.
2445 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2447 (Field.VerifyClsCompliance): Volatile fields are not compliant.
2449 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2452 2005-04-25 Ben Maurer <bmaurer@ximian.com>
2454 * cs-parser.jay: Use the prefered version of -unsafe in error
2457 2005-04-22 Marek Safar <marek.safar@seznam.cz>
2459 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2462 2005-04-20 John Luke <john.luke@gmail.com>
2464 * driver.cs: fix typo in error message, --outout to --output
2466 2005-04-30 Martin Baulig <martin@ximian.com>
2468 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
2469 handle the .NET 2.x security attributes.
2471 2005-04-30 Martin Baulig <martin@ximian.com>
2474 (TypeManager.ExpandInterfaces): Don't add things twice.
2477 (TypeContainer.VerifyClsCompliance): Allow generic instances.
2479 2005-04-29 Martin Baulig <martin@ximian.com>
2481 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
2483 * anonymous.cs: Added support for anonymous generic methods.
2485 2005-04-29 Martin Baulig <martin@ximian.com>
2487 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
2490 2005-04-29 Martin Baulig <martin@ximian.com>
2492 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
2494 * expression.cs (New.DoResolve): Fix the CS0304 check.
2496 2005-04-29 Martin Baulig <martin@ximian.com>
2498 * typemanager.cs (TypeManager.GetFullName): Updated to the new
2501 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
2502 explicit interface implementation, compare the interface types.
2503 (MethodData.Define): Use the new naming scheme from the latest
2505 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
2507 * decl.cs (MemberName.GetMemberName): Removed.
2508 (MemberName.MethodName, FullName): New properties.
2510 2005-04-25 Raja R Harinath <rharinath@novell.com>
2512 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
2514 2005-04-22 Martin Baulig <martin@ximian.com>
2516 * generic.cs (GenericMethod): Create the EmitContext in the
2517 `Define()'; in `Define(MethodBuilder)', create the type parameters
2518 before calling `Define()'. Fixes #73933.
2520 2005-04-22 Martin Baulig <martin@ximian.com>
2523 (Constraints.Resolve): Make things work wrt. the new type lookup system.
2524 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
2526 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
2527 ConstructedType, check its constraints.
2529 2005-04-20 Marek Safar <marek.safar@seznam.cz>
2531 * codegen.cs (InRefOutArgumentResolving): New field.
2533 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2534 fields outside contructor.
2536 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2538 2005-04-19 Miguel de Icaza <miguel@novell.com>
2540 * anonymous.cs (CaptureContext.EmitParameterInstance): The
2541 parameter code was not completed ever, so it was not as up-to-date
2542 as local variables. Must finish it.
2544 The bug fix was to compare the Toplevel of the block, not the
2545 current block. Thanks for Ben for pointing this out.
2547 2005-04-19 Raja R Harinath <rharinath@novell.com>
2549 * decl.cs (AddMethods): Use the declaring type of the problem
2550 method to determine if we want to squash a warning.
2552 2005-04-19 Marek Safar <marek.safar@seznam.cz>
2554 * attribute.cs: Removed debug output.
2556 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2558 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2561 2005-04-18 Raja R Harinath <rharinath@novell.com>
2564 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2565 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2566 all null comparisons against reference types.
2568 2005-04-18 Marek Safar <marek.safar@seznam.cz>
2571 * class.cs (TypeContainer.CircularDepException) New nested
2573 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2574 (TypeContainer.DefineType): Removed error, reset InTransit before
2576 (Class.DefineType): Throw exception when is in Transit.
2577 Catch exception and report error.
2578 (Struct.DefineType): Throw exception when is in Transit.
2579 Catch exception and report error.
2580 (Interface.DefineType): Throw exception when is in Transit.
2581 Catch exception and report error.
2583 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2584 handle nested exception handlers.
2586 * flowanalysis.cs (InTryWithCatch): New method, search for try with
2589 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2590 InFinally and InCatch storage.
2592 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2593 (Catch.Resolve): Set and Restore ec.InCatch.
2594 (Try.Resolve): Set and Restore ec.InFinally.
2595 (Try.HasCatch): True when try has catch.
2597 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
2599 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2600 for the same event member, so exclude such cases from warning 419.
2603 2005-04-16 Miguel de Icaza <miguel@novell.com>
2605 * expression.cs (Binary.ResolveOperator): Apply patch from John
2606 Luke to fix bug 59864: operators &, | and ^ on enumerations
2607 require that the same enum type on both sides.
2609 * driver.cs: Add warnings to old flag usage, this is to assist
2610 people who produce Makefiles and hope that the Makefiles will be
2613 * class.cs (TypeContainer.EmitType): Moved the definition of the
2614 special $PRIVATE$ field from the resolve phase to the Emit phase.
2615 During resolve we do not know if we are a struct with
2616 HasExplicitLayout, we know this only after the attributes for the
2619 Set the FieldOffset to zero on the dummy field that we create for
2620 the class. Fixes 74590.
2622 2005-04-16 Raja R Harinath <rharinath@novell.com>
2625 * ecore.cs (PropertyExpr.resolved): New.
2626 (DoResolve): Use it to handle a case of double resolution here.
2627 Handle a case of identical-name-and-type-name.
2628 * expression.cs (ArrayCreation.CheckIndices): Avoid double
2629 resolution by storing the results of expression resolution back
2630 into the "probes" array.
2632 2005-04-15 Raja R Harinath <rharinath@novell.com>
2634 Fix cs0208-7.cs and cs0208-8.cs.
2635 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2636 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
2637 error reporting to point out the reason a struct is not unmanaged.
2639 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2641 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
2642 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2644 2005-04-13 Raja R Harinath <rharinath@novell.com>
2647 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2648 IdenticalNameAndTypeName here.
2649 (EventExpr.InstanceResolve): Likewise.
2651 2005-04-13 Marek Safar <marek.safar@seznam.cz>
2653 C# 2.0 DefaultCharSetAttribute implementation
2655 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2656 which allows us to set GlobalNamespace for every resolve.
2657 (Attribute.ResolveArguments): Cut from Resolve.
2658 (Attribute.GetCharSetValue): Returns CharSet named argument.
2659 (Attribute.DefinePInvokeMethod): Gets default charset from
2661 (GlobalAttribute.ResolveAsTypeStep): Override.
2662 (GlobalAttribute.ResolveArguments): Override.
2664 * class.cs (TypeAttr): Is protected.
2666 * codegen.cs (ModuleClass.DefaultCharSet): New member.
2667 (ModuleClass.DefaultCharSetType): New memeber.
2668 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2670 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2671 charset from module.
2673 * delegate.cs (TypeAttr): Override.
2674 (Delegate.DefineType): Use this TypeAttr.
2676 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2677 at very early stage (before types are defined) to resolve model
2678 module attributes. It will probably not work with corlib but it
2681 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2682 charset from module.
2684 * typemanager.cs (default_charset_type): New type.
2686 2005-04-13 Raja R Harinath <rharinath@novell.com>
2688 * decl.cs (MemberCache.AddMethods): Don't warn if
2689 System.Object.Finalize has buggy MethodAttributes.
2691 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2694 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2696 * doc.cs : detect ambiguous reference to overloaded members.
2697 Fixed bug #71603. MS 1.1 csc does not detect it.
2699 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2701 * doc.cs : delegates must not be referenced with parameters.
2704 2005-04-12 Miguel de Icaza <miguel@novell.com>
2706 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2708 2005-04-10 Miguel de Icaza <miguel@novell.com>
2710 * driver.cs (MainDriver): Stop processing if the CLS stage found
2713 (CompilerCallableEntryPoint.InvokeCompiler): Always
2714 reset after execution; Take a TextWriter argument for the
2717 * report.cs: Use the error stream instead of hardcoding stderr.
2719 2005-04-09 Miguel de Icaza <miguel@novell.com>
2721 * class.cs: Reduce code paths to test, too small of an
2722 optimization to make it worth the extra testing. Always perform
2725 2005-04-08 Raja R Harinath <rharinath@novell.com>
2728 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2729 operators that had errors reported on them.
2731 2005-04-08 Marek Safar <marek.safar@seznam.cz>
2733 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2735 (Attribute.Resolve): Add named argument type checking.
2737 * class.cs (FixedField.Define): Use IsPrimitiveType
2739 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2741 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2742 unsafe parameter types.
2744 * statement.cs (Using.ResolveExpression): Add better error description.
2746 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2748 2005-04-08 Raja R Harinath <rharinath@novell.com>
2751 * attribute.cs (Attribute.GetAttributeUsage): Resolve
2752 AttributeUsageAttribute in the emitcontext of the attribute class,
2753 not in the emitcontext of the attributable entity it was attached to.
2754 * cs-parser.jay: Use 'current_class', not 'current_container',
2755 when creating a GlobalAttribute.
2757 2005-04-08 Alp Toker <alp@atoker.com>
2759 * pending.cs: The fix to #58413 failed to compile methods implementing
2760 interfaces with/without params modifiers and vice versa, even though
2761 params modifiers aren't part of the signature. Make the modifier check
2762 less strict as in csc.
2764 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
2765 Anoob V E <projectmonokochi@rediffmail.com>
2766 Harilal P R <projectmonokochi@rediffmail.com>
2769 * pending.cs (TypeAndMethods.mods): New. Store the parameter
2770 modifiers of pending methods.
2771 (PendingImplementation.PendingImplementation): Initialize it.
2772 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2773 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2774 with ParameterData. Add check for modifiers.
2775 * class.cs (MethodData.Define): Update to changes.
2777 2005-04-07 Raja R Harinath <rharinath@novell.com>
2779 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2781 2005-04-07 Marek Safar <marek.safar@seznam.cz>
2783 * class.cs (PropertyMethod.Define): Check private accessor in abstract
2786 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2789 * typemanager.cs: Registered RequiredAttributeAttribute.
2791 2005-04-06 Marek Safar <marek.safar@seznam.cz>
2793 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2794 Warning CS0169 is back at level 3.
2795 (IMethodData.SetMemberIsUsed): New method.
2797 * decl.cs (IsUsed): New value; moved from FieldBase.Status
2798 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2800 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2802 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2804 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2807 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2810 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2811 to avoid the problems with nested types.
2813 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
2814 Anoob V.E <projectmonokochi@rediffmail.com>
2815 Harilal P.R <projectmonokochi@rediffmail.com>
2816 Raja R Harinath <rharinath@novell.com>
2819 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2821 * typemanager (GetConstructor): Make public.
2823 2005-04-05 John Luke <john.luke@gmail.com>
2824 Raja R Harinath <rharinath@novell.com>
2827 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2828 struct too. Return false quicker in a few cases.
2829 (VerifyUnManaged): Use it.
2831 2005-04-05 Raja R Harinath <rharinath@novell.com>
2834 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2835 not 'unreachable_seen'.
2837 2005-04-04 Marek Safar <marek.safar@seznam.cz>
2839 * attribute.cs (Attribute.GetValue): Removed unused.
2841 * codegen.cs (CodeGen.TrimExt): Removed unused.
2843 * cs-parser.jay (output): Removed unused.
2845 * cs-tokenizer.cs (hex_digits): Removed unused.
2847 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2849 * expression.cs (Indirection.LoadExprValue): Removed unused.
2850 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2852 * iterators.cs (Iterator.param_types): Removed unused.
2854 * statement.cs (Goto.block): Removed unused.
2855 (ToplevelBlock.did): Removed unused.
2856 (Switch.ResolveConstantSwitch): Removed unused.
2858 2005-04-01 Ben Maurer <bmaurer@ximian.com>
2860 * rootcontext.cs: Allow mcs to bootstrap with the compilation
2863 2005-04-19 Martin Baulig <martin@ximian.com>
2865 Merged r42462 from MCS and made it work for GMCS.
2867 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
2869 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
2871 2005-04-01 Raja R Harinath <rharinath@novell.com>
2873 Fix #74232 and cs0208-3.cs.
2874 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2875 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2876 unmanaged type. Don't use FieldBuilders when 't' is a
2877 TypeBuilder. Use ModFlags and MemberType fields.
2878 * class.cs (MemberBase.member_type): Rename from MemberType.
2879 (MemberBase.MemberType): New property. Determines member_type on
2881 (MemberBase.DoDefine): Don't initialize MemberType here.
2882 (FieldMember.Define): Likewise.
2884 2005-04-01 Marek Safar <marek.safar@seznam.cz>
2887 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2888 Attributes are emitted there.
2890 2005-04-01 Raja R Harinath <rharinath@novell.com>
2892 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2893 keyword in 'partial enum' too.
2894 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2896 Report from Kamil Skalski <nazgul@omega.pl>.
2899 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2900 have partial containers too.
2902 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2903 in block' checks to Block.CheckInvariantMeaningInBlock.
2904 * statement.cs (Block.GetKnownVariableInfo): Make private.
2905 (Block.IsVariableUsedInChildBlock): Remove.
2906 (Block.IsVariableUsedInBlock): Likewise.
2907 (Block.CheckInvariantMeaningInBlock): New. Show location of
2908 conflicting declaration.
2909 (Block.AddVariable): Make error messages less long-winded and more
2910 specific. Show location of conflicting declaration.
2911 * parameter.cs (Parameters.Location): New readonly property.
2913 2005-03-31 Raja R Harinath <rharinath@novell.com>
2915 Clean up semantics of invoking ResolveMemberAccess.
2916 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2917 can have an instance, ensure that we pass in a non-TypeExpression
2918 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
2919 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2920 argument. Update to changes and simplify.
2921 (FieldExpr.Emitinstance): Remove CS0120 check.
2922 (PropertyExpr.EmitInstance): Likewise.
2923 * expression.cs (Argument.Resolve): Likewise.
2924 (Invocation.DoResolve): Update to changes in semantics of
2927 2005-03-31 Marek Safar <marek.safar@seznam.cz>
2930 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2933 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2935 2005-03-31 Raja R Harinath <rharinath@novell.com>
2937 Fix difference in behaviour with commandline invocation.
2938 * driver.cs (Driver.Reset): New.
2939 (CompilerCallableEntryPoint): Call it.
2941 * statement.cs (If.Resolve): Avoid spurious "uninitialized
2942 variable" warnings if the boolean expression failed to resolve.
2944 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
2946 * attribute.cs: Fix the union of several permissions when some of them
2947 are unrestricted (so the result isn't an unrestricted permission set).
2950 2005-03-30 Raja R Harinath <rharinath@novell.com>
2952 * ecore.cs (MemberExpr): New class. Convert from interface
2954 (MemberExpr.ResolveMemberAccess): Refactor and move here from
2955 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
2957 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2958 (MethodGroupExpr.IsExplicitImpl): Remove.
2959 (Expression.GetFieldFromEvent): Remove.
2960 (SimpleName.MemberStaticCheck): Remove.
2961 (SimpleName.DoSimpleNameResolve): Update to changes.
2962 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2963 (MemberAccess.IdenticalNameAndTypeName): Remove.
2964 (MemberAccess.error176): Move to MemberExpr.
2965 (MemberAccess.DoResolve): Update to changes.
2966 (BaseAccess.DoResolve): Likewise.
2968 2005-03-30 Marek Safar <marek.safar@seznam.cz>
2970 C# 2.0 Conditional attribute class implementation
2972 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2973 Analyzes class whether it has attribute which has ConditionalAttribute
2974 and its condition is not defined.
2976 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2977 (Class.IsExcluded): New method. Search for at least one defined
2978 condition in ConditionalAttribute of attribute class.
2980 2005-03-30 Raja R Harinath <rharinath@novell.com>
2982 * ecore.cs (PropertyExpr): Derive from Expression, not
2983 ExpressionStatement.
2984 (PropertyExpr.EmitStatement): Remove.
2986 2005-03-29 Raja R Harinath <rharinath@novell.com>
2989 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2990 internal field "value__" of an enum be private. The examples for
2991 "value__" that I found on MSDN all used FieldAttributes.Private.
2993 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2994 Don't mention IL method attribute names.
2996 Fix #47991. Remove a TODO.
2997 * statement.cs (Block.Toplevel): Make into a field.
2998 (Block.Parameters): Move into ToplevelBlock.
2999 (Block.known_variables): Rename from child_variable_names.
3000 (Block.Block): Remove variants that take Parameters. Initialize
3001 'Toplevel' with the immediately surrounding toplevel block.
3002 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
3003 LocalInfo parameter.
3004 (Block.GetKnownVariableInfo): New.
3005 (Block.IsVariableNameUsedInChildBlock): Update.
3006 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
3007 the block, even though it may not be in scope.
3008 (Block.AddVariable): Remove Parameters parameter. Use
3009 Toplevel.Parameters instead.
3010 (Block.AddConstant): Remove Parameters parameter.
3011 (Block.GetParameterReference): Update to use Toplevel.Parameters.
3012 (Block.IsParamaterReference): Likewise.
3013 (Block.IsLocalParameter): Likewise. Simplify a lot.
3014 (ToplevelBlock.Parameters): New. Moved from Block.
3015 (ToplevelBlock.ToplevelBlock): Update to changes. Always
3016 initialize Parameters to a non-null value.
3017 * cs-parser.jay: Update to changes.
3018 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
3019 simple names that mean different things in the same block. Use
3020 Block.IsVariableNameUsedInBlock.
3022 2005-03-28 Raja R Harinath <rharinath@novell.com>
3024 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
3026 2005-03-26 Raja R Harinath <harinath@acm.org>
3029 * assign.cs (Assign.DoResolve): When the RHS of an assignment
3030 fails to resolve, ensure that the LHS is still resolved as an
3033 2005-03-25 Raja R Harinath <harinath@acm.org>
3035 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3037 (Enum.current_ec): Remove.
3038 (Enum.LookupEnumValue): Remove EmitContext argument.
3039 Just uses the one created during DefineType.
3040 (Enum.FindMembers): Update.
3041 * expression.cs (MemberAccess.DoResolve): Update.
3043 2005-03-22 Marek Safar <marek.safar@seznam.cz>
3045 * assign.cs (Assign.DoResolve): Check for CS1717 when
3046 source and target are same (uses Equals).
3048 * expression.cs (LocalVariableReference, ParameterReference,
3049 This): Implemented Equals, GetHashCode.
3051 * statement.cs (Block.GetParameterReference): Removed useless
3054 2005-03-22 Raja R Harinath <rharinath@novell.com>
3057 * statement.cs (Block.AddVariable): Ensure that we skip implicit
3058 blocks before deciding whether the error is cs0136 or cs0128.
3060 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3061 (using_alias_directive, using_namespace_directive): Pass
3062 MemberName, not an expression to Namespace.UsingAlias and
3064 (MakeName): Use the MemberName of the namespace.
3065 * namespace.cs (Namespace.MemberName): New.
3066 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3067 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3069 * decl.cs (MemberName.Name): Make readonly.
3070 (MemberName.FromDotted): New "constructor".
3071 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3072 (MemberCore.Name): Compute from MemberName on demand.
3073 (MemberCore.SetMemberName): Provide a way to change the
3075 (MemberCore.AddToContainer): Don't take a fullname parameter.
3076 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3077 fully qualified name of the container to the member name.
3078 (TypeContainer.AddToTypeContainer): Use a fully qualified name
3079 only if the type is a member of the root container.
3080 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3081 MemberName.Left rather than searching for an embedded ".".
3082 (PartialContainer.CreatePart): Update to changes in RootContext.
3083 (MemberBase.ShortName): Turn into a property. Use
3084 MemberCore.SetMemberName.
3085 (MemberBase.ExplicitInterfaceName): Remove.
3086 (MemberBase.UpdateMemberName): Remove.
3087 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3088 (PropertyBase.SetMemberName): New override.
3089 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3090 (Tree.GetDecl): New.
3091 (Tree.AllDecls): Rename from Decls.
3092 * attribute.cs, enum.cs, report.cs: Update to changes.
3093 * driver.cs (MainDriver): Use MemberName.FromDotted on
3094 RootContext.MainClass.
3096 2005-03-21 Marek Safar <marek.safar@seznam.cz>
3098 * class.cs (FixedField.Define): Check for CS1664 and more sanity
3101 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3103 2005-03-18 Marek Safar <marek.safar@seznam.cz>
3105 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3106 property accessor modifiers.
3108 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3109 fixed buffer attribute (CS1716).
3110 (PropertyMethod.HasCustomAccessModifier): When property accessor
3111 has custom modifier.
3113 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3115 (PropertyExpr.DoResolveLValue): Add CS0272.
3117 2005-03-17 Miguel de Icaza <miguel@novell.com>
3119 * convert.cs: When converting to a pointer, use the proper Conv.U
3120 or Conv.I depending on the source data type.
3122 * cs-tokenizer.cs: Make the size for large decimal constants,
3125 2005-03-17 Martin Baulig <martin@ximian.com>
3127 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3128 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
3130 2005-03-17 Martin Baulig <martin@ximian.com>
3132 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3133 to bool so we can return an error condition.
3134 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3137 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
3139 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
3142 2005-03-16 Raja R Harinath <rharinath@novell.com>
3144 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
3145 Refactor to avoid traversing the list of assemblies, and to avoid
3146 string concatenation.
3147 * typemanager.cs (guid_attr_type): Remove.
3148 (negative_hits, pointers, references): Remove hashes.
3150 (GetConstructedType): New. Uses type_hash to handle constructed
3151 types (arrays, references, pointers).
3152 (GetReferenceType, GetPointerType): Use it.
3153 (GetNestedType): New. Uses type_hash to handle nested types of
3155 (LookupType, LookupTypeDirect): Remove.
3156 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
3157 'types' hash and LookupTypeReflection directly.
3158 (params_string, params_object): Use GetConstructedType.
3159 * namespace.cs (Namespace.cached_types): New. Cache of reflected
3161 (Namespace.Lookup): Use cached_types.
3162 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
3163 provided by old TypeManager.LookupType.
3164 * rootcontext.cs (MakeFQN): Remove.
3165 * decl.cs (DeclSpace.MakeFQN): Likewise.
3166 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
3167 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
3168 TypeManager.GetConstructedType.
3169 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
3171 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
3173 * cs-parser.jay: Fix build.
3175 2005-03-15 Marek Safar <marek.safar@seznam.cz>
3177 * class.cs (TypeContainer.CircularDepException) New nested
3178 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
3180 * cs-parser.jay: Reports CS1527 for any namespace element.
3182 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
3185 * expression.cs (ParameterReference.IsAssigned): Changed error to
3187 (Error_WrongNumArguments): Moved CS0245 detection here.
3189 * statement.cs (Return.Resolve): Add CS1622 report.
3191 2005-03-11 Marek Safar <marek.safar@seznam.cz>
3193 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
3195 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
3197 * attribute.cs expression.cs: Get rid of some allocations.
3199 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
3201 * doc.cs : just eliminate the latest change.
3203 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
3205 * doc.cs : commented out the latest change. It breaks xml-030.cs
3207 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
3209 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
3210 fail. So invoke CreateType() in FindDocumentedType().
3212 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
3214 * cs-tokenizer.cs : added IsKeyword().
3215 * doc.cs : Detect keyword incorrectly used as identifier.
3216 Allow identifiers prefixed by @.
3218 2005-03-10 Marek Safar <marek.safar@seznam.cz>
3220 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
3221 It caused exception in namespace resolving (again!).
3223 * class.cs (Class.ctor): Removed exit.
3224 (PropertyMethod.ctor): ditto.
3226 * codegen.cs (Codegen.Reset): Reset static data.
3227 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
3229 * cs-tokenizer.cs (Cleanup): Removed.
3231 * driver.cs (GetSystemDir): Rewrote to one line command.
3232 It caused problem with unloaded dynamic modules.
3233 (UnixParseOption): Removed Exit.
3234 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
3235 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
3236 Now can be mcs used as library.
3238 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
3241 * location.cs (Reset): Reset static data.
3243 * namespace.cs (Reset): Reset static data.
3245 * report.cs (Report.Reset): Reset static data.
3247 * rootcontext.cs (RootContext.Reset): Reset static data.
3249 * tree.cs (RootTypes.ctor): Use Location.Null
3251 * typemanager.cs (TypeManager.Reset): Reset static data.
3252 (CoreLookupType): Removed Exit.
3253 (TypeHandle.Reset): Reset static data.
3255 2005-03-10 Raja R Harinath <rharinath@novell.com>
3258 * typemanager.cs (ComputeNamespaces): Import namespaces from
3259 referenced modules too.
3261 2005-03-09 Raja R Harinath <rharinath@novell.com>
3263 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
3266 2005-03-09 Raja R Harinath <rharinath@novell.com>
3268 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
3269 enclosing DeclSpace. This ensures that a name-lookup populates
3270 more caches and there are fewer 'TypeExpression's. Carve out
3271 nested type lookup into ...
3272 (LookupNestedTypeInHierarchy): ... this.
3274 2005-04-15 Martin Baulig <martin@ximian.com>
3276 Merged r41590 from MCS and make it work in the generics land.
3278 * generic.cs (TypeParameter.UpdateConstraints): Removed the
3281 * class.cs (PartialContainer.UpdateConstraints): Removed.
3282 (PartialContainer.CheckConstraints): Removed.
3283 (PartialContainer.SetParameterInfo): Store the constraints here.
3284 (PartialContainer.DefineTypeParameters): New public method;
3285 resolve the type parameter's constraints here. Note that the
3286 PartialContainer doesn't have an EmitContext anymore, so we must
3287 do this in the ClassPart.
3289 2005-03-09 Raja R Harinath <rharinath@novell.com>
3291 Clean up a few partial-class semantics.
3292 Fixes test-357.cs and cs1618-2.cs.
3293 * cs-parser.jay (struct_declaration): Use 'current_class' as
3294 parent of newly-created struct. Remove call to Register ().
3295 Use 'pop_current_class' to complete handing the current struct.
3296 (interface_declaration): Likewise.
3297 (class_declaration): Likewise.
3298 (enum_declaration): Use 'current_class' as parent of newly created
3300 (delegate_declaration): Likewise.
3301 (pop_current_class): New function. This is used to handle closing
3302 up the 'current_class' and 'current_container', and pointing them
3303 to the enclosing class/container.
3304 (CSharpParser): Initialize 'current_class' too.
3305 * decl.cs (MemberCore): Add check for invariant: a partial
3306 container is not a parsed entity, and thus does not enclose any
3308 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
3309 (DeclSpace.BaseTypeExpr): Use it.
3310 (DeclSpace.LookupType): Add check for invariant.
3311 * class.cs (TypeContainer): Add check for invariant: a nested
3312 class should have the same NamespaceEntry as its enclosing class.
3313 (TypeContainer.EmitFieldInitializers): Make virtual.
3314 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
3316 (TypeContainer.Register): Remove.
3317 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
3318 null. Use TypeResolveEmitContext for resolving base types and
3319 interfaces. Move initialization of Parts.TypeBuilder here from
3321 (TypeContainer.DefineNestedTypes): ... here.
3322 (PartialContainer): Take a Namespace not a NamespaceEntry.
3323 (PartialContainer.Create): Don't use Register. Call the
3324 appropriate Add... function directly.
3325 (ClassPart): Take both the PartialContainer and the enclosing
3326 class as constructor arguments.
3327 (ClassPart.EmitFieldInitializers): Override.
3328 (ClassPart.PartFindNestedTypes): Remove.
3329 (FieldBase.GetInitializerExpression): Resolve the initializer
3330 expression in the emit context of the enclosing class.
3331 * tree.cs (RootTypes): Remove Register ().
3333 2005-03-08 Marek Safar <marek.safar@seznam.cz>
3335 * cs-parser.jay: Removed CS0134.
3337 * driver.cs: Removed CS1901.
3339 * expression.cs (SizeOf.DoResolve): Don't report CS0233
3340 for predefined types.
3342 2005-03-07 Duncan Mak <duncan@novell.com>
3344 * codegen.cs (Save): Catch UnauthorizedAccessException as
3345 well. Fixes bug #73454.
3347 2005-03-07 Marek Safar <marek.safar@seznam.cz>
3349 * cs-tokenizer.cs (xtoken): Add CS1035.
3351 * class.cs (MethodData.Define): Add CS0683.
3352 (FieldMember.ctor): Add CS0681.
3354 2005-03-07 Raja R Harinath <rharinath@novell.com>
3356 * ecore.cs (SimpleName.DoResolve): Rename from
3357 SimpleName.DoResolveAllowStatic.
3358 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
3359 Pass 'intermediate' flag to MemberStaticCheck.
3360 (SimpleName.MemberStaticCheck): Skip "static check" only in case
3361 of "intermediate" lookups via MemberAccess.
3362 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
3363 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
3365 2005-03-07 Raja R Harinath <rharinath@novell.com>
3368 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
3369 slipped in because of variable names that are identical to a
3370 builtin type's BCL equivalent ('string String;', 'int Int32;').
3371 (PropertyExpr.EmitInstance): Likewise.
3373 2005-03-04 Marek Safar <marek.safar@seznam.cz>
3375 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
3377 * report.cs (warning_ignore_table): Made public.
3379 2005-03-04 Raja R Harinath <rharinath@novell.com>
3382 * class.cs (MethodData.Emit): Pass 'container' to
3383 container.GetObsoleteAttribute instead of 'container.Parent'.
3385 2005-03-03 Marek Safar <marek.safar@seznam.cz>
3387 * cs-parser.jay: Add 1534 error test.
3389 * iterators.cs (Yield.CheckContext): Add error 1629.
3390 (Iterator.ctor): Save unsafe modifier.
3391 (MoveNextMethod.DoEmit): Restore unsafe context.
3393 * namespace.cs (UsingAlias): Better error message.
3395 2005-03-03 Dan Winship <danw@novell.com>
3397 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
3398 the warning message [#73219]
3400 2005-03-03 Raja R Harinath <rharinath@novell.com>
3402 Fix compile with MCS 1.0.0.0.
3403 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
3404 w_restore to not depend on string constant folding.
3406 2005-03-03 Raja R Harinath <rharinath@novell.com>
3408 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
3409 CS0246 check to users who passed 'silent = false'.
3410 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
3412 (SimpleName.SimpleNameResolve): Update.
3413 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
3414 (MemberAccess.IdenticalNameAndTypeName): Update.
3415 * doc.cs (FindDocumentedTypeNonArray): Update.
3417 2005-03-03 Raja R Harinath <rharinath@novell.com>
3419 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3420 * parameters.cs (ComputeAndDefineParameters): Remove.
3421 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3422 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3423 Use GetParameterInfo.
3425 2005-03-02 Marek Safar <marek.safar@seznam.cz>
3427 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3429 2005-03-02 Raja R Harinath <rharinath@novell.com>
3431 Unify DeclSpace.LookupType and DeclSpace.FindType.
3432 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
3433 is in charge of defining nested types on demand.
3434 (DeclSpace.LookupType): Use it when the current_type is a
3435 TypeBuilder. Use LookupTypeDirect for reflected types.
3436 (DeclSpace.FindType): Remove.
3437 (DeclSpace.LookupInterfaceOrClass): Likewise.
3438 (DeclSpace.DefineTypeAndParents): Likewise.
3439 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3440 DeclSpace.LookupType.
3441 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3442 * typemanager.cs (LookupType): Simplify.
3443 (AddUserType): Remove type from negative_hits.
3444 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3445 * class.cs (TypeContainer.FindMembers): Move handling of nested
3447 (TypeContainer.FindMembers_NestedTypes): ... here.
3448 (TypeContainer.FindNestedType): Implement override.
3449 (ClassPart.FindNestedType): Delegate to PartialContainer.
3450 (ClassPart.PartFindNestedType): Looks up the nested types of the
3453 2005-04-14 Martin Baulig <martin@ximian.com>
3455 * generic.cs (ConstructedType): Moved all the type lookup and
3456 nested class logic into SimpleName.
3457 (ConstructedType.ResolveConstructedType): Our underlying type is
3458 already fully resolved; all the type lookup stuff is in
3461 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
3462 constructed types here instead of in ConstructedType.
3464 * decl.cs (MemberName.GetTypeExpression): Always create a
3465 SimpleName, not a ConstructedType.
3466 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
3468 2005-03-02 Martin Baulig <martin@ximian.com>
3470 * class.cs (TypeContainer.DoDefineMembers): We also need a default
3471 static constructor in static classes.
3473 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
3475 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3476 sizeParamIndex is not specified.
3478 2005-03-01 Marek Safar <marek.safar@seznam.cz>
3481 * report.cs (WarningMessage.IsEnabled): Missing null check.
3483 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3485 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3486 in the fields and not in the properties.
3488 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
3490 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
3493 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3495 * attribute.cs: Small refactoring (improved robustness).
3496 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3497 (ValidateGuid): Removed.
3498 (Resolve): Removed referenced to above mentioned.
3499 (GetAttributeUsage): Made private and changed to work without
3501 (GetIndexerAttributeValue): Don't crash.
3502 (GetConditionalAttributeValue): Ditto.
3503 (GetClsCompliantAttributeValue): Ditto.
3504 (ExtractSecurityPermissionSet): All attributes exceptions are
3506 (GetPropertyValue): New helper.
3507 (GetMethodImplOptions): New method.
3508 (DefinePInvokeMethod): Reuse common code. Implemented handling of
3509 some missing properties.
3511 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3512 (Method.ApplyAttributeBuilder): Updated.
3514 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3517 2005-02-28 Raja R Harinath <rharinath@novell.com>
3520 * report.cs (Report.SymbolRelatedToPreviousError): Handle
3521 non-simple types (array, pointer, reference).
3523 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3525 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3527 * class.cs (MethodCore.IsDuplicateImplementation): Special error
3529 (Method.CheckBase): Catch wrong destructor here.
3530 (MethodData.Define): Add errors 550, 668.
3532 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3534 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3536 * pending.cs (VerifyPendingMethods): Add error 551.
3538 * typemanager.cs (CSharpName): Next error report helper.
3540 2005-02-25 Marek Safar <marek.safar@seznam.cz>
3542 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3543 attributes. Removed useless attribute double check.
3544 It saves almost 2MBs for corlib.
3546 2005-02-25 Raja R Harinath <rharinath@novell.com>
3549 * statement.cs (ExpressionStatement.Resolve): Make robust to being
3550 called twice in case of error.
3552 2005-02-23 Chris Toshok <toshok@ximian.com>
3554 Fix compiler portions of #72827.
3555 * statement.cs (Block.Emit): call Begin/EndScope on the
3556 EmitContext instead of the ILGenerator.
3558 * codegen.cs (EmitContext.BeginScope): new method, call
3559 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3561 (EmitContext.BeginScope): same, but EndScope and CloseScope
3563 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3564 offset and call the superclass's OpenScope(int) with it.
3565 (SymbolWriter.CloseScope): get the current il
3566 offset and call superclass's CloseScope(int) with it.
3568 2005-02-23 Marek Safar <marek.safar@seznam.cz>
3570 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3571 CS1677 for out and ref as well.
3573 * class.cs (Method.Define): Add error CS1599 detection.
3575 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3577 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3579 * delegate.cs (Delegate.Define): Add error CS1599 detection.
3581 * support.cs.cs (ModifierDesc): New helper method.
3583 2005-02-23 Raja R Harinath <rharinath@novell.com>
3584 Abin Thomas <projectmonokochi@rediffmail.com>
3585 Anoob V E <projectmonokochi@rediffmail.com>
3586 Harilal P R <projectmonokochi@rediffmail.com>
3589 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3590 MemberLookup (used for error reporting) actually returns a result.
3591 Fix error report number (122, not 112).
3593 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
3594 Anoob V E <projectmonokochi@rediffmail.com>
3595 Harilal P R <projectmonokochi@rediffmail.com>
3598 * pending.cs (PendingImplementation.GetAbstractMethods):
3599 Find NonPublic members too.
3601 2005-02-22 Marek Safar <marek.safar@seznam.cz>
3603 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3606 * class.cs (MethodCore.CheckMethodAgainstBase):
3607 Add error 239 report.
3609 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3611 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3613 * class.cs (Operator.Define): Add error 217 report.
3615 2005-02-21 Raja R Harinath <rharinath@novell.com>
3618 * expression.cs (Invocation.IsApplicable): Make public.
3619 (Invocation.IsParamsMethodApplicable): Likewise.
3620 * delegate.cs (Delegate.VerifyApplicability): Don't use
3621 Invocation.VerifyArgumentCompat for parameter applicability
3622 testing. Use Invocation.IsApplicable and
3623 Invocation.IsParamsMethodApplicable.
3625 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3627 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3629 * class.cs (Operator.Define): Add error 217 report.
3631 2005-02-21 Raja R Harinath <rharinath@novell.com>
3633 * namespace.cs (UsingEntry.Resolve): Undo change below.
3635 2005-02-21 Raja R Harinath <rharinath@novell.com>
3638 * ecore.cs (Expression.MemberLookupFailed): Add argument to
3639 disable the error message when the extended MemberLookup also
3641 (Expression.MemberLookupFinal): Update.
3642 (SimpleName.DoSimpleNameResolve): Update.
3643 * expression.cs (MemberAccess.ResolveNamespaceOrType):
3644 Don't use MemberLookupFinal.
3645 (New.DoResolve): Update.
3646 (BaseAccess.CommonResolve): Update.
3648 2005-02-21 Raja R Harinath <rharinath@novell.com>
3651 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3652 occured previously, don't resolve again.
3654 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3657 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3658 argument. Call ResolveAttributeUsage for unresolved.
3659 when types doesn't match ctor arguments.
3661 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3662 for nested attribute classes.
3663 (Class.attribute_usage): Removed.
3664 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3665 for attribute class.
3667 * ecore.cs (IsAttribute): Removed.
3669 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3671 * rootcontext.cs (RegisterAttribute): Removed, attributes are
3673 (attribute_types): Removed.
3674 (EmitCode): Global attributes are emited as the latest.
3676 2005-02-18 Marek Safar <marek.safar@seznam.cz>
3678 * class.cs (EmitFieldInitializers): Don't emit field initializer
3679 for default values when optimilization is on.
3681 * constant.cs (Constant.IsDefaultValue): New property.
3683 * driver.cs: Add /optimize handling.
3687 * literal.cs: Implement new IsDefaultValue property.
3689 * rootcontext.cs (Optimize): New field, holds /optimize option.
3691 2005-02-18 Raja R Harinath <rharinath@novell.com>
3693 Fix crasher in re-opened #72347.
3694 * namespace.cs (Namespace.Lookup): Return null if
3695 DeclSpace.DefineType returns null.
3698 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3700 2005-02-18 Raja R Harinath <rharinath@novell.com>
3702 Fix remainder of #63202. Change semantics of DoResolveLValue: it
3703 now returns null if it cannot resolve to an lvalue.
3704 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3705 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3706 returned null. Remove check for SimpleName.
3707 (EventExpr.DoResolveLValue): New.
3708 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3709 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
3711 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
3713 (Unary.ResolveOperator): Move CS0211 check ...
3714 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
3716 (Unary.DoResolveLValue): Simplify.
3717 (AddressOf.DoResolveLValue): New.
3718 (ArrayAccess.DoResolveLValue): New.
3720 2005-02-16 Marek Safar <marek.safar@seznam.cz>
3722 * attribute.cs (Attribute.Resolve): Add arguments casting for
3723 when types doesn't match ctor arguments.
3725 2005-02-16 Raja R Harinath <rharinath@novell.com>
3727 Fix parts of #63202.
3728 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3729 lookup of operator in base type. Ensure that all checks happen
3730 when the operator resolves to an "op_..." method.
3732 2005-02-15 Raja R Harinath <rharinath@novell.com>
3735 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3736 'ignore_cs0104' parameter. Pass it to ...
3737 (NamespaceEntry.Lookup): ... this.
3738 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3739 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3740 (TypeLookupExpression.DoResolveAsTypeStep): Update.
3741 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3742 Update. Request that cs0104 errors be ignored.
3743 (ComposedCast.ResolveAsTypeStep): Update.
3745 2005-02-14 Raja R Harinath <rharinath@novell.com>
3748 * expression.cs (Invocation.BetterFunction): Remove support for
3749 comparing virtual functions and their overrides.
3750 (Invocation.IsOverride): New.
3751 (Invocation.OverloadResolve): Don't consider 'override' functions
3752 during candidate selection. Store them in a lookaside list.
3753 If the selected method is a 'virtual' function, use the list to
3754 find any overrides that are closer to the LHS type.
3756 2005-02-14 Marek Safar <marek.safar@seznam.cz>
3758 * expression.cs (New.DoResolve): Add complex core type reduction.
3759 (New.Constantify): Converts complex core type syntax like 'new int ()'
3762 2005-02-14 Raja R Harinath <rharinath@novell.com>
3764 * decl.cs (EntryType.EntryType): New constructor to create an
3765 updated copy of a cache entry.
3766 (MemberCache.AddMethods): Use it.
3767 (MemberCache.ClearDeclaredOnly): Remove.
3768 (MemberCache.MemberCache): Update.
3770 2005-02-11 Miguel de Icaza <miguel@novell.com>
3772 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3773 variable. This one is represents the actual low-level declaration
3774 of the method, as opposed to the semantic level `IsStatic'.
3776 An anonymous method which is hosted into a static method might be
3777 actually an instance method. IsStatic would reflect the
3778 container, while MethodIsStatic represents the actual code
3781 * expression.cs (ParameterReference): Use the new MethodIsStatic
3782 instead of IsStatic.
3784 * anonymous.cs (AnonymousMethod.Compatible): Pass the
3785 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3786 set on the current EmitContext.
3788 * expression.cs (Cast): Overload DoResolveLValue so we can pass
3789 resolve our casted expression as an LValue. This triggers the
3790 proper LValue processing that is later required by Assign.
3794 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3796 2005-02-11 Marek Safar <marek.safar@seznam.cz>
3798 C# 2.0 Fixed buffer implementation
3800 * anonymous.cs: Update after RegisterHelperClass renaming.
3802 * attribute.cs (AttributeTester.fixed_buffer_cache):
3803 Cache of external fixed buffers.
3804 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3805 implementation if field is fixed buffer else null.
3808 (TypeContainer.AddField): Accept FieldMember instead of Field.
3809 (FieldBase.IsFieldClsCompliant): Extracted code from
3810 VerifyClsCompliance descendant customization.
3811 (FixedField): New class handles fixed buffer fields.
3812 (FixedFieldExternal): Keeps information about imported fixed
3814 (IFixedField): Make access to internal or external fixed buffer
3817 * cs-parser.jay: Add fixed buffer parsing.
3819 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3822 * expression.cs (Indirection): Extended implementation to accept
3824 (PointerArithmetic.Emit): Get element from fixed buffer as well.
3825 (ElementAccess.MakePointerAccess): Get type as parameter.
3826 (DoResolve): Add fixed buffer field expression conversion.
3827 (DoResolveLValue): Ditto.
3828 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3829 (ArrayPtr): Derives from FixedBufferPtr.
3830 (ArrayPtr.Emit): Add extra emit for array elements.
3832 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3834 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3835 for compiler generated types.
3836 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3838 * statement.cs (Fixed): Refactored to be easier add fixed buffer
3839 and consume less memory.
3840 (Fixed.Resolve): Add fixed buffer case.
3842 * typemanager.cs (compiler_generated_attr_ctor,
3843 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3844 (HasElementType): Add our own implementation to work on every
3847 2005-02-11 Miguel de Icaza <miguel@novell.com>
3849 * anonymous.cs (CaptureContext): Track whether `this' has been
3852 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
3853 only captured `this' if it was implicitly done (instance
3854 methods/variables were used).
3856 * codegen.cs (EmitContext.CaptureThis): New method to flag that
3857 `this' must be captured.
3859 2005-01-30 Miguel de Icaza <miguel@novell.com>
3861 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3862 is null it means that there has been no need to capture anything,
3863 so we just create a sibling.
3865 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3867 Just a partial fix. The other half is fairly elusive.
3869 2005-02-10 Raja R Harinath <rharinath@novell.com>
3871 Fix #52586, cs0121-4.cs.
3872 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
3873 and return a hashtable.
3874 (MemberCache.ClearDeclaredOnly): New.
3875 (MemberCache.MemberCache): Update to change. Make a deep copy of
3876 the method_hash of a base type too.
3877 (MemberCache.AddMethods): Adapt to having a deep copy of the base
3878 type methods. Overwrite entries with the same MethodHandle so
3879 that the ReflectedType is correct. The process leaves in base
3880 virtual functions and their overrides as distinct entries.
3881 (CacheEntry): Now a class instead of a struct. It shouldn't alter
3882 matters since it was boxed in a ArrayList before.
3883 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3885 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
3886 case of a virtual function and its override (choose the overload
3888 (Invocation.OverloadResolve): Avoid 'override' members during
3889 'applicable_type' calculation.
3891 2005-03-28 Raja R Harinath <rharinath@novell.com>
3893 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3894 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3895 GetTypeHandle. It is possible for a reflected type to derive from
3896 a TypeBuilder (e.g., int[] derives from the TypeBuilder
3897 System.Array during mscorlib compilation).
3898 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3899 contain a method_hash, don't create one either. Don't create a
3900 deep copy of the base cache's method_hash.
3901 (MemberCache.SetupCache): Rename back from DeepCopy.
3902 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3903 already initialized. If we see an override function, add its
3904 underlying base virtual function to the member_hash too.
3906 2005-02-09 Raja R Harinath <rharinath@novell.com>
3908 Combine two near-redundant caches.
3909 * typemanager.cs (method_params): Rename from method_internal_params.
3910 (TypeManager.GetParameterData): New. Replace
3911 Invocation.GetParameterData.
3912 (TypeManager.LookupParametersByBuilder): Remove.
3913 * expression.cs (Invocation.method_parameter_cache): Remove.
3914 (Invocation.GetParameterData): Remove.
3916 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3919 2005-02-08 Raja R Harinath <rharinath@novell.com>
3922 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3923 TypeManager.multicast_delegate_type is null, resolve it by looking
3924 up "System.MulticastDelegate".
3925 * rootcontext.cs (RootContext.ResolveCore): Simplify.
3927 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
3928 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
3929 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
3932 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3933 (LabeledStatement.AddReference): New. Set 'referenced'.
3934 (Goto.Resolve): Use it.
3936 2005-02-05 John Luke <john.luke@gmail.com>
3938 * driver.cs: remove duplicate -doc line in Usage ()
3940 2005-02-04 Raja R Harinath <rharinath@novell.com>
3942 * location.cs (Location.AddFile): Fix CS2002 error report.
3944 2005-02-02 Martin Baulig <martin@ximian.com>
3946 * delegate.cs (Delegate.DefineType): Report an internal error if
3947 TypeManager.multicast_delegate_type is null. See bug #72015 for
3950 2005-02-02 Raja R Harinath <rharinath@novell.com>
3952 Fix a crasher in a variant of #31984.
3953 * const.cs (Constant.CheckBase): New override that defers the
3954 new-or-override check in case the base type hasn't been populated
3956 (Constant.Define): Ensure the new-or-override check is performed.
3958 2005-02-01 Duncan Mak <duncan@ximian.com>
3960 * const.cs (LookupConstantValue): Check that `ce' is not null
3961 before calling GetValue ().
3963 2005-02-01 Raja R Harinath <rharinath@novell.com>
3965 Fix test-334.cs (#69519).
3966 * cs-parser.jay (using_alias_directive): Pass in an expression to
3967 NamespaceEntry.UsingAlias.
3968 (using_namespace_directive): Pass in an expression to
3969 NamespaceEntry.Using.
3970 (namespace_name): Don't flatten to a string.
3971 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3972 (NamespaceEntry.AliasEntry.Resolve): Lookup using
3974 (NamespaceEntry.UsingEntry): Likewise.
3975 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3977 (NamespaceEntry.LookupForUsing): Remove.
3978 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3980 (NamespaceEntry.Lookup): Remove support for dotted names.
3982 2005-02-01 Raja R Harinath <rharinath@novell.com>
3984 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3986 (NamespaceEntry.ImplicitParent): Compute on demand.
3987 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3988 parallels the current.
3989 (NamespaceEntry.LookupForUsing): Use it.
3990 (NamespaceEntry.Lookup): If the current namespace-entry is
3991 implicit, don't search aliases and using tables.
3993 2005-02-01 Raja R Harinath <rharinath@novell.com>
3996 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3998 (TypeContainer.BaseCache): Compute on demand.
3999 (TypeContainer.FindMembers): Define constants and types if they're
4000 not already created.
4001 (FieldMember.Define): Move resetting of ec.InUnsafe before error
4003 * const.cs (Constant.Define): Make idempotent.
4005 2005-01-29 Miguel de Icaza <miguel@novell.com>
4007 * pending.cs: Produce better code (no nops produced by using Ldarg
4010 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4011 i - 1' it should be arg + 1.
4015 2005-01-28 Raja R Harinath <rharinath@novell.com>
4017 * attribute.cs (Attribute.CheckAttributeType): Make private
4019 (Attribute.ResolveType): Make virtual.
4020 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
4021 handling of RootContext.Tree.Types.
4023 2005-01-27 Raja R Harinath <rharinath@novell.com>
4025 Update attribute-handling to use the SimpleName/MemberAccess
4027 * cs-parser.jay (attribute): Pass in an expression to the
4028 constructors of Attribute and GlobalAttribute.
4029 * attribute.cs (Attribute): Take an expression for the name.
4030 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
4031 passed in attribute name expression.
4032 (Attribute.CheckAttributeType): Use it.
4033 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
4034 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
4035 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
4036 argument to prevent error messages if the lookup fails.
4038 2005-01-27 Marek Safar <marek.safar@seznam.cz>
4040 * expression.cs (Indirection): Implemented IVariable interface
4041 to support indirection in AddressOf operator.
4042 (PointerArithmetic.Emit): Add optimalization for case where
4043 result can be precomputed.
4045 2005-01-26 Martin Baulig <martin@ximian.com>
4047 * class.cs (TypeContainer.AttributeTargets): Return the correct
4048 AttributeTargets depending on our `Kind' instead of throwing an
4049 exception; fixes #71632.
4051 2005-01-26 Marek Safar <marek.safar@seznam.cz>
4054 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
4057 2005-03-17 Martin Baulig <martin@ximian.com>
4059 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4060 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4062 2005-03-17 Martin Baulig <martin@ximian.com>
4064 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4065 to bool so we can return an error condition.
4066 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4069 2005-03-17 Martin Baulig <martin@ximian.com>
4071 * generic.cs (TypeMananager.IsIEnumerable): New public method.
4073 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
4074 converting from an array-type of T to `IEnumerable<T>'.
4076 2005-03-16 Martin Baulig <martin@ximian.com>
4078 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
4079 (Nullable.LiftedUnaryMutator): New public class.
4081 * expression.cs (UnaryMutator.DoResolve): Added support for
4084 2005-03-14 Martin Baulig <martin@ximian.com>
4086 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
4088 2005-03-14 Martin Baulig <martin@ximian.com>
4090 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
4091 the comparision operators `<', `>', `<=' and `>='.
4093 2005-03-13 Martin Baulig <martin@ximian.com>
4096 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
4097 avoid confusion with the `NullLiteral'.
4098 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
4100 2005-03-13 Martin Baulig <martin@ximian.com>
4102 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
4103 comparing arbitrary types with the null literal.
4105 2005-03-13 Martin Baulig <martin@ximian.com>
4107 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
4108 boolean operators '&&', '||', '&' and '|'.
4109 (Nullable.OperatorTrueOrFalse): New public class.
4111 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
4112 instead of a `StaticCallExpr'; added support for nullables.
4114 2005-03-10 Martin Baulig <martin@ximian.com>
4117 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
4118 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
4120 2005-03-07 Martin Baulig <martin@ximian.com>
4122 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
4123 it work if `expr' is not an IMemoryLocation.
4124 (Nullable.Lifted): Implement IMemoryLocation.
4125 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
4128 2005-03-05 Martin Baulig <martin@ximian.com>
4130 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
4131 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
4132 (Nullable): Added support for lifted unary and binary operators.
4134 * expression.cs (Unary.DoResolve): Added support for nullable types.
4135 (Binary.DoResolve): Likewise.
4136 (Conditional.DoResolve): Likewise.
4138 2005-03-02 Martin Baulig <martin@ximian.com>
4140 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
4142 * class.cs (ClassPart.SetParameterInfo): Override this.
4143 (PartialContainer.SetParameterInfo): Override this.
4144 (TypeContainer.CheckConstraints): New protected method.
4145 (PartialContainer.CheckConstraints): Override this and check
4146 whether the same contraints were specified in all parts of a
4147 partial generic type definition.
4148 (PartialContainer.UpdateConstraints): New public method.
4150 * generic.cs (TypeParameter.UpdateConstraints): New public method.
4152 2005-03-02 Martin Baulig <martin@ximian.com>
4154 Committing a patch from Carlos Alberto Cortez to fix #72887.
4156 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
4157 casts from `T []' to `int []'.
4159 2005-03-02 Martin Baulig <martin@ximian.com>
4161 * generic.cs (TypeManager.IsEqual): Make this symmetric.
4163 * expression.cs (Binary.ResolveOperator): When resolving a
4164 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
4165 `=='. Fixes #71866. See gen-127.cs.
4167 2005-03-02 Martin Baulig <martin@ximian.com>
4169 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4170 static constructor in static classes.
4172 2005-03-02 Martin Baulig <martin@ximian.com>
4175 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
4176 (Nullable.LiftedConversion): Added support for user-defined
4179 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
4181 * cs-parser.jay: Use ComposedCast everywhere instead of
4182 NullableType, so we don't need to check for NullableType
4184 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
4185 case where we'll be resolved into a `parenthesized_expression_0'
4189 (Convert.UserDefinedConversion): Added nullable conversions.
4191 2005-02-28 Martin Baulig <martin@ximian.com>
4193 * generic.cs (TypeManager.IsNullableType): New static method.
4194 (Nullable): New abstract class.
4195 (Nullable.NullLiteral): New public class.
4196 (Nullable.LiftedConversion): New public class.
4198 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
4199 `builtin_types opt_nullable'.
4202 (Convert.ImplicitConversionStandard): Added nullable conversions.
4203 (Convert.ExplicitConversionStandard): Likewise.
4204 (Convert.ExplicitConversion): Likewise.
4206 2005-02-26 Martin Baulig <martin@ximian.com>
4208 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
4209 begin with a "?", for instance "?[]". Don't do a type lookup if
4212 2005-02-25 Martin Baulig <martin@ximian.com>
4214 The first part of Nullable Types :-)
4216 * generic.cs (NullableType): New public class.
4217 (NullCoalescingOperator): New public class.
4218 (TypeArguments.Resolve): Add a CS0306 check.
4220 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
4221 (opt_nullable): New rule.
4222 (type): Added `opt_nullable' to `namespace_or_type_name',
4223 `builtin_types' and `pointer_type'.
4224 (array_type): Added `opt_nullable'.
4225 (opt_rank_specifier_or_nullable): New rule; this is the
4226 combination of `opt_rank_specifier' and `opt_nullable'.
4227 (opt_error): New rule; catch errors here.
4228 (nullable_type_or_conditional): New rule; we use this to check for
4229 nullable and still detect the conditional operator.
4230 (local_variable_type): Use `opt_rank_specifier_or_nullable'
4231 instead `opt_rank_specifier'.
4233 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
4236 2005-02-24 Martin Baulig <martin@ximian.com>
4238 * README, README.Changes: Removed; they're old and obsolete.
4240 2005-02-22 Martin Baulig <martin@ximian.com>
4242 * generic.cs (TypeParameter.Resolve): If resolving the constraints
4243 returned an error, set `constraints' to null to avoid a crash
4245 (TypeParameter.ResolveType): Likewise.
4247 2005-02-22 Martin Baulig <martin@ximian.com>
4250 (Constraints.ResolveTypes): Protect against being called twice.
4251 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
4252 (TypeParameter.ResolveType): New public method; calls
4253 constraints.ResolveTypes().
4254 (TypeParameter.DefineType): Moved constraints.ResolveType() out
4255 into the new ResolveType().
4256 (GenericMethod.Define): Call ResolveType() on all our
4259 2005-02-21 Martin Baulig <martin@ximian.com>
4262 (TypeManager.generic_nullable_type): New static public field.
4263 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
4266 (RootContext.ResolveCore): Resolve "System.Nullable`1".
4268 2005-02-15 Martin Baulig <martin@ximian.com>
4270 * generic.cs (ConstructedType.Constraints): Correctly check
4271 constraints if the argument type is a type parameter; fixes
4274 2005-02-02 Martin Baulig <martin@ximian.com>
4276 * delegate.cs (Delegate.DefineType): Report an internal error if
4277 TypeManager.multicast_delegate_type is null. See bug #72015 for
4280 2005-01-29 Miguel de Icaza <miguel@novell.com>
4282 * pending.cs: Produce better code (no nops produced by using Ldarg
4285 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4286 i - 1' it should be arg + 1.
4290 2005-01-26 Martin Baulig <martin@ximian.com>
4292 * cs-parser.jay (indexer_declarator): Don't report an error if we
4293 have type parameters since we can be an explicit interface
4294 implementation; fixes #71449.
4296 2005-01-26 Martin Baulig <martin@ximian.com>
4298 * class.cs (TypeContainer.AttributeTargets): Return the correct
4299 AttributeTargets depending on our `Kind' instead of throwing an
4300 exception; fixes #71632.
4302 2005-01-26 Martin Baulig <martin@ximian.com>
4304 * delegate.cs (Delegate.DefineType): Correctly define our type
4305 parameters. Fixes #71483.
4307 2005-01-25 Raja R Harinath <rharinath@novell.com>
4310 * expression.cs (MemberAccess.DoResolve): Don't complain with
4311 cs0572 when the LHS of a member access has identical name and type
4314 2005-01-25 Marek Safar <marek.safar@seznam.cz>
4317 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
4319 Create custom PermissionSet only for PermissionSetAttribute.
4321 2005-01-24 Marek Safar <marek.safar@seznam.cz>
4324 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
4325 delegates in static class.
4327 2005-01-24 Martin Baulig <martin@ximian.com>
4329 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4330 merging an implicit block, just use its reachability.
4332 * statement.cs (Block.Resolve): Make the unreachable code check
4333 work wrt. implicit blocks; see test-337 from #63842.
4335 2005-01-21 Alp Toker <alp@atoker.com>
4337 * cs-parser.jay: destructor_declaration's container is PartialContainer
4338 not Class when partial types are used, so use Kind prop instead of
4341 2005-01-22 Miguel de Icaza <miguel@ximian.com>
4343 * cs-parser.jay: Improve error reporting when an interface
4346 2005-01-20 Dick Porter <dick@ximian.com>
4348 * support.cs: SeekableStreamReader fix from Sandor Dobos
4349 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
4350 chars are read. Fixes bug 70369.
4352 2005-01-20 Raja R Harinath <rharinath@novell.com>
4354 * cs-parser.jay (catch_clause): Simplify current_block handling
4357 2005-01-17 Miguel de Icaza <miguel@ximian.com>
4359 * convert.cs (ImplicitStandardConversionExists): Synchronize the
4360 code with ImplicitStandardConversion to handle the implicit
4361 conversion of method groups into valid delegate invocations.
4363 The problem is that in parameter handling we were using this code
4364 path. Fixes bug #64698
4366 2005-01-19 Raja R Harinath <rharinath@novell.com>
4368 * cs-parser.jay: Fix several infelicities.
4369 - Avoid assigning to the parser value stack. Code like
4370 '$3 = null' is unclean. Synthesize a value for the code block
4372 - Avoid using oob_stack for storing location information. Use ...
4373 (_mark_): ... this. New (empty) rule. Saves the current location
4375 (foreach_statement): Avoid using oob_stack for current_block
4376 handling. Use technique used in for_statement and
4377 using_statement. Synthesize a value for the code block to store
4378 additional intermediate information.
4380 2005-01-13 Miguel de Icaza <miguel@ximian.com>
4382 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
4383 of a different type is only allowed to private fields of a
4384 containing type, not on fields of a base class.
4386 See test-174.cs and error cs0122-9.cs
4388 2005-01-13 Raja R Harinath <rharinath@novell.com>
4390 Fix test-335.cs (bug #58126).
4391 * cs-parser.jay (argument): Split out non-expression parts of the
4392 rule into 'non_simple_argument'.
4393 (invocation_expression): Support parenthesized invocations with
4394 multiple arguments, and with single non-simple arguments.
4396 2005-01-13 Raja R Harinath <rharinath@novell.com>
4398 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
4401 2005-01-12 Raja R Harinath <rharinath@novell.com>
4403 Fix cs0038-1.cs, cs1640-6.cs.
4404 * ecore.cs (Expression.Resolve): Remove special-case for
4405 SimpleName in error-handling.
4406 (Expression.almostMatchedMembers): Relax access permission to
4408 (Expression.MemberLookupFailed): Handle duplicates in
4409 almostMatchedMembers list.
4410 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
4411 * expression.cs (New.DoResolve): Report CS1540 for more cases.
4412 * typemanager.cs (GetFullNameSignature): Use the MethodBase
4413 overload if the passed in MemberInfo is a MethodBase.
4415 2005-01-25 Martin Baulig <martin@ximian.com>
4418 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
4420 2005-01-12 Marek Safar <marek.safar@seznam.cz>
4423 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
4424 for non-CAS & merge permission sets properly.
4426 2005-01-11 Raja R Harinath <rharinath@novell.com>
4428 Improve standard-compliance of simple name and member access
4429 resolution. Fixes bugs #52697, #57200, #67520, #69519.
4430 * ecore.cs (FullNamedExpression): New abstract base class
4431 for Namespaces and TypeExpressions.
4432 (ResolveFlags.SimpleName): Remove.
4433 (SimpleName): Remove support for dotted names.
4434 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
4435 DeclSpace.FindType and DeclSpace.LookupType.
4436 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
4437 (Expression.ExprClassName): Make member function.
4438 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
4439 a namespace. Remove creation of dotted "SimpleName"s.
4440 (MemberAccess.DoResolve): Likewise.
4441 * decl.cs (DeclSpace.Cache): Make private.
4442 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
4443 (DeclSpace.FindType): Update.
4444 (DeclSpace.LookupType): Move here from RootContext. Return a
4445 FullNamedExpression.
4446 * namespace.cs (Namespace): Derive from FullNamedExpression
4447 so that it can be part of expression resolution.
4448 (Namespace.Lookup): Return an FullNamedExpression.
4449 (NamespaceEntry.LookupAlias): Lookup aliases only in current
4451 * rootcontext.cs (NamespaceLookup): Remove.
4452 (LookupType): Move to DeclSpace.
4453 * attribute.cs (CheckAttributeType): Update.
4454 * doc.cs (FindDocumentedType): Remove allowAlias argument.
4455 (FindDocumentedTypeNonArray): Likewise.
4457 2005-01-11 Raja R Harinath <rharinath@novell.com>
4459 Fix cs0509.cs, cs1632.cs.
4460 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
4461 is the same as IsInterface.
4462 (TypeContainer.GetClassBases): Likewise.
4463 * statement.cs (LabeledStatement.ig): New field.
4464 (LabeledStatement.LabelTarget): Save ILGenerator which created the
4466 (LabeledStatement.DoEmit): Check that the label was created with
4467 the same ILGenerator.
4469 2005-01-10 Marek Safar <marek.safar@seznam.cz>
4472 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
4473 accessors to its properties.
4475 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
4476 from accessors to property.
4478 2005-01-10 Marek Safar <marek.safar@seznam.cz>
4481 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
4484 2005-01-08 Miguel de Icaza <miguel@ximian.com>
4486 * attribute.cs: Check for null and empty strings.
4488 I have lost another battle to Paolo.
4490 2005-01-07 Marek Safar <marek.safar@seznam.cz>
4493 * class.cs (PropertyMethod): Set Parent field in ctors.
4494 (SetMethod.InternalParameters): Add unsafe switch hack.
4495 Override MarkForDuplicationCheck where it is appropriate.
4497 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
4498 It says whether container allows members with the same name.
4500 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
4501 Removed is_method parameter.
4503 2005-01-06 Duncan Mak <duncan@ximian.com>
4505 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
4506 because the previous change led to incorrect reporting of CS1032
4507 ("Cannot define/undefine preprocessor symbols after first token in
4508 file"). Instead of using `tokens_seen' as the only flag that
4509 triggers CS1040, introduce `comments_seen'. This new flag is used
4510 to signify having seen comments on the current line, so it is
4511 unset after a newline.
4513 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
4515 * doc.cs : When searching for a type, find nested type too.
4516 This fixes bug #71040.
4518 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
4521 - Warn missing member comment on those classes which also does not
4522 have doc comments. Fixed bug #71041.
4523 - Don't warn missing doc comment on default constructor.
4526 2005-01-06 Duncan Mak <duncan@ximian.com>
4528 * cs-tokenizer.cs (xtoken): After handling traditional C-style
4529 comments, set `tokens_seen' to true. This allows us to detect
4530 misplaced preprocessor directives (i.e. not at the beginning of
4531 the a line, nor after whitespaces). In that case, report error
4532 CS1040. This fixes bug #56460.
4534 * cs-parser.jay (interface_member_declaration): Add checks for
4535 IsExplicitImpl, and report CS0541 error if an interface member is
4536 defined as an explicit interface declaration.
4538 2005-01-06 Marek Safar <marek.safar@seznam.cz>
4541 * class.cs (PropertyMethod): Set Parent field in ctors.
4542 (SetMethod.InternalParameters): Add unsafe switch hack.
4544 * decl.cs (MemberCore.Parent): Cannot be readonly.
4546 2005-01-06 Raja R Harinath <rharinath@novell.com>
4548 * decl.cs (DeclSpace.ResolveType): Remove.
4549 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4550 Merge in code from ...
4551 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
4552 * class.cs, enum.cs: Update to changes.
4554 2005-01-06 Miguel de Icaza <miguel@ximian.com>
4556 * anonymous.cs: Ensure that we init the scope of our parent if it
4557 has not been initialized yet.
4559 2004-12-30 Duncan Mak <duncan@ximian.com>
4561 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
4562 if field.FieldBuilder is null. Fixes #70758.
4564 * convert.cs: Fixed some typos and updated some of the comments.
4565 (ImplicitStandardConversionExists):
4566 (TryImplicitIntConversion): If `target_type' is an interface and
4567 the type of `ic' implements this interface, return true or a new
4568 BoxedCast instead of null. This fixes #70468.
4570 2004-12-29 Duncan Mak <duncan@ximian.com>
4572 * expression.cs (Argument.Emit): Check that Expr is
4573 IMemoryLocation before casting to it, and report CS1510 otherwise.
4577 2004-12-21 Ben Maurer <bmaurer@ximian.com>
4579 * statement.cs (Block.ThisVariable): remove the recursion here, to
4580 make the --profile more sane.
4582 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
4584 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4585 assembly, by JB Evain.
4587 2004-12-17 Raja R Harinath <rharinath@novell.com>
4589 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
4590 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4591 "parent" refers to enclosing type/class. "base" refers to superclass.
4593 2004-12-17 Raja R Harinath <rharinath@novell.com>
4595 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4596 Ensure that we only have GlobalAttributes.
4597 * attribute.cs (Attribute.Emit): Make non-virtual.
4598 (GlobalAttribute.Emit): Remove.
4599 (Attribute.Resolve): Make virtual.
4600 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
4601 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4602 the argument. Don't create one.
4603 (Attribute.GetObsoleteAttribute): Likewise.
4604 (Attribute.GetClsCompliantAttributeValue): Likewise.
4605 * class.cs, decl.cs: Update to changes.
4607 2004-12-17 Marek Safar <marek.safar@seznam.cz>
4609 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4611 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4613 * statement.cs (Foreach.Resolve): Add error 186 report.
4615 2004-12-16 Marek Safar <marek.safar@seznam.cz>
4617 * expression.cs (Conditional.DoResolve): Add warning 429.
4619 * statement.cs (If.Resolve): Add warning 665.
4621 2004-12-16 Raja R Harinath <rharinath@novell.com>
4623 New invariant: RootContext.Tree.Types.NamespaceEntry == null
4624 except when in the parser, and in GlobalAttribute.
4625 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4626 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4627 RootContext.Tree.Types.NamespaceEntry once work is done.
4628 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
4629 and resets RootContext.Tree.Types.NamespaceEntry.
4631 2004-12-15 Marek Safar <marek.safar@seznam.cz>
4633 * cs-parser.jay: Don't create a block for every variable.
4635 2004-12-14 Miguel de Icaza <miguel@ximian.com>
4637 * location.cs: Provide extra information.
4639 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4640 variables from the captured environment, it is the ldarg_0.
4642 2004-12-14 Marek Safar <marek.safar@seznam.cz>
4644 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4647 * class.cs: Changed warning level for 169 to avoid developer
4648 displeasure from warning flooding. It will be changed back when they
4649 fix most of current BCL warnings.
4651 * RootContext.cs: Pushed default WarningLevel to 3.
4653 * statement.cs: Removed unused variable.
4655 2004-12-14 Marek Safar <marek.safar@seznam.cz>
4657 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4658 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4659 Add error 502 report.
4660 (StaticClass.DefineType): Add error 441 report.
4661 (Class.AllowedModifiersProp): New virtual property as temporary
4662 extension to AllowedModifiers.
4663 (Class.DefineType): Add error 418 report. Moved ModFlags check here
4664 to share implementation with StaticClass and don't call virtual
4667 * driver.cs (MainDriver): Add error 1558 test.
4669 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4670 report. Moved error 36 test here.
4672 * statement.cs (Throw.Resolve): Add error 724 report.
4674 * typemanager.cs: Add out_attribute_type core type.
4676 2004-12-13 Marek Safar <marek.safar@seznam.cz>
4678 * class.cs (TypeContainer.VerifyClsCompliance): Add error
4680 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4682 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4685 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4687 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
4688 Add error 3023 report.
4689 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4691 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4694 2004-12-12 John Luke <john.luke@gmail.com>
4696 * driver.cs (AddArgs): take -- into account when
4697 adding arguments, fixes bug 65710
4699 2004-12-12 Martin Baulig <martin@ximian.com>
4701 * expression.cs (Unary.TryReduceNegative): Added support for
4702 SByteConstant and ByteConstant.
4703 (Unary.Reduce): Check error values from TryReduceNegative().
4705 2004-12-10 Marek Safar <marek.safar@seznam.cz>
4707 * attributes.cs (Attribute.Resolve): Avoid multiple error report
4708 and report exception as error 182.
4710 2004-12-10 Raja R Harinath <rharinath@novell.com>
4712 * driver.cs (Main): Fix message when there are warnings.
4714 2004-12-09 Miguel de Icaza <miguel@ximian.com>
4716 * delegate.cs: Fixed my fix from yesterday, sorry about that.
4718 2004-12-09 Marek Safar <marek.safar@seznam.cz>
4720 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
4721 Reduced number of warnings.
4723 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4725 2004-12-08 Miguel de Icaza <miguel@ximian.com>
4727 * driver.cs: Removed message.
4729 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4731 2004-12-08 <vargaz@freemail.hu>
4733 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4735 2004-12-08 Martin Baulig <martin@ximian.com>
4737 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4738 instead of a CS3002 for properties and indexer.
4740 2004-12-08 Martin Baulig <martin@ximian.com>
4742 * decl.cs (MemberName.ToString): Make this work again.
4744 2004-12-08 Marek Safar <marek.safar@seznam.cz>
4746 * attribute.cs (Resolve): Add error 591 detection.
4748 * class.cs (FieldMember.Define): Add error 1547 detection.
4749 (Indexer.Define): Add error 620 detection.
4750 (Operator.Define): Add error 590 detection.
4752 * ecore.cs: Missing argument for error 79.
4754 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4757 2004-12-07 Marek Safar <marek.safar@seznam.cz>
4760 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4763 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4765 * cs-parser.jay : handle doc comments on implicit/explicit operators.
4766 Some operator comments were suppressed.
4767 * doc.cs : Implicit/explicit operator name in doc comments are like
4768 "op_Explicit(type)~returnType", so added suffix handling.
4770 2005-01-21 Alp Toker <alp@atoker.com>
4772 * cs-parser.jay: destructor_declaration's container is PartialContainer
4773 not Class when partial types are used, so use Kind prop instead of 'is'.
4775 2004-12-12 Martin Baulig <martin@ximian.com>
4777 * expression.cs (Unary.TryReduceNegative): Added support for
4778 SByteConstant and ByteConstant.
4779 (Unary.Reduce): Check error values from TryReduceNegative().
4781 2004-12-11 Martin Baulig <martin@ximian.com>
4783 * support.cs (ReflectionParameters.ParameterName): If we have a
4784 `gpd', call `ParameterName' on it.
4786 * parameter.cs (Parameter.GetParameterAttributes): New static method.
4788 * pending.cs (PendingImplementation.DefineProxy): Call
4789 DefineParameter() for all of the MethodBuilder's arguments.
4791 2004-12-09 Martin Baulig <martin@ximian.com>
4793 * doc.cs (DocUtil): Make this a static class.
4795 2004-12-09 Martin Baulig <martin@ximian.com>
4797 * expression.cs (Invocation.InferType): Moved the type inference
4798 implementation into TypeManager.
4800 * generics.cs (TypeManager): Moved the type inference
4801 implementation here.
4803 2004-12-09 Martin Baulig <martin@ximian.com>
4805 * typemanager.cs (TypeManager): Make this a partial class.
4808 (TypeManager): Move the generics part of `TypeManager' here.
4810 2004-12-08 Martin Baulig <martin@ximian.com>
4812 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4813 instead of a CS3002 for properties and indexer. Added CS3024
4814 check for generic interfaces.
4816 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
4817 instances are not CLS-compliant.
4819 2004-12-08 Martin Baulig <martin@ximian.com>
4822 (void_pointer_expression): New rule for `void*', `void**' etc.
4823 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
4825 2004-12-08 Martin Baulig <martin@ximian.com>
4827 * expression.cs (Invocation.InferType): Removed the hack for
4828 MethodCore.MayUnify().
4830 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4833 * class.cs (MethodCore.MayUnify): Use
4834 TypeManager.MayBecomeEqualGenericTypes().
4836 2004-12-08 Martin Baulig <martin@ximian.com>
4838 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
4839 parameter, box it. Fixes #69233.
4841 2004-12-08 Martin Baulig <martin@ximian.com>
4843 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
4844 have the ctor constraint. Fixes #68326.
4846 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4848 * cs-parser.jay : interface comment was not consumed because of
4849 extra opt_semicolon before doc handling.
4851 2004-12-03 Raja R Harinath <rharinath@novell.com>
4853 Fix test-327.cs, test-328.cs, and put in early infrastructure
4854 for eventually fixing #52697.
4855 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4856 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4858 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4859 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4860 (VerifyUsing, error246): Update.
4861 * rootcontext.cs (RootContext.NamespaceLookup): Just use
4862 'NamespaceEntry.LookupNamespaceOrType'.
4864 2004-12-07 Martin Baulig <martin@ximian.com>
4866 * driver.cs: Call it "BETA SOFTWARE" :-)
4868 2004-12-06 Raja R Harinath <rharinath@novell.com>
4870 Fix crash on cs0657-17.cs.
4871 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4872 Use RootContext.Tree.Types, not 'new RootTypes ()'.
4873 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4874 the case where the NamespaceEntry gets overwritten.
4876 2004-12-06 Marek Safar <marek.safar@seznam.cz>
4878 Fixed #69195, #56821
4879 * ecore.cs (ResolveBoolean): Tiny refactoring.
4881 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4882 of right expression resolving when left is false constant and
4883 operator is LogicalAnd OR true constant and operator is LogicalOr.
4885 * statement.cs (ResolveUnreachable): Always reports warning.
4887 2004-12-05 Miguel de Icaza <miguel@ximian.com>
4889 * class.cs: Distinguish between 1721 and 1722 (just a little help
4890 for the programmer).
4892 2004-12-03 Miguel de Icaza <miguel@ximian.com>
4894 * delegate.cs: Only allow this on new versions of the language.
4896 2004-12-02 Duncan Mak <duncan@ximian.com>
4898 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4900 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4901 here as a static method. Take an additional bool out parameter
4902 `must_do_cs1540_check' for signaling to InstanceResolve.
4903 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4904 member field from PropertyExpr class and made it an argument of
4906 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4907 check for MarshalByRefObject, and report CS0122 instead of CS1540.
4908 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4909 and `remove_accessor' as well as InstanceResolve: report CS0122
4914 2004-12-07 Martin Baulig <martin@ximian.com>
4916 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
4917 and CS0692 where appropriate.
4919 2004-12-06 Martin Baulig <martin@ximian.com>
4921 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
4922 IsDuplicateImplementation() and improved it.
4924 * expression.cs (Invocation.InferTypeArguments): Added
4925 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
4926 and removed the "ref" modifier from `infered_types'.
4928 * decl.cs (MemberName.ToString): Removed the exception.
4930 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
4932 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4933 comments are allowed.
4935 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4937 * delegate.cs: Add checks for subtypes in paramaters and return values
4938 in VerifyMethod () to add support for Covariance/Contravariance
4941 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4943 * report.cs: Remove extra closing parenthesis.
4945 * convert.cs (Error_CannotImplicitConversion): If the name of the
4946 types are the same, provide some extra information.
4948 2004-12-02 Marek Safar <marek.safar@seznam.cz>
4951 * attribute.cs (Resolve): Improved implementation of params
4952 attribute arguments.
4954 * support.cs (ParameterData): Add HasParams to be faster.
4956 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
4958 all things are for /doc support:
4960 * doc.cs: new file that supports XML documentation generation.
4961 * mcs.exe.sources: added doc.cs.
4963 Handle /doc command line option.
4964 Report error 2006 instead of 5 for missing file name for /doc.
4965 Generate XML documentation when required, after type resolution.
4967 Added support for picking up documentation (/// and /** ... */),
4968 including a new XmlCommentState enumeration.
4970 Added lines to fill Documentation element for field, constant,
4971 property, indexer, method, constructor, destructor, operator, event
4972 and class, struct, interface, delegate, enum.
4973 Added lines to warn incorrect comment.
4975 Added Documentation field (passed only when /doc was specified).
4977 Added DocComment, DocCommentHeader, GenerateDocComment() and
4978 OnGenerateDocComment() and some supporting private members for
4979 /doc feature to MemberCore.
4981 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4983 Added overriden DocCommentHeader.
4985 Added overriden DocCommentHeader and GenerateDocComment().
4987 2004-12-01 Miguel de Icaza <miguel@ximian.com>
4989 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4990 unwrapping the enumeration values, chain to
4991 DoConstantNumericPromotions again, so we can promote things to the
4992 fundamental types (takes care of enums that are bytes, sbytes).
4996 2004-12-01 Raja R Harinath <rharinath@novell.com>
4998 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4999 Fix long-standing bug in type-lookup. Use FindType instead of
5000 LookupType when ec.ResolvingTypeTree.
5001 (Attribute.ResolveType, Attribute.Resolve)
5002 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5004 (Attributes.Search): Remove internal version. Update.
5005 (Attributes.SearchMulti): Update.
5006 (Attributes.GetClsCompliantAttribute): Remove.
5007 (Attributes.GetIndexerNameAttribute): Remove.
5008 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5009 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5010 * class.cs (Indexer.Define): Likewise.
5012 2004-12-01 Marek Safar <marek.safar@seznam.cz>
5015 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5016 MarshallByReference members access.
5018 * expression.cs: Use CheckMarshallByRefAccess;
5019 Better error CS0197 message.
5021 * report.cs: Print whole related error message.
5023 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5025 * class (GetClassBases): Better error 60 report.
5026 (EventProperty): Disabled warning 67 detection.
5028 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5031 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5033 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5036 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5039 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5041 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5043 2004-11-26 Miguel de Icaza <miguel@ximian.com>
5045 * attribute.cs (Attribute.Resolve): Refine error reporting and
5046 report a cs0117 if the identifier does not exist, to distinguish
5047 from 0617 which is a miss-use of the actual identifier.
5049 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5050 between cs0070 and cs0079.
5052 * class.cs (MemberBase.DoDefine): When reporting a wrong
5053 accessibility level, we use MethodCore to compare instead of
5054 Method (this was a regression in some refactoring effort).
5056 So now we correctly report cs0056 again.
5058 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5059 testing the target_type (which was known to be object_type) and
5060 not the source type (which is anonymous_method).
5062 Fixed reporting of error cs1660.
5064 * expression.cs (UserCast.Source): Expose the underlying cast.
5066 * statement.cs (Switch.SwitchGoverningType): Sort the list of
5067 allowed types to find a match to int32 first (most common).
5069 In addition, it ignores any ImplicitUserConversions that did an
5070 internal implicit conversion (as the switch statement allows only
5071 one integral conversion to exist).
5073 * class.cs (PartialContainer.Create): rename `name' to
5074 `member_name' for clarity. Then replace the string calls with a
5075 call to MemberName.GetPartialName, as now using
5076 MemberName.ToString is an error (this is due to the side effects
5077 it had, that were fixed in the past).
5079 This will restore the error reporting on a number of partial class
5080 errors that were missusing this (and getting an exception as a
5081 results, which is now just a plain textual warning, because
5082 yyparse debug output would crash otherwise).
5084 2004-11-26 Raja R Harinath <rharinath@novell.com>
5086 * Makefile (PROGRAM_INSTALL_DIR): Remove.
5088 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5090 * rootcontext.cs (LookupType): Make sure to cache lookups that
5091 don't give us a negative result. This saves about 5% of corlib
5094 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5096 * report.cs (AbstractMessage.Print): messages are sent to stderr
5098 * class.cs (TypeContainer.GetClassBases): It is an error to have a
5099 non-interface in the list of interfaces (at this point, either
5100 parent was properly set, or a base class is being listed in the
5101 interfaces section).
5103 This flags error 1722, and resolves the crash from bug 69259.
5105 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5107 * statement.cs (Using.EmitExpressionFinally): make this work right
5108 for valuetypes. Fixes 69926.
5110 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5112 * const.cs (Const.ChangeType): Cope with the "0 literal can be
5113 converted to an enum" here, before we try to change the underlying
5114 type. This code exists, but it is a different code path than the
5115 one used while encoding constants.
5117 (ImplicitReferenceConversionExists): In addition, resynchronized
5118 the code here, so it matches the same code in
5119 ImplicitReferenceConversionExists for the `from any class-type S
5120 to any interface-type T'.
5122 2004-11-25 Marek Safar <marek.safar@seznam.cz>
5124 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5126 2004-11-24 Miguel de Icaza <miguel@ximian.com>
5128 * cs-parser.jay: Use verbosity accordingly.
5130 2004-11-24 Marek Safar <marek.safar@seznam.cz>
5132 * expression.cs (Unary.ResolveOperator): Do not report warning;
5133 AddressOf reads from variable.
5135 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5137 2004-11-24 Marek Safar <marek.safar@seznam.cz>
5141 * attribute.cs (Attributable): Removed CheckTargets.
5142 (Attributes.Emit): Explicit attribute targets are tested here.
5144 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
5145 not enabled for interfaces.
5147 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
5148 (GetAssemblyName): Ouch next bug there.
5150 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5152 * expression.cs: Error 275 added.
5154 2004-11-23 Marek Safar <marek.safar@seznam.cz>
5156 Fix bug #69177 (Implemented decimal constant support)
5158 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
5159 (BinaryFold): Add DecimalConstant.
5161 * const.cs (Define): Decimal constant
5163 (ChangeType): Add decimal type handling.
5164 (LookupConstantValue): Don't set value for decimal type but
5165 emit DecimalConstantAttribute. Needed for constant optimization.
5167 * constant.cs (ToDecimal): New method.
5168 (ConvertToDecimal): New method.
5169 (IntConstant): Implemented ConvertToDecimal.
5170 (DecimalConstant.Emit): Emit optimized version for decimals in
5173 * expression.cs (ResolveOperator): Changed order of constant
5174 reduction to work correctly with native types which have
5175 overloaded operators.
5176 (ResolveMemberAccess): Extract constant value from attribute
5179 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
5181 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
5182 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
5183 (ChangeType): Decimal is special.
5184 (TypeToCoreType): Add decimal type.
5186 2004-11-22 Marek Safar <marek.safar@seznam.cz>
5188 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
5191 2004-11-22 Marek Safar <marek.safar@seznam.cz>
5193 * class.cs (EventField.ApplyAttributeBuilder): Fix error
5196 2004-11-19 Marek Safar <marek.safar@seznam.cz>
5198 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
5200 * pending.cs (PendingImplementation): Grab only interfaces.
5202 2004-11-19 Marek Safar <marek.safar@seznam.cz>
5204 * statement.cs (ForeachHelperMethods): Add location member and
5205 error 202 detection.
5207 2004-11-18 Marek Safar <marek.safar@seznam.cz>
5209 * expression.cs (DoResolveBase): Fixed wrong warning for out
5212 2004-12-04 Martin Baulig <martin@ximian.com>
5214 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
5215 to check whether the conversion is ok.
5217 * typemanager.cs (TypeManager.GetTypeArguments): Just return
5218 `Type.EmptyTypes' if we're not a generic TypeContainer.
5220 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5222 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
5223 old bug: when converting from the null literal to a pointer,
5224 return an EmptyCast, not the NullLiteral.
5226 This fixes #69921, the recent null_type changes probably made this
5229 2004-12-03 Martin Baulig <martin@ximian.com>
5231 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5232 method as our child, call AnonymousMethod.Compatible() on it.
5234 2004-12-02 Miguel de Icaza <miguel@ximian.com>
5236 * class.cs (FieldBase): Use an unused bit field from the field to
5237 encode the `has_offset' property from the FieldMember. This saves
5238 a couple of Ks on bootstrap compilation.
5240 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5241 method as our child, return the AnonymousMethod resolved
5244 * expression.cs (New.DoResolve): Allow return values from
5245 NewDelegate to also include AnonymousMethods.
5249 2004-11-29 Raja R Harinath <rharinath@novell.com>
5251 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
5253 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
5254 System.Runtime.InteropServices._Exception, since it's a base
5255 interface of the core type System.Exception in the net_2_0 profile.
5257 2004-11-27 Martin Baulig <martin@ximian.com>
5259 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
5261 2004-11-26 Raja R Harinath <rharinath@novell.com>
5263 * Makefile: Convert to use executable.make.
5264 * gmcs.exe.sources: New.
5266 2004-11-25 Martin Baulig <martin@ximian.com>
5268 * expression.cs (Invocation.InferType): Added support for byref types.
5270 2004-11-25 Martin Baulig <martin@ximian.com>
5272 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
5273 in TypeManager.TypeToCoreType().
5275 2004-11-25 Martin Baulig <martin@ximian.com>
5277 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
5278 "Dispose" method from the `current_type'.
5279 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
5280 DoDefineMembers() instead of using the MethodBuilder; this is
5281 required for generic iterators.
5283 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
5285 2004-11-24 Martin Baulig <martin@ximian.com>
5287 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
5289 2004-11-20 Martin Baulig <martin@ximian.com>
5291 * expression.cs (Invocation.InferType): Correctly infer generic
5292 instances; see gen-103.cs.
5293 (Invocation.InferTypeArguments): If a generic method doesn't have
5294 any unbound type parameters, we don't need to infer anything.
5296 2004-11-19 Raja R Harinath <rharinath@novell.com>
5298 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
5300 2004-11-17 Raja R Harinath <rharinath@novell.com>
5302 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
5303 (TypeHandle.GetMemberCache): New.
5304 (TypeHandle.TypeHandle): Update.
5305 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
5306 (TypeManager.LookupParentInterfacesCache):
5307 Rename from LookupInterfaceCache. Optimize slightly.
5308 (TypeManager.MemberLookup_FindMembers): Update.
5309 * decl.cs (MemberCache.MemberCache): Set Container to null in the
5311 (AddCacheContents): Rename from AddHashtable.
5312 * class.cs (TypeContainer.parent_container): Remove.
5313 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
5314 (TypeContainer.DoDefineMembers): Don't initialize it.
5315 Update to name changes.
5317 2004-11-17 Miguel de Icaza <miguel@ximian.com>
5319 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
5320 that factors the code to check access modifiers on override.
5322 (PropertyBase): Use the code here.
5324 Patch from Lluis S'anchez, fixes bug #69361.
5326 2004-11-15 Miguel de Icaza <miguel@ximian.com>
5328 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
5329 routine that is used to report the use of a captured variable
5330 whose address has been taken.
5332 There are two checks: one when variables are being captured and
5333 the other check is when the address of a variable is taken.
5335 (because an anonymous methods might be resolved before *or* after
5336 the address has been taken) and
5338 * expression.cs (Conditional.DoResolve): Remove the special
5339 casing that Martin added to trueExpr and falseExpr being both
5340 NullLiteral. We get the right behavior now just by introducing
5341 the null_type into the compiler.
5343 * convert.cs (ExplicitConversion): Change the code to use
5344 null_type instead of testing `expr is NullLiteral'.
5345 (ImplicitConversionStandard): use null_type too.
5346 (ImplicitReferenceConversionExists): use null_type too.
5347 (ImplicitReferenceConversion): use null_type too.
5349 * literal.cs: The type of `NullLiteral' is now null_type instead
5351 (Resolve): Set the type here.
5353 * typemanager.cs: Introduce null_type.
5355 2004-11-18 Martin Baulig <martin@ximian.com>
5358 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
5360 2004-11-18 Martin Baulig <martin@ximian.com>
5362 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
5364 2004-11-18 Martin Baulig <martin@ximian.com>
5366 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
5367 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
5368 call ResolveConstructedType() on it to resolve it without checking
5370 (Constraints.ResolveTypes): Check them here.
5371 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
5372 but don't check constraints.
5373 (ConstructedType.ResolveAsTypeTerminal): Override this and also
5374 check constraints here.
5375 (ConstructedType.ResolveConstructedType): New public method. This
5376 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
5377 resolve ourselves without checking constraints.
5379 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
5381 2004-11-18 Martin Baulig <martin@ximian.com>
5384 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
5386 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
5388 2004-11-18 Martin Baulig <martin@ximian.com>
5390 * ecore.cs (TypeExpr.ResolveType): Removed.
5391 (Expression.ResolveAsTypeTerminal): We always return a fully
5392 resolved `TypeExpr', so we can just access its `Type'.
5394 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
5396 2004-11-17 Martin Baulig <martin@ximian.com>
5398 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
5399 sure we don't return any unresolved TypeExpr's.
5400 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
5402 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
5404 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
5405 unresolved `ConstructedType's.
5407 2004-11-17 Martin Baulig <martin@ximian.com>
5409 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
5411 2004-11-17 Martin Baulig <martin@ximian.com>
5414 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
5416 * decl.cs (DeclSpace.ResolveType): Removed.
5417 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
5419 2004-11-17 Martin Baulig <martin@ximian.com>
5421 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
5422 direction, like FindMembers() does. Fixes #69546, testcase is in
5425 2004-11-16 Martin Baulig <martin@ximian.com>
5427 This is based on a patch from Marek Safar, see bug #69082.
5428 Fixes bugs #63705 and #67130.
5430 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
5431 method; create a MemberCache for an interface type and cache the
5434 * decl.cs (IMemberContainer.ParentContainer): Removed.
5435 (IMemberContainer.ParentCache): New property.
5436 (MemberCache.SetupCacheForInterface): Removed.
5437 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
5438 to create a cache for an interface's "parent".
5440 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
5443 2004-11-14 Ben Maurer <bmaurer@ximian.com>
5445 * statement.cs: Avoid adding bools to a hashtable.
5447 2004-11-15 Martin Baulig <martin@ximian.com>
5449 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
5451 2004-11-11 Martin Baulig <martin@ximian.com>
5453 * typemanager.cs (TypeManager.GetMethodName): New method.
5455 * class.cs (MethodData.Define): Include the generic arity in the
5456 name of an explicit interface; also add it to the method name.
5458 * pending.cs (PendingImplementation.InterfaceMethod): The method
5459 name now includes the generic arity.
5461 2004-11-07 Miguel de Icaza <miguel@ximian.com>
5463 * expression.cs (Invocation.OverloadResolve): Flag error if we are
5464 calling an unsafe method from a safe location.
5466 2004-11-06 Marek Safar <marek.safar@seznam.cz>
5469 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
5471 2004-11-06 Miguel de Icaza <miguel@ximian.com>
5473 * namespace.cs (VerifyUsing): use GetPartialName instead of
5476 2004-11-05 Miguel de Icaza <miguel@ximian.com>
5478 * statement.cs (Return.Resolve): Fix regression in typo: if
5479 `in_exc', we have to request a NeedReturnLabel, this was a typo
5480 introduced in the anonymous method check-in. Fixes #69131.
5482 * Indexers were using the ShortName when defining themselves,
5483 causing a regression in the compiler bootstrap when applying the
5484 patch from 2004-11-02 (first part), now they use their full name
5485 and the bug is gone.
5487 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
5489 * driver.cs: Strip the path from the names of embedded resources. Fixes
5492 2004-11-04 Raja R Harinath <rharinath@novell.com>
5494 Fix error message regression: cs0104-2.cs.
5495 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
5496 (AliasEntry.Resolve): Update.
5497 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
5499 (RootContext.LookupType): Update.
5501 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
5503 * cs-parser.jay: Add support for handling accessor modifiers
5504 * class: Add support port accessor modifiers and error checking,
5505 define PropertyMethod.Define as virtual (not abstract anymore)
5506 * ecore.cs: Add checking for proeprties access with access modifiers
5507 * iterators.cs: Modify Accessor constructor call based in the modified
5509 2004-11-02 Ben Maurer <bmaurer@ximian.com>
5511 * expression.cs (StringConcat): Handle being called twice,
5512 as when we have a concat in a field init with more than two
5515 2004-11-02 Miguel de Icaza <miguel@ximian.com>
5517 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5518 special case explicit implementations, we should always produce
5519 the .property or .event declaration.
5521 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5522 since it will not return correct data if people use this
5523 unresolved in the presence of using statements (see test-313).
5525 * class.cs (MethodData.Define): If we are an explicit interface
5526 implementation, set the method name to the full name of the
5527 interface plus the name of the method.
5529 Notice that using the method.MethodName.GetFullName() does not
5530 work, as it will only contain the name as declared on the source
5531 file (it can be a shorthand in the presence of using statements)
5532 and not the fully qualifed type name, for example:
5536 class D : ICloneable {
5537 object ICloneable.Clone () {
5541 Would produce a method called `ICloneable.Clone' instead of
5542 `System.ICloneable.Clone'.
5544 * namespace.cs (Alias.Resolve): Use GetPartialName.
5546 2004-11-01 Marek Safar <marek.safar@seznam.cz>
5548 * cs-parser.jay: Add error 1055 report.
5550 2004-11-01 Miguel de Icaza <miguel@ximian.com>
5552 * assign.cs (Assign.DoResolve): Only do the transform of
5553 assignment into a New if the types are compatible, if not, fall
5554 through and let the implicit code deal with the errors and with
5555 the necessary conversions.
5557 2004-11-01 Marek Safar <marek.safar@seznam.cz>
5559 * cs-parser.jay: Add error 1031 report.
5561 * cs-tokenizer.cs: Add location for error 1038.
5563 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5565 * cs-parser.jay: Add error 1016 report.
5567 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5569 * cs-parser.jay: Add errors 1575,1611 report.
5571 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5573 * cs-parser.jay: Add error 1001 report.
5575 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5578 * attribute.cs (GetMarshal): Add method argument for
5579 caller identification.
5581 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5582 agument for GetMarshal and RuntimeMissingSupport.
5584 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5586 * attribute.cs (ExtractSecurityPermissionSet): Removed
5587 TypeManager.code_access_permission_type.
5589 * typemanager.cs: Removed TypeManager.code_access_permission_type.
5591 2004-10-27 Miguel de Icaza <miguel@ximian.com>
5593 * expression.cs (LocalVariableReference.DoResolveLValue): Check
5594 for obsolete use of a variable here. Fixes regression on errors
5595 cs0619-25 and cs0619-26.
5597 2004-10-27 Marek Safar <marek.safar@seznam.cz>
5599 Fix #62358, implemented security attribute encoding.
5601 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5602 Tests permitted SecurityAction for assembly or other types.
5603 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5604 data from SecurityPermissionAttribute to PermisionSet class.
5606 * class.cs (ApplyAttributeBuilder): Added special handling
5607 for System.Security.Permissions.SecurityAttribute based types.
5609 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5610 special handling for System.Security.Permissions.SecurityAttribute
5613 * enum.cs (ApplyAttributeBuilder): Added special handling
5614 for System.Security.Permissions.SecurityAttribute based types.
5616 * parameter.cs (ApplyAttributeBuilder): Added special handling
5617 for System.Security.Permissions.SecurityAttribute based types.
5619 * rootcontext.cs: Next 2 core types.
5621 * typemanager.cs (TypeManager.security_permission_attr_type):
5622 Built in type for the SecurityPermission Attribute.
5623 (code_access_permission_type): Build in type.
5625 2004-10-17 Miguel de Icaza <miguel@ximian.com>
5627 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5628 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5629 all of this information into
5630 EmitContext.EmitCapturedVariableInstance.
5632 * codegen.cs (EmitCapturedVariableInstance): move here the
5633 funcionality of emitting an ldarg.0 in the presence of a
5634 remapping. This centralizes the instance emit code.
5636 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5637 then emit a load of this: it means that we have reached the
5638 topmost ScopeInfo: the one that contains the pointer to the
5639 instance of the class hosting the anonymous method.
5641 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5642 captures to the topmost CaptureContext.
5644 2004-10-12 Miguel de Icaza <miguel@ximian.com>
5646 * expression.cs (LocalVariableReference): Move the knowledge about
5647 the iterators into codegen's EmitCapturedVariableInstance.
5649 2004-10-11 Miguel de Icaza <miguel@ximian.com>
5651 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5652 all code paths return a value from an anonymous method (it is the
5653 same as the 161 error, but for anonymous methods).
5655 2004-10-08 Miguel de Icaza <miguel@ximian.com>
5657 The introduction of anonymous methods in the compiler changed
5658 various ways of doing things in the compiler. The most
5659 significant one is the hard split between the resolution phase
5660 and the emission phases of the compiler.
5662 For instance, routines that referenced local variables no
5663 longer can safely create temporary variables during the
5664 resolution phase: they must do so from the emission phase,
5665 since the variable might have been "captured", hence access to
5666 it can not be done with the local-variable operations from the runtime.
5670 (Block.Flags): New flag `IsTopLevel' to indicate that this block
5671 is a toplevel block.
5673 (ToplevelBlock): A new kind of Block, these are the blocks that
5674 are created by the parser for all toplevel method bodies. These
5675 include methods, accessors and anonymous methods.
5677 These contain some extra information not found in regular blocks:
5678 A pointer to an optional CaptureContext (for tracking captured
5679 local variables and parameters). A pointer to the parent
5682 (Return.Resolve): Catch missmatches when returning a value from an
5683 anonymous method (error 1662).
5684 Invoke NeedReturnLabel from the Resolve phase instead of the emit
5687 (Break.Resolve): ditto.
5689 (SwitchLabel): instead of defining the labels during the
5690 resolution phase, we now turned the public ILLabel and ILLabelCode
5691 labels into methods called GetILLabelCode() and GetILLabel() that
5692 only define the label during the Emit phase.
5694 (GotoCase): Track the SwitchLabel instead of the computed label
5695 (its contained therein). Emit the code by using
5696 SwitchLabel.GetILLabelCode ().
5698 (LocalInfo.Flags.Captured): A new flag has been introduce to track
5699 whether the Local has been captured or not.
5701 (LocalInfo.IsCaptured): New property, used to tell whether the
5702 local has been captured.
5704 * anonymous.cs: Vastly updated to contain the anonymous method
5707 The main classes here are: CaptureContext which tracks any
5708 captured information for a toplevel block and ScopeInfo used to
5709 track the activation frames for various local variables.
5711 Each toplevel block has an optional capture context associated
5712 with it. When a method contains an anonymous method both the
5713 toplevel method and the anonymous method will create a capture
5714 context. When variables or parameters are captured, they are
5715 recorded on the CaptureContext that owns them, for example:
5719 MyDelegate d = delegate {
5724 Here `a' will be recorded as captured on the toplevel
5725 CapturedContext, the inner captured context will not have anything
5726 (it will only have data if local variables or parameters from it
5727 are captured in a nested anonymous method.
5729 The ScopeInfo is used to track the activation frames for local
5730 variables, for example:
5732 for (int i = 0; i < 10; i++)
5733 for (int j = 0; j < 10; j++){
5734 MyDelegate d = delegate {
5739 At runtime this captures a single captured variable `i', but it
5740 captures 10 different versions of the variable `j'. The variable
5741 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5742 recorded on a child.
5744 The toplevel ScopeInfo will also track information like the `this'
5745 pointer if instance variables were referenced (this is necessary
5746 as the anonymous method lives inside a nested class in the host
5747 type of the method).
5749 (AnonymousMethod): Expanded to track the Toplevel, implement
5750 `AnonymousMethod.Compatible' to tell whether an anonymous method
5751 can be converted to a target delegate type.
5753 The routine now also produces the anonymous method content
5755 (AnonymousDelegate): A helper class that derives from
5756 DelegateCreation, this is used to generate the code necessary to
5757 produce the delegate for the anonymous method that was created.
5759 * assign.cs: API adjustments for new changes in
5760 Convert.ImplicitStandardConversionExists.
5762 * class.cs: Adjustments to cope with the fact that now toplevel
5763 blocks are of type `ToplevelBlock'.
5765 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5766 insteda of standard blocks.
5768 Flag errors if params arguments are passed to anonymous methods.
5770 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5771 `CurrentAnonymousMethod' which points to the current Anonymous
5772 Method. The variable points to the AnonymousMethod class that
5773 holds the code being compiled. It is set in the new EmitContext
5774 created for the anonymous method.
5776 (EmitContext.Phase): Introduce a variable and an enumeration to
5777 assist in enforcing some rules about when and where we are allowed
5778 to invoke certain methods (EmitContext.NeedsReturnLabel is the
5779 only one that enfonces this right now).
5781 (EmitContext.HaveCaptureInfo): new helper method that returns
5782 whether we have a CapturedContext initialized.
5784 (EmitContext.CaptureVariable): New method used to register that a
5785 LocalInfo must be flagged for capturing.
5787 (EmitContext.CapturedParameter): New method used to register that a
5788 parameters must be flagged for capturing.
5790 (EmitContext.CapturedField): New method used to register that a
5791 field must be flagged for capturing.
5793 (EmitContext.HaveCapturedVariables,
5794 EmitContext.HaveCapturedFields): Return whether there are captured
5795 variables or fields.
5797 (EmitContext.EmitMethodHostInstance): This is used to emit the
5798 instance for the anonymous method. The instance might be null
5799 (static methods), this (for anonymous methods that capture nothing
5800 and happen to live side-by-side with the current method body) or a
5801 more complicated expression if the method has a CaptureContext.
5803 (EmitContext.EmitTopBlock): Routine that drives the emission of
5804 code: it will first resolve the top block, then emit any metadata
5805 and then emit the code. The split is done so that we can extract
5806 any anonymous methods and flag any captured variables/parameters.
5808 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5809 during this phase, the ILGenerator should not be used as labels
5810 and local variables declared here might not be accessible to any
5811 code that is part of an anonymous method.
5813 Exceptions to this include the temporary variables that are
5814 created by some statements internally for holding temporary
5817 (EmitContext.EmitMeta): New routine, in charge of emitting all the
5820 (EmitContext.TemporaryReturn): This method is typically called
5821 from the Emit phase, and its the only place where we allow the
5822 ReturnLabel to be defined other than the EmitMeta. The reason is
5823 that otherwise we would have to duplicate a lot of logic in the
5824 Resolve phases of various methods that today is on the Emit
5827 (EmitContext.NeedReturnLabel): This no longer creates the label,
5828 as the ILGenerator is not valid during the resolve phase.
5830 (EmitContext.EmitThis): Extended the knowledge in this class to
5831 work in anonymous methods in addition to iterators.
5833 (EmitContext.EmitCapturedVariableInstance): This emits whatever
5834 code is necessary on the stack to access the instance to a local
5835 variable (the variable will be accessed as a field).
5837 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5838 EmitContext.EmitAddressOfParameter): Routines to support
5839 parameters (not completed at this point).
5841 Removals: Removed RemapLocal and RemapLocalLValue. We probably
5842 will also remove the parameters.
5844 * convert.cs (Convert): Define a `ConstantEC' which points to a
5845 null. This is just to prefity some code that uses
5846 ImplicitStandardConversion code and do not have an EmitContext
5849 The idea is to flag explicitly that at that point in time, it is
5850 known that the conversion will not trigger the delegate checking
5851 code in implicit conversions (which requires a valid
5854 Everywhere: pass new EmitContext parameter since
5855 ImplicitStandardConversionExists now requires it to check for
5856 anonymous method conversions.
5858 (Convert.ImplicitStandardConversionExists): If the type of an
5859 expression is the anonymous_method_type, and the type is a
5860 delegate, we invoke the AnonymousMethod.Compatible method to check
5861 whether an implicit conversion is possible.
5863 (Convert.ImplicitConversionStandard): Only do implicit method
5864 group conversions if the language level is not ISO_1.
5866 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5867 MethodInfo for the Invoke method. used by Delegate and
5870 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5871 method conversions if the target type is a delegate.
5873 Removed extra debugging nops.
5875 (LocalVariableReference): Turn the `local_info' into a public
5878 Add `prepared' field, the same hack used for FieldExprs to cope
5879 with composed assignments, as Local variables do not necessarily
5880 operate purely on the stack as they used to: they can be captured
5883 Add `temp' for a temporary result, like fields.
5885 Refactor DoResolve and DoResolveLValue into DoResolveBase.
5887 It now copes with Local variables that are captured and emits the
5888 proper instance variable to load it from a field in the captured
5891 (ParameterReference.DoResolveBase): During the resolve phase,
5892 capture parameters if we are in an anonymous method.
5894 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5895 anonymous method, use the EmitContext helper routines to emit the
5896 parameter reference.
5898 * iterators.cs: Set RemapToProxy to true/false during the
5901 * parameters.cs (GetParameterByName): New helper method.
5903 * typemanager.cs (anonymous_method_type) a new type that
5904 represents an anonyous method. This is always an internal type,
5905 used as a fencepost to test against the anonymous-methodness of an
5908 2004-10-20 Marek Safar <marek.safar@seznam.cz>
5910 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5912 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5914 2004-11-10 Martin Baulig <martin@ximian.com>
5916 * expression.cs (Invocation.BetterFunction): If two methods have
5917 equal parameter types, but only one of them is generic, the
5918 non-generic one wins.
5919 (New.DoResolve): Don't set `is_struct' to false if we're a generic
5920 instance; just use `Type.IsValueType' to determine whether
5921 something is a struct or not.
5922 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
5923 so we can be called multiple times.
5925 2004-11-10 Martin Baulig <martin@ximian.com>
5927 * generic.cs (TypeParameter.DefineConstraints): New public method.
5928 (TypeParameter.CheckAccessLevel): Override this and return true.
5929 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
5930 override ResolveType() anymore.
5931 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
5933 2004-11-10 Martin Baulig <martin@ximian.com>
5935 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
5936 call DeclSpace.ResolveNestedType() on it.
5938 2004-11-10 Martin Baulig <martin@ximian.com>
5940 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
5941 non-null, call ParameterModifier() on it.
5943 2004-11-10 Martin Baulig <martin@ximian.com>
5946 (Iterators): Added `current_type' and `this_type' fields.
5947 (Iterators.DefineIterator): Create a new EmitContext and store it
5948 in `ec'; compute `this_type'.
5950 2004-11-10 Martin Baulig <martin@ximian.com>
5953 (TypeManager.IsPrivateAccessible): New public method.
5954 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
5956 2004-11-10 Martin Baulig <martin@ximian.com>
5958 * class.cs (TypeContainer.DefineType): Call
5959 TypeBuilder.DefineGenericParameters() before resolving the type
5961 (MethodData.parent_method): New protected field.
5962 (MethodData..ctor): Added `MethodInfo parent_method' argument.
5963 (MethodData.Define): Compute `parent_method'.
5966 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5967 (MemberCore.GetClsCompliantAttributeValue): Likewise.
5968 (DeclSpace.ec): New protected field; store the EmitContext here.
5969 (DeclSpace.EmitContext): New public property.
5970 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
5971 (DeclSpace.ResolveNestedType): New public method.
5972 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
5973 (DeclSpace.NestedAccessible): Added `Type tb' argument.
5974 (DeclSpace.FamilyAccessible): Likewise.
5975 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
5976 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5979 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
5982 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5983 (Enum.Emit): Don't create a new EmitContext.
5985 2004-10-18 Martin Baulig <martin@ximian.com>
5987 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5988 `Type' directly, but call ResolveType() on it.
5989 (Catch.Resolve): Likewise.
5990 (Foreach.Resolve): Likewise.
5992 2004-10-18 Martin Baulig <martin@ximian.com>
5994 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5995 `Type' directly, but call ResolveType() on it.
5996 (Probe.DoResolve): Likewise.
5997 (ArrayCreation.LookupType): Likewise.
5998 (TypeOf.DoResolve): Likewise.
5999 (SizeOf.DoResolve): Likewise.
6001 2004-10-18 Raja R Harinath <rharinath@novell.com>
6003 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6006 2004-10-17 John Luke <john.luke@gmail.com>
6008 * class.cs (Operator.GetSignatureForError): use CSharpName
6010 * parameter.cs (Parameter.GetSignatureForError): Returns
6011 correct name even if was not defined.
6013 2004-10-13 Raja R Harinath <rharinath@novell.com>
6016 * class.cs (TypeContainer.EmitContext): New property.
6017 (DefineNestedTypes): Create an emitcontext for each part.
6018 (MethodCore.DoDefineParameters): Use container's emitcontext.
6019 Pass type array to InternalParameters.
6020 (MemberBase.DoDefine): Use container's emitcontext.
6021 (FieldMember.Define): Likewise.
6022 (Event.Define): Likewise.
6023 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6024 Pass type array to InternalParameters.
6025 (SetIndexerMethod.GetParameterInfo): Likewise.
6026 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6027 * delegate.cs (Define): Pass emitcontext to
6028 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6029 array to InternalParameters.
6030 * expression.cs (ParameterReference.DoResolveBase): Pass
6031 emitcontext to GetParameterInfo.
6032 (ComposedCast.DoResolveAsTypeStep): Remove check on
6033 ec.ResolvingTypeTree.
6034 * parameter.cs (Parameter.Resolve): Change argument to
6035 EmitContext. Use ResolveAsTypeTerminal.
6036 (Parameter.GetSignature): Change argument to EmitContext.
6037 (Parameters.ComputeSignature): Likewise.
6038 (Parameters.ComputeParameterTypes): Likewise.
6039 (Parameters.GetParameterInfo): Likewise.
6040 (Parameters.ComputeAndDefineParameterTypes): Likewise.
6041 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
6042 * support.cs (InternalParameters..ctor): Remove variant that takes
6044 * typemanager.cs (system_intptr_expr): New.
6045 (InitExpressionTypes): Initialize it.
6047 2004-10-12 Chris Toshok <toshok@ximian.com>
6049 * cs-parser.jay: fix location for try_statement and catch_clause.
6051 2004-10-18 Martin Baulig <martin@ximian.com>
6053 * class.cs (FieldMember.Define): Don't access the TypeExpr's
6054 `Type' directly, but call ResolveType() on it.
6055 (MemberBase.DoDefine): Likewise.
6057 * expression.cs (New.DoResolve): Don't access the TypeExpr's
6058 `Type' directly, but call ResolveType() on it.
6059 (ComposedCast.DoResolveAsTypeStep): Likewise.
6061 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6062 `Type' directly, but call ResolveType() on it.
6064 2004-10-17 John Luke <john.luke@gmail.com>
6066 * class.cs (Operator.GetSignatureForError): use CSharpName
6068 * parameter.cs (Parameter.GetSignatureForError): Returns
6069 correct name even if was not defined.
6071 2004-10-13 Raja R Harinath <rharinath@novell.com>
6074 * class.cs (TypeContainer.EmitContext): New property.
6075 (DefineNestedTypes): Create an emitcontext for each part.
6076 (MethodCore.DoDefineParameters): Use container's emitcontext.
6077 Pass type array to InternalParameters.
6078 (MemberBase.DoDefine): Use container's emitcontext.
6079 (FieldMember.Define): Likewise.
6080 (Event.Define): Likewise.
6081 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6082 Pass type array to InternalParameters.
6083 (SetIndexerMethod.GetParameterInfo): Likewise.
6084 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6085 * delegate.cs (Define): Pass emitcontext to
6086 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6087 array to InternalParameters.
6088 * expression.cs (ParameterReference.DoResolveBase): Pass
6089 emitcontext to GetParameterInfo.
6090 (ComposedCast.DoResolveAsTypeStep): Remove check on
6091 ec.ResolvingTypeTree.
6092 * parameter.cs (Parameter.Resolve): Change argument to
6093 EmitContext. Use ResolveAsTypeTerminal.
6094 (Parameter.GetSignature): Change argument to EmitContext.
6095 (Parameters.ComputeSignature): Likewise.
6096 (Parameters.ComputeParameterTypes): Likewise.
6097 (Parameters.GetParameterInfo): Likewise.
6098 (Parameters.ComputeAndDefineParameterTypes): Likewise.
6099 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
6100 * support.cs (InternalParameters..ctor): Remove variant that takes
6102 * typemanager.cs (system_intptr_expr): New.
6103 (InitExpressionTypes): Initialize it.
6105 2004-10-12 Chris Toshok <toshok@ximian.com>
6107 * cs-parser.jay: fix location for try_statement and catch_clause.
6109 2004-10-07 Raja R Harinath <rharinath@novell.com>
6111 More DeclSpace.ResolveType avoidance.
6112 * decl.cs (MemberCore.InUnsafe): New property.
6113 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
6114 with newly created EmitContext.
6115 (FieldMember.Define): Likewise.
6116 * delegate.cs (Delegate.Define): Likewise.
6117 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6118 only if normal name-lookup fails.
6119 (TypeExpr.DoResolve): Enable error-checking.
6120 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6121 (SizeOf.DoResolve): Likewise.
6122 (ComposedCast.DoResolveAsTypeStep): Likewise.
6123 (StackAlloc.DoResolve): Likewise.
6124 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6125 (Block.Unsafe): New property.
6126 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6127 (Unsafe): Set 'unsafe' flag of contained block.
6128 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6129 (Fixed.Resolve): Likewise.
6130 (Catch.Resolve): Likewise.
6131 (Using.ResolveLocalVariableDecls): Likewise.
6132 (Foreach.Resolve): Likewise.
6134 2004-10-05 John Luke <john.luke@gmail.com>
6136 * cs-parser.jay: add location to error CS0175
6138 2004-10-04 Miguel de Icaza <miguel@ximian.com>
6140 * ecore.cs (Expression.Constantity): Add support for turning null
6143 * const.cs (Const.Define): Allow constants to be reference types
6144 as long as the value is Null.
6146 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
6148 * namespace.cs (NamespaceEntry.Using): No matter which warning
6149 level is set, check if this namespace name has already been added.
6151 2004-10-03 Ben Maurer <bmaurer@ximian.com>
6153 * expression.cs: reftype [!=]= null should always use br[true,false].
6156 2004-10-03 Marek Safar <marek.safar@seznam.cz>
6159 * attribute.cs: Enum conversion moved to
6160 GetAttributeArgumentExpression to be applied to the all
6163 2004-10-01 Raja R Harinath <rharinath@novell.com>
6165 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
6166 * class.c (TypeContainer.DefineType): Flag error if
6167 base types aren't accessible due to access permissions.
6168 * decl.cs (DeclSpace.ResolveType): Move logic to
6169 Expression.ResolveAsTypeTerminal.
6170 (DeclSpace.ResolveTypeExpr): Thin layer over
6171 Expression.ResolveAsTypeTerminal.
6172 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
6173 Refactor code into NestedAccess. Use it.
6174 (DeclSpace.NestedAccess): New.
6175 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
6176 argument to silence errors. Check access permissions.
6177 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
6178 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
6179 (Cast.DoResolve): Likewise.
6180 (New.DoResolve): Likewise.
6181 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
6182 (TypeOf.DoResolve): Likewise.
6184 * expression.cs (Invocation.BetterConversion): Return the Type of
6185 the better conversion. Implement section 14.4.2.3 more faithfully.
6186 (Invocation.BetterFunction): Make boolean. Make correspondence to
6187 section 14.4.2.2 explicit.
6188 (Invocation.OverloadResolve): Update.
6189 (Invocation): Remove is_base field.
6190 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
6191 (Invocation.Emit): Likewise.
6193 2004-09-24 Marek Safar <marek.safar@seznam.cz>
6195 * cs-parser.jay: Reverted 642 warning fix.
6197 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6200 * decl.cs (FindMemberWithSameName): Indexer can have more than
6203 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6205 * expression.cs (LocalVariableReference.DoResolveLValue):
6206 Do not report warning 219 for out values.
6207 (EmptyExpression.Null): New member to avoid extra allocations.
6209 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6211 * cs-parser.jay: Fix wrong warning 642 report.
6213 * cs-tokenizer.cs (CheckNextToken): New helper;
6214 Inspect next character if is same as expected.
6216 2004-09-23 Martin Baulig <martin@ximian.com>
6218 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6219 (Convert.ImplicitReferenceConversionExists): Likewise.
6221 2004-11-09 Raja R Harinath <rharinath@novell.com>
6223 * Makefile (DISTFILES): Comment out a few missing files.
6225 2004-10-29 Raja R Harinath <rharinath@novell.com>
6227 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
6228 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
6229 (gmcs.exe): Invoke bootstrap-libs.
6230 (clean-local): Clean the net_2_0_bootstrap profile too.
6231 (PROGRAM_INSTALL_DIR): New.
6232 (install-local): Use it.
6234 2004-10-13 Martin Baulig <martin@ximian.com>
6236 * generic.cs (TypeManager.InflatedConstraints): New nested class.
6237 (TypeParameter.DefineType): If we're a method type parameter and
6238 that method is overriding something, "inflate" its constraints.
6240 2004-10-12 Martin Baulig <martin@ximian.com>
6242 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
6243 and have type arguments, create and resolve a ConstructedType.
6245 2004-10-12 Martin Baulig <martin@ximian.com>
6247 * decl.cs (MemberCache.FindMemberToOverride): Use
6248 TypeManager.IsEqual() to compare the parameters and Type.Equals()
6249 to compare the invocationType.
6251 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
6252 When comparing two type parameters, only do the signature-only
6253 comparision for method type parameters.
6255 2004-10-11 Martin Baulig <martin@ximian.com>
6257 * report.cs: Don't make --fatal abort on warnings, we have
6258 -warnaserror for that.
6260 2004-10-11 Martin Baulig <martin@ximian.com>
6263 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
6264 (TypeManager.IsEqual): Call ourself recursively instead of using
6267 2004-10-11 Martin Baulig <martin@ximian.com>
6269 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
6270 on our own type parameters, not on the ones we inherit from a containing
6273 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
6276 * generic.cs (TypeParameter.Define): We may only be called once.
6278 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
6279 instead of TypeManager.IsEqual().
6281 2004-09-28 Martin Baulig <martin@ximian.com>
6284 (GenericConstraints.EffectiveBaseClass): New public property.
6285 (TypeParameter.GenericConstraints): New public property.
6286 (ConstructedType.CheckConstraints): Improved.
6288 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
6289 (Convert.TypeParameterConversion): New private method; use this in
6290 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
6291 for all conversions related to type parameters.
6293 2004-09-24 Martin Baulig <martin@ximian.com>
6295 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
6296 type parameter conversions for type parameters which are known to
6299 2004-09-24 Martin Baulig <martin@ximian.com>
6301 * generic.cs (GenericConstraints): Added `IsReferenceType' and
6302 `IsValueType' properties.
6304 * support.cs (ReflectionConstraints): Use
6305 Type.GetGenericParameterConstraints() instead of the old hack.
6307 2004-09-24 Martin Baulig <martin@ximian.com>
6309 * generic.cs (GenericConstraints): Moved here and made it an
6312 * support.cs (GenericConstraints): Moved to generic.cs.
6314 2004-09-24 Martin Baulig <martin@ximian.com>
6317 (ReflectionConstraints): Un-nested this class and made it public.
6320 (TypeManager.GetTypeParameterConstraints): New public method.
6321 (TypeManager.HasConstructorConstraint): Use the attributes.
6323 2004-09-24 Martin Baulig <martin@ximian.com>
6325 * support.cs (GenericConstraints): Replaced `HasConstructor',
6326 `IsReferenceType' and `IsValueType' with `Attributes'.
6327 (ReflectionParameters.ReflectionConstraints): Removed the Create()
6328 method and made the .ctor public.
6330 * generic.cs (Constraints.Attributes): New public property.
6331 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
6332 `IsReferenceType' -> `HasReferenceTypeConstraint' and
6333 `IsValueType' -> `HasValueTypeConstraint'.
6335 2004-09-23 Martin Baulig <martin@ximian.com>
6337 * generic.cs (Constraints): Reflect latest runtime changes.
6339 2004-09-23 Martin Baulig <martin@ximian.com>
6341 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6342 (Convert.ImplicitReferenceConversionExists): Likewise.
6344 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6346 * class.cs (Operator.Define): Add error 448 and 559 report.
6348 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6350 * class.cs (MemberBase.IsTypePermitted): New protected
6351 method for checking error CS0610.
6353 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6355 * class.cs (TypeContainer.HasExplicitLayout): New property
6356 Returns whether container has StructLayout attribute set Explicit.
6357 (FieldMember): New abstract class for consts and fields.
6358 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
6359 (Field): Reuse FieldMember.
6361 * const.cs (Const): Reuse FieldMember.
6363 * rootcontext.cs: EmitConstants call moved to class.
6365 2004-09-22 Martin Baulig <martin@ximian.com>
6367 Marek and me just fixed one of our oldest bugs: #28562 :-)
6369 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
6371 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
6372 we're an EnumConstant, just return that.
6373 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
6374 an EnumConstant. In this case, we need to use GetValueAsEnumType()
6375 to get the value which'll actually be written into the attribute.
6376 However, we have to use GetValue() to access the attribute's value
6379 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6381 * constant.cs (Constant.IsNegative): New abstract property
6384 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
6385 (StackAlloc.DoResolve): Reused IsNegative.
6387 2004-09-22 Martin Baulig <martin@ximian.com>
6389 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
6390 public method; like LookupTypeContainer, but also works for
6393 * report.cs (Report.SymbolRelatedToPreviousError): Use
6394 TypeManager.LookupGenericTypeContainer().
6396 2004-09-22 Martin Baulig <martin@ximian.com>
6398 Thanks to Peter Sestoft for this bug report.
6400 * expression.cs (Conditional): If both the `trueExpr' and the
6401 `falseExpr' is a NullLiteral, return a NullLiteral.
6403 2004-09-22 Martin Baulig <martin@ximian.com>
6405 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
6406 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
6407 for the "get_Current" call.
6409 2004-09-21 Martin Baulig <martin@ximian.com>
6411 * convert.cs (Convert.ImplicitReferenceConversion): When
6412 converting to an interface type, first check whether we're
6413 converting from a reference type.
6415 2004-09-14 Martin Baulig <martin@ximian.com>
6417 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6419 2004-09-14 Marek Safar <marek.safar@seznam.cz>
6422 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6423 called and is obsolete then this member suppress message
6424 when call is inside next [Obsolete] method or type.
6426 * expression.cs: Use TestObsoleteMethodUsage member.
6428 2004-09-14 Martin Baulig <martin@ximian.com>
6430 * genericparser.cs: Removed.
6432 2004-09-13 Marek Safar <marek.safar@seznam.cz>
6434 * class.cs (MethodCore.CheckBase): Fix bug #65757.
6436 2004-09-12 Marek Safar <marek.safar@seznam.cz>
6438 * attribute.cs (Attribute.Resolve): Add error 653 report.
6440 * class.cs (Class.ApplyAttributeBuilder): Add error 641
6442 (Method.ApplyAttributeBuilder): Add error 685 report.
6443 (Operator.Define): Add error 564 report.
6445 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
6447 * expression.cs (Invocation.DoResolve): Add error
6450 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
6453 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6455 * class.cs (ConstructorInitializer.Resolve):
6456 Wrong error number (515->516).
6458 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6460 * class.cs (Indexer.Define): Add error 631 report.
6462 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6464 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
6466 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6468 * expression.cs (Probe.DoResolve): Add error CS0241 report.
6470 2004-09-10 Marek Safar <marek.safar@seznam.cz>
6472 * cs-parser.jay: Added error CS0241 report.
6474 2004-09-10 Raja R Harinath <rharinath@novell.com>
6476 * cs-parser.jay (fixed_statement): Introduce a scope for the
6477 declaration in the 'fixed' statement.
6479 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6481 * cs-parser.jay: Added CS0230 error report.
6483 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6485 * cs-parser.jay: Added errors CS0231 and CS0257 report.
6487 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6489 * expression.cs (Argument.Resolve): Added error CS0192 and
6492 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6494 C# 2.0 #pragma warning feature
6496 * cs-tokenizer.cs (PreProcessPragma): New method;
6497 Handles #pragma directive.
6499 * report.cs (WarningRegions): New class; Support
6500 class for #pragma warning directive. It tests whether
6501 warning is enabled for a given line.
6503 2004-09-08 Miguel de Icaza <miguel@ximian.com>
6505 * const.cs: Add more descriptive error report, tahnks to
6508 2004-09-08 Marek Safar <marek.safar@seznam.cz>
6510 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
6512 2004-09-07 Miguel de Icaza <miguel@ximian.com>
6514 * expression.cs: Apply patch from Ben: Remove dead code from
6515 ArrayCreation, and remove the TurnintoConstant call in const.cs,
6516 as that code just threw an exception anwyays.
6518 * const.cs: Remove the call to the turnintoconstant, for details
6521 * literal.cs: The type of the null-literal is the null type; So
6522 we use a placeholder type (literal.cs:System.Null, defined here)
6525 * expression.cs (Conditional.DoResolve): Remove some old code that
6526 is no longer needed, conversions have been fixed.
6528 (ArrayCreationExpression.DoResolve): Return false if we fail to
6529 resolve the inner expression.
6531 2004-09-07 Raja R Harinath <rharinath@novell.com>
6534 * cs-parser.jay (delegate_declaration): Record a delegate
6535 declaration as a type declaration.
6536 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
6538 2004-09-06 Miguel de Icaza <miguel@ximian.com>
6540 * parameter.cs: Do not crash if the type can not be resolved.
6542 * expression.cs: Report errors with unsafe pointers, fixes #64896
6544 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
6546 * expression.cs: Pointer arith always needs to do a conv.i
6547 if the operand is a long. fix 65320
6549 2004-09-04 Marek Safar <marek.safar@seznam.cz>
6551 Fixed cs0619-37.cs, cs0619-38.cs
6553 * enum.cs (GetObsoleteAttribute): Removed.
6555 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
6556 on Enum member is double staged. The first is tested member
6559 2004-09-04 Marek Safar <marek.safar@seznam.cz>
6561 Fixed #56986, #63631, #65231
6563 * class.cs: (TypeContainer.AddToMemberContainer): New method,
6564 adds member to name container.
6565 (TypeContainer.AddToTypeContainer): New method, adds type to
6567 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6568 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6569 AddOperator): Simplified by reusing AddToMemberContainer.
6570 (TypeContainer.UserDefinedStaticConstructor): Changed to property
6572 (Method.CheckForDuplications): Fixed implementation to test all
6574 (MemberBase): Detection whether member is explicit interface
6575 implementation is now in constructor.
6576 (MemberBase.UpdateMemberName): Handles IndexerName.
6577 (Accessor): Changed to keep also location information.
6578 (AbstractPropertyEventMethod): Is derived from MemberCore.
6579 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6580 will be emited or not.
6581 (PropertyBase.AreAccessorsDuplicateImplementation):
6582 Tests whether accessors are not in collision with some method.
6583 (Operator): Is derived from MethodCore to simplify common
6586 * decl.cs (Flags.TestMethodDuplication): Test for duplication
6588 (DeclSpace.AddToContainer): Adds the member to defined_names
6589 table. It tests for duplications and enclosing name conflicts.
6591 * enum.cs (EnumMember): Clean up to reuse the base structures
6593 2004-09-03 Martin Baulig <martin@ximian.com>
6595 Merged latest changes into gmcs. Please keep this comment in
6596 here, it makes it easier for me to see what changed in MCS since
6597 the last time I merged.
6599 2004-09-03 Martin Baulig <martin@ximian.com>
6601 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6602 into TypeContainer, to make partial classes work again.
6604 2004-09-03 Martin Baulig <martin@ximian.com>
6606 * rootcontext.cs (RootContext.V2): Removed.
6608 2004-03-23 Martin Baulig <martin@ximian.com>
6610 * expression.cs (Invocation.OverloadResolve): Added `bool
6611 may_fail' argument and use it instead of the Location.IsNull() hack.
6613 2004-09-09 Martin Baulig <martin@ximian.com>
6615 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
6617 2004-09-09 Martin Baulig <martin@ximian.com>
6619 * generic.cs (TypeParameter.DefineType): Added support for
6620 explicit interface methods.
6622 2004-09-09 Martin Baulig <martin@ximian.com>
6624 * README.Changes: New document. Started to list important changes
6625 between MCS and GMCS here.
6627 2004-09-08 Martin Baulig <martin@ximian.com>
6630 (TypeContainer.CheckRecursiveDefinition): New protected method.
6631 (TypeContainer.DefineType): Move the CS0146 check into
6632 CheckRecursiveDefinition().
6634 2004-09-06 Martin Baulig <martin@ximian.com>
6636 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
6637 types for the constructor constraint.
6639 2004-09-03 Martin Baulig <martin@ximian.com>
6641 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6642 into TypeContainer, to make partial classes work again.
6644 2004-09-03 Martin Baulig <martin@ximian.com>
6646 * rootcontext.cs (RootContext.V2): Removed.
6648 2004-03-23 Martin Baulig <martin@ximian.com>
6650 * expression.cs (Invocation.OverloadResolve): Added `bool
6651 may_fail' argument and use it instead of the Location.IsNull() hack.
6653 2004-09-03 Martin Baulig <martin@ximian.com>
6655 Merged latest changes into gmcs. Please keep this comment in
6656 here, it makes it easier for me to see what changed in MCS since
6657 the last time I merged.
6659 2004-09-03 Raja R Harinath <rharinath@novell.com>
6662 * expression.cs (BetterConversion): Don't allow either conversion
6663 to be null. Remove redundant implicit conversion test when 'q ==
6664 null' -- when this function is invoked, we already know that the
6665 implicit conversion exists.
6666 (BetterFunction): Assume that 'best' is non-null. Remove
6667 redundant reimplementation of IsApplicable when 'best' is null.
6668 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6669 number of arguments.
6670 (IsAncestralType): Extract from OverloadResolve.
6671 (OverloadResolve): Make robust to the MethodGroupExpr being
6672 unsorted. Implement all the logic of Section 14.5.5.1, and
6673 support overloading of methods from multiple applicable types.
6674 Clean up logic somewhat. Don't pass null methods to BetterFunction.
6676 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6677 (RealError, Warning): Append type of report to related symbol.
6679 2004-09-03 Marek Safar <marek.safar@seznam.cz>
6681 * enum.cs: Fixed CLS-Compliance checks for enum members.
6682 Error tests cs3008-8.cs, cs3014-8.cs
6684 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6686 Fixed bug #62342, #63102
6687 * class.cs: ImplementIndexer uses member.IsExplicitImpl
6688 like ImplementMethod.
6690 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6692 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6695 2004-09-02 Martin Baulig <martin@ximian.com>
6697 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6698 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6701 2004-09-01 Marek Safar <marek.safar@seznam.cz>
6703 C# 2.0 Static classes implemented
6705 * class.cs (TypeContainer): instance_constructors,
6706 initialized_fields, initialized_static_fields,
6707 default_constructor, base_inteface_types are protected to be
6708 accessible from StaticClass.
6709 (TypeContainer.DefineDefaultConstructor): New virtual method
6710 for custom default constructor generating
6711 (StaticClass): New class to handle "Static classes" feature.
6713 * cs-parser.jay: Handle static keyword on class like instance
6716 * driver.cs: Added "/langversion" command line switch with two
6717 options (iso-1, default).
6719 2004-08-31 Marek Safar <marek.safar@seznam.cz>
6721 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6723 2004-08-31 Miguel de Icaza <miguel@ximian.com>
6725 * delegate.cs: Style.
6727 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
6729 * delegate.cs: Add seperate instance expr field for miguel.
6731 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6733 * PointerArithmetic (Resolve): make sure we are not doing
6734 pointer arith on void*. Also, make sure we are resolved
6735 by not setting eclass until resolve.
6737 All callers: Make sure that PointerArithmetic gets resolved.
6739 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6741 * ArrayCreation (LookupType): If the type does not resolve
6742 to an array, give an error.
6744 2004-08-27 Marek Safar <marek.safar@seznam.cz>
6746 * statement.cs (Try.Resolve): Fixed bug #64222
6748 2004-08-27 Martin Baulig <martin@ximian.com>
6751 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6754 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6756 * ecore.cs (Constantify): Get underlying type via
6757 System.Enum.GetUnderlyingType to avoid StackOverflow on the
6758 Windows in special cases.
6760 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6762 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6763 for obtaining also private methods.
6764 (GetRemoveMethod): Used GetRemoveMethod (true)
6765 for obtaining also private methods.
6767 2004-09-02 Martin Baulig <martin@ximian.com>
6769 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6770 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6773 2004-08-27 Martin Baulig <martin@ximian.com>
6776 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6779 2004-08-25 Martin Baulig <martin@ximian.com>
6781 * support.cs (ReflectionParameters..ctor): If this is a generic
6782 method, retrieve and store its type parameters.
6783 (InternalParameters..ctor): Added `TypeParameter[]' argument.
6784 (ReflectionParameters.GenericConstraints): The argument specifies
6785 the type parameter, not the method parameter.
6786 (InternalParameters.GenericConstraints): Likewise.
6788 * generic.cs (TypeParameter.DefineType): Correctly handle
6789 constraints wrt. generic methods in interfaces and their
6792 2004-08-24 Martin Baulig <martin@ximian.com>
6794 * generic.cs (TypeParameter.IsSubclassOf): New public method.
6795 (Constraints.IsSubclassOf): New internal method.
6797 * typemanager.cs (TypeManager.FindMembers): Added special support
6798 for GenericTypeParameterBuilder's.
6799 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
6802 2004-08-24 Martin Baulig <martin@ximian.com>
6805 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6806 this for accessibility checks.
6807 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6808 IsNestedFamilyAccessible.
6809 (TypeManager.IsSubclassOf): New method, do what the name actually
6812 2004-08-24 Martin Baulig <martin@ximian.com>
6814 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
6815 as a SimpleName, include the generic arity.
6817 2004-08-24 Martin Baulig <martin@ximian.com>
6819 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6820 MethodAttributes.HideBySig for operators.
6822 2004-08-23 Martin Baulig <martin@ximian.com>
6824 Back to the old error reporting system :-)
6826 * report.cs (Message): Removed.
6827 (Report.MessageData, ErrorData, WarningData): Removed.
6828 (Report.Error, Warning): Back to the old system.
6830 2004-08-23 Martin Baulig <martin@ximian.com>
6832 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6834 * class.cs (TypeContainer.ParentContainer): New public virtual
6835 method; replaces the explicit interface implementation.
6836 (ClassPart.ParentContainer): Override.
6838 2004-08-23 Martin Baulig <martin@ximian.com>
6840 * statement.cs (Switch): Added support for constant switches; see
6841 #59428 or test-285.cs.
6843 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6846 * statement.cs (GetEnumeratorFilter): Removed useless
6847 logic because C# specs is strict. GetEnumerator must be
6850 2004-08-22 Martin Baulig <martin@ximian.com>
6852 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6853 a switch and may break, reset the barrier. Fixes #59867.
6855 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6857 CLS-Compliance speed up (~5% for corlib)
6859 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6860 New method. Tests container for CLS-Compliant names
6862 * class.cs (TypeContainer.VerifyClsName): New method.
6863 Checks whether container name is CLS Compliant.
6864 (Constructor): Implements IMethodData.
6866 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6867 low-case table for CLS Compliance test.
6868 (MemberCache.VerifyClsParameterConflict): New method.
6869 Checks method parameters for CS3006 error.
6871 * enum.cs (EnumMember): Is derived from MemberCore.
6872 (Enum.VerifyClsName): Optimized for better performance.
6874 2004-08-06 Marek Safar <marek.safar@seznam.cz>
6876 * report.cs: Renamed Error_T to Error and changed all
6879 2004-08-06 Marek Safar <marek.safar@seznam.cz>
6881 * class.cs (TypeContainer.IndexerArrayList): New inner class
6882 container for indexers.
6883 (TypeContainer.DefaultIndexerName): New constant for default
6884 indexer name. Replaced all "Item" with this constant.
6885 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6887 * typemanager.cs (TypeManager.default_member_ctor): Cache here
6888 DefaultMemberAttribute constructor.
6890 2004-08-05 Martin Baulig <martin@ximian.com>
6892 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6895 2004-08-05 Marek Safar <marek.safar@seznam.cz>
6897 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6898 multi platforms problem.
6900 * compiler.csproj: Included shared files.
6902 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6904 Fix bug 60333, 55971 in the more general way
6905 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6906 Added arg_type argument for constant conversion.
6907 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6909 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6912 * class.cs (TypeContainer ): New inner classes MethodArrayList,
6913 OperatorArrayList, MethodCoreArrayList for typecontainer
6914 containers. Changed class member types to these new types.
6915 (MethodArrayList.DefineMembers): Added test for CS0659.
6917 2004-08-04 Miguel de Icaza <miguel@ximian.com>
6919 * cfold.cs: Synchronize the folding with the code in expression.cs
6920 Binary.DoNumericPromotions for uint operands.
6922 * attribute.cs: Revert patch from Raja, it introduced a regression
6923 while building Blam-1.2.1 (hard to isolate a test case).
6925 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6929 (TypeContainer.Define): Renamed to DefineContainerMembers because of
6931 (MethodCore.parent_method): New member. The method we're overriding
6932 if this is an override method.
6933 (MethodCore.CheckBase): Moved from Method class and made common.
6934 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6936 (MethodCore.CheckForDuplications): New abstract method. For custom
6937 member duplication search in a container
6938 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6939 method and its return type.
6940 (Event.conflict_symbol): New member. Symbol with same name in the
6944 (MemberCache.FindMemberWithSameName): New method. The method
6945 is looking for conflict with inherited symbols.
6947 2004-08-04 Martin Baulig <martin@ximian.com>
6949 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6951 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6953 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6955 * report.cs (Message): New enum for better error, warning reference in
6957 (MessageData): New inner abstract class. It generally handles printing of
6958 error and warning messages.
6959 Removed unused Error, Warning, Message methods.
6961 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6963 Fix for cs0592-8.cs test
6965 (Attributable.ValidAttributeTargets): Made public.
6966 (Attribute.ExplicitTarget): New member for explicit target value.
6967 (Attribute.CheckTargets): Now we translate explicit attribute
6968 target to Target here.
6970 2004-08-03 Ben Maurer <bmaurer@ximian.com>
6972 * ecore.cs (MethodGroupExpr): new IsBase property.
6974 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6976 * delegate.cs (DelegateCreation): store a MethodGroupExpr
6977 rather than an instance expr.
6979 (DelegateCreation.Emit): Use the method group rather than
6980 the instance expression. Also, if you have base.Foo as the
6981 method for a delegate, make sure to emit ldftn, not ldftnvirt.
6983 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
6985 (NewDelegate.DoResolve): Only check for the existance of Invoke
6986 if the method is going to be needed. Use MethodGroupExpr.
6988 (NewDelegate.Emit): Remove, DelegateCreation implements this.
6990 * expression.cs: For pointer arith., make sure to use
6991 the size of the type, not the size of the pointer to
6994 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6997 * class.cs (Class): Added error CS0502 test.
6999 2004-08-03 John Luke <jluke@cfl.rr.com>
7000 Raja R Harinath <rharinath@novell.com>
7003 * attribute.cs (Attribute.complained_before): New flag.
7004 (Attribute.ResolveType, Attribute.Resolve),
7005 (Attribute.DefinePInvokeMethod): Set it.
7006 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7008 2004-08-03 Martin Baulig <martin@ximian.com>
7010 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7011 use a user-defined operator; we still need to do numeric
7012 promotions in case one argument is a builtin type and the other
7013 one has an implicit conversion to that type. Fixes #62322.
7015 2004-08-18 Martin Baulig <martin@ximian.com>
7017 * class.cs (Method.Define): Use the correct method name when
7018 creating the MethodBuilder for a generic method.
7020 2004-08-17 Martin Baulig <martin@ximian.com>
7022 * generic.cs (Constraints): Support type parameter constraints.
7024 2004-08-16 Martin Baulig <martin@ximian.com>
7026 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
7027 (Token.GENERIC_DIMENSION): New token; this is returned if we
7028 encounter an unbound generic type in a typeof() expression.
7030 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
7031 this token is only generated while parsing a typeof() expression.
7032 (typeof_expression): Removed the old unbound_type hack.
7034 * generic.cs (TypeArguments.IsUnbound): New public property.
7036 * decl.cs (MemberName): Added support for unbound types.
7038 2004-08-14 Martin Baulig <martin@ximian.com>
7041 (TypeManager.IsEqualGenericInstance): New static method.
7042 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
7043 just used to check accessibility, so follow the rules of 26.1.6.
7045 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
7046 ConstructedType instead of a TypeExpression if we have type arguments.
7048 * cs-parser.jay (typeof_expression): Support unbound generic types.
7050 * ecore.cs (UnboundTypeExpression): New public class.
7052 2004-08-12 Martin Baulig <martin@ximian.com>
7054 * typemanager.cs (TypeManager.IsNestedChildOf): Use
7055 TypeManager.IsEqual() rather than `=='.
7057 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
7058 generic instances as well.
7060 2004-08-12 Martin Baulig <martin@ximian.com>
7062 * expression.cs (Invocation.InferType): We can only infer method
7063 type parameters. Fixes #62647.
7065 2004-08-11 Martin Baulig <martin@ximian.com>
7067 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
7068 before resolving the base classes.
7070 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7072 * Makefile: install .mdb file too.
7074 2004-08-05 Martin Baulig <martin@ximian.com>
7076 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
7077 initializer, the current type is just the TypeBuilder, not the
7078 instantiated generic type.
7079 (FieldExpr.IsFieldInitializer): New public property.
7081 2004-08-04 Martin Baulig <martin@ximian.com>
7083 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7085 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7087 2004-08-03 Martin Baulig <martin@ximian.com>
7089 * class.cs (MethodData.Define): If we're an explicit
7090 implementation, remove the generic arity from the type name.
7092 2004-08-03 Martin Baulig <martin@ximian.com>
7094 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7095 use a user-defined operator; we still need to do numeric
7096 promotions in case one argument is a builtin type and the other
7097 one has an implicit conversion to that type. Fixes #62322.
7099 2004-08-02 Martin Baulig <martin@ximian.com>
7101 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
7103 (TypeContainer.GetClassBases): Return the unexpanded list of
7104 interfaces; we expand them later.
7105 (TypeContainer.DefineType): After creating the TypeBuilder, call
7106 TypeManager.ExpandInterfaces() to get an expanded and resolved
7109 * ecore.cs (TypeExpr.GetInterfaces): Removed
7111 * generics.cs (Constraints.InterfaceConstraints): Remove.
7112 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
7113 register the interface constraints.
7116 (TypeManager.AddUserType): Removed the `ifaces' argument.
7117 (TypeManager.AddTypeParameter): Likewise.
7118 (TypeManager.AddUserInterface): Removed, was unused.
7119 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
7120 `TypeExpr[]' array for the interfaces.
7121 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
7122 has been defined, returns a list of the resolved interfaces types.
7123 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
7124 (TypeManager.GetExplicitInterfaces): Likewise.
7126 2004-08-02 Martin Baulig <martin@ximian.com>
7128 * expression.cs (Invocation.EmitCall): If we're invoking a method
7129 on a type parameter, use the new `Constrained' prefix opcode.
7131 2004-08-02 Martin Baulig <martin@ximian.com>
7133 * statement.cs (LocalInfo.Flags): Added `IsThis'.
7134 (LocalInfo.IsThis): New public property.
7135 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7137 2004-08-01 Martin Baulig <martin@ximian.com>
7139 * class.cs (TypeContainer.GetClassBases): Don't set the default
7140 here since we may get called from GetPartialBases().
7141 (TypeContainer.DefineType): If GetClassBases() didn't return a
7142 parent, use the default one.
7144 2004-07-30 Martin Baulig <martin@ximian.com>
7146 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7148 * class.cs (SourceMethod): New public class, derive from the
7149 symbol writer's ISourceMethod.
7150 (Method): Use the new symbol writer API.
7152 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7153 as argument and use the new symbol writer.
7156 (SourceFile): Implement the symbol writer's ISourceFile.
7157 (Location.SymbolDocument): Removed.
7158 (Location.SourceFile): New public property.
7160 * symbolwriter.cs: Use the new symbol writer API.
7162 2004-07-30 Raja R Harinath <rharinath@novell.com>
7164 * Makefile (install-local): Remove. Functionality moved to
7167 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
7169 * Makefile: Install mcs.exe.config file together with mcs.exe.
7170 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7171 correct runtime version.
7173 2004-07-25 Martin Baulig <martin@ximian.com>
7176 (TypeContainer.RegisterOrder): Removed, this was unused.
7177 (TypeContainer, interface_order): Removed.
7178 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7179 TypeContainer as argument since we can also be called with a
7180 `PartialContainer' for a partial class/struct/interface.
7181 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7182 of checking whether we're an `Interface' - we could be a
7184 (PartialContainer.Register): Override; call
7185 AddClass()/AddStruct()/AddInterface() on our parent.
7187 * cs-parser.jay (interface_member_declaration): Add things to the
7188 `current_container', not the `current_class'.
7190 * rootcontext.cs (RegisterOrder): The overloaded version which
7191 takes an `Interface' was unused, removed.
7193 * typemanager.cs (TypeManager.LookupInterface): Return a
7194 `TypeContainer', not an `Interface'.
7195 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7196 contain a `PartialContainer' for an interface, so check it's
7197 `Kind' to figure out what it is.
7199 2004-07-25 Martin Baulig <martin@ximian.com>
7201 * class.cs (Class.DefaultTypeAttributes): New public constant.
7202 (Struct.DefaultTypeAttributes): Likewise.
7203 (Interface.DefaultTypeAttributes): Likewise.
7204 (PartialContainer.TypeAttr): Override this and add the
7205 DefaultTypeAttributes.
7207 2004-07-25 Martin Baulig <martin@ximian.com>
7209 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7210 we can just use the `Parent' field instead.
7212 2004-07-25 Martin Baulig <martin@ximian.com>
7214 * class.cs (TypeContainer.Emit): Renamed to EmitType().
7216 2004-07-25 Martin Baulig <martin@ximian.com>
7218 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7219 our parts before defining any methods.
7220 (TypeContainer.VerifyImplements): Make this virtual.
7221 (ClassPart.VerifyImplements): Override and call VerifyImplements()
7222 on our PartialContainer.
7224 2004-07-25 Martin Baulig <martin@ximian.com>
7226 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7228 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7229 argument, we can just use the `Parent' field instead.
7232 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
7233 (MemberBase.DoDefine): Likewise.
7235 2004-07-24 Martin Baulig <martin@ximian.com>
7237 * decl.cs (MemberCore.Parent): New public field.
7238 (DeclSpace.Parent): Moved to MemberCore.
7240 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7241 (MemberBase.ctor): Added TypeContainer argument, pass it to our
7243 (FieldBase, Field, Operator): Likewise.
7244 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7245 (EventField, Event): Likewise.
7247 2004-07-23 Martin Baulig <martin@ximian.com>
7249 * class.cs (PartialContainer): New public class.
7250 (ClassPart): New public class.
7251 (TypeContainer): Added support for partial classes.
7252 (TypeContainer.GetClassBases): Splitted some of the functionality
7253 out into GetNormalBases() and GetPartialBases().
7255 * cs-tokenizer.cs (Token.PARTIAL): New token.
7256 (Tokenizer.consume_identifier): Added some hacks to recognize
7257 `partial', but only if it's immediately followed by `class',
7258 `struct' or `interface'.
7260 * cs-parser.jay: Added support for partial clases.
7262 2004-07-23 Martin Baulig <martin@ximian.com>
7264 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
7265 a `DeclSpace' and also made it readonly.
7266 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
7267 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
7268 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
7270 * cs-parser.jay: Pass the `current_class', not the
7271 `current_container' (at the moment, this is still the same thing)
7272 to a new Method, Property, Event, Indexer or Constructor.
7274 2004-07-23 Martin Baulig <martin@ximian.com>
7276 * cs-parser.jay (CSharpParser): Added a new `current_class' field
7277 and removed the `current_interface' one.
7278 (struct_declaration, class_declaration, interface_declaration):
7279 Set `current_class' to the newly created class/struct/interface;
7280 set their `Bases' and call Register() before parsing their body.
7282 2004-07-23 Martin Baulig <martin@ximian.com>
7284 * class.cs (Kind): New public enum.
7285 (TypeContainer): Made this class abstract.
7286 (TypeContainer.Kind): New public readonly field.
7287 (TypeContainer.CheckDef): New public method; moved here from
7289 (TypeContainer.Register): New public abstract method.
7290 (TypeContainer.GetPendingImplementations): New public abstract
7292 (TypeContainer.GetClassBases): Removed the `is_class' and
7293 `is_iface' parameters.
7294 (TypeContainer.DefineNestedTypes): Formerly known as
7296 (ClassOrStruct): Made this class abstract.
7298 * tree.cs (RootTypes): New public type.
7300 2004-07-20 Martin Baulig <martin@ximian.com>
7302 * tree.cs (Tree.RecordNamespace): Removed.
7303 (Tree.Namespaces): Removed.
7305 * rootcontext.cs (RootContext.IsNamespace): Removed.
7307 * cs-parser.jay (namespace_declaration): Just create a new
7308 NamespaceEntry here.
7310 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
7312 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
7313 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
7314 entry to make sure it runs in the correct runtime version.
7316 2004-07-18 Martin Baulig <martin@ximian.com>
7318 * generic.cs (ConstructedType.CheckConstraints): Improved
7319 constraints checking.
7321 2004-07-18 Martin Baulig <martin@ximian.com>
7323 * expression.cs (Invocation.BetterMethod): Call
7324 TypeManager.TypeToCoreType() on all types and removed my previous
7325 hack; we're already doig the right thing here.
7327 2004-07-17 Martin Baulig <martin@ximian.com>
7329 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
7331 2004-07-16 Martin Baulig <martin@ximian.com>
7333 * iterators.cs: Added generics support.
7335 2004-07-16 Martin Baulig <martin@ximian.com>
7337 * iterators.cs: Rewrote this. We're now using one single Proxy
7338 class for both the IEnumerable and the IEnumerator interface and
7339 `Iterator' derives from Class so we can use the high-level API.
7341 * class.cs (TypeContainer.AddIterator): New method.
7342 (TypeContainer.DoDefineType): New protected virtual method, which
7343 is called from DefineType().
7344 (TypeContainer.DoDefineMembers): Call DefineType() and
7345 DefineMembers() on all our iterators.
7346 (TypeContainer.Emit): Call Emit() on all our iterators.
7347 (TypeContainer.CloseType): Call CloseType() on all our iterators.
7349 * codegen.cs (EmitContext.CurrentIterator): New public field.
7351 2004-07-15 Martin Baulig <martin@ximian.com>
7354 (TypeManager.not_supported_exception_type): New type.
7356 2004-07-14 Martin Baulig <martin@ximian.com>
7359 (TypeManager.generic_ienumerable_type): New type.
7360 (TypeManager.generic_ienumerator_type): New type.
7363 (RootContext.interfaces_first_stage): Added
7364 "System.Collections.Generic.IEnumerator`1" and
7365 "System.Collections.Generic.IEnumerable`1".
7367 2004-07-14 Martin Baulig <martin@ximian.com>
7369 * iterators.cs: Use real error numbers.
7371 2004-07-14 Martin Baulig <martin@ximian.com>
7373 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
7374 requires this to be a System.Collection.IEnumerable and not a
7375 class implementing that interface.
7376 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
7378 2004-07-13 Marek Safar <marek.safar@seznam.cz>
7380 * class.cs: Fixed previous fix, it broke some error tests.
7382 2004-07-12 Martin Baulig <martin@ximian.com>
7384 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
7387 2004-07-14 Martin Baulig <martin@ximian.com>
7389 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
7390 an exclamation mark (!) for the generic arity to reflect the
7391 latest spec changes; ie. use "System.Collections.Generic.IList`1".
7393 2004-07-13 Martin Baulig <martin@ximian.com>
7395 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
7396 specifiers being part of a type argument.
7398 2004-07-13 Martin Baulig <martin@ximian.com>
7400 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
7401 name for generic types.
7403 2004-07-13 Martin Baulig <martin@ximian.com>
7405 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
7408 2004-07-09 Miguel de Icaza <miguel@ximian.com>
7410 * assign.cs (LocalTemporary): Add new argument: is_address,If
7411 `is_address' is true, then the value that we store is the address
7412 to the real value, and not the value itself.
7414 * ecore.cs (PropertyExpr): use the new local temporary
7415 stuff to allow us to handle X.Y += z (where X is a struct)
7417 2004-07-08 Martin Baulig <martin@ximian.com>
7419 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7420 not always return, just like we're doing in Using.Resolve().
7422 2004-07-07 Miguel de Icaza <miguel@ximian.com>
7424 * cs-parser.jay (fixed_statement): flag this as Pinned.
7426 2004-07-06 Miguel de Icaza <miguel@ximian.com>
7428 * typemanager.cs (TypeManager): Removed MakePinned method, this
7429 mechanism is replaced with the .NET 2.x compatible mechanism of
7430 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7432 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
7433 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7434 `IsFixed' property which has a different meaning.
7436 2004-07-02 Raja R Harinath <rharinath@novell.com>
7438 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7439 visible from inside a nested class, not just the names of the
7440 immediately enclosing class.
7443 2004-06-24 Raja R Harinath <rharinath@novell.com>
7445 * expression.cs (BetterConversion): Remove buggy special-case
7446 handling of "implicit constant expression conversions". At this
7447 point, we already know that the conversion is possible -- we're
7448 only checking to see which is better.
7450 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7452 * cs-parser.jay: Added error CS0210 test.
7454 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7456 * cs-parser.jay: Added error CS0134 test.
7458 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7461 * cs-parser.jay: Added error CS0145 test.
7463 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7465 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7467 2004-06-23 Ben Maurer <bmaurer@ximian.com>
7469 * expression.cs (StackAlloc.Resolve): The argument may not
7470 be a constant; deal with this case.
7472 2004-06-23 Marek Safar <marek.safar@seznam.cz>
7474 * attribute.cs (IndexerName_GetIndexerName): Renamed to
7475 GetIndexerAttributeValue.
7476 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7478 * class.cs (Indexer.Define): Added error tests for CS0415,
7481 2004-06-23 Miguel de Icaza <miguel@ximian.com>
7483 * attribute.cs (Attribute.Resolve): Keep field code in sync with
7486 2004-06-23 Martin Baulig <martin@ximian.com>
7488 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7489 neither return nor throw, reset the barrier as well. Fixes #60457.
7491 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
7493 * class.cs : EventAttributes is now set to None by default.
7494 This fixes bug #60459.
7496 2004-06-18 Marek Safar <marek.safar@seznam.cz>
7499 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7500 Don't throw exception but return null (it's sufficient now).
7502 2004-06-18 Marek Safar <marek.safar@seznam.cz>
7504 * typemanager.cs (GetArgumentTypes): Faster implementation.
7506 2004-06-18 Martin Baulig <martin@ximian.com>
7508 * attribute.cs (Attribute.Resolve): Check whether we're an
7509 EmptyCast which a Constant child. Fixes #60333.
7511 2004-06-17 Ben Maurer <bmaurer@ximian.com>
7513 * statement.cs (EmitCollectionForeach): Account for the fact that
7514 not all valuetypes are in areas which we can take the address of.
7515 For these variables, we store to a temporary variable. Also, make
7516 sure that we dont emit a `callvirt' on a valuetype method.
7518 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7520 * expression.cs (StackAlloc.DoReSolve): Added test for
7521 negative parameter (CS0247).
7523 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7526 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7528 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7531 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7534 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7536 Fix bug #58254 & cs1555.cs, cs1556.cs
7537 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7539 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7541 * cs-parser.jay: Added error CS1669 test for indexers.
7543 2004-06-18 Martin Baulig <martin@ximian.com>
7545 * generics.cs (GenericMethod.ctor): Don't take an Attributes
7546 argument. Fixes #60441.
7548 2004-06-16 Ben Maurer <bmaurer@ximian.com>
7549 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
7550 The name needs to have the actual name of the method in order
7551 for other tests (such as the one in OverloadResolve for Invoke
7552 on a delegate) to work. As well, it does not really help
7553 error reporting because the method group had multiple methods.
7554 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
7555 Make profiling work.
7557 2004-06-13 Martin Baulig <martin@ximian.com>
7559 * cs-parser.jay: Don't allow generic attributes.
7561 2004-06-13 Martin Baulig <martin@ximian.com>
7563 * class.cs (MemberBase.DoDefineBase): New protected method.
7564 (MemberBase.DoDefine): Compute the `flags' in the new
7565 DoDefineBase() which must be called first.
7566 (Method.Define): Call DoDefineBase() first so we have the flags
7567 when defining the generic method.
7569 * cs-parser.jay (interface_method_declaration): Support generic methods.
7571 2004-06-13 Martin Baulig <martin@ximian.com>
7573 * decl.cs (TypeName): Removed.
7574 (MemberName): Removed TypeName and MemberNow; now we just have
7577 * cs-parser.jay: Don't distinguish between type arguments and type
7578 parameters in the grammar and simplified the rules a bit. The
7579 reduce/reduce conflicts are now gone (except the one we inherited
7582 2004-06-11 Martin Baulig <martin@ximian.com>
7584 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7585 call this twice: for params and varargs methods.
7587 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7590 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7592 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7594 * attribute.cs (Attribute.GetValidTargets): Made public.
7597 (AbstractPropertyEventMethod): New class for better code sharing.
7598 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7600 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7602 2004-06-09 Martin Baulig <martin@ximian.com>
7604 * cs-parser.jay: Removed a reduce/reduce conflict.
7606 2004-06-03 Martin Baulig <martin@ximian.com>
7608 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
7609 GetSimpleName() and return a SimpleName.
7611 * ecore.cs (SimpleName.Arguments): New public field.
7612 (SimpleName): Added overloaded ctor which takes an additional
7613 TypeArguments argument.
7614 (SimpleName.SimpleNameResolve): Added support for generic methods.
7615 (MethodGroupExpr.ResolveGeneric): New public method. The code was
7616 formerly in MemberAccess.DoResolve(), but we also need it in
7617 SimpleNameResolve().
7619 * expression.cs (MemberAccess.DoResolve): Use the new
7620 MethodGroupExpr.ResolveGeneric().
7622 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7624 * decl.cs: If possible, use lookuptypedirect here. We can only do
7625 this if there is no `.' after the namespace. Avoids using
7626 LookupType, which does lots of slow processing.
7627 (FindNestedType) New method, does what it says :-).
7628 * namespace.cs: use LookupTypeDirect.
7629 * rootcontext.cs: use membercache, if possible.
7630 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7632 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7635 According to the spec,
7637 In a member access of the form E.I, if E is a single identifier,
7638 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7639 field, property, localvariable, or parameter with the same type as
7640 the meaning of E as a type-name (§3.8), then both possible
7641 meanings of E are permitted.
7643 We did not check that E as a simple-name had the same type as E as
7646 This trivial check gives us 5-7% on bootstrap time.
7648 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7650 * expression.cs (Invocation.OverloadResolve): Avoid the
7651 use of hashtables and boxing here by allocating on demand.
7653 2004-05-30 Martin Baulig <martin@ximian.com>
7655 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7656 we're doing a silent lookup. Don't try to lookup nested types in
7657 TypeManager.object_type (thanks to Ben Maurer).
7659 2004-05-30 Martin Baulig <martin@ximian.com>
7661 Committing a patch from Ben Maurer.
7663 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7665 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7667 * convert.cs: add a trivial cache for overload operator resolution.
7669 2004-05-31 Marek Safar <marek.safar@seznam.cz>
7672 (AttributeTester.GetObsoleteAttribute): Returns instance of
7673 ObsoleteAttribute when type is obsolete.
7676 (TypeContainer.VerifyObsoleteAttribute): Override.
7677 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7678 (MethodCode.VerifyObsoleteAttribute): Override.
7679 (MemberBase.VerifyObsoleteAttribute): Override.
7682 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7683 and report proper error.
7686 (Delegate.VerifyObsoleteAttribute): Override.
7689 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7690 and report proper error.
7691 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7694 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7698 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7699 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7700 Added test for ObsoleteAttribute.
7703 (Catch): Derived from Statement.
7705 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7707 * decl.cs: If possible, use lookuptypedirect here. We can only do
7708 this if there is no `.' after the namespace. Avoids using
7709 LookupType, which does lots of slow processing.
7710 (FindNestedType) New method, does what it says :-).
7711 * namespace.cs: use LookupTypeDirect.
7712 * rootcontext.cs: use membercache, if possible.
7713 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7715 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7718 According to the spec,
7720 In a member access of the form E.I, if E is a single identifier,
7721 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7722 field, property, localvariable, or parameter with the same type as
7723 the meaning of E as a type-name (§3.8), then both possible
7724 meanings of E are permitted.
7726 We did not check that E as a simple-name had the same type as E as
7729 This trivial check gives us 5-7% on bootstrap time.
7731 2004-05-30 Marek Safar <marek.safar@seznam.cz>
7733 Fixed bug #59071 & cs0160.cs
7734 * statement.cs (Try.Resolve): Check here whether order of catch
7735 clauses matches their dependencies.
7737 2004-05-30 Marek Safar <marek.safar@seznam.cz>
7740 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
7743 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7745 * expression.cs (Invocation.OverloadResolve): Avoid the
7746 use of hashtables and boxing here by allocating on demand.
7748 2004-05-30 Martin Baulig <martin@ximian.com>
7750 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7751 we're doing a silent lookup. Don't try to lookup nested types in
7752 TypeManager.object_type (thanks to Ben Maurer).
7754 2004-05-30 Martin Baulig <martin@ximian.com>
7756 Committing a patch from Ben Maurer.
7758 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7760 2004-05-29 Martin Baulig <martin@ximian.com>
7762 * class.cs (IMethodData.ShouldIgnore): New method.
7764 * typemanager.cs (TypeManager.MethodFlags): Don't take a
7765 `Location' argument, we don't need it anywhere. Use
7766 `IMethodData.ShouldIgnore ()' instead of
7767 `MethodData.GetMethodFlags ()'.
7768 (TypeManager.AddMethod): Removed.
7769 (TypeManager.AddMethod2): Renamed to AddMethod.
7771 2004-05-29 Martin Baulig <martin@ximian.com>
7773 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7775 * convert.cs (Convert.ImplicitReferenceConversion): If we're
7776 converting from a class type S to an interface type and we already
7777 have an object on the stack, don't box it again. Fixes #52578.
7779 2004-05-29 Martin Baulig <martin@ximian.com>
7781 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7782 Added support for `params' parameters. Fixes #59267.
7784 2004-05-29 Martin Baulig <martin@ximian.com>
7786 * literal.cs (NullPointer): Provide a private .ctor which sets
7787 `type' to TypeManager.object_type. Fixes #59048.
7789 2004-05-29 Martin Baulig <martin@ximian.com>
7791 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7792 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
7794 * ecore.cs (EventExpr.instance_expr): Make the field private.
7796 2004-05-26 Marek Safar <marek.safar@seznam.cz>
7798 Fixed bug #50080 & cs0214-2.cs
7799 * expression.cs (Cast.DoResolve): Check unsafe context here.
7801 * statement.cs (Resolve.DoResolve): Likewise.
7803 2004-05-26 Martin Baulig <martin@ximian.com>
7805 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7807 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7808 (RootContext.LookupType): Pass down the `silent' flag.
7810 2004-05-25 Martin Baulig <martin@ximian.com>
7813 (MethodGroupExpr.IdenticalTypeName): New public property.
7814 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7815 expression actually refers to a type.
7817 2004-05-25 Martin Baulig <martin@ximian.com>
7819 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7820 for #56176 and made it actually work.
7822 2004-05-25 Martin Baulig <martin@ximian.com>
7824 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7825 (FieldExpr, PropertyExpr): Override and implement
7826 CacheTemporaries. Fixes #52279.
7828 2004-05-25 Miguel de Icaza <miguel@ximian.com>
7830 * location.cs: In the new compiler listing a file twice is a
7831 warning, not an error.
7833 2004-05-24 Martin Baulig <martin@ximian.com>
7835 * enum.cs (Enum.DefineType): For the `BaseType' to be a
7836 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
7838 2004-05-24 Martin Baulig <martin@ximian.com>
7840 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7841 walking the `using' list. Fixes #53921.
7843 2004-05-24 Martin Baulig <martin@ximian.com>
7845 * const.cs (Const.LookupConstantValue): Added support for
7846 EmptyCast's; fixes #55251.
7848 2004-05-24 Martin Baulig <martin@ximian.com>
7850 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7851 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7852 which does the CS0135 check. The reason is that we first need to
7853 check whether the variable actually exists.
7855 2004-05-24 Martin Baulig <martin@ximian.com>
7857 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7858 than RootContext.LookupType() to find the explicit interface
7861 2004-05-24 Raja R Harinath <rharinath@novell.com>
7863 * Makefile: Simplify. Use executable.make.
7864 * mcs.exe.sources: New file. List of sources of mcs.exe.
7866 2004-05-24 Anders Carlsson <andersca@gnome.org>
7870 Use the invariant culture when doing String.Compare for CLS case
7873 2004-05-23 Martin Baulig <martin@ximian.com>
7875 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7876 don't have any dots. Fixes #52622, added cs0246-8.cs.
7878 * namespace.cs (NamespaceEntry.Lookup): Likewise.
7880 2004-05-23 Marek Safar <marek.safar@seznam.cz>
7882 * class.cs (MemberBase.Define): Reuse MemberType member for
7883 resolved type. Other methods can use it too.
7885 2004-05-23 Martin Baulig <martin@ximian.com>
7887 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7888 the variable also exists in the current block (otherwise, we need
7889 to report a CS0103). Fixes #58670.
7891 2004-05-23 Martin Baulig <martin@ximian.com>
7893 * flowanalysis.cs (Reachability.Reachable): Compute this
7894 on-the-fly rather than storing it as a field.
7896 2004-05-23 Martin Baulig <martin@ximian.com>
7898 * flowanalysis.cs (Reachability.And): Manually compute the
7899 resulting `barrier' from the reachability.
7901 2004-05-23 Marek Safar <marek.safar@seznam.cz>
7904 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7905 instance of ObsoleteAttribute when symbol is obsolete.
7908 (IMethodData): Extended interface for ObsoleteAttribute support.
7910 2004-05-22 Marek Safar <marek.safar@seznam.cz>
7912 * attribute.cs: Fix bug #55970
7914 2004-05-22 Marek Safar <marek.safar@seznam.cz>
7918 (GetObsoleteAttribute): New method. Creates the instance of
7920 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7921 ObsoleteAttribute when member is obsolete.
7922 (AttributeTester.Report_ObsoleteMessage): Common method for
7923 Obsolete error/warning reporting.
7926 (TypeContainer.base_classs_type): New member for storing parent type.
7929 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7930 for this MemberCore.
7932 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7934 * attribute.cs, const.cs: Fix bug #58590
7936 2004-05-21 Martin Baulig <martin@ximian.com>
7938 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7939 out parameters if the end of the method is unreachable. Fixes
7942 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7944 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7945 Hari was right, why extra method.
7947 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7949 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7951 2004-05-20 Martin Baulig <martin@ximian.com>
7953 * delegate.cs: Convert this file to Unix mode - like the original
7956 2004-05-20 Martin Baulig <martin@ximian.com>
7958 * attribute.cs: Convert this file to Unix mode - like the original
7961 2004-05-19 Marek Safar <marek.safar@seznam.cz>
7963 Fix bug #58688 (MCS does not report error when the same attribute
7966 * attribute.cs (Attribute.Emit): Distinction between null and default.
7968 2004-05-19 Raja R Harinath <rharinath@novell.com>
7970 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7971 of a top-level attribute without an attribute target.
7972 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
7974 (Attribute.Conditional_GetConditionName),
7975 (Attribute.Obsolete_GetObsoleteMessage): Update.
7976 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
7977 part of ScanForIndexerName.
7978 (Attribute.CanIgnoreInvalidAttribute): New function.
7979 (Attribute.ScanForIndexerName): Move to ...
7980 (Attributes.ScanForIndexerName): ... here.
7981 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7982 (Attributes.Search): New internal variant that can choose not to
7983 complain if types aren't resolved. The original signature now
7985 (Attributes.GetClsCompliantAttribute): Use internal variant, with
7986 complaints suppressed.
7987 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7988 only if it not useful.
7989 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7990 top-level for attributes that are shared between the assembly
7991 and a top-level class.
7992 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7993 * class.cs: Update to reflect changes.
7994 (DefineIndexers): Fuse loops.
7995 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
7996 a couple more variants of attribute names.
7998 2004-05-18 Marek Safar <marek.safar@seznam.cz>
8000 Fix bug #52585 (Implemented explicit attribute declaration)
8003 (Attributable.ValidAttributeTargets): New abstract method. It gets
8004 list of valid attribute targets for explicit target declaration.
8005 (Attribute.Target): It holds target itself.
8006 (AttributeSection): Removed.
8007 (Attribute.CheckTargets): New method. It checks whether attribute
8008 target is valid for the current element.
8011 (EventProperty): New class. For events that are declared like
8012 property (with add and remove accessors).
8013 (EventField): New class. For events that are declared like field.
8016 * cs-parser.jay: Implemented explicit attribute target declaration.
8018 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
8019 Override ValidAttributeTargets.
8022 (ReturnParameter): Class for applying custom attributes on
8024 (ParameterAtribute): New class. Class for applying custom
8025 attributes on the parameter type.
8027 2004-05-17 Miguel de Icaza <miguel@ximian.com>
8029 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8032 (Method): Allow UNSAFE here.
8034 * modifiers.cs: Support unsafe reporting.
8036 2004-05-17 Marek Safar <marek.safar@seznam.cz>
8038 * decl.cs: Fix bug #58478.
8040 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8042 * statement.cs: When checking for unreachable code on an EmptyStatement,
8043 set the location. Fixes bug #58488.
8045 2004-05-13 Miguel de Icaza <miguel@ximian.com>
8047 * driver.cs: Add -pkg handling.
8049 From Gonzalo: UseShelLExecute=false
8051 2004-05-12 Marek Safar <marek.safar@seznam.cz>
8054 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8056 (Attribute.IsClsCompliaceRequired): Moved to base for better
8058 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8059 when attribute is AttributeUsageAttribute.
8060 (Attribute.GetValidTargets): Simplified.
8061 (Attribute.GetAttributeUsage): New method returns AttributeUsage
8062 attribute for this type.
8063 (Attribute.ApplyAttributes): Method renamed to Emit and make
8065 (GlobalAttributeSection): New class for special handling of global
8066 attributes (assembly, module).
8067 (AttributeSection.Emit): New method.
8069 * class.cs: Implemented Attributable abstract methods.
8070 (MethodCore.LabelParameters): Moved to Parameter class.
8071 (Accessor): Is back simple class.
8072 (PropertyMethod): Implemented Attributable abstract class.
8073 (DelegateMethod): Implemented Attributable abstract class.
8074 (Event): New constructor for disctintion between normal Event
8075 and Event with accessors.
8077 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8079 * codegen.cs, const.cs, decl.cs, delegate.cs:
8080 (CommonAssemblyModulClass): Implemented Attributable abstract class
8083 * enum.cs: Implement IAttributeSupport interface.
8084 (EnumMember): New class for emum members. Implemented Attributable
8088 (ParameterBase): Is abstract.
8089 (ReturnParameter): New class for easier [return:] attribute handling.
8091 * typemanager.cs: Removed builder_to_attr.
8093 2004-05-11 Raja R Harinath <rharinath@novell.com>
8096 * attribute.cs (Attribute.GetPositionalValue): New function.
8097 * class.cs (TypeContainer.VerifyMembers): New function.
8098 (TypeContainer.Emit): Use it.
8099 (ClassOrStruct): New base class for Class and Struct.
8100 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
8101 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8103 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8104 then each non-static field should have a FieldOffset attribute.
8105 Otherwise, none of the fields should have a FieldOffset attribute.
8106 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
8107 and FieldOffset attributes.
8108 * typemanager.cs (TypeManager.struct_layout_attribute_type)
8109 (TypeManager.field_offset_attribute_type): New core types.
8110 (TypeManager.InitCoreTypes): Initialize them.
8112 2004-05-11 Michal Moskal <malekith@pld-linux.org>
8114 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8115 Return correct type.
8118 2004-05-09 Miguel de Icaza <miguel@ximian.com>
8120 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8121 be implicitly converted to ulong.
8123 * expression.cs: The logic for allowing operator &, | and ^ worked
8124 was wrong, it worked before because we did not report an error in
8125 an else branch. Fixes 57895.
8127 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8128 allow volatile fields to be reference types.
8130 2004-05-07 Miguel de Icaza <miguel@ximian.com>
8132 * driver.cs: Add support for /debug-
8134 2004-05-07 Raja R Harinath <rharinath@novell.com>
8136 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
8137 Add a 'complain' parameter to silence errors.
8138 (Attribute.Resolve): Update to changes. Put in sanity check to catch
8139 silently overlooked type-resolutions.
8140 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8142 (Attributes.Search): New function.
8143 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8144 (Attributes.GetAttributeFullName): Remove hack.
8145 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
8146 Update to reflect changes.
8147 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8148 Use Attributes.Search instead of nested loops.
8150 2004-05-07 Marek Safar <marek.safar@seznam.cz>
8153 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
8154 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
8155 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
8157 * report.cs: (Report.Warning): Renamed to Warning_T because of
8158 parameter collision.
8160 2004-05-05 Raja R Harinath <rharinath@novell.com>
8162 * expression.cs (MemberAccess.ResolveMemberAccess):
8163 Exit with non-zero status after Report.Error.
8164 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
8166 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
8168 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
8170 * support.cs: Don't hang when the file is empty.
8172 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
8174 * support.cs: In SeekableStreamReader, compute the preamble size of the
8175 underlying stream. Position changes should take into account that initial
8178 2004-05-03 Todd Berman <tberman@sevenl.net>
8180 * driver.cs: remove unused GetSysVersion function.
8182 2004-05-03 Todd Berman <tberman@sevenl.net>
8184 * driver.cs: Remove the hack from saturday, as well as the hack
8185 from jackson (LoadAssemblyFromGac), also adds the CWD to the
8186 link_paths to get that bit proper.
8188 2004-05-01 Todd Berman <tberman@sevenl.net>
8190 * driver.cs: Try a LoadFrom before a Load, this checks the current
8191 path. This is currently a bug in mono that is be fixed, however, this
8192 provides a workaround for now. This will be removed when the bug
8195 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
8197 * CryptoConvert.cs: Updated to latest version. Fix issue with
8198 incomplete key pairs (#57941).
8200 2004-05-01 Todd Berman <tberman@sevenl.net>
8202 * driver.cs: Remove '.' from path_chars, now System.* loads properly
8205 2004-04-30 Jackson Harper <jackson@ximian.com>
8207 * codegen.cs: Open keys readonly.
8209 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8211 * typemanager.cs: don't report cyclic struct layout when a struct
8212 contains 2 or more fields of the same type. Failed for Pango.AttrShape
8213 which has 2 Pango.Rectangle fields.
8215 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
8217 * expression.cs: Handle IntPtr comparisons with IL code
8218 rather than a method call.
8220 2004-04-29 Martin Baulig <martin@ximian.com>
8222 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
8223 the list of PropertyInfo's in class hierarchy and find the
8224 accessor. Fixes #56013.
8226 2004-04-29 Martin Baulig <martin@ximian.com>
8228 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
8230 2004-04-29 Martin Baulig <martin@ximian.com>
8232 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8234 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
8236 2004-04-29 Martin Baulig <martin@ximian.com>
8238 * class.cs (ConstructorInitializer.Resolve): Check whether the
8239 parent .ctor is accessible. Fixes #52146.
8241 2004-04-29 Martin Baulig <martin@ximian.com>
8243 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8245 * statement.cs (Using.EmitLocalVariableDecls): Use
8246 TypeManager.idisposable_type, not typeof (IDisposable).
8247 (Foreach.EmitCollectionForeach): Added support for valuetypes.
8249 2004-04-29 Martin Baulig <martin@ximian.com>
8251 * class.cs (Event.Define): Don't emit the field and don't set
8252 RTSpecialName and SpecialName for events on interfaces. Fixes
8255 2004-04-29 Raja R Harinath <rharinath@novell.com>
8257 Refactor Attribute.ApplyAttributes.
8258 * attribute.cs (Attributable): New base class for objects that can
8259 have Attributes applied on them.
8260 (Attribute): Make AttributeUsage fields public.
8261 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
8262 (Attribute.IsInternalCall): New property.
8263 (Attribute.UsageAttr): Convert to a public read-only property.
8264 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
8265 (Attribute.ResolveType, Attribute.Resolve)
8266 (Attribute.ScanForIndexerName): Update to reflect changes.
8267 (Attribute.CheckAttributeTarget): Re-format.
8268 (Attribute.ApplyAttributes): Refactor, to various
8269 Attributable.ApplyAttributeBuilder methods.
8270 * decl.cs (MemberCore): Make Attributable.
8271 * class.cs (Accessor): Make Attributable.
8272 (MethodData.ApplyAttributes): Use proper attribute types, not
8274 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
8275 (TypeContainer.ApplyAttributeBuilder)
8276 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
8277 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
8278 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
8279 (Operator.ApplyAttributeBuilder): New factored-out methods.
8280 * const.cs (Const.ApplyAttributeBuilder): Likewise.
8281 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
8282 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
8283 * parameter.cs (ParameterBase): New Attributable base class
8284 that can also represent Return types.
8285 (Parameter): Update to the changes.
8287 2004-04-29 Jackson Harper <jackson@ximian.com>
8289 * driver.cs: Prefer the corlib system version when looking for
8290 assemblies in the GAC. This is still a hack, but its a better hack
8293 2004-04-29 Marek Safar <marek.safar@seznam.cz>
8295 * decl.cs, enum.cs: Improved error 3005 reporting.
8297 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
8298 (related_symbols): New private member for list of symbols
8299 related to reported error/warning.
8301 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
8303 2004-04-29 Martin Baulig <martin@ximian.com>
8305 * ecore.cs (Expression.Constantify): If we're an enum and
8306 TypeManager.TypeToCoreType() doesn't give us another type, use
8307 t.UnderlyingSystemType. Fixes #56178.
8309 2004-04-29 Martin Baulig <martin@ximian.com>
8311 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
8312 interfaces and for each interface, only add members directly
8313 declared in that interface. Fixes #53255.
8315 2004-04-28 Martin Baulig <martin@ximian.com>
8317 * expression.cs (ConditionalLogicalOperator): Use a temporary
8318 variable for `left' to avoid that we evaluate it more than once;
8321 2004-04-28 Martin Baulig <martin@ximian.com>
8323 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
8326 2004-04-28 Martin Baulig <martin@ximian.com>
8328 * statement.cs (LocalInfo.Resolve): Check whether the type is not
8331 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
8332 whether the type is not void (CS1547).
8334 2004-04-28 Martin Baulig <martin@ximian.com>
8336 * expression.cs (Unary.DoResolveLValue): Override this and report
8337 CS0131 for anything but Operator.Indirection.
8339 2004-04-28 Martin Baulig <martin@ximian.com>
8341 Committing a patch from Ben Maurer; see bug #50820.
8343 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8346 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8349 2004-04-28 Martin Baulig <martin@ximian.com>
8351 Committing a patch from Ben Maurer; see bug #50820.
8353 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8356 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8359 2004-04-28 Martin Baulig <martin@ximian.com>
8361 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
8362 (Block.AddLabel): Call DoLookupLabel() to only search in the
8365 2004-04-28 Martin Baulig <martin@ximian.com>
8367 * cfold.cs (ConstantFold.BinaryFold): Added special support for
8368 comparing StringConstants and NullLiterals in Equality and Inequality.
8370 2004-04-28 Jackson Harper <jackson@ximian.com>
8372 * driver.cs: Attempt to load referenced assemblies from the
8373 GAC. This is the quick and dirty version of this method that
8374 doesnt take into account versions and just takes the first
8375 canidate found. Will be good enough for now as we will not have more
8376 then one version installed into the GAC until I update this method.
8378 2004-04-28 Martin Baulig <martin@ximian.com>
8380 * typemanager.cs (TypeManager.CheckStructCycles): New public
8381 static method to check for cycles in the struct layout.
8383 * rootcontext.cs (RootContext.PopulateTypes): Call
8384 TypeManager.CheckStructCycles() for each TypeContainer.
8385 [Note: We only need to visit each type once.]
8387 2004-04-28 Martin Baulig <martin@ximian.com>
8389 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
8391 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
8392 success and added `out object value'. Use a `bool resolved' field
8393 to check whether we've already been called rather than
8394 `ConstantValue != null' since this breaks for NullLiterals.
8396 2004-04-28 Raja R Harinath <rharinath@novell.com>
8398 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
8399 setting of this flag, since the 'set' method may be non-public.
8401 2004-04-28 Raja R Harinath <rharinath@novell.com>
8403 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
8404 check on current_vector.Block.
8406 2004-04-27 Martin Baulig <martin@ximian.com>
8408 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
8409 a field initializer. Fixes #56459.
8411 2004-04-27 Martin Baulig <martin@ximian.com>
8413 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
8414 we're not attempting to use an indexer. Fixes #52154.
8416 2004-04-27 Martin Baulig <martin@ximian.com>
8418 * statement.cs (Return): Don't create a return label if we don't
8419 need it; reverts my change from January 20th. Thanks to Ben
8422 2004-04-27 Martin Baulig <martin@ximian.com>
8424 According to the spec, `goto' can only leave a nested scope, but
8427 * statement.cs (Block.LookupLabel): Only lookup in the current
8428 block, don't recurse into parent or child blocks.
8429 (Block.AddLabel): Check in parent and child blocks, report
8430 CS0140/CS0158 if we find a duplicate.
8431 (Block): Removed this indexer for label lookups.
8432 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8433 this already does the error reporting for us.
8436 (FlowBranching.UsageVector.Block): New public variable; may be null.
8437 (FlowBranching.CreateSibling): Added `Block' argument.
8438 (FlowBranching.LookupLabel): New public virtual method. Lookup a
8439 label for the target of a `goto' and check whether we're not
8440 leaving a `finally'.
8442 2004-04-27 Martin Baulig <martin@ximian.com>
8444 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8445 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8448 2004-04-27 Martin Baulig <martin@ximian.com>
8450 * statement.cs (Block.AddLabel): Also check for implicit blocks
8451 and added a CS0158 check.
8453 2004-04-27 Martin Baulig <martin@ximian.com>
8455 * flowanalysis.cs (FlowBranchingLoop): New class.
8456 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
8457 UsageVector's instead of an ArrayList.
8458 (FlowBranching.Label): Likewise.
8459 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
8460 (FlowBranching.AddBreakVector): New method.
8462 2004-04-27 Miguel de Icaza <miguel@ximian.com>
8464 * attribute.cs: Small regression fix: only convert the type if we
8465 the type is different, fixes System.Drawing build.
8467 2004-04-27 Martin Baulig <martin@ximian.com>
8469 * attribute.cs (Attribute.Resolve): If we have a constant value
8470 for a named field or property, implicity convert it to the correct
8473 2004-04-27 Raja R Harinath <rharinath@novell.com>
8475 * statement.cs (Block.Block): Implicit blocks share
8476 'child_variable_names' fields with parent blocks.
8477 (Block.AddChildVariableNames): Remove.
8478 (Block.AddVariable): Mark variable as "used by a child block" in
8479 every surrounding block.
8480 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
8481 been used in a child block, complain about violation of "Invariant
8482 meaning in blocks" rule.
8483 * cs-parser.jay (declare_local_variables): Don't use
8484 AddChildVariableNames.
8485 (foreach_statement): Don't create an implicit block: 'foreach'
8488 2004-04-23 Miguel de Icaza <miguel@ximian.com>
8490 * convert.cs (ImplicitNumericConversion): 0 is also positive when
8491 converting from 0L to ulong. Fixes 57522.
8493 2004-04-22 Marek Safar <marek.safar@seznam.cz>
8495 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
8496 derived class hides via 'new' keyword field from base class (test-242.cs).
8497 TODO: Handle this in the more general way.
8499 * class.cs (CheckBase): Ditto.
8501 2004-04-22 Marek Safar <marek.safar@seznam.cz>
8503 * decl.cs (caching_flags): New member for storing cached values
8505 (MemberCore.Flags): New enum where bit flags for caching_flags
8507 (MemberCore.cls_compliance): Moved to caching_flags.
8508 (DeclSpace.Created): Moved to caching_flags.
8510 * class.cs: Use caching_flags instead of DeclSpace.Created
8512 2004-04-21 Miguel de Icaza <miguel@ximian.com>
8514 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
8515 if we are only a derived class, not a nested class.
8517 * typemanager.cs: Same as above, but do this at the MemberLookup
8518 level (used by field and methods, properties are handled in
8519 PropertyExpr). Allow for the qualified access if we are a nested
8522 2004-04-21 Marek Safar <marek.safar@seznam.cz>
8524 * class.cs: Refactoring.
8525 (IMethodData): New inteface; Holds links to parent members
8526 to avoid member duplication (reduced memory allocation).
8527 (Method): Implemented IMethodData interface.
8528 (PropertyBase): New inner classes for get/set methods.
8529 (PropertyBase.PropertyMethod): Implemented IMethodData interface
8530 (Event): New inner classes for add/remove methods.
8531 (Event.DelegateMethod): Implemented IMethodData interface.
8533 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8534 EmitContext (related to class.cs refactoring).
8536 2004-04-21 Raja R Harinath <rharinath@novell.com>
8538 * delegate.cs (Delegate.VerifyApplicability): If the number of
8539 arguments are the same as the number of parameters, first try to
8540 verify applicability ignoring any 'params' modifier on the last
8544 2004-04-08 Martin Baulig <martin@ximian.com>
8546 Merged latest changes into gmcs. Please keep this comment in
8547 here, it makes it easier for me to see what changed in MCS since
8548 the last time I merged.
8550 2004-04-16 Raja R Harinath <rharinath@novell.com>
8552 * class.cs (TypeContainer.AddIndexer): Use
8553 'ExplicitInterfaceName' to determine if interface name was
8554 explicitly specified. 'InterfaceType' is not initialized at this time.
8555 (TypeContainer.DefineIndexers): Remove use of temporary list. The
8556 Indexers array is already in the required order. Initialize
8557 'IndexerName' only if there are normal indexers.
8558 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8559 (TypeContainer.Emit): Emit DefaultMember attribute only if
8560 IndexerName is initialized.
8563 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
8565 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8568 2004-04-15 Raja R Harinath <rharinath@novell.com>
8570 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
8574 * attribute.cs (Attribute.Resolve): Check for duplicate named
8578 2004-04-15 Miguel de Icaza <miguel@ximian.com>
8580 * iterators.cs (MarkYield): track whether we are in an exception,
8581 and generate code accordingly. Use a temporary value to store the
8582 result for our state.
8584 I had ignored a bit the interaction of try/catch with iterators
8585 since their behavior was not entirely obvious, but now it is
8586 possible to verify that our behavior is the same as MS .NET 2.0
8590 2004-04-14 Miguel de Icaza <miguel@ximian.com>
8592 * iterators.cs: Avoid creating temporaries if there is no work to
8595 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8596 Enumerations, use TypeManager.EnumToUnderlying and call
8599 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8602 (This.Emit): Use EmitContext.EmitThis to emit our
8605 (This.EmitAssign): Ditto.
8607 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8608 codepaths, we will move all the functionality into
8611 (FieldExpr.EmitAssign): Ditto.
8613 This fixes several hidden bugs that I uncovered while doing a code
8614 review of this today.
8616 * codegen.cs (EmitThis): reworked so the semantics are more clear
8617 and also support value types "this" instances.
8619 * iterators.cs: Changed so that for iterators in value types, we
8620 do not pass the value type as a parameter.
8622 Initialization of the enumerator helpers is now done in the caller
8623 instead of passing the parameters to the constructors and having
8624 the constructor set the fields.
8626 The fields have now `assembly' visibility instead of private.
8628 2004-04-11 Miguel de Icaza <miguel@ximian.com>
8630 * expression.cs (Argument.Resolve): Check if fields passed as ref
8631 or out are contained in a MarshalByRefObject.
8633 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8634 another compiler type.
8636 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
8638 * class.cs (Indexer.Define): use the new name checking method.
8639 Also, return false on an error.
8640 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8641 (is_identifier_[start/part]_character): make static.
8643 2004-04-10 Miguel de Icaza <miguel@ximian.com>
8645 * expression.cs (Binary.ResolveOperator): Do no append strings
8646 twice: since we can be invoked more than once (array evaluation)
8647 on the same concatenation, take care of this here. Based on a fix
8648 from Ben (bug #56454)
8650 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8652 * codegen.cs: Fix another case where CS1548 must be reported (when
8653 delay-sign isn't specified and no private is available #56564). Fix
8654 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8655 error when MCS is used on the MS runtime and we need to delay-sign
8656 (which seems unsupported by AssemblyBuilder - see #56621).
8658 2004-04-08 Marek Safar <marek.safar@seznam.cz>
8660 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8661 (TypeManager.ComputeNamespaces): Faster implementation for
8664 * compiler.csproj: Updated AssemblyName to mcs.
8666 2004-05-11 Jackson Harper <jackson@ximian.com>
8668 * Makefile: Preserve MONO_PATH
8670 2004-05-11 Jackson Harper <jackson@ximian.com>
8672 * Makefile: Use mono and mcs to build gmcs
8674 2004-05-03 Miguel de Icaza <miguel@ximian.com>
8676 * codegen.cs: Add patch from Robert Shade
8677 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
8680 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
8682 * CryptoConvert.cs: Updated to latest version. Fix issue with
8683 incomplete key pairs (#57941).
8685 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8687 * codegen.cs: Fix another case where CS1548 must be reported (when
8688 delay-sign isn't specified and no private is available #56564). Fix
8689 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8690 error when MCS is used on the MS runtime and we need to delay-sign
8691 (which seems unsupported by AssemblyBuilder - see #56621).
8693 2004-04-29 Jackson Harper <jackson@ximian.com>
8695 * Makefile: Set MONO_PATH to use the bootstrap corlib
8696 * driver.cs: Check the GAC for referenced assemblies.
8698 2004-04-29 Martin Baulig <martin@ximian.com>
8700 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
8702 2004-04-07 Martin Baulig <martin@ximian.com>
8704 * expression.cs (Binary.ResolveOperator): Added special case for
8705 Equality/Inequality between a type parameter and a null literal.
8707 2004-04-07 Martin Baulig <martin@ximian.com>
8709 * convert.cs: Check null literal -> type parameter conversions.
8711 2004-04-07 Martin Baulig <martin@ximian.com>
8713 * generic.cs (ConstructedType.CheckConstraints): Enforce the
8714 `class' and `struct' constraints.
8716 2004-04-07 Martin Baulig <martin@ximian.com>
8718 * generic.cs (SpecialConstraint): New public enum.
8719 (Constraints.Resolve): Added support for the `class' and `struct'
8722 * cs-parser.jay (type_parameter_constraint): Added support for the
8723 `class' and `struct' constraints.
8725 2004-04-07 Martin Baulig <martin@ximian.com>
8727 * support.cs (GenericConstraints): Replaced `Types' by
8728 `ClassConstraint' and `InterfaceConstraints'; added
8729 `HasClassConstraint'.
8731 2004-04-07 Martin Baulig <martin@ximian.com>
8734 (Constraints.InterfaceConstraints): New public property.
8735 (Constraints.Types): Make this property public
8736 (TypeParameter): Implement IMemberContainer.
8737 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
8738 instead of a TypeBuilder/MethodBuilder; pass the interface
8739 constraints to TypeManager.AddTypeParameter().
8740 (TypeParameter.DefineType): Just take an EmitContext and no
8741 TypeBuilder/MethodBuilder. Use the new public API.
8743 * typemanager.cs (TypeManager.AddTypeParameter): Added
8744 `TypeExpr[]' argument; add the interfaces to the
8745 `builder_to_ifaces' hash.
8746 (TypeManager.LookupMemberContainer): For
8747 GenericTypeParameterBuilders, get the TypeParameter from the
8748 `builder_to_type_param'.
8749 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
8750 the TypeParameter and call FindMembers on it.
8752 2004-04-07 Martin Baulig <martin@ximian.com>
8755 (MethodCore.GenericMethod): Moved this field here from Method.
8756 (MethodCore.IsDuplicateImplementation): Take the number of type
8757 parameters into account if we're a generic method.
8759 * expression.cs (Invocation.InferTypeArguments): Don't return true
8760 if `arguments' is null; we still need to check whether we actually
8761 don't need to infer anything in this case.
8762 (MemberAccess): Merged the functionality from GenericMemberAccess
8765 * generic.cs (GenericMemberAccess): Removed.
8767 2004-04-05 Martin Baulig <martin@ximian.com>
8769 * decl.cs (MemberCore): For generic classes, interfaces and
8770 structs, `Name' now includes the number of type parameters
8772 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
8773 encode the number of type arguments in the type name.
8775 * expression.cs (Expression.MemberLookup): Removed the
8776 `num_type_args' argument; we now encode the number of type
8777 arguments in the type name.
8779 * ecore.cs (SimpleName): Encode the number of type arguments in
8780 the type name itself.
8782 * generic.cs (ConstructedType): Likewise.
8784 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
8785 `MemberName'; we now include the number of type parameters in the
8788 * typemanager.cs (TypeManager.CheckGeneric): Removed.
8789 (TypeManager.MemberLookup): Removed the
8790 `num_type_args' argument; we now encode the number of type
8791 arguments in the type name.
8793 2004-04-03 Martin Baulig <martin@ximian.com>
8795 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
8796 (MemberCore.MemberName): Moved here from MemberBase.
8797 (DeclSpace.SetParameterInfo): Just take the constraints as an
8798 ArrayList; we already have the type parameters in our
8799 `MemberName'; also do the CS0080 reporting here.
8801 * cs-parser.jay (struct_declaration): Use `member_name' instead of
8802 `IDENTIFIER opt_type_parameter_list'; when constructing our
8803 `MemberName', it'll already include our type parameters.
8804 (class_declaration, interface_declaration): Likewise.
8805 (delegate_declaration): Likewise.
8806 (MakeName): Take a MemberName and return a MemberName.
8807 The following two changes are required to avoid shift/reduce conflicts:
8808 (member_name): Don't include a TypeName anymore; ie. this is now
8809 just 'IDENTIFIER opt_type_parameter_list'.
8810 (property_declaration, event_declaration): Use a
8811 `namespace_or_type_name' instead of a `member_name'.
8813 2004-04-03 Martin Baulig <martin@ximian.com>
8815 * decl.cs (MemberName): Renamed to `TypeName' and created a new
8817 (TypeName): Formerly known as MemberName.
8819 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
8820 instead of a `MemberName'.
8822 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
8823 (member_name): New rule; create a MemberName.
8825 2004-04-02 Martin Baulig <martin@ximian.com>
8827 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
8828 (CS0305 and CS0308).
8830 2004-04-02 Martin Baulig <martin@ximian.com>
8832 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
8833 support for nested types.
8835 2004-04-02 Martin Baulig <martin@ximian.com>
8837 * ecore.cs (IAlias): New public interface.
8838 (TypeExpr, TypeExpression): Implement IAlias.
8839 (TypeAliasExpression): New public class.
8841 * namespace.cs (Namespace): Implement IAlias.
8842 (Namespace.Lookup): Return an IAlias instead on an object.
8843 (Namespace.DefineName): Take an IAlias instead of an object.
8844 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
8846 (NamespaceEntry.UsingAlias): Take a Membername instead of an
8848 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
8850 (NamespaceEntry.Lookup): Likewise.
8852 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
8855 * decl.cs (DeclSpace): Implement IAlias.
8856 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
8858 * generic.cs (ConstructedType): Improved error checking.
8860 2004-04-02 Martin Baulig <martin@ximian.com>
8862 * convert.cs: Added type parameter conversions.
8865 (UnboxCast.Emit): Emit an `unbox.any' for type params.
8866 (ClassCast.Emit): If the source type is a type parameter, box it.
8867 If the target type is a type parameter, emit an `unbox.any'
8868 instead of a `classcast'.1
8870 2004-04-01 Martin Baulig <martin@ximian.com>
8872 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
8874 2004-04-01 Martin Baulig <martin@ximian.com>
8876 * generic.cs (ConstructedType.CheckConstraints): Use
8877 Convert.ImplicitStandardConversionExists(); user-defined implicit
8878 conversions are not allowed according to the spec.
8880 2004-03-30 Martin Baulig <martin@ximian.com>
8882 * expression.cs (New): Added support for type parameters.
8885 (TypeManager.activator_type): New public static field.
8886 (TypeManager.activator_create_instance): Likewise.
8888 2004-03-30 Martin Baulig <martin@ximian.com>
8890 * typemanager.cs (TypeManager.HasConstructorConstraint): New
8893 2004-03-30 Martin Baulig <martin@ximian.com>
8895 * generic.cs (ConstructedType.CheckConstraints): Actually follow
8896 the spec here: the argument type must be convertible to the
8899 2004-03-30 Martin Baulig <martin@ximian.com>
8902 (TypeParameter.Define, TypeParameter.DefineMethod): Call
8903 TypeManager.AddTypeParameter().
8904 (ConstructedType.CheckConstraints): Re-enable this and actually
8905 check whether we have a constructor constraint.
8908 (TypeManager.builder_to_type_param): New static field.
8909 (TypeManager.AddTypeParameter): New static method.
8910 (TypeManager.LookupTypeParameter): New public method.
8912 2004-03-30 Martin Baulig <martin@ximian.com>
8914 * generic.cs (TypeParameter.DefineType): Return a boolean and use
8915 the new API to actually define the constructor constraint.
8918 (TypeManager.new_constraint_attr_type): New static field.
8919 (TypeManager.InitCoreTypes): Initialize it.
8921 2004-03-30 Martin Baulig <martin@ximian.com>
8923 * generic.cs (Constraints): Completed error checking, use correct
8926 2004-03-29 Martin Baulig <martin@ximian.com>
8928 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
8930 * expression.cs (Invocation.InferTypeArguments): Added overloaded
8931 public version which takes a `ParameterData pd' instead of an
8934 2004-03-29 Martin Baulig <martin@ximian.com>
8936 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
8939 2004-03-29 Martin Baulig <martin@ximian.com>
8941 * expression.cs (Argument.ResolveMethodGroup): If we're a
8942 ConstructedType, call GetMemberAccess() on it.
8944 2004-03-29 Martin Baulig <martin@ximian.com>
8946 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
8947 (MethodCore.CheckGenericOverride): When overriding a generic
8948 method, check whether the constraints match.
8950 * support.cs (GenericConstraints): New public interface.
8951 (ParameterData.GenericConstraints): New public method.
8953 * parameter.cs (Parameter.Resolve): Check whether we're a generic
8954 method parameter and compute our constraints if appropriate.
8955 (Parameter.GenericConstraints): New public property.
8957 * generic.cs (Constraints): Implement GenericConstraints.
8959 2004-03-29 Martin Baulig <martin@ximian.com>
8961 * decl.cs (MemberCache.FindMemberToOverride): Use
8962 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
8964 2004-03-29 Martin Baulig <martin@ximian.com>
8966 * generic.cs (GenericMethod.Define): Resolve our type parameters.
8968 2004-03-29 Martin Baulig <martin@ximian.com>
8970 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
8971 not allowed on non-generic declarations").
8973 2004-03-29 Martin Baulig <martin@ximian.com>
8975 * expression.cs (Invocation.InferTypeArguments): Added overloaded
8976 public version of this method.
8978 * class.cs (MethodCore.IsDuplicateImplementation): Use
8979 Invocation.InferTypeArguments() to check this.
8981 2004-03-29 Martin Baulig <martin@ximian.com>
8983 * convert.cs: Use TypeManager.IsDelegateType() instead of
8984 comparing types correctly.
8986 2004-03-29 Martin Baulig <martin@ximian.com>
8988 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
8989 types directly to make it work for generic instances.
8991 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
8993 2004-03-29 Martin Baulig <martin@ximian.com>
8995 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
8998 2004-03-24 Martin Baulig <martin@ximian.com>
9000 * decl.cs (DeclSpace.FindType): Also use
9001 TypeManager.CheckGeneric() for types from the using clauses.
9003 2004-03-23 Martin Baulig <martin@ximian.com>
9005 * expression.cs (Invocation.OverloadResolve): Added `bool
9006 may_fail' argument and use it instead of the Location.IsNull() hack.
9008 2004-03-23 Martin Baulig <martin@ximian.com>
9010 * expression.cs (Invocation.InferType): Use correct type inference
9013 2004-03-23 Martin Baulig <martin@ximian.com>
9015 * ecore.cs (MethodGroupExpr.Name): Use
9016 TypeManager.CSharpSignature() instead of just the name.
9018 * expression.cs (Invocation.OverloadResolve): Provide better error
9020 (Invocation.DoResolve): OverloadResolve() never returns null
9021 without reporting an error, so removed the error -6 reporting here.
9023 2004-03-23 Martin Baulig <martin@ximian.com>
9025 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
9028 * cs-parser.jay (delegate_declaration): Support generic delegates.
9030 * delegate.cs: Support generic delegates.
9032 2004-03-22 Martin Baulig <martin@ximian.com>
9034 * expression.cs (Invocation.InferParamsTypeArguments): New static
9035 method; does type inference for params arguments.
9037 2004-03-21 Martin Baulig <martin@ximian.com>
9039 * typemanager.cs (TypeManager.IsGenericMethod): New public static
9040 method; checks whether a method is a generic method.
9042 * expression.cs (Invocation.InferTypeArguments): New static method;
9043 infer type arguments for generic method invocation.
9045 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
9046 property; we set this to true if we're resolving a generic method
9047 invocation and the user specified type arguments, ie. we're not
9048 doing type inference.
9050 2004-03-20 Martin Baulig <martin@ximian.com>
9052 * class.cs (MethodData.DeclaringType): New public property.
9053 (MethodData.Define): Set DeclaringType here.
9054 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
9055 instead of OperatorMethodBuilder.DeclaringType.
9057 2004-03-20 Martin Baulig <martin@ximian.com>
9059 * cs-tokenizer.cs (xtoken): Return a special
9060 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
9062 * cs-parser.jay (default_value_expression): Switch to the new
9065 2004-03-19 Martin Baulig <martin@ximian.com>
9067 * decl.cs (MemberName): New class. We use this to "construct"
9068 namespace_or_type_name's.
9070 * generics.cs (TypeArguments.GetDeclarations): New public method;
9071 returns the type arguments as a string[] and reports a CS0081 if
9072 one of them is not an identifier.
9074 * class.cs (MemberBase): The .ctor now takes the name as a
9075 MemberName instead of a string.
9076 (MemberBase.ExplicitInterfaceName): Changed type from string to
9078 (MemberBase.DoDefine): If we're an explicit implementation, the
9079 InterfaceType may be a generic instance.
9081 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
9082 (namespace_name): Call MemberName.GetName () to transform the
9083 MemberName into a string and ensure we don't have any type
9085 (type_name): Call MemberName.GetTypeExpression() to transfrom the
9086 MemberName into an expression.
9087 (method_header): Use namespace_or_type_name instead of member_name.
9089 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9091 * rootcontext.cs: Add new types to the boot resolution.
9093 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9094 MulticastDelegate is not allowed.
9096 * typemanager.cs: Add new types to lookup: System.TypedReference
9099 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9100 check for TypedReference or ArgIterator, they are not allowed.
9102 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9103 makes us properly catch 1510 in some conditions (see bug 56016 for
9106 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9108 * CryptoConvert.cs: update from corlib version
9111 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9113 * class.cs (Indexer.Define): Check indexername declaration
9115 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9117 * attribute.cs (IsClsCompliant): Fixed problem with handling
9118 all three states (compliant, not-compliant, undetected).
9120 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9122 * attribute.cs (Attribute): Location is now public.
9123 (Resolve): Store resolved arguments (pos_values) in attribute class.
9124 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9125 (GetClsCompliantAttributeValue): New method that gets
9126 CLSCompliantAttribute value.
9127 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9128 if exists else null.
9129 (AttributeTester): New class for CLS-Compliant verification routines.
9131 * class.cs (Emit): Add CLS-Compliant verification.
9132 (Method.GetSignatureForError): Implemented.
9133 (Constructor.GetSignatureForError): Implemented
9134 (Constructor.HasCompliantArgs): Returns if constructor has
9135 CLS-Compliant arguments.
9136 (Constructor.Emit): Override.
9137 (Construcor.IsIdentifierClsCompliant): New method; For constructors
9138 is needed to test only parameters.
9139 (FieldBase.GetSignatureForError): Implemented.
9140 (TypeContainer): New member for storing base interfaces.
9141 (TypeContainer.FindMembers): Search in base interfaces too.
9143 * codegen.cs (GetClsComplianceAttribute): New method that gets
9144 assembly or module CLSCompliantAttribute value.
9145 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9147 (ModuleClass.Emit): Add error 3012 test.
9149 * const.cs (Emit): Override and call base for CLS-Compliant tests.
9151 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9152 state for all decl types.
9153 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9154 if CLS-Compliant tests are required.
9155 (IsClsCompliaceRequired): New method. Analyze whether code
9156 must be CLS-Compliant.
9157 (IsExposedFromAssembly): New method. Returns true when MemberCore
9158 is exposed from assembly.
9159 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9160 value or gets cached value.
9161 (HasClsCompliantAttribute): New method. Returns true if MemberCore
9162 is explicitly marked with CLSCompliantAttribute.
9163 (IsIdentifierClsCompliant): New abstract method. This method is
9164 used to testing error 3005.
9165 (IsIdentifierAndParamClsCompliant): New method. Common helper method
9166 for identifier and parameters CLS-Compliant testing.
9167 (VerifyClsCompliance): New method. The main virtual method for
9168 CLS-Compliant verifications.
9169 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9170 null. I don't know why is null (too many public members !).
9171 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9172 and get value of first CLSCompliantAttribute that found.
9174 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9175 (VerifyClsCompliance): Override and add extra tests.
9177 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9178 clscheck- disable CLS-Compliant verification event if assembly is has
9179 CLSCompliantAttribute(true).
9181 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9182 ApllyAttribute is now called in emit section as in the other cases.
9183 Possible future Emit integration.
9184 (IsIdentifierClsCompliant): New override.
9185 (VerifyClsCompliance): New override.
9186 (GetEnumeratorName): Returns full enum name.
9188 * parameter.cs (GetSignatureForError): Implemented.
9190 * report.cs (WarningData): New struct for Warning message information.
9191 (LocationOfPreviousError): New method.
9192 (Warning): New method. Reports warning based on the warning table.
9193 (Error_T): New method. Reports error based on the error table.
9195 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9196 verifications are done here.
9198 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9200 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9201 CLSCompliantAttribute.
9202 (all_imported_types): New member holds all imported types from other
9204 (LoadAllImportedTypes): New method fills static table with exported types
9205 from all referenced assemblies.
9206 (Modules): New property returns all assembly modules.
9208 2004-03-30 Miguel de Icaza <miguel@ximian.com>
9210 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9211 throwing a parser error.
9213 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9214 which removes the hardcoded get_/set_ prefixes for properties, as
9215 IL allows for the properties to be named something else.
9219 * expression.cs: Do not override operand before we know if it is
9222 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9224 * typemanager.cs: support for pinned variables.
9226 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9228 * decl.cs, typemanager.cs: Avoid using an arraylist
9229 as a buffer if there is only one result set.
9231 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9233 * expression.cs: Make sure you cant call a static method
9234 with an instance expression, bug #56174.
9236 2004-03-29 Miguel de Icaza <miguel@ximian.com>
9238 * class.cs (IsDuplicateImplementation): Improve error reporting to
9239 flag 663 (method only differs in parameter modifier).
9241 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9242 in preprocessor directives.
9244 * location.cs (LookupFile): Allow for the empty path.
9246 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
9247 better approach for some of that patch, but its failing with the
9248 CharSet enumeration. For now try/catch will do.
9250 * typemanager.cs: Do not crash if a struct does not have fields.
9253 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9255 * expression.cs: cs0213, cant fix a fixed expression.
9258 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9260 * cs-parser.jay: detect invalid embeded statements gracefully.
9263 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9265 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9268 the invocation type may not be a subclass of the tye of the item/
9269 The type of the item must be a subclass of the invocation item.
9274 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
9276 * attribute.cs: Added methods to get a string and a bool from an
9277 attribute. Required to information from AssemblyKeyFileAttribute,
9278 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9279 * codegen.cs: Modified AssemblyName creation to include support for
9280 strongnames. Catch additional exceptions to report them as CS1548.
9281 * compiler.csproj: Updated include CryptoConvert.cs.
9282 * compiler.csproj.user: Removed file - user specific configuration.
9283 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
9284 Mono.Security assembly. The original class is maintained and tested in
9285 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9286 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9287 like CSC 8.0 (C# v2) supports.
9288 * Makefile: Added CryptoConvert.cs to mcs sources.
9289 * rootcontext.cs: Added new options for strongnames.
9291 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
9293 * driver.cs: For --expect-error, report error code `2'
9294 if the program compiled with no errors, error code `1' if
9295 it compiled with an error other than the one expected.
9297 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
9299 * compiler.csproj: Updated for Visual Studio .NET 2003.
9300 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9301 * compiler.sln: Updated for Visual Studio .NET 2003.
9303 2004-03-24 Ravi Pratap M <ravi@ximian.com>
9305 * expression.cs: Fix bug #47234. We basically need to apply the
9306 rule that we prefer the conversion of null to a reference type
9307 when faced with a conversion to 'object' (csc behaviour).
9309 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9311 * statement.cs: Shorter form for foreach, eliminates
9312 a local variable. r=Martin.
9314 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9316 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9317 checks if we can use brtrue/brfalse to test for 0.
9318 * expression.cs: use the above in the test for using brtrue/brfalse.
9321 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9323 * expression.cs: Rewrite string concat stuff. Benefits:
9325 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9326 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9327 rather than a concat chain.
9329 * typemanager.cs: Add lookups for more concat overloads.
9331 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9333 * expression.cs: Emit shorter il code for array init.
9350 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
9352 * statement.cs: Before, two switch blocks would be merged if the
9353 total size of the blocks (end_item - begin_item + 1) was less than
9354 two times the combined sizes of the blocks.
9356 Now, it will only merge if after the merge at least half of the
9361 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
9363 * class.cs : csc build fix for GetMethods(). See bug #52503.
9365 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
9367 * expression.cs: Make sure fp comparisons work with NaN.
9368 This fixes bug #54303. Mig approved this patch a long
9369 time ago, but we were not able to test b/c the runtime
9372 2004-03-19 Miguel de Icaza <miguel@ximian.com>
9374 * ecore.cs (TypExpr.GetHashCode): implement this overload.
9376 2004-03-19 Martin Baulig <martin@ximian.com>
9378 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
9379 two overloads may unify for some type parameter substitutions and
9380 report a CS0408 if appropriate.
9382 2004-03-19 Martin Baulig <martin@ximian.com>
9384 * class.cs (MemberCore.IsDuplicateImplementation): Report the
9385 error here and not in our caller.
9387 2004-03-19 Martin Baulig <martin@ximian.com>
9389 * interface.cs: Completely killed this file.
9390 (Interface): We're now a TypeContainer and live in class.cs.
9392 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9393 argument; we're now also called for interfaces.
9394 (TypeContainer.DefineMembers): Allow this method being called
9396 (TypeContainer.GetMethods): New public method; formerly known as
9397 Interface.GetMethod(). This is used by PendingImplementation.
9398 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9399 it's now private and non-static.
9400 (Interface): Moved this here; it's now implemented similar to
9402 (Method, Property, Event, Indexer): Added `bool is_interface'
9403 argument to their .ctor's.
9404 (MemberBase.IsInterface): New public field.
9406 * cs-parser.jay: Create normal Method, Property, Event, Indexer
9407 instances instead of InterfaceMethod, InterfaceProperty, etc.
9408 (opt_interface_base): Removed; we now use `opt_class_base' instead.
9409 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9411 2004-03-19 Martin Baulig <martin@ximian.com>
9413 * class.cs (MethodCore.IsDuplicateImplementation): New private
9414 method which does the CS0111 checking.
9415 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9416 Use IsDuplicateImplementation().
9418 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
9420 * decl.cs (FindMemberToOverride): New method to find the correct
9421 method or property to override in the base class.
9423 - Make Method/Property use the above method to find the
9424 version in the base class.
9425 - Remove the InheritableMemberSignatureCompare as it is now
9428 This patch makes large code bases much faster to compile, as it is
9429 O(n) rather than O(n^2) to do this validation.
9431 Also, it fixes bug 52458 which is that nested classes are not
9432 taken into account when finding the base class member.
9434 Reviewed/Approved by Martin.
9436 2004-03-17 Martin Baulig <martin@ximian.com>
9438 * expression.cs (MemberAccess.DoResolve): Take the parent's number
9439 of type arguments into account; use the `real_num_type_args'
9440 approach like in DoResolveAsTypeStep().
9442 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
9445 2004-03-17 Marek Safar <marek.safar@seznam.cz>
9447 * interface.cs: In all interface classes removed redundant
9448 member initialization.
9450 2004-03-16 Martin Baulig <martin@ximian.com>
9452 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9454 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9456 * decl.cs (DefineTypeAndParents): New helper method to define a
9457 type's containers before the type itself is defined; This is a
9458 bug exposed by the recent changes to Windows.Forms when an
9459 implemented interface was defined inside a class that had not been
9462 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9464 (Check): Loop correctly to report errors modifiers
9465 (UNSAFE was not in the loop, since it was the same as TOP).
9467 * interface.cs: Every interface member now takes a ModFlags,
9468 instead of a "is_new" bool, which we set on the base MemberCore.
9470 Every place where we called "UnsafeOk" in the interface, now we
9471 call the proper member (InterfaceMethod.UnsafeOK) instead to get
9472 the unsafe settings from the member declaration instead of the
9473 container interface.
9475 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
9477 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9478 `set_indexer_name' to the pending bits (one per type).
9480 We fixed a bug today that was picking the wrong method to
9481 override, since for properties the existing InterfaceMethod code
9482 basically ignored the method name. Now we make sure that the
9483 method name is one of the valid indexer names.
9485 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
9487 * support.cs (SeekableStreamReader): Keep track of stream byte
9488 positions and don't mix them with character offsets to the buffer.
9490 Patch from Gustavo Giráldez
9492 2004-03-15 Marek Safar <marek.safar@seznam.cz>
9494 * interface.cs (InterfaceSetGetBase): Removed double member
9495 initialization, base class does it as well.
9497 2004-03-13 Martin Baulig <martin@ximian.com>
9499 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9500 when compiling corlib.
9502 2004-03-13 Miguel de Icaza <miguel@ximian.com>
9504 * convert.cs (ExplicitConversion): We were reporting an error on
9505 certain conversions (object_type source to a value type, when the
9506 expression was `null') before we had a chance to pass it through
9507 the user defined conversions.
9509 * driver.cs: Replace / and \ in resource specifications to dots.
9512 * class.cs: Add check for duplicate operators. Fixes 52477
9514 2004-03-11 Miguel de Icaza <miguel@ximian.com>
9516 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9517 that are in the middle of the statements, not only at the end.
9520 * class.cs (TypeContainer.AddField): No longer set the
9521 `HaveStaticConstructor' flag, now we call it
9522 `UserDefineStaticConstructor' to diferentiate the slightly
9523 semantic difference.
9525 The situation is that we were not adding BeforeFieldInit (from
9526 Modifiers.TypeAttr) to classes that could have it.
9527 BeforeFieldInit should be set to classes that have no static
9532 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9534 And most importantly Zoltan's comment:
9536 http://bugzilla.ximian.com/show_bug.cgi?id=44229
9538 "I think beforefieldinit means 'it's ok to initialize the type sometime
9539 before its static fields are used', i.e. initialization does not need
9540 to be triggered by the first access to the type. Setting this flag
9541 helps the JIT to compile better code, since it can run the static
9542 constructor at JIT time, and does not need to generate code to call it
9543 (possibly lots of times) at runtime. Unfortunately, mcs does not set
9544 this flag for lots of classes like String.
9546 csc sets this flag if the type does not have an explicit static
9547 constructor. The reasoning seems to be that if there are only static
9548 initalizers for a type, and no static constructor, then the programmer
9549 does not care when this initialization happens, so beforefieldinit
9552 This bug prevents the AOT compiler from being usable, since it
9553 generates so many calls to mono_runtime_class_init that the AOT code
9554 is much slower than the JITted code. The JITted code is faster,
9555 because it does not generate these calls if the vtable is type is
9556 already initialized, which is true in the majority of cases. But the
9557 AOT compiler can't do this."
9559 2004-03-10 Miguel de Icaza <miguel@ximian.com>
9561 * class.cs (MethodData.Emit): Refactor the code so symbolic
9562 information is generated for destructors; For some reasons we
9563 were taking a code path that did not generate symbolic information
9566 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
9568 * class.cs: Create a Constructor.CheckBase method that
9569 takes care of all validation type code. The method
9570 contains some code that was moved from Define.
9572 It also includes new code that checks for duplicate ctors.
9573 This fixes bug #55148.
9575 2004-03-09 Joshua Tauberer <tauberer@for.net>
9577 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9578 a { ... }-style array creation invokes EmitStaticInitializers
9579 which is not good for reference-type arrays. String, decimal
9580 and now null constants (NullCast) are not counted toward
9581 static initializers.
9583 2004-03-05 Martin Baulig <martin@ximian.com>
9585 * location.cs (SourceFile.HasLineDirective): New public field;
9586 specifies whether the file contains or is referenced by a "#line"
9588 (Location.DefineSymbolDocuments): Ignore source files which
9589 either contain or are referenced by a "#line" directive.
9591 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
9593 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9594 direct access to our parent, so check the method inline there.
9596 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
9598 * expression.cs (Invocation.EmitCall): Miguel's last commit
9599 caused a regression. If you had:
9604 In Foo the implict this would be null.
9606 2004-02-27 Miguel de Icaza <miguel@ximian.com>
9608 * expression.cs (Invocation.EmitCall): If the method is not
9609 virtual, do not emit a CallVirt to it, use Call.
9611 * typemanager.cs (GetFullNameSignature): Improve the method to
9612 cope with ".ctor" and replace it with the type name.
9614 * class.cs (ConstructorInitializer.Resolve): Now the method takes
9615 as an argument the ConstructorBuilder where it is being defined,
9616 to catch the recursive constructor invocations.
9618 2004-03-16 Martin Baulig <martin@ximian.com>
9620 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
9621 ConstructedType, call ResolveType() on it to get the type rather
9622 than just using `expr.Type'.
9624 2004-03-16 Martin Baulig <martin@ximian.com>
9626 * generics.cs (ConstructedType.GetMemberAccess): Take the
9627 EmitContext instead on the TypeExpr and use
9628 ec.TypeContainer.CurrentType/ec.ContainerType.
9630 2004-03-16 Martin Baulig <martin@ximian.com>
9632 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
9633 parameters before aliases.
9635 2004-03-16 Martin Baulig <martin@ximian.com>
9637 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
9638 New oublic function; checks whether two generic instances may become
9639 equal under some instantiations (26.3.1).
9641 * class.cs (TypeContainer.Define): Call
9642 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
9645 2004-03-16 Martin Baulig <martin@ximian.com>
9647 * class.cs (TypeContainer.GetClassBases): Moved
9648 Error_TypeParameterAsBase() here and also check whether the base
9649 class is not an attribute.
9651 2004-03-16 Martin Baulig <martin@ximian.com>
9653 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9655 2004-03-16 Martin Baulig <martin@ximian.com>
9657 * class.cs (Error_TypeParameterAsBase): Use correct error number
9660 2004-03-16 Martin Baulig <martin@ximian.com>
9662 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
9665 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
9668 2004-03-15 Martin Baulig <martin@ximian.com>
9670 * typemanager.cs (TypeManager.GetFullName): New public method.
9671 (TypeManager.MemberLookup): Added `int_num_type_arguments'
9672 argument; only return members with the correct number of type
9674 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
9675 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
9676 whether the number of type arguments matches.
9678 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
9679 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
9681 * expression.cs (MemberAccess): Added public `NumTypeArguments'
9682 field; it's set by the protected .ctor when we're actually a
9683 GenericMemberAccess.
9684 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
9685 arguments and pass it to MemberLookupFinal ().
9687 * ecore.cs (Expression.MemberLookup): Added `int
9688 num_type_arguments' argument; only return members with the correct
9689 number of type arguments.
9690 (Expression.MemberLookupFailed): Check whether the MemberLookup
9691 failed because we did not have the correct number of type
9692 arguments; report CS0305 in this case.
9694 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
9695 `e.ResolveAsTypeTerminal()' already did so.
9697 2004-03-15 Martin Baulig <martin@ximian.com>
9699 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
9700 we're a ConstructedType; in this case, the caller must report an
9701 error (for instance CS0131).
9703 * generic.cs (TypeArguments): Added Location argument to the .ctor.
9704 (TypeArguments.Resolve): Actually report errors here.
9706 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9708 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9709 `set_indexer_name' to the pending bits (one per type).
9711 We fixed a bug today that was picking the wrong method to
9712 override, since for properties the existing InterfaceMethod code
9713 basically ignored the method name. Now we make sure that the
9714 method name is one of the valid indexer names.
9716 2004-03-15 Martin Baulig <martin@ximian.com>
9718 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
9719 for generic instances.
9721 2004-03-13 Martin Baulig <martin@ximian.com>
9723 * class.cs (TypeContainer.DefineType): Call
9724 TypeManager.AddUserType() immediately after creating the
9725 TypeBuilder; pass all type parameters when creating the
9728 * decl.cs (DeclSpace.FindNestedType): New public method.
9729 (DeclSpace.FindType): Added `int num_type_args' argument; only
9730 return types with the correct number of type parameters.
9731 (DeclSpace.CountTypeParams): New public property.
9733 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
9734 the number of type parameters; defaults to zero.
9736 * generic.cs (TypeArguments.Count): New public property.
9737 (ConstructedType.DoResolveAsTypeStep): First call
9738 ds.FindNestedType() to find out whether we're nested in the
9739 current generic type; in this case, we inherit all type parameters
9740 from the current class.
9742 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
9743 num_type_args' argument.
9744 (RootContext.LookupType): Added overloaded version which takes the
9745 number of type arguments; only return types with the correct
9746 number of type arguments.
9748 * typemanager.cs (TypeManager.CheckGeneric): New public function;
9749 checks whether `Type t' has `int num_type_args'.
9751 2004-03-13 Martin Baulig <martin@ximian.com>
9753 * generic.cs (GenericMethod.DefineType): New method; calls
9754 DefineType() on all the type parameters.
9756 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
9757 (MethodData.Define): If we're a generic method, call
9758 GenericMethod.DefineType() to define the type parameters.
9760 2004-03-10 Martin Baulig <martin@ximian.com>
9762 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
9763 instead of IsAssignableFrom.
9765 2004-03-10 Martin Baulig <martin@ximian.com>
9767 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
9769 * support.cs (ParameterData.HasArrayParameter): New property.
9770 (ReflectionParameters.ctor): Take a MethodBase instead of a
9771 ParameterInfo[]. If we have any type parameters, get the generic
9772 method definition and ask it whether we have variable arguments.
9774 2004-02-26 Miguel de Icaza <miguel@ximian.com>
9776 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9777 routines to check if a type is an enumerable/enumerator allow
9778 classes that implement the IEnumerable or IEnumerator interfaces.
9780 * class.cs (Property, Operator): Implement IIteratorContainer, and
9781 implement SetYields.
9783 (Property.Define): Do the block swapping for get_methods in the
9784 context of iterators. We need to check if Properties also
9785 include indexers or not.
9787 (Operator): Assign the Block before invoking the
9788 OperatorMethod.Define, so we can trigger the Iterator code
9791 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
9792 Property and Operator classes are not created when we parse the
9793 declarator but until we have the block completed, so we use a
9794 singleton SimpleIteratorContainer.Simple to flag whether the
9795 SetYields has been invoked.
9797 We propagate this setting then to the Property or the Operator to
9798 allow the `yield' to function.
9800 2004-02-25 Marek Safar <marek.safar@seznam.cz>
9802 * codegen.cs: Implemented attribute support for modules.
9803 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9804 Assembly/Module functionality.
9806 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9807 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9808 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9810 2004-02-16 Marek Safar <marek.safar@seznam.cz>
9812 * interface.cs (FindMembers): The operation is performed on all base
9813 interfaces and not only on the first. It is required for future CLS Compliance patch.
9815 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
9817 * statement.cs, codegen.cs:
9818 This patch deals with patterns such as:
9820 public class List : IEnumerable {
9822 public MyEnumerator GetEnumerator () {
9823 return new MyEnumerator(this);
9826 IEnumerator IEnumerable.GetEnumerator () {
9830 public struct MyEnumerator : IEnumerator {
9835 Before, there were a few things we did wrong:
9836 1) we would emit callvirt on a struct, which is illegal
9837 2) we emited ldarg when we needed to emit ldarga
9838 3) we would mistakenly call the interface methods on an enumerator
9839 type that derived from IEnumerator and was in another assembly. For example:
9841 public class MyEnumerator : IEnumerator
9843 Would have the interface methods called, even if there were public impls of the
9844 method. In a struct, this lead to invalid IL code.
9846 2004-02-11 Marek Safar <marek.safar@seznam.cz>
9848 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9851 * delegate.cs (Define): Fixed crash when delegate type is undefined.
9853 2004-02-11 Miguel de Icaza <miguel@ximian.com>
9855 * cs-parser.jay: Fix small regression: we were not testing V2
9856 compiler features correctly.
9858 * interface.cs: If the emit context is null, then create one
9860 2004-02-09 Marek Safar <marek.safar@seznam.cz>
9862 * decl.cs (GetSignatureForError): New virtual method to get full name
9865 * attribute.cs (IAttributeSupport): New interface for attribute setting.
9866 Now it is possible to rewrite ApplyAttributes method to be less if/else.
9868 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9869 Duplicated members and code in these classes has been removed.
9870 Better encapsulation in these classes.
9872 2004-02-07 Miguel de Icaza <miguel@ximian.com>
9874 * assign.cs (Assign.DoResolve): When dealing with compound
9875 assignments, there is a new rule in ECMA C# 2.4 (might have been
9876 there before, but it is documented here) that states that in:
9880 If b is of type int, and the `op' is a shift-operator, then the
9881 above is evaluated as:
9885 * expression.cs (Binary.ResolveOperator): Instead of testing for
9886 int/uint/long/ulong, try to implicitly convert to any of those
9887 types and use that in pointer arithmetic.
9889 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9890 method to print information for from the type, not from the
9891 null-method we were given.
9893 2004-02-01 Duncan Mak <duncan@ximian.com>
9895 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9896 parsing for cmd, fixes bug #53694.
9898 2004-02-04 Marek Safar <marek.safar@seznam.cz>
9900 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9901 in the member name duplication tests. Property and operator name duplication
9902 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9904 2004-02-03 Marek Safar <marek.safar@seznam.cz>
9906 * interface.cs (PopulateMethod): Fixed crash when interface method
9907 returns not existing type (error test cs0246-3.cs).
9909 2004-02-02 Ravi Pratap M <ravi@ximian.com>
9911 * cs-parser.jay (interface_accessors): Re-write actions to also
9912 store attributes attached to get and set methods. Fix spelling
9915 (inteface_property_declaration): Modify accordingly.
9917 (InterfaceAccessorInfo): New helper class to store information to pass
9918 around between rules that use interface_accessors.
9920 * interface.cs (Emit): Apply attributes on the get and set
9921 accessors of properties and indexers too.
9923 * attribute.cs (ApplyAttributes): Modify accordingly to use the
9924 right MethodBuilder when applying attributes to the get and set accessors.
9926 2004-01-31 Miguel de Icaza <miguel@ximian.com>
9928 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9930 2004-01-26 Miguel de Icaza <miguel@ximian.com>
9932 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9934 2004-01-25 Miguel de Icaza <miguel@ximian.com>
9936 * cs-parser.jay: Remove YIELD token, instead use the new grammar
9937 changes that treat `yield' specially when present before `break'
9940 * cs-tokenizer.cs: yield is no longer a keyword.
9942 2004-01-23 Marek Safar <marek.safar@seznam.cz>
9944 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9945 setting for default constructors.
9946 For default constructors are almost every time set wrong Modifier. The
9947 generated IL code has been alright. But inside mcs this values was
9948 wrong and this was reason why several of my CLS Compliance tests
9951 2004-02-27 Martin Baulig <martin@ximian.com>
9953 * generics.cs (ConstructedType.ResolveType): Make the nested type
9954 stuff actually work.
9956 2004-02-25 Martin Baulig <martin@ximian.com>
9958 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
9959 property; returns the type parameters just from the current type,
9960 ie. with the ones from outer classes.
9961 (DeclSpace.LookupGeneric): First search in the current class, then
9963 (DeclSpace.initialize_type_params): When hiding a type parameter
9964 from an outer class, put it into the `type_param_list' anyways.
9966 * expression.cs (MemberAccess.expr): Made this field protected.
9968 * class.cs (TypeContainer.Define): The `CurrentType' just contains
9969 the type parameters from the current class.
9971 * generic.cs (ConstructedType.ResolveType): Support nested generic
9972 types by taking the type parameters which we inherit from outer
9973 classes into account.
9974 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
9975 support for nested generic types.
9977 2004-02-23 Martin Baulig <martin@ximian.com>
9979 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
9980 field and check whether we're nested inside a generic type.
9981 (DeclSpace.ResolveType): If we're resolving to a generic type
9982 definition, create a ConstructedType and return its resolved type.
9983 (DeclSpace.initialize_type_params): New private method;
9984 initializes the `type_param_list' field from the type parameters
9985 from this and all enclosing classes.
9986 (DeclSpace.TypeParameters): Call initialize_type_params() unless
9987 we're already initialized.
9989 2004-02-23 Martin Baulig <martin@ximian.com>
9991 * class.cs (Method.Define): Create the generic method before
9993 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
9994 the TypeContainer one); we use this for generic methods.
9996 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
9997 parent's TypeBuilder.
9999 2004-02-18 Martin Baulig <martin@ximian.com>
10001 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
10002 to check for equality.
10004 2004-02-05 Martin Baulig <martin@ximian.com>
10006 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
10007 `ec.TypeContainer.CurrentType', use it instead of
10008 `ec.ContainerType' to check whether we're in the type's ctor.
10010 2004-01-29 Martin Baulig <martin@ximian.com>
10012 * expression.cs (Invocation.DoResolve): If we're a
10013 `ConstructedType', then we're actually a generic method, so
10014 rewrite the expr as a GenericMemberAccess.
10016 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
10017 here; manually parse it into a string.
10019 2004-01-28 Martin Baulig <martin@ximian.com>
10021 * typemanager.cs (TypeManager.IsEqual): New static method.
10022 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
10023 check for equality instead of using `=='.
10025 2004-01-26 Martin Baulig <martin@ximian.com>
10027 * decl.cs (DeclSpace.CurrentType): New public field.
10029 * expression.cs (This.ResolveBase): If we have an
10030 `ec.TypeContainer.CurrentType', use it instead of
10031 `ec.ContainerType'.
10033 * class.cs (TypeContainer.DefineType): If we're a generic type,
10034 create the `CurrentType' (unresolved).
10035 (TypeContainer.GenericType): New private field.
10036 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
10037 it and store it in `GenericType' before creating the MemberCache.
10038 (TypeContainer.GetMembers): If we have a `GenericType', call
10039 TypeManager.FindMembers() on it.
10041 * interface.cs (Interface.GenericType): New private field.
10042 (Interface.DefineType): If we're a generic type, create the
10043 `CurrentType' (unresolved).
10044 (Interface.DefineMembers): If we have a `CurrentType', resolve it
10045 and store it in `GenericType' before creating the MemberCache.
10046 (Interface.GetMembers): If we have a `GenericType', call
10047 TypeManager.FindMembers() on it.
10049 2004-01-22 Martin Baulig <martin@ximian.com>
10051 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10052 not a QualifiedIdentifier. This is what `type_name_expression'
10053 was previously doing.
10054 (type_name_expression): Removed; the code is now in
10055 `namespace_or_type_name'.
10056 (qualified_identifier): Removed, use `namespace_or_type_name'
10058 (QualifiedIdentifier): Removed this class.
10060 2004-01-22 Martin Baulig <martin@ximian.com>
10062 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10063 not a string as alias name.
10065 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10067 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10068 #52730 bug, and instead compute correctly the need to use a
10069 temporary variable when requesting an address based on the
10070 static/instace modified of the field and the constructor.
10072 2004-01-21 Martin Baulig <martin@ximian.com>
10074 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10075 class and namespace before looking up aliases. Fixes #52517.
10077 2004-01-21 Martin Baulig <martin@ximian.com>
10079 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10080 assinged in a 'try'; fixes exception4.cs.
10082 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10083 * class.cs : Implemented parameter-less constructor for TypeContainer
10085 * decl.cs: Attributes are now stored here. New property OptAttributes
10087 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10089 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10091 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10093 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10094 (CSharpSignature): New method for indexer and property signature.
10096 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10098 * pending.cs (IsVirtualFilter): Faster implementation.
10100 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10102 * typemanager.cs: Avoid inclusion of same assembly more than once.
10104 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10106 * cs-parser.jay: Fixed problem where the last assembly attribute
10107 has been applied also to following declaration (class, struct, etc.)
10109 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10111 * class.cs: Added error CS0538, CS0539 reporting.
10112 Fixed crash on Microsoft runtime when field type is void.
10114 * cs-parser.jay: Added error CS0537 reporting.
10116 * pending.cs: Added error CS0535 reporting.
10117 Improved error report for errors CS0536, CS0534.
10119 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10121 Merge a few bits from the Anonymous Method MCS tree.
10123 * statement.cs (ToplevelBlock): New class for toplevel methods,
10124 will hold anonymous methods, lifted variables.
10126 * cs-parser.jay: Create toplevel blocks for delegates and for
10127 regular blocks of code.
10129 2004-01-20 Martin Baulig <martin@ximian.com>
10131 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10132 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10133 and `NeedExplicitReturn'; added `IsLastStatement'.
10134 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10135 have a `ReturnLabel' or we're not unreachable.
10137 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10138 child's reachability; don't just override ours with it. Fixes
10139 #58058 (lluis's example).
10140 (FlowBranching): Added public InTryOrCatch(), InCatch(),
10141 InFinally(), InLoop(), InSwitch() and
10142 BreakCrossesTryCatchBoundary() methods.
10144 * statement.cs (Return): Do all error checking in Resolve().
10145 Unless we are the last statement in a top-level block, always
10146 create a return label and jump to it.
10147 (Break, Continue): Do all error checking in Resolve(); also make
10148 sure we aren't leaving a `finally'.
10149 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10150 statement in a top-level block.
10151 (Block.Flags): Added `IsDestructor'.
10152 (Block.IsDestructor): New public property.
10154 2004-01-20 Martin Baulig <martin@ximian.com>
10156 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10158 2004-01-20 Martin Baulig <martin@ximian.com>
10160 * statement.cs (Statement.ResolveUnreachable): New public method.
10161 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10162 (Block.Resolve): Resolve unreachable statements.
10164 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10166 * expression.cs: We need to fix the case where we do
10167 not have a temp variable here.
10169 * assign.cs: Only expression compound assignments need
10170 temporary variables.
10172 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10174 * flowanalysis.cs: Reduce memory allocation in a few ways:
10175 - A block with no variables should not allocate a bit
10177 - A method with no out parameters does not need any tracking
10178 for assignment of the parameters, so we need not allocate
10181 public readonly Type[] VariableTypes;
10182 public readonly string[] VariableNames;
10183 Are redundant. The data is already stored in the variable
10184 map, so we need not allocate another array for it.
10185 - We need to add alot of checks for if (params | locals) == null
10186 due to the first two changes.
10188 2004-01-18 Miguel de Icaza <miguel@ximian.com>
10190 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10191 implement IMemoryLocation, we store a copy on a local variable and
10192 take the address of it. Patch from Benjamin Jemlich
10194 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10195 to use a special "type_name_expression" rule which reduces the
10196 number of "QualifiedIdentifier" classes created, and instead
10197 directly creates MemberAccess expressions.
10199 2004-01-17 Miguel de Icaza <miguel@ximian.com>
10201 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10202 that fixes #52853. Null literal assignment to ValueType
10204 * class.cs (MethodData.Emit): Instead of checking the name of the
10205 method to determine if its a destructor, create a new derived
10206 class from Method called Destructor, and test for that.
10208 * cs-parser.jay: Create a Destructor object instead of a Method.
10210 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10214 2004-01-16 Miguel de Icaza <miguel@ximian.com>
10216 * expression.cs (Binary.ResolveOperator): Perform an implicit
10217 conversion from MethodGroups to their delegate types on the
10218 Addition operation.
10220 * delegate.cs: Introduce a new class DelegateCreation that is the
10221 base class for `NewDelegate' and `ImplicitDelegateCreation',
10222 factor some code in here.
10224 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10225 conversion from MethodGroups to compatible delegate types.
10227 * ecore.cs (Expression.Resolve): Do not flag error 654
10228 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10229 we allow conversions from MethodGroups to delegate types now.
10231 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10232 assignments in v2 either.
10234 2004-01-10 Miguel de Icaza <miguel@ximian.com>
10236 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10237 static read-only fields in ctors.
10239 Applied patch from Benjamin Jemlich
10241 * expression.cs (UnaryMutator): Avoid leaking local variables.
10243 2004-01-09 Miguel de Icaza <miguel@ximian.com>
10245 * cs-tokenizer.cs (IsCastToken): Allow the various native types
10246 here to return true, as they can be used like this:
10248 (XXX) int.MEMBER ()
10250 Fixed 49836 and all the other dups
10252 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
10254 * driver.cs: Implement /win32res and /win32icon.
10256 2004-01-08 Miguel de Icaza <miguel@ximian.com>
10258 * cs-parser.jay: Add a rule to improve error handling for the
10259 common mistake of placing modifiers after the type.
10261 2004-01-07 Miguel de Icaza <miguel@ximian.com>
10263 * cs-parser.jay (interface_event_declaration): Catch
10264 initialization of events on interfaces, and report cs0068
10266 * cs-parser.jay (interface_event_declaration): Catch
10267 initialization of events.
10269 * ecore.cs: Better report missing constructors.
10271 * expression.cs (Binary.ResolveOperator): My previous bug fix had
10272 the error reporting done in the wrong place. Fix.
10274 * expression.cs (Binary.ResolveOperator): Catch the
10275 operator + (E x, E y) error earlier, and later allow for implicit
10276 conversions in operator +/- (E e, U x) from U to the underlying
10279 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10280 52596, if the container class is abstract, the default constructor
10281 is protected otherwise its public (before, we were always public).
10283 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10286 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10287 Jemlich that fixes bug #52597, MCS was generating invalid code for
10288 idisposable structs. Thanks to Ben for following up with this
10291 2004-01-06 Miguel de Icaza <miguel@ximian.com>
10293 * driver.cs: Allow assemblies without code to be generated, fixes
10296 2004-01-07 Nick Drochak <ndrochak@gol.com>
10298 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10300 2004-01-05 Miguel de Icaza <miguel@ximian.com>
10302 * cs-parser.jay: Add rules to improve error reporting if fields or
10303 methods are declared at the namespace level (error 116)
10305 * Add rules to catch event add/remove
10307 2004-01-04 David Sheldon <dave-mono@earth.li>
10309 * expression.cs: Added matching ")" to error message for
10312 2004-01-03 Todd Berman <tberman@gentoo.org>
10314 * ecore.cs, attribute.cs:
10315 Applying fix from #52429.
10317 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10319 * ecore.cs, expression.cs, statement.cs:
10320 Total rewrite of how we handle branching. We
10321 now handle complex boolean expressions with fewer
10322 jumps. As well if (x == 0) no longer emits a ceq.
10324 if (x is Foo) is much faster now, because we generate
10327 Overall, we get a pretty big improvement on our benchmark
10328 tests. The code we generate is smaller and more readable.
10330 I did a full two-stage bootstrap. The patch was reviewed
10331 by Martin and Miguel.
10333 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10335 * cs-parser.jay: Make primary_expression not take a QI.
10336 we dont need this because the member_access rule covers
10337 us here. So we replace the rule with just IDENTIFIER.
10339 This has two good effects. First, we remove a s/r conflict.
10340 Second, we allocate many fewer QualifiedIdentifier objects.
10342 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10344 * attribute.cs: Handle MarshalAs attributes as pseudo, and
10345 set the correct information via SRE. This prevents
10346 hanging on the MS runtime. Fixes #29374.
10348 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10350 * convert.cs: correctly handle conversions to value types
10351 from Enum and ValueType as unboxing conversions.
10353 Fixes bug #52569. Patch by Benjamin Jemlich.
10355 2004-01-02 Ravi Pratap <ravi@ximian.com>
10357 * expression.cs (BetterConversion): Prefer int -> uint
10358 over int -> ulong (csc's behaviour). This fixed bug #52046.
10360 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
10362 * decl.cs (MemberCache.FindMembers): now returns a
10365 * typemanager.cs: In general, go with with ^^.
10366 (CopyNewMethods): take an IList.
10367 (RealMemberLookup): Only allocate an arraylist
10368 if we copy from two sets of methods.
10370 This change basically does two things:
10371 1) Fewer array lists allocated due to CopyNewMethods.
10372 2) the explicit cast in MemberList costed ALOT.
10374 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
10376 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10377 a hashtable to avoid needless string allocations when an identifier is
10378 used more than once (the common case).
10380 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10382 * pending.cs: MS's TypeBuilder.GetInterfaces ()
10383 is broken, it will not return anything. So, we
10384 have to use the information we have in mcs to
10387 * typemanager.cs: Add a cache for GetInterfaces,
10388 since this will now be used more often (due to ^^)
10390 (GetExplicitInterfaces) New method that gets the
10391 declared, not effective, interfaces on a type
10392 builder (eg, if you have interface IFoo, interface
10393 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10396 This patch makes MCS able to bootstrap itself on
10399 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10401 * expression.cs: Remove the Nop's that Miguel put
10404 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10406 * report.cs, codegen.cs: Give the real stack trace to
10407 the error when an exception is thrown.
10409 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10411 * decl.cs: only allocate hashtables for ifaces if
10414 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10416 * expression.cs: fix the error from cs0121-2.cs
10417 (a parent interface has two child interfaces that
10418 have a function with the same name and 0 params
10419 and the function is called through the parent).
10421 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
10423 * class.cs, rootcontext.cs, typmanager.cs: do not
10426 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
10428 * codegen.cs: remove stack for the ec flow branching.
10429 It is already a linked list, so no need.
10431 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
10433 * Makefile: Allow custom profiler here.
10435 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10437 * typemanager.cs (LookupType):
10438 - Use a static char [], because split takes
10439 a param array for args, so it was allocating
10441 - Do not store true in a hashtable, it boxes.
10443 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10445 * flowanalysis.cs: bytify common enums.
10447 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10449 * modifiers.cs: Add a new set of flags for the
10450 flags allowed on explicit interface impls.
10451 * cs-parser.jay: catch the use of modifiers in
10452 interfaces correctly.
10453 * class.cs: catch private void IFoo.Blah ().
10455 All related to bug #50572.
10457 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10459 * decl.cs: Rewrite the consistant accessability checking.
10460 Accessability is not linear, it must be implemented in
10461 a tableish way. Fixes #49704.
10463 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10465 * expression.cs: Handle negation in a checked context.
10466 We must use subtraction from zero. Fixes #38674.
10468 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10470 * class.cs: Ignore static void main in DLLs.
10471 * rootcontext.cs: Handle the target type here,
10472 since we are have to access it from class.cs
10473 * driver.cs: account for the above.
10475 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10477 * report.cs: Give line numbers and files if available.
10479 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
10481 * driver.cs: Implement /addmodule.
10483 * typemanager.cs: Change 'modules' field so it now contains Modules not
10486 2003-12-20 Martin Baulig <martin@ximian.com>
10488 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10489 (FieldBase.IsAssigned): Removed this field.
10490 (FieldBase.SetAssigned): New public method.
10491 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10493 2003-12-20 Martin Baulig <martin@ximian.com>
10495 * expression.cs (LocalVariableReference.DoResolve): Don't set
10496 `vi.Used' if we're called from DoResolveLValue().
10498 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10499 returns the usage vector it just merged into the current one -
10500 pass this one to UsageWarning().
10501 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10502 of the `EmitContext', don't call this recursively on our children.
10504 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
10506 * driver.cs: Implement /target:module.
10508 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
10510 * support.cs (CharArrayHashtable): New helper class.
10512 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
10513 char arrays, not strings, so we can avoid creating a string in
10514 consume_identifier if the identifier is a keyword.
10516 2003-12-16 Martin Baulig <martin@ximian.com>
10518 * statement.cs (LocalInfo.Assigned): Removed this property.
10519 (LocalInfo.Flags): Removed `Assigned'.
10520 (LocalInfo.IsAssigned): New public method; takes the EmitContext
10521 and uses flow analysis.
10522 (Block.UsageWarning): Made this method private.
10523 (Block.Resolve): Call UsageWarning() if appropriate.
10525 * expression.cs (LocalVariableReference.DoResolve): Always set
10526 LocalInfo.Used here.
10528 2003-12-13 Martin Baulig <martin@ximian.com>
10530 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10531 any value here; we're now using flow analysis to figure out
10532 whether a statement/block returns a value.
10534 2003-12-13 Martin Baulig <martin@ximian.com>
10536 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10538 (FlowBranching.MergeFinally): Don't call
10539 `branching.CheckOutParameters()' here, this is called in
10541 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10542 when adding the `finally' vector.
10544 2003-12-13 Martin Baulig <martin@ximian.com>
10547 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10548 actually work and also fix #48962.
10550 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
10552 * decl.cs: Do not check System.Object for nested types,
10553 since we know it does not have any. Big bang for buck:
10556 Run 1: 8.35 seconds
10557 Run 2: 8.32 seconds
10558 corlib: 17.99 seconds
10560 Run 1: 8.17 seconds
10561 Run 2: 8.17 seconds
10562 corlib: 17.39 seconds
10564 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
10566 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10567 time we are returning 0 members, so we save alot here.
10569 2003-12-11 Martin Baulig <martin@ximian.com>
10571 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10572 `MergeChild()', also just take the `FlowBranching' as argument;
10573 call Merge() on it and return the result.
10574 (FlowBranching.Merge): We don't need to do anything if we just
10577 2003-12-11 Martin Baulig <martin@ximian.com>
10579 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10580 them in an `ArrayList' to reduce memory usage. Thanks to Ben
10581 Maurer for this idea.
10583 2003-12-11 Martin Baulig <martin@ximian.com>
10585 * flowanalysis.cs (MergeResult): This class is now gone; we now
10586 use the `UsageVector' for this. The reason for this is that if a
10587 branching just has one sibling, we don't need to "merge" them at
10588 all - that's the next step to do.
10589 (FlowBranching.Merge): We now return a `UsageVector' instead of a
10592 2003-12-11 Martin Baulig <martin@ximian.com>
10594 Reworked flow analyis and made it more precise and bug-free. The
10595 most important change is that we're now using a special `Reachability'
10596 class instead of having "magic" meanings of `FlowReturns'. I'll
10597 do some more cleanups and optimizations and also add some more
10598 documentation this week.
10600 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10601 largely reworked this class.
10602 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10603 the new `Reachability' class instead of having "magic" values here.
10604 (FlowBranching): We're now using an instance of `Reachability'
10605 instead of having separate `Returns', `Breaks' etc. fields.
10607 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10608 based on flow analysis; ignore the return value of block.Emit ().
10610 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10612 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10613 if they are private.
10615 2003-12-09 Martin Baulig <martin@ximian.com>
10617 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10618 call them directly on the UsageVector.
10620 2003-12-09 Martin Baulig <martin@ximian.com>
10622 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10623 Changed return type from `FlowReturns' to `Reachability'.
10625 2003-12-09 Martin Baulig <martin@ximian.com>
10627 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10628 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10629 `Reachable' fields with a single `Reachability' one.
10631 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10633 * class.cs (FindMembers): Remove foreach's.
10638 Run 1: 8.74 seconds
10639 Run 2: 8.71 seconds
10642 Run 1: 8.64 seconds
10643 Run 2: 8.58 seconds
10646 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10651 This patch does a few things:
10652 1. EmptyStatement is now a singleton, so it is never reallocated.
10653 2. All blah is EmptyStatement constructs have been changed to
10654 blah == EmptyStatement.Value, which is much faster and valid
10655 now that EmptyStatement is a singleton.
10656 3. When resolving a block, rather than allocating a new array for
10657 the non-empty statements, empty statements are replaced with
10658 EmptyStatement.Value
10659 4. Some recursive functions have been made non-recursive.
10660 Mainly the performance impact is from (3), however (1) and (2) are needed for
10661 this to work. (4) does not make a big difference in normal situations, however
10662 it makes the profile look saner.
10667 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10668 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10669 Total memory allocated: 56397 KB
10672 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10673 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10674 Total memory allocated: 55666 KB
10676 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10678 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10679 than the hashtable in a hashtable version
10681 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10682 we always end up concating a string. This results in a huge perf
10683 loss, because many strings have to be tracked by the GC. In this
10684 patch, we first use a hashtable that works with two keys, so that
10685 the strings do not need to be concat'ed.
10689 Run 1: 8.74 seconds
10690 Run 2: 8.71 seconds
10693 Run 1: 8.65 seconds
10694 Run 2: 8.56 seconds
10696 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10698 * Makefile: Add a new target `do-time' that does a quick and simple
10699 profile, leaving easy to parse output.
10701 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
10703 * codegen.cs (Init): Create the dynamic assembly with
10704 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10706 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
10708 * support.cs: Make the PtrHashtable use only one
10709 instance of its comparer.
10711 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
10713 * typemanager.cs: Fix lookup of GetNamespaces.
10715 2003-11-29 Miguel de Icaza <miguel@ximian.com>
10717 * expression.cs: Removed redundant line.
10719 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10720 ArrayLists, use for loops with bounds.
10722 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10725 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10726 arraylists, use for loop with bounds.
10728 The above three changes give us a 0.071 second performance
10729 improvement out of 3.294 seconds down to 3.223. On my machine
10730 the above changes reduced the memory usage by 1,387 KB during
10731 compiler bootstrap.
10733 * cs-parser.jay (QualifiedIdentifier): New class used to represent
10734 QualifiedIdentifiers. Before we created a new string through
10735 concatenation, and mostly later on, the result would be
10736 manipulated by DecomposeQI through string manipulation.
10738 This reduced the compiler memory usage for bootstrapping from
10739 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10740 compile times in 0.05 seconds.
10742 2003-11-28 Dick Porter <dick@ximian.com>
10744 * support.cs: Do string compares with the Invariant culture.
10752 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10753 the comparison is done with the Invariant culture.
10755 2003-11-27 Miguel de Icaza <miguel@ximian.com>
10757 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10758 GetEnumerator method.
10760 (ProbeCollectionType): Iterate starting at the most specific type
10761 upwards looking for a GetEnumerator
10763 * expression.cs: Shift count can be up to 31 for int/uint and 63
10766 2003-11-26 Miguel de Icaza <miguel@ximian.com>
10768 * statement.cs (Block.LookupLabel): Also look for the label on the
10769 children blocks. Use a hash table to keep track of visited
10772 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10773 we actually did transform the other operand, otherwise fall back
10774 to the common codepath that casts to long.
10776 * cs-tokenizer.cs: Use the same code pattern as the int case.
10777 Maybe I should do the parsing myself, and avoid depending on the
10778 Parse routines to get this done.
10780 2003-11-25 Miguel de Icaza <miguel@ximian.com>
10782 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10783 which fixes bug 51347. This time test it.
10785 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10786 attributes for example can not tell the difference between these.
10787 The difference was only a syntax feature of the language.
10789 * attribute.cs: Apply attributes to delegates.
10791 * delegate.cs: Call the apply attributes method.
10793 2003-11-24 Miguel de Icaza <miguel@ximian.com>
10795 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10796 comparing 0 vs Byte.MinValue, not the value
10798 (ImplicitConversionRequired): When reporting a conversion error,
10799 use error 31 to print out the constant error instead of the
10802 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10803 which fixes bug 51347.
10805 2003-11-22 Miguel de Icaza <miguel@ximian.com>
10807 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
10808 which fixes the -warnaserror command line option.
10810 2003-11-21 Miguel de Icaza <miguel@ximian.com>
10812 * cfold.cs (DoNumericPromotions): During constant folding of
10813 additions on UIntConstant, special case intconstants with
10814 IntConstants like we do on the expression binary operator.
10816 2003-11-12 Miguel de Icaza <miguel@ximian.com>
10818 * convert.cs (ImplicitReferenceConversion): We were missing a case
10819 (System.Enum are not value types or class types, so we need to
10820 classify them separatedly).
10822 * driver.cs: We do not support error 2007.
10824 2003-11-12 Jackson Harper <jackson@ximian.com>
10826 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10827 system directory. Also use the full file name so users can
10828 libraries names mscorlib-o-tron.dll in a non system dir.
10830 2004-01-04 David Sheldon <dave-mono@earth.li>
10832 * expression.cs: Added matching ")" to error message for CS0077.
10834 2003-12-19 Martin Baulig <martin@ximian.com>
10836 * typemanager.cs (TypeManager.IsEqualGenericType): New public
10837 static method; see documentation in the method.
10838 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
10840 * convert.cs (Convert.ImplicitReferenceConversion,
10841 Convert.ImplicitReferenceConversionExists): Add support for
10842 generic type declarations; see gen-36.cs.
10844 2003-12-19 Martin Baulig <martin@ximian.com>
10846 * pending.cs (Pending.InterfaceMethod): Use
10847 `Type.IsAssignableFrom()' instead of `=='.
10849 2003-12-18 Martin Baulig <martin@ximian.com>
10851 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
10854 * convert.cs (Convert.ImplicitStandardConversionExists): Use
10855 `expr_type.Equals (target_type)' instead of `=='.
10857 2003-12-08 Martin Baulig <martin@ximian.com>
10859 * generics.cs (Constraints.Types): Removed.
10860 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
10862 (Constraints.ResolveTypes): New public method; resolves the
10863 TypeExpr's to Type's.
10864 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
10865 longer takes the constraints.
10866 (TypeParameter.DefineMethod): Likewise.
10867 (TypeParameter.DefineType): New public method. Calls
10868 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
10871 2003-12-08 Martin Baulig <martin@ximian.com>
10873 * convert.cs (Convert.ImplicitConversionStandard): Use
10874 `expr_type.Equals (target_type)' instead of `=='.
10876 2003-12-08 Martin Baulig <martin@ximian.com>
10878 * typemanager.cs (TypeManager.GetReferenceType): Call
10879 `Type.MakeByRefType ()'.
10881 2003-12-08 Martin Baulig <martin@ximian.com>
10883 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
10884 just has some special meaning in some situations. For instance,
10885 it is allowed to use `where' as the name of a variable etc.
10887 2003-12-04 Martin Baulig <martin@ximian.com>
10889 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10890 `Type.MakeArrayType()' for array types.
10892 2003-11-18 Miguel de Icaza <miguel@ximian.com>
10894 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
10897 (SizeOf.DoResolve): assign the `type_queried' field. This gets
10900 2003-11-16 Martin Baulig <martin@ximian.com>
10902 * codegen.cs (EmitContext.IsGeneric): Removed.
10904 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
10905 ResolveGeneric() on the DeclSpace.
10907 2003-11-16 Martin Baulig <martin@ximian.com>
10909 * generic.cs (TypeArguments.Resolve):
10910 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
10911 `ResolveType()' on it to get the Type.
10913 2003-11-15 Martin Baulig <martin@ximian.com>
10915 * generic.cs (ConstructedType.GetInterfaces): Override this.
10917 2003-11-14 Martin Baulig <martin@ximian.com>
10919 * interface.cs (Interface.DefineType): Define all type parameters
10920 before adding the interfaces we inherit.
10922 2003-11-11 Martin Baulig <martin@ximian.com>
10924 * generic.cs (ConstructedType.ResolveType): Always call
10925 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
10927 2003-11-10 Martin Baulig <martin@ximian.com>
10929 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10930 (TypeManager.InitCoreTypes): Initialize them here, but instead of
10931 calling `ResolveType()' on them, directly assign their `Type'.
10933 2003-11-08 Martin Baulig <martin@ximian.com>
10935 * generic.cs (ConstructedType): Override `IsClass' etc.
10937 2003-11-08 Martin Baulig <martin@ximian.com>
10939 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10940 return value and the `out parent' parameter.
10941 (TypeContainer.DefineType): Moved the CS0644 check into
10942 GetClassBases(). Don't pass the interface types to the
10943 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10944 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10946 * ecore.cs (TypeExpr.IsAttribute): New property.
10947 (TypeExpr.GetInterfaces): New method.
10949 * interface.cs (Interface.GetInterfaceTypeByName): Return a
10950 TypeExpr instead of a Type.
10951 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10952 (Interface.DefineType): Don't pass the interface types to the
10953 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10954 them later and then call `TypeBulider.AddInterfaceImplementation()'.
10956 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10957 instead of a `Type[]'.
10958 (TypeManager.RegisterBuilder): Likewise.
10959 (TypeManager.AddUserInterface): Likewise.
10960 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10961 `Type[]' and also return a `TypeExpr[]'.
10962 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10964 2003-11-08 Martin Baulig <martin@ximian.com>
10966 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10969 2003-11-08 Martin Baulig <martin@ximian.com>
10971 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10972 TypeManager.ResolveExpressionTypes().
10974 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10975 instead of an Expression.
10976 (TypeExpr): This is now an abstract base class for `TypeExpression'.
10977 (TypeExpression): New public class; formerly known as `TypeExpr'.
10979 * expression.cs (ComposedCast): Derive from TypeExpr.
10981 * typemanager.cs (TypeManager.system_*_expr): These are now
10982 TypExpr's instead of Expression's.
10983 (TypeManager.ResolveExpressionTypes): New public static function;
10984 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10987 2003-11-06 Miguel de Icaza <miguel@ximian.com>
10989 * expression.cs (New.DoResolve): Do not dereference value that
10990 might be a null return.
10992 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10993 sure that the constant value has the right type. Fixes an
10994 unreported bug, similar to 50425.
10996 * const.cs (Const.LookupConstantValue): Call
10997 ImplicitStandardConversionExists before doing a conversion to
10998 avoid havng the TypeManager.ChangeType do conversions.
11000 Reduced the number of casts used
11002 (Const.ChangeType): New routine to enable reuse of the constant
11003 type changing code from statement.
11005 * typemanager.cs (ChangeType): Move common initialization to
11006 static global variables.
11010 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11011 every value type to go through, even if it was void. Fix that.
11013 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11014 character of the define, and the is_identifier_part_character for
11015 the rest of the string.
11017 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11019 * expression.cs (UnaryMutator.EmitCode): When I updated
11020 LocalVariableReference.DoResolve, I overdid it, and dropped an
11021 optimization done on local variable references.
11023 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11025 * ecore.cs: Convert the return from Ldlen into an int.
11027 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11029 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11030 the accessibility, this is a special case for toplevel non-public
11031 classes (internal for instance).
11033 2003-10-20 Nick Drochak <ndrochak@gol.com>
11035 * ecore.cs: Fix typo and build. Needed another right paren.
11037 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11039 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11040 `internal' case regular and protected, but not allowing protected
11041 to be evaluated later. Bug 49840
11043 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11045 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11046 to kb.Nlast, and not the kb.nFirst to isolate the switch
11049 Extract the underlying type, so enumerations of long/ulong are
11050 treated like long/ulong.
11052 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11054 * expression.cs (New): Overload the meaning of RequestedType to
11055 track the possible creation of the NewDelegate type, since
11056 DoResolve is invoked more than once for new constructors on field
11059 See bugs: #48800 and #37014
11061 * cs-parser.jay (declare_local_constants): Take an arraylist
11062 instead of a single constant.
11064 (local_constant_declaration): It should take a
11065 constant_declarators, not a constant_declarator. Fixes 49487
11067 * convert.cs: Fix error report.
11069 2003-10-13 Jackson Harper <jackson@ximian.com>
11071 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11074 2003-11-03 Martin Baulig <martin@ximian.com>
11076 * expression.cs (ArrayAccess.GetStoreOpcode): Added
11077 `out bool has_type_arg'; if set, we need to pass the type to
11079 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
11080 Stelem_Any/Ldelem_Any for generic parameters.
11082 2003-11-02 Martin Baulig <martin@ximian.com>
11084 * expression.cs (Invocation.EmitCall): Use
11085 `TypeManager.IsValueType()' to check whether it's a value type.
11086 Don't set `struct_call' when calling a method on a type parameter.
11088 2003-11-02 Martin Baulig <martin@ximian.com>
11090 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
11091 and removed the TypeBuilder argument.
11093 * typemanager.cs (TypeManager.IsValueType): Return
11094 `t.IsGenericParameter || t.IsValueType'.
11096 2003-10-25 Martin Baulig <martin@ximian.com>
11098 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
11099 call ConstructedType.Resolve() on it.
11101 * generic.cs (ConstructedType.Resolve): Set `type' on success.
11103 2003-10-25 Martin Baulig <martin@ximian.com>
11105 * class.cs (TypeContainer.GetClassBases): Changed
11106 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
11107 CS8214 reporting here.
11108 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
11109 instead of a `Type' for our parent. In case of a recursive
11110 declaration (see tests/gen-23.cs for an example), our parent is a
11111 ConstructedType and it doesn't have its type set. So, first
11112 create our own TypeBuilder, then call constructed.Resolve() to get
11113 the parent's type and finally TypeBuilder.SetParent() it.
11115 * ecore.cs (TypeExpr.Name): New public virtual property.
11118 (ConstructedType): We're now a TypeExpr and not just an Expression.
11119 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
11120 arguments here; this is done later.
11121 (ConstructedType.Resolve): New public method to resolve the type
11122 arguments and bind them.
11124 2003-10-21 Martin Baulig <martin@ximian.com>
11126 * convert.cs: Use `TypeManager.IsValueType' instead of
11127 'type.IsValueType' everywhere.
11129 * typemanager.cs (TypeManager.IsValueType): Return true for type
11130 parameters. The reason for this is that we need to box a type
11131 parameter when converting it to a reference type.
11133 * cs-parser.jay: Added support for default value expressions.
11135 * generics.cs (DefaultValueExpression): New public class.
11137 2003-10-17 Martin Baulig <martin@ximian.com>
11139 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
11140 TypeContainer so we can also use this for Interfaces.
11141 (TypeParameter.Resolve): Likewise.
11143 * interface.cs (Interface.DefineType): Added support for generic
11146 * cs-parser.jay: Added support for generic structs and interfaces.
11148 2003-10-17 Martin Baulig <martin@ximian.com>
11150 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
11151 call generic methods :-)
11153 2003-10-16 Martin Baulig <martin@ximian.com>
11155 * cs-parser.jay (namespace_or_type_name): Only create a
11156 GenericMemberAccess if we actually have type arguments.
11158 2003-10-13 Martin Baulig <martin@ximian.com>
11160 * class.cs (Method.Define): If we're a generic method, call
11161 TypeBuilder.DefineGenericMethod () before resolving
11163 (MethodData): Added .ctor which takes an additional MethodBuilder
11164 argument; this is used for generic methods.
11165 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
11166 we already have a MethodBuilder.
11168 2003-10-10 Martin Baulig <martin@ximian.com>
11170 * class.cs (Method): Added .ctor which takes a `GenericMethod'
11171 instead of a `DeclSpace'. This is used for generic methods.
11173 * cs-parser.jay (method_header): Added support for generic
11174 methods; create a `GenericMethod' instance and pass it to the
11175 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
11176 parameters and locals.
11178 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
11179 since we already have the location. Check whether we're a generic
11180 type declaration or a generic method and create the correct type
11183 * generic.cs (TypeParameter.DefineMethod): New public method.
11184 (GenericMethod): New public class; derives from DeclSpace and is
11185 used for generic methods.
11187 2003-10-09 Martin Baulig <martin@ximian.com>
11189 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11191 (MethodCore.DoDefineParameters): Removed the TypeContainer
11192 argument; use the DeclSpace which was passed to the .ctor instead.
11193 (MethodCore.CheckParameter): Take a DeclSpace instead of a
11194 TypeContainer; we only need a DeclSpace here.
11196 2003-10-09 Martin Baulig <martin@ximian.com>
11198 * class.cs (MethodData): Added additional `DeclSpace ds' argument
11200 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11201 EmitContext's .ctor.
11203 2003-10-09 Martin Baulig <martin@ximian.com>
11205 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11206 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11207 AsAccessible(), moved them as well.
11209 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11211 2003-10-07 Miguel de Icaza <miguel@ximian.com>
11213 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11214 generation for >=, as spotted by Paolo, bug 48679.
11215 Patch from David Waite.
11217 * cs-tokenizer.cs: Add handling for #pragma.
11219 * cs-parser.jay: Allow for both yield and yield return in the
11220 syntax. The anti-cobolization of C# fight will go on!
11222 * class.cs (TypeBuilder.DefineType): Catch error condition here
11223 (Parent.DefineType erroring out and returning null).
11225 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11226 coping with enumerations variables, we were mistakenly processing
11227 them as a regular value type instead of built-in types. Fixes the
11230 * typemanager.cs (IsBuiltinOrEnum): New method.
11232 2003-09-30 Miguel de Icaza <miguel@ximian.com>
11234 * cs-parser.jay: Upgrade: yield now needs the return clause.
11236 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11238 * cs-parser.jay : Renamed yyName to yyNames related to jay.
11240 2003-09-29 Martin Baulig <martin@ximian.com>
11242 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
11243 inflated generic methods.
11245 * generics.cs (ConstructedType): Distinguish between open and
11246 closed constructed types; correctly resolve the arguments.
11248 2003-09-22 Martin Baulig <martin@ximian.com>
11250 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
11251 all type arguments meet their constraints.
11253 2003-09-19 Martin Baulig <martin@ximian.com>
11255 * decl.cs (MemberCache.SetupCacheForInterface): Take a
11256 `MemberCache parent' argument. Normally, an interface doesn't
11257 have a parent type except System.Object, but we use this in gmcs
11258 for generic type parameters.
11260 2003-09-18 Martin Baulig <martin@ximian.com>
11262 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11263 on `type.IsInterface'; don't check whether the type has a parent
11264 to determine whether it's an interface.
11266 2003-09-17 Martin Baulig <martin@ximian.com>
11268 * generic.cs (ConstructedType.ToString): Always use `name' as the
11271 2003-09-15 Martin Baulig <martin@ximian.com>
11273 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
11275 * generic.cs (Constraints.Resolve): New public method; this is
11276 called to resolve the constraint types and to check whether all
11277 the constraints are correct.
11278 (Constraints.Types): New public property.
11279 (TypeParameter.Resolve): New public method; resolves all the
11280 type's constraints.
11282 * class.cs (TypeContainer.DefineType): Call
11283 TypeParameter.Resolve() before actually defining the type.
11285 2003-09-15 Martin Baulig <martin@ximian.com>
11287 * class.cs (TypeContainer.DefineType): Added an error flag to
11288 avoid reporting duplicate CS0146's ("class definition is
11291 * driver.cs (Driver.MainDriver): Abort if
11292 RootContext.ResolveTree() reported any errors.
11294 2003-09-07 Martin Baulig <martin@ximian.com>
11296 * report.cs (Error, Warning): Added overloaded versions which take
11297 a `params object[] args' and call String.Format().
11299 2003-09-07 Martin Baulig <martin@ximian.com>
11301 * decl.cs (DeclSpace..ctor): Don't call
11302 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11303 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
11304 (DeclSpace.RecordDecl): New method.
11306 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11308 2003-09-02 Ravi Pratap <ravi@ximian.com>
11310 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11311 value attributes to be applied to ParameterBuilders.
11313 * class.cs (MethodCore.LabelParameters): Make static and more
11314 generic so that it can be used from other places - like interface
11315 methods, for instance.
11317 * interface.cs (Interface.Emit): Call LabelParameters before
11318 emitting attributes on the InterfaceMethod.
11320 2003-09-07 Martin Baulig <martin@ximian.com>
11322 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
11323 if the number of type parameters doesn't match.
11325 2003-09-04 Martin Baulig <martin@ximian.com>
11327 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
11328 for arrays of generic type params (ie. `!0[]').
11330 2003-09-04 Martin Baulig <martin@ximian.com>
11332 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
11335 2003-09-04 Martin Baulig <martin@ximian.com>
11337 * decl.cs (DeclSpace.LookupGeneric): New method.
11338 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
11341 * generic.cs (TypeParameterExpr): Take a TypeParameter as
11342 argument, not just a string.
11343 (TypeParameter.Define): New public method; this is called to
11344 actually define the generic parameter; after this, you can use the
11345 new `Type' property to get the type.
11347 2003-09-04 Martin Baulig <martin@ximian.com>
11349 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
11350 is now an ArrayList; initialize the result of the `TypeParameters'
11352 (DeclSpace.GetGenericData): Removed.
11353 (DeclSpace.LookupGeneric): Temporarily removed; we need to
11354 implement this in a different way.
11355 (DeclSpace.GetTypeParameters): Removed; there's now a
11356 `TypeParameters' property.
11357 (DeclSpace.TypeParameters): New public property.
11359 * generic.cs (Constraints): Make this class public.
11360 (TypeParameter): New public class.
11362 2003-09-04 Martin Baulig <martin@ximian.com>
11364 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
11365 generic parameters.
11367 * class.cs (TypeContainer.DefineType): Call
11368 TypeBuilder.DefineGenericParameter () on all generic parameters if
11369 this is a generic type.
11371 2003-08-28 Martin Baulig <martin@ximian.com>
11373 * sample-stack.il: Compile this with ilasm: "ilasm /dll
11376 * sample-hello.cs: Compile this with gmcs: "gmcs
11377 /r:sample-stack.dll sample-hello.cs".
11379 2003-08-28 Martin Baulig <martin@ximian.com>
11381 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
11382 the parameters to the generic type.
11384 2003-08-28 Martin Baulig <martin@ximian.com>
11386 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
11388 2003-08-28 Martin Baulig <martin@ximian.com>
11390 * cs-parser.jay (opt_type_argument_list): Use
11391 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
11392 (primary_expression): Replace `qualified_identifier' with `type_name'.
11393 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
11395 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
11396 parser to check whether it is syntactically a type parameter list;
11397 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
11400 2003-08-26 Martin Baulig <martin@ximian.com>
11402 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11403 resolving aliases; fixes #47927.
11405 2003-08-26 Martin Baulig <martin@ximian.com>
11407 * statement.cs (Using.DoResolve): This is internally emitting a
11408 try/finally clause, so we need to set ec.NeedExplicitReturn if we
11409 do not always return. Fixes #47681.
11411 2003-08-26 Martin Baulig <martin@ximian.com>
11413 * decl.cs (MemberCore): Moved WarningNotHiding(),
11414 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11416 (AdditionResult): Make this nested in DeclSpace.
11417 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11418 argument; call NamespaceEntry.Define() unless we're nested in a
11421 * namespace.cs (Namespace.DefineName): New public function. This
11422 is called from DeclSpace's .ctor to add
11423 (Namespace.Lookup): Include DeclSpaces in the lookup.
11425 * class.cs (Operator): Derive from MemberBase, not MemberCore.
11427 * const.cs (Const): Derive from MemberBase, not MemberCore.
11429 2003-08-25 Martin Baulig <martin@ximian.com>
11431 * convert.cs (Convert.ExplicitReferenceConversion): When
11432 converting from an interface type to a class, unbox if the target
11433 type is a struct type. Fixes #47822.
11435 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11437 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11440 2003-08-22 Martin Baulig <martin@ximian.com>
11442 * class.cs (TypeManager.DefineType): When defining a nested type,
11443 call DefineType() on our parent; fixes #47801.
11445 2003-08-22 Martin Baulig <martin@ximian.com>
11447 * class.cs (MethodData.Define): While checking if a method is an
11448 interface implementation, improve the test a bit more to fix #47654.
11450 2003-08-22 Martin Baulig <martin@ximian.com>
11452 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11453 correctly; fixes #47722.
11455 2003-08-22 Martin Baulig <martin@ximian.com>
11457 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11458 LocalVariableReference, ensure it's not read-only. Fixes #47536.
11460 * statement.cs (Fixed.DoResolve): Make all variables read-only.
11462 2003-08-22 Martin Baulig <martin@ximian.com>
11464 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11465 can only be assigned in static constructors. Fixes #47161.
11467 2003-08-22 Martin Baulig <martin@ximian.com>
11469 Rewrote and improved the flow analysis code.
11471 * flowbranching.cs (FlowBranching): Make this class abstract.
11472 (FlowBranching.CreateBranching): New static function to create a
11473 new flow branching.
11474 (FlowBranchingBlock, FlowBranchingException): New classes.
11475 (FlowBranching.UsageVector.Type): New public readonly field.
11476 (FlowBranching.UsageVector.Breaks): Removed the setter.
11477 (FlowBranching.UsageVector.Returns): Removed the setter.
11478 (FlowBranching.UsageVector): Added Break(), Return(),
11479 NeverReachable() and Throw() methods to modify the reachability.
11480 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11481 done by FlowBranching.Merge().
11482 (FlowBranching.UsageVector.MergeChild): New method; merges the
11483 merge result into the current vector.
11484 (FlowBranching.Merge): New abstract method to merge a branching.
11486 2003-08-12 Martin Baulig <martin@ximian.com>
11488 * expression.cs (Indirection.CacheTemporaries): Create the
11489 LocalTemporary with the pointer type, not its element type.
11491 2003-08-10 Miguel de Icaza <miguel@ximian.com>
11493 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11494 token was a keyword or not.
11496 Add `error' options where an IDENTIFIER was expected; Provide
11497 CheckToken and CheckIdentifierToken convenience error reporting
11500 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11502 * decl.cs: Rename `NamespaceEntry Namespace' public field into
11503 NameSpaceEntry NameSpaceEntry.
11505 (LookupInterfaceOrClass): Avoid creating a full qualified name
11506 from namespace and name: avoid doing lookups when we know the
11507 namespace is non-existant. Use new Tree.LookupByNamespace which
11508 looks up DeclSpaces based on their namespace, name pair.
11510 * driver.cs: Provide a new `parser verbose' to display the
11511 exception thrown during parsing. This is turned off by default
11512 now, so the output of a failure from mcs is more graceful.
11514 * namespace.cs: Track all the namespaces defined in a hashtable
11517 (IsNamespace): New method
11519 2003-08-09 Miguel de Icaza <miguel@ximian.com>
11521 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
11522 we know that we need to concatenate (full typename can never be
11527 * statement.cs: Use a bitfield; Do not initialize to null things
11528 which are done by the constructor by default.
11530 * cs-parser.jay: bug fix, parameter was 4, not 3.
11532 * expression.cs: Just use the property;
11534 * statement.cs: No need for GetVariableInfo method.
11536 2003-08-08 Martin Baulig <martin@ximian.com>
11538 * flowanalysis.cs (FlowReturns): This is now nested in the
11539 `FlowBranching' class.
11540 (MyBitVector): Moved this here from statement.cs.
11541 (FlowBranching.SiblingType): New enum type.
11542 (FlowBranching.CreateSibling): Added `SiblingType' argument.
11544 2003-08-07 Martin Baulig <martin@ximian.com>
11546 * flowanalysis.cs (FlowBranchingType): This is now nested in the
11547 `FlowBranching' class and called `BranchingType'.
11549 2003-08-07 Martin Baulig <martin@ximian.com>
11551 * flowanalysis.cs: Moved all the control flow analysis code into
11554 2003-08-07 Martin Baulig <martin@ximian.com>
11556 * assign.cs (Assign.DoResolve): `target' must either be an
11557 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
11560 2003-08-07 Miguel de Icaza <miguel@ximian.com>
11562 * expression.cs (BinaryMethod): This kind of expression is created by the
11563 Binary class if it determines that the operator has to be handled
11566 (BinaryDelegate): This kind of expression is created if we are
11567 dealing with a + or - operator on delegates.
11569 (Binary): remove method, argumetns, and DelegateOperator: when
11570 dealing with methods,
11572 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11574 * statement.cs (Block): use bitfields for the three extra booleans
11575 we had in use. Remove unused topblock parameter.
11577 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11579 * assign.cs: Drop extra unneeded tests.
11581 2003-08-06 Miguel de Icaza <miguel@ximian.com>
11583 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11585 * statement.cs (Foreach): Use VariableStorage instead of
11588 * codegen.cs (VariableStorage): New class used by clients that
11589 require a variable stored: locals or fields for variables that
11590 need to live across yield.
11592 Maybe provide a convenience api for EmitThis+EmitLoad?
11594 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11597 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11599 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11600 RemapParameterLValue): New methods that are used to turn a
11601 precomputed FieldInfo into an expression like this:
11605 The idea is to use this instead of making LocalVariableReference
11606 have more than one meaning.
11608 * cs-parser.jay: Add error production to BASE.
11610 * ecore.cs: Deal with TypeManager.GetField returning null, which
11611 is now a valid return value.
11613 (FieldExprNoAddress): New expression for Fields whose address can
11616 * expression.cs (LocalVariableReference): During the resolve
11617 phases, create new expressions if we are in a remapping context.
11618 Remove code that dealt with remapping here.
11620 (ParameterReference): same.
11622 (ProxyInstance): New expression, like the `This' expression, but
11623 it is born fully resolved. We know what we are doing, so remove
11624 the errors that are targeted to user-provided uses of `this'.
11626 * statement.cs (Foreach): our variable is now stored as an
11627 Expression; During resolution, follow the protocol, dont just
11628 assume it will return this.
11630 2003-08-06 Martin Baulig <martin@ximian.com>
11632 * support.cs (SeekableStreamReader.cs): New public class.
11634 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11635 SeekableStreamReader instead of the normal StreamReader.
11637 2003-08-04 Martin Baulig <martin@ximian.com>
11639 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11640 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11641 deambiguate casts and delegate invocations.
11642 (parenthesized_expression): Use the new tokens to ensure this is
11643 not a cast of method invocation.
11645 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11646 when reading a `)' and Deambiguate_CloseParens () was previously
11649 * expression.cs (ParenthesizedExpression): New class. This is
11650 just used for the CS0075 test.
11651 (Binary.DoResolve): Check for CS0075.
11653 2003-07-29 Ravi Pratap <ravi@ximian.com>
11655 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11656 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11657 reference comparison.
11659 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11660 examine the ReturnType for equality - this is necessary in the
11661 cases of implicit and explicit operators whose signature also
11662 includes the return type.
11664 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11666 * namespace.cs: Cache the result of the namespace computation,
11667 instead of computing it every time.
11669 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11671 * decl.cs: Use a global arraylist that we reuse over invocations
11672 to avoid excesive memory consumption. Reduces memory usage on an
11673 mcs compile by one meg (45 average).
11675 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11676 private, work around that.
11678 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11680 * literal.cs (IntLiteral): Define Zero and One static literals.
11682 * cs-parser.jay (integer_literal): use static literals to reduce
11683 memory usage for the most used literals (0, 1 and -1). 211kb
11684 reduced in memory usage.
11686 Replace all calls to `new ArrayList' with `new
11687 ArrayList(4)' which is a good average number for most allocations,
11688 and also requires only 16 bytes of memory for its buffer by
11691 This reduced MCS memory usage in seven megabytes for the RSS after
11694 2003-07-28 Ravi Pratap <ravi@ximian.com>
11696 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11697 handle params methods the correct way by forming only one
11698 applicable set with params and normal methods in them. Earlier we
11699 were looking at params methods only if we found no normal methods
11700 which was not the correct thing to do.
11702 (Invocation.BetterFunction): Take separate arguments indicating
11703 when candidate and the best method are params methods in their
11706 This fixes bugs #43367 and #46199.
11708 * attribute.cs: Documentation updates.
11710 (CheckAttribute): Rename to CheckAttributeTarget.
11711 (GetValidPlaces): Rename to GetValidTargets.
11713 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11714 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11718 2003-07-28 Miguel de Icaza <miguel@ximian.com>
11720 * codegen.cs: Compute IsGeneric correctly.
11722 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
11725 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
11726 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
11727 regressions, and I was chasing more bugs than I required.
11729 * interface.cs: Use expressions for base type names (like classes
11730 and structs have been doing for a while now), and resolve that.
11731 This patch should probably go into head as well.
11733 This makes it one less user of FindType.
11735 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11737 This compiler can not self host currently. Need to fix that.
11739 * Makefile: compile to `gmcs.exe'
11741 * driver.cs: Turn on v2 by default on gmcs.
11743 * generic.cs (ConstructedType): Does no longer take a container
11744 type argument; That will be taken care of later.
11746 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
11747 Use SimpleName to resolve for now, so we can continue the work on
11748 the parser, until we get Type.GetType that understands generics.
11750 (ConstructedType.ToString): Implement
11752 (TypeArguments.Resolve): Resolve the child expressions as types.
11754 * cs-parser.jay: Rename interface_constraints to
11755 type_parameter_constraints
11757 (namespace_or_type_name): Only use constructed types for the basic
11758 construction, we will deal with identifier<...> later.
11760 (type/type_name): No longer call DecomposeQI, as
11761 namespace_or_type_name is always decoded now.
11763 2003-07-22 Ravi Pratap <ravi@ximian.com>
11765 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11766 closely: we eliminate methods in base types when we have an
11767 applicable method in a top-level type.
11769 Please see section 14.5.5.1 for an exact description of what goes
11772 This fixes bug #45127 and a host of other related to corlib compilation.
11774 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11775 array is the method corresponding to the top-level type (this is
11776 because of the changes made to icall.c) so we change this
11779 (MethodGroupExpr.Name): This too.
11781 * typemanager.cs (GetElementType): New method which does the right
11782 thing when compiling corlib.
11784 * everywhere: Make use of the above in the relevant places.
11786 2003-07-22 Martin Baulig <martin@ximian.com>
11788 * cs-parser.jay (invocation_expression): Moved
11789 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11790 `cast_expression', but create a InvocationOrCast which later
11791 resolves to either an Invocation or a Cast.
11793 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11794 method; call this before EmitStatement() to make sure that this
11795 expression can be used as a statement.
11797 * expression.cs (InvocationOrCast): New class; resolves to either
11798 an Invocation or a Cast.
11800 * statement.cs (StatementExpression): Call ResolveStatement() on
11801 the ExpressionStatement before emitting it.
11803 2003-07-21 Martin Baulig <martin@ximian.com>
11805 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11806 `ref' and `out' attributes match; fixes #46220.
11807 (MemberAccess.ResolveMemberAccess): You can't reference a type
11808 through an expression; fixes #33180.
11809 (Indexers.GetIndexersForType): Don't return the indexers from
11810 interfaces the class implements; fixes #46502.
11812 2003-07-21 Martin Baulig <martin@ximian.com>
11814 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11815 CS0661 checks; fixes bug #30442.
11817 2003-07-21 Martin Baulig <martin@ximian.com>
11819 * decl.cs (AdditionResult): Added `Error'.
11821 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11823 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
11824 cs0031.cs actually work.
11826 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11828 * cs-parser.jay (namespace_name): do not use
11829 namespace_or_type_name, use qualified_identifier, because
11830 namespace_or_type_name will soon return a composed expression
11831 instead of a string.
11833 (namespace_or_type_name): Instead of returning a string, now this
11834 production returns an expression.
11836 * codegen.cs (EmitContext): Setup IsGeneric property based on
11837 whether our DeclSpace is generic, our the method is generic.
11839 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
11840 the method is generic.
11842 * cs-parser.jay (type_arguments, opt_type_argument_list,
11843 type_parameters, type_parameter_list, opt_type_parameter_list,
11844 type_parameter,, opt_type_parameter_constraints_clauses,
11845 type_parameter_constraints_clauses,
11846 type_parameter_constraint_clause, type_parameter_constraint,
11847 interface_constraints): Add new production
11849 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
11850 DeclSpace is generic or not.
11852 (DeclSpace.SetParameterInfo): New routine, used to set the
11853 parameter info for a type.
11855 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
11856 returns a GenericTypeExpr
11858 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
11859 generic, lookup the generic argument.
11861 * attribute.cs: Do not allow TypeParameterExpressions in
11864 * class.cs: Do not allow the Main method to be defined in a
11867 * expression.cs (SizeOf): Do not allow generic types to be used as
11868 arguments to sizeof.
11870 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
11871 it: whether a type is generic or not. Only works for types we are
11872 currently building for now.
11874 2003-07-20 Martin Baulig <martin@ximian.com>
11876 * namespace.cs: Fixed that bug which caused a crash when compiling
11877 the debugger's GUI.
11879 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11881 * typemanager.cs (LookupTypeReflection): Never expose types which
11882 are NotPublic, NestedPrivate, NestedAssembly, or
11883 NestedFamANDAssem. We used to return these, and later do a check
11884 that would report a meaningful error, but the problem is that we
11885 would not get the real match, if there was a name override.
11887 2003-07-18 Miguel de Icaza <miguel@ximian.com>
11889 * namespace.cs (Namespace, Name): Do not compute the namespace
11890 name dynamically, compute it in the constructor. This reduced
11891 memory usage by 1697 KB.
11893 * driver.cs: Use --pause to pause at the end.
11895 2003-07-17 Peter Williams <peter@newton.cx>
11897 * Makefile: Change the name of the test target so that it doesn't
11898 conflict with the recursive test target.
11900 2003-07-17 Miguel de Icaza <miguel@ximian.com>
11902 * expression.cs (LocalVariableReference.Emit, EmitAssign,
11903 AddressOf): Do not use EmitThis, that was wrong, use the actual
11906 2003-07-15 Miguel de Icaza <miguel@ximian.com>
11908 * class.cs (MethodData.Define): While checking if a method is an
11909 interface implementation, improve the test: If we are not public
11910 (use new test here: use the computed MethodAttributes directly,
11911 instead of the parsed modifier flags) check if the `implementing'
11912 method comes from an interface or not.
11914 * pending.cs (VerifyPendingMethods): Slightly better error
11917 * makefile: add test target that does the mcs bootstrap.
11919 2003-07-16 Ravi Pratap <ravi@ximian.com>
11921 * interface.cs (Define): Do nothing here since there are no
11922 members to populate etc. Move the attribute emission out of here
11923 since this was just totally the wrong place to put it. Attribute
11924 application happens during the 'Emit' phase, not in the 'Define'
11927 (Emit): Add this method and move the attribute emission here
11929 * rootcontext.cs (EmitCode): Call the Emit method on interface
11932 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11934 * expression.cs (OverloadResolve): Report error only if Location
11935 is not 'Null' which means that there was a probe going on.
11937 2003-07-14 Martin Baulig <martin@ximian.com>
11939 * expression.cs (ConditionalLogicalOperator): New public class to
11940 implement user defined conditional logical operators.
11941 This is section 14.11.2 in the spec and bug #40505.
11943 2003-07-14 Martin Baulig <martin@ximian.com>
11945 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11947 2003-07-14 Martin Baulig <martin@ximian.com>
11949 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11951 * ecore.cs (IVariable.VerifyFixed): New interface method.
11953 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11954 operator, check whether the variable is actually fixed. Fixes bug
11955 #36055. Set a variable definitely assigned when taking its
11956 address as required by the spec.
11958 * statement.cs (LocalInfo.IsFixed): New field.
11959 (LocalInfo.MakePinned): Set `IsFixed' to true.
11961 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11963 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11964 for .ctors, ensure that we only ask for members declared in the
11965 attribute type (BindingFlags.DeclaredOnly).
11969 * expression.cs (Error_WrongNumArguments): Report error 1501
11970 correctly the way CSC does.
11972 2003-07-13 Martin Baulig <martin@ximian.com>
11974 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11975 lookup on the fully qualified name, to make things like "X.X" work
11976 where "X.X" is a fully qualified type name, but we also have a
11977 namespace "X" in the using list. Fixes #41975.
11979 2003-07-13 Martin Baulig <martin@ximian.com>
11981 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11982 function. If we're a CompoundAssign, we need to create an embedded
11983 CompoundAssign, not an embedded Assign.
11984 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11987 2003-07-13 Martin Baulig <martin@ximian.com>
11989 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11990 work to fix bug #46088.
11992 2003-07-13 Ravi Pratap <ravi@ximian.com>
11994 * class.cs (Operator.Emit): Do not emit attributes here - it is
11995 taken care of by the Method class that we delegate too. This takes
11996 care of bug #45876.
11998 2003-07-10 Martin Baulig <martin@ximian.com>
12000 * expression.cs (TypeOfVoid): New class.
12001 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
12003 2003-07-10 Martin Baulig <martin@ximian.com>
12005 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12008 2003-07-10 Martin Baulig <martin@ximian.com>
12010 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12011 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12013 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12015 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12017 2003-07-10 Martin Baulig <martin@ximian.com>
12019 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12020 of decimal. Fixes #42850.
12022 NOTE: I also fixed the created byte blob, but this doesn't work on
12023 the MS runtime and csc never produces any byte blobs for decimal
12026 2003-07-10 Martin Baulig <martin@ximian.com>
12028 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12029 structs; fixes #32068.
12030 (Block.AddChildVariableNames): Fixed #44302.
12032 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12034 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12036 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12038 * attribute.cs: And this test is onger needed.
12040 2003-07-08 Martin Baulig <martin@ximian.com>
12042 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12043 inaccessible types. Fixes #36313.
12045 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12047 * namespace.cs (NamespaceEntry): Create implicit entries for all
12048 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12049 implicit entries for N1.N2 and N1.
12051 2003-07-08 Martin Baulig <martin@ximian.com>
12053 Rewrote the handling of namespaces to fix a lot of the issues
12054 wrt. `using' aliases etc.
12056 * namespace.cs (Namespace): Splitted this class into a
12057 per-assembly `Namespace' and a per-file `NamespaceEntry'.
12059 * typemanager.cs (TypeManager.IsNamespace): Removed.
12060 (TypeManager.ComputeNamespaces): Only compute namespaces from
12061 loaded assemblies here, not the namespaces from the assembly we're
12062 currently compiling.
12064 2003-07-08 Martin Baulig <martin@ximian.com>
12066 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12068 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12070 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12073 I thought about the memory savings here, but LookupTypeReflection
12074 is used under already very constrained scenarios. Compiling
12075 corlib or mcs only exposes one hit, so it would not really reduce
12076 any memory consumption.
12078 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12080 * typemanager.cs: fixes bug #45889 by only adding public types from
12081 other assemblies to the list of known types.
12083 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12085 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12086 on the type we resolved.
12088 2003-07-05 Martin Baulig <martin@ximian.com>
12090 * pending.cs (PendingImplementation.ParentImplements): Don't
12091 create the proxy if the parent is abstract.
12093 * class.cs (TypeContainer.DefineIndexers): Process explicit
12094 interface implementations first. Fixes #37714.
12096 2003-07-04 Miguel de Icaza <miguel@ximian.com>
12098 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12099 defined recursively; but since we modify the input parameters
12100 (left is set to `this' temporarily), we reset this value if the
12101 left_is_explicit is false, which gives the original semantics to
12104 * literal.cs (NullPointer): new class used to represent a null
12105 literal in a pointer context.
12107 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12108 type is a pointer, use a NullPointer object instead of a
12109 NullLiteral. Closes 43687
12111 (ExplicitConversion): Convert pointer values using
12112 the conv opcode to the proper type.
12114 * ecore.cs (New): change ValueTypeVariable property into a method,
12115 that returns whether the valuetype is suitable for being used.
12117 * expression.cs (Binary.DoNumericPromotions): Only return if we
12118 the int constant was a valid uint, and we can return both left and
12119 right as uints. If not, we continue processing, to trigger the
12120 type conversion. This fixes 39018.
12122 * statement.cs (Block.EmitMeta): During constant resolution, set
12123 the CurrentBlock property on the emitcontext, so that we resolve
12124 constants propertly.
12126 2003-07-02 Martin Baulig <martin@ximian.com>
12128 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12129 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12131 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12132 than emitting it here.
12134 * statement.cs: Fixed some more flow analysis bugs.
12136 2003-07-02 Martin Baulig <martin@ximian.com>
12138 * class.cs (MethodData.Define): When implementing interface
12139 methods, set Final unless we're Virtual.
12141 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12142 check work for interface methods.
12144 2003-07-01 Martin Baulig <martin@ximian.com>
12146 * ecore.cs (EmitContext.This): Replaced this property with a
12147 GetThis() method which takes a Location argument. This ensures
12148 that we get the correct error location for a CS0188.
12150 2003-07-01 Miguel de Icaza <miguel@ximian.com>
12152 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12153 ImplicitStandardConversion.
12155 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12157 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
12159 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12162 2003-06-30 Miguel de Icaza <miguel@ximian.com>
12164 * class.cs (Constructor.Define): Turn off initlocals for unsafe
12167 (MethodData.Define): Turn off initlocals for unsafe methods.
12169 2003-06-29 Miguel de Icaza <miguel@ximian.com>
12171 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12172 complete; Fixes #37521.
12174 * delegate.cs: Use Modifiers.TypeAttr to compute the
12175 TypeAttributes, instead of rolling our own. This makes the flags
12176 correct for the delegates.
12178 2003-06-28 Miguel de Icaza <miguel@ximian.com>
12180 * class.cs (Constructor.Define): Set the private flag for static
12181 constructors as well.
12183 * cs-parser.jay (statement_expression): Set the return value to
12184 null, to avoid a crash when we catch an error.
12186 2003-06-24 Miguel de Icaza <miguel@ximian.com>
12188 * cs-parser.jay: Applied patch from Jackson that adds support for
12189 extern and unsafe modifiers to destructor declarations.
12191 * expression.cs: Report error 21 if the user is trying to index a
12194 * driver.cs: Add an error message, suggested by the bug report.
12196 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12197 if we do not have a ": this ()" constructor initializer. Fixes 45149
12199 2003-06-14 Miguel de Icaza <miguel@ximian.com>
12201 * namespace.cs: Add some information to reduce FAQs.
12203 2003-06-13 Miguel de Icaza <miguel@ximian.com>
12205 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12206 underlying enumeration types. Fixes #43915.
12208 * expression.cs: Treat ushort/short as legal values to be used in
12209 bitwise operations.
12211 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12213 * delegate.cs: transfer custom attributes for paramenters from
12214 the delegate declaration to Invoke and BeginInvoke.
12216 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12218 * attribute.cs: handle custom marshalers and emit marshal info
12221 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
12223 * makefile.gnu: Added anonymous.cs to the compiler sources.
12225 2003-05-28 Miguel de Icaza <miguel@ximian.com>
12227 * iterators.cs: Change the name of the proxy class to include two
12230 * cs-parser.jay: Update grammar to include anonymous methods.
12232 * anonymous.cs: new file.
12234 2003-05-27 Miguel de Icaza <miguel@ximian.com>
12236 * class.cs (Field.Define): Add missing test for pointers and
12239 2003-05-27 Ravi Pratap <ravi@ximian.com>
12241 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12242 we use the stobj opcode.
12244 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12245 since it wasn't the correct fix.
12247 It still is puzzling that we are required to use stobj for IntPtr
12248 which seems to be a ValueType.
12250 2003-05-26 Miguel de Icaza <miguel@ximian.com>
12252 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12253 during regular simple name resolution. Now, the trick is that
12254 instead of returning for processing the simplename, we do a
12255 TypeManager.LookupType (ie, a rooted lookup as opposed to a
12256 contextual lookup type). If a match is found, return that, if
12257 not, return for further composition.
12259 This fixes long-standing 30485.
12261 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12262 using the address to initialize an object, do an Stobj instead of
12263 using the regular Stelem.
12265 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12266 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12267 Because if we are a BaseIndexerAccess that value will be true.
12270 * statement.cs (GotoCase.Resolve): Return after reporting an
12271 error, do not attempt to continue.
12273 * expression.cs (PointerArithmetic.Emit): If our operand is a
12274 long, convert our constants to match the operand before
12275 multiplying. Convert to I type before adding. Fixes 43670.
12277 2003-05-14 Ravi Pratap <ravi@ximian.com>
12279 * enum.cs (ImplicitConversionExists) : Rename to
12280 ImplicitEnumConversionExists to remove ambiguity.
12282 * ecore.cs (NullCast): New type of cast expression class which
12283 basically is very similar to EmptyCast with the difference being
12284 it still is a constant since it is used only to cast a null to
12286 (eg. (string) null)
12288 * convert.cs (ImplicitReferenceConversion): When casting a null
12289 literal, we return a NullCast.
12291 * literal.cs (NullLiteralTyped): Remove - I don't see why this
12292 should be around anymore.
12294 The renaming (reported was slightly wrong). Corrections:
12296 ConvertImplicitStandard -> ImplicitConversionStandard
12297 ConvertExplicitStandard -> ExplicitConversionStandard
12299 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12300 before passing them in !
12302 * convert.cs (ImplicitConversionStandard): When comparing for
12303 equal expr and target types, ensure that expr is not a
12306 In general, we must not be checking (expr_type ==
12307 target_type) in the top level conversion methods
12308 (ImplicitConversion, ExplicitConversion etc). This checking is
12309 done in the methods that they delegate to.
12311 2003-05-20 Miguel de Icaza <miguel@ximian.com>
12313 * convert.cs: Move Error_CannotConvertType,
12314 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12315 ImplicitNumericConversion, ImplicitConversionExists,
12316 ImplicitUserConversionExists, StandardConversionExists,
12317 FindMostEncompassedType, FindMostSpecificSource,
12318 FindMostSpecificTarget, ImplicitUserConversion,
12319 ExplicitUserConversion, GetConversionOperators,
12320 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12321 TryImplicitIntConversion, Error_CannotConvertImplicit,
12322 ConvertImplicitRequired, ConvertNumericExplicit,
12323 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12324 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12327 Perform the following renames:
12329 StandardConversionExists -> ImplicitStandardConversionExists
12330 ConvertImplicit -> ImplicitConversion
12331 ConvertImplicitStandard -> ImplicitStandardConversion
12332 TryImplicitIntConversion -> ImplicitIntConversion
12333 ConvertImplicitRequired -> ImplicitConversionRequired
12334 ConvertNumericExplicit -> ExplicitNumericConversion
12335 ConvertReferenceExplicit -> ExplicitReferenceConversion
12336 ConvertExplicit -> ExplicitConversion
12337 ConvertExplicitStandard -> ExplicitStandardConversion
12339 2003-05-19 Martin Baulig <martin@ximian.com>
12341 * statement.cs (TypeInfo.StructInfo): Made this type protected.
12342 (TypeInfo): Added support for structs having structs as fields.
12344 * ecore.cs (FieldExpr): Implement IVariable.
12345 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12346 VariableInfo for the field.
12348 2003-05-18 Martin Baulig <martin@ximian.com>
12350 * expression.cs (This.DoResolve): Report a CS0027 if we're
12351 emitting a field initializer.
12353 2003-05-18 Martin Baulig <martin@ximian.com>
12355 * expression.cs (This.ResolveBase): New public function.
12356 (This.DoResolve): Check for CS0188.
12358 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12361 * ecore.cs (MethodGroupExpr.DoResolve): Set the
12362 `instance_expression' to null if we don't have any non-static
12365 2003-05-18 Martin Baulig <martin@ximian.com>
12367 Reworked the way how local variables and parameters are handled by
12368 the flow analysis code.
12370 * statement.cs (TypeInfo, VariableMap): New public classes.
12371 (VariableInfo): New public class. This is now responsible for
12372 checking whether a variable has been assigned. It is used for
12373 parameters and local variables.
12374 (Block.EmitMeta): Take the InternalParameters as argument; compute
12375 the layout of the flow vectors here.
12376 (Block.LocalMap, Block.ParameterMap): New public properties.
12377 (FlowBranching): The .ctor doesn't get the InternalParameters
12378 anymore since Block.EmitMeta() now computes the layout of the flow
12380 (MyStructInfo): This class is now known as `StructInfo' and nested
12381 in `TypeInfo'; we don't access this directly anymore.
12383 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12384 property and removed IsAssigned(), IsFieldAssigned(),
12385 SetAssigned() and SetFieldAssigned(); we now call them on the
12386 VariableInfo so we don't need to duplicate this code everywhere.
12388 * expression.cs (ParameterReference): Added `Block block' argument
12390 (LocalVariableReference, ParameterReference, This): The new
12391 VariableInfo class is now responsible for all the definite
12394 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12395 IsParameterAssigned, SetParameterAssigned): Removed.
12397 2003-05-18 Martin Baulig <martin@ximian.com>
12399 * typemanager.cs (InitCoreTypes): Try calling
12400 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12401 the 3-args-version. Corlib now also needs our `void_type'.
12402 (GetMethod): Added overloaded version which takes an optional
12403 `bool report_errors' to allow lookups of optional methods.
12405 2003-05-12 Martin Baulig <martin@ximian.com>
12407 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12408 only used for locals and not for parameters.
12410 2003-05-12 Miguel de Icaza <miguel@ximian.com>
12412 * support.cs (InternalParameters.ParameterType): Return the
12413 ExternalType of the parameter.
12415 * parameter.cs (Parameter.ExternalType): drop the two arguments,
12418 2003-05-11 Miguel de Icaza <miguel@ximian.com>
12420 * class.cs (MethodData.Define): Do not set the `newslot' on
12421 interface members, if they are also flagged as "override".
12423 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12424 better code for ++i and i++. This only works for static fields
12425 and local variables.
12427 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12428 want to pull the DeclSpace out of the builder_to_declspace instead
12429 of the TypeBuilder (like in TypeContainer.FindMembers).
12431 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12432 instead of LookupTypeContainer. Fixes the crash on .NET for
12433 looking up interface members.
12435 * const.cs: Create our own emit context during the Definition
12436 stage, so that constants are evaluated in the proper context, when
12437 a recursive definition happens.
12439 2003-05-11 Martin Baulig <martin@ximian.com>
12441 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
12442 new block for a switch section.
12443 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12444 the adding/lookup in the switch block. Fixes #39828.
12446 2003-05-09 Miguel de Icaza <miguel@ximian.com>
12448 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12449 functionality: I needed to convert the data after I had performed
12450 the add/sub operation into the operands type size.
12452 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12453 pass the type for the box operation, otherwise the resulting
12454 object would have been of type object.
12456 (BoxedCast): Add constructor to specify the type to box as.
12458 2003-05-07 Miguel de Icaza <miguel@ximian.com>
12460 * iterators.cs: I was reusing the `count' variable inadvertently,
12461 take steps to not allow this to happen.
12463 2003-05-06 Miguel de Icaza <miguel@ximian.com>
12465 * attribute.cs (Attribute.Resolve): Params attributes are encoded
12466 by creating an array at the point where the params starts and
12467 putting all those arguments there, then adjusting the size of the
12470 2003-05-05 Miguel de Icaza <miguel@ximian.com>
12472 * expression.cs (New.AddressOf): Implement interface
12473 IMemoryLocation. This is used when the `new' operator is used in
12474 the context of an invocation to a method on a value type.
12476 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12479 * namespace.cs: Also check the using aliases here.
12481 * driver.cs: Move the test for using validity after the types have
12482 been entered, so we do a single pass that also includes the using
12485 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12486 in the regular case. CreateSiblingForFinally is doing extra
12489 * attribute.cs (GetAttributeArgumentExpression): Store the result
12490 on an out value, and use the return value to indicate failure
12491 instead of using null (which is a valid return for Constant.GetValue).
12493 * statement.cs: Perform the analysis flow for the increment
12494 portion after the statement, because this will be the real flow of
12495 execution. Fixes #42385
12497 * codegen.cs (EmitContext.EmitArgument,
12498 EmitContext.EmitStoreArgument): New helper functions when the
12499 RemapToProxy flag is set.
12501 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12504 Add support for remapping parameters.
12506 * iterators.cs: Propagate parameter values; Store parameter
12507 values in the proxy classes.
12509 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12511 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12512 need a proxy reference; I do not know what I was thinking
12514 * cs-parser.jay (constructor_initializer): catch another error,
12515 and display nice message.
12517 (field_declaration): catch void field declaration
12518 to flag a better error.
12520 * class.cs (MemberBase.CheckBase): Report an error instead of a
12521 warning if a new protected member is declared in a struct.
12522 (Field.Define): catch the error of readonly/volatile.
12524 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12526 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12527 volatile variable is taken
12529 2003-05-02 Miguel de Icaza <miguel@ximian.com>
12531 * statement.cs (Fixed.Resolve): Report an error if we are not in
12534 2003-05-01 Miguel de Icaza <miguel@ximian.com>
12536 * typemanager.cs: reuse the code that handles type clashes for
12537 delegates and enumerations.
12539 * class.cs (Report28): Always report.
12541 * expression.cs (EncodeAsAttribute): Allow nulls here.
12543 2003-04-28 Miguel de Icaza <miguel@ximian.com>
12545 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12546 the functionality for testing whether an expression is valid for
12547 an attribute here. Also handle the case of arrays of elements
12550 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12551 encoding a linear array into an array of objects that are suitable
12552 to be passed to an CustomAttributeBuilder.
12554 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12556 * ecore.cs: (FieldExpr): Handle field remapping here.
12558 * iteratators.cs: Pass the instance variable (if the method is an
12559 instance method) to the constructors, so we can access the field
12560 variables on the class.
12562 TODO: Test this with structs. I think the THIS variable on
12563 structs might have to be a pointer, and not a refenrece
12565 2003-04-27 Miguel de Icaza <miguel@ximian.com>
12567 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12568 local variables to fields in a proxy class.
12570 * iterators.cs (PopulateProxy): Rename our internal fields to
12572 Create a <THIS> field if we are an instance method, so we can
12573 reference our parent container variables.
12574 (MapVariable): Called back from the EmitContext code to enter a
12575 new variable to field mapping into the proxy class (we just create
12579 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12580 for using the remapped locals to fields.
12582 I placed the code here, because that gives the same semantics to
12583 local variables, and only changes the Emit code.
12585 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12586 statements inside iterators.
12587 (VariableInfo): Add a FieldBuilder for the cases when we are
12588 remapping local variables to fields in a proxy class
12590 * ecore.cs (SimpleNameResolve): Avoid testing two times for
12591 current_block != null.
12593 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12594 not cope with strings, as it has been moved to the
12595 TableSwitchEmit. Fixed bug in switch generation.
12597 * expression.cs (New.DoResolve): Provide more context for the user
12598 when reporting an error.
12600 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12603 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12604 check the permissions for it. Note than in a type-resolution
12605 context the check was already present in DeclSpace.ResolveType,
12606 but was missing from the MemberAccess.
12608 (ArrayCreation.CheckIndices): warn if the user has
12609 more nested levels of expressions, but there are no more
12610 dimensions specified. Avoids crash on bug 41906.
12612 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12614 * statement.cs (Block): replace Implicit bool, for a generic
12616 New flag: `Unchecked'. This is used during the EmitMeta phase
12617 (which is out-of-line with the regular Resolve/Emit process for a
12618 statement, as this is done ahead of time, but still gets a chance
12619 to call constant resolve).
12621 (Block.Flags): new enum for adding a new flag.
12623 (Block.EmitMeta): track the state of unchecked.
12625 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12626 to enable constant resolution to work there as well.
12628 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12630 * typemanager.cs (ienumerable_type): Also look up
12631 System.Collections.IEnumerable.
12633 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12635 TODO: Test more than one conditional per method.
12637 * class.cs (Indexer.Define): Report the location where the user is
12638 referencing the unsupported feature.
12640 (MethodData): Overload the use of `conditionals' to
12641 minimize the creation of needless ArrayLists. This saves roughly
12642 212kb on my machine.
12644 (Method): Implement the new IIteratorContainer interface.
12645 (Method.SetYields): Implement the method by setting the ModFlags
12646 to contain METHOD_YIELDS.
12648 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12649 which just got set to null.
12651 * iterators.cs: New file.
12653 (Yield, YieldBreak): New statements.
12655 * statement.cs (Return.Resolve): Flag an error if we are used in
12656 an iterator method.
12658 * codegen.cs (InIterator): New flag set if the code is being
12659 compiled in an iterator method.
12661 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12662 internal modifier, and we just use it to avoid adding extra
12663 fields, as this is seldom used.
12665 * cs-parser.jay: Add yield_statement (yield and yield break).
12667 * driver.cs: New flag -v2 to turn on version 2 features.
12669 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12670 hashtable when v2 is enabled.
12672 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12674 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12675 there is already a namespace defined with this name.
12677 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12678 people upgraded their corlibs.
12680 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12681 always use fully qualified types, no need to use the compiler
12684 (TypeManager.IsNamespace): Use binarysearch.
12686 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12687 AddDelegate): I did not quite use the new IsValid API properly: I
12688 have to pass the short-name and the fullname. I was passing only
12689 the basename instead of the fullname sometimes.
12691 (TypeContainer.DefineType): call NamespaceClash.
12693 * interface.cs (Interface.DefineType): use NamespaceClash before
12696 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12699 * enum.cs: (Enum.DefineType): use NamespaceClash before
12702 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12703 speed increase. First, use the negative_hits cache when we get a
12704 negative. Second, add the type with its full original name
12705 instead of the new . and + encoded name (reflection uses + to
12706 separate type from a nested type). Use LookupTypeReflection
12707 directly which bypasses the type->name hashtable (that we already
12708 know does not contain the type.
12710 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12711 location/container type.
12713 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12715 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12717 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12719 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12720 method is being referenced in the method group from a static
12721 context, and report error 120 if so.
12723 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12726 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12727 is created, we create the A namespace).
12729 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12732 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12734 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12735 invocation to ModuleBuilder.GetType with the same values will
12736 return a new type instance, so we need to cache its return
12739 * expression.cs (Binary.ResolveOperator): Only allow the compare
12740 operators on enums if they are of the same type.
12742 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12743 types of ValueType on their own case. Before we were giving them
12744 the same treatment as objects.
12746 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12747 fullname. Short name is used to compare against container name.
12748 Fullname is used to check against defined namespace names.
12750 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12751 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12753 (Method.CheckBase): Call parent.
12754 (MemberBase.CheckBase): Check for protected members on sealed
12756 (PropertyBase.CheckBase): Call parent.
12757 (Field.Define): Call parent.
12759 * report.cs: Negative error codes are now mapped to 8000 - code,
12760 so that the display is render more nicely.
12762 * typemanager.cs: Do not use try/catch, instead report a regular
12765 (GetPointerType, GetReferenceType): These methods provide
12766 mechanisms to obtain the T* and T& from a T. We had the code
12767 previously scattered around the code base, and it also used
12768 TypeManager.LookupType that would go through plenty of caches.
12769 This one goes directly to the type source.
12771 In some places we did the Type.GetType followed by
12772 ModuleBuilder.GetType, but not in others, so this unifies the
12773 processing as well.
12775 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12776 statements now that we have namespace information.
12778 * typemanager.cs (IsNamespace): New method, returns whether the
12779 string presented is a namespace or not.
12781 (ComputeNamespaces): New public entry point, computes the list of
12782 available namespaces, using the GetNamespaces API call in Mono, or
12783 the slower version in MS.NET.
12785 Now before we start the semantic analysis phase, we have a
12786 complete list of namespaces including everything that the user has
12789 Deleted old code to cache namespaces in .nsc files.
12791 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12793 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12794 class/struct location definition Location for the implicit
12795 constructor location.
12797 (Operator.Define): Use the location of the operator for the
12798 implicit Method definition.
12800 (Constructor.Emit): use the constructor location for the implicit
12801 base initializer constructor.
12803 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12804 and the Expression class now contains two new methods:
12806 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12807 isolate type lookup from the rest of the resolution process.
12809 Since we use Expressions to hold type definitions due to the way
12810 we parse the input we have historically overloaded Resolve to
12811 perform the Type lookups if a special flag is passed. Now this is
12812 eliminated and two methods take their place.
12814 The differences in the two methods between xStep and xTerminal is
12815 that xStep is involved in our current lookup system that uses
12816 SimpleNames to compose a name, while xTerminal is used just to
12817 catch the case where the simplename lookup failed.
12819 2003-04-16 Miguel de Icaza <miguel@ximian.com>
12821 * expression.cs (ResolveMemberAccess): Remove redundant code.
12822 TypeExpr expressions are always born fully resolved.
12824 * interface.cs (PopulateMethod): Do not lookup the types twice.
12825 We were doing it once during SemanticAnalysis and once during
12828 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12829 in local variable type definitions, were being returned as a
12830 SimpleName (we decomposed everything into a string), that is
12831 because primary_expression was being used instead of a type in the
12832 grammar (reduce/reduce conflicts).
12834 The part that was wrong is that we converted the expression into a
12835 string (an oversimplification in one hand, compounded with primary
12836 expressions doing string concatenation).
12842 Would return "A.B.C[]" as a SimpleName. This stopped things like
12843 using clauses from working on this particular context. And a type
12844 was being matched directly against "A.B.C[]".
12846 We now use the correct approach, and allow for ComposedCast to be
12847 part of the unary expression. So the "A.B.C []" become a composed
12848 cast of "A.B.C" (as a nested group of MemberAccess with a
12849 SimpleName at the end) plus the rank composition "[]".
12853 2003-04-10 Miguel de Icaza <miguel@ximian.com>
12855 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12856 for the access level checking.
12858 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
12859 `TypeContainer container', because I kept getting confused when I
12860 was debugging this code.
12862 * expression.cs (Indexers): Instead of tracking getters/setters,
12863 we now track them in parallel. We create one arraylist less, but
12864 most importantly it is possible now for the LValue code to find a
12865 matching get for a set.
12867 (IndexerAccess.DoResolveLValue): Update the code.
12868 GetIndexersForType has been modified already to extract all the
12869 indexers from a type. The code assumed it did not.
12871 Also make the code set the correct return type for the indexer.
12872 This was fixed a long time ago for properties, but was missing for
12873 indexers. It used to be void_type.
12875 (Binary.Emit): Test first for doubles instead of
12876 floats, as they are more common.
12878 (Binary.EmitBranchable): Use the .un version of the branch opcodes
12879 when dealing with floats and the <=, >= operators. This fixes bug
12882 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12883 to load the array value by emitting a load on the foreach variable
12884 type. This was incorrect.
12886 We now emit the code to load an element using the the array
12887 variable type, and then we emit the conversion operator.
12891 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
12893 * attribute.cs: Avoid allocation of ArrayLists in the common case.
12895 2003-04-09 Miguel de Icaza <miguel@ximian.com>
12897 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12898 test for protection before we test for signatures.
12900 (MethodSignature.ToString): implement.
12902 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12903 to the case where we reduced into a LongConstant.
12905 * decl.cs (CheckAccessLevel): If the type is an array, we can not
12906 depend on whether the information is acurrate, because the
12907 Microsoft runtime will always claim that the array type is public,
12908 regardless of the real state.
12910 If the type is a pointer, another problem happens: the type is
12911 reported as non-public in Microsoft.
12913 In both cases we have to call CheckAccessLevel recursively with
12914 the underlying type as the argument to be tested.
12916 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12918 * assign.cs (Assign.Emit): If we are dealing with a compound
12919 assignment expression, we should use the code path that stores the
12920 intermediate result in a temporary value. This fixes #40903.
12922 *expression.cs (Indirection.ToString): Provide ToString method for
12925 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12927 * class.cs: Null out fields holding references to Block objects so
12928 they can be garbage collected.
12930 * expression.cs (OverloadResolve): Remove unused local.
12932 2003-04-07 Martin Baulig <martin@ximian.com>
12934 * codegen.cs (EmitContext.CurrentFile): New public field.
12935 (EmitContext.Mark): Use the CurrentFile to check whether the
12936 location is in the correct file.
12937 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12939 2003-04-07 Martin Baulig <martin@ximian.com>
12941 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12943 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12944 location. [FIXME: The location argument which gets passed to this
12945 method is sometimes wrong!]
12947 2003-04-07 Nick Drochak <ndrochak@gol.com>
12949 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12951 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12953 * expression.cs (Indirection.EmitAssign): We were using the
12954 temporary, but returning immediately instead of continuing the
12957 2003-04-06 Martin Baulig <martin@ximian.com>
12959 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12960 if it's a nested child, but also deriving from the outer class.
12963 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12964 nested child, but also deriving from the outer class. See
12966 (FilterWithClosure): We may access private members of the outer
12967 class if we're a nested child and deriving from the outer class.
12968 (RealMemberLookup): Only set `closure_private_ok' if the
12969 `original_bf' contained BindingFlags.NonPublic.
12971 2003-04-05 Martin Baulig <martin@ximian.com>
12973 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
12974 probe if its a type parameter, and if so, flag an error.
12976 * decl.cs: Move here the SetParameterInfo code from class.cs.
12977 Handle IsGeneric here.
12979 Handle a variety of errors in the parameter info definition.
12981 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
12982 type parameters here.
12984 * cs-parser.jay (class_declaration): report errors for parameters
12987 2003-01-21 Miguel de Icaza <miguel@ximian.com>
12989 * generic.cs: New file, contains support code for generics.
12991 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
12992 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
12994 Update parser for the above removals.
12996 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
12997 now taken care of in the parser.
12999 2003-04-02 Miguel de Icaza <miguel@ximian.com>
13001 * class.cs (Event.Define): Do not allow abstract events to have
13004 2003-04-01 Miguel de Icaza <miguel@ximian.com>
13006 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13007 block in event declarations.
13009 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13010 value type, get its address.
13012 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13013 leaving a class on the stack instead of a boolean value (int
13014 0/1). Change the code so we compare against null, and then the
13015 result against zero.
13017 * class.cs (TypeContainer.GetClassBases): We were checking for the
13018 parent class being sealed too late.
13020 * expression.cs (Binary.Emit): For <= and >= when dealing with
13021 floating point values, use cgt.un and clt.un instead of cgt and
13024 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
13026 * statement.cs: Apply the same optimization as MS: skip the
13027 GetEnumerator returning an IEnumerator, and use the one returning a
13028 CharEnumerator instead. This allows us to avoid the try-finally block
13031 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
13033 * cs-parser.jay: Attributes cannot be applied to
13034 namespaces. Fixes #40473
13036 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13039 (Add*): check if the name is valid using the full name for constants,
13040 fields, properties and events.
13042 2003-03-28 Miguel de Icaza <miguel@ximian.com>
13044 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13045 char constants to be part of the enumeration.
13047 * expression.cs (Conditional.DoResolve): Add support for operator
13048 true. Implements the missing functionality from 14.12
13050 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13051 operator true/false as required by the spec.
13053 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13054 implicit conversion to boolean.
13056 * statement.cs (Statement.ResolveBoolean): A boolean expression is
13057 also one where the type implements `operator true'.
13059 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13060 get an expression that will invoke operator true based on an
13063 (GetConversionOperators): Removed the hack that called op_True
13066 (Expression.ResolveBoolean): Move this from Statement.
13068 2003-03-17 Miguel de Icaza <miguel@ximian.com>
13070 * ecore.cs (FieldExpr): do not allow initialization of initonly
13071 fields on derived classes
13073 2003-03-13 Martin Baulig <martin@ximian.com>
13075 * statement.cs (Block.Emit): Call ig.BeginScope() and
13076 ig.EndScope() when compiling with debugging info; call
13077 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13079 2003-03-08 Miguel de Icaza <miguel@ximian.com>
13081 * expression.cs (Indexers): Do not construct immediately, allow
13082 for new members to be appended as we go. Fixes 38143
13084 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13086 * expression.cs: save/restore context when resolving an unchecked
13089 2003-03-05 Miguel de Icaza <miguel@ximian.com>
13091 * cfold.cs: Catch division by zero in modulus operator during
13094 2003-03-03 Miguel de Icaza <miguel@ximian.com>
13096 * interface.cs (Interface.DefineMembers): Avoid defining members
13099 2003-02-27 Miguel de Icaza <miguel@ximian.com>
13101 * driver.cs: handle the +/- options for -noconfig
13103 * statement.cs (Unckeched.Resolve): Also track the state of
13104 unchecked in the Resolve phase.
13106 2003-02-27 Martin Baulig <martin@ximian.com>
13108 * ecore.cs (Expression.MemberLookup): Don't create a
13109 MethodGroupExpr for something which is not a method. Fixes #38291.
13111 2003-02-25 Miguel de Icaza <miguel@ximian.com>
13113 * class.cs (MemberBase.CheckParameters): Also check that the type
13114 is unmanaged if it is a pointer.
13116 * expression.cs (SizeOf.Resolve): Add location information.
13118 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13119 a managed type is declared.
13121 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13122 parameter modifiers as well. Fixes bug 38606
13124 * class.cs: Very sad. Am backing out the speed up changes
13125 introduced by the ArrayList -> Array in the TypeContainer, as they
13126 were not actually that much faster, and introduced a bug (no error
13127 reports on duplicated methods).
13129 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13130 source first, this will guarantee that we have a valid expression
13131 before calling in lower levels functions that will require a
13132 resolved object. Then use this original_source in the
13133 target.ResolveLValue instead of the original source that was
13136 Another change. Use target.Resolve instead of LValueResolve.
13137 Although we are resolving for LValues, we will let the Assign code
13138 take care of that (it will be called again from Resolve). This
13139 basically allows code like this:
13141 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13142 class Y { void A (X x) { x [0] += o; }
13144 The problem was that the indexer was trying to resolve for
13145 set_Item (idx, object o) and never finding one. The real set_Item
13146 was set_Item (idx, X). By delaying the process we get the right
13151 2003-02-23 Martin Baulig <martin@ximian.com>
13153 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13154 while calling DoEmit ().
13156 * codegen.cs (EmitContext.Mark): Don't mark locations in other
13157 source files; if you use the #line directive inside a method, the
13158 compiler stops emitting line numbers for the debugger until it
13159 reaches the end of the method or another #line directive which
13160 restores the original file.
13162 2003-02-23 Martin Baulig <martin@ximian.com>
13164 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13166 2003-02-23 Martin Baulig <martin@ximian.com>
13168 * statement.cs (Block.AddChildVariableNames): We need to call this
13169 recursively, not just for our immediate children.
13171 2003-02-23 Martin Baulig <martin@ximian.com>
13173 * class.cs (Event.Define): Always make the field private, like csc does.
13175 * typemanager.cs (TypeManager.RealMemberLookup): Make events
13176 actually work, fixes bug #37521.
13178 2003-02-23 Miguel de Icaza <miguel@ximian.com>
13180 * delegate.cs: When creating the various temporary "Parameters"
13181 classes, make sure that we call the ComputeAndDefineParameterTypes
13182 on those new parameters (just like we do with the formal ones), to
13183 allow them to be resolved in the context of the DeclSpace.
13185 This fixes the bug that Dick observed in Bugzilla #38530.
13187 2003-02-22 Miguel de Icaza <miguel@ximian.com>
13189 * expression.cs (ResolveMemberAccess): When resolving a constant,
13190 do not attempt to pull a constant if the value was not able to
13191 generate a valid constant.
13193 * const.cs (LookupConstantValue): Do not report more errors than required.
13195 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13197 * expression.cs: fixes bug #38328.
13199 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13201 * class.cs: Changed all the various members that can be part of a
13202 class from being an ArrayList to be an Array of the right type.
13203 During the DefineType type_list, interface_list, delegate_list and
13204 enum_list are turned into types, interfaces, delegates and enums
13207 And during the member population, indexer_list, event_list,
13208 constant_list, field_list, instance_constructor_list, method_list,
13209 operator_list and property_list are turned into their real arrays.
13211 Although we could probably perform this operation earlier, for
13212 good error reporting we need to keep the lists and remove the
13213 lists for longer than required.
13215 This optimization was triggered by Paolo profiling the compiler
13216 speed on the output of `gen-sample-program.pl' perl script.
13218 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13219 not crash in methods like MemberLookupFailed that use this field.
13221 This problem arises when the compiler fails to resolve a type
13222 during interface type definition for example.
13224 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13226 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13227 inherit from System.Object, so we have to stop at null, not only
13228 when reaching System.Object.
13230 2003-02-17 Miguel de Icaza <miguel@ximian.com>
13232 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13233 DeclaredOnly because the parent indexer might have had a different
13234 name, but did not loop until the top of the hierarchy was reached.
13236 The problem this one fixes is 35492: when a class implemented an
13237 indexer from an interface, we were getting the interface method
13238 (which was abstract) and we were flagging an error (can not invoke
13241 This also keeps bug 33089 functioning, and test-148 functioning.
13243 * typemanager.cs (IsSpecialMethod): The correct way of figuring
13244 out if a method is special is to see if it is declared in a
13245 property or event, or whether it is one of the predefined operator
13246 names. This should fix correctly #36804.
13248 2003-02-15 Miguel de Icaza <miguel@ximian.com>
13250 The goal here is to remove the dependency on EmptyCast.Peel ().
13251 Killing it completely.
13253 The problem is that currently in a number of places where
13254 constants are expected, we have to "probe" for an EmptyCast, and
13255 Peel, which is not the correct thing to do, as this will be
13256 repetitive and will likely lead to errors.
13258 The idea is to remove any EmptyCasts that are used in casts that
13259 can be reduced to constants, so we only have to cope with
13262 This bug hunt was triggered by Bug 37363 and the desire to remove
13263 the duplicate pattern where we were "peeling" emptycasts to check
13264 whether they were constants. Now constants will always be
13267 * ecore.cs: Use an enumconstant here instead of wrapping with
13270 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13271 throwing me off. By handling this we can get rid of a few hacks.
13273 * statement.cs (Switch): Removed Peel() code.
13275 2003-02-14 Miguel de Icaza <miguel@ximian.com>
13277 * class.cs: Location information for error 508
13279 * expression.cs (New.DoResolve): Add a guard against double
13280 resolution of an expression.
13282 The New DoResolve might be called twice when initializing field
13283 expressions (see EmitFieldInitializers, the call to
13284 GetInitializerExpression will perform a resolve on the expression,
13285 and later the assign will trigger another resolution
13287 This leads to bugs (#37014)
13289 * delegate.cs: The signature for EndInvoke should contain any ref
13290 or out parameters as well. We were not doing this in the past.
13292 * class.cs (Field.Define): Do not overwrite the type definition
13293 inside the `volatile' group. Turns out that volatile enumerations
13294 were changing the type here to perform a validity test, which
13297 2003-02-12 Miguel de Icaza <miguel@ximian.com>
13299 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13300 and structs, we do not want to load the instance variable
13302 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13303 enum_type has to be handled like an object reference (implicit
13304 conversions exists from this to object), but the regular IsClass
13305 and IsValueType tests will never return true for this one.
13307 Also we use TypeManager.IsValueType instead of type.IsValueType,
13308 just for consistency with the rest of the code (this is only
13309 needed if we ever use the construct exposed by test-180.cs inside
13310 corlib, which we dont today).
13312 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
13314 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13317 2003-02-09 Martin Baulig <martin@ximian.com>
13319 * namespace.cs (Namespace..ctor): Added SourceFile argument.
13320 (Namespace.DefineNamespaces): New static public method; this is
13321 called when we're compiling with debugging to add all namespaces
13322 to the symbol file.
13324 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13325 pass it to the Namespace's .ctor.
13327 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13328 and MethodBase arguments; pass the namespace ID to the symwriter;
13329 pass the MethodBase instead of the token to the symwriter.
13330 (SymbolWriter.DefineNamespace): New method to add a namespace to
13333 2003-02-09 Martin Baulig <martin@ximian.com>
13335 * symbolwriter.cs: New file. This is a wrapper around
13336 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
13337 methods here in near future.
13339 2003-02-09 Martin Baulig <martin@ximian.com>
13341 * codegen.cs (EmitContext.Mark): Just pass the arguments to
13342 ILGenerator.MarkSequencePoint() which are actually used by the
13345 2003-02-09 Martin Baulig <martin@ximian.com>
13347 * location.cs (SourceFile): New public sealed class. This
13348 contains the name and an index which is used in the location's token.
13349 (Location): Reserve an appropriate number of bits in the token for
13350 the source file instead of walking over that list, this gives us a
13351 really huge performance improvement when compiling with debugging.
13353 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13354 `SourceFile' argument instead of a string.
13355 (Driver.ProcessFile): Add all the files via Location.AddFile(),
13356 but don't parse/tokenize here, we need to generate the list of all
13357 source files before we do that.
13358 (Driver.ProcessFiles): New static function. Parses/tokenizes all
13361 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13362 instead of a string.
13364 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13367 2003-02-09 Martin Baulig <martin@ximian.com>
13369 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13370 filename on `#line default'.
13372 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13374 * statement.cs: don't clear the pinned var when the fixed statement
13375 returns from the method (fixes bug#37752).
13377 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13379 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
13382 2003-02-07 Martin Baulig <martin@ximian.com>
13384 * driver.cs: Removed the `--debug-args' command line argument.
13386 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13387 automatically by the AsssemblyBuilder.
13388 (CodeGen.InitializeSymbolWriter): We don't need to call any
13389 initialization function on the symbol writer anymore. This method
13390 doesn't take any arguments.
13392 2003-02-03 Miguel de Icaza <miguel@ximian.com>
13394 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13395 from referenced assemblies as well.
13397 2003-02-02 Martin Baulig <martin@ximian.com>
13399 * class.cs (MethodData.Emit): Generate debugging info for external methods.
13401 2003-02-02 Martin Baulig <martin@ximian.com>
13403 * class.cs (Constructor.Emit): Open the symbol writer before
13404 emitting the constructor initializer.
13405 (ConstructorInitializer.Emit): Call ec.Mark() to allow
13406 single-stepping through constructor initializers.
13408 2003-01-30 Miguel de Icaza <miguel@ximian.com>
13410 * class.cs: Handle error 549: do not allow virtual methods in
13413 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13415 * decl.cs: Check access levels when resolving types
13417 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13419 * statement.cs: Add parameters and locals set in catch blocks that might
13420 return to set vector
13422 2003-01-29 Miguel de Icaza <miguel@ximian.com>
13424 * class.cs (Operator): Set the SpecialName flags for operators.
13426 * expression.cs (Invocation.DoResolve): Only block calls to
13427 accessors and operators on SpecialName methods.
13429 (Cast.TryReduce): Handle conversions from char constants.
13432 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13434 * statement.cs: small memory and time optimization in FlowBranching.
13436 2003-01-28 Pedro Mart <yoros@wanadoo.es>
13438 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13439 problem that the last fix but in the other sid (Set).
13441 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13442 access when there is no indexer in the hierarchy.
13444 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13446 * class.cs: Combine some if statements.
13448 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13450 * driver.cs: fixed bug #37187.
13452 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
13454 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13455 any indexer, it's needed to build a list with all the indexers in the
13456 hierarchy (AllGetters), else we have problems. Fixes #35653.
13458 2003-01-23 Miguel de Icaza <miguel@ximian.com>
13460 * class.cs (MethodData.Define): It is wrong for an interface
13461 implementation to be static in both cases: explicit and implicit.
13462 We were only handling this in one case.
13464 Improve the if situation there to not have negations.
13466 * class.cs (Field.Define): Turns out that we do not need to check
13467 the unsafe bit on field definition, only on usage. Remove the test.
13469 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13471 * driver.cs: use assembly.Location instead of Codebase (the latest
13472 patch made mcs fail when using MS assemblies).
13474 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
13476 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13477 get the path to *corlib.dll.
13479 2003-01-21 Nick Drochak <ndrochak@gol.com>
13483 * typemanager.cs: Remove compiler warnings
13485 2003-01-20 Duncan Mak <duncan@ximian.com>
13487 * AssemblyInfo.cs: Bump the version number to 0.19.
13489 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13491 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13493 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
13495 * class.cs (Constructor::Emit): Emit debugging info for constructors.
13497 2003-01-17 Miguel de Icaza <miguel@ximian.com>
13499 * cs-parser.jay: Small fix: we were not comparing the constructor
13500 name correctly. Thanks to Zoltan for the initial pointer.
13502 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13504 * cs-tokenizer.cs: Set file name when specified with #line
13506 2003-01-15 Miguel de Icaza <miguel@ximian.com>
13508 * cs-parser.jay: Only perform the constructor checks here if we
13509 are named like the class; This will help provider a better
13510 error. The constructor path is taken when a type definition is
13511 not found, but most likely the user forgot to add the type, so
13512 report that rather than the constructor error.
13514 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13516 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13519 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13521 * cs-parser.jay: Add cleanup call.
13523 2003-01-13 Duncan Mak <duncan@ximian.com>
13525 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13526 consistent with other methods.
13528 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13530 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13532 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13534 * attribute.cs: only set GuidAttr to true when we have a
13537 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13541 * typemanager.cs: fixes to allow mcs compile corlib with the new
13542 Type.IsSubclassOf fix.
13544 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13546 * expression.cs (LocalVariableReference.DoResolve): Classify a
13547 constant as a value, not as a variable. Also, set the type for
13550 * cs-parser.jay (fixed_statement): take a type instead of a
13551 pointer_type, so we can produce a better error message later.
13553 * statement.cs (Fixed.Resolve): Flag types that are not pointers
13556 (For.DoEmit): Make inifinite loops have a
13557 non-conditional branch back.
13559 (Fixed.DoEmit): First populate the pinned variables, then emit the
13560 statement, then clear the variables. Before I was emitting the
13561 code once for each fixed piece.
13564 2003-01-08 Martin Baulig <martin@ximian.com>
13566 * statement.cs (FlowBranching.MergeChild): A break in a
13567 SWITCH_SECTION does not leave a loop. Fixes #36155.
13569 2003-01-08 Martin Baulig <martin@ximian.com>
13571 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13572 lives in the same number space than `param_map'. Fixes #36154.
13574 2003-01-07 Miguel de Icaza <miguel@ximian.com>
13576 * cs-parser.jay (constructor_declaration): Set the
13577 Constructor.ModFlags before probing for it. This makes the
13578 compiler report 514, 515 and 132 (the code was there, but got
13581 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13582 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13583 (GotoCase.Resolve): Set `Returns' to ALWAYS.
13585 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13587 * enum.cs: create the enum static fields using the enum type.
13589 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13591 * class.cs: don't try to create the ParamBuilder for the return
13592 type if it's not needed (and handle it breaking for the ms runtime
13595 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13597 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13599 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13601 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13602 the command. This showed up while compiling the JANET source
13603 code, which used \r as its only newline separator.
13605 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13607 * class.cs (Method.Define): If we are an operator (because it
13608 reuses our code), then set the SpecialName and HideBySig. #36128
13610 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13612 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13613 exception, report error 120 `object reference required'.
13615 * driver.cs: Add --pause option, used during to measure the size
13616 of the process as it goes with --timestamp.
13618 * expression.cs (Invocation.DoResolve): Do not allow methods with
13619 SpecialName to be invoked.
13621 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13623 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13624 number before adding it.
13626 2002-12-21 Ravi Pratap <ravi@ximian.com>
13628 * ecore.cs (StandardImplicitConversion): When in an unsafe
13629 context, we allow conversion between void * to any other pointer
13630 type. This fixes bug #35973.
13632 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13634 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13635 is not thrown when extensionless outputs are used
13637 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13639 * rootcontext.cs: fixed compilation of corlib.
13641 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13643 * attribute.cs (Attributes.Contains): Add new method.
13645 * class.cs (MethodCore.LabelParameters): if the parameter is an
13646 `out' parameter, check that no attribute `[In]' has been passed.
13648 * enum.cs: Handle the `value__' name in an enumeration.
13650 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13652 * decl.cs: Added special case to allow overrides on "protected
13655 2002-12-18 Ravi Pratap <ravi@ximian.com>
13657 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13658 since it makes much more sense.
13660 (Attributes.ctor): Don't require a Location parameter.
13662 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13664 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13665 since we already have that information per attribute.
13667 * everywhere : make appropriate changes.
13669 * class.cs (LabelParameters): Write the code which actually
13670 applies attributes to the return type. We can't do this on the MS
13671 .NET runtime so we flag a warning in the case an exception is
13674 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13676 * const.cs: Handle implicit null conversions here too.
13678 2002-12-17 Ravi Pratap <ravi@ximian.com>
13680 * class.cs (MethodCore.LabelParameters): Remove the extra
13681 Type [] parameter since it is completely unnecessary. Instead
13682 pass in the method's attributes so that we can extract
13683 the "return" attribute.
13685 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13687 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13688 of ignoring it and letting the compile continue.
13690 * typemanager.cs (ChangeType): use an extra argument to return an
13691 error condition instead of throwing an exception.
13693 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13695 * expression.cs (Unary.TryReduce): mimic the code for the regular
13696 code path. Perform an implicit cast in the cases where we can
13697 implicitly convert to one of the integral types, and then reduce
13698 based on that constant. This fixes bug #35483.
13700 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13702 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13704 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13706 * namespace.cs: fixed bug #35489.
13708 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13710 * class.cs: Remove some dead code.
13712 * cs-parser.jay: Estimate the number of methods needed
13713 (RootContext.MethodCount);
13715 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13716 numbers instead of StringBuilders.
13718 * support.cs (PtrHashtable): Add constructor with initial size;
13719 We can now reduce reallocations of the method table.
13721 2002-12-10 Ravi Pratap <ravi@ximian.com>
13723 * attribute.cs (ApplyAttributes): Keep track of the emitted
13724 attributes on a per-target basis. This fixes bug #35413.
13726 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13728 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13729 default to the Windows 1252 encoding.
13731 (UnixParseOption): Support version, thanks to Alp for the missing
13734 * AssemblyInfo.cs: Add nice assembly information.
13736 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13739 * cs-parser.jay: Allow a trailing comma before the close bracked
13740 in the attribute_section production.
13742 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13743 address of the instance was being taken, I will take this out,
13744 because we take the address of the object immediately here.
13746 2002-12-09 Ravi Pratap <ravi@ximian.com>
13748 * typemanager.cs (AreMultipleAllowed): Take care of the most
13749 obvious case where attribute type is not in the current assembly -
13752 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13754 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13755 definitions, instead of doing that afterwards.
13757 Also we use a nice little hack, depending on the constructor, we
13758 know if we are a "composed" name or a simple name. Hence, we
13759 avoid the IndexOf test, and we avoid
13761 * codegen.cs: Add code to assist in a bug reporter to track down
13762 the source of a compiler crash.
13764 2002-12-07 Ravi Pratap <ravi@ximian.com>
13766 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13767 types have been emitted for a given element and flag an error
13768 if something which does not have AllowMultiple set is used more
13771 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13772 attribute types and their corresponding AllowMultiple properties
13774 (AreMultipleAllowed): Check the property for a given type.
13776 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13777 property in the case we have a TypeContainer.
13779 (Attributes.AddAttribute): Detect duplicates and just skip on
13780 adding them. This trivial fix catches a pretty gross error in our
13781 attribute emission - global attributes were being emitted twice!
13783 Bugzilla bug #33187 is now fixed.
13785 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13787 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13788 instead of pp_and).
13790 * expression.cs (Binary.ResolveOperator): I can only use the
13791 Concat (string, string, string) and Concat (string, string,
13792 string, string) if the child is actually a concatenation of
13795 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13797 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13798 context where we need a 2-character lookahead.
13800 * pending.cs (PendingImplementation): Rework so we can keep track
13801 of interface types all the time, and flag those which were
13802 implemented by parents as optional.
13804 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13806 * expression.cs (Binary.ResolveOperator): Use
13807 String.Concat(string,string,string) or
13808 String.Concat(string,string,string,string) when possible.
13810 * typemanager: More helper methods.
13813 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13815 * pending.cs: remove the bogus return from GetMissingInterfaces()
13816 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13818 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13820 * namespace.cs: avoid duplicated 'using xxx' being added to
13821 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13822 when we get more than one 'using' statement for the same namespace.
13823 Report a CS0105 warning for it.
13825 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13827 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13828 of calling getChar/putback, uses internal knowledge of it.
13830 (xtoken): Reorder tokenizer so most common patterns are checked
13831 first. This reduces the compilation time in another 5% (from 8.11s
13832 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13834 The parsing time is 22% of the compilation in mcs, and from that
13835 64% is spent on the tokenization process.
13837 I tried using a binary search for keywords, but this is slower
13838 than the hashtable. Another option would be to do a couple of
13841 * Not use a StringBuilder, instead use an array of chars,
13842 with a set value. Notice that this way we could catch
13843 the 645 error without having to do it *afterwards*.
13845 * We could write a hand-parser to avoid the hashtable
13846 compares altogether.
13848 The identifier consumption process takes 37% of the tokenization
13849 time. Another 15% is spent on is_number. 56% of the time spent
13850 on is_number is spent on Int64.Parse:
13852 * We could probably choose based on the string length to
13853 use Int32.Parse or Int64.Parse and avoid all the 64-bit
13856 Another 3% is spend on wrapping `xtoken' in the `token' function.
13858 Handle 0xa0 as whitespace (#34752)
13860 2002-11-26 Miguel de Icaza <miguel@ximian.com>
13862 * typemanager.cs (IsCLRType): New routine to tell whether a type
13863 is one of the builtin types.
13865 Maybe it needs to use TypeCodes to be faster. Maybe we could use
13866 typecode in more places instead of doing pointer comparissions.
13867 We could leverage some knowledge about the way the typecodes are
13870 New code to cache namespaces in assemblies, it is currently not
13871 invoked, to be used soon.
13873 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13875 * expression.cs (Binary.ResolveOperator): specially handle
13876 strings, and do not perform user-defined operator overloading for
13879 2002-11-24 Miguel de Icaza <miguel@ximian.com>
13881 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13882 internalcall as it is a pretty simple operation; Avoid whenever
13883 possible to call Char.IsLetter.
13885 (consume_identifier): Cut by half the number of
13886 hashtable calls by merging the is_keyword and GetKeyword behavior.
13888 Do not short-circuit, because if we do, we
13889 report errors (ie, #if false && true would produce an invalid
13893 2002-11-24 Martin Baulig <martin@ximian.com>
13895 * expression.cs (Cast.TryReduce): If we're in checked syntax,
13896 check constant ranges and report a CS0221. Fixes #33186.
13898 2002-11-24 Martin Baulig <martin@ximian.com>
13900 * cs-parser.jay: Make this work for uninitialized variable
13901 declarations in the `for' initializer. Fixes #32416.
13903 2002-11-24 Martin Baulig <martin@ximian.com>
13905 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13906 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
13908 2002-11-24 Martin Baulig <martin@ximian.com>
13910 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13911 argument; if true, we also check for user-defined conversions.
13912 This is only needed if both arguments are of a user-defined type.
13913 Fixes #30443, added test-175.cs.
13914 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13916 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13918 2002-11-24 Martin Baulig <martin@ximian.com>
13920 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13921 function to get the store opcode.
13922 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13923 only emit the Ldelema if the store opcode is Stobj. You must run
13924 both test-34 and test-167 to test this. Fixes #34529.
13926 2002-11-23 Martin Baulig <martin@ximian.com>
13928 * ecore.cs (Expression.MemberLookup): Added additional
13929 `qualifier_type' argument which is used when we're being called
13930 from MemberAccess.DoResolve() and null if we're called from a
13932 (Expression.MemberLookupFailed): New method to report errors; this
13933 does the CS1540 check and reports the correct error message.
13935 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13936 argument for the CS1540 check and redone the way how we're dealing
13937 with private members. See the comment in the source code for details.
13938 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13939 `closure_start_type' to `closure_qualifier_type' and check whether
13940 it's not null. It was not this filter being broken, it was just
13941 being called with the wrong arguments.
13943 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13944 and pass it the correct `qualifier_type'; this also does the error
13947 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13949 * expression.cs (Invocation.EmitParams): If the we are dealing
13950 with a non-built-in value type, load its address as well.
13952 (ArrayCreation): Use a a pretty constant instead
13953 of the hardcoded value 2. Use 6 instead of 2 for the number of
13954 static initializers.
13956 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13957 because they are not really value types, just glorified integers.
13959 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13961 * ecore.cs: Remove redundant code for enumerations, make them use
13962 the same code path as everything else, fixes the casting issue
13963 with enumerations in Windows.Forms.
13965 * attribute.cs: Do only cast to string if it is a string, the
13966 validation happens later.
13968 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13969 people upgrade their corlibs.
13971 * ecore.cs: Oops, enumerations were not following the entire code path
13973 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13975 * typemanager.cs (FilterWithClosure): Commented out the test for
13976 1540 in typemanager.cs, as it has problems when accessing
13977 protected methods from a parent class (see test-174.cs).
13979 * attribute.cs (Attribute.ValidateGuid): new method.
13980 (Attribute.Resolve): Use above.
13982 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13984 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13986 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13987 handling for enumerations, as we only needed the TypeContainer
13988 functionality to begin with (this is required for the fix below to
13989 work for enums that reference constants in a container class for
13992 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13994 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13995 a valid TypeBuilder to perform lookups on.o
13997 * class.cs (InheritableMemberSignatureCompare): Use true in the
13998 call to GetGetMethod and GetSetMethod, because we are comparing
13999 the signature, and we need to get the methods *even* if they are
14002 (PropertyBase.CheckBase): ditto.
14004 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14005 GotoCase.Resolve): Use Peel on EmpytCasts.
14007 * ecore.cs (EmptyCast): drop child, add Peel method.
14009 2002-11-17 Martin Baulig <martin@ximian.com>
14011 * ecore.cs (EmptyCast.Child): New public property.
14013 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14014 label resolved to an EmptyCast. Fixes #34162.
14015 (GotoCase.Resolve): Likewise.
14016 (Block.EmitMeta): Likewise.
14018 2002-11-17 Martin Baulig <martin@ximian.com>
14020 * expression.cs (Invocation.BetterConversion): Prefer int over
14021 uint; short over ushort; long over ulong for integer literals.
14022 Use ImplicitConversionExists instead of StandardConversionExists
14023 since we also need to check for user-defined implicit conversions.
14024 Fixes #34165. Added test-173.cs.
14026 2002-11-16 Martin Baulig <martin@ximian.com>
14028 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14029 with the `true' and `false' literals. Fixes #33151.
14031 2002-11-16 Martin Baulig <martin@ximian.com>
14033 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14034 October 22nd; don't do the cs1540 check for static members.
14036 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14037 now using our own filter here and doing the cs1540 check again.
14039 2002-11-16 Martin Baulig <martin@ximian.com>
14041 * support.cs (InternalParameters): Don't crash if we don't have
14042 any fixed parameters. Fixes #33532.
14044 2002-11-16 Martin Baulig <martin@ximian.com>
14046 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14047 when looking up static methods to make this work on Windows.
14050 2002-11-16 Martin Baulig <martin@ximian.com>
14052 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14053 a setter rather than using PropertyInfo.CanWrite.
14055 2002-11-15 Nick Drochak <ndrochak@gol.com>
14057 * class.cs: Allow acces to block member by subclasses. Fixes build
14060 2002-11-14 Martin Baulig <martin@ximian.com>
14062 * class.cs (Constructor.Emit): Added the extern/block check.
14065 2002-11-14 Martin Baulig <martin@ximian.com>
14067 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14068 iteration while looking for indexers, this is needed because the
14069 indexer may have a different name in our base classes. Fixed the
14070 error reporting (no indexers at all, not get accessor, no
14071 overloaded match). Fixes bug #33089.
14072 (IndexerAccess.DoResolveLValue): Likewise.
14074 2002-11-14 Martin Baulig <martin@ximian.com>
14076 * class.cs (PropertyBase.CheckBase): Make this work for multiple
14077 indexers. Fixes the first part of bug #33089.
14078 (MethodSignature.InheritableMemberSignatureCompare): Added support
14081 2002-11-13 Ravi Pratap <ravi@ximian.com>
14083 * attribute.cs (Attribute.Resolve): Catch the
14084 NullReferenceException and report it since it isn't supposed to
14087 2002-11-12 Miguel de Icaza <miguel@ximian.com>
14089 * expression.cs (Binary.EmitBranchable): Also handle the cases for
14090 LogicalOr and LogicalAnd that can benefit from recursively
14091 handling EmitBranchable. The code now should be nice for Paolo.
14093 2002-11-08 Miguel de Icaza <miguel@ximian.com>
14095 * typemanager.cs (LookupType): Added a negative-hit hashtable for
14096 the Type lookups, as we perform quite a number of lookups on
14097 non-Types. This can be removed once we can deterministically tell
14098 whether we have a type or a namespace in advance.
14100 But this might require special hacks from our corlib.
14104 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14105 and double which avoids a conversion from an integer to a double.
14107 * expression.cs: tiny optimization, avoid calling IsConstant,
14108 because it effectively performs the lookup twice.
14110 2002-11-06 Miguel de Icaza <miguel@ximian.com>
14112 But a bogus return here to keep the semantics of the old code
14113 until the Mono runtime is fixed.
14115 * pending.cs (GetMissingInterfaces): New method used to remove all
14116 the interfaces that are already implemented by our parent
14117 classes from the list of pending methods.
14119 * interface.cs: Add checks for calls after ResolveTypeExpr.
14121 2002-11-05 Miguel de Icaza <miguel@ximian.com>
14123 * class.cs (Class.Emit): Report warning 67: event not used if the
14124 warning level is beyond 3.
14126 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14127 being a NullLiteral.
14129 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14132 * class.cs (TypeContainer.GetClassBases): Cover a missing code
14133 path that might fail if a type can not be resolved.
14135 * expression.cs (Binary.Emit): Emit unsigned versions of the
14138 * driver.cs: use error 5.
14140 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14142 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14144 2002-11-01 Miguel de Icaza <miguel@ximian.com>
14146 * cs-parser.jay (switch_section): A beautiful patch from Martin
14147 Baulig that fixed 33094.
14149 2002-10-31 Miguel de Icaza <miguel@ximian.com>
14151 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14152 Check whether the base is abstract and report an error if so.
14154 * expression.cs (IndexerAccess.DoResolveLValue,
14155 IndexerAccess.DoResolve): ditto.
14157 (Invocation.DoResolve): ditto.
14159 (Invocation.FullMethodDesc): Improve the report string.
14161 * statement.cs (Block): Eliminate IsVariableDefined as it is
14162 basically just a wrapper for GetVariableInfo.
14164 * ecore.cs (SimpleName): Use new
14166 * support.cs (ReflectionParamter.ParameterType): We unwrap the
14167 type, as we return the actual parameter ref/unref state on a
14170 2002-10-30 Miguel de Icaza <miguel@ximian.com>
14172 * support.cs: Return proper flags REF/OUT fixing the previous
14175 * expression.cs: Reverted last patch, that was wrong. Is_ref is
14176 not used to mean `ref' but `ref or out' in ParameterReference
14178 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14179 full type signature instead of calling TypeManger.CSharpName
14182 * support.cs (InternalParameters.ParameterDesc): Do not compare
14183 directly to the modflags, because REF/OUT will actually be bitsets
14186 * delegate.cs (VerifyMethod): Check also the modifiers.
14188 * cs-tokenizer.cs: Fix bug where floating point values with an
14189 exponent where a sign was missing was ignored.
14191 * driver.cs: Allow multiple assemblies to be specified in a single
14194 2002-10-28 Miguel de Icaza <miguel@ximian.com>
14196 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
14197 because identifiers after a parenthesis would end up in this kind
14198 of production, and we needed to desamiguate it for having casts
14201 (UserDefinedType *) xxx
14203 2002-10-24 Miguel de Icaza <miguel@ximian.com>
14205 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14206 we should set on the Bindingflags.NonPublic, but not turn on
14207 private_ok. private_ok controls whether a Private member is
14208 returned (this is chekced on the filter routine), while the
14209 BindingFlags.NonPublic just controls whether private/protected
14210 will be allowed. This fixes the problem part of the problem of
14211 private properties being allowed to be used in derived classes.
14213 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14214 so we can call the children DoResolveLValue method (this will
14215 properly signal errors on lvalue assignments to base properties)
14217 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14218 getter are null, and we have a property info, we know that this
14219 happened because the lookup failed, so we report an error 122 for
14220 protection level violation.
14222 We also silently return if setter and getter are null in the
14223 resolve functions, this condition only happens if we have flagged
14224 the error before. This is the other half of the problem.
14226 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14227 not have accessibility information, that is why we were returning
14228 true in the filter function in typemanager.cs.
14230 To properly report 122 (property is inaccessible because of its
14231 protection level) correctly, we report this error in ResolveAccess
14232 by failing if both the setter and the getter are lacking (ie, the
14235 DoResolve and DoLResolve have been modified to check for both
14236 setter/getter being null and returning silently, the reason being
14237 that I did not want to put the knowledge about this error in upper
14240 int old = Report.Errors;
14241 x = new PropertyExpr (...);
14242 if (old != Report.Errors)
14247 So the property expr is returned, but it is invalid, so the error
14248 will be flagged during the resolve process.
14250 * class.cs: Remove InheritablePropertySignatureCompare from the
14251 class, as we no longer depend on the property signature to compute
14252 whether it is possible to implement a method or not.
14254 The reason is that calling PropertyInfo.GetGetMethod will return
14255 null (in .NET, in Mono it works, and we should change this), in
14256 cases where the Get Method does not exist in that particular
14261 class X { public virtual int A { get { return 1; } } }
14263 class Z : Y { public override int A { get { return 2; } } }
14265 Would fail in Z because the parent (Y) would not have the property
14266 defined. So we avoid this completely now (because the alternative
14267 fix was ugly and slow), and we now depend exclusively on the
14270 (PropertyBase.CheckBase): Use a method-base mechanism to find our
14271 reference method, instead of using the property.
14273 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14274 routines are gone now.
14276 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14277 names, they were incorrectly named.
14279 * cs-tokenizer.cs: Return are more gentle token on failure.
14281 * pending.cs (PendingImplementation.InterfaceMethod): This routine
14282 had an out-of-sync index variable, which caused it to remove from
14283 the list of pending methods the wrong method sometimes.
14285 2002-10-22 Miguel de Icaza <miguel@ximian.com>
14287 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14288 CanWrite, because those refer to this particular instance of the
14289 property, and do not take into account the fact that we can
14290 override single members of a property.
14292 Constructor requires an EmitContext. The resolution process does
14293 not happen here, but we need to compute the accessors before,
14294 because the resolution does not always happen for properties.
14296 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14297 subclass, before we did not update this flag, but we did update
14300 (GetAccessors): Drop this routine, as it did not work in the
14301 presence of partially overwritten set/get methods.
14303 Notice that this broke the cs1540 detection, but that will require
14306 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14310 * driver.cs: issue a warning instead of an error if we don't support
14311 debugging for the platform. Also ignore a couple of errors that may
14312 arise when trying to write the symbols. Undo my previous patch.
14314 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14316 * driver.cs: ignore /debug switch except for Unix platforms.
14318 2002-10-23 Nick Drochak <ndrochak@gol.com>
14320 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14322 2002-10-21 Miguel de Icaza <miguel@ximian.com>
14324 * driver.cs: Do not make mcs-debug conditional, so we do not break
14325 builds that use it.
14327 * statement.cs (UsageVector.MergeChildren): I would like Martin to
14328 review this patch. But basically after all the children variables
14329 have been merged, the value of "Breaks" was not being set to
14330 new_breaks for Switch blocks. I think that it should be set after
14331 it has executed. Currently I set this to the value of new_breaks,
14332 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14333 conservative, but I do not understand this code very well.
14335 I did not break anything in the build, so that is good ;-)
14337 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14339 2002-10-20 Mark Crichton <crichton@gimp.org>
14341 * cfold.cs: Fixed compile blocker. Really fixed it this time.
14343 2002-10-20 Nick Drochak <ndrochak@gol.com>
14345 * cfold.cs: Fixed compile blocker.
14347 2002-10-20 Miguel de Icaza <miguel@ximian.com>
14349 * driver.cs: I was chekcing the key, not the file.
14351 2002-10-19 Ravi Pratap <ravi@ximian.com>
14353 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14354 message that we were generating - we just need to silently return
14357 2002-10-19 Miguel de Icaza <miguel@ximian.com>
14359 * class.cs (Event.Define): Change my previous commit, as this
14360 breaks the debugger. This is a temporary hack, as it seems like
14361 the compiler is generating events incorrectly to begin with.
14363 * expression.cs (Binary.ResolveOperator): Added support for
14364 "U operator - (E x, E y)"
14366 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14369 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14370 init-only variables, but this path did not take into account that
14371 there might be also instance readonly variables. Correct this
14374 This fixes bug 32253
14376 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14379 * driver.cs: Change the extension for modules to `netmodule'
14381 * cs-parser.jay: Improved slightly the location tracking for
14382 the debugger symbols.
14384 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14385 modifiers that were specified instead of the hardcoded value
14386 (FamAndAssem). This was basically ignoring the static modifier,
14387 and others. Fixes 32429.
14389 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14390 fixed a bug in the process (32476)
14392 * expression.cs (ArrayAccess.EmitAssign): Patch from
14393 hwang_rob@yahoo.ca that fixes bug 31834.3
14395 2002-10-18 Miguel de Icaza <miguel@ximian.com>
14397 * driver.cs: Make the module extension .netmodule.
14399 2002-10-16 Miguel de Icaza <miguel@ximian.com>
14401 * driver.cs: Report an error if the resource file is not found
14402 instead of crashing.
14404 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14405 false, like Emit does.
14407 2002-10-16 Nick Drochak <ndrochak@gol.com>
14409 * typemanager.cs: Remove unused private member. Also reported mcs
14410 bug to report this as a warning like csc.
14412 2002-10-15 Martin Baulig <martin@gnome.org>
14414 * statement.cs (Statement.Emit): Made this a virtual method; emits
14415 the line number info and calls DoEmit().
14416 (Statement.DoEmit): New protected abstract method, formerly knows
14417 as Statement.Emit().
14419 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14421 2002-10-11 Miguel de Icaza <miguel@ximian.com>
14423 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14424 have fixed a remaining problem: not every AddXXXX was adding a
14425 fully qualified name.
14427 Now everyone registers a fully qualified name in the DeclSpace as
14428 being defined instead of the partial name.
14430 Downsides: we are slower than we need to be due to the excess
14431 copies and the names being registered this way.
14433 The reason for this is that we currently depend (on the corlib
14434 bootstrap for instance) that types are fully qualified, because
14435 we dump all the types in the namespace, and we should really have
14436 types inserted into the proper namespace, so we can only store the
14437 basenames in the defined_names array.
14439 2002-10-10 Martin Baulig <martin@gnome.org>
14441 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14442 from bug #31834, see the bug report for a testcase which is
14445 2002-10-10 Martin Baulig <martin@gnome.org>
14447 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14448 flow analysis code for this.
14450 * statement.cs (Do, While, For): Tell the flow analysis code about
14452 (FlowBranching.UsageVector): Added support for infinite loops.
14453 (Block.Resolve): Moved the dead code elimination here and use flow
14456 2002-10-09 Miguel de Icaza <miguel@ximian.com>
14458 * class.cs (Field.Define): Catch cycles on struct type
14461 * typemanager.cs (IsUnmanagedtype): Do not recursively check
14462 fields if the fields are static. We only need to check instance
14465 * expression.cs (As.DoResolve): Test for reference type.
14467 * statement.cs (Using.ResolveExpression): Use
14468 ConvertImplicitRequired, not ConvertImplicit which reports an
14470 (Using.ResolveLocalVariableDecls): ditto.
14472 * expression.cs (Binary.ResolveOperator): Report errors in a few
14473 places where we had to.
14475 * typemanager.cs (IsUnmanagedtype): Finish implementation.
14477 2002-10-08 Miguel de Icaza <miguel@ximian.com>
14479 * expression.cs: Use StoreFromPtr instead of extracting the type
14480 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
14482 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14483 an enumeration value to a System.Enum, but System.Enum is not a
14484 value type, but an class type, so we need to box.
14486 (Expression.ConvertExplicit): One codepath could return
14487 errors but not flag them. Fix this. Fixes #31853
14489 * parameter.cs (Resolve): Do not allow void as a parameter type.
14491 2002-10-06 Martin Baulig <martin@gnome.org>
14493 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14494 if it's a class type and not a struct. Fixes #31815.
14496 2002-10-06 Martin Baulig <martin@gnome.org>
14498 * statement.cs: Reworked the flow analysis code a bit to make it
14499 usable for dead code elimination.
14501 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14503 * cs-parser.jay: allow empty source files. Fixes bug #31781.
14505 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14507 * expression.cs (ComposedCast.DoResolveType): A quick workaround
14508 to fix the test 165, will investigate deeper.
14510 2002-10-04 Martin Baulig <martin@gnome.org>
14512 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14513 finally blocks actually work.
14514 (Try.Resolve): We don't need to create a sibling for `finally' if
14515 there is no finally block.
14517 2002-10-04 Martin Baulig <martin@gnome.org>
14519 * class.cs (Constructor.Define): The default accessibility for a
14520 non-default constructor is private, not public.
14522 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14524 * class.cs (Constructor): Make AllowedModifiers public, add
14527 * cs-parser.jay: Perform the modifiers test here, as the
14528 constructor for the Constructor class usually receives a zero
14529 because of the way we create it (first we create, later we
14530 customize, and we were never checking the modifiers).
14532 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14533 is a version of LookupTypeReflection that includes the type-name
14534 cache. This can be used as a fast path for functions that know
14535 the fully qualified name and are only calling into *.GetType() to
14536 obtain a composed type.
14538 This is also used by TypeManager.LookupType during its type
14541 (LookupType): We now also track the real type name, as sometimes
14542 we can get a quey for the real type name from things like
14543 ComposedCast. This fixes bug 31422.
14545 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14546 complete type fullname, it does not have to go through the type
14547 resolution system to obtain the composed version of the type (for
14548 obtaining arrays or pointers).
14550 (Conditional.Emit): Use the EmitBoolExpression to
14551 generate nicer code, as requested by Paolo.
14553 (ArrayCreation.CheckIndices): Use the patch from
14554 hwang_rob@yahoo.ca to validate the array initializers.
14556 2002-10-03 Miguel de Icaza <miguel@ximian.com>
14558 * class.cs (ConstructorInitializer.Emit): simplify code by using
14559 Invocation.EmitCall, and at the same time, fix the bugs in calling
14560 parent constructors that took variable arguments.
14562 * ecore.cs (Expression.ConvertNumericExplicit,
14563 Expression.ImplicitNumericConversion): Remove the code that
14564 manually wrapped decimal (InternalTypeConstructor call is now gone
14567 * expression.cs (Cast.TryReduce): Also handle decimal types when
14568 trying to perform a constant fold on the type.
14570 * typemanager.cs (IsUnmanagedtype): Partially implemented.
14572 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14573 that only turned off an error report, and did nothing else.
14575 2002-10-02 Miguel de Icaza <miguel@ximian.com>
14577 * driver.cs: Handle and ignore /fullpaths
14579 2002-10-01 Miguel de Icaza <miguel@ximian.com>
14581 * expression.cs (Binary.ResolveOperator): Catch the case where
14582 DoNumericPromotions returns true,
14584 (Binary.DoNumericPromotions): Simplify the code, and the tests.
14586 2002-09-27 Miguel de Icaza <miguel@ximian.com>
14588 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14591 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14593 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14594 conversion exists, but it is also required that the conversion be
14595 performed. This manifested in "(Type64Enum) 2".
14597 * class.cs (TypeManager.AddMethod): The fix is not to change
14598 AddEnum, because that one was using a fully qualified name (every
14599 DeclSpace derivative does), but to change the AddMethod routine
14600 that was using an un-namespaced name. This now correctly reports
14601 the duplicated name.
14603 Revert patch until I can properly fix it. The issue
14604 is that we have a shared Type space across all namespaces
14605 currently, which is wrong.
14607 Options include making the Namespace a DeclSpace, and merge
14608 current_namespace/current_container in the parser.
14610 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14612 * cs-parser.jay: Improve error reporting when we get a different
14613 kind of expression in local_variable_type and
14614 local_variable_pointer_type.
14616 Propagate this to avoid missleading errors being reported.
14618 * ecore.cs (ImplicitReferenceConversion): treat
14619 TypeManager.value_type as a target just like object_type. As
14624 Is valid, and needs to result in the int 1 being boxed before it
14625 is assigned to the value type v.
14627 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14628 to validate the enumeration name.
14630 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14631 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14632 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14634 * ecore.cs (TryImplicitIntConversion): When doing an
14635 implicit-enumeration-conversion, check if the type is 64-bits and
14636 perform a conversion before passing to EnumConstant.
14638 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14640 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14641 report ambiguous type references. Unlike the MS version, we
14642 report what the ambiguity is. Innovation at work ;-)
14644 (DeclSpace.FindType): Require a location argument to
14645 display when we display an ambiguous error.
14647 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14649 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14651 * expression.cs (EmitDynamicInitializers): Apply patch from
14652 hwang_rob@yahoo.ca that fixes the order in which we emit our
14655 2002-09-21 Martin Baulig <martin@gnome.org>
14657 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14658 delegate takes no arguments.
14660 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14662 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14665 * expression.cs: Extract the underlying type.
14667 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14669 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14671 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14673 * class.cs (TypeContainer.DefineType): We can not use the nice
14674 PackingSize with the size set to 1 DefineType method, because it
14675 will not allow us to define the interfaces that the struct
14678 This completes the fixing of bug 27287
14680 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14681 means also structs. This fixes part of the problem.
14682 (Expresion.ImplicitReferenceConversionExists): ditto.
14684 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14685 error if there were no errors reported during the type lookup
14686 process, to avoid duplicates or redundant errors. Without this
14687 you would get an ambiguous errors plus a type not found. We have
14688 beaten the user enough with the first error.
14690 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14693 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14694 during the resolution process, stop the lookup, this avoids
14695 repeated error reports (same error twice).
14697 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14699 * typemanager.cs (LookupType): Redo the type lookup code to match
14700 the needs of System.Reflection.
14702 The issue is that System.Reflection requires references to nested
14703 types to begin with a "+" sign instead of a dot. So toplevel
14704 types look like: "NameSpace.TopLevelClass", and nested ones look
14705 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14708 2002-09-19 Martin Baulig <martin@gnome.org>
14710 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14711 says that a method always returns or always throws an exception,
14712 don't report the CS0161.
14714 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14715 set `Returns = new_returns'.
14717 2002-09-19 Martin Baulig <martin@gnome.org>
14719 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14720 to an enum constant, check for a CS0176.
14722 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14724 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14725 for operators that must be in pairs and report errors.
14727 * ecore.cs (SimpleName.DoResolveType): During the initial type
14728 resolution process, when we define types recursively, we must
14729 check first for types in our current scope before we perform
14730 lookups in the enclosing scopes.
14732 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14734 (Invocation.VerifyArgumentsCompat): Call
14735 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14736 I thought we were supposed to always call this, but there are a
14737 few places in the code where we dont do it.
14739 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14741 * driver.cs: Add support in -linkres and -resource to specify the
14742 name of the identifier.
14744 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14746 * ecore.cs (StandardConversionExists): Sync with the conversion
14747 code: allow anything-* to void* conversions.
14749 (FindMostSpecificSource): Use an Expression argument
14750 instead of a Type, because we might be handed over a Literal which
14751 gets a few more implicit conversions that plain types do not. So
14752 this information was being lost.
14754 Also, we drop the temporary type-holder expression when not
14757 2002-09-17 Martin Baulig <martin@gnome.org>
14759 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14760 this is an explicit interface implementation.
14762 2002-09-17 Martin Baulig <martin@gnome.org>
14764 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14765 different `IndexerName' attributes.
14767 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14768 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14769 virtual CommonResolve().
14771 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14773 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14774 and convert that to the UnderlyingType.
14776 * statement.cs (Foreach.Resolve): Indexers are just like variables
14777 or PropertyAccesses.
14779 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14780 inside quoted strings, we were not doing this before.
14782 2002-09-16 Martin Baulig <martin@gnome.org>
14784 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14785 resolve it. This is needed for the definite assignment check of the
14786 instance expression, fixes bug #29846.
14787 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14789 2002-09-16 Nick Drochak <ndrochak@gol.com>
14791 * parameter.cs: Fix compile error. Cannot reference static member
14792 from an instance object. Is this an mcs bug?
14794 2002-09-14 Martin Baulig <martin@gnome.org>
14796 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14797 multiple times. Fixes bug #30295, added test-166.cs.
14799 2002-09-14 Martin Baulig <martin@gnome.org>
14801 * statement.cs (Block.Emit): Don't emit unreachable code.
14802 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14803 `break' statements.
14804 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14806 2002-09-14 Martin Baulig <martin@gnome.org>
14808 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14811 2002-09-14 Martin Baulig <martin@gnome.org>
14813 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14814 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14815 be false on the ms runtime.
14817 2002-09-13 Martin Baulig <martin@gnome.org>
14819 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14820 the CS0038 error message.
14822 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14824 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14825 constant inside, return it.
14827 2002-09-12 Martin Baulig <martin@gnome.org>
14829 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14830 implicit conversion can be done between enum types.
14832 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14833 check whether an implicit conversion to the current enum's UnderlyingType
14834 exists and report an error if not.
14836 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14837 without debugging support.
14839 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14840 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14842 2002-09-12 Martin Baulig <martin@gnome.org>
14844 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14846 * ecore.cs (IMemberExpr.DeclaringType): New property.
14847 (SimpleName.SimpleNameResolve): Check whether we're accessing a
14848 nonstatic member of an outer type (CS0038).
14850 2002-09-11 Miguel de Icaza <miguel@ximian.com>
14852 * driver.cs: Activate the using-error detector at warning level
14853 4 (at least for MS-compatible APIs).
14855 * namespace.cs (VerifyUsing): Small buglett fix.
14857 * pending.cs (PendingImplementation): pass the container pointer.
14859 * interface.cs (GetMethods): Allow for recursive definition. Long
14860 term, I would like to move every type to support recursive
14861 definitions, not the current ordering mechanism that we have right
14864 The situation is this: Attributes are handled before interfaces,
14865 so we can apply attributes to interfaces. But some attributes
14866 implement interfaces, we will now handle the simple cases
14867 (recursive definitions will just get an error).
14869 * parameter.cs: Only invalidate types at the end if we fail to
14872 2002-09-09 Martin Baulig <martin@gnome.org>
14874 * ecore.cs (PropertyExpr.Emit): Also check for
14875 TypeManager.system_int_array_get_length so this'll also work when
14876 compiling corlib. Fixes #30003.
14878 2002-09-09 Martin Baulig <martin@gnome.org>
14880 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14881 and throw an exception if we can't get the type's size. Fixed #30040,
14884 2002-09-09 Martin Baulig <martin@gnome.org>
14886 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14888 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14889 context. Fixes bug #30027.
14891 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14892 virtual functions. Fixes bug #30043, added test-164.cs.
14894 2002-09-08 Ravi Pratap <ravi@ximian.com>
14896 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14898 2002-09-08 Nick Drochak <ndrochak@gol.com>
14900 * driver.cs: Use an object to get the windows codepage since it's not a
14903 2002-09-08 Miguel de Icaza <miguel@ximian.com>
14905 * statement.cs (For.Emit): for infinite loops (test == null)
14906 return whether there is a break inside, not always "true".
14908 * namespace.cs (UsingEntry): New struct to hold the name of the
14909 using definition, the location where it is defined, and whether it
14910 has been used in a successful type lookup.
14912 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14917 2002-09-06 Ravi Pratap <ravi@ximian.com>
14919 * attribute.cs : Fix incorrect code which relied on catching
14920 a NullReferenceException to detect a null being passed in
14921 where an object was expected.
14923 2002-09-06 Miguel de Icaza <miguel@ximian.com>
14925 * statement.cs (Try): flag the catch variable as assigned
14927 * expression.cs (Cast): Simplified by using ResolveType instead of
14928 manually resolving.
14930 * statement.cs (Catch): Fix bug by using ResolveType.
14932 2002-09-06 Ravi Pratap <ravi@ximian.com>
14934 * expression.cs (BetterConversion): Special case for when we have
14935 a NullLiteral as the argument and we have to choose between string
14936 and object types - we choose string the way csc does.
14938 * attribute.cs (Attribute.Resolve): Catch the
14939 NullReferenceException and report error #182 since the Mono
14940 runtime no more has the bug and having this exception raised means
14941 we tried to select a constructor which takes an object and is
14944 2002-09-05 Ravi Pratap <ravi@ximian.com>
14946 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14947 message (1502, 1503) when we can't locate a method after overload
14948 resolution. This is much more informative and closes the bug
14951 * interface.cs (PopulateMethod): Return if there are no argument
14952 types. Fixes a NullReferenceException bug.
14954 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14955 expressions too. Previously we were checking only in one place for
14956 positional arguments leaving out named arguments.
14958 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14959 type to the enum type is not allowed. Remove code corresponding to
14962 (ConvertNumericExplicit): Allow explicit conversions from
14963 the underlying type to enum type. This precisely follows the spec
14964 and closes a bug filed by Gonzalo.
14966 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14969 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14971 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14973 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14974 it was important that we stored the right value after the
14975 reduction in `converted'.
14977 2002-09-04 Martin Baulig <martin@gnome.org>
14979 * location.cs (Location.SymbolDocument): Use full pathnames for the
14982 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14984 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14985 of the expression resolve mechanism, because that will catch the
14986 SimpleName error failures.
14988 (Conditional): If we can not resolve the
14989 expression, return, do not crash.
14991 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14994 (location): display token name instead of its number.
14996 2002-08-28 Martin Baulig <martin@gnome.org>
14998 * expression.cs (Binary.ResolveOperator): Don't silently return
14999 but return an error if an operator cannot be applied between two
15002 2002-08-28 Martin Baulig <martin@gnome.org>
15004 * class.cs (Constructor.Define): Set the permission attributes
15005 correctly instead of making all constructors public.
15007 2002-08-28 Martin Baulig <martin@gnome.org>
15009 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15010 for private members before reporting a CS0103; if we find anything,
15013 2002-08-28 Martin Baulig <martin@gnome.org>
15015 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15016 to check whether `closure_start_type == closure_invocation_type',
15017 we also need to check whether `m.DeclaringType == closure_invocation_type'
15018 before bypassing the permission checks. We might be accessing
15019 protected/private members from the base class.
15020 (TypeManager.RealMemberLookup): Only set private_ok if private
15021 members were requested via BindingFlags.NonPublic.
15023 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15025 * expression.cs (MemberAccess.ResolveMemberAccess): Set
15026 MethodGroupExpr.IsExplicitImpl if appropriate.
15027 (Invocation.DoResolve): Don't report the CS0120 for explicit
15028 interface implementations.
15030 2002-08-27 Martin Baulig <martin@gnome.org>
15032 * expression.cs (Invocation.DoResolve): If this is a static
15033 method and we don't have an InstanceExpression, we must report
15036 2002-08-25 Martin Baulig <martin@gnome.org>
15038 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15039 `==' between a valuetype and an object.
15041 2002-08-25 Miguel de Icaza <miguel@ximian.com>
15043 * ecore.cs (TypeExpr): Provide a ToString method.
15045 2002-08-24 Martin Baulig <martin@gnome.org>
15047 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15048 now called proggie.dbg and it's a binary file.
15050 2002-08-23 Martin Baulig <martin@gnome.org>
15052 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15054 2002-08-23 Martin Baulig <martin@gnome.org>
15056 * struct.cs (MyStructInfo.ctor): Make this work with empty
15057 structs; it's not allowed to use foreach() on null.
15059 2002-08-23 Martin Baulig <martin@gnome.org>
15061 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15062 writer the full pathname of the generated assembly.
15064 2002-08-23 Martin Baulig <martin@gnome.org>
15066 * statements.cs (FlowBranching.UsageVector.MergeChildren):
15067 A `finally' block never returns or breaks; improved handling of
15070 2002-08-23 Martin Baulig <martin@gnome.org>
15072 * statement.cs (Throw.Resolve): Allow `throw null'.
15074 2002-08-23 Martin Baulig <martin@gnome.org>
15076 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15077 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15078 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
15079 MemberLookup would return a wrong event if this is an explicit
15080 interface implementation and the class has an event with the same
15083 2002-08-23 Martin Baulig <martin@gnome.org>
15085 * statement.cs (Block.AddChildVariableNames): New public method.
15086 (Block.AddChildVariableName): Likewise.
15087 (Block.IsVariableNameUsedInChildBlock): Likewise.
15088 (Block.AddVariable): Check whether a variable name has already
15089 been used in a child block.
15091 * cs-parser.jay (declare_local_variables): Mark all variable names
15092 from the current block as being used in a child block in the
15095 2002-08-23 Martin Baulig <martin@gnome.org>
15097 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15098 find the symbol writer.
15100 * driver.cs: csc also allows the arguments to /define being
15101 separated by commas, not only by semicolons.
15103 2002-08-23 Martin Baulig <martin@gnome.org>
15105 * interface.cs (Interface.GetMembers): Added static check for events.
15107 2002-08-15 Martin Baulig <martin@gnome.org>
15109 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15110 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15112 * ecore.cs (Expression.MemberLookup): Added documentation and explained
15113 why the MethodData.EmitDestructor() change was necessary.
15115 2002-08-20 Martin Baulig <martin@gnome.org>
15117 * class.cs (TypeContainer.FindMembers): Added static check for events.
15119 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15121 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15122 use Type.GetEvents(), not Type.FindMembers().
15124 2002-08-20 Martin Baulig <martin@gnome.org>
15126 * decl.cs (MemberCache): Added a special method cache which will
15127 be used for method-only searched. This ensures that a method
15128 search will return a MethodInfo with the correct ReflectedType for
15131 2002-08-20 Martin Baulig <martin@gnome.org>
15133 * decl.cs (DeclSpace.FindMembers): Made this public.
15135 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15137 * delegate.cs: fixed build on windows.
15138 [FIXME: Filed as bug #29150: MCS must report these errors.]
15140 2002-08-19 Ravi Pratap <ravi@ximian.com>
15142 * ecore.cs (StandardConversionExists): Return a false
15143 if we are trying to convert the void type to anything else
15144 since that is not allowed.
15146 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15147 we flag error 70 in the event an event is trying to be accessed
15148 directly from outside the declaring type.
15150 2002-08-20 Martin Baulig <martin@gnome.org>
15152 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15153 MemberCache from typemanager.cs to decl.cs.
15155 2002-08-19 Martin Baulig <martin@gnome.org>
15157 * class.cs (TypeContainer): Implement IMemberContainer.
15158 (TypeContainer.DefineMembers): Create the MemberCache.
15159 (TypeContainer.FindMembers): Do better BindingFlags checking; only
15160 return public members if BindingFlags.Public was given, check
15161 whether members are static.
15163 2002-08-16 Martin Baulig <martin@gnome.org>
15165 * decl.cs (DeclSpace.Define): Splitted this in Define and
15166 DefineMembers. DefineMembers is called first and initializes the
15169 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
15170 DefineMembers() on all our DeclSpaces.
15172 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15173 but call DefineMembers() on all nested interfaces. We call their
15174 Define() in our new Define() function.
15176 * interface.cs (Interface): Implement IMemberContainer.
15177 (Interface.Define): Moved all code except the attribute stuf to
15179 (Interface.DefineMembers): Initialize the member cache.
15181 * typemanager.cs (IMemberFinder): Removed this interface, we don't
15182 need this anymore since we can use MemberCache.FindMembers directly.
15184 2002-08-19 Martin Baulig <martin@gnome.org>
15186 * typemanager.cs (MemberCache): When creating the cache for an
15187 interface type, add all inherited members.
15188 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15189 to `out bool used_cache' and documented it.
15190 (TypeManager.MemberLookup): If we already used the cache in the first
15191 iteration, we don't need to do the interfaces check.
15193 2002-08-19 Martin Baulig <martin@gnome.org>
15195 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
15196 here from IMemberFinder and don't implement this interface anymore.
15197 (DeclSpace.MemberCache): Moved here from IMemberFinder.
15199 * typemanager.cs (IMemberFinder): This interface is now only used by
15200 classes which actually support the member cache.
15201 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15202 since we only put DeclSpaces into this Hashtable.
15203 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15204 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15206 2002-08-16 Martin Baulig <martin@gnome.org>
15208 * typemanager.cs (ICachingMemberFinder): Removed.
15209 (IMemberFinder.MemberCache): New property.
15210 (TypeManager.FindMembers): Merged this with RealFindMembers().
15211 This function will never be called from TypeManager.MemberLookup()
15212 so we can't use the cache here, just the IMemberFinder.
15213 (TypeManager.MemberLookup_FindMembers): Check whether the
15214 IMemberFinder has a MemberCache and call the cache's FindMembers
15216 (MemberCache): Rewrote larger parts of this yet another time and
15217 cleaned it up a bit.
15219 2002-08-15 Miguel de Icaza <miguel@ximian.com>
15221 * driver.cs (LoadArgs): Support quoting.
15223 (Usage): Show the CSC-like command line arguments.
15225 Improved a few error messages.
15227 2002-08-15 Martin Baulig <martin@gnome.org>
15229 * typemanager.cs (IMemberContainer.Type): New property.
15230 (IMemberContainer.IsInterface): New property.
15232 The following changes are conditional to BROKEN_RUNTIME, which is
15233 defined at the top of the file.
15235 * typemanager.cs (MemberCache.MemberCache): Don't add the base
15236 class'es members, but add all members from TypeHandle.ObjectType
15237 if we're an interface.
15238 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15239 is the current type.
15240 (MemberCache.CacheEntry.Container): Removed this field.
15241 (TypeHandle.GetMembers): Include inherited members.
15243 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15245 * typemanager.cs: fixed compilation and added a comment on a field that
15248 2002-08-15 Martin Baulig <martin@gnome.org>
15250 * class.cs (ConstructorInitializer.Resolve): In the
15251 Expression.MemberLookup call, use the queried_type as
15254 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15255 declared' attribute, it's always true.
15256 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15257 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15258 temporary wrapper for FindMembers which tells MemberLookup whether
15259 members from the base classes are included in the return value.
15260 This will go away soon.
15261 (TypeManager.MemberLookup): Use this temporary hack here; once the
15262 new MemberCache is completed, we don't need to do the DeclaredOnly
15263 looping here anymore since the MemberCache will take care of this.
15264 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15265 (MemberCache): When creating the MemberCache for a class, get
15266 members from the current class and all its base classes.
15267 (MemberCache.CacheEntry.Container): New field. This is a
15268 temporary hack until the Mono runtime is fixed to distinguish
15269 between ReflectedType and DeclaringType. It allows us to use MCS
15270 with both the MS runtime and the unfixed Mono runtime without
15271 problems and without accecting performance.
15272 (MemberCache.SearchMembers): The DeclaredOnly looping from
15273 TypeManager.MemberLookup is now done here.
15275 2002-08-14 Martin Baulig <martin@gnome.org>
15277 * statement.cs (MyStructInfo.MyStructInfo): Don't call
15278 Type.GetFields on dynamic types but get the fields from the
15279 corresponding TypeContainer.
15280 (MyStructInfo.GetStructInfo): Added check for enum types.
15282 * typemanager.cs (MemberList.IsSynchronized): Implemented.
15283 (MemberList.SyncRoot): Implemented.
15284 (TypeManager.FilterWithClosure): No need to check permissions if
15285 closure_start_type == closure_invocation_type, don't crash if
15286 closure_invocation_type is null.
15288 2002-08-13 Martin Baulig <martin@gnome.org>
15290 Rewrote TypeContainer.FindMembers to use a member cache. This
15291 gives us a speed increase of about 35% for the self-hosting MCS
15292 build and of about 15-20% for the class libs (both on GNU/Linux).
15294 * report.cs (Timer): New class to get enhanced profiling. This
15295 whole class is "TIMER" conditional since it remarkably slows down
15298 * class.cs (MemberList): New class. This is an IList wrapper
15299 which we're now using instead of passing MemberInfo[]'s around to
15300 avoid copying this array unnecessarily.
15301 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15302 (ICachingMemberFinder, IMemberContainer): New interface.
15303 (TypeManager.FilterWithClosure): If `criteria' is null, the name
15304 has already been checked, otherwise use it for the name comparision.
15305 (TypeManager.FindMembers): Renamed to RealMemberFinder and
15306 provided wrapper which tries to use ICachingMemberFinder.FindMembers
15307 if possible. Returns a MemberList, not a MemberInfo [].
15308 (TypeHandle): New class, implements IMemberContainer. We create
15309 one instance of this class per type, it contains a MemberCache
15310 which is used to do the member lookups.
15311 (MemberCache): New class. Each instance of this class contains
15312 all members of a type and a name-based hash table.
15313 (MemberCache.FindMembers): This is our new member lookup
15314 function. First, it looks up all members of the requested name in
15315 the hash table. Then, it walks this list and sorts out all
15316 applicable members and returns them.
15318 2002-08-13 Martin Baulig <martin@gnome.org>
15320 In addition to a nice code cleanup, this gives us a performance
15321 increase of about 1.4% on GNU/Linux - not much, but it's already
15322 half a second for the self-hosting MCS compilation.
15324 * typemanager.cs (IMemberFinder): New interface. It is used by
15325 TypeManager.FindMembers to call FindMembers on a TypeContainer,
15326 Enum, Delegate or Interface.
15327 (TypeManager.finder_to_member_finder): New PtrHashtable.
15328 (TypeManager.finder_to_container): Removed.
15329 (TypeManager.finder_to_delegate): Removed.
15330 (TypeManager.finder_to_interface): Removed.
15331 (TypeManager.finder_to_enum): Removed.
15333 * interface.cs (Interface): Implement IMemberFinder.
15335 * delegate.cs (Delegate): Implement IMemberFinder.
15337 * enum.cs (Enum): Implement IMemberFinder.
15339 * class.cs (TypeContainer): Implement IMemberFinder.
15341 2002-08-12 Martin Baulig <martin@gnome.org>
15343 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15345 2002-08-12 Martin Baulig <martin@gnome.org>
15347 * ecore.cs (ITypeExpression): New interface for expressions which
15349 (TypeExpression): Renamed to TypeLookupExpression.
15350 (Expression.DoResolve): If we're doing a types-only lookup, the
15351 expression must implement the ITypeExpression interface and we
15352 call DoResolveType() on it.
15353 (SimpleName): Implement the new ITypeExpression interface.
15354 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15355 hack, the situation that we're only looking up types can't happen
15356 anymore when this method is called. Moved the type lookup code to
15357 DoResolveType() and call it.
15358 (SimpleName.DoResolveType): This ITypeExpression interface method
15359 is now doing the types-only lookup.
15360 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15361 (ResolveFlags): Added MaskExprClass.
15363 * expression.cs (MemberAccess): Implement the ITypeExpression
15365 (MemberAccess.DoResolve): Added support for a types-only lookup
15366 when we're called via ITypeExpression.DoResolveType().
15367 (ComposedCast): Implement the ITypeExpression interface.
15369 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
15370 Expression.Resolve() with ResolveFlags.Type instead.
15372 2002-08-12 Martin Baulig <martin@gnome.org>
15374 * interface.cs (Interface.Define): Apply attributes.
15376 * attribute.cs (Attribute.ApplyAttributes): Added support for
15377 interface attributes.
15379 2002-08-11 Martin Baulig <martin@gnome.org>
15381 * statement.cs (Block.Emit): Only check the "this" variable if we
15382 do not always throw an exception.
15384 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15385 whether the property has a set accessor.
15387 2002-08-11 Martin Baulig <martin@gnome.org>
15389 Added control flow analysis support for structs.
15391 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15392 with control flow analysis turned off.
15393 (IVariable): New interface.
15394 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15395 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15396 (FieldExpr.DoResolve): Resolve the instance expression with flow
15397 analysis turned off and do the definite assignment check after the
15398 resolving when we know what the expression will resolve to.
15400 * expression.cs (LocalVariableReference, ParameterReference):
15401 Implement the new IVariable interface, only call the flow analysis
15402 code if ec.DoFlowAnalysis is true.
15403 (This): Added constructor which takes a Block argument. Implement
15404 the new IVariable interface.
15405 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15406 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15407 This does the definite assignment checks for struct members.
15409 * class.cs (Constructor.Emit): If this is a non-static `struct'
15410 constructor which doesn't have any initializer, call
15411 Block.AddThisVariable() to tell the flow analysis code that all
15412 struct elements must be initialized before control returns from
15415 * statement.cs (MyStructInfo): New public class.
15416 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15417 argument to this indexer. If non-zero, check an individual struct
15418 member, not the whole struct.
15419 (FlowBranching.CheckOutParameters): Check struct members.
15420 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15421 overloaded versions of these methods which take an additional
15422 `int field_idx' argument to check struct members.
15423 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15424 overloaded versions of these methods which take an additional
15425 `string field_name' argument to check struct member.s
15426 (VariableInfo): Implement the IVariable interface.
15427 (VariableInfo.StructInfo): New public property. Returns the
15428 MyStructInfo instance of the variable if it's a struct or null.
15429 (Block.AddThisVariable): New public method. This is called from
15430 Constructor.Emit() for non-static `struct' constructor which do
15431 not have any initializer. It creates a special variable for the
15432 "this" instance variable which will be checked by the flow
15433 analysis code to ensure that all of the struct's fields are
15434 initialized before control returns from the constructor.
15435 (UsageVector): Added support for struct members. If a
15436 variable/parameter is a struct with N members, we reserve a slot
15437 in the usage vector for each member. A struct is considered fully
15438 initialized if either the struct itself (slot 0) or all its
15439 members are initialized.
15441 2002-08-08 Martin Baulig <martin@gnome.org>
15443 * driver.cs (Driver.MainDriver): Only report an error CS5001
15444 if there were no compilation errors.
15446 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15447 `UnsafeContext' property to determine whether the parent is in
15448 unsafe context rather than checking the parent's ModFlags:
15449 classes nested in an unsafe class are unsafe as well.
15451 2002-08-08 Martin Baulig <martin@gnome.org>
15453 * statement.cs (UsageVector.MergeChildren): Distinguish between
15454 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15455 we return. Added test17() and test18() to test-154.cs.
15457 2002-08-08 Martin Baulig <martin@gnome.org>
15459 * typemanager.cs (TypeManager.FilterWithClosure): If we have
15460 Family access, make sure the invoking type isn't a subclass of the
15461 queried type (that'd be a CS1540).
15463 * ecore.cs (Expression.MemberLookup): Added overloaded version of
15464 this method which takes an additional `Type invocation_type'.
15466 * expression.cs (BaseAccess.DoResolve): Use the base type as
15467 invocation and query type.
15468 (MemberAccess.DoResolve): If the lookup failed and we're about to
15469 report a CS0122, try a lookup with the ec.ContainerType - if this
15470 succeeds, we must report a CS1540.
15472 2002-08-08 Martin Baulig <martin@gnome.org>
15474 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15475 (MethodGroupExpr): Implement the IMemberExpr interface.
15477 * expression (MemberAccess.ResolveMemberAccess): No need to have
15478 any special code for MethodGroupExprs anymore, they're now
15481 2002-08-08 Martin Baulig <martin@gnome.org>
15483 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15484 Family, FamANDAssem and FamORAssem permissions.
15485 (TypeManager.IsSubclassOrNestedChildOf): New public method.
15487 2002-08-08 Martin Baulig <martin@gnome.org>
15489 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15490 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15493 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15495 * driver.cs: implemented /resource option to embed managed resources.
15497 2002-08-07 Martin Baulig <martin@gnome.org>
15499 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15500 (FieldBase.HasFieldInitializer): New public property.
15501 (FieldBase.GetInitializerExpression): New public method. Resolves and
15502 returns the field initializer and makes sure it is only resolved once.
15503 (TypeContainer.EmitFieldInitializers): Call
15504 FieldBase.GetInitializerExpression to get the initializer, this ensures
15505 that it isn't resolved multiple times.
15507 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
15508 the resolving process (SimpleName/MemberLookup) that we're currently
15509 emitting a field initializer (which must not access any instance members,
15510 this is an error CS0236).
15512 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15513 argument, if the `IsFieldInitializer' flag is set, we must report and
15514 error CS0236 and not an error CS0120.
15516 2002-08-07 Martin Baulig <martin@gnome.org>
15518 * ecore.cs (IMemberExpr): New public interface.
15519 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15520 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15521 if the expression is an IMemberExpr.
15523 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15524 to be null, implicitly default to `this' if we're non-static in
15525 this case. Simplified the code a lot by using the new IMemberExpr
15526 interface. Also fixed bug #28176 here.
15528 2002-08-06 Martin Baulig <martin@gnome.org>
15530 * cs-parser.jay (SimpleLookup): Removed. We need to create
15531 ParameterReferences during semantic analysis so that we can do a
15532 type-only search when resolving Cast, TypeOf and SizeOf.
15533 (block): Pass the `current_local_parameters' to the Block's
15536 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15537 argument to the constructor.
15538 (ConstructorInitializer.Resolve): Create a temporary implicit
15539 block with the parameters.
15541 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15542 references here if we aren't doing a type-only search.
15544 * statement.cs (Block): Added constructor which takes a
15545 `Parameters parameters' argument.
15546 (Block.Parameters): New public property.
15548 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15549 to `Parameters' and made it public readonly.
15551 2002-08-06 Martin Baulig <martin@gnome.org>
15553 * ecore.cs (Expression.Warning): Made this public as well.
15555 * report.cs (Report.Debug): Print the contents of collections.
15557 2002-08-06 Martin Baulig <martin@gnome.org>
15559 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
15560 used to tell Resolve() which kinds of expressions it may return.
15561 (Expression.Resolve): Added overloaded version of this method which
15562 takes a `ResolveFlags flags' argument. This can be used to tell
15563 Resolve() which kinds of expressions it may return. Reports a
15565 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15566 ResolveFlags.SimpleName.
15567 (Expression.Error118): Added overloaded version of this method which
15568 takes a `ResolveFlags flags' argument. It uses the flags to determine
15569 which kinds of expressions are allowed.
15571 * expression.cs (Argument.ResolveMethodGroup): New public method.
15572 Resolves an argument, but allows a MethodGroup to be returned.
15573 This is used when invoking a delegate.
15575 * TODO: Updated a bit.
15577 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15579 Fixed compilation with csc.
15581 * ecore.cs: Expression.Error made public. Is this correct? Should
15582 Warning be made public too?
15584 * expression.cs: use ea.Location instead of ea.loc.
15585 [FIXME: Filed as bug #28607: MCS must report these errors.]
15587 2002-08-06 Martin Baulig <martin@gnome.org>
15589 * ecore.cs (Expression.loc): Moved the location here instead of
15590 duplicating it in all derived classes.
15591 (Expression.Location): New public property.
15592 (Expression.Error, Expression.Warning): Made them non-static and
15593 removed the location argument.
15594 (Expression.Warning): Added overloaded version which takes an
15595 `int level' argument.
15596 (Expression.Error118): Make this non-static and removed the
15597 expression and location arguments.
15598 (TypeExpr): Added location argument to the constructor.
15600 * expression.cs (StaticCallExpr): Added location argument to
15602 (Indirection, PointerArithmetic): Likewise.
15603 (CheckedExpr, UnCheckedExpr): Likewise.
15604 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15605 (StringPtr): Likewise.
15608 2002-08-05 Martin Baulig <martin@gnome.org>
15610 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15612 * assign.cs (Assign.DoResolve): Check whether the source
15613 expression is a value or variable.
15615 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15616 while resolving the corresponding blocks.
15618 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15619 an error, don't silently return null.
15621 * statement.cs (Block.AddVariable): Do the error reporting here
15622 and distinguish between CS0128 and CS0136.
15623 (Block.DoResolve): Report all unused labels (warning CS0164).
15624 (LabeledStatement): Pass the location to the constructor.
15625 (LabeledStatement.HasBeenReferenced): New property.
15626 (LabeledStatement.Resolve): Set it to true here.
15628 * statement.cs (Return.Emit): Return success even after reporting
15629 a type mismatch error (CS0126 or CS0127), this is what csc does and
15630 it avoids confusing the users with any consecutive errors.
15632 2002-08-05 Martin Baulig <martin@gnome.org>
15634 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15636 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15638 * expression.cs (MemberAccess.DoResolve): Silently return if an
15639 error has already been reported.
15641 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15642 error has already been reported.
15644 2002-08-05 Martin Baulig <martin@gnome.org>
15646 * statement.cs (UsageVector): Only initialize the `parameters'
15647 vector if we actually have any "out" parameters.
15649 2002-08-05 Martin Baulig <martin@gnome.org>
15651 * expression.cs (Binary.ResolveOperator): When combining delegates,
15652 they must have the same type.
15654 2002-08-05 Martin Baulig <martin@gnome.org>
15656 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15657 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15658 work with the ms runtime and we also don't need it: if we're a
15659 PropertyBuilder and not in the `indexer_arguments' hash, then we
15660 are a property and not an indexer.
15662 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15663 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15664 since the latter one doesn't work with the ms runtime.
15666 2002-08-03 Martin Baulig <martin@gnome.org>
15668 Fixed bugs #27998 and #22735.
15670 * class.cs (Method.IsOperator): New public field.
15671 (Method.CheckBase): Report CS0111 if there's already a method
15672 with the same parameters in the current class. Report CS0508 when
15673 attempting to change the return type of an inherited method.
15674 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15675 and it's not marked abstract or extern.
15676 (PropertyBase): New abstract base class for Property and Indexer.
15677 (PropertyBase.CheckBase): Moved here from Property and made it work
15679 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15680 the same so we can reuse it there.
15681 (Property, Indexer): Derive from PropertyBase.
15682 (MethodSignature.inheritable_property_signature_filter): New delegate
15683 to find properties and indexers.
15685 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15686 argument and improved error reporting.
15688 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15689 EmptyReadOnlyParameters and made it a property.
15691 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15692 version of this method which takes a `PropertyInfo indexer'.
15693 (TypeManager.RegisterIndexer): New method.
15695 * class.cs: Added myself as author of this file :-)
15697 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15699 * class.cs: fixed compilation on windoze.
15701 2002-08-03 Martin Baulig <martin@gnome.org>
15703 * interface.cs (Interface.GetInterfaceBases): Check whether all
15704 base interfaces are at least as accessible than the current one.
15706 * class.cs (TypeContainer.GetClassBases): Check whether base types
15707 are at least as accessible than the current type.
15708 (TypeContainer.AsAccessible): Implemented and made non-static.
15709 (MemberBase.CheckParameters): Report errors if the accessibility
15712 * delegate.cs (Delegate.Delegate): The default visibility is
15713 internal for top-level types and private for nested types.
15714 (Delegate.Define): Report errors if the accessibility checks fail.
15716 * enum.cs (Enum.Enum): The default visibility is internal for
15717 top-level types and private for nested types.
15718 (Enum.DefineType): Compute the correct visibility.
15720 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15721 function which takes a `bool is_toplevel' instead of a TypeContainer.
15723 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15726 2002-08-02 Martin Baulig <martin@gnome.org>
15728 * expression.cs (LocalVariableReferenc): Added constructor which
15729 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15730 (LocalVariableReference.IsReadOnly): New property.
15731 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15732 variable is readonly, use our own readonly flag to do this; you can
15733 use the new constructor to get a writable reference to a read-only
15736 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15737 reference to the local variable.
15739 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15741 * rootcontext.cs (ResolveCore): Also include System.Exception
15743 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15744 we reach an EmptyStatement.
15746 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15749 * expression.cs (Binary.ResolveOperator): Check error result in
15752 use brtrue/brfalse directly and avoid compares to null.
15754 2002-08-02 Martin Baulig <martin@gnome.org>
15756 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15757 Fixes bug #28407, added test-155.cs.
15759 2002-08-01 Martin Baulig <martin@gnome.org>
15761 * class.cs (Event.EmitDefaultMethod): Make this work with static
15762 events. Fixes #28311, added verify-3.cs.
15764 2002-08-01 Martin Baulig <martin@gnome.org>
15766 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15767 `is_disposable' fields.
15768 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15769 `hm.is_disposable' if we're using the collection pattern.
15770 (Foreach.EmitCollectionForeach): Use the correct type for the
15771 enumerator's local variable, only emit the try/finally block if
15772 necessary (fixes #27713).
15774 2002-08-01 Martin Baulig <martin@gnome.org>
15776 * ecore.cs (Expression.report118): Renamed to Error118 and made
15779 * statement.cs (Throw.Resolve): Check whether the expression is of
15780 the correct type (CS0118) and whether the type derives from
15781 System.Exception (CS0155).
15782 (Catch.Resolve): New method. Do the type lookup here and check
15783 whether it derives from System.Exception (CS0155).
15784 (Catch.CatchType, Catch.IsGeneral): New public properties.
15786 * typemanager.cs (TypeManager.exception_type): Added.
15788 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15790 * driver.cs: Updated About function.
15792 2002-07-31 Martin Baulig <martin@gnome.org>
15794 Implemented Control Flow Analysis.
15796 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15797 (EmitContext.CurrentBranching): Added.
15798 (EmitContext.StartFlowBranching): Added.
15799 (EmitContext.EndFlowBranching): Added.
15800 (EmitContext.KillFlowBranching): Added.
15801 (EmitContext.IsVariableAssigned): Added.
15802 (EmitContext.SetVariableAssigned): Added.
15803 (EmitContext.IsParameterAssigned): Added.
15804 (EmitContext.SetParameterAssigned): Added.
15805 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15806 Added control flow analysis stuff here.
15808 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15809 resolve the expression as lvalue.
15810 (LocalVariableReference.DoResolve): Check whether the variable has
15811 already been assigned.
15812 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15813 the parameter as assigned here.
15814 (ParameterReference.DoResolve): Check whether the parameter has already
15816 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15817 expression as lvalue.
15819 * statement.cs (FlowBranching): New class for the flow analysis code.
15820 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15821 (LabeledStatement.IsDefined): New public property.
15822 (LabeledStatement.AddUsageVector): New public method to tell flow
15823 analyis that the label may be reached via a forward jump.
15824 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15826 (VariableInfo.Number): New public field. This is used by flow analysis
15827 to number all locals of a block.
15828 (Block.CountVariables): New public property. This is the number of
15829 local variables in this block (including the locals from all parent
15831 (Block.EmitMeta): Number all the variables.
15833 * statement.cs: Added flow analysis support to all classes.
15835 2002-07-31 Martin Baulig <martin@gnome.org>
15837 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15838 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15839 then use this argument.
15841 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15843 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15844 use this to specify /define options.
15846 2002-07-29 Martin Baulig <martin@gnome.org>
15848 * statement.cs (Fixed): Moved all code that does variable lookups
15849 and resolvings from Emit to Resolve.
15851 * statement.cs (For): Moved all code that does variable lookups
15852 and resolvings from Emit to Resolve.
15854 * statement.cs (Using): Moved all code that does variable lookups
15855 and resolvings from Emit to Resolve.
15857 2002-07-29 Martin Baulig <martin@gnome.org>
15859 * attribute.cs (Attribute.Resolve): Explicitly catch a
15860 System.NullReferenceException when creating the
15861 CustromAttributeBuilder and report a different warning message.
15863 2002-07-29 Martin Baulig <martin@gnome.org>
15865 * support.cs (ParameterData.ParameterName): Added method to
15866 get the name of a parameter.
15868 * typemanager.cs (TypeManager.IsValueType): New public method.
15870 2002-07-29 Martin Baulig <martin@gnome.org>
15872 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
15873 is a flag which specifies that it's either ref or out.
15874 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15875 the out parameter to `out Parameter.Modifier mod', also set the
15876 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15878 * support.cs (InternalParameters.ParameterModifier): Distinguish
15879 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15880 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15882 * expression.cs (Argument.GetParameterModifier): Distinguish
15883 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15884 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15886 2002-07-29 Martin Baulig <martin@gnome.org>
15888 * expression.cs (ParameterReference.ParameterReference): Added
15889 `Location loc' argument to the constructor.
15891 * cs-parser.jay: Pass location to ParameterReference.
15893 2002-07-28 Miguel de Icaza <miguel@ximian.com>
15895 * statement.cs (Try): Initialize the location.
15897 * cs-parser.jay: pass location to Try.
15899 * expression.cs (Unary.Reduce): Change the prototype to return
15900 whether a constant fold could be performed or not. The result is
15901 returned in an out parameters. In the case of Indirection and
15902 AddressOf, we want to perform the full tests.
15904 2002-07-26 Miguel de Icaza <miguel@ximian.com>
15906 * statement.cs (Statement.Emit): Flag dead code.
15908 2002-07-27 Andrew Birkett <andy@nobugs.org>
15910 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15912 2002-07-27 Martin Baulig <martin@gnome.org>
15914 * class.cs (MethodData.Define): Put back call to
15915 TypeManager.AddMethod(), accidentally commented this out.
15917 * report.cs (Debug): New public method to print debugging information,
15918 this is `[Conditional ("DEBUG")]'.
15920 2002-07-26 Martin Baulig <martin@gnome.org>
15922 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15923 (switch_statement): Push the current_block to the switch_stack and
15924 pop it again when we're done with the switch.
15925 (switch_section): The new block is a child of the current_block.
15926 Fixes bug #24007, added test-152.cs.
15928 2002-07-27 Martin Baulig <martin@gnome.org>
15930 * expression.cs (Invocation.EmitArguments): When calling a varargs
15931 function with only its fixed arguments, we need to pass an empty
15934 2002-07-27 Martin Baulig <martin@gnome.org>
15936 Mono 0.13 has been released.
15938 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15940 * driver.cs: Rename --resource to --linkres, because that is what
15941 we do currently, we dont support --resource yet.
15943 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15945 2002-07-25 Martin Baulig <martin@gnome.org>
15947 * class.cs (MethodData): New public class. This is a `method builder'
15948 class for a method or one accessor of a Property/Indexer/Event.
15949 (MethodData.GetMethodFlags): Moved here from MemberBase.
15950 (MethodData.ApplyAttributes): Likewise.
15951 (MethodData.ApplyObsoleteAttribute): Likewise.
15952 (MethodData.ApplyConditionalAttribute): Likewise.
15953 (MethodData.ApplyDllImportAttribute): Likewise.
15954 (MethodData.CheckAbstractAndExternal): Likewise.
15955 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15956 (MethodData.Emit): Formerly known as Method.Emit().
15957 (MemberBase): Moved everything which was specific to a single
15958 accessor/method to MethodData.
15959 (Method): Create a new MethodData and call Define() and Emit() on it.
15960 (Property, Indexer, Event): Create a new MethodData objects for each
15961 accessor and call Define() and Emit() on them.
15963 2002-07-25 Martin Baulig <martin@gnome.org>
15965 Made MethodCore derive from MemberBase to reuse the code from there.
15966 MemberBase now also checks for attributes.
15968 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15969 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15971 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15972 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15973 (MemberBase.ApplyAttributes): New virtual method; applies the
15974 attributes to a method or accessor.
15975 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15976 (MemberBase.ApplyConditionalAttribute): Likewise.
15977 (MemberBase.ApplyDllImportAttribute): Likewise.
15978 (MemberBase.CheckAbstractAndExternal): Likewise.
15979 (MethodCore.ParameterTypes): This is now a property instead of a
15980 method, it's initialized from DoDefineParameters().
15981 (MethodCore.ParameterInfo): Removed the set accessor.
15982 (MethodCore.DoDefineParameters): New protected virtual method to
15983 initialize ParameterTypes and ParameterInfo.
15984 (Method.GetReturnType): We can now simply return the MemberType.
15985 (Method.GetMethodFlags): Override the MemberBase version and add
15986 the conditional flags.
15987 (Method.CheckBase): Moved some code from Define() here, call
15988 DoDefineParameters() here.
15989 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15990 here to avoid some larger code duplication.
15991 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15992 ensure that abstract and external accessors don't declare a body.
15994 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15995 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15996 lookup in the attribute's parent classes, so we need to abort as soon
15997 as we found the first match.
15998 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15999 the attribute has no arguments.
16001 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16004 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16006 * cs-parser.jay: reverted previous patch.
16008 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16010 * cs-parser.jay: fixed bug #22119.
16012 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16014 * attribute.cs: fixed compilation. The error was:
16015 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
16016 be assigned to before control leaves the current method."
16017 [FIXME: Filed as bug #28186: MCS must report this error.]
16019 2002-07-25 Martin Baulig <martin@gnome.org>
16021 * attribute.cs (Attribute.Conditional_GetConditionName): New static
16022 method to pull the condition name ouf of a Conditional attribute.
16023 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16024 the obsolete message and error flag out of an Obsolete attribute.
16026 * class.cs (Method.GetMethodFlags): New public method to get the
16027 TypeManager.MethodFlags for this method.
16028 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16030 (Method.Define): Get and apply the Obsolete and Conditional attributes;
16031 if we're overriding a virtual function, set the new private variable
16032 `parent_method'; call the new TypeManager.AddMethod().
16034 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
16035 the MethodBuilder and the Method in a PtrHashtable.
16036 (TypeManager.builder_to_method): Added for this purpose.
16037 (TypeManager.MethodFlags): Added IsObsoleteError.
16038 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
16039 Obsolete and Conditional arguments in MethodBuilders. If we discover
16040 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16041 the message from the attribute.
16043 2002-07-24 Martin Baulig <martin@gnome.org>
16045 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16046 preprocessor directives, ensure that the argument to #define/#undef is
16047 exactly one identifier and that it's actually an identifier.
16049 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16052 2002-07-24 Martin Baulig <martin@gnome.org>
16054 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16055 initialize it to TypeManager.object_type in the constructor.
16056 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16057 of the `hm.get_current' method if we're using the collection pattern.
16058 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16059 for the explicit conversion to make it work when we're using the collection
16060 pattern and the `Current' property has a different return type than `object'.
16063 2002-07-24 Martin Baulig <martin@gnome.org>
16065 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16066 does not match, but don't report any errors. This method is called in
16067 order for all methods in a MethodGroupExpr until a matching method is
16068 found, so we don't want to bail out if the first method doesn't match.
16069 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16070 matches, report the 123. Fixes #28070.
16072 2002-07-24 Martin Baulig <martin@gnome.org>
16074 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16075 TypeManager.TypeToCoreType() to the top of the method so the
16076 following equality checks will work. Fixes #28107.
16078 2002-07-24 Martin Baulig <martin@gnome.org>
16080 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16081 operand is of type uint, and the other operand is of type sbyte,
16082 short or int, the operands are converted to type long." -
16083 Actually do what this comment already told us. Fixes bug #28106,
16086 2002-07-24 Martin Baulig <martin@gnome.org>
16088 * class.cs (MethodBase): New abstract class. This is now a base
16089 class for Property, Indexer and Event to avoid some code duplication
16090 in their Define() and DefineMethods() methods.
16091 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16092 generic methods for Define() and DefineMethods().
16093 (FieldBase): Derive from MemberBase, not MemberCore.
16094 (Property): Derive from MemberBase, not MemberCore.
16095 (Property.DefineMethod): Moved all the code from this method to the
16096 new MethodBase.DefineAccessor(), just call it with appropriate
16098 (Property.Define): Call the new Property.DoDefine(), this does some
16099 sanity checks and we don't need to duplicate the code everywhere.
16100 (Event): Derive from MemberBase, not MemberCore.
16101 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16102 accessors, this will also make them work with interface events.
16103 (Indexer): Derive from MemberBase, not MemberCore.
16104 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16105 (Indexer.Define): Use the new MethodBase functions.
16107 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16108 argument to the constructor.
16109 (Interface.FindMembers): Added support for interface events.
16110 (Interface.PopluateEvent): Implemented.
16112 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
16114 2002-07-22 Miguel de Icaza <miguel@ximian.com>
16116 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16117 but this is required to check for a method name being the same as
16118 the containing class.
16122 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16124 * interface.cs: initialize variable.
16126 2002-07-23 Martin Baulig <martin@gnome.org>
16128 Implemented the IndexerName attribute in interfaces.
16130 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16131 name if this is an explicit interface implementation.
16132 (Indexer.InterfaceIndexerName): New public variable. If we're
16133 implementing an interface indexer, this is the IndexerName in that
16134 interface. Otherwise, it's the IndexerName.
16135 (Indexer.DefineMethod): If we're implementing interface indexer,
16136 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
16137 and Pending.ImplementIndexer methods.
16138 (Indexer.Define): Also define the PropertyBuilder if we're
16139 implementing an interface indexer and this is neither an explicit
16140 interface implementation nor do the IndexerName match the one in
16143 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16144 If a method is defined here, then we always need to create a proxy
16145 for it. This is used when implementing interface indexers.
16146 (Pending.IsInterfaceIndexer): New public method.
16147 (Pending.ImplementIndexer): New public method.
16148 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16149 This is used when implementing interface indexers to define a proxy
16151 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16152 define a proxy if necessary.
16154 * interface.cs (Interface.IndexerName): New public variable.
16155 (Interface.PopulateIndexer): Set the IndexerName.
16156 (Interface.DefineIndexers): New private method. Populate all the
16157 indexers and make sure their IndexerNames match.
16159 * typemanager.cs (IndexerPropertyName): Added support for interface
16162 2002-07-22 Martin Baulig <martin@gnome.org>
16164 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16165 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16166 ret if HasReturnLabel.
16167 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16170 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16171 and set the ec.LoopBeginTryCatchLevel.
16172 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16173 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16174 the current ec.TryCatchLevel, the branch goes out of an exception
16175 block. In this case, we need to use Leave and not Br.
16177 2002-07-22 Martin Baulig <martin@gnome.org>
16179 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16180 block unless the block does not always return or it is contained in
16181 another try { ... } catch { ... } block. Fixes bug #26506.
16182 Added verify-1.cs to the test suite.
16184 2002-07-22 Martin Baulig <martin@gnome.org>
16186 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16187 then we do not always return. Fixes bug #24985.
16189 2002-07-22 Martin Baulig <martin@gnome.org>
16191 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16192 lookup on a per-class level; ie. walk up the class hierarchy until we
16193 found at least one applicable method, then choose the best among them.
16194 Fixes bug #24463 and test-29.cs.
16196 2002-07-22 Martin Baulig <martin@gnome.org>
16198 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16199 return types of the methods. The return type is not part of the
16200 signature and we must not check it to make the `new' modifier work.
16201 Fixes bug #27999, also added test-147.cs.
16202 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16204 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16205 on the method's return type.
16207 2002-07-21 Martin Baulig <martin@gnome.org>
16209 * assign.cs: Make this work if the rightmost source is a constant and
16210 we need to do an implicit type conversion. Also adding a few more tests
16211 to test-38.cs which should have caught this.
16213 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16214 target in the makefile for this. The makefile.gnu is primarily intended
16215 for end-users who don't want to debug the compiler.
16217 2002-07-21 Martin Baulig <martin@gnome.org>
16219 * assign.cs: Improved the Assign class so it can now handle embedded
16220 assignments (X = Y = Z = something). As a side-effect this'll now also
16221 consume less local variables. test-38.cs now passes with MCS, added
16222 a few new test cases to that test.
16224 2002-07-20 Martin Baulig <martin@gnome.org>
16226 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16227 instructions. Fixes bug #27977, also added test-146.cs.
16229 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16231 * cs-tokenizer.cs: fixed getHex ().
16233 2002-07-19 Martin Baulig <martin@gnome.org>
16235 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16236 not Type.GetType() to lookup the array type. This is needed when
16237 we're constructing an array of a user-defined type.
16238 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16239 single-dimensional arrays, but also for single-dimensial arrays of
16242 2002-07-19 Martin Baulig <martin@gnome.org>
16244 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16245 this function is called, it's not allowed to share LocalBuilders
16246 among ILGenerators.
16248 2002-07-19 Martin Baulig <martin@gnome.org>
16250 * expression.cs (Argument.Resolve): Report an error 118 when trying
16251 to pass a type as argument.
16253 2002-07-18 Martin Baulig <martin@gnome.org>
16255 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16256 Conv_R_Un for the signed `long' type.
16258 2002-07-15 Miguel de Icaza <miguel@ximian.com>
16260 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16261 `expr' for the temporary result, as that will fail if we do
16262 multiple resolves on the same expression.
16264 2002-07-05 Miguel de Icaza <miguel@ximian.com>
16266 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16267 ec.TypeContainer for looking up aliases.
16269 * class.cs (TypeContainer): Remove LookupAlias from here.
16271 * decl.cs (DeclSpace); Move here.
16273 2002-07-01 Miguel de Icaza <miguel@ximian.com>
16275 * class.cs (FindMembers): Only call filter if the constructor
16276 bulider is not null.
16278 Also handle delegates in `NestedTypes' now. Now we will perform
16279 type lookups using the standard resolution process. This also
16282 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16283 This uses Expressions (the limited kind that can be parsed by the
16284 tree) instead of strings.
16286 * expression.cs (ComposedCast.ToString): Implement, used to flag
16287 errors since now we have to render expressions.
16289 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
16292 * ecore.cs (SimpleName.ToString): ditto.
16294 * cs-parser.jay: Instead of using strings to assemble types, use
16295 Expressions to assemble the type (using SimpleName, ComposedCast,
16296 MemberAccess). This should fix the type lookups in declarations,
16297 because we were using a different code path for this.
16299 * statement.cs (Block.Resolve): Continue processing statements
16300 even when there is an error.
16302 2002-07-17 Miguel de Icaza <miguel@ximian.com>
16304 * class.cs (Event.Define): Also remove the `remove' method from
16305 the list of pending items.
16307 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16308 generate more compact code.
16310 2002-07-17 Martin Baulig <martin@gnome.org>
16312 * const.cs (Const.LookupConstantValue): Add support for constant
16313 `unchecked' and `checked' expressions.
16314 Also adding test case test-140.cs for this.
16316 2002-07-17 Martin Baulig <martin@gnome.org>
16318 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16319 check whether mi.ReturnType implements the IEnumerator interface; the
16320 `==' and the IsAssignableFrom() will fail in this situation.
16322 2002-07-16 Ravi Pratap <ravi@ximian.com>
16324 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
16327 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16329 * expression.cs: fixed bug #27811.
16331 2002-07-14 Miguel de Icaza <miguel@ximian.com>
16333 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16334 Molaro: when we are a ref, the value already contains a pointer
16335 value, do not take the address of it.
16337 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16338 * removed mb-parser.jay and mb-tokenizer.cs
16340 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16342 * expression.cs: check against the building corlib void type.
16344 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16346 * ecore.cs: fix for valuetype static readonly fields: when
16347 initializing them, we need their address, not the address of a copy.
16349 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16351 * typemanager.cs: register also enum_type in corlib.
16353 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16355 * class.cs: allow calling this (but not base) initializers in structs.
16357 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16359 * ecore.cs: make sure we compare against the building base types
16362 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16364 * typemanager.cs: fix TypeToCoreType() to handle void and object
16365 (corlib gets no more typerefs after this change).
16367 2002-07-12 Miguel de Icaza <miguel@ximian.com>
16369 * expression.cs (ArrayCreation.EmitArrayArguments): use
16370 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16372 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16373 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
16374 array indexes, the runtime actually forbids them.
16376 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16377 for array arguments here.
16379 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16380 instead of the default for ValueTypes.
16382 (New.DoEmit): Use IsValueType instead of
16383 IsSubclassOf (value_type)
16384 (New.DoResolve): ditto.
16385 (Invocation.EmitCall): ditto.
16387 * assign.cs (Assign): ditto.
16389 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16390 Statements *are* currently doing part of their resolution during
16393 Expressions do always resolve during resolve, but statements are
16394 only required to propagate resolution to their children.
16396 2002-07-11 Miguel de Icaza <miguel@ximian.com>
16398 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16400 (LoadAssembly): Do not add the dll if it is already specified
16402 (MainDriver): Add the System directory to the link path at the end,
16403 after all the other -L arguments.
16405 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16406 wrong opcode for loading bytes and bools (ldelem.i1 instead of
16407 ldelem.u1) and using the opposite for sbytes.
16409 This fixes Digger, and we can finally run it.
16411 * driver.cs (UnixParseOption): Move the option parsing here.
16412 (CSCParseOption): Implement CSC-like parsing of options.
16414 We now support both modes of operation, the old Unix way, and the
16415 new CSC-like way. This should help those who wanted to make cross
16416 platform makefiles.
16418 The only thing broken is that /r:, /reference: and /lib: are not
16419 implemented, because I want to make those have the same semantics
16420 as the CSC compiler has, and kill once and for all the confussion
16421 around this. Will be doing this tomorrow.
16423 * statement.cs (Unsafe.Resolve): The state is checked during
16424 resolve, not emit, so we have to set the flags for IsUnsfe here.
16426 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16428 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16429 not catch the Error_ObjectRefRequired in SimpleName (as it is
16430 possible to have a class/instance variable name that later gets
16431 deambiguated), we have to check this here.
16433 2002-07-10 Ravi Pratap <ravi@ximian.com>
16435 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16436 make static and put into Expression.
16438 (Event.Define): Register the private field of the event with the
16439 TypeManager so that GetFieldFromEvent can get at it.
16441 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16442 keep track of the private field associated with an event which
16445 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16448 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16450 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16452 * expression.cs (Binary.EmitBranchable): this routine emits the
16453 Binary expression in a branchable context. This basically means:
16454 we need to branch somewhere, not just get the value on the stack.
16456 This works together with Statement.EmitBoolExpression.
16458 * statement.cs (Statement.EmitBoolExpression): Use
16461 2002-07-09 Miguel de Icaza <miguel@ximian.com>
16463 * statement.cs (For): Reduce the number of jumps in loops.
16465 (For): Implement loop inversion for the For statement.
16467 (Break): We can be breaking out of a Try/Catch controlled section
16468 (foreach might have an implicit try/catch clause), so we need to
16469 use Leave instead of Br.
16471 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16472 now). If the instace expression supports IMemoryLocation, we use
16473 the AddressOf method from the IMemoryLocation to extract the
16474 address instead of emitting the instance.
16476 This showed up with `This', as we were emitting the instance
16477 always (Emit) instead of the Address of This. Particularly
16478 interesting when This is a value type, as we dont want the Emit
16479 effect (which was to load the object).
16481 2002-07-08 Miguel de Icaza <miguel@ximian.com>
16483 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16485 * statement.cs (Checked): Set the CheckedState during the resolve
16486 process too, as the ConvCast operations track the checked state on
16487 the resolve process, and not emit.
16489 * cs-parser.jay (namespace_member_declaration): Flag that we have
16490 found a declaration when we do. This is used to flag error 1529
16492 * driver.cs: Report ok when we display the help only.
16494 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
16496 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16498 2002-07-04 Miguel de Icaza <miguel@ximian.com>
16500 * cs-tokenizer.cs (define): We also have to track locally the
16501 defines. AllDefines is just used for the Conditional Attribute,
16502 but we also need the local defines for the current source code.
16504 2002-07-03 Miguel de Icaza <miguel@ximian.com>
16506 * statement.cs (While, For, Do): These loops can exit through a
16507 Break statement, use this information to tell whether the
16508 statement is the last piece of code.
16510 (Break): Flag that we break.
16512 * codegen.cs (EmitContexts): New `Breaks' state variable.
16514 2002-07-03 Martin Baulig <martin@gnome.org>
16516 * class.cs (TypeContainer.MethodModifiersValid): Allow override
16517 modifiers in method declarations in structs. Otherwise, you won't
16518 be able to override things like Object.Equals().
16520 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16522 * class.cs (Method, Property, Indexer): Do not allow the public
16523 modifier to be used in explicit interface implementations.
16525 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16526 override modifiers in method declarations in structs
16528 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16530 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16531 integer or real overflow, report an error
16533 2002-07-02 Martin Baulig <martin@gnome.org>
16535 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16536 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16537 to tell the runtime about our newly created System.Object and
16538 System.ValueType types.
16540 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16542 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16543 struct instead of Ldarg/Starg.
16545 2002-07-02 Martin Baulig <martin@gnome.org>
16547 * expression.cs (Indirection.Indirection): Call
16548 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16550 2002-07-02 Martin Baulig <martin@gnome.org>
16552 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16553 ValueType, call TypeManager.TypeToCoreType() on it.
16554 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16555 the OpCodes.Newarr argument.
16557 2002-07-02 Martin Baulig <martin@gnome.org>
16559 * expression.cs (Invocation.EmitCall): When compiling corlib,
16560 replace all calls to the system's System.Array type to calls to
16561 the newly created one.
16563 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16564 System.Array methods.
16565 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16566 from the system's System.Array type which must be replaced.
16568 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16570 * typemanager.cs: load unverifiable_code_ctor so we can build
16571 corlib using the correct type. Avoid using GetTypeCode() with
16573 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16574 TypeManager.object_type to allow building corlib.
16576 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16578 * ecore.cs: handle System.Enum separately in LoadFromPtr().
16580 2002-07-01 Martin Baulig <martin@gnome.org>
16582 * class.cs: Make the last change actually work, we need to check
16583 whether `ifaces != null' to avoid a crash.
16585 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16587 * class.cs: when we build structs without fields that implement
16588 interfaces, we need to add the interfaces separately, since there is
16589 no API to both set the size and add the interfaces at type creation
16592 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16594 * expression.cs: the dimension arguments to the array constructors
16595 need to be converted if they are a long.
16597 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16599 * class.cs: don't emit ldarg.0 if there is no parent constructor
16600 (fixes showstopper for corlib).
16602 2002-06-29 Martin Baulig <martin@gnome.org>
16604 MCS now compiles corlib on GNU/Linux :-)
16606 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16607 ie. check for MethodImplOptions.InternalCall.
16609 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16610 and TypeManager.attribute_type are null, so we must explicitly check
16611 whether parent is not null to find out whether it's an attribute type.
16612 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16613 and SetBuilder, not only if the property is neither abstract nor external.
16614 This is necessary to set the MethodImplOptions on the accessor methods.
16615 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16616 SetBuilder, see Property.Emit().
16618 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16619 populate "System.Object", "System.ValueType" and "System.Attribute" since
16620 they've already been populated from BootCorlib_PopulateCoreTypes().
16622 2002-06-29 Martin Baulig <martin@gnome.org>
16624 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16625 is the NullLiteral, we also need to make sure that target_type is not
16628 2002-06-29 Martin Baulig <martin@gnome.org>
16630 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16631 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16632 before calling BootstrapCorlib_ResolveDelegate ().
16634 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16636 * statement.cs: fixed build-breaker. All tests passed ok.
16638 2002-06-27 Martin Baulig <martin@gnome.org>
16640 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16641 for System.Decimal when compiling corlib.
16643 2002-06-27 Martin Baulig <martin@gnome.org>
16645 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16646 switch blocks which contain nothing but a default clause.
16648 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16650 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16652 2002-06-27 Martin Baulig <martin@gnome.org>
16654 * ecore.cs (PropertyExpr.PropertyExpr): Call
16655 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16657 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16658 is already a TypeBuilder.
16660 2002-06-27 Martin Baulig <martin@gnome.org>
16662 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16663 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16664 the "from an array-type to System.Array" case. This makes it work
16665 when compiling corlib.
16667 2002-06-27 Martin Baulig <martin@gnome.org>
16669 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16670 non-static PropertyExpr, set its InstanceExpression. This makes
16671 the `ICollection.Count' property work in System/Array.cs.
16673 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16675 * driver.cs: Made error handling more consistent. Errors now
16676 tracked by Report class, so many methods which used to return int
16677 now return void. Main() now prints success/failure and
16678 errors/warnings message.
16680 Renamed '--probe' compiler argument to '--expect-error'. Removed
16681 the magic number return values (123 and 124). Now, if the
16682 expected error occurs, the compiler exits with success (exit value
16683 0). If the compilation completes without seeing that particular
16684 error, the compiler exits with failure (exit value 1). The
16685 makefile in mcs/errors has been changed to handle the new behaviour.
16687 * report.cs: Made 'expected error' number a property and renamed
16688 it from 'Probe' to 'ExpectedError'.
16690 * genericparser.cs: Removed error handling support, since it is
16691 now all done by Report class.
16693 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16694 class, so parse() no longer returns an int.
16696 * namespace.cs: Use Report.Error instead of GenericParser.error
16698 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16700 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16701 TypeContainer.AddOperator): At the front of the list put the
16702 explicit implementations, so they get resolved/defined first.
16704 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16706 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16707 interface type is implemented by this TypeContainer. Used during
16708 explicit interface implementation.
16710 (Property.Define, Indexer.Define, Method.Define): Validate that
16711 the given interface in the explicit implementation is one of the
16712 base classes for the containing type.
16714 Also if we are explicitly implementing an interface, but there is
16715 no match in the pending implementation table, report an error.
16717 (Property.Define): Only define the property if we are
16718 not explicitly implementing a property from an interface. Use the
16719 correct name also for those properties (the same CSC uses,
16720 although that is really not needed).
16722 (Property.Emit): Do not emit attributes for explicitly implemented
16723 properties, as there is no TypeBuilder.
16725 (Indexer.Emit): ditto.
16727 Hiding then means that we do not really *implement* a pending
16728 implementation, which makes code fail.
16730 2002-06-22 Martin Baulig <martin@gnome.org>
16732 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16733 the return value of Object.GetType(). [FIXME: we need to do this whenever
16734 we get a type back from the reflection library].
16736 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16738 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16740 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16742 * attribute.cs: Return null if we can not look up the type.
16744 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16745 the interface types found.
16747 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16748 interface types found.
16750 * typemanager.cs (GetInterfaces): Make this routine returns alll
16751 the interfaces and work around the lame differences between
16752 System.Type and System.Reflection.Emit.TypeBuilder in the results
16753 result for GetInterfaces.
16755 (ExpandInterfaces): Given an array of interface types, expand and
16756 eliminate repeated ocurrences of an interface. This expands in
16757 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16760 2002-06-21 Martin Baulig <martin@gnome.org>
16762 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16765 2002-06-21 Martin Baulig <martin@gnome.org>
16767 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16768 and called with one of the core types, return the corresponding typebuilder for
16771 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16774 2002-06-21 Martin Baulig <martin@gnome.org>
16776 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16777 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16778 (Expression.ConvertReferenceExplicit): Likewise.
16780 * expression.cs (ElementAccess.DoResolve): Likewise.
16781 (ElementAccess.DoResolveLValue): Likewise.
16783 2002-06-10 Martin Baulig <martin@gnome.org>
16785 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16786 add the "value" parameter to the parameter list.
16788 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16791 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16793 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16794 the argument to an int, uint, long or ulong, per the spec. Also
16795 catch negative constants in array creation.
16797 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16799 * class.cs: do not allow the same interface to appear twice in
16800 the definition list.
16802 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16804 * ecore.cs: don't use ldlen with System.Array.
16806 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16808 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16810 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16812 * modifiers.cs: produce correct field attributes for protected
16813 internal. Easy fix so miguel can work on ther harder stuff:-)
16815 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16817 * pending.cs: New file. Move the code from class.cs here.
16818 Support clearning the pending flag for all methods (when not doing
16819 explicit interface implementation).
16821 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16823 * rootcontext.cs: added a couple more types needed to bootstrap.
16825 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16827 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16828 constructor in the type, instead of any constructor in the type
16829 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16830 a bug in the Mono runtime when applying the params attribute).
16832 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16833 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16835 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16837 * expression.cs (Unary.ResolveOperator): Use TypeManager
16838 to resolve the type.
16840 2002-06-13 Ravi Pratap <ravi@ximian.com>
16842 * cs-parser.jay (enum_member_declaration): Pass in the attributes
16845 * enum.cs (AddEnumMember): Add support to store the attributes associated
16846 with each member too.
16848 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16849 field builders too - this takes care of the enum member case.
16851 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
16853 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16854 address-of operator on both value types and pointers.
16856 2002-06-10 Martin Baulig <martin@gnome.org>
16858 * interface.cs (Interface.PopulateIndexer): Add the indexer's
16859 PropertyBuilder to the `property_builders' list.
16861 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16862 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16863 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
16864 find any indexers which are inherited from an interface.
16866 2002-06-09 Martin Baulig <martin@gnome.org>
16868 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16869 the same type as the constant if necessary. There's also a test-130.cs
16872 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16874 * typemanager.cs (TypeManager.ChangeType): Previously known as
16875 Enum.ChangeEnumType().
16877 2002-06-09 Martin Baulig <martin@gnome.org>
16879 * expression.cs (Cast.TryReduce): Added support for consts.
16881 2002-06-08 Ravi Pratap <ravi@ximian.com>
16883 * class.cs (Accessor): Hold attributes information so we can pass
16886 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16887 Modify to pass in attributes attached to the methods.
16889 (add_accessor_declaration, remove_accessor_declaration): Ditto.
16891 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16892 to handle the Accessor kind :-)
16894 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16896 2002-06-08 Martin Baulig <martin@gnome.org>
16898 * expression.cs (Unary.TryReduceNegative): Added support for
16901 2002-06-08 Martin Baulig <martin@gnome.org>
16903 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16904 name can't be found in the `defined_names' - the caller will do a
16905 MemberLookup in this case and thus find methods in System.Enum
16906 such as Enum.IsDefined().
16908 2002-06-08 Martin Baulig <martin@gnome.org>
16910 * enum.cs (Enum.ChangeEnumType): This is a custom version of
16911 Convert.ChangeType() which works with TypeBuilder created types.
16912 (Enum.LookupEnumValue, Enum.Define): Use it here.
16914 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16915 `TypeBuilder.BaseType != null' check.
16916 (TypeContainer.FindMembers): Only lookup parent members if we
16917 actually have a parent.
16918 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16919 (ConstructorInitializer.Resolve): Likewise.
16921 * interface.cs (Interface.FindMembers): Added
16922 `TypeBuilder.BaseType != null' check.
16924 * rootcontext.cs (RootContext.ResolveCore): Added
16925 "System.Runtime.CompilerServices.IndexerNameAttribute" to
16926 classes_second_stage.
16928 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16929 debug_type and trace_type when compiling with --nostdlib.
16931 2002-06-07 Martin Baulig <martin@gnome.org>
16933 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16934 (AddField): Set it to true when adding a non-static field.
16935 (DefineType): Use `have_nonstatic_fields' to find out whether we
16936 have non-static fields, not `Fields != null'.
16938 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16940 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16941 dereferencing a null on the static-field code path)
16943 2002-05-30 Martin Baulig <martin@gnome.org>
16945 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16946 to take command line arguments. Use reflection to call the new
16947 custom `Initialize' function on the symbol writer and pass it the
16948 command line arguments.
16950 * driver.cs (--debug-args): New command line argument to pass command
16951 line arguments to the symbol writer.
16953 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16955 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16956 the target type for indexers and properties. Thanks to Joe for
16959 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16961 * typemanager.cs (MethodFlags): returns the method flags
16962 (Obsolete/ShouldIgnore) that control warning emission and whether
16963 the invocation should be made, or ignored.
16965 * expression.cs (Invocation.Emit): Remove previous hack, we should
16966 not do this on matching a base type, we should do this based on an attribute
16968 Only emit calls to System.Diagnostics.Debug and
16969 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16970 on the command line.
16972 * rootcontext.cs: Global settings for tracing and debugging.
16974 * cs-tokenizer.cs (define): New utility function to track
16975 defines. Set the global settings for TRACE and DEBUG if found.
16977 2002-05-25 Ravi Pratap <ravi@ximian.com>
16979 * interface.cs (Populate*): Pass in the TypeContainer as well as
16980 the DeclSpace as parameters so that we can create EmitContexts and
16981 then use that to apply attributes etc.
16983 (PopulateMethod, PopulateEvent, PopulateProperty)
16984 (PopulateIndexer): Apply attributes everywhere.
16986 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16989 (ApplyAttributes): Update accordingly.
16991 We now apply interface attributes for all members too.
16993 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16995 * class.cs (Indexer.Define); Correctly check if we are explicit
16996 implementation (instead of checking the Name for a ".", we
16997 directly look up if the InterfaceType was specified).
16999 Delay the creation of the PropertyBuilder.
17001 Only create the PropertyBuilder if we are not an explicit
17002 interface implementation. This means that explicit interface
17003 implementation members do not participate in regular function
17004 lookups, and hence fixes another major ambiguity problem in
17005 overload resolution (that was the visible effect).
17007 (DefineMethod): Return whether we are doing an interface
17010 * typemanager.cs: Temporary hack until we get attributes in
17011 interfaces (Ravi is working on that) and we get IndexerName
17012 support in interfaces.
17014 * interface.cs: Register the indexers as properties.
17016 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17017 warning, I have verified that this is a bug in the .NET runtime
17018 (JavaScript suffers of the same problem).
17020 * typemanager.cs (MemberLookup): When looking up members for
17021 interfaces, the parent of an interface is the implicit
17022 System.Object (so we succeed in searches of Object methods in an
17023 interface method invocation. Example: IEnumerable x; x.ToString
17026 2002-05-25 Miguel de Icaza <miguel@ximian.com>
17028 * class.cs (Event): Events should also register if they do
17029 implement the methods that an interface requires.
17031 * typemanager.cs (MemberLookup); use the new GetInterfaces
17034 (GetInterfaces): The code used to lookup interfaces for a type is
17035 used in more than one place, factor it here.
17037 * driver.cs: Track the errors at the bottom of the file, we kept
17040 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17041 instance if the method we are calling is static!
17043 2002-05-24 Miguel de Icaza <miguel@ximian.com>
17045 * attribute.cs (ApplyAttributes): Make this function filter out
17046 the IndexerName attribute (as that attribute in reality is never
17047 applied) and return the string constant for the IndexerName
17050 * class.cs (TypeContainer.Emit): Validate that all the indexers
17051 have the same IndexerName attribute, and if so, set the
17052 DefaultName attribute on the class.
17054 * typemanager.cs: The return value might contain other stuff (not
17055 only methods). For instance, consider a method with an "Item"
17056 property and an Item method.
17058 * class.cs: If there is a problem with the parameter types,
17061 2002-05-24 Ravi Pratap <ravi@ximian.com>
17063 * ecore.cs (ImplicitConversionExists): Wrapper function which also
17064 looks at user defined conversion after making a call to
17065 StandardConversionExists - we need this for overload resolution.
17067 * expression.cs : Update accordingly the various method calls.
17069 This fixes 2 bugs filed against implicit user defined conversions
17071 2002-05-22 Miguel de Icaza <miguel@ximian.com>
17073 * statement.cs: Track the result of the assignment.
17075 2002-05-21 Miguel de Icaza <miguel@ximian.com>
17077 * expression.cs (MemberAccess): Improved error reporting for
17078 inaccessible members.
17080 2002-05-22 Martin Baulig <martin@gnome.org>
17082 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
17083 itself with debugging support.
17085 2002-05-22 Martin Baulig <martin@gnome.org>
17087 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17088 Removed, this isn't needed anymore.
17090 2002-05-20 Martin Baulig <martin@gnome.org>
17092 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17093 be underlying type for an enum.
17095 2002-05-20 Miguel de Icaza <miguel@ximian.com>
17097 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17098 that splits out the loading of just the core types.
17100 * rootcontext.cs (ResolveCore): Split the struct resolution in
17101 two, so we can load the enumeration underlying types before any
17104 * expression.cs (Is): Bandaid until we fix properly Switch (see
17105 bug #24985 for details).
17107 * typemanager.cs (ImplementsInterface): The hashtable will contain
17108 a null if there are no interfaces implemented.
17110 2002-05-18 Miguel de Icaza <miguel@ximian.com>
17112 * cs-parser.jay (indexer_declarator): It is fine to have array
17115 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17117 * typemanager.cs: (RegisterBuilder): New function used to register
17118 TypeBuilders that implement interfaces. Since
17119 TypeBuilder.GetInterfaces (as usual) does not work with lame
17121 (AddUserType): register interfaces.
17123 (ImplementsInterface): Use the builder_to_ifaces hash if we are
17124 dealing with TypeBuilder. Also, arrays are showing up as
17125 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17126 methods can not be invoked on them!
17128 * ecore.cs (ExplicitReferenceConversionExists): Made public.
17129 (ImplicitReferenceConversionExists): Split out from
17130 StandardConversionExists.
17132 * expression.cs (As): We were only implementing one of the three
17133 cases for the as operator. We now implement them all.
17134 (Is): Implement the various other cases for Is as well.
17136 * typemanager.cs (CACHE): New define used to control if we want or
17137 not the FindMembers cache. Seems to have a negative impact on
17138 performance currently
17140 (MemberLookup): Nested types have full acess to
17141 enclosing type members
17143 Remove code that coped with instance/static returns for events, we
17144 now catch this in RealFindMembers.
17146 (RealFindMembers): only perform static lookup if the instance
17147 lookup did not return a type or an event.
17149 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17151 * assign.cs (CompoundAssign): We pass more semantic information
17152 now to Compound Assignments than we did before: now we have all
17153 the information at hand, and now we resolve the target *before* we
17154 do the expression expansion, which allows the "CacheValue" method
17155 to have the effect we intended (before, a [x] += 1 would generate
17156 two differen ArrayAccess expressions from the ElementAccess,
17157 during the resolution process).
17159 (CompoundAssign.DoResolve): Resolve target and original_source here.
17161 2002-05-16 Miguel de Icaza <miguel@ximian.com>
17163 * expression.cs (ArrayAccess): dropped debugging information.
17165 * typemanager.cs: Small bug fix: I was always returning i_members,
17166 instead of one of i_members or s_members (depending on which had
17169 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
17170 method is invoked before any code generation takes place, and it
17171 is a mechanism to inform that the expression will be invoked more
17172 than once, and that the method should use temporary values to
17173 avoid having side effects
17175 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17177 * ecore.cs (Expression.CacheTemporaries): Provide empty default
17180 * expression.cs (Indirection, ArrayAccess): Add support for
17181 CacheTemporaries in these two bad boys.
17183 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17184 ldobj or ldind_ref.
17185 (StoreFromPtr): Handle stobj as well.
17187 * expression.cs (UnaryMutator): Share more code.
17189 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17190 down: I was not tracking the Filter function as well, which
17191 was affecting the results of the cache.
17193 2002-05-15 Miguel de Icaza <miguel@ximian.com>
17195 * attribute.cs: Remove the hack to handle the CharSet property on
17198 2002-05-14 Miguel de Icaza <miguel@ximian.com>
17200 * attribute.cs (DoResolve): More uglyness, we now only try to
17201 resolve the attribute partially, to extract the CharSet
17202 information (only if we are a StructLayout attribute). Otherwise
17204 (GetExtraTypeInfo): Add some code to conditionally kill in the
17205 future this. I am more and more convinced that the .NET
17206 framework has special code to handle the attribute setting on
17209 * expression.cs (IsParamsMethodApplicable): Revert my previous
17210 foreach change here, it was wrong.
17212 2002-05-13 Miguel de Icaza <miguel@ximian.com>
17214 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17215 (pp_expr): do not abort on unknown input, just return.
17216 (eval): abort if there are pending chars.
17218 * attribute.cs (Attribute.Resolve): Positional parameters are
17219 optional. Deal with that case.
17221 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17222 the Ansi/Unicode/Auto information for the type.
17224 (TypeContainer.DefineType): instantiate the EmitContext here, as
17225 we will be using it during the type definition (to resolve
17226 attributes) and during the emit phase.
17228 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17229 to pull type information out of the attributes
17231 (Attribute.Resolve): track the constructor builder, and allow for
17232 multiple invocations (structs and classes will use this).
17234 * ecore.cs (MemberLookupFinal): new version with all the
17235 parameters customizable.
17237 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17238 constructors. Return if the result value is null (as the error
17239 would have been flagged already by MemberLookupFinal)
17241 Do not allow instances of abstract classes or interfaces to be
17244 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17245 We have to compare the assembly property here when dealing with
17246 FamANDAssem and Assembly access modifiers, because we might be
17247 creating an assembly from *modules* (that means that we are not
17248 getting TypeBuilders for types defined in other modules that are
17249 part of this assembly).
17251 (Method.Emit): If the method is marked abstract and has a body,
17254 (TypeContainer.DefineMembers): If both the defined member and the
17255 parent name match are methods, then do not emit any warnings: let
17256 the Method.Define routine take care of flagging warnings. But if
17257 there is a mismatch (method overrides something else, or method is
17258 overriwritten by something, then emit warning).
17260 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17261 set to null, this means `do not check for the return type on the
17264 (Method.Define): set the return type for the method signature to
17265 null, so that we get methods with the same name and parameters and
17266 different return types. This is used to flag warning 114 (you are
17267 hiding a method, and you probably want to use the new/override
17270 * typemanager.cs (MemberLookup): Implemented proper access
17271 control, closing a long standing set of bug reports. The problem
17272 was that the Framework only has two bits: Public and NonPublic,
17273 and NonPublic includes private and protected methods, but we need
17274 to enforce the FamANDAssem, FamOrAssem and Family.
17276 2002-05-11 Miguel de Icaza <miguel@ximian.com>
17278 * statement.cs (GotoCase): Return true: Ammounts to giving up
17279 knowledge on whether we return or not, and letting the other case
17280 be responsible for it.
17282 2002-05-10 Miguel de Icaza <miguel@ximian.com>
17284 * driver.cs: Do not load directories for each file processed, only
17285 do it if there is a pattern.
17287 * ecore.cs: Report readonly assigns here as well, as we might have
17288 been resolved only by MemberAccess.
17290 (SimpleName.SimpleNameResolve): Also be useful for LValue
17291 resolution. We need this to propagate assign to local readonly variables
17293 * typemanager.cs: Use a ptrhashtable for the criteria, because we
17294 do not want to reuse potential criteria memory.
17296 * class.cs (MyEventBuilder): Set reflected_type;
17298 * ecore.cs (Constantify): Added support for constifying bools.
17300 (RootContext.LookupType): Added a cache for values looked up in
17301 the declaration space.
17303 * typemanager.cs (FindMembers): Now is a front-end to
17304 RealFindMembers, and provides a two-level hashtable-based cache to
17307 15% performance improvement: from 22.5 to 19.2 seconds.
17309 * expression.cs (IsParamsMethodApplicable): use foreach.
17310 (Invocation.DoResolve): ditto.
17311 (New.DoResolve): ditto.
17312 (ArrayCreation.DoResolve): ditto.
17314 * ecore.cs (FindMostEncompassingType): use foreach.
17316 * delegate.cs (NewDelegate.DoResolve): Use foreach
17318 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17319 (RemoveMethods): use foreach.
17321 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17322 nested foreach statements instead of for, and also break out of
17323 the inner loop once a match is found.
17325 (Invocation.OverloadResolve): Use foreach, simplify the code.
17327 2002-05-08 Miguel de Icaza <miguel@ximian.com>
17329 * cfold.cs (BinaryFold): During an enumeration evaluation context,
17330 we actually unwrap the expression to allow for extra information
17333 * expression.cs: Use Shr_Un on unsigned operations.
17335 2002-05-08 Ravi Pratap <ravi@ximian.com>
17337 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
17338 applicable operators was not being considered correctly. This closes
17339 the bug Miguel reported.
17341 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17343 * attribute.cs: check that the type derives from System.Attribute
17344 and report the correct error in that case (moved the duplicate code to
17345 its own method, too).
17347 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17349 * attribute.cs: lookup attribute type name as the spec says: first the
17350 bare attribute name and then name + "Attribute" (nant compiles with
17351 mcs after this fix).
17353 2002-05-07 Miguel de Icaza <miguel@ximian.com>
17355 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
17356 Because of the way we parse things, we should try to see if a
17357 UIntConstant can fit in an integer.
17359 2002-05-07 Ravi Pratap <ravi@ximian.com>
17361 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17362 when we are in an explicit context.
17364 (ConvertReferenceExplicit): When converting from Iface type S to Class
17365 T make sure the rules are implemented as an OR.
17367 * parameter.cs (ParameterType): Make it a property for now although the
17368 purpose really isn't anything immediate.
17370 * expression.cs (Is*Applicable): Do better checking on the parameter type
17371 of a ref/out parameter. The ones from the system assemblies are already
17372 marked with the correct type so we don't need to do any correction.
17374 * ecore.cs (StandardConversionExists): Conversion from Interface types to
17375 the object type is standard too so include that.
17377 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17379 * ecore.cs (StandardConversionExists): Augment with missing code:
17380 deal with IntConstant, LongConstants and Enumerations.
17382 * assign.cs: Report the error, instead of failing silently
17384 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17385 typecontainer that they are declared, because the
17386 typecontainer/namespace will have the list of using clauses that
17387 need to be applied.
17389 Assembly Attributes were escaping the normal registration
17392 (EmitCode): Apply attributes within an EmitContext that represents
17393 the container they were declared on.
17395 * cs-parser.jay: Track bases for structs. How did I get this wrong?
17397 2002-05-06 Ravi Pratap <ravi@ximian.com>
17399 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17400 Revamp completely - make much cleaner as we now operate only
17403 (FindMostSpecificSource, FindMostSpecificTarget): New methods
17404 to implement the logic detailed in the spec more correctly.
17406 (UserDefinedConversion): Update accordingly.
17408 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17410 * statement.cs: Return flow analysis information up.
17412 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17415 (token): Do not consume an extra character before calling
17418 2002-05-06 Piers Haken <piersh@friskit.com>
17420 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17422 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17424 * class.cs (Constructor.Emit): Set the IsStatic flag in the
17425 EmitContext during the instance constructor initializer
17426 resolution, to stop access to instance variables.
17428 This is mandated by the spec, last paragraph of the `constructor
17429 initializers' section.
17431 2002-05-05 Miguel de Icaza <miguel@ximian.com>
17433 * cs-parser.jay, class.cs (Accessor): new class used to represent
17434 an accessor (get or set). In the past we used `null' to represent
17435 a missing accessor. But this is ambiguous because there was no
17436 way to tell in abstract indexers/properties if one of them was
17439 Now there is a way of addressing that.
17441 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17442 instead of FindMembers.
17444 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17445 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17447 * attribute.cs: Treat indexers and properties as the same in terms
17448 of applying attributes
17450 * ecore.cs (FindMostEncompassedType): Use statically initialized
17451 EmptyExpressions()s like we do elsewhere to avoid creating useless
17452 objects (and we take this out of the tight loop).
17454 (GetConversionOperators): Move the code to extract the actual
17455 operators to a separate routine to clean things up.
17457 2002-05-04 Miguel de Icaza <miguel@ximian.com>
17459 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17460 events are always registered FieldBuilders.
17462 * class.cs (FieldBase): New class shared by Fields
17464 * delegate.cs: If we are a toplevel delegate, use our full name.
17465 If we are a nested delegate, then only use our tail name.
17467 2002-05-02 Ravi Pratap <ravi@ximian.com>
17469 * expression.cs (IsApplicable): Ensure that we add the "&" to
17470 ref/out types before comparing it with the type of the argument.
17472 (IsParamsMethodApplicable): Ditto.
17474 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
17477 * delegate.cs : Handle the case when we have more than one applicable
17478 method. Flag an error only when we finish checking all.
17480 2002-05-02 Miguel de Icaza <miguel@ximian.com>
17482 * expression.cs: Add support for boolean static initializers.
17484 2002-05-01 Miguel de Icaza <miguel@ximian.com>
17486 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17488 * parameter.cs (ComputeParameterTypes,
17489 ComputeAndDefineParameterTypes): Better error handling: now we
17490 clear the `types' cache if we fail during any of the type lookups.
17491 We also return the status code correctly to our caller
17493 * delegate.cs: If we fail to define a delegate, abort the extra
17496 * expression.cs (Binary.ResolveOperator): for
17497 operator==(object,object) and operator !=(object, object) we also
17498 have to verify that there is an implicit conversion from one to
17501 (ArrayAccess.DoResolve): Array Access can operate on
17504 2002-04-30 Miguel de Icaza <miguel@ximian.com>
17506 * assign.cs (CompoundAssign): A new class used as a "flag" that
17507 the assignment actually is happening as part of a compound
17508 assignment operator.
17510 During compound assignment, a few new rules exist to enable things
17517 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17518 to the type of x) if y is implicitly convertible to the type of x,
17519 and the operator is a builtin operator and the return type of the
17520 operator is explicitly convertible to the type of x.
17522 * rootcontext.cs: Reset warning level to 2. 4 catches various
17523 "interesting" features in mcs, we must clean this up at some
17524 point, but currently am trying to kill other bugs ;-)
17526 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17527 in container classes as well.
17529 * expression.cs (Binary.ResolveOperator): Handle string case
17530 before anything else (as operator overloading does emit an error
17531 before doing anything else).
17533 This code could go away when we move to a table driven model, but
17534 i could not come up with a good plan last night.
17536 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17538 * typemanager.cs (CSharpName): reimplementation using regex.
17539 * class.cs: added null check for fields in Emit
17540 * rootcontext.cs: set warninglevel to 4
17542 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17544 * typemanager.cs (CSharpName): reimplemented with Lupus
17547 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17549 * statement.cs (If): correclty implement Resolve, because we were
17550 not catching sem errors in there. The same process is needed
17552 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17555 (Statement.Warning_DeadCodeFound): Factorize code.
17556 (While): Report dead code here too.
17558 (Statement): Added Resolve virtual method to allow
17559 for resolution split from the emit code.
17561 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17563 * statement.cs (EmitBoolExpression): No longer try to resolve the
17565 (MakeBoolean): New utility function that resolve, implicitly
17566 converts to boolean and tags the expression.
17569 (If, Do): Implement dead code elimination.
17570 (While): Implement loop inversion
17572 (Do, While, For, If): Resolve the expression prior to calling our
17575 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
17578 - added method Report28 (warning: program has more than one entry point)
17579 - added method IsEntryPoint, implements paragraph 10.1 of the spec
17580 - modified method Method.Define, the part at the end of the method
17582 * rootcontext.cs: added static public Location EntryPointLocation;
17584 * ../errors/cs0028.cs : Add test case for the above warning.
17587 - modified method CSharpName to allow arrays of primitive type to
17588 be printed nicely (e.g. instead of System.Int32[][] it now prints
17590 - added method CSharpSignature: returns the signature of a method
17591 in string format to be used in reporting errors, warnings, etc.
17593 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17596 2002-04-26 Ravi Pratap <ravi@ximian.com>
17598 * delegate.cs (Define): Fix extremely silly bug where I was
17599 setting the type of the 'object' parameter of the BeginInvoke
17600 method to System.IAsyncResult instead of System.Object ;-)
17602 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17604 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17607 (Constructor.Emit): return if we fail to initialize the
17608 constructor. Another door closed!
17610 * expression.cs (New.DoResolve): Improve error message (from -6 to
17611 1501). Use DeclaredOnly lookup to find the exact constructor.
17613 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17614 loop. This is useful.
17616 * cs-parser.jay: Adjust the default parameters so that destructors
17617 have the proper signature.
17619 2002-04-26 Martin Baulig <martin@gnome.org>
17621 * driver.cs (LoadAssembly): If `assembly' contains any characters
17622 which are only valid in path names and not in assembly names
17623 (currently slash, backslash and point), use Assembly.LoadFrom ()
17624 instead of Assembly.Load () on the `assembly' (before iteration
17625 over the link_paths).
17627 2002-04-26 Martin Baulig <martin@gnome.org>
17629 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17631 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17633 * class.cs (Property): use the new typemanager.MemberLookup
17635 (TypeContainer.MemberLookup): Implement using the
17636 TypeManager.MemberLookup now.
17638 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17639 and return MemberInfos, so that these can be used without an
17640 EmitContext (what we had before).
17642 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17644 * expression.cs: Fix the case where the argument to params if the
17645 type of the params. I omitted handling this before. Fixed
17647 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17649 * driver.cs: Call BootCorlib_PopulateCoreType
17651 * class.cs (Property.CheckBase): Check for properties only, not
17654 * interface.cs: Temporary hack: try/catch around the
17655 CustomAttributeBuilder, because I am getting an exception that I
17658 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17659 types whose definitions are required to be there (attributes are
17660 defined before standard types).
17662 Compute definitions as we boot the various types, as they are used
17663 immediately (value_type class will need object_type, but if we do
17664 not initialize object_type, we will pass a null, which will let
17665 the runtime pick the System.Object from the existing corlib, which
17666 is not what we want).
17668 2002-04-22 Patrik Torstensson <totte@labs2.com>
17670 * cs-tokenizer.cs: fixed a number of trim() issues.
17672 2002-04-22 Ravi Pratap <ravi@ximian.com>
17674 * expression.cs (Argument.Type): Ensure that we return the correct
17675 type when we have out or ref parameters [in which case we
17678 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17680 * class.cs (Property, Indexer): Allow extern modifier in there.
17682 * typemanager.cs (InitBaseTypes): Initializes object_type and
17683 value_type, since those will be used early on during the bootstrap
17684 process to compile corlib.
17686 (InitCoreTypes): Move code from here to InitBaseTypes.
17688 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17690 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17691 single-dimension arrays as using the ldlen opcode.
17693 Daniel Lewis discovered this optimization.
17695 * typemanager.cs: Add signature for System.Array::get_Length
17697 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17699 * statement.cs: report the error when the foreach does not apply to an
17700 array nor a collection.
17702 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17704 * expression.cs: Add implicit conversions to the operator ~.
17706 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17708 * typemanager.cs: Locate the decimal constructor.
17710 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17712 * attribute.cs: use the new property of TypeOf.
17713 * expression.cs: added 'get' property around typearg.
17715 These changes fix a build breaker reported by NickD. Is this the
17716 correct way to fix? If not, please, revert my changes and make it
17719 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17721 * attribute.cs: Add support for typeof in attribute invocations.
17722 I am not sure that this is right though.
17724 2002-04-14 Duncan Mak <duncan@ximian.com>
17726 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17727 Binary.Operator.Division case.
17729 2002-04-13 Ravi Pratap <ravi@ximian.com>
17731 * class.cs (DefineType): Ensure that we do a proper check on
17732 attribute types and also register it with the TypeManager.
17734 (TypeContainer.Targets): The default for attribute types is
17735 AttributeTargets.All.
17737 * attribute.cs (ApplyAttributes): Registering the attribute type
17738 is done elsewhere, not when we discover we have a Usage attribute.
17740 2002-04-12 Ravi Pratap <ravi@ximian.com>
17742 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17743 and get rid of is_delegate parameter.
17745 * everywhere : update.
17747 2002-04-12 Ravi Pratap <ravi@ximian.com>
17749 * cs-parser.jay (compilation_unit): Revamp completely to use
17750 some new ideas that I got from Rhys' grammar to solve the problems
17751 with assembly level attributes.
17753 (outer_declaration): New grammar production.
17755 (attribute_sections): Add.
17757 (opt_attributes): Base on attribute_sections
17759 (namespace_declaration): Allow opt_attributes to tackle the case
17760 when we have assembly level attributes - we are clever in this
17763 * attribute.cs (ApplyAttributes): Do not worry about assembly
17764 attributes in the non-global context.
17766 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17767 instead of SetGlobalAttributes.
17769 * class.cs, rootcontext.cs : Ensure we define and generate
17770 attribute types before anything else.
17772 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17773 and flag the new error -20 for the case when the attribute type
17774 does not have valid targets specified. csc does not catch this.
17776 * ../errors/errors.txt : update for error # -20
17778 2002-04-11 Ravi Pratap <ravi@ximian.com>
17780 * support.cs (InternalParameters.ParameterModifier): Do some null
17781 checking and return sane values.
17783 * class.cs (Method.Define): If we are a PInvoke method, ensure
17784 that we are static and extern. Report error # 601
17786 * ../errors/cs0601.cs : Add test case for the above error.
17788 2002-04-07 Ravi Pratap <ravi@ximian.com>
17790 * rootcontext.cs (attribute_types): We need to keep type of
17791 all attribute types separately and emit code for them first.
17793 (RegisterAttribute) : Implement.
17795 * class.cs (DefineType): Check if the current Type is a custom
17796 attribute type and register it accordingly.
17798 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17799 adding the first attribute twice and rename to
17801 (SetGlobalAttributes): this.
17803 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17806 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17807 if we are processing global arguments. Hmm, I am unsure of this.
17809 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17811 * expression.cs: added static array of strings to avoid calling
17812 Enum.ToString () for Operator in Binary. Significant recover of
17815 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17817 * class.cs (FindMembers): Allow the Builders of the various
17818 members to be null. If they are skip them. This only happens
17819 during the PInvoke declaration.
17821 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17823 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17824 failure, so we do not keep going afterwards.
17826 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17827 wanted to pass `false' as the `is_delegate' argument. If this is
17828 the case, why not use delegate_type == null to mean `is_delegate =
17829 false' and anything else as is_delegate = true.
17831 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17833 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17834 code for the section, not the beginning of the tests.
17836 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17838 * cfold.cs: Handle operator + (Enum x, Underlying x)
17840 * expression.cs (Binary): same. Warn about errors where we have
17841 Enum/Enum in operator + as well.
17843 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
17846 - added support for switch(bool)
17847 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17848 - add TableSwitchEmit() to handle table-based switch statements
17850 2002-04-05 Ravi Pratap <ravi@ximian.com>
17852 * expression.cs (Invocation.OverloadResolve): Factor out code which
17853 does parameter compatibility checking with arguments so that we can
17854 re-use the code even from Delegate.VerifyApplicability
17856 (VerifyArgumentsCompat): Move above code here.
17858 * delegate.cs (VerifyApplicability): Get rid of duplicate code
17859 and instead make a call to the above method.
17861 2002-03-31 Ravi Pratap <ravi@ximian.com>
17863 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17864 We use it to keep track of classes which are attribute types.
17866 2002-04-02 Miguel de Icaza <miguel@ximian.com>
17868 * delegate.cs (Delegate.Define): Correctly define the types in the
17869 presence of fixed and array parameters.
17871 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17874 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17875 include NonPublic after the first iteration.
17877 * class.cs (Indexer.CheckBase): Only check if both parents are
17880 * cs-parser.jay (accessor_body): If empty, set to null.
17882 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17883 same code path here to resolve constants names that we did have in
17884 MemberAccess.DoResolve. There is too much code duplicated here.
17886 2002-04-01 Miguel de Icaza <miguel@ximian.com>
17888 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17890 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17893 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17894 tokens, numbers and strings.
17896 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17899 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17900 asyncronous parameters and the regular parameters.
17902 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17903 specify the target directory.
17905 * expression.cs: (This.DoResolve): Simplify
17906 (As.Emit): Optimize, do not generate IsInst if the expression is
17907 always of the given type.
17909 (Is.DoResolve): Bug fix, we were reporting both always/never for
17912 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17913 creating too many unnecessary arrays.
17915 2002-03-31 Miguel de Icaza <miguel@ximian.com>
17917 * class.cs (EmitFieldInitializer): Use Assign expression to assign
17918 fields instead of rolling our own initializer. Takes care of all
17919 implicit conversions, and drops unnecessary static checks/argument.
17921 2002-03-31 Dick Porter <dick@ximian.com>
17923 * driver.cs: use the GetDirectories() return values properly, and
17924 use "/" as path separator.
17926 2002-03-30 Miguel de Icaza <miguel@ximian.com>
17928 * expression.cs (Unary): Optimize - - expr into expr.
17929 (Binary): Optimize a + (-b) into a -b.
17931 * codegen.cs (CodeGen): Made all methods static.
17933 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17937 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17938 TypeBuilder property.
17940 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17943 * tree.cs: Removed the various RecordXXXX, and replaced with a
17944 single RecordDecl. Removed all the accessor methods, and just
17945 left a single access point Type
17947 * enum.cs: Rename DefineEnum to DefineType.
17949 * decl.cs: New abstract method `DefineType' used to unify the
17950 Defines for Enumerations, Interfaces, TypeContainers and
17953 (FindType): Moved LookupInterfaceOrClass here. Moved the
17954 LookupBaseClasses method that used to live in class.cs and
17955 interface.cs here, and renamed to FindType.
17957 * delegate.cs: Implement DefineType. Take advantage of the
17958 refactored pattern for locating the parent builder without taking
17959 the parent_builder argument (which we know does not work if we are
17960 nested, and triggering a toplevel definition).
17962 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17964 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17965 accessibility of a member has changed during override and report
17968 * class.cs (Method.Define, Property.Define): Only complain on
17969 overrides if the method is private, any other accessibility is
17970 fine (and since we just checked the permission is the same, we are
17973 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17974 and elif are processed always. The other pre-processing
17975 directives are only processed if we are "taking" the path
17977 2002-03-29 Martin Baulig <martin@gnome.org>
17979 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17980 current location is not Null.
17982 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17983 a separate method so we can profile it.
17985 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17986 `span.Seconds' are just seconds, but no minutes or hours.
17987 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17989 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17991 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17992 Remove the gratuitous set of Final:
17994 // If an interface implementation, then we can set Final.
17995 if (((flags & MethodAttributes.Abstract) == 0) &&
17996 implementing.DeclaringType.IsInterface)
17997 flags |= MethodAttributes.Final;
17999 I do not know what I was smoking when I used that.
18002 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18003 step into fixing the name resolution issues for delegates and
18004 unifying the toplevel name resolution.
18006 2002-03-28 Martin Baulig <martin@gnome.org>
18008 * class.cs (Method.Emit): If we have a symbol writer, call its
18009 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18010 tell it about the current method.
18012 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18013 writer that we're going to emit the first byte of IL code for a new
18014 statement (a new source line).
18015 (EmitContext.EmitTopBlock): If we have a symbol writer, call
18016 EmitContext.Mark() before emitting any code.
18018 * location.cs (SymbolDocument): Return null when we're Null.
18020 * statement.cs (Statement): Moved the `Location loc' variable here.
18021 (Statement.EmitBoolExpression): If we have a symbol writer, call
18022 ec.Mark() before emitting any code to tell it that we're at the
18023 beginning of a new statement.
18024 (StatementExpression): Added `Location' argument to the constructor.
18025 (Block): Added public readonly variable `StartLocation' and public
18026 variable `EndLocation'. The latter is to be set using SetEndLocation().
18027 (Block): Added constructor which takes a start and end location.
18028 (Block.SetEndLocation): New method. This sets the end location.
18029 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18030 local variables we create.
18031 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18032 each statement and do also mark the begin and end of the block.
18034 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18035 tell it the current lexer.Location, use Location.Null for the end of the
18037 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18038 current block, set its end location using SetEndLocation().
18039 (statement_expression): StatementExpression constructor now takes the
18040 lexer.Location as additional argument.
18041 (for_statement, declare_local_variables): Likewise.
18042 (declare_local_variables): When creating a new implicit block, use the
18043 new Block constructor and pass it the lexer.Location.
18045 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18047 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18048 members also on the parent interfaces recursively.
18050 2002-03-27 Miguel de Icaza <miguel@ximian.com>
18052 * report.cs: Use new formats, since Gonzalo finished the missing
18055 * expression.cs (Binary.ResolveOperator): added missing operator|
18056 operator& and operator^ for bool/bool.
18058 * cs-parser.jay: CheckDef now takes a Location argument that is
18059 used to report errors more precisly (instead of reporting the end
18060 of a definition, we try to track something which is a lot closer
18061 to the source of the problem).
18063 * cs-tokenizer.cs: Track global token use, so we can properly flag
18064 the use of #define/#undef after the first token has been seen.
18066 Also, rename the reportXXXX to Error_DescriptiveName
18068 * decl.cs (DeclSpace.IsTopLevel): Move property here from
18069 TypeContainer, so that Enum and Interface can use this too.
18071 * class.cs (TypeContainer.LookupInterfaceOrClass,
18072 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18073 `builder' argument. Typically this was used to pass the parent
18074 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18077 The problem is that a nested class could trigger the definition of
18078 a toplevel class, and the builder would be obviously wrong in that
18081 So we drop this argument, and we compute dynamically the
18082 TypeBuilder/ModuleBuilder (the correct information was available
18083 to us anyways from DeclSpace.Parent)
18085 * interface.cs (Interface.DefineInterface): Drop builder
18086 parameter cleanup like class.cs
18088 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
18091 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18094 (Try.Emit): Propagate the returns value from the statement.
18096 (Return.Emit): Even if we are leavning
18098 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18100 * modifiers.cs: Fix the computation of MethodAttributes flags.
18102 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18104 * driver.cs: allow compilation of files that start with '/'.
18105 Add a default case when checking the argument of --target.
18107 2002-03-25 Miguel de Icaza <miguel@ximian.com>
18109 * interface.cs: Implement the same search algorithm for types in
18110 the interface code.
18112 * delegate.cs: Do not allow multiple definition.
18114 * Recovered ChangeLog that got accidentally amputated
18116 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18118 * rootcontext.cs: Load manually enum to allow core classes to
18119 contain enumerations.
18121 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18122 Update to new static methods in TypeManager.
18124 * typemanager.cs (GetMethod, GetConstructor): Use our
18125 implementation of FindMembers to find the members, since during
18126 corlib compilation, the types are TypeBuilders and GetMethod and
18127 GetConstructor do not work.
18129 Make all methods in TypeManager static.
18131 (InitCodeHelpers): Split the functionality from
18132 the InitCodeTypes function.
18134 * driver.cs: Call InitCodeHelpers after we have populated the
18137 * cs-parser.jay (delegate_declaration): we did not used to compute
18138 the delegate name correctly for void delegates.
18140 2002-03-24 Miguel de Icaza <miguel@ximian.com>
18142 * rootcontext.cs (RootContext): Init the interface_resolve_order
18143 and type_container_resolve_order always.
18145 (ResolveCore, BootstrapCorlib_ResolveClass,
18146 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18147 compiler when compiling with --nostdlib
18149 * class.cs (TypeContainer.DefineType): Check that our parent is
18150 not null. This test is most important when we are bootstraping
18153 * codegen.cs: Split out the symbol writing code.
18155 2002-03-25 Martin Baulig <martin@gnome.org>
18157 * driver.cs (-g): Made -g an alias for --debug.
18159 2002-03-24 Martin Baulig <martin@gnome.org>
18161 * codegen.cs (SymbolWriter): New public variable. Returns the
18162 current symbol writer.
18163 (CodeGen): Added `bool want_debugging_support' argument to the
18164 constructor. If true, tell the ModuleBuild that we want debugging
18165 support and ask it for the ISymbolWriter.
18166 (Save): If we have a symbol writer, call it's Close() method after
18167 saving the assembly.
18169 * driver.c (--debug): New command line argument to create a
18170 debugger information file.
18172 * location.cs (SymbolDocument): New public property. Returns an
18173 ISymbolDocumentWriter object for the current source file or null
18174 if we don't have a symbol writer.
18176 2002-03-21 Miguel de Icaza <miguel@ximian.com>
18178 * driver.cs (LoadAssembly): Correctly return when all the paths
18179 have been tried and not before.
18181 * statement.cs (Switch.Emit): return the actual coverage for this
18182 statement (returns/not-returns)
18184 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18185 switch of the statement if we are the last switch section. That
18186 kills two problems: try/catch problems (we used to emit an empty
18187 nop at the end) and switch statements where all branches would
18190 2002-03-19 Miguel de Icaza <miguel@ximian.com>
18192 * driver.cs: Add default assemblies (the equivalent to the
18193 Microsoft CSC.RSP file)
18195 * cs-tokenizer.cs: When updating `cols and setting it to zero,
18196 also update tokens_seen and set it to false.
18198 * driver.cs: Implement --recurse for Mike.
18200 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18201 correctly splitting out the paths.
18203 2002-03-18 Miguel de Icaza <miguel@ximian.com>
18205 * interface.cs (Interface.PopulateProperty): Instead of using
18206 `parent' as the declaration space for the set parameters, use
18209 * support.cs (InternalParameters): InternalParameters constructor
18210 takes a DeclSpace instead of a TypeContainer.
18212 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18213 types are being initialized, load the address of it before calling
18216 (New): Provide a mechanism to disable the generation of local
18217 value type temporaries when the caller will be providing us with
18218 an address to store it.
18220 (ArrayCreation.EmitDynamicInitializers): Use it.
18222 2002-03-17 Miguel de Icaza <miguel@ximian.com>
18224 * expression.cs (Invocation.EmitArguments): Only probe for array
18225 property if there is more than one argument. Sorry about that.
18227 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18228 empty param arrays.
18230 * class.cs (Method.LabelParameters): Fix incorrect code path that
18231 prevented the `ParamArrayAttribute' from being applied to the
18234 2002-03-16 Miguel de Icaza <miguel@ximian.com>
18236 * support.cs (ReflectionParameters): Correctly compute whether the
18237 last argument is a params array. Fixes the problem with
18240 * typemanager.cs: Make the assemblies array always be non-null
18241 (empty, but non-null)
18243 * tree.cs (RecordDecl): New function that abstracts the recording
18244 of names. This reports error 101, and provides a pointer to the
18245 previous declaration. Fixes a crash in the compiler.
18247 * cs-parser.jay (constructor_declaration): Update to new grammar,
18248 and provide a constructor_body that can be empty.
18250 2002-03-15 Miguel de Icaza <miguel@ximian.com>
18252 * driver.cs: Add support for --resources.
18254 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18255 Make all types for the various array helper methods be integer.
18257 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18258 CheckState to ConvCast.
18260 (ConvCast): Now it takes a `checked' state argument, to avoid
18261 depending on the emit context for the conversion, and just using
18262 the resolve time setting.
18264 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18265 instead of Invocation.EmitArguments. We do not emit the original
18266 arguments, instead we emit those which have been converted to
18267 unsigned int expressions.
18269 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18271 * codegen.cs: ditto.
18273 * expression.cs (LocalVariableReference): Drop the use of the
18274 Store function that depended on the variable index.
18276 * statement.cs (VariableInfo): Drop the `Idx' property from this
18277 class, as this is not taking into account the indexes for
18278 temporaries tat we generate during the execution, getting the
18281 * class.cs: First emit class initializers, then call the parent
18284 * expression.cs (Binary): Fix opcode emision.
18285 (UnaryMutator.EmitCode): Support checked code generation
18287 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18288 matches for events for both the Static and Instance scans,
18289 pointing to the same element. Fix that.
18291 2002-03-14 Miguel de Icaza <miguel@ximian.com>
18293 * rootcontext.cs (ResolveTree): Always set the
18294 interface_resolve_order, because nested interfaces will be calling
18297 * class.cs (GetInterfaceOrClass): Track the same resolution
18298 process used by TypeManager.LookupType. This fixes the nested
18299 type lookups in class declarations (separate path from
18302 (TypeContainer.DefineType): Also define nested interfaces.
18303 (TypeContainer.RegisterOrder): New public function used to
18304 register the order in which child interfaces need to be closed.
18306 Nested interfaces need to be closed after their parents have been
18309 * interface.cs (InterfaceAttr): Put all the logic for computing
18310 the interface attribute here.
18312 (DefineInterface): Register our interface order with the
18313 RootContext or with the TypeContainer depending on the case.
18315 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18317 * cs-parser.jay: rework foreach statement to work with the new
18318 changes to the policy on SimpleNames.
18320 * report.cs: support Stacktrace on warnings as well.
18322 * makefile: drop --unsafe and /unsafe from the compile.
18324 2002-03-13 Ravi Pratap <ravi@ximian.com>
18326 * ecore.cs (StandardConversionExists): Modify to take an Expression
18327 as the first parameter. Ensure we do null -> reference type conversion
18330 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18331 temporary Expression objects.
18333 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18335 * interface.cs: workaround bug in method overloading resolution
18336 (there is already a bugzilla bug for it).
18338 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18340 We could also solve this problem by having a separate path for
18341 performing type lookups, instead of DoResolve, we could have a
18342 ResolveType entry point, and only participating pieces of the
18343 production (simplename, deref, array) would implement this.
18345 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18346 signal SimpleName to only resolve type names and not attempt to
18347 resolve anything else.
18349 * expression.cs (Cast): Set the flag.
18351 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18353 * class.cs: Only report 108 if there is no `new' modifier.
18355 * cs-parser.jay: rework foreach statement to work with the new
18356 changes to the policy on SimpleNames.
18358 * report.cs: support Stacktrace on warnings as well.
18360 * makefile: drop --unsafe and /unsafe from the compile.
18362 2002-03-11 Miguel de Icaza <miguel@ximian.com>
18364 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18365 lookups here, instead of doing that at parse time. This means
18366 that our grammar will not introduce `LocalVariableReferences' as
18367 expressions at this point. That solves the problem of code like
18371 static void Main ()
18375 This is only half the fix. The full fix requires parameters to
18376 also be handled in this way.
18378 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18379 makes the use more obvious of the DeclSpace. The
18380 ec.TypeContainer.TypeBuilder is now only used to pull the
18381 TypeBuilder for it.
18383 My theory is that I can get rid of the TypeBuilder completely from
18384 the EmitContext, and have typecasts where it is used (from
18385 DeclSpace to where it matters).
18387 The only pending problem is that the code that implements Aliases
18388 is on TypeContainer, and probably should go in DeclSpace.
18390 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18391 lookups here, instead of doing that at parse time. This means
18392 that our grammar will not introduce `LocalVariableReferences' as
18393 expressions at this point. That solves the problem of code like
18397 static void Main ()
18401 This is only half the fix. The full fix requires parameters to
18402 also be handled in this way.
18404 * class.cs (Property.DefineMethod): When implementing an interface
18405 method, set newslot, when implementing an abstract method, do not
18406 set the flag (before we tried never setting it, or always setting
18407 it, which is the difference).
18408 (Indexer.DefineMethod): same.
18409 (Method.DefineMethod): same.
18411 * ecore.cs: Only set the status used flag if we get back a Field.
18413 * attribute.cs: Temporary hack, so Paolo can keep working.
18415 2002-03-08 Ravi Pratap <ravi@ximian.com>
18417 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18418 the unmanaged type in the case we have a MarshalAs attribute.
18420 (Resolve): Handle the case when we are parsing the special MarshalAs
18421 attribute [we need to store the unmanaged type to use later]
18423 * typemanager.cs (marshal_as_attr_type): Built in type for the
18424 MarshalAs Attribute.
18426 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
18427 on parameters and accordingly set the marshalling info.
18429 2002-03-09 Miguel de Icaza <miguel@ximian.com>
18431 * class.cs: Optimizing slightly by removing redundant code after
18432 we switched to the `NoTypes' return value.
18433 (Property.DefineMethod): use NoTypes here too.
18435 This fixes the bug I introduced in my last batch of changes.
18437 2002-03-05 Ravi Pratap <ravi@ximian.com>
18439 * tree.cs (RecordEnum): Add. We now keep track of enums too.
18441 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18442 Enums since those are types too.
18444 * cs-parser.jay (enum_declaration): Record enums as we parse them.
18446 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
18447 thanks to a call during the lookup process.
18449 2002-03-07 Miguel de Icaza <miguel@ximian.com>
18451 * statement.cs (Foreach): Lots of work to accomodate a particular
18452 kind of foreach statement that I had not kept in mind. It is
18453 possible to have foreachs on classes that provide a GetEnumerator
18454 method that return objects that implement the "pattern" for using
18455 a foreach, there is no need to support GetEnumerator
18458 This is needed to compile nant.
18460 * decl.cs: Only report 114 if the member is not `Finalize' and if
18461 the warning level is at least 2.
18463 * class.cs: Moved the compare function from Method to
18466 (MethodSignature.InheritableMemberSignatureCompare): Add new
18467 filter function that is used to extract inheritable methods from a
18470 (Method.Define): Use the new `inheritable_method_signature_filter'
18473 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18476 2002-03-06 Miguel de Icaza <miguel@ximian.com>
18478 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18480 * cs-parser.jay: Add opt_semicolon to the interface declaration.
18482 * expression.cs: Pass location information to
18483 ConvertImplicitStandard.
18485 * class.cs: Added debugging code to track return values from
18488 2002-03-05 Miguel de Icaza <miguel@ximian.com>
18490 * expression.cs (Is.DoResolve): If either side of the `is' is an
18491 interface, do not flag the warning.
18493 * ecore.cs (ImplicitReferenceConversion): We need a separate test
18496 * report.cs: Allow for --fatal to be used with --probe.
18498 * typemanager.cs (NoTypes): Move the definition for the empty Type
18501 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18503 (TypeContainer.DefineProxy): New function used to proxy to parent
18504 implementations when implementing interfaces.
18505 (TypeContainer.ParentImplements): used to lookup if our parent
18506 implements a public function that is required by an interface.
18507 (TypeContainer.VerifyPendingMethods): Hook this up.
18509 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18510 `modules' and `assemblies' arraylists into arrays. We only grow
18511 these are the very early start up of the program, so this improves
18512 the speedof LookupType (nicely measured).
18514 * expression.cs (MakeByteBlob): Replaced unsafe code with
18515 BitConverter, as suggested by Paolo.
18517 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18518 folding of string concatenation, but if either side is a string,
18519 and the other is not, then return null, and let the runtime use
18520 the concatenation on the string plus the object (using
18521 `Object.ToString').
18523 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18525 Constant Folding has been implemented now.
18527 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18528 the error instead on types that are not supported in one's
18531 * constant.cs (Constant and all children): New set of functions to
18532 perform implict and explicit conversions.
18534 * ecore.cs (EnumConstant): Implement the new functions to perform
18535 conversion by proxying to the child expression.
18537 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18538 own separate setting that can not be turned off from the command
18539 line using --unchecked or --checked and is only controlled using
18540 the checked/unchecked statements and expressions. This setting is
18541 used by the constant folder to flag errors.
18543 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18544 ConstantCheckState as well.
18546 During Resolve, they also have to flag the state, because the
18547 constant folder runs completely in the Resolve phase.
18549 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18552 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18554 * cfold.cs: New file, this file contains the constant folder.
18556 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18557 argument to track whether we are using the resulting address to
18558 load or store a value and provide better error messages.
18560 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18561 new AddressOf arguments.
18563 * statement.cs (Foreach.EmitCollectionForeach): Update
18565 * expression.cs (Argument.Emit): Call AddressOf with proper
18566 arguments to track usage.
18568 (New.DoEmit): Call AddressOf with new arguments.
18570 (Unary.Emit): Adjust AddressOf call.
18572 2002-03-01 Ravi Pratap <ravi@ximian.com>
18574 * cs-parser.jay (member_access): Change the case for pre-defined types
18575 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
18578 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18581 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18582 essentially like methods and apply attributes like MethodImplOptions to them too.
18584 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18587 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18588 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18591 * Update code everywhere accordingly.
18593 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18595 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18597 2002-02-28 Ravi Pratap <ravi@ximian.com>
18599 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18600 try performing lookups against those instead of jumping straight into using
18601 the 'using' clauses.
18603 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18605 (LookupType): Perform lookups in implicit parents too.
18607 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18608 sequence as RootContext.LookupType.
18610 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18611 the various cases of namespace lookups into this method.
18613 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18615 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18616 in positional arguments)
18618 * class.cs (Operator): Update the AllowedModifiers to contain
18621 * cs-parser.jay: Update operator declaration to allow for the
18622 operator body to be empty.
18624 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18627 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18629 * class.cs (Method.Emit): Label parameters.
18631 * driver.cs: Return 1 or 0 as the program exit code.
18633 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18635 * expression.cs: Special case the `null' object when trying to
18636 auto-compute the type, as anything can be explicitly converted to
18639 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18640 spotting this Paolo.
18642 (Expression.ImplicitNumericConversion): Perform comparissions of
18643 the type using the underlying type in the case of an enumeration
18644 rather than using the enumeration type for the compare.
18646 Cope with the underlying == type case, which is not possible to
18649 (Expression.ConvertNumericExplicit): Perform comparissions of
18650 the type using the underlying type in the case of an enumeration
18651 rather than using the enumeration type for the compare.
18653 * driver.cs: If the user does not supply an extension, assume .exe
18655 * cs-parser.jay (if_statement): Rewrote so that we can track the
18656 location for the if statement.
18658 * expression.cs (Binary.ConstantFold): Only concat strings when
18659 the operation is "+", not everything ;-)
18661 * statement.cs (Statement.EmitBoolExpression): Take a location
18663 (If, While, Do): Track location.
18665 * expression.cs (Binary.ResolveOperator): In the object + string
18666 case, I was missing a call to ConvertImplicit
18668 2002-02-25 Ravi Pratap <ravi@ximian.com>
18670 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18671 Location arguments. Ensure we use RootContext.LookupType to do our work
18672 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18674 * interface.cs (PopulateMethod): Handle the type of the parameter being
18677 * expression.cs (Invocation.BetterFunction): Handle the case when we
18678 have a params method with no fixed arguments and a call is made with no
18681 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18683 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18684 the verbatim-string-literal
18686 * support.cs (InternalParameters.ParameterModifier): handle null
18688 (InternalParameters.ParameterType): ditto.
18690 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18691 duplicating the name of the variable parameter.
18692 (GetParameterByName): Fix bug where we were not looking up array
18693 paramters if they were the only present (thanks Paolo!).
18694 (GetParameterInfo): We only have an empty set of types if both
18695 fixed and array are set to null.
18696 (GetParameterInfo-idx): Handle FixedParameter == null
18698 * cs-parser.jay: Handle the case where there is no catch
18699 statements (missing null test).
18701 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18703 * driver.cs (MainDriver): Be conservative on our command line
18706 Catch DirectoryNotFoundException when calling GetFiles.
18708 (SplitPathAndPattern): Used to split the input specification into
18709 a path and a pattern that we can feed to Directory.GetFiles.
18711 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18713 * statement.cs (Fixed): Implement the last case of the Fixed
18714 statement (string handling).
18716 * expression.cs (StringPtr): New class used to return a char * to
18717 a string; Used by the Fixed statement.
18719 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18721 * expression.cs (Binary.ResolveOperator): Remove redundant
18722 MemberLookup pn parent type.
18723 Optimize union call, we do not need a union if the types are the same.
18724 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18727 Specialize the use of MemberLookup everywhere, instead of using
18728 the default settings.
18730 (StackAlloc): Implement stackalloc keyword.
18732 * cs-parser.jay: Add rule to parse stackalloc.
18734 * driver.cs: Handle /h, /help, /?
18736 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18737 before we supported unsafe code.
18739 * makefile: add --unsafe to the self compilation of mcs.
18741 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18743 * expression.cs (PointerArithmetic): New class that is used to
18744 perform pointer arithmetic.
18745 (Binary.Resolve): Handle pointer arithmetic
18746 Handle pointer comparission.
18747 (ArrayPtr): Utility expression class that is used to take the
18748 address of an array.
18750 (ElementAccess): Implement array access for pointers
18752 * statement.cs (Fixed): Implement fixed statement for arrays, we
18753 are missing one more case before we are done.
18755 * expression.cs (Indirection): Implement EmitAssign and set the
18756 ExprClass to Variable. This allows pointer dereferences to be
18757 treated as variables, and to have values assigned to them.
18759 * ecore.cs (Expression.StoreFromPtr): New utility function to
18760 store values dereferencing.
18762 2002-02-20 Ravi Pratap <ravi@ximian.com>
18764 * expression.cs (Binary.ResolveOperator): Ensure that we are
18765 not trying to operate on a void type - this fixes the reported
18768 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18769 the parent implementation is sealed.
18771 * ../errors/cs0239.cs : Add.
18773 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18775 * typemanager.cs (unverifiable_code_type): Corresponds to
18776 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18777 which have unsafe code in them.
18779 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18782 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18784 * cs-tokenizer.cs: Add support for @"litreal strings"
18786 Make tokenizer accept pre-processor directives
18787 on any column (remove the old C-like limitation).
18789 * rootcontext.cs (EmitCode): Emit any global attributes.
18790 (AddGlobalAttributes): Used to keep track of assembly attributes.
18792 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18794 * cs-parser.jay: Add support for global attributes.
18796 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18798 * expression.cs (Indirection): New helper class. Unary will
18799 create Indirection classes to be able to implement the
18800 IMemoryLocation interface on it.
18802 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18804 * cs-parser.jay (fixed_statement): reference the right statement.
18806 * statement.cs (Fixed.Emit): Finish implementing the fixed
18807 statement for the &x case.
18809 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18811 * class.cs (Property.Define, Method.Define): Remove newslot when
18814 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18815 wrong. NewSlot should only be used if the `new' keyword is present.
18817 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18818 locating our system dir. Sorry about this.
18820 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18822 * driver.cs (GetSystemDir): Compute correctly the location of our
18823 system assemblies. I was using the compiler directory instead of
18824 the library directory.
18826 2002-02-13 Ravi Pratap <ravi@ximian.com>
18828 * expression.cs (BetterFunction): Put back in what Miguel commented out
18829 since it is the correct fix. The problem is elsewhere ;-)
18831 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18832 parameters of the parms method are themselves compatible or not !
18834 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18835 to check that a class implements an interface before saying that an implicit
18836 conversion was allowed. Use ImplementsInterface to do the checking.
18838 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18840 * class.cs (Method.Define): Track whether we are an explicit
18841 implementation or not. And only call DefineMethodOverride if we
18842 are an explicit implementation.
18844 (Property.DefineMethod): Ditto.
18846 2002-02-11 Ravi Pratap <ravi@ximian.com>
18848 * expression.cs (BetterFunction): Catch hideous bug which was
18849 preventing us from detecting ambiguous calls due to implicit casts i.e
18852 2002-01-29 Miguel de Icaza <miguel@ximian.com>
18854 * support.cs (Pair): Remove un-needed method. I figured why I was
18855 getting the error in cs-parser.jay, the variable in a foreach loop
18856 is readonly, and the compiler does not really treat this as a variable.
18858 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
18859 instead of EQUALS in grammar.
18861 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18863 * expression.cs (Unary.DoResolve): Check whether the argument is
18866 2002-01-28 Miguel de Icaza <miguel@ximian.com>
18868 * support.cs: Api for Pair to set a value. Despite the fact that
18869 the variables are public the MS C# compiler refuses to compile
18870 code that accesses the field if the variable is part of a foreach
18873 * statement.cs (Fixed): Begin implementation of the fixed
18876 (Block.AddVariable): Return the VariableInfo on success and null
18877 on failure instead of true/false.
18879 * cs-parser.jay (foreach): Catch errors on variables already
18880 defined (we were ignoring this value before) and properly unwind
18881 the block hierarchy
18883 (fixed_statement): grammar for the fixed statement.
18885 2002-01-25 Miguel de Icaza <miguel@ximian.com>
18887 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18888 pointer types to be incretemented.
18890 (SizeOf): Implement.
18892 * cs-parser.jay (pointer_member_access): Implement
18893 expr->IDENTIFIER production.
18895 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18896 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18899 (Unary): Implement indirection.
18901 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18902 use in non-unsafe context).
18904 (SimpleName.DoResolve): Check for pointers in field access on safe
18907 (Expression.LoadFromPtr): Factor the load-indirect code in this
18908 function. This was duplicated in UnboxCast and ParameterReference
18910 2002-01-24 Miguel de Icaza <miguel@ximian.com>
18912 * expression.cs (ComposedCast): report an error if a pointer cast
18913 is used in a safe region.
18915 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18916 pointer type casts in unsafe context.
18918 * codegen.cs (EmitContext): Set up IsUnsafe.
18920 * cs-parser.jay (non_expression_type): Add productions for pointer
18923 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18924 code. We should not use force into static mode if the method is
18925 not virtual. Fixes bug in MIS
18927 * statement.cs (Do.Emit, While.Emit, For.Emit,
18928 Statement.EmitBoolExpression): Add support to Do and While to
18929 propagate infinite loop as `I do return' semantics.
18931 Improve the For case to also test for boolean constants.
18933 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18934 to the list of attributes we can add.
18936 Remove `EmitContext' argument.
18938 * class.cs (Method.Define): Apply parameter attributes.
18939 (Constructor.Define): Apply parameter attributes.
18940 (MethodCore.LabelParameters): Move here the core of labeling
18943 * support.cs (ReflectionParameters.ParameterModifier,
18944 InternalParameters.ParameterModifier): Use IsByRef on the type and
18945 only return the OUT bit for these parameters instead of in/out/ref
18948 This is because I miss-understood things. The ParameterInfo.IsIn
18949 and IsOut represent whether the parameter has the [In] and [Out]
18952 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18954 * ecore.cs (FieldExpr.Emit): Release temporaries.
18956 * assign.cs (LocalTemporary.Release): new function.
18958 * codegen.cs (EmitContext.GetTemporaryStorage,
18959 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18960 temporary storage. Now we can "put back" localbuilders when we
18963 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18965 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18966 need to make a copy of the variable to generate verifiable code.
18968 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18970 * driver.cs: Compute dynamically the system directory.
18972 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18973 Slower, but more generally useful. Used by the abstract
18974 registering implementation.
18976 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18977 the rules for the special rule on Type/instances. First check if
18978 we have the same name, and if so, try that special static path
18979 rather than the instance path.
18981 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18983 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18986 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18987 Enum, ValueType, Delegate or Array for non-corlib compiles.
18989 * cs-tokenizer.cs: Catch long identifiers (645)
18991 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18994 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18995 fix, we were returning too early, so we were not registering
18996 pending methods from abstract classes.
18998 Do not register pending methods if the class is abstract.
19000 * expression.cs (Conditional.DoResolve): Report circular implicit
19001 conversions when we neecd to compute it for conditional
19004 (Is.DoResolve): If the expression is always of the provided type,
19005 flag warning 183. If the expression can not ever be of the
19006 provided type flag warning 184.
19008 * class.cs: Catch 169 as well.
19010 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19013 2002-01-18 Nick Drochak <ndrochak@gol.com>
19015 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
19017 2002-01-17 Miguel de Icaza <miguel@ximian.com>
19019 * interface.cs: (PopulateMethod): Check for pointers being defined
19020 only if the unsafe context is active.
19021 (PopulateProperty): ditto.
19022 (PopulateIndexer): ditto.
19024 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19025 specified. If pointers are present, make sure that they are
19026 present in an unsafe context.
19027 (Constructor, Constructor.Define): ditto.
19028 (Field, Field.Define): ditto.
19029 (Property, Property.Define): ditto.
19030 (Event, Event.Define): ditto.
19032 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19033 hashtable if there are classes or structs defined.
19035 * expression.cs (LocalVariableReference.DoResolve): Simplify this
19036 code, as the constant resolution moved.
19038 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19039 the metadata, so we can flag error 133.
19041 * decl.cs (MemberCore.UnsafeOK): New function to test that a
19042 pointer is being declared in an unsafe context.
19044 2002-01-16 Miguel de Icaza <miguel@ximian.com>
19046 * modifiers.cs (Modifiers.Check): Require a Location argument.
19047 Report error 227 for Unsafe use.
19049 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19051 * statement.cs (For.Emit): If the test is null, then report that
19052 we do `return', as we wont reach anything afterwards.
19054 (Switch.SwitchGoverningType): Track the expression that matched
19057 * driver.cs: Allow negative numbers as an error code to flag.
19059 * cs-parser.jay: Handle 1551.
19061 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19063 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19065 * cs-parser.jay: Report 1518 (type declaration can only contain
19066 class, struct, interface, enum or delegate)
19068 (switch_label): Report 1523 (keywords `case' or `default' must
19071 (opt_switch_sections): Report 1522 (empty switch)
19073 * driver.cs: Report 1515 (response file specified multiple times)
19074 Report 1516 (Source file specified multiple times).
19076 * expression.cs (Argument.Resolve): Signal 1510
19078 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19079 access not allowed in static code)
19081 2002-01-11 Ravi Pratap <ravi@ximian.com>
19083 * typemanager.cs (IsPointerType): Utility method which we are going
19086 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19087 the object type, so we take care of that.
19089 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19091 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19092 added to non-params parameters :-)
19094 * typemanager.cs (CSharpName): Include 'void' type too.
19096 (void_ptr_type): Include in the set of core types.
19098 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
19101 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
19104 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
19105 completely forgotten about it.
19107 2002-01-10 Ravi Pratap <ravi@ximian.com>
19109 * cs-parser.jay (pointer_type): Add. This begins our implementation
19110 of parsing rules for unsafe code.
19112 (unsafe_statement): Implement.
19114 (embedded_statement): Modify to include the above.
19116 * statement.cs (Unsafe): Implement new class for unsafe blocks.
19118 * codegen.cs (EmitContext.InUnsafe): Add. This determines
19119 if the current context is an unsafe one.
19121 * cs-parser.jay (local_variable_pointer_type): Since local variable types
19122 are handled differently, we need separate rules for them.
19124 (local_variable_declaration): Update to use local_variable_pointer_type
19125 to allow variable declarations of unmanaged pointer types.
19127 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19128 in unsafe contexts.
19130 * ../errors/cs0214.cs : Add.
19132 2002-01-16 Nick Drochak <ndrochak@gol.com>
19134 * makefile: remove 'response' file when cleaning.
19136 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19138 * cs-parser.jay: Report 1524.
19140 2002-01-14 Miguel de Icaza <miguel@ximian.com>
19142 * typemanager.cs (RegisterMethod): drop checking if we have
19143 registered this from here
19145 2002-01-12 Miguel de Icaza <miguel@ximian.com>
19147 * class.cs (Method.EmitDestructor): Implement calling our base
19150 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19151 value of InFinally.
19153 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19154 this routine and will wrap the call in a try/catch block. Deal
19157 2002-01-11 Miguel de Icaza <miguel@ximian.com>
19159 * ecore.cs (Expression.MemberLookup): instead of taking a
19160 parameter `same_type' that was used to tell whether we could
19161 access private members we compute our containing type from the
19164 (FieldExpr): Added partial support for volatile fields. This does
19165 not work for volatile fields exposed from assemblies, as I can not
19166 figure out how to extract the modreq from it.
19168 Updated all the source files to use this.
19170 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19171 because it is referenced by MemberLookup very often.
19173 2002-01-09 Ravi Pratap <ravi@ximian.com>
19175 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19176 TypeBuilder.GetCustomAttributes to retrieve what we need.
19178 Get rid of redundant default_member_attr_type as this is the same as
19179 default_member_type which already exists.
19181 * interface.cs, attribute.cs : Update accordingly.
19183 2002-01-08 Miguel de Icaza <miguel@ximian.com>
19185 * typemanager.cs: Enable IndexerPropertyName again. It does not
19186 work for TYpeBuilders though. Ravi, can you please fix this?
19188 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19190 * expression.cs (Argument.Emit): Handle the case of ref objects
19191 being passed to ref functions;
19193 (ParameterReference.EmitLoad): Loads the content of the pointer
19194 without dereferencing.
19196 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19198 * cs-tokenizer.cs: Implemented the pre-processing expressions.
19200 2002-01-08 Ravi Pratap <ravi@ximian.com>
19202 * class.cs (Indexer.DefineMethod): Incorporate the interface
19203 type in the name of the method if we are doing explicit interface
19206 * expression.cs (ConversionExists): Remove as it is completely obsolete.
19208 (BetterConversion): Fix extremely trivial bug where we were referring to
19209 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19212 * ../errors/bug16.cs : Add although we have fixed it.
19214 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19216 * expression.cs (BaseIndexer): Begin implementation.
19218 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19220 * cs-parser.jay (indexer_declarator): Use qualified_identifier
19221 production directly to remove a shift/reduce, and implement
19222 explicit interface implementation.
19224 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19225 after a floating point suffix.
19227 * expression.cs (DoNumericPromotions): Improved the conversion for
19228 uint/uint. If we have a constant, we avoid doing a typecast to a
19231 * class.cs (Indexer): Implement explicit interface implementation
19234 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19236 * class.cs: make the default instance constructor public and hidebysig.
19238 2001-01-03 Ravi Pratap <ravi@ximian.com>
19240 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19241 so we can call it from elsewhere.
19243 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19244 we emit it internally if the class has a defined indexer; otherwise the user
19245 emits it by decorating the class definition with the DefaultMemberAttribute.
19247 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19248 attribute is not used on a type which defines an indexer.
19250 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19251 character when we skip whitespace.
19253 * ../errors/cs0646.cs : Add.
19255 2002-01-03 Miguel de Icaza <miguel@ximian.com>
19257 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19260 * makefile: Add practical target `mcs3.exe' which builds the third
19261 generation compiler.
19263 * expression.cs (New): Fix structures constructor calling.
19265 * class.cs (Property, Method, Indexer): Emit Final flag on the
19266 method if we are an interface implementation and we are not
19269 * ecore.cs (PropertyExpr): New public field `IsBase', tells
19270 whether this property is referencing a `base' method.
19272 * expression.cs (Invocation.EmitCall): take an extra argument:
19273 is_base, this is used to determine whether the `call' or
19274 `callvirt' opcode should be used.
19277 * delegate.cs: update EmitCall.
19279 * class.cs (Method.Define): Set NewSlot for the cases where we are
19280 not implementing an interface method.
19282 (Property.Define): ditto.
19284 2002-01-02 Miguel de Icaza <miguel@ximian.com>
19286 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19287 'r'. Allows mcs to parse itself fully.
19289 2002-01-02 Ravi Pratap <ravi@ximian.com>
19291 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19292 of the number of initializers that require the InitializeArray method.
19294 (CheckIndices): Store the Expression in all cases - not the plain value. Also
19295 update the above field where necessary.
19297 (MakeByteBlob): Update accordingly.
19299 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
19302 (EmitDynamicInitializers): Update in accordance with the new optimization.
19304 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19305 same OpCode applies.
19307 * cs-parser.jay : Fix some glaring errors I introduced.
19309 2002-01-01 Ravi Pratap <ravi@ximian.com>
19311 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19312 so that we can check for name clashes there too.
19314 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19315 for interface indexers.
19317 * interfaces.cs (Define): Emit the default member attribute.
19319 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19320 variable was being referred to while setting the value ;-)
19322 2002-01-01 Miguel de Icaza <miguel@ximian.com>
19324 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19325 byte-by-byte information when we know the data is zero.
19327 Make the block always a multiple of 4, because
19328 DefineInitializedData has a bug.
19330 * assign.cs: Fix, we should assign from the temporary, not from
19333 * expression.cs (MakeByteBlob): Fix my incorrect code.
19335 2001-12-31 Miguel de Icaza <miguel@ximian.com>
19337 * typemanager.cs (EnumToUnderlying): This function is used to get
19338 the underlying type from an enumeration, because it does not
19341 * constant.cs: Use the I4_S form for values between -128 and 127.
19343 * statement.cs (Block.LookupLabel): Looks up a label.
19344 (Block): Drop support for labeled blocks.
19346 (LabeledStatement): New kind of statement that represents a label
19349 (Goto): Finally implement this bad boy.
19351 * cs-parser.jay: Update to reflect new mechanism to implement
19354 2001-12-30 Miguel de Icaza <miguel@ximian.com>
19356 * codegen.cs (EmitContext.This): a codegen property that keeps the
19357 a single instance of this instead of creating many different this
19360 * delegate.cs (Delegate.DoResolve): Update to use the property;
19362 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19364 * expression.cs (BaseAccess.DoResolve): Ditto.
19366 2001-12-29 Ravi Pratap <ravi@ximian.com>
19368 * typemanager.cs (methodimpl_attr_type): Add to hold the type
19369 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19371 (InitCoreTypes): Update accordingly.
19373 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19374 so we can quickly store the state.
19376 (ApplyAttributes): Set the correct implementation flags
19377 for InternalCall methods.
19379 2001-12-29 Miguel de Icaza <miguel@ximian.com>
19381 * expression.cs (EmitCall): if a method is not virtual, then do
19382 not use callvirt on it.
19384 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19385 user defined stuff) requires the use of stobj, which takes an
19386 address on the stack instead of an array and an index. So emit
19387 the Ldelema operation for it.
19389 (EmitStoreOpcode): Use stobj for valuetypes.
19391 (UnaryMutator.EmitCode): Use the right 1 value depending on
19392 whether we are dealing with int64/uint64, float or doubles.
19394 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19395 constructors that I implemented last night.
19397 (Constructor.IsDefault): Fix to work properly for static
19400 * cs-parser.jay (CheckDef): report method signature errors.
19401 Update error number 103 to be 132.
19403 * decl.cs: New AdditionResult enumeration value: MethodExists.
19404 Although we do this check for methods later on in the semantic
19405 analysis, catching repeated default constructors is so easy that
19406 we catch these here.
19408 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19411 (ParameterReference.EmitAssign, Emit): handle
19414 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19415 (ArrayAccess.EmitStoreOpcode): ditto.
19417 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19419 * expression.cs (MakeByteBlob): Complete all the missing types
19420 (uint, short, ushort, byte, sbyte)
19422 * class.cs: Only init instance field initializers on instance
19425 Rename `constructors' to instance_constructors.
19427 (TypeContainer.AddConstructor): Only add constructors to the list
19428 if it is not static.
19430 Make sure that we handle default_static_constructor independently
19431 everywhere where we handle instance_constructors
19433 2001-12-28 Miguel de Icaza <miguel@ximian.com>
19435 * class.cs: Do not lookup or create a base initializer for a
19436 static constructor.
19438 (ConstructorInitializer.Resolve): use the proper type to lookup
19441 * cs-parser.jay: Report error 1585 (modifiers between type and name).
19443 * enum.cs, interface.cs: Remove CloseType, this is taken care by
19446 * decl.cs: CloseType is now an virtual method, the default
19447 implementation just closes this type.
19449 2001-12-28 Ravi Pratap <ravi@ximian.com>
19451 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19452 to PreserveSig by default. Also emit HideBySig on such methods.
19454 Basically, set the defaults to standard values.
19456 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19457 argument, if candidate is better, it can't be worse than the best !
19459 (Invocation): Re-write bits to differentiate between methods being
19460 applicable in their expanded form and their normal form - for params
19463 Get rid of use_standard everywhere as only standard conversions are allowed
19464 in overload resolution.
19466 More spec conformance.
19468 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19470 * driver.cs: Add --timestamp, to see where the compiler spends
19473 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19474 `this' in static code.
19476 (SimpleName.DoResolve): Implement in terms of a helper function
19477 that allows static-references to be passed upstream to
19480 (Expression.ResolveWithSimpleName): Resolve specially simple
19481 names when called by MemberAccess to implement the special
19484 (Expression.ImplicitReferenceConversion): Handle conversions from
19485 Null to reference types before others, as Null's type is
19488 * expression.cs (Invocation.EmitCall): Handle the special case of
19489 calling methods declared on a reference type from a ValueType
19490 (Base classes System.Object and System.Enum)
19492 (MemberAccess.Resolve): Only perform lookups on Enumerations if
19493 the left hand side is a TypeExpr, not on every enumeration.
19495 (Binary.Resolve): If types are reference types, then do a cast to
19496 object on operators != and == of both arguments.
19498 * typemanager.cs (FindMembers): Extract instance and static
19499 members if requested.
19501 * interface.cs (PopulateProperty): Use void_type instead of null
19502 as the return type for the setter method.
19504 (PopulateIndexer): ditto.
19506 2001-12-27 Ravi Pratap <ravi@ximian.com>
19508 * support.cs (ReflectionParameters): Fix minor bug where we
19509 were examining the wrong parameter for the ParamArray attribute.
19511 Cope with requests for the type of the parameter at position
19512 greater than the params parameter's. We now return the element
19513 type of the params array as that makes more sense.
19515 * expression.cs (Invocation.IsParamsMethodApplicable): Update
19516 accordingly as we no longer have to extract the element type
19519 (Invocation.OverloadResolve): Update.
19521 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19523 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19524 against IEnumerator, test whether the return value is a descendant
19525 of the IEnumerator interface.
19527 * class.cs (Indexer.Define): Use an auxiliary method to implement
19528 the other bits of the method definition. Begin support for
19529 explicit interface implementation.
19531 (Property.DefineMethod): Use TypeManager.void_type instead of null
19532 for an empty return value.
19534 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19536 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19537 dealing with a FieldExpr which is composed of a FieldBuilder, in
19538 the code path we did extract the constant, but we should have
19539 obtained the underlying value to be able to cast it (otherwise we
19540 end up in an infinite loop, this is what Ravi was running into).
19542 (ArrayCreation.UpdateIndices): Arrays might be empty.
19544 (MemberAccess.ResolveMemberAccess): Add support for section
19545 14.5.4.1 that deals with the special case of E.I when E is a type
19546 and something else, that I can be a reference to a static member.
19548 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19549 handle a particular array type to create byte blobs, it is just
19550 something we dont generate byteblobs for.
19552 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19555 * location.cs (Push): remove the key from the hashtable that we
19556 are about to add. This happens for empty files.
19558 * driver.cs: Dispose files after we have parsed them.
19560 (tokenize): new function that only runs the tokenizer on its
19561 input, for speed testing.
19563 2001-12-26 Ravi Pratap <ravi@ximian.com>
19565 * class.cs (Event.Define): Define the private field only if there
19566 are no accessors defined.
19568 * expression.cs (ResolveMemberAccess): If there is no associated
19569 field with the event, that means we have an event defined with its
19570 own accessors and we should flag error cs0070 since transforming
19571 ourselves into a field is not valid in that case.
19573 * ecore.cs (SimpleName.DoResolve): Same as above.
19575 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19576 and charset to sane values.
19578 2001-12-25 Ravi Pratap <ravi@ximian.com>
19580 * assign.cs (DoResolve): Perform check on events only if they
19581 are being accessed outside the declaring type.
19583 * cs-parser.jay (event_declarations): Update rules to correctly
19584 set the type of the implicit parameter etc.
19586 (add_accessor, remove_accessor): Set current local parameters.
19588 * expression.cs (Binary): For delegate addition and subtraction,
19589 cast the return value from the method into the appropriate delegate
19592 2001-12-24 Ravi Pratap <ravi@ximian.com>
19594 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19595 of these as the workaround is unnecessary.
19597 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19598 delegate data - none of that is needed at all.
19600 Re-write bits to extract the instance expression and the delegate method
19603 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19606 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19607 of attaching attributes instead of duplicating code everywhere.
19609 * everywhere : Update code to do attribute emission using the above method.
19611 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19613 * expression.cs (IsParamsMethodApplicable): if there are not
19614 parameters, return immediately.
19616 * ecore.cs: The 0 literal can be implicity converted to an enum
19619 (SimpleName.DoResolve): First lookup the type, then lookup the
19622 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19623 want to get its address. If the InstanceExpression is not
19624 addressable, store the result in a temporary variable, then get
19627 * codegen.cs: Only display 219 errors on warning level or above.
19629 * expression.cs (ArrayAccess): Make it implement the
19630 IMemoryLocation interface.
19632 (Binary.DoResolve): handle the operator == (object a, object b)
19633 and operator != (object a, object b) without incurring into a
19634 BoxedCast (because 5 != o should never be performed).
19636 Handle binary enumerator operators.
19638 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19639 value type, otherwise use Ldelem_ref.
19641 Use precomputed names;
19643 (AddressOf): Implement address of
19645 * cs-parser.jay (labeled_statement): Fix recursive block
19646 addition by reworking the production.
19648 * expression.cs (New.DoEmit): New has a special case:
19650 If we are dealing with a ValueType, we have a few
19651 situations to deal with:
19653 * The target of New is a ValueType variable, that is
19654 easy, we just pass this as the variable reference
19656 * The target of New is being passed as an argument,
19657 to a boxing operation or a function that takes a
19660 In this case, we need to create a temporary variable
19661 that is the argument of New.
19664 2001-12-23 Ravi Pratap <ravi@ximian.com>
19666 * rootcontext.cs (LookupType): Check that current_type is not null before
19667 going about looking at nested types.
19669 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19670 not implement the IAssignMethod interface any more.
19672 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19673 where we tranform them into FieldExprs if they are being resolved from within
19674 the declaring type.
19676 * ecore.cs (SimpleName.DoResolve): Do the same here.
19678 * assign.cs (DoResolve, Emit): Clean up code considerably.
19680 * ../errors/bug10.cs : Add.
19682 * ../errors/cs0070.cs : Add.
19684 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19686 * assign.cs : Get rid of EventIsLocal everywhere.
19688 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19690 * ecore.cs (ConvertIntLiteral): finished the implementation.
19692 * statement.cs (SwitchLabel): Convert the value we are using as a
19693 key before looking up the table.
19695 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19697 * codegen.cs (EmitTopBlock): Require a Location argument now.
19699 * cs-parser.jay (constructor_declarator): We need to setup
19700 current_local_parameters before we parse the
19701 opt_constructor_initializer, to allow the variables to be bound
19702 to the constructor arguments.
19704 * rootcontext.cs (LookupType): First lookup nested classes in our
19705 class and our parents before we go looking outside our class.
19707 * expression.cs (ConstantFold): Extract/debox the values at the
19710 * rootcontext.cs (EmitCode): Resolve the constants first before we
19711 resolve the types. This is not really needed, but it helps debugging.
19713 * statement.cs: report location.
19715 * cs-parser.jay: pass location to throw statement.
19717 * driver.cs: Small bug fix.
19719 * report.cs: Updated format to be 4-zero filled digits.
19721 2001-12-22 Ravi Pratap <ravi@ximian.com>
19723 * expression.cs (CheckIndices): Fix minor bug where the wrong
19724 variable was being referred to ;-)
19726 (DoEmit): Do not call EmitStaticInitializers when the
19727 underlying type is System.Object.
19729 2001-12-21 Ravi Pratap <ravi@ximian.com>
19731 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19732 and do the usual workaround for SRE.
19734 * class.cs (MyEventBuilder.EventType): New member to get at the type
19735 of the event, quickly.
19737 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19739 * assign.cs (Assign.DoResolve): Handle the case when the target
19740 is an EventExpr and perform the necessary checks.
19742 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19745 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19747 (EventExpr): Set the type in the constructor itself since we
19748 are meant to be born fully resolved.
19750 (EventExpr.Define): Revert code I wrote earlier.
19752 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19753 instance expression is null. The instance expression is a This in that case
19754 or a null, depending on whether it is a static method or not.
19756 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19757 refers to more than one method.
19759 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19760 and accordingly flag errors.
19762 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19764 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19766 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19768 * location.cs (ToString): Provide useful rutine.
19770 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19772 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19773 objects, return the actual integral boxed.
19775 * statement.cs (SwitchLabel): define an ILLabel for each
19778 (Switch.CheckSwitch): If the value is a Literal, extract
19779 the underlying literal.
19781 Also in the unused hashtable we had, add the SwitchLabel so we can
19782 quickly look this value up.
19784 * constant.cs: Implement a bunch of new constants. Rewrite
19785 Literal based on this. Made changes everywhere to adapt to this.
19787 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19788 dereferencing array only once, and also copes with enumrations.
19790 bytes are two bytes wide, not one.
19792 (Cast): Perform constant conversions.
19794 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19795 wrappers to the literals here.
19797 * expression.cs (DoNumericPromotions): long literals can converted
19798 to ulong implicity (this is taken care of elsewhere, but I was
19799 missing this spot).
19801 * ecore.cs (Expression.Literalize): Make the return type Literal,
19802 to improve type checking.
19804 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19806 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19808 * literal.cs: Revert code from ravi that checked the bounds. The
19809 bounds are sane by the definition of the type itself.
19811 * typemanager.cs: Fix implementation of ImplementsInterface. We
19812 need to actually look up in our parent hierarchy for interfaces
19815 * const.cs: Use the underlying type for enumerations
19817 * delegate.cs: Compute the basename for the delegate creation,
19818 that should fix the delegate test case, and restore the correct
19819 Type Lookup semantics in rootcontext
19821 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19822 referencing a nested type with the Reflection API is using the "+"
19825 * cs-parser.jay: Do not require EOF token at the end.
19827 2001-12-20 Ravi Pratap <ravi@ximian.com>
19829 * rootcontext.cs (LookupType): Concatenate type names with
19830 a '.' instead of a '+' The test suite passes again.
19832 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19833 field of the enumeration.
19835 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19836 the case when the member is an EventExpr.
19838 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19839 static has an associated instance expression.
19841 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19843 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19845 * class.cs (Event.Define): Register event and perform appropriate checks
19848 We define the Add and Remove methods even if the use provides none because
19849 in that case, we provide default implementations ourselves.
19851 Define a private field of the type of the event. This is done by the CSC compiler
19852 and we should be doing it too ;-)
19854 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19855 More methods we use in code we generate.
19857 (multicast_delegate_type, delegate_type): Two separate types since the distinction
19860 (InitCoreTypes): Update accordingly for the above.
19862 * class.cs (Event.Emit): Generate code for default accessors that we provide
19864 (EmitDefaultMethod): Do the job in the above.
19866 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
19869 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19871 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19872 builders even if we were missing one.
19874 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19875 pass the Basename as our class name instead of the Name. The
19876 basename will be correctly composed for us.
19878 * parameter.cs (Paramters): Now takes a Location argument.
19880 * decl.cs (DeclSpace.LookupType): Removed convenience function and
19881 make all the code call directly LookupType in RootContext and take
19882 this chance to pass the Location information everywhere.
19884 * Everywhere: pass Location information.
19886 2001-12-19 Miguel de Icaza <miguel@ximian.com>
19888 * class.cs (Constructor.Define): Updated way of detecting the
19889 length of the parameters.
19891 (TypeContainer.DefineType): Use basename as the type name for
19894 (TypeContainer.Define): Do not recursively define types here, as
19895 definition is taken care in order by the RootContext.
19897 * tree.cs: Keep track of namespaces in a per-file basis.
19899 * parameter.cs (Parameter.ComputeSignature): Update to use
19902 (Parameters.GetSignature): ditto.
19904 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19905 instead of a TypeContainer.
19907 (Interface.SemanticAnalysis): Use `this' instead of our parent to
19908 resolve names. Because we need to be resolve in our context, not
19911 * driver.cs: Implement response files.
19913 * class.cs (TypeContainer.DefineType): If we are defined, do not
19914 redefine ourselves.
19916 (Event.Emit): Emit the code for add/remove handlers.
19917 (Event.Define): Save the MethodBuilders for add/remove.
19919 * typemanager.cs: Use pair here too.
19921 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19922 DictionaryEntry requires the first argument to be non-null.
19924 (enum_declaration): Compute full name for registering the
19927 (delegate_declaration): Instead of using
19928 formal_parameter_list, use opt_formal_parameter_list as the list
19931 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19932 (EventParsing): New property that controls whether `add' and
19933 `remove' are returned as tokens or identifiers (for events);
19935 2001-12-19 Ravi Pratap <ravi@ximian.com>
19937 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19938 use MyEventBuilder only and let it wrap the real builder for us.
19940 (MyEventBuilder): Revamp constructor etc.
19942 Implement all operations that we perform on EventBuilder in precisely the same
19945 (FindMembers): Update to use the EventBuilder member.
19947 (Event.Emit): Update accordingly.
19949 2001-12-18 Ravi Pratap <ravi@ximian.com>
19951 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19952 by calling the appropriate methods.
19954 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19957 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19959 2001-12-17 Ravi Pratap <ravi@ximian.com>
19961 * delegate.cs (Delegate.Populate): Check that the return type
19962 and various parameters types are indeed accessible.
19964 * class.cs (Constructor.Define): Same here.
19966 (Field.Define): Ditto.
19968 (Event.Define): Ditto.
19970 (Operator.Define): Check that the underlying Method defined itself
19971 correctly - so it's MethodBuilder should not be null.
19973 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19974 expression happens to be null.
19976 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19977 members but as of now we don't seem to be able to do anything really useful with it.
19979 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19980 not the EventBuilder.
19982 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19984 * cs-tokenizer.cs: Add support for defines.
19985 Add support for #if, #elif, #else, #endif
19987 (eval_var): evaluates a variable.
19988 (eval): stubbed for evaluating functions.
19990 * cs-parser.jay: Pass the defines information
19992 * driver.cs: Add --define command line option.
19994 * decl.cs: Move MemberCore here.
19996 Make it the base class for DeclSpace. This allows us to catch and
19997 report 108 and 109 for everything now.
19999 * class.cs (TypeContainer.Define): Extract all the members
20000 before populating and emit the warning 108 (new keyword required
20001 to override) instead of having each member implement this.
20003 (MemberCore.Define): New abstract method, we will be using this in
20004 the warning reporting engine in Populate.
20006 (Operator.Define): Adjust to new MemberCore protocol.
20008 * const.cs (Const): This does not derive from Expression, it is a
20009 temporary object we use to create fields, it is a MemberCore.
20011 * class.cs (Method.Define): Allow the entry point to be in a
20014 * driver.cs: Rewrite the argument handler to clean it up a bit.
20016 * rootcontext.cs: Made it just an auxiliary namespace feature by
20017 making everything static.
20019 * driver.cs: Adapt code to use RootContext type name instead of
20022 * delegate.cs: Remove RootContext argument.
20024 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20027 * class.cs (Event.Define): The lookup can fail.
20029 * cs-tokenizer.cs: Begin implementation of pre-procesor.
20031 * expression.cs: Resolve the this instance before invoking the code.
20033 2001-12-17 Miguel de Icaza <miguel@ximian.com>
20035 * cs-parser.jay: Add a production in element_access that allows
20036 the thing to become a "type" reference. This way we can parse
20037 things like "(string [])" as a type.
20039 Note that this still does not handle the more complex rules of
20043 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
20045 * ecore.cs: (CopyNewMethods): new utility function used to
20046 assemble the list of methods from running FindMembers.
20048 (MemberLookup): Rework FindMembers so that
20050 2001-12-16 Miguel de Icaza <miguel@ximian.com>
20052 * class.cs (TypeContainer): Remove Delegates who fail to be
20055 * delegate.cs (Populate): Verify that we dont get null return
20056 values. TODO: Check for AsAccessible.
20058 * cs-parser.jay: Use basename to emit error 574 (destructor should
20059 have the same name as container class), not the full name.
20061 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20062 possible representation.
20064 Also implements integer type suffixes U and L.
20066 2001-12-15 Miguel de Icaza <miguel@ximian.com>
20068 * expression.cs (ArrayCreation.DoResolve): We need to do the
20069 argument resolution *always*.
20071 * decl.cs: Make this hold the namespace. Hold the root context as
20073 (LookupType): Move here.
20075 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20077 * location.cs (Row, Name): Fixed the code, it was always returning
20078 references to the first file.
20080 * interface.cs: Register properties defined through interfaces.
20082 * driver.cs: Add support for globbing on the command line
20084 * class.cs (Field): Make it derive from MemberCore as well.
20087 2001-12-15 Ravi Pratap <ravi@ximian.com>
20089 * class.cs (Event::Define): Check that the type of the event is a delegate
20090 type else flag error #66.
20092 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20095 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20096 values of EntryPoint, CharSet etc etc.
20098 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20100 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20101 be null and we should ignore this. I am not sure if this is really clean. Apparently,
20102 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20103 which needs this to do its work.
20105 * ../errors/cs0066.cs : Add.
20107 2001-12-14 Miguel de Icaza <miguel@ximian.com>
20109 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20112 * class.cs: (MethodSignature.MethodSignature): Removed hack that
20113 clears out the parameters field.
20114 (MemberSignatureCompare): Cleanup
20116 (MemberCore): New base class used to share code between MethodCore
20119 (RegisterRequiredImplementations) BindingFlags.Public requires
20120 either BindingFlags.Instace or Static. Use instance here.
20122 (Property): Refactored code to cope better with the full spec.
20124 * parameter.cs (GetParameterInfo): Return an empty array instead
20127 * class.cs (Property): Abstract or extern properties have no bodies.
20129 * parameter.cs (GetParameterInfo): return a zero-sized array.
20131 * class.cs (TypeContainer.MethodModifiersValid): Move all the
20132 method modifier validation to the typecontainer so we can reuse
20133 this on properties.
20135 (MethodCore.ParameterTypes): return an empty sized array of types.
20137 (Property.Define): Test property modifier validity.
20139 Add tests for sealed/override too.
20141 (Method.Emit): abstract or extern methods have no bodies.
20143 2001-12-14 Ravi Pratap <ravi@ximian.com>
20145 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20148 (Method::Define, ::Emit): Modify accordingly.
20150 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20152 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20154 * makefile: Pass in /unsafe.
20156 2001-12-13 Miguel de Icaza <miguel@ximian.com>
20158 * class.cs (MakeKey): Kill routine.
20160 * class.cs (TypeContainer.Define): Correctly define explicit
20161 method implementations (they require the full interface name plus
20164 * typemanager.cs: Deply the PtrHashtable here and stop using the
20165 lame keys. Things work so much better.
20167 This of course broke everyone who depended on `RegisterMethod' to
20168 do the `test for existance' test. This has to be done elsewhere.
20170 * support.cs (PtrHashtable): A hashtable that avoid comparing with
20171 the object stupid Equals method (because, that like fails all over
20172 the place). We still do not use it.
20174 * class.cs (TypeContainer.SetRequiredInterface,
20175 TypeContainer.RequireMethods): Killed these two routines and moved
20176 all the functionality to RegisterRequiredImplementations.
20178 (TypeContainer.RegisterRequiredImplementations): This routine now
20179 registers all the implementations required in an array for the
20180 interfaces and abstract methods. We use an array of structures
20181 which can be computed ahead of time to reduce memory usage and we
20182 also assume that lookups are cheap as most classes will not
20183 implement too many interfaces.
20185 We also avoid creating too many MethodSignatures.
20187 (TypeContainer.IsInterfaceMethod): Update and optionally does not
20188 clear the "pending" bit if we find that there are problems with
20191 (TypeContainer.VerifyPendingMethods): Update to report errors of
20192 methods that look like implementations but are not.
20194 (TypeContainer.Define): Add support for explicit interface method
20197 2001-12-12 Miguel de Icaza <miguel@ximian.com>
20199 * typemanager.cs: Keep track of the parameters here instead of
20200 being a feature of the TypeContainer.
20202 * class.cs: Drop the registration of parameters here, as
20203 InterfaceMethods are also interface declarations.
20205 * delegate.cs: Register methods with the TypeManager not only with
20206 the TypeContainer. This code was buggy.
20208 * interface.cs: Full registation here.
20210 2001-12-11 Miguel de Icaza <miguel@ximian.com>
20212 * expression.cs: Remove reducer for binary expressions, it can not
20215 * const.cs: Put here the code that used to go into constant.cs
20217 * constant.cs: Put here the code for constants, this is a new base
20218 class for Literals.
20220 * literal.cs: Make Literal derive from Constant.
20222 2001-12-09 Miguel de Icaza <miguel@ximian.com>
20224 * statement.cs (Return.Emit): Report error 157 if the user
20225 attempts to return from a finally block.
20227 (Return.Emit): Instead of emitting a return, jump to the end of
20230 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20231 LocalBuilder to store the result of the function. ReturnLabel is
20232 the target where we jump.
20235 2001-12-09 Radek Doulik <rodo@ximian.com>
20237 * cs-parser.jay: remember alias in current namespace
20239 * ecore.cs (SimpleName::DoResolve): use aliases for types or
20242 * class.cs (LookupAlias): lookup alias in my_namespace
20244 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20246 (LookupAlias): lookup alias in this and if needed in parent
20249 2001-12-08 Miguel de Icaza <miguel@ximian.com>
20253 * rootcontext.cs: (ModuleBuilder) Made static, first step into
20254 making things static. I need this to avoid passing the
20255 TypeContainer when calling ParameterType.
20257 * support.cs (InternalParameters.ParameterType): Remove ugly hack
20258 that did string manipulation to compute the type and then call
20259 GetType. Use Parameter.ParameterType instead.
20261 * cs-tokenizer.cs: Consume the suffix for floating values.
20263 * expression.cs (ParameterReference): figure out whether this is a
20264 reference parameter or not. Kill an extra variable by computing
20265 the arg_idx during emission.
20267 * parameter.cs (Parameters.GetParameterInfo): New overloaded
20268 function that returns whether a parameter is an out/ref value or not.
20270 (Parameter.ParameterType): The type of the parameter (base,
20271 without ref/out applied).
20273 (Parameter.Resolve): Perform resolution here.
20274 (Parameter.ExternalType): The full type (with ref/out applied).
20276 * statement.cs (Using.Emit, Using.EmitExpression): Implement
20277 support for expressions on the using statement.
20279 2001-12-07 Miguel de Icaza <miguel@ximian.com>
20281 * statement.cs (Using.EmitLocalVariableDecls): Split the
20282 localvariable handling of the using statement.
20284 (Block.EmitMeta): Keep track of variable count across blocks. We
20285 were reusing slots on separate branches of blocks.
20287 (Try.Emit): Emit the general code block, we were not emitting it.
20289 Check the type of the declaration to be an IDisposable or
20290 something that can be implicity converted to it.
20292 Emit conversions if required.
20294 * ecore.cs (EmptyExpression): New utility class.
20295 (Expression.ImplicitConversionExists): New utility function.
20297 2001-12-06 Miguel de Icaza <miguel@ximian.com>
20299 * statement.cs (Using): Implement.
20301 * expression.cs (LocalVariableReference): Support read only variables.
20303 * statement.cs: Remove the explicit emit for the Leave opcode.
20304 (VariableInfo): Add a readonly field.
20306 2001-12-05 Miguel de Icaza <miguel@ximian.com>
20308 * ecore.cs (ConvCast): new class used to encapsulate the various
20309 explicit integer conversions that works in both checked and
20310 unchecked contexts.
20312 (Expression.ConvertNumericExplicit): Use new ConvCast class to
20313 properly generate the overflow opcodes.
20315 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20317 * statement.cs: The correct type for the EmptyExpression is the
20318 element_type, not the variable type. Ravi pointed this out.
20320 2001-12-04 Ravi Pratap <ravi@ximian.com>
20322 * class.cs (Method::Define): Handle PInvoke methods specially
20323 by using DefinePInvokeMethod instead of the usual one.
20325 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20326 above to do the task of extracting information and defining the method.
20328 2001-12-04 Ravi Pratap <ravi@ximian.com>
20330 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20331 of the condition for string type.
20333 (Emit): Move that here.
20335 (ArrayCreation::CheckIndices): Keep string literals in their expression
20338 (EmitDynamicInitializers): Handle strings appropriately.
20340 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20342 * codegen.cs (EmitContext): Replace multiple variables with a
20343 single pointer to the current Switch statement.
20345 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20348 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20352 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20355 (Foreach.Emit): Foreach on arrays was not setting
20356 up the loop variables (for break/continue).
20358 (GotoCase): Semi-implented.
20360 2001-12-03 Ravi Pratap <ravi@ximian.com>
20362 * attribute.cs (CheckAttribute): Handle system attributes by using
20363 Attribute.GetAttributes to examine information we need.
20365 (GetValidPlaces): Same here.
20367 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20369 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20371 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20373 (Method::Define): Set appropriate flags if we have a DllImport attribute.
20375 (Method::Emit): Handle the case when we are a PInvoke method.
20377 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20379 * expression.cs: Use ResolveWithSimpleName on compound names.
20381 2001-12-02 Ravi Pratap <ravi@ximian.com>
20383 * constant.cs (EmitConstant): Make sure we resolve the associated expression
20384 before trying to reduce it.
20386 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20388 * constant.cs (LookupConstantValue): Implement.
20390 (EmitConstant): Use the above in emitting the constant.
20392 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20393 that are user-defined by doing a LookupConstantValue on them.
20395 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20398 2001-11-29 Miguel de Icaza <miguel@ximian.com>
20400 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20402 (BaseAccess.DoResolve): Implement.
20404 (MemberAccess.DoResolve): Split this routine into a
20405 ResolveMemberAccess routine that can be used independently
20407 2001-11-28 Miguel de Icaza <miguel@ximian.com>
20409 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20410 As that share bits of the implementation. Is returns a boolean,
20411 while As returns the Type that is being probed.
20413 2001-12-01 Ravi Pratap <ravi@ximian.com>
20415 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20416 instead of a Literal - much easier.
20418 (EnumInTransit): Remove - utterly useless :-)
20420 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20422 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20424 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20425 chain when we have no associated expression.
20427 2001-11-30 Ravi Pratap <ravi@ximian.com>
20429 * constant.cs (Define): Use Location while reporting the errror.
20431 Also emit a warning when 'new' is used and there is no inherited
20434 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
20437 (LookupEnumValue): Implement to lookup an enum member's value and define it
20440 (Populate): Re-write accordingly to use the above routine.
20442 2001-11-27 Miguel de Icaza <miguel@ximian.com>
20444 * expression.cs (This): Fix prototype for DoResolveLValue to
20445 override the base class DoResolveLValue.
20447 * cs-parser.cs: Report errors cs574 and cs575 (destructor
20450 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20451 (we need to load the address of the field here). This fixes
20454 (FieldExpr.DoResolveLValue): Call the DoResolve
20455 function to initialize the Instance expression.
20457 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20458 correctly the GetEnumerator operation on a value type.
20460 * cs-parser.jay: Add more simple parsing error catches.
20462 * statement.cs (Switch): Add support for string switches.
20463 Handle null specially.
20465 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
20467 2001-11-28 Ravi Pratap <ravi@ximian.com>
20469 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20471 (declare_local_constant): New helper function.
20473 * statement.cs (AddConstant): Keep a separate record of constants
20475 (IsConstant): Implement to determine if a variable is a constant.
20477 (GetConstantExpression): Implement.
20479 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20481 * statement.cs (IsVariableDefined): Re-write.
20483 2001-11-27 Ravi Pratap <ravi@ximian.com>
20485 * class.cs (TypeContainer::FindMembers): Look for constants
20486 in the case when we are looking for MemberTypes.Field
20488 * expression.cs (MemberAccess::DoResolve): Check that in the
20489 case we are a FieldExpr and a Literal, we are not being accessed
20490 by an instance reference.
20492 * cs-parser.jay (local_constant_declaration): Implement.
20494 (declaration_statement): Implement for constant declarations.
20496 2001-11-26 Miguel de Icaza <miguel@ximian.com>
20498 * statement.cs (Switch): Catch double defaults.
20500 (Switch): More work on the switch() statement
20501 implementation. It works for integral values now, need to finish
20505 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20507 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20508 integer literals into other integer literals. To be used by
20511 2001-11-24 Ravi Pratap <ravi@ximian.com>
20513 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20516 (EmitDynamicInitializers): Cope with the above since we extract data
20517 directly from ArrayData now.
20519 (ExpectInitializers): Keep track of whether initializers are mandatory
20522 (Bounds): Make it a hashtable to prevent the same dimension being
20523 recorded for every element in that dimension.
20525 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20528 Also fix bug which was causing the indices to be emitted in the reverse
20531 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20533 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20534 unfinished. They do not work, because the underlying code is
20537 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20539 * cs-parser.jay: Remove bogus fixme.
20541 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20542 on Switch statement.
20544 2001-11-23 Ravi Pratap <ravi@ximian.com>
20546 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20549 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20550 parameter. Apparently, any expression is allowed.
20552 (ValidateInitializers): Update accordingly.
20554 (CheckIndices): Fix some tricky bugs thanks to recursion.
20556 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
20557 I was being completely brain-dead.
20559 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20560 and re-write acordingly.
20562 (DelegateInvocation): Re-write accordingly.
20564 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20566 (MakeByteBlob): Handle types more correctly.
20568 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20569 initialization from expressions but it is incomplete because I am a complete
20572 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20574 * statement.cs (If.Emit): Fix a bug that generated incorrect code
20575 on If. Basically, we have to return `true' (ie, we do return to
20576 our caller) only if both branches of the if return.
20578 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20579 short-circuit operators, handle them as short circuit operators.
20581 (Cast.DoResolve): Resolve type.
20582 (Cast.Cast): Take an expression as the target type.
20584 * cs-parser.jay (cast_expression): Remove old hack that only
20585 allowed a limited set of types to be handled. Now we take a
20586 unary_expression and we resolve to a type during semantic
20589 Use the grammar productions from Rhys to handle casts (this is
20590 not complete like Rhys syntax yet, we fail to handle that corner
20591 case that C# has regarding (-x), but we will get there.
20593 2001-11-22 Ravi Pratap <ravi@ximian.com>
20595 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20596 field which is an array type.
20598 * cs-parser.jay (declare_local_variables): Support array initialization too.
20600 * typemanager.cs (MakeKey): Implement.
20602 (everywhere): Use the above appropriately.
20604 * cs-parser.jay (for_statement): Update for array initialization while
20605 declaring variables.
20607 * ecore.cs : The error message was correct, it's the variable's names that
20608 were misleading ;-) Make the code more readable.
20610 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20611 the correct type etc.
20613 (ConvertExplicit): Handle Enum types by examining the underlying type.
20615 2001-11-21 Ravi Pratap <ravi@ximian.com>
20617 * parameter.cs (GetCallingConvention): Always return
20618 CallingConventions.Standard for now.
20620 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20622 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20623 and `r' after calling DoNumericPromotions.
20625 * ecore.cs: Fix error message (the types were in the wrong order).
20627 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20628 BindingFlags.Instance as well
20630 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20631 implicit int literal conversion in an empty cast so that we
20632 propagate the right type upstream.
20634 (UnboxCast): new class used to unbox value types.
20635 (Expression.ConvertExplicit): Add explicit type conversions done
20638 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20639 the target type before applying the implicit LongLiterals to ULong
20642 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20644 * cs-parser.jay (for_statement): Reworked the way For works: now
20645 we declare manually any variables that are introduced in
20646 for_initializer to solve the problem of having out-of-band code
20647 emition (that is what got for broken).
20649 (declaration_statement): Perform the actual variable declaration
20650 that used to be done in local_variable_declaration here.
20652 (local_variable_declaration): Do not declare anything, just pass
20653 the information on a DictionaryEntry
20655 2001-11-20 Ravi Pratap <ravi@ximian.com>
20657 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20658 re-write of the logic to now make it recursive.
20660 (UpdateIndices): Re-write accordingly.
20662 Store element data in a separate ArrayData list in the above methods.
20664 (MakeByteBlob): Implement to dump the array data into a byte array.
20666 2001-11-19 Ravi Pratap <ravi@ximian.com>
20668 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20671 * constant.cs (Define): Implement.
20673 (EmitConstant): Re-write fully.
20675 Pass in location info.
20677 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20680 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20681 DictionaryEntry since we need location info too.
20683 (constant_declaration): Update accordingly.
20685 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20686 code into another method : UpdateIndices.
20688 2001-11-18 Ravi Pratap <ravi@ximian.com>
20690 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20691 some type checking etc.
20693 2001-11-17 Ravi Pratap <ravi@ximian.com>
20695 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20696 bits to provide dimension info if the user skips doing that.
20698 Update second constructor to store the rank correctly.
20700 2001-11-16 Ravi Pratap <ravi@ximian.com>
20702 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20703 and try to implement.
20705 * ../errors/cs0150.cs : Add.
20707 * ../errors/cs0178.cs : Add.
20709 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20711 * statement.cs: Implement foreach on multi-dimensional arrays.
20713 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20714 name of the params argument.
20716 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20717 initializing the array.
20719 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20720 we can use this elsewhere.
20722 * statement.cs: Finish implementation of foreach for single
20725 * cs-parser.jay: Use an out-of-band stack to pass information
20726 around, I wonder why I need this.
20728 foreach_block: Make the new foreach_block the current_block.
20730 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20731 function used to return a static Parameters structure. Used for
20732 empty parameters, as those are created very frequently.
20734 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20736 2001-11-15 Ravi Pratap <ravi@ximian.com>
20738 * interface.cs : Default modifier is private, not public. The
20739 make verify test passes again.
20741 2001-11-15 Ravi Pratap <ravi@ximian.com>
20743 * support.cs (ReflectionParameters): Fix logic to determine
20744 whether the last parameter is a params one. Test 9 passes again.
20746 * delegate.cs (Populate): Register the builders we define with
20747 RegisterParameterForBuilder. Test 19 passes again.
20749 * cs-parser.jay (property_declaration): Reference $6 instead
20750 of $$ to get at the location.
20752 (indexer_declaration): Similar stuff.
20754 (attribute): Ditto.
20756 * class.cs (Property): Register parameters for the Get and Set methods
20757 if they exist. Test 23 passes again.
20759 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20760 call to EmitArguments as we are sure there aren't any params arguments.
20761 Test 32 passes again.
20763 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20764 IndexOutOfRangeException.
20766 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20767 Test 33 now passes again.
20769 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20771 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20772 broke a bunch of things. Will have to come up with a better way
20773 of tracking locations.
20775 * statement.cs: Implemented foreach for single dimension arrays.
20777 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20779 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20780 an error. This removes the lookup from the critical path.
20782 * cs-parser.jay: Removed use of temporary_loc, which is completely
20785 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20787 * support.cs (ReflectionParameters.ParameterModifier): Report
20788 whether the argument is a PARAMS argument or not.
20790 * class.cs: Set the attribute `ParamArrayAttribute' on the
20791 parameter argument.
20793 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20794 and cons_param_array_attribute (ConstructorInfo for
20795 ParamArrayAttribute).,
20797 * codegen.cs: Emit the return using the `Return' statement, that
20798 way we can report the error correctly for missing return values.
20800 * class.cs (Method.Emit): Clean up.
20802 * expression.cs (Argument.Resolve): Take another argument: the
20803 location where this argument is used. Notice that this is not
20804 part of the "Argument" class as to reduce the size of the
20805 structure (we know the approximate location anyways).
20807 Test if the argument is a variable-reference, if not, then
20808 complain with a 206.
20810 (Argument.Emit): Emit addresses of variables.
20812 (Argument.FullDesc): Simplify.
20814 (Invocation.DoResolve): Update for Argument.Resolve.
20816 (ElementAccess.DoResolve): ditto.
20818 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20819 method should be virtual, as this method is always virtual.
20821 (NewDelegate.DoResolve): Update for Argument.Resolve.
20823 * class.cs (ConstructorInitializer.DoResolve): ditto.
20825 * attribute.cs (Attribute.Resolve): ditto.
20827 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20829 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20831 * expression.cs (ParameterReference): Drop IStackStorage and implement
20832 IAssignMethod instead.
20834 (LocalVariableReference): ditto.
20836 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20837 IAssignMethod instead.
20839 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20841 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20842 enumerations that are used in heavily used structures derive from
20843 byte in a laughable and pathetic attempt to reduce memory usage.
20844 This is the kind of pre-optimzations that you should not do at
20845 home without adult supervision.
20847 * expression.cs (UnaryMutator): New class, used to handle ++ and
20848 -- separatedly from the other unary operators. Cleans up the
20849 code, and kills the ExpressionStatement dependency in Unary.
20851 (Unary): Removed `method' and `Arguments' from this class, making
20852 it smaller, and moving it all to SimpleCall, so I can reuse this
20853 code in other locations and avoid creating a lot of transient data
20854 strucutres when not required.
20856 * cs-parser.jay: Adjust for new changes.
20858 2001-11-11 Miguel de Icaza <miguel@ximian.com>
20860 * enum.cs (Enum.Populate): If there is a failure during
20863 * cs-parser.jay (opt_enum_base): we used to catch type errors
20864 here, but this is really incorrect. The type error should be
20865 catched during semantic analysis.
20867 2001-12-11 Ravi Pratap <ravi@ximian.com>
20869 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20870 current_local_parameters as expected since I, in my stupidity, had forgotten
20873 * attribute.cs (GetValidPlaces): Fix stupid bug.
20875 * class.cs (Method::Emit): Perform check on applicability of attributes.
20877 (Constructor::Emit): Ditto.
20879 (Field::Emit): Ditto.
20881 (Field.Location): Store location information.
20883 (Property, Event, Indexer, Operator): Ditto.
20885 * cs-parser.jay (field_declaration): Pass in location for each field.
20887 * ../errors/cs0592.cs : Add.
20889 2001-11-12 Ravi Pratap <ravi@ximian.com>
20891 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20893 (InitCoreTypes): Update accordingly.
20895 (RegisterAttrType, LookupAttr): Implement.
20897 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20898 info about the same.
20900 (Resolve): Update to populate the above as necessary.
20902 (Error592): Helper.
20904 (GetValidPlaces): Helper to the above.
20906 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20908 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20910 2001-11-12 Ravi Pratap <ravi@ximian.com>
20912 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20914 * ../errors/cs0617.cs : Add.
20916 2001-11-11 Ravi Pratap <ravi@ximian.com>
20918 * enum.cs (Emit): Rename to Populate to be more consistent with what
20919 we expect it to do and when exactly it is called.
20921 * class.cs, rootcontext.cs : Update accordingly.
20923 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20924 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20926 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20928 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20929 of a fieldinfo using the above, when dealing with a FieldBuilder.
20931 2001-11-10 Ravi Pratap <ravi@ximian.com>
20933 * ../errors/cs0031.cs : Add.
20935 * ../errors/cs1008.cs : Add.
20937 * ../errrors/cs0543.cs : Add.
20939 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20942 (FindMembers): Implement.
20944 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20945 enums and delegates too.
20947 (enum_types): Rename to builder_to_enum.
20949 (delegate_types): Rename to builder_to_delegate.
20951 * delegate.cs (FindMembers): Implement.
20953 2001-11-09 Ravi Pratap <ravi@ximian.com>
20955 * typemanager.cs (IsEnumType): Implement.
20957 * enum.cs (Emit): Re-write parts to account for the underlying type
20958 better and perform checking etc.
20960 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20961 of the underlying type.
20963 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20966 * enum.cs (error31): Helper to report error #31.
20968 * cs-parser.jay (enum_declaration): Store location of each member too.
20970 * enum.cs (member_to_location): New hashtable.
20972 (AddEnumMember): Update location hashtable.
20974 (Emit): Use the location of each member while reporting errors.
20976 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20978 * cs-parser.jay: A for_initializer if is a
20979 local_variable_declaration really ammount to have an implicit
20980 block with the variable declaration and no initializer for for.
20982 * statement.cs (For.Emit): Cope with null initializers.
20984 This fixes the infinite loop on for initializers.
20986 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20988 * enum.cs: More cleanup.
20990 * ecore.cs: Remove dead code.
20992 * class.cs (Property.Emit): More simplification.
20993 (Event.Emit): ditto.
20995 Reworked to have less levels of indentation.
20997 2001-11-08 Ravi Pratap <ravi@ximian.com>
20999 * class.cs (Property): Emit attributes.
21009 * enum.cs (Emit): Ditto.
21011 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21014 * class.cs (Field, Event, etc.): Move attribute generation into the
21015 Emit method everywhere.
21017 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21018 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21019 as we had no way of defining nested enums !
21021 * rootcontext.cs : Adjust code accordingly.
21023 * typemanager.cs (AddEnumType): To keep track of enum types separately.
21025 2001-11-07 Ravi Pratap <ravi@ximian.com>
21027 * expression.cs (EvalConstantExpression): Move into ecore.cs
21029 * enum.cs (Enum): Rename some members and make them public and readonly
21030 according to our convention.
21032 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21035 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21037 (Enum::Emit): Write a simple version for now which doesn't try to compute
21038 expressions. I shall modify this to be more robust in just a while.
21040 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21042 (TypeContainer::CloseType): Create the Enum types too.
21044 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21046 * expression.cs (EvalConstantExpression): Get rid of completely.
21048 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21049 user-defined values and other cases.
21051 (IsValidEnumLiteral): Helper function.
21053 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
21054 out there in the case we had a literal FieldExpr.
21056 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21058 (Literalize): Revamp a bit to take two arguments.
21060 (EnumLiteral): New class which derives from Literal to wrap enum literals.
21062 2001-11-06 Ravi Pratap <ravi@ximian.com>
21064 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21066 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21068 (Resolve): Use the above to ensure we have proper initializers.
21070 2001-11-05 Ravi Pratap <ravi@ximian.com>
21072 * expression.cs (Expression::EvalConstantExpression): New method to
21073 evaluate constant expressions.
21075 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21077 2001-11-07 Miguel de Icaza <miguel@ximian.com>
21079 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21082 (Binary.ResolveOperator): Handle operator != (object a, object b)
21083 and operator == (object a, object b);
21085 (Binary.DoNumericPromotions): Indicate whether the numeric
21086 promotion was possible.
21088 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21091 Made the ArrayAccess implement interface IAssignMethod instead of
21092 IStackStore as the order in which arguments are passed reflects
21095 * assign.cs: Instead of using expr.ExprClass to select the way of
21096 assinging, probe for the IStackStore/IAssignMethod interfaces.
21098 * typemanager.cs: Load InitializeArray definition.
21100 * rootcontext.cs (RootContext.MakeStaticData): Used to define
21101 static data that can be used to initialize arrays.
21103 2001-11-05 Miguel de Icaza <miguel@ximian.com>
21105 * expression.cs: Handle operator== and operator!= for booleans.
21107 (Conditioal.Reduce): Implement reducer for the ?: operator.
21109 (Conditional.Resolve): Implement dead code elimination.
21111 (Binary.Resolve): Catch string literals and return a new
21112 concatenated string.
21114 (Unary.Reduce): Implement reduction of unary expressions.
21116 * ecore.cs: Split out the expression core handling here.
21118 (Expression.Reduce): New method used to perform constant folding
21119 and CSE. This is needed to support constant-expressions.
21121 * statement.cs (Statement.EmitBoolExpression): Pass true and false
21122 targets, and optimize for !x.
21124 2001-11-04 Ravi Pratap <ravi@ximian.com>
21126 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21127 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21128 set custom atttributes.
21130 * literal.cs (Literal::GetValue): New abstract method to return the actual
21131 value of the literal, cast as an object.
21133 (*Literal): Implement GetValue method.
21135 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21136 expressions to the arraylist but objects of type Argument.
21138 * class.cs (TypeContainer::Emit): Emit our attributes too.
21140 (Method::Emit, Constructor::Emit): Ditto.
21142 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21143 to be ignoring earlier.
21145 2001-11-03 Ravi Pratap <ravi@ximian.com>
21147 * attribute.cs (AttributeSection::Define): Implement to do the business
21148 of constructing a CustomAttributeBuilder.
21150 (Attribute): New trivial class. Increases readability of code.
21152 * cs-parser.jay : Update accordingly.
21154 (positional_argument_list, named_argument_list, named_argument): New rules
21156 (attribute_arguments): Use the above so that we are more correct.
21158 2001-11-02 Ravi Pratap <ravi@ximian.com>
21160 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21161 to perform all checks for a method with a params parameter.
21163 (Invocation::OverloadResolve): Update to use the above method and therefore
21164 cope correctly with params method invocations.
21166 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
21169 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21170 constructors in our parent too because we can't afford to miss out on
21173 * attribute.cs (AttributeSection): New name for the class Attribute
21175 Other trivial changes to improve readability.
21177 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21178 use the new class names.
21180 2001-11-01 Ravi Pratap <ravi@ximian.com>
21182 * class.cs (Method::Define): Complete definition for params types too
21184 (Indexer::Define): Ditto.
21186 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21187 Cope everywhere with a request for info about the array parameter.
21189 2001-11-01 Ravi Pratap <ravi@ximian.com>
21191 * tree.cs (RecordNamespace): Fix up to check for the correct key.
21193 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
21194 local_variable_type to extract the string corresponding to the type.
21196 (local_variable_type): Fixup the action to use the new helper method.
21198 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
21201 * expression.cs : Clean out code which uses the above.
21203 2001-10-31 Ravi Pratap <ravi@ximian.com>
21205 * typemanager.cs (RegisterMethod): Check if we already have an existing key
21206 and bale out if necessary by returning a false.
21208 (RegisterProperty): Ditto.
21210 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21211 and print out appropriate error messages.
21213 * interface.cs (everywhere): Ditto.
21215 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21216 location to constructor.
21218 * class.cs (Property, Event, Indexer): Update accordingly.
21220 * ../errors/cs111.cs : Added.
21222 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21223 of a method, as laid down by the spec.
21225 (Invocation::OverloadResolve): Use the above method.
21227 2001-10-31 Ravi Pratap <ravi@ximian.com>
21229 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21230 now take a TypeContainer and a Parameters object.
21232 (ParameterData): Modify return type of ParameterModifier method to be
21233 Parameter.Modifier and not a string.
21235 (ReflectionParameters, InternalParameters): Update accordingly.
21237 * expression.cs (Argument::GetParameterModifier): Same here.
21239 * support.cs (InternalParameters::ParameterType): Find a better way of determining
21240 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21241 symbol in it at all so maybe this is only for now.
21243 2001-10-30 Ravi Pratap <ravi@ximian.com>
21245 * support.cs (InternalParameters): Constructor now takes an extra argument
21246 which is the actual Parameters class.
21248 (ParameterDesc): Update to provide info on ref/out modifiers.
21250 * class.cs (everywhere): Update call to InternalParameters to pass in
21251 the second argument too.
21253 * support.cs (ParameterData): Add ParameterModifier, which is a method
21254 to return the modifier info [ref/out etc]
21256 (InternalParameters, ReflectionParameters): Implement the above.
21258 * expression.cs (Argument::ParameterModifier): Similar function to return
21259 info about the argument's modifiers.
21261 (Invocation::OverloadResolve): Update to take into account matching modifiers
21264 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21265 a new SetFormalParameters object which we pass to InternalParameters.
21267 2001-10-30 Ravi Pratap <ravi@ximian.com>
21269 * expression.cs (NewArray): Merge into the ArrayCreation class.
21271 2001-10-29 Ravi Pratap <ravi@ximian.com>
21273 * expression.cs (NewArray): Merge classes NewBuiltinArray and
21274 NewUserdefinedArray into one as there wasn't much of a use in having
21277 * expression.cs (Argument): Change field's name to ArgType from Type.
21279 (Type): New readonly property which returns the proper type, taking into
21280 account ref/out modifiers.
21282 (everywhere): Adjust code accordingly for the above.
21284 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21285 whether we are emitting for a ref or out parameter.
21287 * expression.cs (Argument::Emit): Use the above field to set the state.
21289 (LocalVariableReference::Emit): Update to honour the flag and emit the
21292 * parameter.cs (Attributes): Set the correct flags for ref parameters.
21294 * expression.cs (Argument::FullDesc): New function to provide a full desc.
21296 * support.cs (ParameterData): Add method ParameterDesc to the interface.
21298 (ReflectionParameters, InternalParameters): Implement the above method.
21300 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21303 (Invocation::FullMethodDesc): Ditto.
21305 2001-10-29 Miguel de Icaza <miguel@ximian.com>
21307 * cs-parser.jay: Add extra production for the second form of array
21310 * expression.cs (ArrayCreation): Update to reflect the above
21313 * Small changes to prepare for Array initialization.
21315 2001-10-28 Miguel de Icaza <miguel@ximian.com>
21317 * typemanager.cs (ImplementsInterface): interface might be null;
21318 Deal with this problem;
21320 Also, we do store negative hits on the cache (null values), so use
21321 this instead of calling t.GetInterfaces on the type everytime.
21323 2001-10-28 Ravi Pratap <ravi@ximian.com>
21325 * typemanager.cs (IsBuiltinType): New method to help determine the same.
21327 * expression.cs (New::DoResolve): Get rid of array creation code and instead
21328 split functionality out into different classes.
21330 (New::FormArrayType): Move into NewBuiltinArray.
21332 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21335 (NewBuiltinArray): New class to handle creation of built-in arrays.
21337 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21338 account creation of one-dimensional arrays.
21340 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21342 (NewUserdefinedArray::DoResolve): Implement.
21344 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21346 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21347 we maintain inside the TypeManager. This is necessary to perform lookups on the
21350 (LookupType): Update to perform GetType on the module builders too.
21352 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21354 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21356 2001-10-23 Ravi Pratap <ravi@ximian.com>
21358 * expression.cs (New::DoResolve): Implement guts of array creation.
21360 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21362 2001-10-27 Miguel de Icaza <miguel@ximian.com>
21364 * expression.cs: Fix bug I introduced lsat night that broke
21367 (Expression.Resolve): Report a 246 error (can not resolve name)
21368 if we find a SimpleName in the stream.
21370 (Expression.ResolveLValue): Ditto.
21372 (Expression.ResolveWithSimpleName): This function is a variant of
21373 ResolveName, this one allows SimpleNames to be returned without a
21374 warning. The only consumer of SimpleNames is MemberAccess
21376 2001-10-26 Miguel de Icaza <miguel@ximian.com>
21378 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21379 might arrive here. I have my doubts that this is correct.
21381 * statement.cs (Lock): Implement lock statement.
21383 * cs-parser.jay: Small fixes to support `lock' and `using'
21385 * cs-tokenizer.cs: Remove extra space
21387 * driver.cs: New flag --checked, allows to turn on integer math
21390 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21391 Threading.Monitor.Exit
21393 2001-10-23 Miguel de Icaza <miguel@ximian.com>
21395 * expression.cs (IndexerAccess::DoResolveLValue): Set the
21396 Expression Class to be IndexerAccess.
21398 Notice that Indexer::DoResolve sets the eclass to Value.
21400 2001-10-22 Miguel de Icaza <miguel@ximian.com>
21402 * class.cs (TypeContainer::Emit): Emit code for indexers.
21404 * assign.cs (IAssignMethod): New interface implemented by Indexers
21405 and Properties for handling assignment.
21407 (Assign::Emit): Simplify and reuse code.
21409 * expression.cs (IndexerAccess, PropertyExpr): Implement
21410 IAssignMethod, clean up old code.
21412 2001-10-22 Ravi Pratap <ravi@ximian.com>
21414 * typemanager.cs (ImplementsInterface): New method to determine if a type
21415 implements a given interface. Provides a nice cache too.
21417 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21420 (ConvertReferenceExplicit): Ditto.
21422 * delegate.cs (Delegate::Populate): Update to define the parameters on the
21423 various methods, with correct names etc.
21425 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
21426 Operator.UnaryNegation.
21428 * cs-parser.jay (operator_declarator): Be a little clever in the case where
21429 we have a unary plus or minus operator.
21431 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
21434 * everywhere : update accordingly.
21436 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21439 * class.cs (Method::Define): For the case where we are implementing a method
21440 inherited from an interface, we need to set the MethodAttributes.Final flag too.
21441 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21443 2001-10-21 Ravi Pratap <ravi@ximian.com>
21445 * interface.cs (FindMembers): Implement to work around S.R.E
21448 * typemanager.cs (IsInterfaceType): Implement.
21450 (FindMembers): Update to handle interface types too.
21452 * expression.cs (ImplicitReferenceConversion): Re-write bits which
21453 use IsAssignableFrom as that is not correct - it doesn't work.
21455 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21456 and accordingly override EmitStatement.
21458 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21459 using the correct logic :-)
21461 2001-10-19 Ravi Pratap <ravi@ximian.com>
21463 * ../errors/cs-11.cs : Add to demonstrate error -11
21465 2001-10-17 Miguel de Icaza <miguel@ximian.com>
21467 * assign.cs (Assign::Resolve): Resolve right hand side first, and
21468 then pass this as a hint to ResolveLValue.
21470 * expression.cs (FieldExpr): Add Location information
21472 (FieldExpr::LValueResolve): Report assignment to readonly
21475 (Expression::ExprClassFromMemberInfo): Pass location information.
21477 (Expression::ResolveLValue): Add new method that resolves an
21480 (Expression::DoResolveLValue): Default invocation calls
21483 (Indexers): New class used to keep track of indexers in a given
21486 (IStackStore): Renamed from LValue, as it did not really describe
21487 what this did. Also ResolveLValue is gone from this interface and
21488 now is part of Expression.
21490 (ElementAccess): Depending on the element access type
21492 * typemanager.cs: Add `indexer_name_type' as a Core type
21493 (System.Runtime.CompilerServices.IndexerNameAttribute)
21495 * statement.cs (Goto): Take a location.
21497 2001-10-18 Ravi Pratap <ravi@ximian.com>
21499 * delegate.cs (Delegate::VerifyDelegate): New method to verify
21500 if two delegates are compatible.
21502 (NewDelegate::DoResolve): Update to take care of the case when
21503 we instantiate a delegate from another delegate.
21505 * typemanager.cs (FindMembers): Don't even try to look up members
21506 of Delegate types for now.
21508 2001-10-18 Ravi Pratap <ravi@ximian.com>
21510 * delegate.cs (NewDelegate): New class to take care of delegate
21513 * expression.cs (New): Split the delegate related code out into
21514 the NewDelegate class.
21516 * delegate.cs (DelegateInvocation): New class to handle delegate
21519 * expression.cs (Invocation): Split out delegate related code into
21520 the DelegateInvocation class.
21522 2001-10-17 Ravi Pratap <ravi@ximian.com>
21524 * expression.cs (New::DoResolve): Implement delegate creation fully
21525 and according to the spec.
21527 (New::DoEmit): Update to handle delegates differently.
21529 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21530 because of which we were printing out arguments in reverse order !
21532 * delegate.cs (VerifyMethod): Implement to check if the given method
21533 matches the delegate.
21535 (FullDelegateDesc): Implement.
21537 (VerifyApplicability): Implement.
21539 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21540 delegate invocations too.
21542 (Invocation::Emit): Ditto.
21544 * ../errors/cs1593.cs : Added.
21546 * ../errors/cs1594.cs : Added.
21548 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21550 2001-10-16 Ravi Pratap <ravi@ximian.com>
21552 * typemanager.cs (intptr_type): Core type for System.IntPtr
21554 (InitCoreTypes): Update for the same.
21556 (iasyncresult_type, asynccallback_type): Ditto.
21558 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21561 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21564 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21565 the builders for the 4 members of a delegate type :-)
21567 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21570 * expression.cs (New::DoResolve): Implement guts for delegate creation.
21572 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21574 2001-10-15 Miguel de Icaza <miguel@ximian.com>
21576 * statement.cs (Break::Emit): Implement.
21577 (Continue::Emit): Implement.
21579 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
21580 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
21581 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
21582 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
21585 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21586 properties that track the label for the current loop (begin of the
21587 loop and end of the loop).
21589 2001-10-15 Ravi Pratap <ravi@ximian.com>
21591 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21592 use of emitting anything at all.
21594 * class.cs, rootcontext.cs : Get rid of calls to the same.
21596 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21598 (Populate): Define the constructor correctly and set the implementation
21601 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21604 (AddDelegateType): Implement.
21606 (IsDelegateType): Implement helper method.
21608 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21610 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21611 and accordingly handle it.
21613 * delegate.cs (Populate): Take TypeContainer argument.
21614 Implement bits to define the Invoke method. However, I still haven't figured out
21615 how to take care of the native int bit :-(
21617 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21618 Qualify the name of the delegate, not its return type !
21620 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21623 (StandardConversionExists): Checking for array types turns out to be recursive.
21625 (ConvertReferenceExplicit): Implement array conversion.
21627 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21629 2001-10-12 Ravi Pratap <ravi@ximian.com>
21631 * cs-parser.jay (delegate_declaration): Store the fully qualified
21632 name as it is a type declaration.
21634 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21637 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21638 as TypeContainer::DefineType.
21640 (Populate): Method in which all the definition of the various methods (Invoke)
21643 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21646 (CloseDelegate): Finally creates the delegate.
21648 * class.cs (TypeContainer::DefineType): Update to define delegates.
21649 (Populate, Emit and CloseType): Do the same thing here too.
21651 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21652 delegates in all these operations.
21654 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21656 * expression.cs: LocalTemporary: a new expression used to
21657 reference a temporary that has been created.
21659 * assign.cs: Handle PropertyAccess back here, so that we can
21660 provide the proper semantic access to properties.
21662 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21663 a few more explicit conversions.
21665 * modifiers.cs: `NEW' modifier maps to HideBySig.
21667 * expression.cs (PropertyExpr): Make this into an
21668 ExpressionStatement, and support the EmitStatement code path.
21670 Perform get/set error checking, clean up the interface.
21672 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21673 them into toplevel access objects.
21675 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21677 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21680 * typemanager.cs: Keep track here of our PropertyBuilders again to
21681 work around lameness in SRE.
21683 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21685 * expression.cs (LValue::LValueResolve): New method in the
21686 interface, used to perform a second resolution pass for LValues.
21688 (This::DoResolve): Catch the use of this in static methods.
21690 (This::LValueResolve): Implement.
21692 (This::Store): Remove warning, assigning to `this' in structures
21695 (Invocation::Emit): Deal with invocation of
21696 methods on value types. We need to pass the address to structure
21697 methods rather than the object itself. (The equivalent code to
21698 emit "this" for structures leaves the entire structure on the
21699 stack instead of a pointer to it).
21701 (ParameterReference::DoResolve): Compute the real index for the
21702 argument based on whether the method takes or not a `this' pointer
21703 (ie, the method is static).
21705 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21706 value types returned from functions when we need to invoke a
21707 method on the sturcture.
21710 2001-10-11 Ravi Pratap <ravi@ximian.com>
21712 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21713 defining the type in the Modulebuilder or Typebuilder. This is to take
21714 care of nested types which need to be defined on the TypeBuilder using
21715 DefineNestedMethod.
21717 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21718 methods in RootContext, only ported to be part of TypeContainer.
21720 (TypeContainer::GetInterfaceOrClass): Ditto.
21722 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21724 * interface.cs (Interface::DefineInterface): New method. Does exactly
21725 what RootContext.CreateInterface did earlier, only it takes care of nested types
21728 (Interface::GetInterfaces): Move from RootContext here and port.
21730 (Interface::GetInterfaceByName): Same here.
21732 * rootcontext.cs (ResolveTree): Re-write.
21734 (PopulateTypes): Re-write.
21736 * class.cs (TypeContainer::Populate): Populate nested types too.
21737 (TypeContainer::Emit): Emit nested members too.
21739 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21740 instead just use the name argument passed in as it is already fully
21743 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21744 to TypeContainer mapping to see if a type is user-defined.
21746 * class.cs (TypeContainer::CloseType): Implement.
21748 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21749 the default constructor.
21751 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21754 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21756 * interface.cs (CloseType): Create the type here.
21758 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21761 Remove all the methods which are now in TypeContainer.
21763 2001-10-10 Ravi Pratap <ravi@ximian.com>
21765 * delegate.cs (Define): Re-write bits to define the delegate
21768 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21770 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21772 * expression.cs (ImplicitReferenceConversion): handle null as well
21773 as a source to convert to any reference type.
21775 * statement.cs (Return): Perform any implicit conversions to
21776 expected return type.
21778 Validate use of return statement.
21780 * codegen.cs (EmitContext): Pass the expected return type here.
21782 * class.cs (Method, Constructor, Property): Pass expected return
21783 type to EmitContext.
21785 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21787 * expression.cs: Make DoResolve take an EmitContext instead of a
21790 Replaced `l' and `location' for `loc', for consistency.
21792 (Error, Warning): Remove unneeded Tc argument.
21794 * assign.cs, literal.cs, constant.cs: Update to new calling
21797 * codegen.cs: EmitContext now contains a flag indicating whether
21798 code is being generated in a static method or not.
21800 * cs-parser.jay: DecomposeQI, new function that replaces the old
21801 QualifiedIdentifier. Now we always decompose the assembled
21802 strings from qualified_identifier productions into a group of
21805 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21807 * rootcontext.cs: Deal with field-less struct types correctly now
21808 by passing the size option to Define Type.
21810 * class.cs: Removed hack that created one static field.
21812 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21814 * statement.cs: Moved most of the code generation here.
21816 2001-10-09 Ravi Pratap <ravi@ximian.com>
21818 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21821 (ElementAccess): Remove useless bits for now - keep checks as the spec
21824 2001-10-08 Ravi Pratap <ravi@ximian.com>
21826 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21827 and start performing checks according to the spec.
21829 2001-10-07 Ravi Pratap <ravi@ximian.com>
21831 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21832 rank_specifiers instead.
21834 (rank_specifiers): Change the order in which the rank specifiers are stored
21836 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21838 * expression.cs (ElementAccess): Implement the LValue interface too.
21840 2001-10-06 Ravi Pratap <ravi@ximian.com>
21842 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21843 except that user defined conversions are not included.
21845 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
21846 perform the conversion of the return type, if necessary.
21848 (New::DoResolve): Check whether we are creating an array or an object
21849 and accordingly do the needful.
21851 (New::Emit): Same here.
21853 (New::DoResolve): Implement guts of array creation.
21855 (New::FormLookupType): Helper function.
21857 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21859 * codegen.cs: Removed most of the code generation here, and move the
21860 corresponding code generation bits to the statement classes.
21862 Added support for try/catch/finalize and throw.
21864 * cs-parser.jay: Added support for try/catch/finalize.
21866 * class.cs: Catch static methods having the flags override,
21867 virtual or abstract.
21869 * expression.cs (UserCast): This user cast was not really doing
21870 what it was supposed to do. Which is to be born in fully resolved
21871 state. Parts of the resolution were being performed at Emit time!
21875 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21877 * expression.cs: Implicity convert the result from UserCast.
21879 2001-10-05 Ravi Pratap <ravi@ximian.com>
21881 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21882 prevented it from working correctly.
21884 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21885 merely ConvertImplicit.
21887 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21889 * typemanager.cs: Make the LookupTypeContainer function static,
21890 and not per-instance.
21892 * class.cs: Make static FindMembers (the one that takes a Type
21895 * codegen.cs: Add EmitForeach here.
21897 * cs-parser.jay: Make foreach a toplevel object instead of the
21898 inline expansion, as we need to perform semantic analysis on it.
21900 2001-10-05 Ravi Pratap <ravi@ximian.com>
21902 * expression.cs (Expression::ImplicitUserConversion): Rename to
21903 UserDefinedConversion.
21905 (Expression::UserDefinedConversion): Take an extra argument specifying
21906 whether we look for explicit user conversions too.
21908 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21910 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21912 (ExplicitUserConversion): Make it a call to UserDefinedConversion
21913 with the appropriate arguments.
21915 * cs-parser.jay (cast_expression): Record location too.
21917 * expression.cs (Cast): Record location info.
21919 (Expression::ConvertExplicit): Take location argument.
21921 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21922 to determine if we are doing explicit conversions.
21924 (UserCast::Emit): Update accordingly.
21926 (Expression::ConvertExplicit): Report an error if everything fails.
21928 * ../errors/cs0030.cs : Add.
21930 2001-10-04 Miguel de Icaza <miguel@ximian.com>
21932 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21933 virtual and newslot bits.
21935 * class.cs (TypeContainer::RegisterRequiredImplementations):
21936 Record methods we need.
21938 (TypeContainer::MakeKey): Helper function to make keys for
21939 MethodBases, since the Methodbase key is useless.
21941 (TypeContainer::Populate): Call RegisterRequiredImplementations
21942 before defining the methods.
21944 Create a mapping for method_builders_to_methods ahead of time
21945 instead of inside a tight loop.
21947 (::RequireMethods): Accept an object as the data to set into the
21948 hashtable so we can report interface vs abstract method mismatch.
21950 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21952 * report.cs: Make all of it static.
21954 * rootcontext.cs: Drop object_type and value_type computations, as
21955 we have those in the TypeManager anyways.
21957 Drop report instance variable too, now it is a global.
21959 * driver.cs: Use try/catch on command line handling.
21961 Add --probe option to debug the error reporting system with a test
21964 * report.cs: Add support for exiting program when a probe
21965 condition is reached.
21967 2001-10-03 Ravi Pratap <ravi@ximian.com>
21969 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21970 we do a forcible conversion regardless of type, to check if
21971 ForceConversion returns a null.
21973 (Binary::error19): Use location to report error.
21975 (Unary::error23): Use location here too.
21977 * ../errors/cs0019.cs : Check in.
21979 * ../errors/cs0023.cs : Check in.
21981 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21982 case of a non-null MethodInfo object with a length of 0 !
21984 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21985 an applicable member - according to the spec :-)
21986 Also fix logic to find members in base types.
21988 (Unary::ResolveOperator): Same here.
21990 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21991 as I was getting thoroughly confused between this and error19 :-)
21993 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21994 (::FindMostEncompassedType): Implement.
21995 (::FindMostEncompassingType): Implement.
21996 (::StandardConversionExists): Implement.
21998 (UserImplicitCast): Re-vamp. We now need info about most specific
21999 source and target types so that we can do the necessary conversions.
22001 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22002 mathematical union with no duplicates.
22004 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22006 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22007 in order from base classes to child classes, so that we can in
22008 child classes look up in our parent for method names and
22009 attributes (required for handling abstract, virtual, new, override
22010 constructs: we need to instrospect our base class, and if we dont
22011 populate the classes in order, the introspection might be
22012 incorrect. For example, a method could query its parent before
22013 the parent has any methods and would determine that the parent has
22014 no abstract methods (while it could have had them)).
22016 (RootContext::CreateType): Record the order in which we define the
22019 2001-10-02 Miguel de Icaza <miguel@ximian.com>
22021 * class.cs (TypeContainer::Populate): Also method definitions can
22022 fail now, keep track of this.
22024 (TypeContainer::FindMembers): Implement support for
22025 DeclaredOnly/noDeclaredOnly flag.
22027 (Constructor::Emit) Return the ConstructorBuilder.
22029 (Method::Emit) Return the MethodBuilder.
22030 Check for abstract or virtual methods to be public.
22032 * rootcontext.cs (RootContext::CreateType): Register all the
22033 abstract methods required for the class to be complete and the
22034 interface methods that must be implemented.
22036 * cs-parser.jay: Report error 501 (method requires body if it is
22037 not marked abstract or extern).
22039 * expression.cs (TypeOf::Emit): Implement.
22041 * typemanager.cs: runtime_handle_type, new global type.
22043 * class.cs (Property::Emit): Generate code for properties.
22045 2001-10-02 Ravi Pratap <ravi@ximian.com>
22047 * expression.cs (Unary::ResolveOperator): Find operators on base type
22048 too - we now conform exactly to the spec.
22050 (Binary::ResolveOperator): Same here.
22052 * class.cs (Operator::Define): Fix minor quirk in the tests.
22054 * ../errors/cs0215.cs : Added.
22056 * ../errors/cs0556.cs : Added.
22058 * ../errors/cs0555.cs : Added.
22060 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22062 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22063 single integer which is really efficient
22065 2001-10-01 Ravi Pratap <ravi@ximian.com>
22067 * expression.cs (Expression::ImplicitUserConversion): Use location
22068 even in the case when we are examining True operators.
22070 * class.cs (Operator::Define): Perform extensive checks to conform
22071 with the rules for operator overloading in the spec.
22073 * expression.cs (Expression::ImplicitReferenceConversion): Implement
22074 some of the other conversions mentioned in the spec.
22076 * typemanager.cs (array_type): New static member for the System.Array built-in
22079 (cloneable_interface): For System.ICloneable interface.
22081 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22082 we start resolving the tree and populating types.
22084 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22086 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22088 * expression.cs (Expression::ExprClassFromMemberInfo,
22089 Expression::Literalize): Create literal expressions from
22090 FieldInfos which are literals.
22092 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22093 type casts, because they were wrong. The test suite in tests
22096 (ImplicitNumericConversion): ushort to ulong requires a widening
22099 Int32 constant to long requires widening cast as well.
22101 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22102 for integers because the type on the stack is not i4.
22104 2001-09-30 Miguel de Icaza <miguel@ximian.com>
22106 * expression.cs (report118): require location argument.
22108 * parameter.cs: Do not dereference potential null value.
22110 * class.cs: Catch methods that lack the `new' keyword when
22111 overriding a name. Report warnings when `new' is used without
22112 anything being there to override.
22114 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22116 * class.cs: Only add constructor to hashtable if it is non-null
22117 (as now constructors can fail on define).
22119 (TypeManager, Class, Struct): Take location arguments.
22121 Catch field instance initialization in structs as errors.
22123 accepting_filter: a new filter for FindMembers that is static so
22124 that we dont create an instance per invocation.
22126 (Constructor::Define): Catch errors where a struct constructor is
22129 * cs-parser.jay: Pass location information for various new
22132 * delegate.cs (Delegate): take a location argument.
22134 * driver.cs: Do not call EmitCode if there were problesm in the
22135 Definition of the types, as many Builders wont be there.
22137 * decl.cs (Decl::Decl): Require a location argument.
22139 * cs-tokenizer.cs: Handle properly hex constants that can not fit
22140 into integers, and find the most appropiate integer for it.
22142 * literal.cs: Implement ULongLiteral.
22144 * rootcontext.cs: Provide better information about the location of
22145 failure when CreateType fails.
22147 2001-09-29 Miguel de Icaza <miguel@ximian.com>
22149 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22152 * expression.cs (Binary::CheckShiftArguments): Add missing type
22154 (Binary::ResolveOperator): Add type to the logical and and logical
22155 or, Bitwise And/Or and Exclusive Or code paths, it was missing
22158 (Binary::DoNumericPromotions): In the case where either argument
22159 is ulong (and most signed types combined with ulong cause an
22160 error) perform implicit integer constant conversions as well.
22162 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22164 * expression.cs (UserImplicitCast): Method should always be
22166 (Invocation::BetterConversion): Simplified test for IntLiteral.
22168 (Expression::ImplicitNumericConversion): Split this routine out.
22169 Put the code that performs implicit constant integer conversions
22172 (Expression::Resolve): Become a wrapper around DoResolve so we can
22173 check eclass and type being set after resolve.
22175 (Invocation::Badness): Remove this dead function
22177 (Binary::ResolveOperator): Do not compute the expensive argumnets
22178 unless we have a union for it.
22180 (Probe::Emit): Is needs to do an isinst and then
22181 compare against null.
22183 (::CanConvert): Added Location argument. If the Location argument
22184 is null (Location.Null), then we do not report errors. This is
22185 used by the `probe' mechanism of the Explicit conversion. We do
22186 not want to generate an error for something that the user
22187 explicitly requested to be casted. But the pipeline for an
22188 explicit cast first tests for potential implicit casts.
22190 So for now, if the Location is null, it means `Probe only' to
22191 avoid adding another argument. Might have to revise this
22194 (ClassCast): New class used to type cast objects into arbitrary
22195 classes (used in Explicit Reference Conversions).
22197 Implement `as' as well.
22199 Reverted all the patches from Ravi below: they were broken:
22201 * The use of `level' as a mechanism to stop recursive
22202 invocations is wrong. That was there just to catch the
22203 bug with a strack trace but not as a way of addressing
22206 To fix the problem we have to *understand* what is going
22207 on and the interactions and come up with a plan, not
22208 just get things going.
22210 * The use of the type conversion cache that I proposed
22211 last night had an open topic: How does this work across
22212 protection domains. A user defined conversion might not
22213 be public in the location where we are applying the
22214 conversion, a different conversion might be selected
22215 (ie, private A->B (better) but public B->A (worse),
22216 inside A, A->B applies, but outside it, B->A will
22219 * On top of that (ie, even if the above is solved),
22220 conversions in a cache need to be abstract. Ie, `To
22221 convert from an Int to a Short use an OpcodeCast', not
22222 `To convert from an Int to a Short use the OpcodeCast on
22223 the variable 5' (which is what this patch was doing).
22225 2001-09-28 Ravi Pratap <ravi@ximian.com>
22227 * expression.cs (Invocation::ConversionExists): Re-write to use
22228 the conversion cache
22230 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22231 cache all conversions done, not just user-defined ones.
22233 (Invocation::BetterConversion): The real culprit. Use ConversionExists
22234 to determine if a conversion exists instead of acutually trying to
22235 perform the conversion. It's faster too.
22237 (Expression::ConvertExplicit): Modify to use ConversionExists to check
22238 and only then attempt the implicit conversion.
22240 2001-09-28 Ravi Pratap <ravi@ximian.com>
22242 * expression.cs (ConvertImplicit): Use a cache for conversions
22243 already found. Check level of recursion and bail out if necessary.
22245 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22247 * typemanager.cs (string_concat_string_string, string_concat_object_object):
22248 Export standard methods that we expect for string operations.
22250 * statement.cs (Block::UsageWarning): Track usage of variables and
22251 report the errors for not used variables.
22253 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22256 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22258 * codegen.cs: remove unnneded code
22260 * expression.cs: Removed BuiltinTypeAccess class
22262 Fix the order in which implicit conversions are
22265 The previous fixed dropped support for boxed conversions (adding a
22266 test to the test suite now)
22268 (UserImplicitCast::CanConvert): Remove test for source being null,
22269 that code is broken. We should not feed a null to begin with, if
22270 we do, then we should track the bug where the problem originates
22271 and not try to cover it up here.
22273 Return a resolved expression of type UserImplicitCast on success
22274 rather than true/false. Ravi: this is what I was talking about,
22275 the pattern is to use a static method as a "constructor" for
22278 Also, do not create arguments until the very last minute,
22279 otherwise we always create the arguments even for lookups that
22280 will never be performed.
22282 (UserImplicitCast::Resolve): Eliminate, objects of type
22283 UserImplicitCast are born in a fully resolved state.
22285 * typemanager.cs (InitCoreTypes): Init also value_type
22286 (System.ValueType).
22288 * expression.cs (Cast::Resolve): First resolve the child expression.
22290 (LValue): Add new method AddressOf to be used by
22293 Change the argument of Store to take an EmitContext instead of an
22294 ILGenerator, because things like FieldExpr need to be able to call
22295 their children expression to generate the instance code.
22297 (Expression::Error, Expression::Warning): Sugar functions for
22300 (Expression::MemberLookup): Accept a TypeContainer instead of a
22301 Report as the first argument.
22303 (Expression::ResolvePrimary): Killed. I still want to improve
22304 this as currently the code is just not right.
22306 (Expression::ResolveMemberAccess): Simplify, but it is still
22309 (Unary::Resolve): Catch errors in AddressOf operators.
22311 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22312 index to a byte for the short-version, or the compiler will choose
22313 the wrong Emit call, which generates the wrong data.
22315 (ParameterReference::Emit, ::Store): same.
22317 (FieldExpr::AddressOf): Implement.
22319 * typemanager.cs: TypeManager: made public variable instead of
22322 * driver.cs: document --fatal.
22324 * report.cs (ErrorMessage, WarningMessage): new names for the old
22325 Error and Warning classes.
22327 * cs-parser.jay (member_access): Turn built-in access to types
22328 into a normal simplename
22330 2001-09-27 Ravi Pratap <ravi@ximian.com>
22332 * expression.cs (Invocation::BetterConversion): Fix to cope
22333 with q being null, since this was introducing a bug.
22335 * expression.cs (ConvertImplicit): Do built-in conversions first.
22337 2001-09-27 Ravi Pratap <ravi@ximian.com>
22339 * expression.cs (UserImplicitCast::Resolve): Fix bug.
22341 2001-09-27 Ravi Pratap <ravi@ximian.com>
22343 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22344 I had introduced long ago (what's new ?).
22346 * expression.cs (UserImplicitCast::CanConvert): Static method to do
22347 the work of all the checking.
22348 (ConvertImplicit): Call CanConvert and only then create object if necessary.
22349 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22351 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22352 that is the right way.
22354 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
22355 overloading resolution. Use everywhere instead of cutting and pasting code.
22357 (Binary::ResolveOperator): Use MakeUnionSet.
22359 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
22360 we have to convert to bool types. Not complete yet.
22362 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22364 * typemanager.cs (TypeManager::CSharpName): support ushort.
22366 * expression.cs (Expression::TryImplicitIntConversion): Attempts
22367 to provide an expression that performsn an implicit constant int
22368 conversion (section 6.1.6).
22369 (Expression::ConvertImplicitRequired): Reworked to include
22370 implicit constant expression conversions.
22372 (Expression::ConvertNumericExplicit): Finished.
22374 (Invocation::Emit): If InstanceExpression is null, then it means
22375 that we perform a call on this.
22377 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22379 * expression.cs (Unary::Emit): Remove some dead code.
22380 (Probe): Implement Resolve and Emit for `is'.
22381 (Expression::ConvertImplicitRequired): Attempt to do constant
22382 expression conversions here. Maybe should be moved to
22383 ConvertImplicit, but I am not sure.
22384 (Expression::ImplicitLongConstantConversionPossible,
22385 Expression::ImplicitIntConstantConversionPossible): New functions
22386 that tell whether is it possible to apply an implicit constant
22387 expression conversion.
22389 (ConvertNumericExplicit): Started work on explicit numeric
22392 * cs-parser.jay: Update operator constants.
22394 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22395 (Parameters::GetSignature): Hook up VerifyArgs here.
22396 (Parameters::VerifyArgs): Verifies that no two arguments have the
22399 * class.cs (Operator): Update the operator names to reflect the
22400 ones that the spec expects (as we are just stringizing the
22403 * expression.cs (Unary::ResolveOperator): Fix bug: Use
22404 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22405 previous usage did only work for our methods.
22406 (Expression::ConvertImplicit): Handle decimal implicit numeric
22407 conversions as well.
22408 (Expression::InternalTypeConstructor): Used to invoke constructors
22409 on internal types for default promotions.
22411 (Unary::Emit): Implement special handling for the pre/post
22412 increment/decrement for overloaded operators, as they need to have
22413 the same semantics as the other operators.
22415 (Binary::ResolveOperator): ditto.
22416 (Invocation::ConversionExists): ditto.
22417 (UserImplicitCast::Resolve): ditto.
22419 2001-09-26 Ravi Pratap <ravi@ximian.com>
22421 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22422 operator, return after emitting body. Regression tests pass again !
22424 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22425 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22426 (Invocation::OverloadResolve): Ditto.
22427 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22429 * everywhere : update calls to the above methods accordingly.
22431 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22433 * assign.cs (Assign): Make it inherit from ExpressionStatement.
22435 * expression.cs (ExpressionStatement): New base class used for
22436 expressions that can appear in statements, so that we can provide
22437 an alternate path to generate expression that do not leave a value
22440 (Expression::Emit, and all the derivatives): We no longer return
22441 whether a value is left on the stack or not. Every expression
22442 after being emitted leaves a single value on the stack.
22444 * codegen.cs (EmitContext::EmitStatementExpression): Use the
22445 facilties of ExpressionStatement if possible.
22447 * cs-parser.jay: Update statement_expression.
22449 2001-09-25 Miguel de Icaza <miguel@ximian.com>
22451 * driver.cs: Change the wording of message
22453 2001-09-25 Ravi Pratap <ravi@ximian.com>
22455 * expression.cs (Binary::ResolveOperator): Had forgottten to set
22456 the type of the expression to the return type of the method if
22457 we have an overloaded operator match ! The regression tests pass again !
22458 (Unary::ResolveOperator): Ditto.
22460 * expression.cs (Invocation::ConversionExists): Correct the member lookup
22461 to find "op_Implicit", not "implicit" ;-)
22462 (UserImplicitCast): New class to take care of user-defined implicit conversions.
22463 (ConvertImplicit, ForceConversion): Take TypeContainer argument
22465 * everywhere : Correct calls to the above accordingly.
22467 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22468 (ConvertImplicit): Do user-defined conversion if it exists.
22470 2001-09-24 Miguel de Icaza <miguel@ximian.com>
22472 * assign.cs: track location.
22473 (Resolve): Use implicit conversions on assignment.
22475 * literal.cs: Oops. Not good, Emit of short access values should
22476 pass (Bytes) or the wrong argument will be selected.
22478 * expression.cs (Unary::Emit): Emit code for -expr.
22480 (Unary::ResolveOperator): Handle `Substract' for non-constants
22481 (substract from zero from the non-constants).
22482 Deal with Doubles as well.
22484 (Expression::ConvertImplicitRequired): New routine that reports an
22485 error if no implicit conversion exists.
22487 (Invocation::OverloadResolve): Store the converted implicit
22488 expressions if we make them
22490 2001-09-24 Ravi Pratap <ravi@ximian.com>
22492 * class.cs (ConstructorInitializer): Take a Location argument.
22493 (ConstructorBaseInitializer): Same here.
22494 (ConstructorThisInitializer): Same here.
22496 * cs-parser.jay : Update all calls accordingly.
22498 * expression.cs (Unary, Binary, New): Take location argument.
22499 Update accordingly everywhere.
22501 * cs-parser.jay : Update all calls to the above to take a location
22504 * class.cs : Ditto.
22506 2001-09-24 Ravi Pratap <ravi@ximian.com>
22508 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22509 (Invocation::BetterConversion): Same here
22510 (Invocation::ConversionExists): Ditto.
22512 (Invocation::ConversionExists): Implement.
22514 2001-09-22 Ravi Pratap <ravi@ximian.com>
22516 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22517 Also take an additional TypeContainer argument.
22519 * All over : Pass in TypeContainer as argument to OverloadResolve.
22521 * typemanager.cs (CSharpName): Update to check for the string type and return
22524 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22527 2001-09-21 Ravi Pratap <ravi@ximian.com>
22529 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22530 (Invocation::BetterFunction): Implement.
22531 (Invocation::BetterConversion): Implement.
22532 (Invocation::ConversionExists): Skeleton, no implementation yet.
22534 Okay, things work fine !
22536 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22538 * typemanager.cs: declare and load enum_type, delegate_type and
22541 * expression.cs (Expression::Emit): Now emit returns a value that
22542 tells whether a value is left on the stack or not. This strategy
22543 might be reveted tomorrow with a mechanism that would address
22544 multiple assignments.
22545 (Expression::report118): Utility routine to report mismatches on
22548 (Unary::Report23): Report impossible type/operator combination
22551 (Unary::IsIncrementableNumber): Whether the type can be
22552 incremented or decremented with add.
22553 (Unary::ResolveOperator): Also allow enumerations to be bitwise
22555 (Unary::ResolveOperator): Implement ++, !, ~,
22557 (Invocation::Emit): Deal with new Emit convetion.
22559 * All Expression derivatives: Updated their Emit method to return
22560 whether they leave values on the stack or not.
22562 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22563 stack for expressions that are statements.
22565 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22567 * expression.cs (LValue): New interface. Must be implemented by
22569 (LocalVariableReference, ParameterReference, FieldExpr): Implement
22572 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22573 interface for generating code, simplifies the code.
22575 2001-09-20 Ravi Pratap <ravi@ximian.com>
22577 * expression.cs (everywhere): Comment out return statements in ::Resolve
22578 methods to avoid the warnings.
22580 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22582 * driver.cs (parse): Report error 2001 if we can not open the
22585 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22588 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22591 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22592 otherwise nested blocks end up with the same index.
22594 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22596 * expression.cs: Instead of having FIXMEs in the Resolve
22597 functions, throw exceptions so it is obvious that we are facing a
22600 * cs-parser.jay (invocation_expression): Pass Location information.
22602 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22603 Use a basename for those routines because .NET does not like paths
22606 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22609 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22611 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22612 are loading the correct data types (throws an exception if not).
22613 (TypeManager::InitCoreTypes): Use CoreLookupType
22615 * expression.cs (Unary::ResolveOperator): return the child
22616 expression for expressions which are just +expr.
22617 (Unary::ResolveOperator): Return negative literals for -LITERAL
22618 expressions (otherwise they are Unary {Literal}).
22619 (Invocation::Badness): Take into account `Implicit constant
22620 expression conversions'.
22622 * literal.cs (LongLiteral): Implement long literal class.
22623 (IntLiteral): export the `Value' of the intliteral.
22625 2001-09-19 Ravi Pratap <ravi@ximian.com>
22627 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22629 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22630 instead of 'Operator'
22632 * expression.cs (Binary::ResolveOperator): Update accordingly.
22633 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22636 * cs-parser.jay (unary_expression): Update to use the new names.
22638 * gen-treedump.cs (GetUnary): Same here.
22640 * expression.cs (Unary::Resolve): Implement.
22641 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22642 operators are found instead of making noise ;-)
22643 (Unary::ResolveOperator): New method to do precisely the same thing which
22644 Binary::ResolveOperator does for Binary expressions.
22645 (Unary.method, .Arguments): Add.
22646 (Unary::OperName): Implement.
22647 (Unary::ForceConversion): Copy and Paste !
22649 * class.cs (Operator::Define): Fix a small bug for the case when we have
22652 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22653 for the inbuilt operators. Only overloading works for now ;-)
22655 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22657 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22658 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22660 * expression.cs (This::Emit): Implement.
22661 (This::Resolve): Implement.
22662 (TypeOf:Resolve): Implement.
22663 (Expression::ResolveSimpleName): Add an implicit this to instance
22665 (MemberAccess::Resolve): Deal with Parameters and Fields.
22666 Bind instance variable to Field expressions.
22667 (FieldExpr::Instance): New field used to track the expression that
22668 represents the object instance.
22669 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22671 (FieldExpr::Emit): Implement.
22673 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22674 the last instruction contains a return opcode to avoid generating
22675 the last `ret' instruction (this generates correct code, and it is
22676 nice to pass the peverify output).
22678 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22679 initializer for static and instance variables.
22680 (Constructor::Emit): Allow initializer to be null in the case of
22681 static constructors. Only emit initializer for instance
22684 (TypeContainer::FindMembers): Return a null array if there are no
22687 Also fix the code for the MemberTypes.Method branch, as it was not
22688 scanning that for operators (or tried to access null variables before).
22690 * assign.cs (Assign::Emit): Handle instance and static fields.
22694 * driver.cs: Stop compilation if there are parse errors.
22696 * cs-parser.jay (constructor_declaration): Provide default base
22697 initializer for non-static constructors.
22698 (constructor_declarator): Do not provide a default base
22699 initializers if none was specified.
22700 Catch the fact that constructors should not have parameters.
22702 * class.cs: Do not emit parent class initializers for static
22703 constructors, that should be flagged as an error.
22705 2001-09-18 Ravi Pratap <ravi@ximian.com>
22707 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22708 Move back code into TypeContainer::Populate.
22710 2001-09-18 Ravi Pratap <ravi@ximian.com>
22712 * class.cs (TypeContainer::AddConstructor): Fix the check to
22713 compare against Name, not Basename.
22714 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22716 * cs-parser.jay : Update accordingly.
22718 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22719 for methods, don't forget to look into the operators too.
22720 (RegisterMethodBuilder): Helper method to take care of this for
22721 methods, constructors and operators.
22722 (Operator::Define): Completely revamp.
22723 (Operator.OperatorMethod, MethodName): New fields.
22724 (TypeContainer::Populate): Move the registering of builders into
22725 RegisterMethodBuilder.
22726 (Operator::Emit): Re-write.
22728 * expression.cs (Binary::Emit): Comment out code path to emit method
22729 invocation stuff for the case when we have a user defined operator. I am
22730 just not able to get it right !
22732 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22734 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22737 (Expression::MemberLookup): Provide a version that allows to
22738 specify the MemberTypes and BindingFlags.
22740 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22741 so it was not fetching variable information from outer blocks.
22743 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22744 Beforefieldinit as it was buggy.
22746 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22747 that Ravi put here.
22749 * class.cs (Constructor::Emit): Only emit if block is not null.
22750 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22751 deal with this by semantically definining it as if the user had
22754 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22755 constructors as we now "emit" them at a higher level.
22757 (TypeContainer::DefineDefaultConstructor): Used to define the
22758 default constructors if none was provided.
22760 (ConstructorInitializer): Add methods Resolve and Emit.
22762 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22764 2001-09-17 Ravi Pratap <ravi@ximian.com>
22766 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22767 the default constructor builder with our hashtable for methodbuilders
22770 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22771 and argument_count is 0 in which case we have a match.
22772 (Binary::ResolveOperator): More null checking and miscellaneous coding
22775 2001-09-17 Ravi Pratap <ravi@ximian.com>
22777 * rootcontext.cs (IsNameSpace): Compare against null.
22779 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22781 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22782 and Unary::Operator.
22784 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22787 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22788 we have overloaded operators.
22789 (Binary::ResolveOperator): Implement the part which does the operator overload
22792 * class.cs (Operator::Emit): Implement.
22793 (TypeContainer::Emit): Emit the operators we have too.
22795 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22796 the case when we have a user-defined operator.
22798 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22800 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22802 2001-09-16 Ravi Pratap <ravi@ximian.com>
22804 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22805 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22806 (Constructor::Emit): Implement.
22807 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22808 if we have no work to do.
22809 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22812 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22813 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22815 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22818 2001-09-15 Ravi Pratap <ravi@ximian.com>
22820 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22822 (Tree::RecordNamespace): Method to do what the name says ;-)
22823 (Tree::Namespaces): Property to get at the namespaces hashtable.
22825 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22828 * rootcontext.cs (IsNamespace): Fixed it :-)
22830 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22832 * class.cs (TypeContainer::FindMembers): Add support for
22834 (MethodCore): New class that encapsulates both the shared aspects
22835 of a Constructor and a Method.
22836 (Method, Constructor): Factored pieces into MethodCore.
22838 * driver.cs: Added --fatal which makes errors throw exceptions.
22839 Load System assembly as well as part of the standard library.
22841 * report.cs: Allow throwing exceptions on errors for debugging.
22843 * modifiers.cs: Do not use `parent', instead use the real type
22844 container to evaluate permission settings.
22846 * class.cs: Put Ravi's patch back in. He is right, and we will
22847 have to cope with the
22849 2001-09-14 Ravi Pratap <ravi@ximian.com>
22851 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22852 FamORAssem, not FamANDAssem.
22854 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22856 * driver.cs: Added --parse option that only parses its input files
22859 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
22860 incorrect. IsTopLevel is not used to tell whether an object is
22861 root_types or not (that can be achieved by testing this ==
22862 root_types). But to see if this is a top-level *class* (not
22863 necessarly our "toplevel" container).
22865 2001-09-14 Ravi Pratap <ravi@ximian.com>
22867 * enum.cs (Enum::Define): Modify to call the Lookup method on the
22868 parent instead of a direct call to GetType.
22870 2001-09-14 Ravi Pratap <ravi@ximian.com>
22872 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22873 Modifiers.TypeAttr. This should just be a call to that method.
22875 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22876 object so that we can determine if we are top-level or not.
22878 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
22881 * enum.cs (Enum::Define): Ditto.
22883 * modifiers.cs (FieldAttr): Re-write.
22885 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22886 (TypeContainer::HaveStaticConstructor): New property to provide access
22887 to precisely that info.
22889 * modifiers.cs (MethodAttr): Re-write.
22890 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22892 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22893 of top-level types as claimed.
22895 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22897 * expression.cs (MemberLookup): Fruitless attempt to lookup
22898 constructors. Maybe I need to emit default constructors? That
22899 might be it (currently .NET emits this for me automatically).
22900 (Invocation::OverloadResolve): Cope with Arguments == null.
22901 (Invocation::EmitArguments): new function, shared by the new
22902 constructor and us.
22903 (Invocation::Emit): Handle static and instance methods. Emit
22904 proper call instruction for virtual or non-virtual invocations.
22905 (New::Emit): Implement.
22906 (New::Resolve): Implement.
22907 (MemberAccess:Resolve): Implement.
22908 (MethodGroupExpr::InstanceExpression): used conforming to the spec
22909 to track instances.
22910 (FieldExpr::Resolve): Set type.
22912 * support.cs: Handle empty arguments.
22914 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22915 SimpleLookup): Auxiliary routines to help parse a qualifier
22918 Update qualifier_identifier rule.
22920 * codegen.cs: Removed debugging messages.
22922 * class.cs: Make this a global thing, this acts just as a "key" to
22923 objects that we might have around.
22925 (Populate): Only initialize method_builders_to_methods once.
22927 * expression.cs (PropertyExpr): Initialize type from the
22930 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22931 Resolve pattern. Attempt to implicitly convert value to boolean.
22934 * expression.cs: Set the type for the int32/int32 argument case.
22935 (Binary::ResolveOperator): Set the return type to boolean for
22936 comparission operators
22938 * typemanager.cs: Remove debugging print code.
22940 (Invocation::Resolve): resolve type.
22942 * class.cs: Allocate a MemberInfo of the correct size, as the code
22943 elsewhere depends on the test to reflect the correct contents.
22945 (Method::) Keep track of parameters, due to System.Reflection holes
22947 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22950 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22951 of the exact size and return that.
22953 (Class::LookupMethodByBuilder): New function that maps
22954 MethodBuilders to its methods. Required to locate the information
22955 on methods because System.Reflection bit us again.
22957 * support.cs: New file, contains an interface ParameterData and
22958 two implementations: ReflectionParameters and InternalParameters
22959 used to access Parameter information. We will need to grow this
22962 * expression.cs (Invocation::GetParameterData): implement a cache
22963 and a wrapper around the ParameterData creation for methods.
22964 (Invocation::OverloadResolve): Use new code.
22966 2001-09-13 Ravi Pratap <ravi@ximian.com>
22968 * class.cs (TypeContainer::EmitField): Remove and move into
22969 (Field::Define): here and modify accordingly.
22970 (Field.FieldBuilder): New member.
22971 (TypeContainer::Populate): Update accordingly.
22972 (TypeContainer::FindMembers): Implement.
22974 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22976 * statement.cs: (VariableInfo::VariableType): New field to be
22977 initialized with the full type once it is resolved.
22979 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22981 * parameter.cs (GetParameterInfo): Use a type cache to compute
22982 things only once, and to reuse this information
22984 * expression.cs (LocalVariableReference::Emit): Implement.
22985 (OpcodeCast::Emit): fix.
22987 (ParameterReference::Resolve): Implement.
22988 (ParameterReference::Emit): Implement.
22990 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22991 that are expressions need to stay as Expressions.
22993 * typemanager.cs (CSharpName): Returns the C# name of a type if
22996 * expression.cs (Expression::ConvertImplicit): New function that
22997 implements implicit type conversions.
22999 (Expression::ImplicitReferenceConversion): Implements implicit
23000 reference conversions.
23002 (EmptyCast): New type for transparent casts.
23004 (OpcodeCast): New type for casts of types that are performed with
23005 a sequence of bytecodes.
23007 (BoxedCast): New type used for casting value types into reference
23008 types. Emits a box opcode.
23010 (Binary::DoNumericPromotions): Implements numeric promotions of
23011 and computation of the Binary::Type.
23013 (Binary::EmitBranchable): Optimization.
23015 (Binary::Emit): Implement code emission for expressions.
23017 * typemanager.cs (TypeManager): Added two new core types: sbyte
23020 2001-09-12 Ravi Pratap <ravi@ximian.com>
23022 * class.cs (TypeContainer::FindMembers): Method which does exactly
23023 what Type.FindMembers does, only we don't have to use reflection. No
23024 implementation yet.
23026 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23027 typecontainer objects as we need to get at them.
23028 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23030 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23031 typecontainer object.
23033 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23034 of just a Report object.
23036 2001-09-11 Ravi Pratap <ravi@ximian.com>
23038 * class.cs (Event::Define): Go back to using the prefixes "add_" and
23040 (TypeContainer::Populate): Now define the delegates of the type too.
23041 (TypeContainer.Delegates): Property to access the list of delegates defined
23044 * delegates.cs (Delegate::Define): Implement partially.
23046 * modifiers.cs (TypeAttr): Handle more flags.
23048 2001-09-11 Ravi Pratap <ravi@ximian.com>
23050 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23052 (Operator::Define): Re-write logic to get types by using the LookupType method
23053 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23054 (Indexer::Define): Ditto.
23055 (Event::Define): Ditto.
23056 (Property::Define): Ditto.
23058 2001-09-10 Ravi Pratap <ravi@ximian.com>
23060 * class.cs (TypeContainer::Populate): Now define operators too.
23061 (TypeContainer.Operators): New property to access the list of operators
23063 (Operator.OperatorMethodBuilder): New member to hold the method builder
23064 for the operator we are defining.
23065 (Operator::Define): Implement.
23067 2001-09-10 Ravi Pratap <ravi@ximian.com>
23069 * class.cs (Event::Define): Make the prefixes of the accessor methods
23070 addOn_ and removeOn_
23072 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23073 of the location being passed in too. Ideally, this should go later since all
23074 error reporting should be done through the Report object.
23076 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23077 (Populate): Iterate thru the indexers we have and define them too.
23078 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23079 for the get and set accessors.
23080 (Indexer::Define): Implement.
23082 2001-09-09 Miguel de Icaza <miguel@ximian.com>
23084 * expression.cs (Binary::Resolve): Beginning of it. I scratched
23085 my previous implementation, did not work.
23087 * typemanager.cs: Add a couple of missing types (the longs).
23089 * literal.cs: Use TypeManager.bool_type instead of getting it.
23091 * expression.cs (EventExpr): New kind of expressions.
23092 (Expressio::ExprClassFromMemberInfo): finish
23094 2001-09-08 Miguel de Icaza <miguel@ximian.com>
23096 * assign.cs: Emit stores to static fields differently.
23098 2001-09-08 Ravi Pratap <ravi@ximian.com>
23100 * Merge in changes and adjust code to tackle conflicts. Backed out my
23101 code in Assign::Resolve ;-)
23103 2001-09-08 Ravi Pratap <ravi@ximian.com>
23105 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23106 instead Report.Error and also pass in the location.
23107 (CSharpParser::Lexer): New readonly property to return the reference
23108 to the Tokenizer object.
23109 (declare_local_variables): Use Report.Error with location instead of plain
23113 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23114 (Operator.CheckBinaryOperator): Ditto.
23116 * cs-parser.jay (operator_declarator): Update accordingly.
23118 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23119 (CheckBinaryOperator): Same here.
23121 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23122 on the name without any prefixes of namespace names etc. This is because we
23123 already might have something already fully qualified like
23124 'System.Console.WriteLine'
23126 * assign.cs (Resolve): Begin implementation. Stuck ;-)
23128 2001-09-07 Ravi Pratap <ravi@ximian.com>
23130 * cs-tokenizer.cs (location): Return a string which also contains
23133 * expression.cs (ElementAccess): New class for expressions of the
23134 type 'element access.'
23135 (BaseAccess): New class for expressions of the type 'base access.'
23136 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23139 * cs-parser.jay (element_access): Implement action.
23140 (base_access): Implement actions.
23141 (checked_expression, unchecked_expression): Implement.
23143 * cs-parser.jay (local_variable_type): Correct and implement.
23144 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23146 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23148 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23149 name and the specifiers.
23151 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23153 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
23154 making them all public ;-)
23156 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23159 2001-09-07 Miguel de Icaza <miguel@ximian.com>
23161 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23163 (FieldExpr, PropertyExprs): New resolved expressions.
23164 (SimpleName::MemberStaticCheck): Perform static checks for access
23165 to non-static fields on static methods. Maybe this should be
23166 generalized for MemberAccesses.
23167 (SimpleName::ResolveSimpleName): More work on simple name
23170 * cs-parser.jay (primary_expression/qualified_identifier): track
23171 the parameter index.
23173 * codegen.cs (CodeGen::Save): Catch save exception, report error.
23174 (EmitContext::EmitBoolExpression): Chain to expression generation
23175 instead of temporary hack.
23176 (::EmitStatementExpression): Put generic expression code generation.
23178 * assign.cs (Assign::Emit): Implement variable assignments to
23179 local variables, parameters and fields.
23181 2001-09-06 Miguel de Icaza <miguel@ximian.com>
23183 * statement.cs (Block::GetVariableInfo): New method, returns the
23184 VariableInfo for a variable name in a block.
23185 (Block::GetVariableType): Implement in terms of GetVariableInfo
23187 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23188 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23190 2001-09-06 Ravi Pratap <ravi@ximian.com>
23192 * cs-parser.jay (operator_declaration): Continue on my quest : update
23193 to take attributes argument.
23194 (event_declaration): Ditto.
23195 (enum_declaration): Ditto.
23196 (indexer_declaration): Ditto.
23198 * class.cs (Operator::Operator): Update constructor accordingly.
23199 (Event::Event): Ditto.
23201 * delegate.cs (Delegate::Delegate): Same here.
23203 * enum.cs (Enum::Enum): Same here.
23205 2001-09-05 Ravi Pratap <ravi@ximian.com>
23207 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23209 * ../tests/cs0658.cs : New file to demonstrate error 0658.
23211 * attribute.cs (Attributes): New class to encapsulate all attributes which were
23212 being passed around as an arraylist.
23213 (Attributes::AddAttribute): Method to add attribute sections.
23215 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23216 (struct_declaration): Update accordingly.
23217 (constant_declaration): Update.
23218 (field_declaration): Update.
23219 (method_header): Update.
23220 (fixed_parameter): Update.
23221 (parameter_array): Ditto.
23222 (property_declaration): Ditto.
23223 (destructor_declaration): Ditto.
23225 * class.cs (Struct::Struct): Update constructors accordingly.
23226 (Class::Class): Ditto.
23227 (Field::Field): Ditto.
23228 (Method::Method): Ditto.
23229 (Property::Property): Ditto.
23230 (TypeContainer::OptAttribute): update property's return type.
23232 * interface.cs (Interface.opt_attributes): New member.
23233 (Interface::Interface): Update to take the extra Attributes argument.
23235 * parameter.cs (Parameter::Parameter): Ditto.
23237 * constant.cs (Constant::Constant): Ditto.
23239 * interface.cs (InterfaceMemberBase): New OptAttributes field.
23240 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
23241 the attributes as a parameter.
23242 (InterfaceProperty): Update constructor call.
23243 (InterfaceEvent): Ditto.
23244 (InterfaceMethod): Ditto.
23245 (InterfaceIndexer): Ditto.
23247 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
23248 pass the attributes too.
23249 (interface_event_declaration): Ditto.
23250 (interface_property_declaration): Ditto.
23251 (interface_method_declaration): Ditto.
23252 (interface_declaration): Ditto.
23254 2001-09-05 Miguel de Icaza <miguel@ximian.com>
23256 * class.cs (Method::Define): Track the "static Main" definition to
23257 create an entry point.
23259 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23260 EntryPoint if we find it.
23262 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23263 (EmitContext::ig): Make this variable public.
23265 * driver.cs: Make the default output file be the first file name
23266 with the .exe extension.
23268 Detect empty compilations
23270 Handle various kinds of output targets. Handle --target and
23271 rename -t to --dumper.
23273 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23274 methods inherited from Expression return now an Expression. This
23275 will is used during the tree rewriting as we resolve them during
23278 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23279 the spec. Missing entirely is the information about
23280 accessability of elements of it.
23282 (Expression::ExprClassFromMemberInfo): New constructor for
23283 Expressions that creates a fully initialized Expression based on
23284 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23287 (Invocation::Resolve): Begin implementing resolution of invocations.
23289 * literal.cs (StringLiteral): Implement Emit.
23291 2001-09-05 Ravi Pratap <ravi@ximian.com>
23293 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23296 2001-09-04 Ravi Pratap <ravi@ximian.com>
23298 * cs-parser.jay (attribute_arguments): Implement actions.
23299 (attribute): Fix bug in production. Implement action.
23300 (attribute_list): Implement.
23301 (attribute_target): Implement.
23302 (attribute_target_specifier, opt_target_specifier): Implement
23303 (CheckAttributeTarget): New method to check if the attribute target
23305 (attribute_section): Implement.
23306 (opt_attributes): Implement.
23308 * attribute.cs : New file to handle attributes.
23309 (Attribute): Class to hold attribute info.
23311 * cs-parser.jay (opt_attribute_target_specifier): Remove production
23312 (attribute_section): Modify production to use 2 different rules to
23313 achieve the same thing. 1 s/r conflict down !
23314 Clean out commented, useless, non-reducing dimension_separator rules.
23316 * class.cs (TypeContainer.attributes): New member to hold list
23317 of attributes for a type.
23318 (Struct::Struct): Modify to take one more argument, the attribute list.
23319 (Class::Class): Ditto.
23320 (Field::Field): Ditto.
23321 (Method::Method): Ditto.
23322 (Property::Property): Ditto.
23324 * cs-parser.jay (struct_declaration): Update constructor call to
23325 pass in the attributes too.
23326 (class_declaration): Ditto.
23327 (constant_declaration): Ditto.
23328 (field_declaration): Ditto.
23329 (method_header): Ditto.
23330 (fixed_parameter): Ditto.
23331 (parameter_array): Ditto.
23332 (property_declaration): Ditto.
23334 * constant.cs (Constant::Constant): Update constructor similarly.
23335 Use System.Collections.
23337 * parameter.cs (Parameter::Parameter): Update as above.
23339 2001-09-02 Ravi Pratap <ravi@ximian.com>
23341 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23342 (TypeContainer.delegates): New member to hold list of delegates.
23344 * cs-parser.jay (delegate_declaration): Implement the action correctly
23345 this time as I seem to be on crack ;-)
23347 2001-09-02 Miguel de Icaza <miguel@ximian.com>
23349 * rootcontext.cs (RootContext::IsNamespace): new function, used to
23350 tell whether an identifier represents a namespace.
23352 * expression.cs (NamespaceExpr): A namespace expression, used only
23353 temporarly during expression resolution.
23354 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23355 utility functions to resolve names on expressions.
23357 2001-09-01 Miguel de Icaza <miguel@ximian.com>
23359 * codegen.cs: Add hook for StatementExpressions.
23361 * class.cs: Fix inverted test for static flag in methods.
23363 2001-09-02 Ravi Pratap <ravi@ximian.com>
23365 * class.cs (Operator::CheckUnaryOperator): Correct error number used
23366 to make it coincide with MS' number.
23367 (Operator::CheckBinaryOperator): Ditto.
23369 * ../errors/errors.txt : Remove error numbers added earlier.
23371 * ../errors/cs1019.cs : Test case for error # 1019
23373 * ../errros/cs1020.cs : Test case for error # 1020
23375 * cs-parser.jay : Clean out commented cruft.
23376 (dimension_separators, dimension_separator): Comment out. Ostensibly not
23377 used anywhere - non-reducing rule.
23378 (namespace_declarations): Non-reducing rule - comment out.
23380 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23381 with TypeContainer::AddEnum.
23383 * delegate.cs : New file for delegate handling classes.
23384 (Delegate): Class for declaring delegates.
23386 * makefile : Update.
23388 * cs-parser.jay (delegate_declaration): Implement.
23390 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
23392 * class.cs (Event::Define): Implement.
23393 (Event.EventBuilder): New member.
23395 * class.cs (TypeContainer::Populate): Update to define all enums and events
23397 (Events): New property for the events arraylist we hold. Shouldn't we move to using
23398 readonly fields for all these cases ?
23400 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23402 * class.cs (Property): Revamp to use the convention of making fields readonly.
23403 Accordingly modify code elsewhere.
23405 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23406 the Define method of the Property class.
23408 * class.cs : Clean up applied patch and update references to variables etc. Fix
23410 (TypeContainer::Populate): Update to define all the properties we have. Also
23411 define all enumerations.
23413 * enum.cs (Define): Implement.
23415 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23417 * cs-parser.jay (overloadable_operator): The semantic value is an
23418 enum of the Operator class.
23419 (operator_declarator): Implement actions.
23420 (operator_declaration): Implement.
23422 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23423 validity of definitions.
23424 (Operator::CheckBinaryOperator): Static method to check for binary operators
23425 (TypeContainer::AddOperator): New method to add an operator to a type.
23427 * cs-parser.jay (indexer_declaration): Added line to actually call the
23428 AddIndexer method so it gets added ;-)
23430 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
23431 already taken care of by the MS compiler ?
23433 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23435 * class.cs (Operator): New class for operator declarations.
23436 (Operator::OpType): Enum for the various operators.
23438 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23440 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23441 ostensibly handle this in semantic analysis.
23443 * cs-parser.jay (general_catch_clause): Comment out
23444 (specific_catch_clauses, specific_catch_clause): Ditto.
23445 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23446 (catch_args, opt_catch_args): New productions.
23447 (catch_clause): Rewrite to use the new productions above
23448 (catch_clauses): Modify accordingly.
23449 (opt_catch_clauses): New production to use in try_statement
23450 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23451 and re-write the code in the actions to extract the specific and
23452 general catch clauses by being a little smart ;-)
23454 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23455 Hooray, try and catch statements parse fine !
23457 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23459 * statement.cs (Block::GetVariableType): Fix logic to extract the type
23460 string from the hashtable of variables.
23462 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23463 I end up making that mistake ;-)
23464 (catch_clauses): Fixed gross error which made Key and Value of the
23465 DictionaryEntry the same : $1 !!
23467 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23469 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23471 * cs-parser.jay (event_declaration): Correct to remove the semicolon
23472 when the add and remove accessors are specified.
23474 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23476 * cs-parser.jay (IndexerDeclaration): New helper class to hold
23477 information about indexer_declarator.
23478 (indexer_declarator): Implement actions.
23479 (parsing_indexer): New local boolean used to keep track of whether
23480 we are parsing indexers or properties. This is necessary because
23481 implicit_parameters come into picture even for the get accessor in the
23482 case of an indexer.
23483 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23485 * class.cs (Indexer): New class for indexer declarations.
23486 (TypeContainer::AddIndexer): New method to add an indexer to a type.
23487 (TypeContainer::indexers): New member to hold list of indexers for the
23490 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23492 * cs-parser.jay (add_accessor_declaration): Implement action.
23493 (remove_accessor_declaration): Implement action.
23494 (event_accessors_declaration): Implement
23495 (variable_declarators): swap statements for first rule - trivial.
23497 * class.cs (Event): New class to hold information about event
23499 (TypeContainer::AddEvent): New method to add an event to a type
23500 (TypeContainer::events): New member to hold list of events.
23502 * cs-parser.jay (event_declaration): Implement actions.
23504 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23506 * cs-parser.jay (dim_separators): Implement. Make it a string
23507 concatenating all the commas together, just as they appear.
23508 (opt_dim_separators): Modify accordingly
23509 (rank_specifiers): Update accordingly. Basically do the same
23510 thing - instead, collect the brackets here.
23511 (opt_rank_sepcifiers): Modify accordingly.
23512 (array_type): Modify to actually return the complete type string
23513 instead of ignoring the rank_specifiers.
23514 (expression_list): Implement to collect the expressions
23515 (variable_initializer): Implement. We make it a list of expressions
23516 essentially so that we can handle the array_initializer case neatly too.
23517 (variable_initializer_list): Implement.
23518 (array_initializer): Make it a list of variable_initializers
23519 (opt_array_initializer): Modify accordingly.
23521 * expression.cs (New::NType): Add enumeration to help us
23522 keep track of whether we have an object/delegate creation
23523 or an array creation.
23524 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23525 members to hold data about array creation.
23526 (New:New): Modify to update NewType
23527 (New:New): New Overloaded contructor for the array creation
23530 * cs-parser.jay (array_creation_expression): Implement to call
23531 the overloaded New constructor.
23533 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23535 * class.cs (TypeContainer::Constructors): Return member
23536 constructors instead of returning null.
23538 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23540 * typemanager.cs (InitCoreTypes): Initialize the various core
23541 types after we have populated the type manager with the user
23542 defined types (this distinction will be important later while
23543 compiling corlib.dll)
23545 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23546 on Expression Classification. Now all expressions have a method
23547 `Resolve' and a method `Emit'.
23549 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23550 generation from working. Also add some temporary debugging
23553 2001-08-24 Miguel de Icaza <miguel@ximian.com>
23555 * codegen.cs: Lots of code generation pieces. This is only the
23556 beginning, will continue tomorrow with more touches of polish. We
23557 handle the fundamentals of if, while, do, for, return. Others are
23558 trickier and I need to start working on invocations soon.
23560 * gen-treedump.cs: Bug fix, use s.Increment here instead of
23563 * codegen.cs (EmitContext): New struct, used during code
23564 emission to keep a context. Most of the code generation will be
23567 * cs-parser.jay: Add embedded blocks to the list of statements of
23568 this block. So code generation proceeds in a top down fashion.
23570 2001-08-23 Miguel de Icaza <miguel@ximian.com>
23572 * statement.cs: Add support for multiple child blocks.
23574 2001-08-22 Miguel de Icaza <miguel@ximian.com>
23576 * codegen.cs (EmitCode): New function, will emit the code for a
23577 Block of code given a TypeContainer and its ILGenerator.
23579 * statement.cs (Block): Standard public readonly optimization.
23580 (Block::Block constructors): Link children.
23581 (Block::Child): Child Linker.
23582 (Block::EmitVariables): Emits IL variable declarations.
23584 * class.cs: Drop support for MethodGroups here, delay until
23586 (Method::): Applied the same simplification that I did before, and
23587 move from Properties to public readonly fields.
23588 (Method::ParameterTypes): Returns the parameter types for the
23589 function, and implements a cache that will be useful later when I
23590 do error checking and the semantic analysis on the methods is
23592 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23593 and made a method, optional argument tells whether this is a class
23594 or a structure to apply the `has-this' bit.
23595 (Method::GetCallingConvention): Implement, returns the calling
23597 (Method::Define): Defines the type, a second pass is performed
23598 later to populate the methods.
23600 (Constructor::ParameterTypes): implement a cache similar to the
23601 one on Method::ParameterTypes, useful later when we do semantic
23604 (TypeContainer::EmitMethod): New method. Emits methods.
23606 * expression.cs: Removed MethodGroup class from here.
23608 * parameter.cs (Parameters::GetCallingConvention): new method.
23610 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23612 * class.cs (TypeContainer::Populate): Drop RootContext from the
23615 (Constructor::CallingConvention): Returns the calling convention.
23616 (Constructor::ParameterTypes): Returns the constructor parameter
23619 (TypeContainer::AddConstructor): Keep track of default constructor
23620 and the default static constructor.
23622 (Constructor::) Another class that starts using `public readonly'
23623 instead of properties.
23625 (Constructor::IsDefault): Whether this is a default constructor.
23627 (Field::) use readonly public fields instead of properties also.
23629 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23630 track of static constructors; If none is used, turn on
23631 BeforeFieldInit in the TypeAttributes.
23633 * cs-parser.jay (opt_argument_list): now the return can be null
23634 for the cases where there are no arguments.
23636 (constructor_declarator): If there is no implicit `base' or
23637 `this', then invoke the default parent constructor.
23639 * modifiers.cs (MethodAttr): New static function maps a set of
23640 modifiers flags into a MethodAttributes enum
23641 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23642 MethodAttr, TypeAttr to represent the various mappings where the
23643 modifiers are used.
23644 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23646 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23648 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23651 * interface.cs (PopulateIndexer): Implemented the code generator
23652 for interface indexers.
23654 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23656 * interface.cs (InterfaceMemberBase): Now we track the new status
23659 (PopulateProperty): Implement property population. Woohoo! Got
23660 Methods and Properties going today.
23662 Removed all the properties for interfaces, and replaced them with
23663 `public readonly' fields.
23665 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23667 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23668 initialize their hashtables/arraylists only when they are needed
23669 instead of doing this always.
23671 * parameter.cs: Handle refs and out parameters.
23673 * cs-parser.jay: Use an ArrayList to construct the arguments
23674 instead of the ParameterCollection, and then cast that to a
23677 * parameter.cs: Drop the use of ParameterCollection and use
23678 instead arrays of Parameters.
23680 (GetParameterInfo): Use the Type, not the Name when resolving
23683 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23685 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23686 and instead use public readonly fields.
23688 * class.cs: Put back walking code for type containers.
23690 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23692 * class.cs (MakeConstant): Code to define constants.
23694 * rootcontext.cs (LookupType): New function. Used to locate types
23697 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23699 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23700 this System.Reflection code is. Kudos to Microsoft
23702 * typemanager.cs: Implement a type cache and avoid loading all
23703 types at boot time. Wrap in LookupType the internals. This made
23704 the compiler so much faster. Wow. I rule!
23706 * driver.cs: Make sure we always load mscorlib first (for
23707 debugging purposes, nothing really important).
23709 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23710 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23712 * rootcontext.cs: Lookup types on their namespace; Lookup types
23713 on namespaces that have been imported using the `using' keyword.
23715 * class.cs (TypeContainer::TypeAttr): Virtualize.
23716 (Class::TypeAttr): Return attributes suitable for this bad boy.
23717 (Struct::TypeAttr): ditto.
23718 Handle nested classes.
23719 (TypeContainer::) Remove all the type visiting code, it is now
23720 replaced with the rootcontext.cs code
23722 * rootcontext.cs (GetClassBases): Added support for structs.
23724 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23726 * interface.cs, statement.cs, class.cs, parameter.cs,
23727 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23728 Drop use of TypeRefs, and use strings instead.
23730 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23734 * class.cs (Struct::Struct): set the SEALED flags after
23735 checking the modifiers.
23736 (TypeContainer::TypeAttr): new property, returns the
23737 TypeAttributes for a class.
23739 * cs-parser.jay (type_list): Oops, list production was creating a
23740 new list of base types.
23742 * rootcontext.cs (StdLib): New property.
23743 (GetInterfaceTypeByName): returns an interface by type name, and
23744 encapsulates error handling here.
23745 (GetInterfaces): simplified.
23746 (ResolveTree): Encapsulated all the tree resolution here.
23747 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23750 * driver.cs: Add support for --nostdlib, to avoid loading the
23751 default assemblies.
23752 (Main): Do not put tree resolution here.
23754 * rootcontext.cs: Beginning of the class resolution.
23756 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23758 * rootcontext.cs: Provide better error reporting.
23760 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23762 * rootcontext.cs (CreateInterface): Handle the case where there
23763 are no parent interfaces.
23765 (CloseTypes): Routine to flush types at the end.
23766 (CreateInterface): Track types.
23767 (GetInterfaces): Returns an array of Types from the list of
23768 defined interfaces.
23770 * typemanager.c (AddUserType): Mechanism to track user types (puts
23771 the type on the global type hash, and allows us to close it at the
23774 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23776 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23777 RecordInterface instead.
23779 * cs-parser.jay: Updated to reflect changes above.
23781 * decl.cs (Definition): Keep track of the TypeBuilder type that
23782 represents this type here. Not sure we will use it in the long
23783 run, but wont hurt for now.
23785 * driver.cs: Smaller changes to accomodate the new code.
23787 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23790 * rootcontext.cs (CreateInterface): New method, used to create
23791 the System.TypeBuilder type for interfaces.
23792 (ResolveInterfaces): new entry point to resolve the interface
23794 (CodeGen): Property, used to keep track of the code generator.
23796 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23798 * cs-parser.jay: Add a second production for delegate_declaration
23801 (enum_body): Put an opt_comma here instead of putting it on
23802 enum_body or enum_member_declarations so we can handle trailing
23803 commas on enumeration members. Gets rid of a shift/reduce.
23805 (type_list): Need a COMMA in the middle.
23807 (indexer_declaration): Tell tokenizer to recognize get/set
23809 * Remove old targets.
23811 * Re-add the parser target.
23813 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23815 * cs-parser.jay: Add precendence rules for a number of operators
23816 ot reduce the number of shift/reduce conflicts in the grammar.
23818 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23820 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23823 Get rid of old crufty code.
23825 * rootcontext.cs: Use this to keep track of the parsed
23826 representation and the defined types available to the program.
23828 * gen-treedump.cs: adjust for new convention.
23830 * type.cs: Split out the type manager, and the assembly builder
23833 * typemanager.cs: the type manager will live here now.
23835 * cil-codegen.cs: And the code generator here.
23837 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23839 * makefile: Fixed up for easy making.
23841 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23843 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23846 (unary_expression): Expand pre_increment_expression and
23847 post_decrement_expression to reduce a shift/reduce.
23849 2001-07-11 Simon Cozens
23851 * cs-tokenizer.cs: Hex numbers should begin with a 0.
23853 Improve allow_keyword_as_indent name.
23855 2001-06-19 Miguel de Icaza <miguel@ximian.com>
23857 * Adjustments for Beta2.
23859 2001-06-13 Miguel de Icaza <miguel@ximian.com>
23861 * decl.cs: Added `Define' abstract method.
23862 (InTransit): new property, used to catch recursive definitions.
23864 * interface.cs: Implement `Define'.
23866 * modifiers.cs: Map Modifiers.constants to
23867 System.Reflection.TypeAttribute flags.
23869 * class.cs: Keep track of types and user-defined types.
23870 (BuilderInit): New method for creating an assembly
23871 (ResolveType): New function to launch the resolution process, only
23872 used by interfaces for now.
23874 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23875 that are inserted into the name space.
23877 2001-06-08 Miguel de Icaza <miguel@ximian.com>
23879 * ARGH. I have screwed up my tree so many times due to the use of
23880 rsync rather than using CVS. Going to fix this at once.
23882 * driver.cs: Objetify driver. Load assemblies, use assemblies to
23885 2001-06-07 Miguel de Icaza <miguel@ximian.com>
23887 * Experiment successful: Use System.Type rather that our own
23890 2001-05-25 Miguel de Icaza <miguel@ximian.com>
23892 * cs-parser.jay: Removed nsAliases from here.
23894 Use new namespaces, handle `using XXX;'
23896 * namespace.cs: Reimplemented namespace handling, use a recursive
23897 definition of the class. Now we can keep track of using clauses
23898 and catch invalid using clauses.
23900 2001-05-24 Miguel de Icaza <miguel@ximian.com>
23902 * gen-treedump.cs: Adapted for all the renaming.
23904 * expression.cs (Expression): this class now has a Type property
23905 which returns an expression Type.
23907 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23908 `Type', as this has a different meaning now in the base
23910 2001-05-22 Miguel de Icaza <miguel@ximian.com>
23912 * interface.cs, class.cs: Removed from all the sources the
23913 references to signature computation, as we can not do method
23914 signature computation during the parsing time, as we are not
23915 trying to solve at that point distinguishing:
23919 void a (NS.Blah x) {}
23922 Which depending on the context might be valid or not, as we do not
23923 know if Blah is the same thing as NS.Blah at that point.
23925 * Redid everything so the code uses TypeRefs now instead of
23926 Types. TypeRefs are just temporary type placeholders, that need
23927 to be resolved. They initially have a pointer to a string and the
23928 current scope in which they are used. This is used later by the
23929 compiler to resolve the reference to an actual Type.
23931 * DeclSpace is no longer a CIR.Type, and neither are
23932 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23933 are all DeclSpaces, but no Types.
23935 * type.cs (TypeRefManager): This implements the TypeRef manager,
23936 which keeps track of all the types that need to be resolved after
23937 the parsing has finished.
23939 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23941 * ARGH. We are going to have to store `foreach' as a class rather
23942 than resolving it, as we need to verify error 1579 after name
23943 resolution. *OR* we could keep a flag that says `This request to
23944 IEnumerator comes from a foreach statement' which we can then use
23945 to generate the error.
23947 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23949 * class.cs (TypeContainer.AddMethod): we now add methods to the
23950 MethodGroup instead of the method hashtable.
23952 * expression.cs: Add MethodGroup abstraction, which gets us one
23953 step closer to the specification in the way we handle method
23956 * cs-parser.jay (primary_expression): qualified_identifier now
23957 tried to match up an identifier to a local variable reference or
23958 to a parameter reference.
23960 current_local_parameters is now a parser global variable that
23961 points to the current parameters for the block, used during name
23964 (property_declaration): Now creates an implicit `value' argument to
23967 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23969 * parameter.cs: Do not use `param' arguments as part of the
23970 signature, per the spec.
23972 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23974 * decl.cs: Base class for classes, structs and interfaces. This
23975 is the "Declaration Space"
23977 * cs-parser.jay: Use CheckDef for checking declaration errors
23978 instead of having one on each function.
23980 * class.cs: Factor out some code for handling error handling in
23981 accordance to the "Declarations" section in the "Basic Concepts"
23982 chapter in the ECMA C# spec.
23984 * interface.cs: Make all interface member classes derive from
23985 InterfaceMemberBase.
23987 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23989 * Many things: all interfaces are parsed and generated in
23990 gen-treedump. Support for member variables, constructors,
23991 destructors, properties, constants is there.
23993 Beginning of the IL backend, but very little done, just there for
23996 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23998 * cs-parser.jay: Fix labeled statement.
24000 * cs-tokenizer.cs (escape): Escape " and ' always.
24001 ref_line, ref_name: keep track of the line/filename as instructed
24002 by #line by the compiler.
24005 2001-04-27 Miguel de Icaza <miguel@ximian.com>
24007 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24008 to match the values in System.CodeDOM.
24010 Divid renamed to Divide.
24012 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24014 (Statements.set): remove.
24016 * System.CodeDOM/CodeCatchClause.cs: always have a valid
24019 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24020 falseStatements always have valid values.
24022 * cs-parser.jay: Use System.CodeDOM now.