1 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3 * anonymous.cs (AnonymousContainer): Don't crash when container
6 2005-10-23 Marek Safar <marek.safar@seznam.cz>
8 * expression.cs (Binary.DoResolve): Warn when comparing same
11 2005-10-23 Marek Safar <marek.safar@seznam.cz>
14 * expression.cs (Binary.DoResolve): It looks like there are no
15 convetsion rules in enum context.
17 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
19 Add support for extern alias qualifiers.
20 * typemanager.cs: Move some LookupTypeReflection code
21 to namespace.cs, to have cleaner code. Added some methods
22 to help us keep track of the extern aliased references.
23 * driver.cs: Add suport for extern alias assemblies on command
24 line and check for their warnings/errors. Also keep track of the
25 extern aliased assemblies.
26 * namespace.cs: Move the global functionality of Namespace
27 to GlobalRootNamespace/RootNamespace. Now the global namespace
28 is GlobalRootNamespace.Globa. Also the code moved from
29 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
30 Finally added LocalAliasEntry (AliasEntry before) and
31 ExternAliasEntry, to handle alias statements.
32 * cs-parser.jay: Add support in the grammar for extern alias
34 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
35 Update callings to Namespace (now in GlobalRootNamespace).
37 2005-10-25 Martin Baulig <martin@ximian.com>
39 * convert.cs (ImplicitTypeParameterConversion): Make base
40 interfaces actually work; fixes #76557.
42 2005-10-25 Martin Baulig <martin@ximian.com>
45 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
46 all the type parameters; fixes #76551.
48 2005-10-25 Martin Baulig <martin@ximian.com>
53 (GenericMethod.ctor): Added `Expression return_type' and
54 `Parameters parameters' arguments.
55 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
56 parameter and return types to check their constraints if they're
59 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
62 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
63 constraints of a generic type if `ec.ResolvingGenericMethod'.
65 * class.cs (MethodCore.DoDefineParameters): Set
66 `ec.ResolvingGenericMethod' if we're a generic method.
67 (MemberBase.MemberType): Likewise.
69 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
71 * typemanager.cs (TypeManager): Added
72 TypeManager.internals_visible_attr_type to cache
73 S.R.CompilerServices.InternalsVisibleToAttribute.
75 * codegen.cs (AssemblyClass): Added checks for
76 InternalsVisibleToAttribute in new method
77 CheckInternalsVisibleAttribute () and also cache the
78 AssemblyName in AssemblyClass.Name.
80 2005-10-24 Martin Baulig <martin@ximian.com>
83 (TypeManager.ExpandInterfaces): Added overloaded version which
84 just takes a `Type[]' array.
87 (Constraints.Resolve): Don't expand the interfaces here; ie. we
88 just use the interfaces which were explicitly specified and not
89 the interfaces they inherit. Fixes #76482.
90 (TypeParameter.FindMembers): Expand the interfaces here.
92 2005-10-21 Martin Baulig <martin@ximian.com>
95 (Constraints.Resolve): Also resolve the actual types here.
96 (Constraints.ResolveTypes): Just check the constraints here.
97 Fixes #76363; see gtest-218.cs.
99 2005-10-21 Martin Baulig <martin@ximian.com>
102 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
103 instead of a `BoxedCast'; fixes gtest-217.cs.
105 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
107 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
108 1) "new()" is specified as generic parameter constraint and 2) the
109 type is TypeBuilder and 3) the type is abstract even if it has a
110 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
112 2005-10-20 Martin Baulig <martin@ximian.com>
115 (GenericConstraints.TypeParameter): New public property.
116 (TypeParameter.ctor): Also take a `DeclSpace' argument.
117 (TypeParameter.DeclSpace): New public property.
118 (TypeParameter.DefineType): Inflate the constraints if our
119 `DeclSpace' is an `Iterator'.
121 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
123 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
124 GenericMethod argument to compare methods' generic type arguments.
127 2005-10-19 Martin Baulig <martin@ximian.com>
129 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
130 not ResolveType() when resolving the base type, so we're not
131 checking the constraints here.
132 (TypeContainer.ResolveType): Call ResolveType() on our base_type
135 2005-10-19 Martin Baulig <martin@ximian.com>
137 * generic.cs (ConstructedType.CheckConstraints): Committing
138 untested fix for #76441.
140 2005-10-18 Raja R Harinath <rharinath@novell.com>
143 * class.cs (TypeContainer.DefineType): Move updating of
144 topological sort earlier in the code.
145 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
147 2005-10-18 Marek Safar <marek.safar@seznam.cz>
150 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
152 * constant.cs (Constant.TryReduce): Moved from Cast class.
153 (Reduce): Made little bit more OO and fixed missing conversions.
155 * ecore.cs (Reduce): Implemented.
156 (Binary.EnumLiftUp): New method to upgrade values to enum values.
158 * literal.cs (Reduce): Implemented.
160 * class.cs: Reverted Miguel's wrong commit.
162 2005-10-14 Miguel de Icaza <miguel@novell.com>
164 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
166 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
168 * cs-parser.jay, expression.cs : CS0214 was missing error location
169 for constants. Fixed bug #76404.
171 2005-10-10 Raja R Harinath <rharinath@novell.com>
173 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
175 (PropertyExpr.EmitCall): Likewise.
176 * expression.cs (Invocation.EmitArguments): Handle case where
178 (Invocation.EmitCall): Avoid allocating temporary variable if
179 there are no arguments.
181 2005-10-11 Marek Safar <marek.safar@seznam.cz>
184 * convert.cs (ExplicitConversionCore): Fixed object->enum
187 2005-10-07 Raja R Harinath <rharinath@novell.com>
190 * convert.cs (ImplicitConversionStandard): Move conversion of
191 void* to arbitrary pointer types ...
192 (ExplicitConversionStandard): .. here.
193 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
194 error to always print typenames.
196 2005-10-07 Raja R Harinath <rharinath@novell.com>
198 * convert.cs (GetConversionOperator): Rename from
199 GetConversionOperators. Move operator selection code from ...
200 (UserDefinedConversion): ... here.
202 2005-10-06 Marek Safar <marek.safar@seznam.cz>
204 * convert.cs (ExplicitConversionCore): Removed duplicate enum
207 2005-10-05 Marek Safar <marek.safar@seznam.cz>
209 * assign.cs (Assign.DoResolve): Error method changed.
211 * cfold.cs (DoConstantNumericPromotions): Error method changed.
213 * const.cs (ResolveValue): Reset in_transit immediately.
215 * constant.cs: Error method changed.
217 * convert.cs: Removed useless location parameter.
218 (ExplicitNumericConversion): Don't do double enum check.
219 (ExplicitConversionCore): Renamed from ExplicitConversion.
220 (ExplicitUnsafe): Extracted from ExplicitConversion.
221 (ExplicitConversion): Uses for error reporting.
223 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
225 (ResolveBoolean): Uses common error method.
226 (CastToDecimal): Get rid of ec.
227 (CastFromDecimal): Optimized.
228 (ConvCast): Get rid of ec.
230 * enum.cs (ResolveValue): Reset in_transit immediately.
231 (Emit): Return after first error.
233 * expression.cs: Convert changes.
235 * literal.cs: Error method changed.
237 * statement.cs: Error method changed.
239 2005-10-06 Raja R Harinath <rharinath@novell.com>
241 Fix gtest-131.cs and gtest-211.cs.
242 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
243 Only emit code for a label if it is used. Unreachable code can
244 violate ECMA evaluation stack invariants.
246 2005-09-27 Marek Safar <marek.safar@seznam.cz>
248 * anonymous.cs: Implemented ExprClassName.
250 * assign.cs (Assign.DoResolve): Don't chrash when type is not
253 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
256 * class.cs (StaticClass.DefineContainerMembers): Report protected
259 * codegen.cs: if(ed) PRODUCTION.
261 * convert.cs (Error_CannotImplicitConversion): Better error
264 * cs-parser.jay: More error checks.
266 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
268 * driver.cs (CSCParseOption): Enabled wrong option check.
270 * ecore.cs (Expression.ExprClassName): Turned to property.
271 (MemberExpr.CheckIntermediateModification): For checking boxed
272 value types modification.
274 * statement.cs (Fixed.Resolve): Expression type must be
275 convertible to fixed type.
276 (CollectionForeach.GetEnumeratorFilter,TryType):
277 Small refactoring for easier error checking.
279 2005-09-26 Marek Safar <marek.safar@seznam.cz>
281 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
284 * class.cs (GeneratedBaseInitializer): New class for customization
285 compiler generated initializers.
286 (MemberBase.DoDefine): Check Obsolete attribute here.
287 (FieldMember.DoDefine): Ditto.
289 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
292 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
293 (MemberCore.GetObsoleteAttribute): Removed argument.
294 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
295 (MemberCore.CheckObsoleteType): New helper.
299 * statement.cs: Updates after MemberCore changes.
301 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
302 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
304 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
305 obsolete attribute for compiler construct.
306 (As.DoResolve): Cache result.
308 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
310 2005-10-01 Miguel de Icaza <miguel@novell.com>
312 * expression.cs (Probe): instead of having a "Type probe_type"
313 keep the extra information as a TypeExpr probe_type_expr since the
314 "As" operator needs to perform some type checks.
316 * (As.DoResolve): If the type is a type parameter, ensure that it
317 is constrained by a class.
319 2005-09-22 Miguel de Icaza <miguel@novell.com>
321 * statement.cs (Lock): Use the TemporaryVariable class instead of
322 manually using local variables as those do not work when variables
325 * ecore.cs: Moved the TemporaryVariable class from being a nested
326 class inside Foreach to be a public class that can be employed in
329 2005-09-19 Marek Safar <marek.safar@seznam.cz>
331 * cs-parser.jay: interface_accessors replaced by
332 accessor_declarations.
334 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
337 * statement.cs (GotoCase.Resolve): Convert null constant to
339 (SwitchLabel.ResolveAndReduce): Ditto.
340 (SwitchLabel.NullStringCase): Custom null stamp.
341 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
343 typemanager.cs (CSharpSignature): Don't skip first argument
346 2005-09-16 Marek Safar <marek.safar@seznam.cz>
348 * cfold.cs, constant.cs, convert.cs, ecore.cs,
349 expression.cs, iterators.cs, literal.cs: Store constants and
352 * class.cs (MemberBase.ShortName): Pass location.
354 * cs-parser.jay: Some location fixes.
356 * ecore.cs (Expression.Location): Made virtual.
358 2005-09-27 Marek Safar <marek.safar@seznam.cz>
361 * const.cs (Const.ResolveValue): Check for assigning non-null
362 value to reference type.
364 2005-09-26 Raja R Harinath <rharinath@novell.com>
367 * expression.cs (This.VerifyFixed): In a value type T, the type of
368 'this' is T&, iow, 'this' is either an out or ref parameter. In a
369 value type R, 'this' is treated as a value parameter.
371 2005-09-05 Miguel de Icaza <miguel@novell.com>
373 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
374 if the underlying types are the same, otherwise we need to produce
375 code that will do the proper cast.
377 This was exposed by Marek's constant rewrite which produced
378 invalid code for the call site:
385 This fixes test-49.cs
387 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
389 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
390 Type/Object should be allowed as well. Fixed bug #75968.
392 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
394 * expression.cs : (Binary.DoResolve): when one is enum constant and
395 another is constant 0, then return enum one *as enum type*.
398 2005-10-04 Martin Baulig <martin@ximian.com>
400 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
401 `SetMemberIsUsed()' work for generics, too.
403 2005-10-04 Martin Baulig <martin@ximian.com>
405 * expression.cs (DelegateInvocation.EmitStatement): Make this work
406 for corlib. Fixes #75691.
408 2005-09-28 Marek Safar <marek.safar@seznam.cz>
411 * driver.cs: Fix compilation files with full root path.
413 2005-09-25 Miguel de Icaza <miguel@novell.com>
415 * report.cs (SymbolRelatedToPreviousError): Format the output so
416 it does not use an open parenthesis that is never closed.
418 * driver.cs: Follow coding guidelines
420 2005-09-18 Miguel de Icaza <miguel@novell.com>
422 * driver.cs: Set InEmacs based on the environment variable EMACS.
424 * location.cs (InEmacs): in this mode, do not report column
425 location as it confuses Emacs.
427 2005-10-03 Raja R Harinath <rharinath@novell.com>
429 * support.cs (SeekableStreamReader.Position): Don't error out when
430 the requested position is just beyond the end of the current
433 2005-09-28 Raja R Harinath <rharinath@novell.com>
435 * support.cs (SeekableStreamReader): Simplify drastically. Don't
436 try to keep in sync with the byte count of the underlying Stream.
437 However, this limits us to a window size of 2048 characters: i.e.,
438 the maximum lookahead of our lexer/parser can be 2048 characters.
440 2005-09-22 Martin Baulig <martin@ximian.com>
442 * driver.cs: Removed a debugging FIXME.
444 2005-09-21 Raja R Harinath <rharinath@novell.com>
446 * cs-parser.jay (type_arguments): Add CS1644 check.
447 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
449 2005-09-15 Raja R Harinath <rharinath@novell.com>
451 * Makefile (PROGRAM): Make profile specific.
452 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
453 the current directory.
456 * expression.cs (Invocation.EmitCall): Remove optimization on
457 this_call since it doesn't handle 'this' being a value type.
459 2005-09-05 Geoff Norton <gnorton@customerdna.com>
461 * driver.cs: Ensure file handles are closed after parsing
463 2005-09-05 Miguel de Icaza <miguel@novell.com>
465 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
466 if the underlying types are the same, otherwise we need to produce
467 code that will do the proper cast.
469 This was exposed by Marek's constant rewrite which produced
470 invalid code for the call site:
477 This fixes test-49.cs
479 2005-09-05 Martin Baulig <martin@ximian.com>
481 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
482 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
484 * cs-parser.jay (delegate_declaration): Small fix for #75852.
486 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
488 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
489 to be a pointer type due to the spec 25.2, so check if declaring
490 type is generic type definition. Fixed bug #75772.
492 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
495 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
496 both types are not defined by methods.
497 * expression.cs : (Invocation.IsApplicable): it should work when
498 the argument type is equal to the parameter type, not only when
499 ImplicitConversionExists() returns true.
501 2005-09-02 Raja R Harinath <rharinath@novell.com>
503 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
507 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
508 flow-branching for LocalVariableReferences in case we were invoked
510 * expression.cs (LocalVariableReference.VerifyAssigned): New.
512 (LocalVariableReference.DoResolveBase): ... this.
513 (MemberAccess.Resolve): Do the check that was disabled during
516 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
519 (PartialContainer.Create): check abstract/sealed/static strictly
520 but abstract/sealed can exist only at one side. Fixed bug #75883.
522 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
525 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
526 specified, don't default to UnmanagedType.I4.
528 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
530 * expression.cs : conditional operator should check possibly
531 incorrect assign expression. Fixed bug #75946.
533 2005-08-30 Raja R Harinath <rharinath@novell.com>
536 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
537 (ScopeInfo.EmitScopeType): Use it to construct field names from
538 names of captured locals.
541 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
542 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
543 Pass 'target_type' to BoxedCast. Don't default to 'object'.
544 (ExplicitConversion): Remove enum cases already handled by
545 implicit conversion. Move implicit conversion check to the beginning.
546 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
547 * expression.cs (ArrayCreation.EmitDynamicInitializers):
548 Don't treat System.Enum as a struct.
550 2005-08-30 Jb Evain <jbevain@gmail.com>
552 * attribute.cs: handles as expression in parameters.
554 2005-08-30 Raja R Harinath <rharinath@novell.com>
557 * class.cs (TypeContainer.VerifyClsName): Don't use a
558 PartialContainer when verifying CLS compliance.
559 (AbstractPropertyEventMethod): Set Parent here, ...
560 (PropertyMethod): ... not here.
562 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
564 * attribute.cs : escaped attribute name should not be allowed to be
565 resolved (e.g. @class as classAttribute). Fixed bug #75930.
567 2005-08-29 Raja R Harinath <rharinath@novell.com>
570 * convert.cs (ImplicitStandardConversionExists): Allow zero also
571 when converting a long constant to unsigned long.
572 * expression.cs (Invocation.OverloadResolve): Add sanity check to
573 detect where IsApplicable and VerifyArgumentsCompat disagree.
575 2005-08-29 Raja R Harinath <rharinath@novell.com>
576 and Carlos Alberto Cortez <carlos@unixmexico.org>
579 * class.cs (TypeContainer.CanElideInitializer): New helper.
580 (TypeContainer.EmitFieldInitializers): Use it to determine if we
581 can safely emitting the initializer of a field.
583 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
585 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
586 allowed inside a switch (without loop). Fixed bug #75433.
588 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
590 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
591 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
593 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
595 * driver.cs : kinda reverting the default encoding changes (not exact
596 revert since I noticed that "codepage:reset" might not work fine).
598 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
600 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
601 Location. Now getter and setter store location correctly.
602 (errors/cs0111-12.cs now reports the expected location.)
604 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
606 * driver.cs : Use default encoding on the environment.
607 Removed (now that) extra parameter for SeekableStreamReader.
608 * support.cs : (SeekableStreamReader) third .ctor() argument for
609 StreamReader is not required (always true). preamble size could
610 be acquired in simpler and safe way.
612 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
614 * cs-parser.jay: report CS0642 at warning level 3
615 and report CS0642 for an if else statement also
616 fixes bug #74745. Patch by John Luke (and a bit
618 Removed extra CS0642 warning check for "while",
620 * statement.cs: In Block.Resolve(), CS0642 check
621 is reimplemented to check a sequence of an empty
622 statement and a block.
626 2005-08-24 Marek Safar <marek.safar@seznam.cz>
628 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
629 detection until I fix it.
631 * cs-tokenizer.cs: Changed error message.
633 * cs-parser.jay: Fixed 2 error locations.
635 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
636 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
639 * enum.cs (GetSignatureForError): Fixed.
641 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
645 * typemanager.cs (RegisterProperty): Removed.
647 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
649 2005-08-24 Raja R Harinath <rharinath@novell.com>
652 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
653 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
655 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
657 * expression.cs : tiny fix is required for not warning positive ulong.
660 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
662 * expression.cs : add CS0652 check for constant and integral
663 expression. Fixed bug #53974.
665 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
667 * expression.cs : in DoNumericPromotions(), check if there is implicit
668 conversion overload for string (to check CS0034). Fixed bug #52492.
670 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
672 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
674 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
676 * ecore.cs : report location when it is *not* Null.
678 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
684 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
685 correctly. Fixed bug #75721.
687 2005-08-23 Raja R Harinath <rharinath@novell.com>
689 * support.cs (SeekableStreamReader.Position): Avoid an expensive
690 loop that performs 'min (pos, char_count)'.
693 * expression.cs (Unary.ResolveOperator): Don't discard implicit
694 converted value in Operator.OnesComplement.
696 2005-08-22 Ben Maurer <bmaurer@ximian.com>
698 * anonymous.cs: If the anon method is pulled into a helper class,
699 it needs to be `internal' not `private'. Fixes runtime behavior on
702 2005-08-17 Marek Safar <marek.safar@seznam.cz>
705 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
708 2005-08-16 Marek Safar <marek.safar@seznam.cz>
710 The big constants rewrite
711 Fix #75746, #75685 and more
712 As a side effect saved 1MB for MWF ;-)
714 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
715 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
716 enum based for corlib compilation.
718 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
721 * class.cs (FixedField.Define): Use ResolveAsConstant.
723 * const.cs (IConstant): Interface constants and enums.
724 (Const.ResolveValue): New method for constant resolvning.
725 (ExternalConstant): Constants from imported assemblies.
727 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
728 conversion; like enums.
729 (Constant.ToType): Converts this constant to different type.
730 (Constant.Increment): Adds 1.
732 * convert.cs (ImplicitConversionRequired): Simplified.
734 * cs-parser.jay: Create EnumMember directly.
736 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
738 * doc.cs (GenerateEnumDocComment): Removed.
740 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
741 (ConvertIntLiteral): Removed.
742 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
744 * enum.cs (EnumMember): Implement IConstant.
745 (Enum.IsValidEnumConstant): Removed.
746 (Enum.GetNextDefaultValue): Removed.
747 (Enum.FindMembers): Updated.
748 (Enum.GenerateDocComment): Iterate enum members.
750 * expression.cs (Cast.TryReduce): Handle enums correctly.
751 (New.Constantify): Made public.
752 (MemberAccess.DoResolve): Removed contant specific if(s).
754 * literal.cs (NullLiteral): Implement new abstract methods.
756 * statement.cs (GotoCase.Resolve): Use new constant methods.
757 (SwitchLabel.ResolveAndReduce): Use new constant methods.
759 * typemanager.cs (LookupEnum): Removed.
760 (IsEnumType): Fixed to work with corlib.
761 (RegisterConstant): Removed.
762 (LookupConstant): Removed.
763 (GetConstant): Changed to work with IConstant.
765 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
767 * location.cs : Fixed overflown (>255) column number.
769 2005-08-03 Raja R Harinath <rharinath@novell.com>
771 First cut of the qualified-alias-member feature.
772 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
774 * cs-parser.jay (DOUBLE_COLON): New token.
775 (namespace_or_type_name): Add rule for recognizing
776 qualified-alias-members.
777 (primary_expression): Likewise.
778 (element_access): Allow QualifiedAliasMember as a possible
779 type-bearing expression.
780 (local_variable_type, local_variable_pointer_type): Likewise.
781 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
782 aliases in the current and enclosing namespace declarations.
783 (NamespaceEntry.UsingAlias): Add CS0440 warning.
784 * decl.cs (MemberName.is_double_colon): New.
785 (MemberName.MemberName): Add new constructor for alias-member.
786 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
787 * expression.cs (QualifiedAliasMember): New expression type.
789 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
791 * location.cs : it borked when no argument was specified.
793 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
795 * location.cs : tiny ToString() format fix.
797 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
799 * statement.cs : oops, it was missing.
801 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
803 A set of fixes for precise line/column location.
806 "token" field now holds a file/line "delta", a line number offset
807 from the segment, and a column number. See also:
808 http://lists.ximian.com/pipermail/mono-devel-list/2004-
810 Removed static IsNull. Use instance IsNull property instead.
812 For some tokens it stores Location. For Identifier it stores
813 LocatedToken which is a pair of string name and location.
814 Column numbers are adjusted only at getChar().
816 Use Location.ToString() for reporting (it now contains column).
818 Largely modified to use LocatedToken instead of
819 string (IDENTIFIER), and to acquire Location from some tokens.
820 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
821 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
823 Now MemberName holds Location. DeclSpace.ctor() receives Location
824 as a parameter. Removed extra parameters to all derived classes.
825 Replaced Location.IsNull() with instance property.
826 * assign.cs, expression.cs :
827 Added .ctor() overload that omits Location.
829 Added "nameEscaped" flag that indicates the identifier was escaped
830 in the source file. This fixes bug #57047.
832 2005-09-02 Martin Baulig <martin@ximian.com>
834 * class.cs: Make CS3005 a warning, not an error.
836 2005-08-02 Marek Safar <marek.safar@seznam.cz>
838 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
839 New method, looking for lo-case imported cls type.
841 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
844 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
846 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
848 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
850 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
852 Optimized to save 3.5 MB for SWF compilation.
854 2005-08-01 Marek Safar <marek.safar@seznam.cz>
856 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
857 (PartialContainer.Create): Moved logic AddToContainer.
858 (PartialContainer.MarkForDuplicationCheck): Shares name.
860 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
863 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
865 (Namespace.GetSignatureForError): New method.
867 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
868 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
870 2005-08-01 Raja R Harinath <rharinath@novell.com>
873 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
874 member lookup rather than qualifier_type, since qualifier_type can
877 2005-08-01 Marek Safar <marek.safar@seznam.cz>
879 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
882 2005-07-31 Miguel de Icaza <miguel@novell.com>
884 * statement.cs: Copy the local exception into the exception
885 captured local. Fixes 75674
887 2005-07-31 Raja R Harinath <harinath@gmail.com>
890 * expression.cs (Invocation.OverloadResolve): Don't report error
891 CS1501 if error CS1502 has been reported.
892 (New.DoResolve): Delegate CS1501 reporting to
893 Invocation.OverloadResolve.
896 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
897 invariant-meaning-in-block property in an enclosing block if
900 2005-07-29 Marek Safar <marek.safar@seznam.cz>
902 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
903 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
904 (Switch.CheckSwitch): Just save 50kb for SWF.
906 2005-07-27 Martin Baulig <martin@ximian.com>
908 * anonymous.cs (CaptureContext.AddField): Added
909 `AnonymousContainer am' argument; compute its toplevel scope if
910 it's not already computed. Fixes #75649.
912 2005-07-26 Raja R Harinath <rharinath@novell.com>
915 * class.cs (Constructor.Emit): Reset block to null if the block
918 2005-07-25 Marek Safar <marek.safar@seznam.cz>
920 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
922 2005-07-25 Marek Safar <marek.safar@seznam.cz>
924 * class.cs (MethodData.Define): Check whether accessor implementing
927 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
929 2005-07-22 Marek Safar <marek.safar@seznam.cz>
932 * namespace.cs (LookupType): Moved same type check to...
934 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
937 2005-07-21 Raja R Harinath <rharinath@novell.com>
939 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
940 already found a typebuilder.
941 * class.cs (MethodCore.IsDuplicateImplementation): Compare
942 MemberNames, not strings.
944 * const.cs (Error_ExpressionMustBeConst):
945 Rename from Error_EpressionMustBeConst.
946 * const.cs, class.cs, statement.cd: Update.
948 2005-07-21 Marek Safar <marek.safar@seznam.cz>
952 * const.cs (Const.LookupConstantValue): Report missing contant expression
954 (Error_EpressionMustBeConstant): Only one error method.
956 * class.cs, statement.c: Updated.
958 2005-07-20 Raja R Harinath <rharinath@novell.com>
960 * statement.cs (Block.Flags): Add back HasVarargs.
961 (Block.flags): Make protected.
962 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
964 * typemanager.cs (types, typecontainers, user_types): Remove.
965 (UserTypes, TypeContainers): Likewise.
966 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
967 (CleanUp, Reset): Update.
968 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
969 (GetNestedType): Use Type.GetNestedType.
970 (CoreLookupType): Take two arguments, the namespace and the
971 basename of the type. Update to use the Namespace.Lookup
973 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
974 (RealMemberLookup): Use IsNestedChildOf instead of playing with
975 string concatenation and substring matches.
976 * class.cs, enum.cs, delegate.cs: Update to changes.
978 2005-07-20 Marek Safar <marek.safar@seznam.cz>
980 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
981 Expression and made virtual.
983 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
984 (ImplicitStandardConversionExists): Fixed `byte' typo ?
986 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
988 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
991 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
994 2005-07-18 Marek Safar <marek.safar@seznam.cz>
997 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
998 AssemblyCultureAttribute is not used on executable.
1001 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1003 2005-07-16 Raja R Harinath <rharinath@novell.com>
1006 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1007 New. Reports CS0252/CS0253.
1008 Mostly taken from preliminary patch by Duncak Mak.
1009 (Binary.DoResolveOperator): Store results of operator lookup.
1010 Use them to detect if we need to warn about unintended reference
1013 2005-07-15 Raja R Harinath <rharinath@novell.com>
1016 * namespace.cs (Namespace.Lookup): Add back location parameter.
1017 (Namespace.LookupType): Add CS0436 report. Add location parameter.
1018 * delegate.cs, ecore.cs, expression.cs: Update to changes.
1020 * codegen.cs (EmitContext.DeclSpace): Make readonly.
1021 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1022 (Namespace.LookupType): ... this.
1023 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1025 * typemanager.cs (LookupTypeReflection): Remove buggy code that
1026 purported to handle pointers.
1027 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1030 2005-07-15 Marek Safar <marek.safar@seznam.cz>
1032 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1035 2005-07-15 Raja R Harinath <rharinath@novell.com>
1037 * namespace.cs (Namespace.Lookup): Drop location parameter.
1038 (NamespaceEntry.LookupAlias): Remove. Merge into ...
1039 (NamespaceEntry.Lookup): ... this.
1040 (NamespaceEntry.Error_AmbiguousTypeReference):
1041 Move here from DeclSpace.
1042 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1044 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1045 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1046 Move to NamespaceEntry.
1047 * delegate.cs, expression.cs: Update to changes.
1049 2005-08-31 Martin Baulig <martin@ximian.com>
1051 Committing a patch from Atsushi Enomoto for #75850.
1053 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
1054 Prefer a generic enumerator over a non-generic one.
1056 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
1058 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1059 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1061 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1063 * driver.cs : reverting default encoding change as well as mcs.
1065 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1067 * driver.cs, support.cs : merged r48826.
1069 > could you integrate your mcs changes to gmcs otherwise
1070 > gmcs cannot compile some files.
1072 2005-08-20 Martin Baulig <martin@ximian.com>
1074 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1075 scope if we don't already have it.
1077 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1078 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1081 2005-07-31 Miguel de Icaza <miguel@novell.com>
1083 * statement.cs: Copy the local exception into the exception
1084 captured local. Fixes 75674
1086 2005-07-15 Marek Safar <marek.safar@seznam.cz>
1088 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1091 2005-08-12 Martin Baulig <martin@ximian.com>
1093 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
1094 for nested types here to avoid hitting the cache too early.
1096 2005-08-09 Miguel de Icaza <miguel@novell.com>
1098 * enum.cs: On the new compiler CLS error 3005 is now a warning not
1101 2005-08-03 Martin Baulig <martin@ximian.com>
1103 Make iterators in generic methods work; see gtest-191.cs.
1106 (Constraints.Resolve): Protect against being called twice.
1109 (TypeContainer.GetClassBases): Make this `protected virtual'.
1111 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
1112 (Iterator.GetClassBases): Override this and compute the base
1114 (Iterator.DefineNestedTypes): If we're a generic method, all our
1115 method type parameters become class type parameters on the proxy
1119 (ToplevelBlock.Parameters): Make this a property, not a field.
1120 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
1122 2005-08-03 Martin Baulig <martin@ximian.com>
1124 * typemanager.cs (TypeManager.IsSubclassOf): Use
1125 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
1126 (TypeManager.GetFullName_recursed): Improved.
1128 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1131 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
1132 Private accessor case, using TypeManager.IsPrivateAccessible instead of
1133 invocation_type == mi.DeclaringType, since the first one also checks
1134 other condition used by generic instances.
1136 2005-07-27 Martin Baulig <martin@ximian.com>
1138 * anonymous.cs (CaptureContext.AddField): Added
1139 `AnonymousContainer am' argument; compute its toplevel scope if
1140 it's not already computed. Fixes #75649.
1142 2005-07-14 Marek Safar <marek.safar@seznam.cz>
1144 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1145 CheckAttributeType and refactored.
1146 (Attribute.ResolvePossibleAttributeType): Changed to reuse
1147 ResolveAsTypeTerminal error handling.
1148 (ResolveAsTypeTerminal): Introduced because of global attributes extra
1150 (GetSignatureForError): Print errors in same way.
1153 * codegen.cs: Reflect attribute GetSignatureForError change.
1156 * expression.cs: Add silent parameter to ResolveAsTypeStep.
1158 * namespace.cs (UsingEntry): Refactored to make fields private.
1161 statement.cs: Error_UnexpectedKind has extra parameter.
1163 2005-07-14 Raja R Harinath <rharinath@novell.com>
1165 * ecore.cs (IAlias): Remove.
1166 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
1167 that implement the interface.
1168 * namespace.cs (Namespace): Likewise.
1169 (Namespace.declspaces): Renamed from 'defined_names'.
1170 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
1171 DeclSpace instead of an IAlias.
1172 * tree.cs (Tree.AddDecl): Update.
1174 2005-07-12 Raja R Harinath <rharinath@novell.com>
1176 * statement.cs (Block.Flags); Remove HasVarargs.
1177 (Block.HasVarargs): Move to ToplevelBlock.
1178 (Block.ThisVariable, Block.AddThisVariable): Likewise.
1179 (Block.Variables): Make protected. Initialize variable hashtable
1181 (Block.AddVariable): Update.
1182 (Block.Resolve): Update to changes.
1183 (ToplevelBlock.HasVarargs): New boolean.
1184 (ToplevelBlock.ThisVariable): Move here from Block.
1185 (ToplevelBlock.AddThisVariable): Likewise.
1186 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
1187 * expression.cs (This.ResolveBase): Update to changes.
1188 (ArglistAccess.DoResolve): Likewise.
1190 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1193 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1195 * class.cs (TypeContainer.VerifyMembers): Distinguish between
1196 not used and not used & assigned.
1197 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1199 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1202 * expression.cs (Is.DoResolve): null is never provided type.
1204 2005-07-08 Marek Safar <marek.safar@seznam.cz>
1207 * cs-parser.jay: Less strict event error rule to catch more errors.
1209 2005-07-11 Martin Baulig <martin@ximian.com>
1211 * generic.cs (ConstructedType.CheckConstraints): Improve the check
1212 for the constructor constraint: we do not only have to check
1213 whether the class has a public constructor, but also ensure that
1214 it's parameterless. Fixes #75492.
1216 2005-07-11 Martin Baulig <martin@ximian.com>
1218 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
1219 between type parameters if they either have the reference type
1220 constraint or the class constraint.
1222 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
1224 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
1226 2005-07-07 Marek Safar <marek.safar@seznam.cz>
1229 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1230 (ExtractSecurityPermissionSet): Cope with self referencing security
1231 attributes properly.
1233 * driver.cs (SetOutputFile): Made public property OutputFile.
1235 2005-07-07 Raja R Harinath <rharinath@novell.com>
1238 * class.cs (TypeContainer.first_nonstatic_field): Rename from
1239 has_nonstatic_fields. Make into a FieldBase pointer.
1240 (TypeContainer.AddField): Add CS0282 check.
1241 (TypeContainer.EmitType): Update.
1243 2005-07-06 Miguel de Icaza <miguel@novell.com>
1245 * cs-tokenizer.cs (consume_identifier): Do not create strings to
1246 compare if they start with __.
1248 2005-07-06 Raja R Harinath <rharinath@novell.com>
1250 * statement.cs (Switch.SwitchGoverningType): Only look at
1251 UserCasts that don't need implicit standard conversions to one of
1252 the allowed switch types (Fixes test-322.cs).
1253 (LocalInfo.Resolve): Re-enable sanity-test.
1255 2005-07-06 Marek Safar <marek.safar@seznam.cz>
1257 * cs-tokenizer.cs (consume_identifier): Detect double undescores
1259 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1261 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1263 2005-07-06 Raja R Harinath <rharinath@novell.com>
1266 * ecore.cs (SimpleName.GetSignatureForError): Add.
1267 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1268 (MemberAccess.GetSignatureForError): Add.
1270 2005-07-05 Marek Safar <marek.safar@seznam.cz>
1272 The big error and warning messages review.
1302 * typemanager.cs: Updated.
1304 * class.cs: (MethodCore.SetYields): Moved here to share.
1305 (PropertyMethod.Define): Moved iterator setup here.
1307 * iterators.cs: Add orig_method to have full access to parent
1310 2005-07-05 Raja R Harinath <rharinath@novell.com>
1312 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1313 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1314 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1315 variable of struct type.
1316 * expression.cs (Unary.ResolveOperator): Update to change.
1317 (Indirection.VerifyFixed): Likewise.
1318 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1319 (ParameterReference.VerifyFixed): Value parameters are fixed.
1320 (This.VerifyFixed): Treat 'this' as a value parameter.
1321 * statement.cs (LocalInfo.IsFixed): Remove.
1323 2005-07-01 Martin Baulig <martin@ximian.com>
1325 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1326 `ec.EmitThis ()' to get the correct scope.
1328 2005-07-01 Martin Baulig <martin@ximian.com>
1330 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1331 instance is a ParameterReference; fixes #75299.
1333 2005-06-30 Raja R Harinath <rharinath@novell.com>
1336 * expression.cs (Indexers.map): Remove.
1337 (Indexers.Append): Filter out inaccessible setters and getters.
1338 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1341 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
1343 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1344 (FieldExpr.Emit, PropertyExpr.Emit): Update.
1345 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1346 * expression.cs (Invocation.EmitCall): Add CS0120 check.
1348 2005-06-30 Marek Safar <marek.safar@seznam.cz>
1351 * class.cs (FieldBase.GetInitializerExpression): One more field
1354 2005-06-28 Miguel de Icaza <miguel@novell.com>
1356 * pending.cs: Do not define a proxy if the base method is virtual,
1357 it will be picked up by the runtime (bug 75270).
1359 2005-07-08 Martin Baulig <martin@ximian.com>
1361 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1362 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1364 2005-07-07 Martin Baulig <martin@ximian.com>
1366 * generic.cs (ConstructedType.CheckConstraint): Use
1367 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
1368 called recursively; fixes #75329.
1370 2005-07-06 Martin Baulig <martin@ximian.com>
1372 * generic.cs (TypeManager.InferTypeArguments): Added support for
1373 anonymous methods; fixes #75461.
1375 2005-07-01 Martin Baulig <martin@ximian.com>
1377 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1378 `ec.EmitThis ()' to get the correct scope.
1380 2005-07-01 Martin Baulig <martin@ximian.com>
1382 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
1383 instance is `This'; fixes #75299.
1385 2005-06-30 Martin Baulig <martin@ximian.com>
1387 * class.cs (Indexer): Implement IIteratorContainer; added support
1388 for iterators in indexers.
1391 (EmitContext.CurrentIterator): Make this a property, not a field.
1393 * anonymous.cs (AnonymousContainer.Iterator): New public property.
1395 2005-06-28 Miguel de Icaza <miguel@novell.com>
1397 * pending.cs: Do not define a proxy if the base method is virtual,
1398 it will be picked up by the runtime (bug 75270).
1400 2005-06-28 Martin Baulig <martin@ximian.com>
1402 * cs-parser.jay (interface_method_declaration): Avoid a
1403 reduce/reduce conflict by moving some of the code into a separate
1404 `interface_method_declaration_body' rule; fixes #75368.
1406 2005-06-28 Martin Baulig <martin@ximian.com>
1408 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
1409 array check after the check for TypeBuilder's.
1411 2005-06-21 Raja R Harinath <rharinath@novell.com>
1413 * convert.cs (FindMostEncompassedType): Add two trivial special
1414 cases (number_of_types == 0 || number_of_types == 1).
1415 (FindMostEncompasingType): Likewise.
1417 2005-06-17 Raja R Harinath <rharinath@novell.com>
1419 Some cleanups preparing for the fix of #75283.
1420 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1422 (EventExpr.InstanceResolve): Likewise.
1423 (EventExpr.DoResolve): Remove redundant checks.
1425 2005-06-08 Miguel de Icaza <miguel@novell.com>
1427 * class.cs: Small fix.
1429 2005-06-08 Raja R Harinath <rharinath@novell.com>
1432 * class.cs (GetPartialBases): Fix return value check of
1435 2005-06-07 Raja R Harinath <rharinath@novell.com>
1437 Ensure that partial classes are registered in their enclosing
1438 namespace. Initial part of fix of #75160.
1439 * tree.cs (Tree.RecordDecl): Add new namespace argument.
1440 Register declspace with namespace here, not in
1441 DeclSpace.RecordDecl.
1442 * cs-parser.jay: Pass namespace to RecordDecl.
1443 * class.cs (PartialContainer.Create): Likewise.
1444 (ClassPart.DefineType): New sanity-check. Throws an exception if
1446 * decl.cs (Declspace.RecordDecl): Remove.
1447 * namespace.cs (NamespaceEntry.DefineName): Remove.
1449 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1451 * rootcontext.cs: Reset TargetExt as well.
1453 2005-06-03 Raja R Harinath <rharinath@novell.com>
1455 * ecore.cs (Expression.Resolve): Emit CS0654 error when
1458 2005-06-02 Raja R Harinath <rharinath@novell.com>
1460 Fix #75080, cs0119.cs.
1461 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
1463 (Expression.Resolve): ... this. Use it. Remove bogus code
1464 allowing ExprClass.Type and ExprClass.Namespace for
1465 ResolveFlags.VariableOrValue.
1466 (Expression.Resolve) [1-argument variant]: Change default resolve
1467 flags based on language version.
1468 (Expression.Error_UnexpectedKind): Use a simple string array
1469 rather than an ArrayList.
1470 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1472 (TypeOfVoid.DoResolve): Likewise.
1473 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
1474 flags argument -- it always has the same value.
1476 2005-05-31 Raja R Harinath <rharinath@novell.com>
1479 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1480 Use it in the error message.
1481 * assign.cs, expression.cs, statement.cs: Update.
1483 2005-05-30 Raja R Harinath <rharinath@novell.com>
1486 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1487 the "almostMatchedMember" case too.
1488 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1489 that failed the accessibility checks to 'almost_match'.
1491 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
1493 * attribute.cs: Use internal MethodBuilder methods to set
1494 ExactSpelling and SetLastError on PInvoke methods, instead
1495 of passing them via charset. Fixes #75060.
1497 2005-05-27 Raja R Harinath <rharinath@novell.com>
1499 * parameter.cs (Parameter): Remove TODO comment.
1500 (Parameter.DefineParameter): Remove Location parameter.
1501 (Parameters.LabelParameters): Likewise.
1502 * class.cs (Constructor.Emit): Update to change.
1503 (MethodData.Emit): Likewise.
1504 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
1505 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1507 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
1510 Removed Parameters.Location and added Parameter.Location instead.
1511 Removed Location parameter from Emit() and GetSignature().
1518 Modified all related calls.
1520 2005-06-21 Martin Baulig <martin@ximian.com>
1522 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
1523 left-hand side is not a nullable type; fixes #75328.
1525 2005-06-21 Martin Baulig <martin@ximian.com>
1528 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
1529 (TypeManager.GetFullNameSignature): Likewise.
1531 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
1532 `source.FullName' and `target.FullName' to check whether there are
1533 two conflicting definitions.
1535 2005-06-21 Martin Baulig <martin@ximian.com>
1537 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
1538 a BoxedCast - also for reference types - to be compatible with csc.
1540 2005-06-21 Martin Baulig <martin@ximian.com>
1542 * expression.cs (MemberAccess.DoResolve): Add support for nested
1543 types in a generic instance; fixes #75320.
1545 2005-06-20 Martin Baulig <martin@ximian.com>
1547 * generic.cs (TypeManager.InferType): Also walk the class
1548 hierarchy for generic instances; fixes #75261.
1550 2005-06-17 Martin Baulig <martin@ximian.com>
1552 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
1553 to make things work for corlib.
1555 2005-06-15 Martin Baulig <martin@ximian.com>
1557 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
1558 obsolete `SecurityAction' values.
1560 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1562 * rootcontext.cs: Reset TargetExt as well.
1564 2005-06-09 Martin Baulig <martin@ximian.com>
1566 * delegate.cs (Delegate.VerifyMethod): Added
1567 `MethodGroupExpr old_mg' argument; inherit its
1568 `HasTypeParameters'; fix #75085.
1570 2005-06-09 Martin Baulig <martin@ximian.com>
1572 * expression.cs (Invocation.OverloadResolve): Correctly handle
1573 generic methods for the SetMemberIsUsed(); fix #75064.
1575 2005-06-09 Martin Baulig <martin@ximian.com>
1577 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
1580 2005-06-08 Martin Baulig <martin@ximian.com>
1582 * cs-parser.jay (nullable_type_or_conditional): If we put the
1583 nullable back and our `type' is a `ComposedCast', remove the
1584 nullable from it. Fixes #75156.
1586 * expression.cs (ComposedCast.RemoveNullable): New public method.
1588 2005-06-08 Martin Baulig <martin@ximian.com>
1590 The big Iterators rewrite :-)
1592 * iterators.cs: Rewrite this to use the anonymous methods framework.
1594 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1595 before the TypeContainers; see 2test-21.cs.
1598 (TypeContainer.DefineType): Don't create a new EmitContext if we
1599 already have one (this only happens if we're an Iterator).
1600 (TypeContainer.Define): Also call Define() on all our iterators.
1601 (Method.CreateEmitContext): Added support for iterators.
1604 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1605 (AnonymousContainer.CreateMethodHost): Moved here from
1606 AnonymousMethod and made abstract.
1607 (AnonymousContainer.CreateScopeType): New abstract method.
1608 (AnonymousContainer.IsIterator): New public property.
1609 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1610 get the ScopeTypeBuilder rather than manually defining it here.
1611 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1614 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1615 before RootContext.DefineTypes().
1617 * codegen.cs (EmitContext.RemapToProxy): Removed.
1618 (EmitContext.CurrentAnonymousMethod): Changed type from
1619 AnonymousMethod -> AnonymousContainer.
1620 (EmitContext.ResolveTopBlock): Protect from being called twice.
1621 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1622 (EmitContext.EmitThis): Removed the iterators hacks; use the
1623 anonymous methods framework for that.
1626 (ToplevelBlock.Container): Make this a property, not a field.
1627 (ToplevelBlock.ReParent): New public method; move the
1628 ToplevelBlock into a new container.
1629 (Foreach.TemporaryVariable): Simplify.
1631 2005-06-05 Martin Baulig <martin@ximian.com>
1633 * statement.cs (LocalInfo.CompilerGenerated): New flag.
1634 (Block.AddTemporaryVariable): New public method; creates a new
1635 `LocalInfo' for a temporary variable.
1636 (Block.EmitMeta): Create the LocalBuilders for all the temporary
1638 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1639 non-iterator variables.
1641 2005-06-05 Martin Baulig <martin@ximian.com>
1643 * statement.cs (Foreach.TemporaryVariable): Create the
1644 LocalBuilder in the Emit phase and not in Resolve since in some
1645 situations, we don't have an ILGenerator during Resolve; see
1646 2test-19.cs for an example.
1648 2005-06-04 Martin Baulig <martin@ximian.com>
1650 The big Foreach rewrite - Part II.
1652 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1653 with `PropertyInfo ienumerator_getcurrent'.
1655 * codegen.cs (VariableStorage): Removed.
1658 (Foreach): Derive from Statement, not ExceptionStatement.
1659 (Foreach.CollectionForeach): New nested class. Moved all the code
1660 dealing with collection foreach here.
1661 (Foreach.ForeachHelperMethods): Removed.
1662 (Foreach.TemporaryVariable): Implement IMemoryLocation.
1664 2005-05-23 Martin Baulig <martin@ximian.com>
1666 * statement.cs (Try.DoResolve): Don't create a `finally' if we
1667 don't need to. Fix #75014.
1669 2005-05-26 Raja R Harinath <rharinath@novell.com>
1671 Improve user-defined conversion handling.
1672 * convert.cs (GetConversionOperators): Rewrite. Return only the
1673 applicable operators.
1674 (AddConversionOperators): New. Helper for GetConversionOperators.
1675 (FindMostEncompassedType, FindMostEncompassingType): Verify that
1676 there is only one most encompassed/encompassing type.
1677 (FindMostSpecificSource, FindMostSpecificTarget): Remove
1678 "applicable operator" handling.
1679 (UserConversion): Move cache here from GetConversionOperators.
1680 Directly cache the chosen operator, rather than the whole
1682 (ExplicitNumericConversion): Fix buggy implementation of Decimal
1683 case. Allow conversion of decimal to sbyte and byte too.
1684 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1685 New static methods. Used to avoid allocating EmptyExpressions in
1688 2005-05-24 Duncan Mak <duncan@novell.com>
1690 * ecore.cs (CastFromDecimal): New class for casting a decimal to
1691 another class, used in Convert.ExplicitNumericConversion.
1692 (CastToDecimal): New class, similar to above, but casts to
1693 System.Decimal, used in Convert.ImplicitNumericConversion and also
1694 in explicit convesion from double/float to decimal.
1696 * convert.cs (ImplicitNumericConversion): Handle implicit
1697 conversions to System.Decimal.
1698 (ExplicitNumericConversion): handle explicit conversions to
1703 2005-05-20 Miguel de Icaza <miguel@novell.com>
1705 * typemanager.cs: Do not throw an exception in the TypeBuilder
1706 case, we take care of it on the TypeCode.
1708 2005-05-17 Marek Safar <marek.safar@seznam.cz>
1710 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1713 * cs-parser.jay: Catch more lexical errors.
1715 * report.cs: Add one more Error method.
1718 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1720 2005-05-20 Martin Baulig <martin@ximian.com>
1722 * class.cs (TypeContainer.CircularDepException): Removed.
1723 (TypeContainer.DefineType): Removed the `InTransit' stuff.
1724 (TypeContainer.CheckRecursiveDefinition): Check for circular class
1725 (CS0146) and interface (CS0529) dependencies here.
1727 2005-05-20 Martin Baulig <martin@ximian.com>
1729 * expression.cs (New.DoResolve): Move the CS0712 check above the
1730 CS0144 check; otherwise it can never be reached.
1732 2005-05-20 Martin Baulig <martin@ximian.com>
1734 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
1736 2005-05-20 Martin Baulig <martin@ximian.com>
1738 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
1740 * typemanager.cs (TypeManager.IsAttributeType): New public method.
1742 2005-05-19 Martin Baulig <martin@ximian.com>
1745 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1746 to disable error reporting.
1748 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1749 here since we don't want to report an error; see the new test-336.cs.
1751 2005-05-19 Raja R Harinath <rharinath@novell.com>
1753 * statement.cs (ToplevelBlock.GetParameterReference)
1754 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1755 Move here from class Block.
1756 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1757 * expression.cs (ParameterReference.DoResolveBase): Likewise.
1759 2005-05-18 Martin Baulig <martin@ximian.com>
1764 (FlowBranching.Reachability): Add non-static public And() and Or()
1766 (FlowBranchingSwitch): New class; do the `break_origins' thing
1767 like in FlowBranchingLoop.
1768 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1769 reachability, not just locals and parameters.
1770 (FlowBranching.MergeChild): Remove some of the hacks for loop and
1771 switch; MergeBreakOrigins() now takes care of that.
1773 2005-05-18 Martin Baulig <martin@ximian.com>
1775 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1776 a loop and may leave it, reset the barrier; fixes #74974.
1778 2005-05-16 Raja R Harinath <rharinath@novell.com>
1780 Fix test-382.cs. Emit values of decimal constants.
1781 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1783 (TypeContainer.AddField): ... this.
1784 (TypeContainer.EmitFieldInitializers): Allow the list of fields
1785 with initializers to include 'Const's.
1786 (ClassPart.RegisterFieldForInitialization): Forward to
1788 * const.cs (Const.Const): Pass initializer to base class.
1789 (Const.Define): In case of decimal constants, register them for
1790 initialization in a static constructor.
1792 2005-05-14 Martin Baulig <martin@ximian.com>
1794 * statement.cs (Block.Resolve): Correctly handle unreachable code;
1795 do not call ResolveUnreachable() on unreachable statements in
1796 here, see the comment in the source code.
1798 2005-05-13 Raja R Harinath <rharinath@novell.com>
1801 * expression.cs (BinaryResolveOperator): If one of the operands of
1802 an equality comparison is 'null' and the other is a pointer type,
1803 convert the null to a NullPointer.
1804 * convert.cs (ImplicitReferenceConversion): If the expression is a
1805 NullLiteral and the target type is a pointer type, return a
1806 NullPointer instead.
1807 (ImplicitConversionStandard): Likewise.
1809 2005-05-13 Marek Safar <marek.safar@seznam.cz>
1811 * cs-parser.jay: Set readonly context based on special constructs.
1813 * expression.cs (LocalVariableReference.DoResolveBase): Improved
1814 readonly variable error handling.
1816 * rootcontext.cs (EmitCode): Don't verify members when error
1819 * statement.cs (LocalInfo): Add reaodnly context information.
1820 (SetReadOnlyContext, GetReadOnlyContext): New methods.
1822 2005-05-17 Martin Baulig <martin@ximian.com>
1824 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1827 2005-05-13 Martin Baulig <martin@ximian.com>
1829 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
1830 handle unreachable blocks.
1832 2005-05-13 Martin Baulig <martin@ximian.com>
1835 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1836 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1839 2005-05-13 Martin Baulig <martin@ximian.com>
1841 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1842 instance variable, not a local. Fix #74873.
1843 (Block.ResolveUnreachable): Set it to true here.
1845 2005-05-12 Martin Baulig <martin@ximian.com>
1847 * cs-parser.jay (property_declaration): Pass the `current_class',
1848 not the `current_container' to Property's .ctor. Fixes #74912.
1850 2005-05-11 Martin Baulig <martin@ximian.com>
1852 * typemanager.cs (Closure): Copy this from MCS and merge all the
1853 GMCS-specific changes into it.
1855 2005-05-12 Raja R Harinath <harinath@gmail.com>
1858 * typemanager.cs (unmanaged_enclosing_types): New.
1859 (IsUnmanagedType): Avoid infloops by using
1860 'unmanaged_enclosing_types' to talk with recursive invocations.
1862 2005-05-11 Duncan Mak <duncan@novell.com>
1864 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1865 continuing to process for 'arg'.
1866 (handle_preprocessing_directive): Check the argument of the #endif
1867 directive and report error CS1025 if there are any trailing
1870 According to the C# spec, having even whitespace after the #endif
1871 directive is illegal; however, because we call arg.TrimEnd ()
1872 beforehand, we have the same behavior as csc, allowing whitespace
1873 after the directive.
1877 2005-05-11 Marek Safar <marek.safar@seznam.cz>
1881 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1882 (Constructor.GetObsoleteAttribute): Implemented correctly.
1884 2005-05-10 Martin Baulig <martin@ximian.com>
1886 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1887 resolve the type; fixes #74864.
1888 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1889 in DoResolve(); fixes #74862.
1891 2005-05-10 Martin Baulig <martin@ximian.com>
1893 * support.cs (ReflectionParameters.ParameterModifier): Use
1894 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1895 and `ParameterAttributes.In'. Fixes #74884.
1897 2005-05-10 Martin Baulig <martin@ximian.com>
1899 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1900 the cache if we're just looking for `MemberTypes.NestedType' in a
1903 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1904 constraints if we're still resolving the type tree.
1905 (Expression.MemberLookup): If we're resolving the type tree, only
1906 look for `MemberTypes.NestedType' since we're only interested in
1909 * class.cs (TypeContainer.DefineType): Don't resolve the type
1910 parameters here; do this later in ResolveType() after the type
1911 tree has been resolved.
1912 (TypeContainer.ResolveType): New public method; this is called
1913 after the type tree is resolved and before the types are being
1914 populated. We resolve the generic constraints here.
1915 (TypeContainer.DoDefineMember): Check the constraints on our base
1916 class and interfaces.
1918 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1919 set the `ResolvingTypeTree' flag on the EmitContext.
1921 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1923 2005-05-10 Marek Safar <marek.safar@seznam.cz>
1925 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1927 * expression.cs (Argument.GetParameterModifier): Turned to property.
1928 (Invocation.Error_InvalidArguments): Add more descriptive errors.
1930 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1933 2005-05-09 Raja R Harinath <rharinath@novell.com>
1936 * decl.cs (MemberCache.AddMethods): Register override methods,
1937 rather than non-override methods.
1938 * typemanager.cs (RegisterOverride): New.
1939 (IsOverride): Update.
1941 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1943 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1945 2005-05-06 Martin Baulig <martin@ximian.com>
1948 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1949 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1951 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1955 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1956 recursive declaration.
1958 * statement.cs (Block.ResolveMeta): Report any error in resolving.
1960 2005-05-06 Marek Safar <marek.safar@seznam.cz>
1962 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1964 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1966 2005-05-05 Raja R Harinath <rharinath@novell.com>
1969 * decl.cs (DeclSpace.FamilyAccessible):
1970 Use TypeManager.IsNestedFamilyAccessible.
1972 Fix reopened #64812.
1973 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1976 2005-05-04 Raja R Harinath <rharinath@novell.com>
1977 Abin Thomas <projectmonokochi@rediffmail.com>
1978 Anoob V E <projectmonokochi@rediffmail.com>
1979 Harilal P R <projectmonokochi@rediffmail.com>
1982 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1983 allow access to all static members.
1985 2005-05-04 Martin Baulig <martin@ximian.com>
1987 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1989 2005-05-04 Martin Baulig <martin@ximian.com>
1993 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1994 section at the end; make things work if `default' is not the last
1997 2005-05-04 Martin Baulig <martin@ximian.com>
2001 * statement.cs (Switch): Replaced the `got_default' field with a
2002 `default_section' one.
2003 (Switch.CheckSwitch): Set `default_section' here.
2004 (Switch.Resolve): If we're a constant switch and the constant is
2005 not found, use the default section.
2007 2005-05-03 Martin Baulig <martin@ximian.com>
2009 * expression.cs (ArrayAccess.EmitGetLength): New public method.
2011 * statement.cs (Foreach.ArrayForeach): New nested class.
2012 (Foreach.TemporaryVariable): New nested class.
2013 (Foreach.EmitArrayForeach): Removed; this is now in the new
2016 2005-05-03 Raja R Harinath <rharinath@novell.com>
2018 * pending.cs (BaseImplements): Move the #74773 fix here. This is
2020 (VerifyPendingMethods): Revert change below.
2022 * typemanager.cs (IsOverride, RegisterNonOverride): New.
2023 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2024 that used to trigger warning -28. Remove warning -28.
2025 * expression.cs (Invocation.OverloadResolve): Use
2026 TypeManager.IsOverride to distinguish override methods.
2029 * pending.cs (VerifyPendingMethods): If a base type implements the
2030 requested interface, don't bother checking individual methods of
2031 the base type. As a side-effect, this prevents the creation of
2032 unnecessary proxies.
2034 2005-05-02 Martin Baulig <martin@ximian.com>
2038 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2039 Also `And' the locals if the old vector is null.
2040 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2041 null; in this case we basically reset all the variables.
2043 2005-05-02 Martin Baulig <martin@ximian.com>
2047 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2048 Added `FlowBranching branching' argument; always `and' the
2049 variables instead of `or'ing them unless we're an infinite loop.
2051 * statement.cs (While.Resolve): Create a new sibling unless we're
2054 2005-05-02 Martin Baulig <martin@ximian.com>
2058 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2059 arguments; use it instead of creating a new TopLevelBlock.
2060 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2061 our ConstructorInitializer.
2064 (TopLevelBlock.TopLevelBranching): New public property.
2065 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2066 and create our `TopLevelBranching'.
2068 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2069 anonymous method host, use `block.TopLevelBranching' rather than
2070 creating a new branching.
2072 2005-04-20 Miguel de Icaza <miguel@novell.com>
2074 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2075 a ScopeInfo, if any of the current children is a child of the new
2076 entry, move those children there.
2078 2005-04-30 Martin Baulig <martin@ximian.com>
2080 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2081 at the beginning of a SwitchSection. Fix #73335.
2083 2005-04-27 Marek Safar <marek.safar@seznam.cz>
2086 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2088 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2089 (FieldExpr.DoResolve): Obsolete members are ignored for field
2092 2005-04-26 Marek Safar <marek.safar@seznam.cz>
2094 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2095 of arrays detection.
2097 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2099 (Field.VerifyClsCompliance): Volatile fields are not compliant.
2101 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2104 2005-04-25 Ben Maurer <bmaurer@ximian.com>
2106 * cs-parser.jay: Use the prefered version of -unsafe in error
2109 2005-04-22 Marek Safar <marek.safar@seznam.cz>
2111 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2114 2005-04-20 John Luke <john.luke@gmail.com>
2116 * driver.cs: fix typo in error message, --outout to --output
2118 2005-04-30 Martin Baulig <martin@ximian.com>
2120 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
2121 handle the .NET 2.x security attributes.
2123 2005-04-30 Martin Baulig <martin@ximian.com>
2126 (TypeManager.ExpandInterfaces): Don't add things twice.
2129 (TypeContainer.VerifyClsCompliance): Allow generic instances.
2131 2005-04-29 Martin Baulig <martin@ximian.com>
2133 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
2135 * anonymous.cs: Added support for anonymous generic methods.
2137 2005-04-29 Martin Baulig <martin@ximian.com>
2139 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
2142 2005-04-29 Martin Baulig <martin@ximian.com>
2144 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
2146 * expression.cs (New.DoResolve): Fix the CS0304 check.
2148 2005-04-29 Martin Baulig <martin@ximian.com>
2150 * typemanager.cs (TypeManager.GetFullName): Updated to the new
2153 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
2154 explicit interface implementation, compare the interface types.
2155 (MethodData.Define): Use the new naming scheme from the latest
2157 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
2159 * decl.cs (MemberName.GetMemberName): Removed.
2160 (MemberName.MethodName, FullName): New properties.
2162 2005-04-25 Raja R Harinath <rharinath@novell.com>
2164 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
2166 2005-04-22 Martin Baulig <martin@ximian.com>
2168 * generic.cs (GenericMethod): Create the EmitContext in the
2169 `Define()'; in `Define(MethodBuilder)', create the type parameters
2170 before calling `Define()'. Fixes #73933.
2172 2005-04-22 Martin Baulig <martin@ximian.com>
2175 (Constraints.Resolve): Make things work wrt. the new type lookup system.
2176 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
2178 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
2179 ConstructedType, check its constraints.
2181 2005-04-20 Marek Safar <marek.safar@seznam.cz>
2183 * codegen.cs (InRefOutArgumentResolving): New field.
2185 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2186 fields outside contructor.
2188 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2190 2005-04-19 Miguel de Icaza <miguel@novell.com>
2192 * anonymous.cs (CaptureContext.EmitParameterInstance): The
2193 parameter code was not completed ever, so it was not as up-to-date
2194 as local variables. Must finish it.
2196 The bug fix was to compare the Toplevel of the block, not the
2197 current block. Thanks for Ben for pointing this out.
2199 2005-04-19 Raja R Harinath <rharinath@novell.com>
2201 * decl.cs (AddMethods): Use the declaring type of the problem
2202 method to determine if we want to squash a warning.
2204 2005-04-19 Marek Safar <marek.safar@seznam.cz>
2206 * attribute.cs: Removed debug output.
2208 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2210 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2213 2005-04-18 Raja R Harinath <rharinath@novell.com>
2216 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2217 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2218 all null comparisons against reference types.
2220 2005-04-18 Marek Safar <marek.safar@seznam.cz>
2223 * class.cs (TypeContainer.CircularDepException) New nested
2225 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2226 (TypeContainer.DefineType): Removed error, reset InTransit before
2228 (Class.DefineType): Throw exception when is in Transit.
2229 Catch exception and report error.
2230 (Struct.DefineType): Throw exception when is in Transit.
2231 Catch exception and report error.
2232 (Interface.DefineType): Throw exception when is in Transit.
2233 Catch exception and report error.
2235 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2236 handle nested exception handlers.
2238 * flowanalysis.cs (InTryWithCatch): New method, search for try with
2241 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2242 InFinally and InCatch storage.
2244 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2245 (Catch.Resolve): Set and Restore ec.InCatch.
2246 (Try.Resolve): Set and Restore ec.InFinally.
2247 (Try.HasCatch): True when try has catch.
2249 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
2251 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2252 for the same event member, so exclude such cases from warning 419.
2255 2005-04-16 Miguel de Icaza <miguel@novell.com>
2257 * expression.cs (Binary.ResolveOperator): Apply patch from John
2258 Luke to fix bug 59864: operators &, | and ^ on enumerations
2259 require that the same enum type on both sides.
2261 * driver.cs: Add warnings to old flag usage, this is to assist
2262 people who produce Makefiles and hope that the Makefiles will be
2265 * class.cs (TypeContainer.EmitType): Moved the definition of the
2266 special $PRIVATE$ field from the resolve phase to the Emit phase.
2267 During resolve we do not know if we are a struct with
2268 HasExplicitLayout, we know this only after the attributes for the
2271 Set the FieldOffset to zero on the dummy field that we create for
2272 the class. Fixes 74590.
2274 2005-04-16 Raja R Harinath <rharinath@novell.com>
2277 * ecore.cs (PropertyExpr.resolved): New.
2278 (DoResolve): Use it to handle a case of double resolution here.
2279 Handle a case of identical-name-and-type-name.
2280 * expression.cs (ArrayCreation.CheckIndices): Avoid double
2281 resolution by storing the results of expression resolution back
2282 into the "probes" array.
2284 2005-04-15 Raja R Harinath <rharinath@novell.com>
2286 Fix cs0208-7.cs and cs0208-8.cs.
2287 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2288 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
2289 error reporting to point out the reason a struct is not unmanaged.
2291 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2293 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
2294 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2296 2005-04-13 Raja R Harinath <rharinath@novell.com>
2299 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2300 IdenticalNameAndTypeName here.
2301 (EventExpr.InstanceResolve): Likewise.
2303 2005-04-13 Marek Safar <marek.safar@seznam.cz>
2305 C# 2.0 DefaultCharSetAttribute implementation
2307 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2308 which allows us to set GlobalNamespace for every resolve.
2309 (Attribute.ResolveArguments): Cut from Resolve.
2310 (Attribute.GetCharSetValue): Returns CharSet named argument.
2311 (Attribute.DefinePInvokeMethod): Gets default charset from
2313 (GlobalAttribute.ResolveAsTypeStep): Override.
2314 (GlobalAttribute.ResolveArguments): Override.
2316 * class.cs (TypeAttr): Is protected.
2318 * codegen.cs (ModuleClass.DefaultCharSet): New member.
2319 (ModuleClass.DefaultCharSetType): New memeber.
2320 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2322 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2323 charset from module.
2325 * delegate.cs (TypeAttr): Override.
2326 (Delegate.DefineType): Use this TypeAttr.
2328 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2329 at very early stage (before types are defined) to resolve model
2330 module attributes. It will probably not work with corlib but it
2333 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2334 charset from module.
2336 * typemanager.cs (default_charset_type): New type.
2338 2005-04-13 Raja R Harinath <rharinath@novell.com>
2340 * decl.cs (MemberCache.AddMethods): Don't warn if
2341 System.Object.Finalize has buggy MethodAttributes.
2343 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2346 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2348 * doc.cs : detect ambiguous reference to overloaded members.
2349 Fixed bug #71603. MS 1.1 csc does not detect it.
2351 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2353 * doc.cs : delegates must not be referenced with parameters.
2356 2005-04-12 Miguel de Icaza <miguel@novell.com>
2358 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2360 2005-04-10 Miguel de Icaza <miguel@novell.com>
2362 * driver.cs (MainDriver): Stop processing if the CLS stage found
2365 (CompilerCallableEntryPoint.InvokeCompiler): Always
2366 reset after execution; Take a TextWriter argument for the
2369 * report.cs: Use the error stream instead of hardcoding stderr.
2371 2005-04-09 Miguel de Icaza <miguel@novell.com>
2373 * class.cs: Reduce code paths to test, too small of an
2374 optimization to make it worth the extra testing. Always perform
2377 2005-04-08 Raja R Harinath <rharinath@novell.com>
2380 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2381 operators that had errors reported on them.
2383 2005-04-08 Marek Safar <marek.safar@seznam.cz>
2385 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2387 (Attribute.Resolve): Add named argument type checking.
2389 * class.cs (FixedField.Define): Use IsPrimitiveType
2391 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2393 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2394 unsafe parameter types.
2396 * statement.cs (Using.ResolveExpression): Add better error description.
2398 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2400 2005-04-08 Raja R Harinath <rharinath@novell.com>
2403 * attribute.cs (Attribute.GetAttributeUsage): Resolve
2404 AttributeUsageAttribute in the emitcontext of the attribute class,
2405 not in the emitcontext of the attributable entity it was attached to.
2406 * cs-parser.jay: Use 'current_class', not 'current_container',
2407 when creating a GlobalAttribute.
2409 2005-04-08 Alp Toker <alp@atoker.com>
2411 * pending.cs: The fix to #58413 failed to compile methods implementing
2412 interfaces with/without params modifiers and vice versa, even though
2413 params modifiers aren't part of the signature. Make the modifier check
2414 less strict as in csc.
2416 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
2417 Anoob V E <projectmonokochi@rediffmail.com>
2418 Harilal P R <projectmonokochi@rediffmail.com>
2421 * pending.cs (TypeAndMethods.mods): New. Store the parameter
2422 modifiers of pending methods.
2423 (PendingImplementation.PendingImplementation): Initialize it.
2424 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2425 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2426 with ParameterData. Add check for modifiers.
2427 * class.cs (MethodData.Define): Update to changes.
2429 2005-04-07 Raja R Harinath <rharinath@novell.com>
2431 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2433 2005-04-07 Marek Safar <marek.safar@seznam.cz>
2435 * class.cs (PropertyMethod.Define): Check private accessor in abstract
2438 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2441 * typemanager.cs: Registered RequiredAttributeAttribute.
2443 2005-04-06 Marek Safar <marek.safar@seznam.cz>
2445 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2446 Warning CS0169 is back at level 3.
2447 (IMethodData.SetMemberIsUsed): New method.
2449 * decl.cs (IsUsed): New value; moved from FieldBase.Status
2450 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2452 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2454 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2456 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2459 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2462 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2463 to avoid the problems with nested types.
2465 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
2466 Anoob V.E <projectmonokochi@rediffmail.com>
2467 Harilal P.R <projectmonokochi@rediffmail.com>
2468 Raja R Harinath <rharinath@novell.com>
2471 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2473 * typemanager (GetConstructor): Make public.
2475 2005-04-05 John Luke <john.luke@gmail.com>
2476 Raja R Harinath <rharinath@novell.com>
2479 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2480 struct too. Return false quicker in a few cases.
2481 (VerifyUnManaged): Use it.
2483 2005-04-05 Raja R Harinath <rharinath@novell.com>
2486 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2487 not 'unreachable_seen'.
2489 2005-04-04 Marek Safar <marek.safar@seznam.cz>
2491 * attribute.cs (Attribute.GetValue): Removed unused.
2493 * codegen.cs (CodeGen.TrimExt): Removed unused.
2495 * cs-parser.jay (output): Removed unused.
2497 * cs-tokenizer.cs (hex_digits): Removed unused.
2499 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2501 * expression.cs (Indirection.LoadExprValue): Removed unused.
2502 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2504 * iterators.cs (Iterator.param_types): Removed unused.
2506 * statement.cs (Goto.block): Removed unused.
2507 (ToplevelBlock.did): Removed unused.
2508 (Switch.ResolveConstantSwitch): Removed unused.
2510 2005-04-01 Ben Maurer <bmaurer@ximian.com>
2512 * rootcontext.cs: Allow mcs to bootstrap with the compilation
2515 2005-04-19 Martin Baulig <martin@ximian.com>
2517 Merged r42462 from MCS and made it work for GMCS.
2519 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
2521 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
2523 2005-04-01 Raja R Harinath <rharinath@novell.com>
2525 Fix #74232 and cs0208-3.cs.
2526 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2527 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2528 unmanaged type. Don't use FieldBuilders when 't' is a
2529 TypeBuilder. Use ModFlags and MemberType fields.
2530 * class.cs (MemberBase.member_type): Rename from MemberType.
2531 (MemberBase.MemberType): New property. Determines member_type on
2533 (MemberBase.DoDefine): Don't initialize MemberType here.
2534 (FieldMember.Define): Likewise.
2536 2005-04-01 Marek Safar <marek.safar@seznam.cz>
2539 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2540 Attributes are emitted there.
2542 2005-04-01 Raja R Harinath <rharinath@novell.com>
2544 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2545 keyword in 'partial enum' too.
2546 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2548 Report from Kamil Skalski <nazgul@omega.pl>.
2551 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2552 have partial containers too.
2554 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2555 in block' checks to Block.CheckInvariantMeaningInBlock.
2556 * statement.cs (Block.GetKnownVariableInfo): Make private.
2557 (Block.IsVariableUsedInChildBlock): Remove.
2558 (Block.IsVariableUsedInBlock): Likewise.
2559 (Block.CheckInvariantMeaningInBlock): New. Show location of
2560 conflicting declaration.
2561 (Block.AddVariable): Make error messages less long-winded and more
2562 specific. Show location of conflicting declaration.
2563 * parameter.cs (Parameters.Location): New readonly property.
2565 2005-03-31 Raja R Harinath <rharinath@novell.com>
2567 Clean up semantics of invoking ResolveMemberAccess.
2568 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2569 can have an instance, ensure that we pass in a non-TypeExpression
2570 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
2571 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2572 argument. Update to changes and simplify.
2573 (FieldExpr.Emitinstance): Remove CS0120 check.
2574 (PropertyExpr.EmitInstance): Likewise.
2575 * expression.cs (Argument.Resolve): Likewise.
2576 (Invocation.DoResolve): Update to changes in semantics of
2579 2005-03-31 Marek Safar <marek.safar@seznam.cz>
2582 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2585 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2587 2005-03-31 Raja R Harinath <rharinath@novell.com>
2589 Fix difference in behaviour with commandline invocation.
2590 * driver.cs (Driver.Reset): New.
2591 (CompilerCallableEntryPoint): Call it.
2593 * statement.cs (If.Resolve): Avoid spurious "uninitialized
2594 variable" warnings if the boolean expression failed to resolve.
2596 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
2598 * attribute.cs: Fix the union of several permissions when some of them
2599 are unrestricted (so the result isn't an unrestricted permission set).
2602 2005-03-30 Raja R Harinath <rharinath@novell.com>
2604 * ecore.cs (MemberExpr): New class. Convert from interface
2606 (MemberExpr.ResolveMemberAccess): Refactor and move here from
2607 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
2609 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2610 (MethodGroupExpr.IsExplicitImpl): Remove.
2611 (Expression.GetFieldFromEvent): Remove.
2612 (SimpleName.MemberStaticCheck): Remove.
2613 (SimpleName.DoSimpleNameResolve): Update to changes.
2614 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2615 (MemberAccess.IdenticalNameAndTypeName): Remove.
2616 (MemberAccess.error176): Move to MemberExpr.
2617 (MemberAccess.DoResolve): Update to changes.
2618 (BaseAccess.DoResolve): Likewise.
2620 2005-03-30 Marek Safar <marek.safar@seznam.cz>
2622 C# 2.0 Conditional attribute class implementation
2624 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2625 Analyzes class whether it has attribute which has ConditionalAttribute
2626 and its condition is not defined.
2628 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2629 (Class.IsExcluded): New method. Search for at least one defined
2630 condition in ConditionalAttribute of attribute class.
2632 2005-03-30 Raja R Harinath <rharinath@novell.com>
2634 * ecore.cs (PropertyExpr): Derive from Expression, not
2635 ExpressionStatement.
2636 (PropertyExpr.EmitStatement): Remove.
2638 2005-03-29 Raja R Harinath <rharinath@novell.com>
2641 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2642 internal field "value__" of an enum be private. The examples for
2643 "value__" that I found on MSDN all used FieldAttributes.Private.
2645 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2646 Don't mention IL method attribute names.
2648 Fix #47991. Remove a TODO.
2649 * statement.cs (Block.Toplevel): Make into a field.
2650 (Block.Parameters): Move into ToplevelBlock.
2651 (Block.known_variables): Rename from child_variable_names.
2652 (Block.Block): Remove variants that take Parameters. Initialize
2653 'Toplevel' with the immediately surrounding toplevel block.
2654 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
2655 LocalInfo parameter.
2656 (Block.GetKnownVariableInfo): New.
2657 (Block.IsVariableNameUsedInChildBlock): Update.
2658 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
2659 the block, even though it may not be in scope.
2660 (Block.AddVariable): Remove Parameters parameter. Use
2661 Toplevel.Parameters instead.
2662 (Block.AddConstant): Remove Parameters parameter.
2663 (Block.GetParameterReference): Update to use Toplevel.Parameters.
2664 (Block.IsParamaterReference): Likewise.
2665 (Block.IsLocalParameter): Likewise. Simplify a lot.
2666 (ToplevelBlock.Parameters): New. Moved from Block.
2667 (ToplevelBlock.ToplevelBlock): Update to changes. Always
2668 initialize Parameters to a non-null value.
2669 * cs-parser.jay: Update to changes.
2670 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2671 simple names that mean different things in the same block. Use
2672 Block.IsVariableNameUsedInBlock.
2674 2005-03-28 Raja R Harinath <rharinath@novell.com>
2676 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2678 2005-03-26 Raja R Harinath <harinath@acm.org>
2681 * assign.cs (Assign.DoResolve): When the RHS of an assignment
2682 fails to resolve, ensure that the LHS is still resolved as an
2685 2005-03-25 Raja R Harinath <harinath@acm.org>
2687 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2689 (Enum.current_ec): Remove.
2690 (Enum.LookupEnumValue): Remove EmitContext argument.
2691 Just uses the one created during DefineType.
2692 (Enum.FindMembers): Update.
2693 * expression.cs (MemberAccess.DoResolve): Update.
2695 2005-03-22 Marek Safar <marek.safar@seznam.cz>
2697 * assign.cs (Assign.DoResolve): Check for CS1717 when
2698 source and target are same (uses Equals).
2700 * expression.cs (LocalVariableReference, ParameterReference,
2701 This): Implemented Equals, GetHashCode.
2703 * statement.cs (Block.GetParameterReference): Removed useless
2706 2005-03-22 Raja R Harinath <rharinath@novell.com>
2709 * statement.cs (Block.AddVariable): Ensure that we skip implicit
2710 blocks before deciding whether the error is cs0136 or cs0128.
2712 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2713 (using_alias_directive, using_namespace_directive): Pass
2714 MemberName, not an expression to Namespace.UsingAlias and
2716 (MakeName): Use the MemberName of the namespace.
2717 * namespace.cs (Namespace.MemberName): New.
2718 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2719 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2721 * decl.cs (MemberName.Name): Make readonly.
2722 (MemberName.FromDotted): New "constructor".
2723 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2724 (MemberCore.Name): Compute from MemberName on demand.
2725 (MemberCore.SetMemberName): Provide a way to change the
2727 (MemberCore.AddToContainer): Don't take a fullname parameter.
2728 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2729 fully qualified name of the container to the member name.
2730 (TypeContainer.AddToTypeContainer): Use a fully qualified name
2731 only if the type is a member of the root container.
2732 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2733 MemberName.Left rather than searching for an embedded ".".
2734 (PartialContainer.CreatePart): Update to changes in RootContext.
2735 (MemberBase.ShortName): Turn into a property. Use
2736 MemberCore.SetMemberName.
2737 (MemberBase.ExplicitInterfaceName): Remove.
2738 (MemberBase.UpdateMemberName): Remove.
2739 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2740 (PropertyBase.SetMemberName): New override.
2741 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2742 (Tree.GetDecl): New.
2743 (Tree.AllDecls): Rename from Decls.
2744 * attribute.cs, enum.cs, report.cs: Update to changes.
2745 * driver.cs (MainDriver): Use MemberName.FromDotted on
2746 RootContext.MainClass.
2748 2005-03-21 Marek Safar <marek.safar@seznam.cz>
2750 * class.cs (FixedField.Define): Check for CS1664 and more sanity
2753 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2755 2005-03-18 Marek Safar <marek.safar@seznam.cz>
2757 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2758 property accessor modifiers.
2760 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2761 fixed buffer attribute (CS1716).
2762 (PropertyMethod.HasCustomAccessModifier): When property accessor
2763 has custom modifier.
2765 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2767 (PropertyExpr.DoResolveLValue): Add CS0272.
2769 2005-03-17 Miguel de Icaza <miguel@novell.com>
2771 * convert.cs: When converting to a pointer, use the proper Conv.U
2772 or Conv.I depending on the source data type.
2774 * cs-tokenizer.cs: Make the size for large decimal constants,
2777 2005-03-17 Martin Baulig <martin@ximian.com>
2779 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2780 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
2782 2005-03-17 Martin Baulig <martin@ximian.com>
2784 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2785 to bool so we can return an error condition.
2786 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2789 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
2791 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2794 2005-03-16 Raja R Harinath <rharinath@novell.com>
2796 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2797 Refactor to avoid traversing the list of assemblies, and to avoid
2798 string concatenation.
2799 * typemanager.cs (guid_attr_type): Remove.
2800 (negative_hits, pointers, references): Remove hashes.
2802 (GetConstructedType): New. Uses type_hash to handle constructed
2803 types (arrays, references, pointers).
2804 (GetReferenceType, GetPointerType): Use it.
2805 (GetNestedType): New. Uses type_hash to handle nested types of
2807 (LookupType, LookupTypeDirect): Remove.
2808 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
2809 'types' hash and LookupTypeReflection directly.
2810 (params_string, params_object): Use GetConstructedType.
2811 * namespace.cs (Namespace.cached_types): New. Cache of reflected
2813 (Namespace.Lookup): Use cached_types.
2814 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2815 provided by old TypeManager.LookupType.
2816 * rootcontext.cs (MakeFQN): Remove.
2817 * decl.cs (DeclSpace.MakeFQN): Likewise.
2818 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2819 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2820 TypeManager.GetConstructedType.
2821 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2823 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
2825 * cs-parser.jay: Fix build.
2827 2005-03-15 Marek Safar <marek.safar@seznam.cz>
2829 * class.cs (TypeContainer.CircularDepException) New nested
2830 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
2832 * cs-parser.jay: Reports CS1527 for any namespace element.
2834 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2837 * expression.cs (ParameterReference.IsAssigned): Changed error to
2839 (Error_WrongNumArguments): Moved CS0245 detection here.
2841 * statement.cs (Return.Resolve): Add CS1622 report.
2843 2005-03-11 Marek Safar <marek.safar@seznam.cz>
2845 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2847 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
2849 * attribute.cs expression.cs: Get rid of some allocations.
2851 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
2853 * doc.cs : just eliminate the latest change.
2855 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2857 * doc.cs : commented out the latest change. It breaks xml-030.cs
2859 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2861 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2862 fail. So invoke CreateType() in FindDocumentedType().
2864 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2866 * cs-tokenizer.cs : added IsKeyword().
2867 * doc.cs : Detect keyword incorrectly used as identifier.
2868 Allow identifiers prefixed by @.
2870 2005-03-10 Marek Safar <marek.safar@seznam.cz>
2872 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2873 It caused exception in namespace resolving (again!).
2875 * class.cs (Class.ctor): Removed exit.
2876 (PropertyMethod.ctor): ditto.
2878 * codegen.cs (Codegen.Reset): Reset static data.
2879 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2881 * cs-tokenizer.cs (Cleanup): Removed.
2883 * driver.cs (GetSystemDir): Rewrote to one line command.
2884 It caused problem with unloaded dynamic modules.
2885 (UnixParseOption): Removed Exit.
2886 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2887 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2888 Now can be mcs used as library.
2890 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2893 * location.cs (Reset): Reset static data.
2895 * namespace.cs (Reset): Reset static data.
2897 * report.cs (Report.Reset): Reset static data.
2899 * rootcontext.cs (RootContext.Reset): Reset static data.
2901 * tree.cs (RootTypes.ctor): Use Location.Null
2903 * typemanager.cs (TypeManager.Reset): Reset static data.
2904 (CoreLookupType): Removed Exit.
2905 (TypeHandle.Reset): Reset static data.
2907 2005-03-10 Raja R Harinath <rharinath@novell.com>
2910 * typemanager.cs (ComputeNamespaces): Import namespaces from
2911 referenced modules too.
2913 2005-03-09 Raja R Harinath <rharinath@novell.com>
2915 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2918 2005-03-09 Raja R Harinath <rharinath@novell.com>
2920 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2921 enclosing DeclSpace. This ensures that a name-lookup populates
2922 more caches and there are fewer 'TypeExpression's. Carve out
2923 nested type lookup into ...
2924 (LookupNestedTypeInHierarchy): ... this.
2926 2005-04-15 Martin Baulig <martin@ximian.com>
2928 Merged r41590 from MCS and make it work in the generics land.
2930 * generic.cs (TypeParameter.UpdateConstraints): Removed the
2933 * class.cs (PartialContainer.UpdateConstraints): Removed.
2934 (PartialContainer.CheckConstraints): Removed.
2935 (PartialContainer.SetParameterInfo): Store the constraints here.
2936 (PartialContainer.DefineTypeParameters): New public method;
2937 resolve the type parameter's constraints here. Note that the
2938 PartialContainer doesn't have an EmitContext anymore, so we must
2939 do this in the ClassPart.
2941 2005-03-09 Raja R Harinath <rharinath@novell.com>
2943 Clean up a few partial-class semantics.
2944 Fixes test-357.cs and cs1618-2.cs.
2945 * cs-parser.jay (struct_declaration): Use 'current_class' as
2946 parent of newly-created struct. Remove call to Register ().
2947 Use 'pop_current_class' to complete handing the current struct.
2948 (interface_declaration): Likewise.
2949 (class_declaration): Likewise.
2950 (enum_declaration): Use 'current_class' as parent of newly created
2952 (delegate_declaration): Likewise.
2953 (pop_current_class): New function. This is used to handle closing
2954 up the 'current_class' and 'current_container', and pointing them
2955 to the enclosing class/container.
2956 (CSharpParser): Initialize 'current_class' too.
2957 * decl.cs (MemberCore): Add check for invariant: a partial
2958 container is not a parsed entity, and thus does not enclose any
2960 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2961 (DeclSpace.BaseTypeExpr): Use it.
2962 (DeclSpace.LookupType): Add check for invariant.
2963 * class.cs (TypeContainer): Add check for invariant: a nested
2964 class should have the same NamespaceEntry as its enclosing class.
2965 (TypeContainer.EmitFieldInitializers): Make virtual.
2966 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2968 (TypeContainer.Register): Remove.
2969 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2970 null. Use TypeResolveEmitContext for resolving base types and
2971 interfaces. Move initialization of Parts.TypeBuilder here from
2973 (TypeContainer.DefineNestedTypes): ... here.
2974 (PartialContainer): Take a Namespace not a NamespaceEntry.
2975 (PartialContainer.Create): Don't use Register. Call the
2976 appropriate Add... function directly.
2977 (ClassPart): Take both the PartialContainer and the enclosing
2978 class as constructor arguments.
2979 (ClassPart.EmitFieldInitializers): Override.
2980 (ClassPart.PartFindNestedTypes): Remove.
2981 (FieldBase.GetInitializerExpression): Resolve the initializer
2982 expression in the emit context of the enclosing class.
2983 * tree.cs (RootTypes): Remove Register ().
2985 2005-03-08 Marek Safar <marek.safar@seznam.cz>
2987 * cs-parser.jay: Removed CS0134.
2989 * driver.cs: Removed CS1901.
2991 * expression.cs (SizeOf.DoResolve): Don't report CS0233
2992 for predefined types.
2994 2005-03-07 Duncan Mak <duncan@novell.com>
2996 * codegen.cs (Save): Catch UnauthorizedAccessException as
2997 well. Fixes bug #73454.
2999 2005-03-07 Marek Safar <marek.safar@seznam.cz>
3001 * cs-tokenizer.cs (xtoken): Add CS1035.
3003 * class.cs (MethodData.Define): Add CS0683.
3004 (FieldMember.ctor): Add CS0681.
3006 2005-03-07 Raja R Harinath <rharinath@novell.com>
3008 * ecore.cs (SimpleName.DoResolve): Rename from
3009 SimpleName.DoResolveAllowStatic.
3010 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
3011 Pass 'intermediate' flag to MemberStaticCheck.
3012 (SimpleName.MemberStaticCheck): Skip "static check" only in case
3013 of "intermediate" lookups via MemberAccess.
3014 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
3015 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
3017 2005-03-07 Raja R Harinath <rharinath@novell.com>
3020 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
3021 slipped in because of variable names that are identical to a
3022 builtin type's BCL equivalent ('string String;', 'int Int32;').
3023 (PropertyExpr.EmitInstance): Likewise.
3025 2005-03-04 Marek Safar <marek.safar@seznam.cz>
3027 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
3029 * report.cs (warning_ignore_table): Made public.
3031 2005-03-04 Raja R Harinath <rharinath@novell.com>
3034 * class.cs (MethodData.Emit): Pass 'container' to
3035 container.GetObsoleteAttribute instead of 'container.Parent'.
3037 2005-03-03 Marek Safar <marek.safar@seznam.cz>
3039 * cs-parser.jay: Add 1534 error test.
3041 * iterators.cs (Yield.CheckContext): Add error 1629.
3042 (Iterator.ctor): Save unsafe modifier.
3043 (MoveNextMethod.DoEmit): Restore unsafe context.
3045 * namespace.cs (UsingAlias): Better error message.
3047 2005-03-03 Dan Winship <danw@novell.com>
3049 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
3050 the warning message [#73219]
3052 2005-03-03 Raja R Harinath <rharinath@novell.com>
3054 Fix compile with MCS 1.0.0.0.
3055 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
3056 w_restore to not depend on string constant folding.
3058 2005-03-03 Raja R Harinath <rharinath@novell.com>
3060 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
3061 CS0246 check to users who passed 'silent = false'.
3062 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
3064 (SimpleName.SimpleNameResolve): Update.
3065 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
3066 (MemberAccess.IdenticalNameAndTypeName): Update.
3067 * doc.cs (FindDocumentedTypeNonArray): Update.
3069 2005-03-03 Raja R Harinath <rharinath@novell.com>
3071 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3072 * parameters.cs (ComputeAndDefineParameters): Remove.
3073 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3074 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3075 Use GetParameterInfo.
3077 2005-03-02 Marek Safar <marek.safar@seznam.cz>
3079 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3081 2005-03-02 Raja R Harinath <rharinath@novell.com>
3083 Unify DeclSpace.LookupType and DeclSpace.FindType.
3084 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
3085 is in charge of defining nested types on demand.
3086 (DeclSpace.LookupType): Use it when the current_type is a
3087 TypeBuilder. Use LookupTypeDirect for reflected types.
3088 (DeclSpace.FindType): Remove.
3089 (DeclSpace.LookupInterfaceOrClass): Likewise.
3090 (DeclSpace.DefineTypeAndParents): Likewise.
3091 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3092 DeclSpace.LookupType.
3093 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3094 * typemanager.cs (LookupType): Simplify.
3095 (AddUserType): Remove type from negative_hits.
3096 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3097 * class.cs (TypeContainer.FindMembers): Move handling of nested
3099 (TypeContainer.FindMembers_NestedTypes): ... here.
3100 (TypeContainer.FindNestedType): Implement override.
3101 (ClassPart.FindNestedType): Delegate to PartialContainer.
3102 (ClassPart.PartFindNestedType): Looks up the nested types of the
3105 2005-04-14 Martin Baulig <martin@ximian.com>
3107 * generic.cs (ConstructedType): Moved all the type lookup and
3108 nested class logic into SimpleName.
3109 (ConstructedType.ResolveConstructedType): Our underlying type is
3110 already fully resolved; all the type lookup stuff is in
3113 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
3114 constructed types here instead of in ConstructedType.
3116 * decl.cs (MemberName.GetTypeExpression): Always create a
3117 SimpleName, not a ConstructedType.
3118 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
3120 2005-03-02 Martin Baulig <martin@ximian.com>
3122 * class.cs (TypeContainer.DoDefineMembers): We also need a default
3123 static constructor in static classes.
3125 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
3127 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3128 sizeParamIndex is not specified.
3130 2005-03-01 Marek Safar <marek.safar@seznam.cz>
3133 * report.cs (WarningMessage.IsEnabled): Missing null check.
3135 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3137 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3138 in the fields and not in the properties.
3140 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
3142 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
3145 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3147 * attribute.cs: Small refactoring (improved robustness).
3148 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3149 (ValidateGuid): Removed.
3150 (Resolve): Removed referenced to above mentioned.
3151 (GetAttributeUsage): Made private and changed to work without
3153 (GetIndexerAttributeValue): Don't crash.
3154 (GetConditionalAttributeValue): Ditto.
3155 (GetClsCompliantAttributeValue): Ditto.
3156 (ExtractSecurityPermissionSet): All attributes exceptions are
3158 (GetPropertyValue): New helper.
3159 (GetMethodImplOptions): New method.
3160 (DefinePInvokeMethod): Reuse common code. Implemented handling of
3161 some missing properties.
3163 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3164 (Method.ApplyAttributeBuilder): Updated.
3166 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3169 2005-02-28 Raja R Harinath <rharinath@novell.com>
3172 * report.cs (Report.SymbolRelatedToPreviousError): Handle
3173 non-simple types (array, pointer, reference).
3175 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3177 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3179 * class.cs (MethodCore.IsDuplicateImplementation): Special error
3181 (Method.CheckBase): Catch wrong destructor here.
3182 (MethodData.Define): Add errors 550, 668.
3184 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3186 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3188 * pending.cs (VerifyPendingMethods): Add error 551.
3190 * typemanager.cs (CSharpName): Next error report helper.
3192 2005-02-25 Marek Safar <marek.safar@seznam.cz>
3194 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3195 attributes. Removed useless attribute double check.
3196 It saves almost 2MBs for corlib.
3198 2005-02-25 Raja R Harinath <rharinath@novell.com>
3201 * statement.cs (ExpressionStatement.Resolve): Make robust to being
3202 called twice in case of error.
3204 2005-02-23 Chris Toshok <toshok@ximian.com>
3206 Fix compiler portions of #72827.
3207 * statement.cs (Block.Emit): call Begin/EndScope on the
3208 EmitContext instead of the ILGenerator.
3210 * codegen.cs (EmitContext.BeginScope): new method, call
3211 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3213 (EmitContext.BeginScope): same, but EndScope and CloseScope
3215 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3216 offset and call the superclass's OpenScope(int) with it.
3217 (SymbolWriter.CloseScope): get the current il
3218 offset and call superclass's CloseScope(int) with it.
3220 2005-02-23 Marek Safar <marek.safar@seznam.cz>
3222 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3223 CS1677 for out and ref as well.
3225 * class.cs (Method.Define): Add error CS1599 detection.
3227 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3229 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3231 * delegate.cs (Delegate.Define): Add error CS1599 detection.
3233 * support.cs.cs (ModifierDesc): New helper method.
3235 2005-02-23 Raja R Harinath <rharinath@novell.com>
3236 Abin Thomas <projectmonokochi@rediffmail.com>
3237 Anoob V E <projectmonokochi@rediffmail.com>
3238 Harilal P R <projectmonokochi@rediffmail.com>
3241 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3242 MemberLookup (used for error reporting) actually returns a result.
3243 Fix error report number (122, not 112).
3245 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
3246 Anoob V E <projectmonokochi@rediffmail.com>
3247 Harilal P R <projectmonokochi@rediffmail.com>
3250 * pending.cs (PendingImplementation.GetAbstractMethods):
3251 Find NonPublic members too.
3253 2005-02-22 Marek Safar <marek.safar@seznam.cz>
3255 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3258 * class.cs (MethodCore.CheckMethodAgainstBase):
3259 Add error 239 report.
3261 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3263 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3265 * class.cs (Operator.Define): Add error 217 report.
3267 2005-02-21 Raja R Harinath <rharinath@novell.com>
3270 * expression.cs (Invocation.IsApplicable): Make public.
3271 (Invocation.IsParamsMethodApplicable): Likewise.
3272 * delegate.cs (Delegate.VerifyApplicability): Don't use
3273 Invocation.VerifyArgumentCompat for parameter applicability
3274 testing. Use Invocation.IsApplicable and
3275 Invocation.IsParamsMethodApplicable.
3277 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3279 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3281 * class.cs (Operator.Define): Add error 217 report.
3283 2005-02-21 Raja R Harinath <rharinath@novell.com>
3285 * namespace.cs (UsingEntry.Resolve): Undo change below.
3287 2005-02-21 Raja R Harinath <rharinath@novell.com>
3290 * ecore.cs (Expression.MemberLookupFailed): Add argument to
3291 disable the error message when the extended MemberLookup also
3293 (Expression.MemberLookupFinal): Update.
3294 (SimpleName.DoSimpleNameResolve): Update.
3295 * expression.cs (MemberAccess.ResolveNamespaceOrType):
3296 Don't use MemberLookupFinal.
3297 (New.DoResolve): Update.
3298 (BaseAccess.CommonResolve): Update.
3300 2005-02-21 Raja R Harinath <rharinath@novell.com>
3303 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3304 occured previously, don't resolve again.
3306 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3309 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3310 argument. Call ResolveAttributeUsage for unresolved.
3311 when types doesn't match ctor arguments.
3313 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3314 for nested attribute classes.
3315 (Class.attribute_usage): Removed.
3316 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3317 for attribute class.
3319 * ecore.cs (IsAttribute): Removed.
3321 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3323 * rootcontext.cs (RegisterAttribute): Removed, attributes are
3325 (attribute_types): Removed.
3326 (EmitCode): Global attributes are emited as the latest.
3328 2005-02-18 Marek Safar <marek.safar@seznam.cz>
3330 * class.cs (EmitFieldInitializers): Don't emit field initializer
3331 for default values when optimilization is on.
3333 * constant.cs (Constant.IsDefaultValue): New property.
3335 * driver.cs: Add /optimize handling.
3339 * literal.cs: Implement new IsDefaultValue property.
3341 * rootcontext.cs (Optimize): New field, holds /optimize option.
3343 2005-02-18 Raja R Harinath <rharinath@novell.com>
3345 Fix crasher in re-opened #72347.
3346 * namespace.cs (Namespace.Lookup): Return null if
3347 DeclSpace.DefineType returns null.
3350 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3352 2005-02-18 Raja R Harinath <rharinath@novell.com>
3354 Fix remainder of #63202. Change semantics of DoResolveLValue: it
3355 now returns null if it cannot resolve to an lvalue.
3356 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3357 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3358 returned null. Remove check for SimpleName.
3359 (EventExpr.DoResolveLValue): New.
3360 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3361 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
3363 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
3365 (Unary.ResolveOperator): Move CS0211 check ...
3366 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
3368 (Unary.DoResolveLValue): Simplify.
3369 (AddressOf.DoResolveLValue): New.
3370 (ArrayAccess.DoResolveLValue): New.
3372 2005-02-16 Marek Safar <marek.safar@seznam.cz>
3374 * attribute.cs (Attribute.Resolve): Add arguments casting for
3375 when types doesn't match ctor arguments.
3377 2005-02-16 Raja R Harinath <rharinath@novell.com>
3379 Fix parts of #63202.
3380 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3381 lookup of operator in base type. Ensure that all checks happen
3382 when the operator resolves to an "op_..." method.
3384 2005-02-15 Raja R Harinath <rharinath@novell.com>
3387 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3388 'ignore_cs0104' parameter. Pass it to ...
3389 (NamespaceEntry.Lookup): ... this.
3390 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3391 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3392 (TypeLookupExpression.DoResolveAsTypeStep): Update.
3393 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3394 Update. Request that cs0104 errors be ignored.
3395 (ComposedCast.ResolveAsTypeStep): Update.
3397 2005-02-14 Raja R Harinath <rharinath@novell.com>
3400 * expression.cs (Invocation.BetterFunction): Remove support for
3401 comparing virtual functions and their overrides.
3402 (Invocation.IsOverride): New.
3403 (Invocation.OverloadResolve): Don't consider 'override' functions
3404 during candidate selection. Store them in a lookaside list.
3405 If the selected method is a 'virtual' function, use the list to
3406 find any overrides that are closer to the LHS type.
3408 2005-02-14 Marek Safar <marek.safar@seznam.cz>
3410 * expression.cs (New.DoResolve): Add complex core type reduction.
3411 (New.Constantify): Converts complex core type syntax like 'new int ()'
3414 2005-02-14 Raja R Harinath <rharinath@novell.com>
3416 * decl.cs (EntryType.EntryType): New constructor to create an
3417 updated copy of a cache entry.
3418 (MemberCache.AddMethods): Use it.
3419 (MemberCache.ClearDeclaredOnly): Remove.
3420 (MemberCache.MemberCache): Update.
3422 2005-02-11 Miguel de Icaza <miguel@novell.com>
3424 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3425 variable. This one is represents the actual low-level declaration
3426 of the method, as opposed to the semantic level `IsStatic'.
3428 An anonymous method which is hosted into a static method might be
3429 actually an instance method. IsStatic would reflect the
3430 container, while MethodIsStatic represents the actual code
3433 * expression.cs (ParameterReference): Use the new MethodIsStatic
3434 instead of IsStatic.
3436 * anonymous.cs (AnonymousMethod.Compatible): Pass the
3437 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3438 set on the current EmitContext.
3440 * expression.cs (Cast): Overload DoResolveLValue so we can pass
3441 resolve our casted expression as an LValue. This triggers the
3442 proper LValue processing that is later required by Assign.
3446 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3448 2005-02-11 Marek Safar <marek.safar@seznam.cz>
3450 C# 2.0 Fixed buffer implementation
3452 * anonymous.cs: Update after RegisterHelperClass renaming.
3454 * attribute.cs (AttributeTester.fixed_buffer_cache):
3455 Cache of external fixed buffers.
3456 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3457 implementation if field is fixed buffer else null.
3460 (TypeContainer.AddField): Accept FieldMember instead of Field.
3461 (FieldBase.IsFieldClsCompliant): Extracted code from
3462 VerifyClsCompliance descendant customization.
3463 (FixedField): New class handles fixed buffer fields.
3464 (FixedFieldExternal): Keeps information about imported fixed
3466 (IFixedField): Make access to internal or external fixed buffer
3469 * cs-parser.jay: Add fixed buffer parsing.
3471 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3474 * expression.cs (Indirection): Extended implementation to accept
3476 (PointerArithmetic.Emit): Get element from fixed buffer as well.
3477 (ElementAccess.MakePointerAccess): Get type as parameter.
3478 (DoResolve): Add fixed buffer field expression conversion.
3479 (DoResolveLValue): Ditto.
3480 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3481 (ArrayPtr): Derives from FixedBufferPtr.
3482 (ArrayPtr.Emit): Add extra emit for array elements.
3484 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3486 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3487 for compiler generated types.
3488 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3490 * statement.cs (Fixed): Refactored to be easier add fixed buffer
3491 and consume less memory.
3492 (Fixed.Resolve): Add fixed buffer case.
3494 * typemanager.cs (compiler_generated_attr_ctor,
3495 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3496 (HasElementType): Add our own implementation to work on every
3499 2005-02-11 Miguel de Icaza <miguel@novell.com>
3501 * anonymous.cs (CaptureContext): Track whether `this' has been
3504 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
3505 only captured `this' if it was implicitly done (instance
3506 methods/variables were used).
3508 * codegen.cs (EmitContext.CaptureThis): New method to flag that
3509 `this' must be captured.
3511 2005-01-30 Miguel de Icaza <miguel@novell.com>
3513 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3514 is null it means that there has been no need to capture anything,
3515 so we just create a sibling.
3517 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3519 Just a partial fix. The other half is fairly elusive.
3521 2005-02-10 Raja R Harinath <rharinath@novell.com>
3523 Fix #52586, cs0121-4.cs.
3524 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
3525 and return a hashtable.
3526 (MemberCache.ClearDeclaredOnly): New.
3527 (MemberCache.MemberCache): Update to change. Make a deep copy of
3528 the method_hash of a base type too.
3529 (MemberCache.AddMethods): Adapt to having a deep copy of the base
3530 type methods. Overwrite entries with the same MethodHandle so
3531 that the ReflectedType is correct. The process leaves in base
3532 virtual functions and their overrides as distinct entries.
3533 (CacheEntry): Now a class instead of a struct. It shouldn't alter
3534 matters since it was boxed in a ArrayList before.
3535 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3537 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
3538 case of a virtual function and its override (choose the overload
3540 (Invocation.OverloadResolve): Avoid 'override' members during
3541 'applicable_type' calculation.
3543 2005-03-28 Raja R Harinath <rharinath@novell.com>
3545 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3546 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3547 GetTypeHandle. It is possible for a reflected type to derive from
3548 a TypeBuilder (e.g., int[] derives from the TypeBuilder
3549 System.Array during mscorlib compilation).
3550 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3551 contain a method_hash, don't create one either. Don't create a
3552 deep copy of the base cache's method_hash.
3553 (MemberCache.SetupCache): Rename back from DeepCopy.
3554 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3555 already initialized. If we see an override function, add its
3556 underlying base virtual function to the member_hash too.
3558 2005-02-09 Raja R Harinath <rharinath@novell.com>
3560 Combine two near-redundant caches.
3561 * typemanager.cs (method_params): Rename from method_internal_params.
3562 (TypeManager.GetParameterData): New. Replace
3563 Invocation.GetParameterData.
3564 (TypeManager.LookupParametersByBuilder): Remove.
3565 * expression.cs (Invocation.method_parameter_cache): Remove.
3566 (Invocation.GetParameterData): Remove.
3568 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3571 2005-02-08 Raja R Harinath <rharinath@novell.com>
3574 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3575 TypeManager.multicast_delegate_type is null, resolve it by looking
3576 up "System.MulticastDelegate".
3577 * rootcontext.cs (RootContext.ResolveCore): Simplify.
3579 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
3580 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
3581 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
3584 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3585 (LabeledStatement.AddReference): New. Set 'referenced'.
3586 (Goto.Resolve): Use it.
3588 2005-02-05 John Luke <john.luke@gmail.com>
3590 * driver.cs: remove duplicate -doc line in Usage ()
3592 2005-02-04 Raja R Harinath <rharinath@novell.com>
3594 * location.cs (Location.AddFile): Fix CS2002 error report.
3596 2005-02-02 Martin Baulig <martin@ximian.com>
3598 * delegate.cs (Delegate.DefineType): Report an internal error if
3599 TypeManager.multicast_delegate_type is null. See bug #72015 for
3602 2005-02-02 Raja R Harinath <rharinath@novell.com>
3604 Fix a crasher in a variant of #31984.
3605 * const.cs (Constant.CheckBase): New override that defers the
3606 new-or-override check in case the base type hasn't been populated
3608 (Constant.Define): Ensure the new-or-override check is performed.
3610 2005-02-01 Duncan Mak <duncan@ximian.com>
3612 * const.cs (LookupConstantValue): Check that `ce' is not null
3613 before calling GetValue ().
3615 2005-02-01 Raja R Harinath <rharinath@novell.com>
3617 Fix test-334.cs (#69519).
3618 * cs-parser.jay (using_alias_directive): Pass in an expression to
3619 NamespaceEntry.UsingAlias.
3620 (using_namespace_directive): Pass in an expression to
3621 NamespaceEntry.Using.
3622 (namespace_name): Don't flatten to a string.
3623 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3624 (NamespaceEntry.AliasEntry.Resolve): Lookup using
3626 (NamespaceEntry.UsingEntry): Likewise.
3627 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3629 (NamespaceEntry.LookupForUsing): Remove.
3630 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3632 (NamespaceEntry.Lookup): Remove support for dotted names.
3634 2005-02-01 Raja R Harinath <rharinath@novell.com>
3636 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3638 (NamespaceEntry.ImplicitParent): Compute on demand.
3639 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3640 parallels the current.
3641 (NamespaceEntry.LookupForUsing): Use it.
3642 (NamespaceEntry.Lookup): If the current namespace-entry is
3643 implicit, don't search aliases and using tables.
3645 2005-02-01 Raja R Harinath <rharinath@novell.com>
3648 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3650 (TypeContainer.BaseCache): Compute on demand.
3651 (TypeContainer.FindMembers): Define constants and types if they're
3652 not already created.
3653 (FieldMember.Define): Move resetting of ec.InUnsafe before error
3655 * const.cs (Constant.Define): Make idempotent.
3657 2005-01-29 Miguel de Icaza <miguel@novell.com>
3659 * pending.cs: Produce better code (no nops produced by using Ldarg
3662 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3663 i - 1' it should be arg + 1.
3667 2005-01-28 Raja R Harinath <rharinath@novell.com>
3669 * attribute.cs (Attribute.CheckAttributeType): Make private
3671 (Attribute.ResolveType): Make virtual.
3672 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3673 handling of RootContext.Tree.Types.
3675 2005-01-27 Raja R Harinath <rharinath@novell.com>
3677 Update attribute-handling to use the SimpleName/MemberAccess
3679 * cs-parser.jay (attribute): Pass in an expression to the
3680 constructors of Attribute and GlobalAttribute.
3681 * attribute.cs (Attribute): Take an expression for the name.
3682 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
3683 passed in attribute name expression.
3684 (Attribute.CheckAttributeType): Use it.
3685 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3686 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3687 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
3688 argument to prevent error messages if the lookup fails.
3690 2005-01-27 Marek Safar <marek.safar@seznam.cz>
3692 * expression.cs (Indirection): Implemented IVariable interface
3693 to support indirection in AddressOf operator.
3694 (PointerArithmetic.Emit): Add optimalization for case where
3695 result can be precomputed.
3697 2005-01-26 Martin Baulig <martin@ximian.com>
3699 * class.cs (TypeContainer.AttributeTargets): Return the correct
3700 AttributeTargets depending on our `Kind' instead of throwing an
3701 exception; fixes #71632.
3703 2005-01-26 Marek Safar <marek.safar@seznam.cz>
3706 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3709 2005-03-17 Martin Baulig <martin@ximian.com>
3711 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3712 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
3714 2005-03-17 Martin Baulig <martin@ximian.com>
3716 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3717 to bool so we can return an error condition.
3718 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3721 2005-03-17 Martin Baulig <martin@ximian.com>
3723 * generic.cs (TypeMananager.IsIEnumerable): New public method.
3725 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
3726 converting from an array-type of T to `IEnumerable<T>'.
3728 2005-03-16 Martin Baulig <martin@ximian.com>
3730 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
3731 (Nullable.LiftedUnaryMutator): New public class.
3733 * expression.cs (UnaryMutator.DoResolve): Added support for
3736 2005-03-14 Martin Baulig <martin@ximian.com>
3738 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
3740 2005-03-14 Martin Baulig <martin@ximian.com>
3742 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
3743 the comparision operators `<', `>', `<=' and `>='.
3745 2005-03-13 Martin Baulig <martin@ximian.com>
3748 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
3749 avoid confusion with the `NullLiteral'.
3750 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
3752 2005-03-13 Martin Baulig <martin@ximian.com>
3754 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
3755 comparing arbitrary types with the null literal.
3757 2005-03-13 Martin Baulig <martin@ximian.com>
3759 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
3760 boolean operators '&&', '||', '&' and '|'.
3761 (Nullable.OperatorTrueOrFalse): New public class.
3763 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
3764 instead of a `StaticCallExpr'; added support for nullables.
3766 2005-03-10 Martin Baulig <martin@ximian.com>
3769 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
3770 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
3772 2005-03-07 Martin Baulig <martin@ximian.com>
3774 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
3775 it work if `expr' is not an IMemoryLocation.
3776 (Nullable.Lifted): Implement IMemoryLocation.
3777 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
3780 2005-03-05 Martin Baulig <martin@ximian.com>
3782 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
3783 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
3784 (Nullable): Added support for lifted unary and binary operators.
3786 * expression.cs (Unary.DoResolve): Added support for nullable types.
3787 (Binary.DoResolve): Likewise.
3788 (Conditional.DoResolve): Likewise.
3790 2005-03-02 Martin Baulig <martin@ximian.com>
3792 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
3794 * class.cs (ClassPart.SetParameterInfo): Override this.
3795 (PartialContainer.SetParameterInfo): Override this.
3796 (TypeContainer.CheckConstraints): New protected method.
3797 (PartialContainer.CheckConstraints): Override this and check
3798 whether the same contraints were specified in all parts of a
3799 partial generic type definition.
3800 (PartialContainer.UpdateConstraints): New public method.
3802 * generic.cs (TypeParameter.UpdateConstraints): New public method.
3804 2005-03-02 Martin Baulig <martin@ximian.com>
3806 Committing a patch from Carlos Alberto Cortez to fix #72887.
3808 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
3809 casts from `T []' to `int []'.
3811 2005-03-02 Martin Baulig <martin@ximian.com>
3813 * generic.cs (TypeManager.IsEqual): Make this symmetric.
3815 * expression.cs (Binary.ResolveOperator): When resolving a
3816 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
3817 `=='. Fixes #71866. See gen-127.cs.
3819 2005-03-02 Martin Baulig <martin@ximian.com>
3821 * class.cs (TypeContainer.DoDefineMembers): We also need a default
3822 static constructor in static classes.
3824 2005-03-02 Martin Baulig <martin@ximian.com>
3827 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
3828 (Nullable.LiftedConversion): Added support for user-defined
3831 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
3833 * cs-parser.jay: Use ComposedCast everywhere instead of
3834 NullableType, so we don't need to check for NullableType
3836 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3837 case where we'll be resolved into a `parenthesized_expression_0'
3841 (Convert.UserDefinedConversion): Added nullable conversions.
3843 2005-02-28 Martin Baulig <martin@ximian.com>
3845 * generic.cs (TypeManager.IsNullableType): New static method.
3846 (Nullable): New abstract class.
3847 (Nullable.NullLiteral): New public class.
3848 (Nullable.LiftedConversion): New public class.
3850 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3851 `builtin_types opt_nullable'.
3854 (Convert.ImplicitConversionStandard): Added nullable conversions.
3855 (Convert.ExplicitConversionStandard): Likewise.
3856 (Convert.ExplicitConversion): Likewise.
3858 2005-02-26 Martin Baulig <martin@ximian.com>
3860 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3861 begin with a "?", for instance "?[]". Don't do a type lookup if
3864 2005-02-25 Martin Baulig <martin@ximian.com>
3866 The first part of Nullable Types :-)
3868 * generic.cs (NullableType): New public class.
3869 (NullCoalescingOperator): New public class.
3870 (TypeArguments.Resolve): Add a CS0306 check.
3872 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3873 (opt_nullable): New rule.
3874 (type): Added `opt_nullable' to `namespace_or_type_name',
3875 `builtin_types' and `pointer_type'.
3876 (array_type): Added `opt_nullable'.
3877 (opt_rank_specifier_or_nullable): New rule; this is the
3878 combination of `opt_rank_specifier' and `opt_nullable'.
3879 (opt_error): New rule; catch errors here.
3880 (nullable_type_or_conditional): New rule; we use this to check for
3881 nullable and still detect the conditional operator.
3882 (local_variable_type): Use `opt_rank_specifier_or_nullable'
3883 instead `opt_rank_specifier'.
3885 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3888 2005-02-24 Martin Baulig <martin@ximian.com>
3890 * README, README.Changes: Removed; they're old and obsolete.
3892 2005-02-22 Martin Baulig <martin@ximian.com>
3894 * generic.cs (TypeParameter.Resolve): If resolving the constraints
3895 returned an error, set `constraints' to null to avoid a crash
3897 (TypeParameter.ResolveType): Likewise.
3899 2005-02-22 Martin Baulig <martin@ximian.com>
3902 (Constraints.ResolveTypes): Protect against being called twice.
3903 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3904 (TypeParameter.ResolveType): New public method; calls
3905 constraints.ResolveTypes().
3906 (TypeParameter.DefineType): Moved constraints.ResolveType() out
3907 into the new ResolveType().
3908 (GenericMethod.Define): Call ResolveType() on all our
3911 2005-02-21 Martin Baulig <martin@ximian.com>
3914 (TypeManager.generic_nullable_type): New static public field.
3915 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3918 (RootContext.ResolveCore): Resolve "System.Nullable`1".
3920 2005-02-15 Martin Baulig <martin@ximian.com>
3922 * generic.cs (ConstructedType.Constraints): Correctly check
3923 constraints if the argument type is a type parameter; fixes
3926 2005-02-02 Martin Baulig <martin@ximian.com>
3928 * delegate.cs (Delegate.DefineType): Report an internal error if
3929 TypeManager.multicast_delegate_type is null. See bug #72015 for
3932 2005-01-29 Miguel de Icaza <miguel@novell.com>
3934 * pending.cs: Produce better code (no nops produced by using Ldarg
3937 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3938 i - 1' it should be arg + 1.
3942 2005-01-26 Martin Baulig <martin@ximian.com>
3944 * cs-parser.jay (indexer_declarator): Don't report an error if we
3945 have type parameters since we can be an explicit interface
3946 implementation; fixes #71449.
3948 2005-01-26 Martin Baulig <martin@ximian.com>
3950 * class.cs (TypeContainer.AttributeTargets): Return the correct
3951 AttributeTargets depending on our `Kind' instead of throwing an
3952 exception; fixes #71632.
3954 2005-01-26 Martin Baulig <martin@ximian.com>
3956 * delegate.cs (Delegate.DefineType): Correctly define our type
3957 parameters. Fixes #71483.
3959 2005-01-25 Raja R Harinath <rharinath@novell.com>
3962 * expression.cs (MemberAccess.DoResolve): Don't complain with
3963 cs0572 when the LHS of a member access has identical name and type
3966 2005-01-25 Marek Safar <marek.safar@seznam.cz>
3969 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3971 Create custom PermissionSet only for PermissionSetAttribute.
3973 2005-01-24 Marek Safar <marek.safar@seznam.cz>
3976 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3977 delegates in static class.
3979 2005-01-24 Martin Baulig <martin@ximian.com>
3981 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3982 merging an implicit block, just use its reachability.
3984 * statement.cs (Block.Resolve): Make the unreachable code check
3985 work wrt. implicit blocks; see test-337 from #63842.
3987 2005-01-21 Alp Toker <alp@atoker.com>
3989 * cs-parser.jay: destructor_declaration's container is PartialContainer
3990 not Class when partial types are used, so use Kind prop instead of
3993 2005-01-22 Miguel de Icaza <miguel@ximian.com>
3995 * cs-parser.jay: Improve error reporting when an interface
3998 2005-01-20 Dick Porter <dick@ximian.com>
4000 * support.cs: SeekableStreamReader fix from Sandor Dobos
4001 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
4002 chars are read. Fixes bug 70369.
4004 2005-01-20 Raja R Harinath <rharinath@novell.com>
4006 * cs-parser.jay (catch_clause): Simplify current_block handling
4009 2005-01-17 Miguel de Icaza <miguel@ximian.com>
4011 * convert.cs (ImplicitStandardConversionExists): Synchronize the
4012 code with ImplicitStandardConversion to handle the implicit
4013 conversion of method groups into valid delegate invocations.
4015 The problem is that in parameter handling we were using this code
4016 path. Fixes bug #64698
4018 2005-01-19 Raja R Harinath <rharinath@novell.com>
4020 * cs-parser.jay: Fix several infelicities.
4021 - Avoid assigning to the parser value stack. Code like
4022 '$3 = null' is unclean. Synthesize a value for the code block
4024 - Avoid using oob_stack for storing location information. Use ...
4025 (_mark_): ... this. New (empty) rule. Saves the current location
4027 (foreach_statement): Avoid using oob_stack for current_block
4028 handling. Use technique used in for_statement and
4029 using_statement. Synthesize a value for the code block to store
4030 additional intermediate information.
4032 2005-01-13 Miguel de Icaza <miguel@ximian.com>
4034 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
4035 of a different type is only allowed to private fields of a
4036 containing type, not on fields of a base class.
4038 See test-174.cs and error cs0122-9.cs
4040 2005-01-13 Raja R Harinath <rharinath@novell.com>
4042 Fix test-335.cs (bug #58126).
4043 * cs-parser.jay (argument): Split out non-expression parts of the
4044 rule into 'non_simple_argument'.
4045 (invocation_expression): Support parenthesized invocations with
4046 multiple arguments, and with single non-simple arguments.
4048 2005-01-13 Raja R Harinath <rharinath@novell.com>
4050 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
4053 2005-01-12 Raja R Harinath <rharinath@novell.com>
4055 Fix cs0038-1.cs, cs1640-6.cs.
4056 * ecore.cs (Expression.Resolve): Remove special-case for
4057 SimpleName in error-handling.
4058 (Expression.almostMatchedMembers): Relax access permission to
4060 (Expression.MemberLookupFailed): Handle duplicates in
4061 almostMatchedMembers list.
4062 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
4063 * expression.cs (New.DoResolve): Report CS1540 for more cases.
4064 * typemanager.cs (GetFullNameSignature): Use the MethodBase
4065 overload if the passed in MemberInfo is a MethodBase.
4067 2005-01-25 Martin Baulig <martin@ximian.com>
4070 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
4072 2005-01-12 Marek Safar <marek.safar@seznam.cz>
4075 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
4076 for non-CAS & merge permission sets properly.
4078 2005-01-11 Raja R Harinath <rharinath@novell.com>
4080 Improve standard-compliance of simple name and member access
4081 resolution. Fixes bugs #52697, #57200, #67520, #69519.
4082 * ecore.cs (FullNamedExpression): New abstract base class
4083 for Namespaces and TypeExpressions.
4084 (ResolveFlags.SimpleName): Remove.
4085 (SimpleName): Remove support for dotted names.
4086 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
4087 DeclSpace.FindType and DeclSpace.LookupType.
4088 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
4089 (Expression.ExprClassName): Make member function.
4090 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
4091 a namespace. Remove creation of dotted "SimpleName"s.
4092 (MemberAccess.DoResolve): Likewise.
4093 * decl.cs (DeclSpace.Cache): Make private.
4094 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
4095 (DeclSpace.FindType): Update.
4096 (DeclSpace.LookupType): Move here from RootContext. Return a
4097 FullNamedExpression.
4098 * namespace.cs (Namespace): Derive from FullNamedExpression
4099 so that it can be part of expression resolution.
4100 (Namespace.Lookup): Return an FullNamedExpression.
4101 (NamespaceEntry.LookupAlias): Lookup aliases only in current
4103 * rootcontext.cs (NamespaceLookup): Remove.
4104 (LookupType): Move to DeclSpace.
4105 * attribute.cs (CheckAttributeType): Update.
4106 * doc.cs (FindDocumentedType): Remove allowAlias argument.
4107 (FindDocumentedTypeNonArray): Likewise.
4109 2005-01-11 Raja R Harinath <rharinath@novell.com>
4111 Fix cs0509.cs, cs1632.cs.
4112 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
4113 is the same as IsInterface.
4114 (TypeContainer.GetClassBases): Likewise.
4115 * statement.cs (LabeledStatement.ig): New field.
4116 (LabeledStatement.LabelTarget): Save ILGenerator which created the
4118 (LabeledStatement.DoEmit): Check that the label was created with
4119 the same ILGenerator.
4121 2005-01-10 Marek Safar <marek.safar@seznam.cz>
4124 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
4125 accessors to its properties.
4127 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
4128 from accessors to property.
4130 2005-01-10 Marek Safar <marek.safar@seznam.cz>
4133 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
4136 2005-01-08 Miguel de Icaza <miguel@ximian.com>
4138 * attribute.cs: Check for null and empty strings.
4140 I have lost another battle to Paolo.
4142 2005-01-07 Marek Safar <marek.safar@seznam.cz>
4145 * class.cs (PropertyMethod): Set Parent field in ctors.
4146 (SetMethod.InternalParameters): Add unsafe switch hack.
4147 Override MarkForDuplicationCheck where it is appropriate.
4149 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
4150 It says whether container allows members with the same name.
4152 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
4153 Removed is_method parameter.
4155 2005-01-06 Duncan Mak <duncan@ximian.com>
4157 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
4158 because the previous change led to incorrect reporting of CS1032
4159 ("Cannot define/undefine preprocessor symbols after first token in
4160 file"). Instead of using `tokens_seen' as the only flag that
4161 triggers CS1040, introduce `comments_seen'. This new flag is used
4162 to signify having seen comments on the current line, so it is
4163 unset after a newline.
4165 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
4167 * doc.cs : When searching for a type, find nested type too.
4168 This fixes bug #71040.
4170 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
4173 - Warn missing member comment on those classes which also does not
4174 have doc comments. Fixed bug #71041.
4175 - Don't warn missing doc comment on default constructor.
4178 2005-01-06 Duncan Mak <duncan@ximian.com>
4180 * cs-tokenizer.cs (xtoken): After handling traditional C-style
4181 comments, set `tokens_seen' to true. This allows us to detect
4182 misplaced preprocessor directives (i.e. not at the beginning of
4183 the a line, nor after whitespaces). In that case, report error
4184 CS1040. This fixes bug #56460.
4186 * cs-parser.jay (interface_member_declaration): Add checks for
4187 IsExplicitImpl, and report CS0541 error if an interface member is
4188 defined as an explicit interface declaration.
4190 2005-01-06 Marek Safar <marek.safar@seznam.cz>
4193 * class.cs (PropertyMethod): Set Parent field in ctors.
4194 (SetMethod.InternalParameters): Add unsafe switch hack.
4196 * decl.cs (MemberCore.Parent): Cannot be readonly.
4198 2005-01-06 Raja R Harinath <rharinath@novell.com>
4200 * decl.cs (DeclSpace.ResolveType): Remove.
4201 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4202 Merge in code from ...
4203 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
4204 * class.cs, enum.cs: Update to changes.
4206 2005-01-06 Miguel de Icaza <miguel@ximian.com>
4208 * anonymous.cs: Ensure that we init the scope of our parent if it
4209 has not been initialized yet.
4211 2004-12-30 Duncan Mak <duncan@ximian.com>
4213 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
4214 if field.FieldBuilder is null. Fixes #70758.
4216 * convert.cs: Fixed some typos and updated some of the comments.
4217 (ImplicitStandardConversionExists):
4218 (TryImplicitIntConversion): If `target_type' is an interface and
4219 the type of `ic' implements this interface, return true or a new
4220 BoxedCast instead of null. This fixes #70468.
4222 2004-12-29 Duncan Mak <duncan@ximian.com>
4224 * expression.cs (Argument.Emit): Check that Expr is
4225 IMemoryLocation before casting to it, and report CS1510 otherwise.
4229 2004-12-21 Ben Maurer <bmaurer@ximian.com>
4231 * statement.cs (Block.ThisVariable): remove the recursion here, to
4232 make the --profile more sane.
4234 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
4236 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4237 assembly, by JB Evain.
4239 2004-12-17 Raja R Harinath <rharinath@novell.com>
4241 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
4242 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4243 "parent" refers to enclosing type/class. "base" refers to superclass.
4245 2004-12-17 Raja R Harinath <rharinath@novell.com>
4247 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4248 Ensure that we only have GlobalAttributes.
4249 * attribute.cs (Attribute.Emit): Make non-virtual.
4250 (GlobalAttribute.Emit): Remove.
4251 (Attribute.Resolve): Make virtual.
4252 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
4253 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4254 the argument. Don't create one.
4255 (Attribute.GetObsoleteAttribute): Likewise.
4256 (Attribute.GetClsCompliantAttributeValue): Likewise.
4257 * class.cs, decl.cs: Update to changes.
4259 2004-12-17 Marek Safar <marek.safar@seznam.cz>
4261 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4263 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4265 * statement.cs (Foreach.Resolve): Add error 186 report.
4267 2004-12-16 Marek Safar <marek.safar@seznam.cz>
4269 * expression.cs (Conditional.DoResolve): Add warning 429.
4271 * statement.cs (If.Resolve): Add warning 665.
4273 2004-12-16 Raja R Harinath <rharinath@novell.com>
4275 New invariant: RootContext.Tree.Types.NamespaceEntry == null
4276 except when in the parser, and in GlobalAttribute.
4277 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4278 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4279 RootContext.Tree.Types.NamespaceEntry once work is done.
4280 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
4281 and resets RootContext.Tree.Types.NamespaceEntry.
4283 2004-12-15 Marek Safar <marek.safar@seznam.cz>
4285 * cs-parser.jay: Don't create a block for every variable.
4287 2004-12-14 Miguel de Icaza <miguel@ximian.com>
4289 * location.cs: Provide extra information.
4291 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4292 variables from the captured environment, it is the ldarg_0.
4294 2004-12-14 Marek Safar <marek.safar@seznam.cz>
4296 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4299 * class.cs: Changed warning level for 169 to avoid developer
4300 displeasure from warning flooding. It will be changed back when they
4301 fix most of current BCL warnings.
4303 * RootContext.cs: Pushed default WarningLevel to 3.
4305 * statement.cs: Removed unused variable.
4307 2004-12-14 Marek Safar <marek.safar@seznam.cz>
4309 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4310 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4311 Add error 502 report.
4312 (StaticClass.DefineType): Add error 441 report.
4313 (Class.AllowedModifiersProp): New virtual property as temporary
4314 extension to AllowedModifiers.
4315 (Class.DefineType): Add error 418 report. Moved ModFlags check here
4316 to share implementation with StaticClass and don't call virtual
4319 * driver.cs (MainDriver): Add error 1558 test.
4321 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4322 report. Moved error 36 test here.
4324 * statement.cs (Throw.Resolve): Add error 724 report.
4326 * typemanager.cs: Add out_attribute_type core type.
4328 2004-12-13 Marek Safar <marek.safar@seznam.cz>
4330 * class.cs (TypeContainer.VerifyClsCompliance): Add error
4332 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4334 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4337 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4339 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
4340 Add error 3023 report.
4341 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4343 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4346 2004-12-12 John Luke <john.luke@gmail.com>
4348 * driver.cs (AddArgs): take -- into account when
4349 adding arguments, fixes bug 65710
4351 2004-12-12 Martin Baulig <martin@ximian.com>
4353 * expression.cs (Unary.TryReduceNegative): Added support for
4354 SByteConstant and ByteConstant.
4355 (Unary.Reduce): Check error values from TryReduceNegative().
4357 2004-12-10 Marek Safar <marek.safar@seznam.cz>
4359 * attributes.cs (Attribute.Resolve): Avoid multiple error report
4360 and report exception as error 182.
4362 2004-12-10 Raja R Harinath <rharinath@novell.com>
4364 * driver.cs (Main): Fix message when there are warnings.
4366 2004-12-09 Miguel de Icaza <miguel@ximian.com>
4368 * delegate.cs: Fixed my fix from yesterday, sorry about that.
4370 2004-12-09 Marek Safar <marek.safar@seznam.cz>
4372 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
4373 Reduced number of warnings.
4375 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4377 2004-12-08 Miguel de Icaza <miguel@ximian.com>
4379 * driver.cs: Removed message.
4381 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4383 2004-12-08 <vargaz@freemail.hu>
4385 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4387 2004-12-08 Martin Baulig <martin@ximian.com>
4389 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4390 instead of a CS3002 for properties and indexer.
4392 2004-12-08 Martin Baulig <martin@ximian.com>
4394 * decl.cs (MemberName.ToString): Make this work again.
4396 2004-12-08 Marek Safar <marek.safar@seznam.cz>
4398 * attribute.cs (Resolve): Add error 591 detection.
4400 * class.cs (FieldMember.Define): Add error 1547 detection.
4401 (Indexer.Define): Add error 620 detection.
4402 (Operator.Define): Add error 590 detection.
4404 * ecore.cs: Missing argument for error 79.
4406 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4409 2004-12-07 Marek Safar <marek.safar@seznam.cz>
4412 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4415 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4417 * cs-parser.jay : handle doc comments on implicit/explicit operators.
4418 Some operator comments were suppressed.
4419 * doc.cs : Implicit/explicit operator name in doc comments are like
4420 "op_Explicit(type)~returnType", so added suffix handling.
4422 2005-01-21 Alp Toker <alp@atoker.com>
4424 * cs-parser.jay: destructor_declaration's container is PartialContainer
4425 not Class when partial types are used, so use Kind prop instead of 'is'.
4427 2004-12-12 Martin Baulig <martin@ximian.com>
4429 * expression.cs (Unary.TryReduceNegative): Added support for
4430 SByteConstant and ByteConstant.
4431 (Unary.Reduce): Check error values from TryReduceNegative().
4433 2004-12-11 Martin Baulig <martin@ximian.com>
4435 * support.cs (ReflectionParameters.ParameterName): If we have a
4436 `gpd', call `ParameterName' on it.
4438 * parameter.cs (Parameter.GetParameterAttributes): New static method.
4440 * pending.cs (PendingImplementation.DefineProxy): Call
4441 DefineParameter() for all of the MethodBuilder's arguments.
4443 2004-12-09 Martin Baulig <martin@ximian.com>
4445 * doc.cs (DocUtil): Make this a static class.
4447 2004-12-09 Martin Baulig <martin@ximian.com>
4449 * expression.cs (Invocation.InferType): Moved the type inference
4450 implementation into TypeManager.
4452 * generics.cs (TypeManager): Moved the type inference
4453 implementation here.
4455 2004-12-09 Martin Baulig <martin@ximian.com>
4457 * typemanager.cs (TypeManager): Make this a partial class.
4460 (TypeManager): Move the generics part of `TypeManager' here.
4462 2004-12-08 Martin Baulig <martin@ximian.com>
4464 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4465 instead of a CS3002 for properties and indexer. Added CS3024
4466 check for generic interfaces.
4468 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
4469 instances are not CLS-compliant.
4471 2004-12-08 Martin Baulig <martin@ximian.com>
4474 (void_pointer_expression): New rule for `void*', `void**' etc.
4475 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
4477 2004-12-08 Martin Baulig <martin@ximian.com>
4479 * expression.cs (Invocation.InferType): Removed the hack for
4480 MethodCore.MayUnify().
4482 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4485 * class.cs (MethodCore.MayUnify): Use
4486 TypeManager.MayBecomeEqualGenericTypes().
4488 2004-12-08 Martin Baulig <martin@ximian.com>
4490 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
4491 parameter, box it. Fixes #69233.
4493 2004-12-08 Martin Baulig <martin@ximian.com>
4495 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
4496 have the ctor constraint. Fixes #68326.
4498 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4500 * cs-parser.jay : interface comment was not consumed because of
4501 extra opt_semicolon before doc handling.
4503 2004-12-03 Raja R Harinath <rharinath@novell.com>
4505 Fix test-327.cs, test-328.cs, and put in early infrastructure
4506 for eventually fixing #52697.
4507 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4508 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4510 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4511 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4512 (VerifyUsing, error246): Update.
4513 * rootcontext.cs (RootContext.NamespaceLookup): Just use
4514 'NamespaceEntry.LookupNamespaceOrType'.
4516 2004-12-07 Martin Baulig <martin@ximian.com>
4518 * driver.cs: Call it "BETA SOFTWARE" :-)
4520 2004-12-06 Raja R Harinath <rharinath@novell.com>
4522 Fix crash on cs0657-17.cs.
4523 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4524 Use RootContext.Tree.Types, not 'new RootTypes ()'.
4525 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4526 the case where the NamespaceEntry gets overwritten.
4528 2004-12-06 Marek Safar <marek.safar@seznam.cz>
4530 Fixed #69195, #56821
4531 * ecore.cs (ResolveBoolean): Tiny refactoring.
4533 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4534 of right expression resolving when left is false constant and
4535 operator is LogicalAnd OR true constant and operator is LogicalOr.
4537 * statement.cs (ResolveUnreachable): Always reports warning.
4539 2004-12-05 Miguel de Icaza <miguel@ximian.com>
4541 * class.cs: Distinguish between 1721 and 1722 (just a little help
4542 for the programmer).
4544 2004-12-03 Miguel de Icaza <miguel@ximian.com>
4546 * delegate.cs: Only allow this on new versions of the language.
4548 2004-12-02 Duncan Mak <duncan@ximian.com>
4550 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4552 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4553 here as a static method. Take an additional bool out parameter
4554 `must_do_cs1540_check' for signaling to InstanceResolve.
4555 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4556 member field from PropertyExpr class and made it an argument of
4558 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4559 check for MarshalByRefObject, and report CS0122 instead of CS1540.
4560 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4561 and `remove_accessor' as well as InstanceResolve: report CS0122
4566 2004-12-07 Martin Baulig <martin@ximian.com>
4568 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
4569 and CS0692 where appropriate.
4571 2004-12-06 Martin Baulig <martin@ximian.com>
4573 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
4574 IsDuplicateImplementation() and improved it.
4576 * expression.cs (Invocation.InferTypeArguments): Added
4577 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
4578 and removed the "ref" modifier from `infered_types'.
4580 * decl.cs (MemberName.ToString): Removed the exception.
4582 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
4584 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4585 comments are allowed.
4587 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4589 * delegate.cs: Add checks for subtypes in paramaters and return values
4590 in VerifyMethod () to add support for Covariance/Contravariance
4593 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4595 * report.cs: Remove extra closing parenthesis.
4597 * convert.cs (Error_CannotImplicitConversion): If the name of the
4598 types are the same, provide some extra information.
4600 2004-12-02 Marek Safar <marek.safar@seznam.cz>
4603 * attribute.cs (Resolve): Improved implementation of params
4604 attribute arguments.
4606 * support.cs (ParameterData): Add HasParams to be faster.
4608 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
4610 all things are for /doc support:
4612 * doc.cs: new file that supports XML documentation generation.
4613 * mcs.exe.sources: added doc.cs.
4615 Handle /doc command line option.
4616 Report error 2006 instead of 5 for missing file name for /doc.
4617 Generate XML documentation when required, after type resolution.
4619 Added support for picking up documentation (/// and /** ... */),
4620 including a new XmlCommentState enumeration.
4622 Added lines to fill Documentation element for field, constant,
4623 property, indexer, method, constructor, destructor, operator, event
4624 and class, struct, interface, delegate, enum.
4625 Added lines to warn incorrect comment.
4627 Added Documentation field (passed only when /doc was specified).
4629 Added DocComment, DocCommentHeader, GenerateDocComment() and
4630 OnGenerateDocComment() and some supporting private members for
4631 /doc feature to MemberCore.
4633 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4635 Added overriden DocCommentHeader.
4637 Added overriden DocCommentHeader and GenerateDocComment().
4639 2004-12-01 Miguel de Icaza <miguel@ximian.com>
4641 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4642 unwrapping the enumeration values, chain to
4643 DoConstantNumericPromotions again, so we can promote things to the
4644 fundamental types (takes care of enums that are bytes, sbytes).
4648 2004-12-01 Raja R Harinath <rharinath@novell.com>
4650 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4651 Fix long-standing bug in type-lookup. Use FindType instead of
4652 LookupType when ec.ResolvingTypeTree.
4653 (Attribute.ResolveType, Attribute.Resolve)
4654 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4656 (Attributes.Search): Remove internal version. Update.
4657 (Attributes.SearchMulti): Update.
4658 (Attributes.GetClsCompliantAttribute): Remove.
4659 (Attributes.GetIndexerNameAttribute): Remove.
4660 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4661 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4662 * class.cs (Indexer.Define): Likewise.
4664 2004-12-01 Marek Safar <marek.safar@seznam.cz>
4667 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4668 MarshallByReference members access.
4670 * expression.cs: Use CheckMarshallByRefAccess;
4671 Better error CS0197 message.
4673 * report.cs: Print whole related error message.
4675 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4677 * class (GetClassBases): Better error 60 report.
4678 (EventProperty): Disabled warning 67 detection.
4680 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4683 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4685 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4688 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4691 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4693 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4695 2004-11-26 Miguel de Icaza <miguel@ximian.com>
4697 * attribute.cs (Attribute.Resolve): Refine error reporting and
4698 report a cs0117 if the identifier does not exist, to distinguish
4699 from 0617 which is a miss-use of the actual identifier.
4701 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4702 between cs0070 and cs0079.
4704 * class.cs (MemberBase.DoDefine): When reporting a wrong
4705 accessibility level, we use MethodCore to compare instead of
4706 Method (this was a regression in some refactoring effort).
4708 So now we correctly report cs0056 again.
4710 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4711 testing the target_type (which was known to be object_type) and
4712 not the source type (which is anonymous_method).
4714 Fixed reporting of error cs1660.
4716 * expression.cs (UserCast.Source): Expose the underlying cast.
4718 * statement.cs (Switch.SwitchGoverningType): Sort the list of
4719 allowed types to find a match to int32 first (most common).
4721 In addition, it ignores any ImplicitUserConversions that did an
4722 internal implicit conversion (as the switch statement allows only
4723 one integral conversion to exist).
4725 * class.cs (PartialContainer.Create): rename `name' to
4726 `member_name' for clarity. Then replace the string calls with a
4727 call to MemberName.GetPartialName, as now using
4728 MemberName.ToString is an error (this is due to the side effects
4729 it had, that were fixed in the past).
4731 This will restore the error reporting on a number of partial class
4732 errors that were missusing this (and getting an exception as a
4733 results, which is now just a plain textual warning, because
4734 yyparse debug output would crash otherwise).
4736 2004-11-26 Raja R Harinath <rharinath@novell.com>
4738 * Makefile (PROGRAM_INSTALL_DIR): Remove.
4740 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4742 * rootcontext.cs (LookupType): Make sure to cache lookups that
4743 don't give us a negative result. This saves about 5% of corlib
4746 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4748 * report.cs (AbstractMessage.Print): messages are sent to stderr
4750 * class.cs (TypeContainer.GetClassBases): It is an error to have a
4751 non-interface in the list of interfaces (at this point, either
4752 parent was properly set, or a base class is being listed in the
4753 interfaces section).
4755 This flags error 1722, and resolves the crash from bug 69259.
4757 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4759 * statement.cs (Using.EmitExpressionFinally): make this work right
4760 for valuetypes. Fixes 69926.
4762 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4764 * const.cs (Const.ChangeType): Cope with the "0 literal can be
4765 converted to an enum" here, before we try to change the underlying
4766 type. This code exists, but it is a different code path than the
4767 one used while encoding constants.
4769 (ImplicitReferenceConversionExists): In addition, resynchronized
4770 the code here, so it matches the same code in
4771 ImplicitReferenceConversionExists for the `from any class-type S
4772 to any interface-type T'.
4774 2004-11-25 Marek Safar <marek.safar@seznam.cz>
4776 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4778 2004-11-24 Miguel de Icaza <miguel@ximian.com>
4780 * cs-parser.jay: Use verbosity accordingly.
4782 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4784 * expression.cs (Unary.ResolveOperator): Do not report warning;
4785 AddressOf reads from variable.
4787 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4789 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4793 * attribute.cs (Attributable): Removed CheckTargets.
4794 (Attributes.Emit): Explicit attribute targets are tested here.
4796 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4797 not enabled for interfaces.
4799 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4800 (GetAssemblyName): Ouch next bug there.
4802 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4804 * expression.cs: Error 275 added.
4806 2004-11-23 Marek Safar <marek.safar@seznam.cz>
4808 Fix bug #69177 (Implemented decimal constant support)
4810 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4811 (BinaryFold): Add DecimalConstant.
4813 * const.cs (Define): Decimal constant
4815 (ChangeType): Add decimal type handling.
4816 (LookupConstantValue): Don't set value for decimal type but
4817 emit DecimalConstantAttribute. Needed for constant optimization.
4819 * constant.cs (ToDecimal): New method.
4820 (ConvertToDecimal): New method.
4821 (IntConstant): Implemented ConvertToDecimal.
4822 (DecimalConstant.Emit): Emit optimized version for decimals in
4825 * expression.cs (ResolveOperator): Changed order of constant
4826 reduction to work correctly with native types which have
4827 overloaded operators.
4828 (ResolveMemberAccess): Extract constant value from attribute
4831 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4833 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4834 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4835 (ChangeType): Decimal is special.
4836 (TypeToCoreType): Add decimal type.
4838 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4840 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4843 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4845 * class.cs (EventField.ApplyAttributeBuilder): Fix error
4848 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4850 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4852 * pending.cs (PendingImplementation): Grab only interfaces.
4854 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4856 * statement.cs (ForeachHelperMethods): Add location member and
4857 error 202 detection.
4859 2004-11-18 Marek Safar <marek.safar@seznam.cz>
4861 * expression.cs (DoResolveBase): Fixed wrong warning for out
4864 2004-12-04 Martin Baulig <martin@ximian.com>
4866 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4867 to check whether the conversion is ok.
4869 * typemanager.cs (TypeManager.GetTypeArguments): Just return
4870 `Type.EmptyTypes' if we're not a generic TypeContainer.
4872 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4874 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4875 old bug: when converting from the null literal to a pointer,
4876 return an EmptyCast, not the NullLiteral.
4878 This fixes #69921, the recent null_type changes probably made this
4881 2004-12-03 Martin Baulig <martin@ximian.com>
4883 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4884 method as our child, call AnonymousMethod.Compatible() on it.
4886 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4888 * class.cs (FieldBase): Use an unused bit field from the field to
4889 encode the `has_offset' property from the FieldMember. This saves
4890 a couple of Ks on bootstrap compilation.
4892 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4893 method as our child, return the AnonymousMethod resolved
4896 * expression.cs (New.DoResolve): Allow return values from
4897 NewDelegate to also include AnonymousMethods.
4901 2004-11-29 Raja R Harinath <rharinath@novell.com>
4903 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4905 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4906 System.Runtime.InteropServices._Exception, since it's a base
4907 interface of the core type System.Exception in the net_2_0 profile.
4909 2004-11-27 Martin Baulig <martin@ximian.com>
4911 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4913 2004-11-26 Raja R Harinath <rharinath@novell.com>
4915 * Makefile: Convert to use executable.make.
4916 * gmcs.exe.sources: New.
4918 2004-11-25 Martin Baulig <martin@ximian.com>
4920 * expression.cs (Invocation.InferType): Added support for byref types.
4922 2004-11-25 Martin Baulig <martin@ximian.com>
4924 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4925 in TypeManager.TypeToCoreType().
4927 2004-11-25 Martin Baulig <martin@ximian.com>
4929 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4930 "Dispose" method from the `current_type'.
4931 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4932 DoDefineMembers() instead of using the MethodBuilder; this is
4933 required for generic iterators.
4935 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4937 2004-11-24 Martin Baulig <martin@ximian.com>
4939 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4941 2004-11-20 Martin Baulig <martin@ximian.com>
4943 * expression.cs (Invocation.InferType): Correctly infer generic
4944 instances; see gen-103.cs.
4945 (Invocation.InferTypeArguments): If a generic method doesn't have
4946 any unbound type parameters, we don't need to infer anything.
4948 2004-11-19 Raja R Harinath <rharinath@novell.com>
4950 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4952 2004-11-17 Raja R Harinath <rharinath@novell.com>
4954 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4955 (TypeHandle.GetMemberCache): New.
4956 (TypeHandle.TypeHandle): Update.
4957 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4958 (TypeManager.LookupParentInterfacesCache):
4959 Rename from LookupInterfaceCache. Optimize slightly.
4960 (TypeManager.MemberLookup_FindMembers): Update.
4961 * decl.cs (MemberCache.MemberCache): Set Container to null in the
4963 (AddCacheContents): Rename from AddHashtable.
4964 * class.cs (TypeContainer.parent_container): Remove.
4965 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4966 (TypeContainer.DoDefineMembers): Don't initialize it.
4967 Update to name changes.
4969 2004-11-17 Miguel de Icaza <miguel@ximian.com>
4971 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4972 that factors the code to check access modifiers on override.
4974 (PropertyBase): Use the code here.
4976 Patch from Lluis S'anchez, fixes bug #69361.
4978 2004-11-15 Miguel de Icaza <miguel@ximian.com>
4980 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4981 routine that is used to report the use of a captured variable
4982 whose address has been taken.
4984 There are two checks: one when variables are being captured and
4985 the other check is when the address of a variable is taken.
4987 (because an anonymous methods might be resolved before *or* after
4988 the address has been taken) and
4990 * expression.cs (Conditional.DoResolve): Remove the special
4991 casing that Martin added to trueExpr and falseExpr being both
4992 NullLiteral. We get the right behavior now just by introducing
4993 the null_type into the compiler.
4995 * convert.cs (ExplicitConversion): Change the code to use
4996 null_type instead of testing `expr is NullLiteral'.
4997 (ImplicitConversionStandard): use null_type too.
4998 (ImplicitReferenceConversionExists): use null_type too.
4999 (ImplicitReferenceConversion): use null_type too.
5001 * literal.cs: The type of `NullLiteral' is now null_type instead
5003 (Resolve): Set the type here.
5005 * typemanager.cs: Introduce null_type.
5007 2004-11-18 Martin Baulig <martin@ximian.com>
5010 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
5012 2004-11-18 Martin Baulig <martin@ximian.com>
5014 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
5016 2004-11-18 Martin Baulig <martin@ximian.com>
5018 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
5019 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
5020 call ResolveConstructedType() on it to resolve it without checking
5022 (Constraints.ResolveTypes): Check them here.
5023 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
5024 but don't check constraints.
5025 (ConstructedType.ResolveAsTypeTerminal): Override this and also
5026 check constraints here.
5027 (ConstructedType.ResolveConstructedType): New public method. This
5028 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
5029 resolve ourselves without checking constraints.
5031 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
5033 2004-11-18 Martin Baulig <martin@ximian.com>
5036 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
5038 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
5040 2004-11-18 Martin Baulig <martin@ximian.com>
5042 * ecore.cs (TypeExpr.ResolveType): Removed.
5043 (Expression.ResolveAsTypeTerminal): We always return a fully
5044 resolved `TypeExpr', so we can just access its `Type'.
5046 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
5048 2004-11-17 Martin Baulig <martin@ximian.com>
5050 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
5051 sure we don't return any unresolved TypeExpr's.
5052 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
5054 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
5056 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
5057 unresolved `ConstructedType's.
5059 2004-11-17 Martin Baulig <martin@ximian.com>
5061 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
5063 2004-11-17 Martin Baulig <martin@ximian.com>
5066 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
5068 * decl.cs (DeclSpace.ResolveType): Removed.
5069 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
5071 2004-11-17 Martin Baulig <martin@ximian.com>
5073 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
5074 direction, like FindMembers() does. Fixes #69546, testcase is in
5077 2004-11-16 Martin Baulig <martin@ximian.com>
5079 This is based on a patch from Marek Safar, see bug #69082.
5080 Fixes bugs #63705 and #67130.
5082 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
5083 method; create a MemberCache for an interface type and cache the
5086 * decl.cs (IMemberContainer.ParentContainer): Removed.
5087 (IMemberContainer.ParentCache): New property.
5088 (MemberCache.SetupCacheForInterface): Removed.
5089 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
5090 to create a cache for an interface's "parent".
5092 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
5095 2004-11-14 Ben Maurer <bmaurer@ximian.com>
5097 * statement.cs: Avoid adding bools to a hashtable.
5099 2004-11-15 Martin Baulig <martin@ximian.com>
5101 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
5103 2004-11-11 Martin Baulig <martin@ximian.com>
5105 * typemanager.cs (TypeManager.GetMethodName): New method.
5107 * class.cs (MethodData.Define): Include the generic arity in the
5108 name of an explicit interface; also add it to the method name.
5110 * pending.cs (PendingImplementation.InterfaceMethod): The method
5111 name now includes the generic arity.
5113 2004-11-07 Miguel de Icaza <miguel@ximian.com>
5115 * expression.cs (Invocation.OverloadResolve): Flag error if we are
5116 calling an unsafe method from a safe location.
5118 2004-11-06 Marek Safar <marek.safar@seznam.cz>
5121 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
5123 2004-11-06 Miguel de Icaza <miguel@ximian.com>
5125 * namespace.cs (VerifyUsing): use GetPartialName instead of
5128 2004-11-05 Miguel de Icaza <miguel@ximian.com>
5130 * statement.cs (Return.Resolve): Fix regression in typo: if
5131 `in_exc', we have to request a NeedReturnLabel, this was a typo
5132 introduced in the anonymous method check-in. Fixes #69131.
5134 * Indexers were using the ShortName when defining themselves,
5135 causing a regression in the compiler bootstrap when applying the
5136 patch from 2004-11-02 (first part), now they use their full name
5137 and the bug is gone.
5139 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
5141 * driver.cs: Strip the path from the names of embedded resources. Fixes
5144 2004-11-04 Raja R Harinath <rharinath@novell.com>
5146 Fix error message regression: cs0104-2.cs.
5147 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
5148 (AliasEntry.Resolve): Update.
5149 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
5151 (RootContext.LookupType): Update.
5153 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
5155 * cs-parser.jay: Add support for handling accessor modifiers
5156 * class: Add support port accessor modifiers and error checking,
5157 define PropertyMethod.Define as virtual (not abstract anymore)
5158 * ecore.cs: Add checking for proeprties access with access modifiers
5159 * iterators.cs: Modify Accessor constructor call based in the modified
5161 2004-11-02 Ben Maurer <bmaurer@ximian.com>
5163 * expression.cs (StringConcat): Handle being called twice,
5164 as when we have a concat in a field init with more than two
5167 2004-11-02 Miguel de Icaza <miguel@ximian.com>
5169 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5170 special case explicit implementations, we should always produce
5171 the .property or .event declaration.
5173 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5174 since it will not return correct data if people use this
5175 unresolved in the presence of using statements (see test-313).
5177 * class.cs (MethodData.Define): If we are an explicit interface
5178 implementation, set the method name to the full name of the
5179 interface plus the name of the method.
5181 Notice that using the method.MethodName.GetFullName() does not
5182 work, as it will only contain the name as declared on the source
5183 file (it can be a shorthand in the presence of using statements)
5184 and not the fully qualifed type name, for example:
5188 class D : ICloneable {
5189 object ICloneable.Clone () {
5193 Would produce a method called `ICloneable.Clone' instead of
5194 `System.ICloneable.Clone'.
5196 * namespace.cs (Alias.Resolve): Use GetPartialName.
5198 2004-11-01 Marek Safar <marek.safar@seznam.cz>
5200 * cs-parser.jay: Add error 1055 report.
5202 2004-11-01 Miguel de Icaza <miguel@ximian.com>
5204 * assign.cs (Assign.DoResolve): Only do the transform of
5205 assignment into a New if the types are compatible, if not, fall
5206 through and let the implicit code deal with the errors and with
5207 the necessary conversions.
5209 2004-11-01 Marek Safar <marek.safar@seznam.cz>
5211 * cs-parser.jay: Add error 1031 report.
5213 * cs-tokenizer.cs: Add location for error 1038.
5215 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5217 * cs-parser.jay: Add error 1016 report.
5219 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5221 * cs-parser.jay: Add errors 1575,1611 report.
5223 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5225 * cs-parser.jay: Add error 1001 report.
5227 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5230 * attribute.cs (GetMarshal): Add method argument for
5231 caller identification.
5233 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5234 agument for GetMarshal and RuntimeMissingSupport.
5236 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5238 * attribute.cs (ExtractSecurityPermissionSet): Removed
5239 TypeManager.code_access_permission_type.
5241 * typemanager.cs: Removed TypeManager.code_access_permission_type.
5243 2004-10-27 Miguel de Icaza <miguel@ximian.com>
5245 * expression.cs (LocalVariableReference.DoResolveLValue): Check
5246 for obsolete use of a variable here. Fixes regression on errors
5247 cs0619-25 and cs0619-26.
5249 2004-10-27 Marek Safar <marek.safar@seznam.cz>
5251 Fix #62358, implemented security attribute encoding.
5253 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5254 Tests permitted SecurityAction for assembly or other types.
5255 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5256 data from SecurityPermissionAttribute to PermisionSet class.
5258 * class.cs (ApplyAttributeBuilder): Added special handling
5259 for System.Security.Permissions.SecurityAttribute based types.
5261 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5262 special handling for System.Security.Permissions.SecurityAttribute
5265 * enum.cs (ApplyAttributeBuilder): Added special handling
5266 for System.Security.Permissions.SecurityAttribute based types.
5268 * parameter.cs (ApplyAttributeBuilder): Added special handling
5269 for System.Security.Permissions.SecurityAttribute based types.
5271 * rootcontext.cs: Next 2 core types.
5273 * typemanager.cs (TypeManager.security_permission_attr_type):
5274 Built in type for the SecurityPermission Attribute.
5275 (code_access_permission_type): Build in type.
5277 2004-10-17 Miguel de Icaza <miguel@ximian.com>
5279 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5280 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5281 all of this information into
5282 EmitContext.EmitCapturedVariableInstance.
5284 * codegen.cs (EmitCapturedVariableInstance): move here the
5285 funcionality of emitting an ldarg.0 in the presence of a
5286 remapping. This centralizes the instance emit code.
5288 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5289 then emit a load of this: it means that we have reached the
5290 topmost ScopeInfo: the one that contains the pointer to the
5291 instance of the class hosting the anonymous method.
5293 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5294 captures to the topmost CaptureContext.
5296 2004-10-12 Miguel de Icaza <miguel@ximian.com>
5298 * expression.cs (LocalVariableReference): Move the knowledge about
5299 the iterators into codegen's EmitCapturedVariableInstance.
5301 2004-10-11 Miguel de Icaza <miguel@ximian.com>
5303 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5304 all code paths return a value from an anonymous method (it is the
5305 same as the 161 error, but for anonymous methods).
5307 2004-10-08 Miguel de Icaza <miguel@ximian.com>
5309 The introduction of anonymous methods in the compiler changed
5310 various ways of doing things in the compiler. The most
5311 significant one is the hard split between the resolution phase
5312 and the emission phases of the compiler.
5314 For instance, routines that referenced local variables no
5315 longer can safely create temporary variables during the
5316 resolution phase: they must do so from the emission phase,
5317 since the variable might have been "captured", hence access to
5318 it can not be done with the local-variable operations from the runtime.
5322 (Block.Flags): New flag `IsTopLevel' to indicate that this block
5323 is a toplevel block.
5325 (ToplevelBlock): A new kind of Block, these are the blocks that
5326 are created by the parser for all toplevel method bodies. These
5327 include methods, accessors and anonymous methods.
5329 These contain some extra information not found in regular blocks:
5330 A pointer to an optional CaptureContext (for tracking captured
5331 local variables and parameters). A pointer to the parent
5334 (Return.Resolve): Catch missmatches when returning a value from an
5335 anonymous method (error 1662).
5336 Invoke NeedReturnLabel from the Resolve phase instead of the emit
5339 (Break.Resolve): ditto.
5341 (SwitchLabel): instead of defining the labels during the
5342 resolution phase, we now turned the public ILLabel and ILLabelCode
5343 labels into methods called GetILLabelCode() and GetILLabel() that
5344 only define the label during the Emit phase.
5346 (GotoCase): Track the SwitchLabel instead of the computed label
5347 (its contained therein). Emit the code by using
5348 SwitchLabel.GetILLabelCode ().
5350 (LocalInfo.Flags.Captured): A new flag has been introduce to track
5351 whether the Local has been captured or not.
5353 (LocalInfo.IsCaptured): New property, used to tell whether the
5354 local has been captured.
5356 * anonymous.cs: Vastly updated to contain the anonymous method
5359 The main classes here are: CaptureContext which tracks any
5360 captured information for a toplevel block and ScopeInfo used to
5361 track the activation frames for various local variables.
5363 Each toplevel block has an optional capture context associated
5364 with it. When a method contains an anonymous method both the
5365 toplevel method and the anonymous method will create a capture
5366 context. When variables or parameters are captured, they are
5367 recorded on the CaptureContext that owns them, for example:
5371 MyDelegate d = delegate {
5376 Here `a' will be recorded as captured on the toplevel
5377 CapturedContext, the inner captured context will not have anything
5378 (it will only have data if local variables or parameters from it
5379 are captured in a nested anonymous method.
5381 The ScopeInfo is used to track the activation frames for local
5382 variables, for example:
5384 for (int i = 0; i < 10; i++)
5385 for (int j = 0; j < 10; j++){
5386 MyDelegate d = delegate {
5391 At runtime this captures a single captured variable `i', but it
5392 captures 10 different versions of the variable `j'. The variable
5393 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5394 recorded on a child.
5396 The toplevel ScopeInfo will also track information like the `this'
5397 pointer if instance variables were referenced (this is necessary
5398 as the anonymous method lives inside a nested class in the host
5399 type of the method).
5401 (AnonymousMethod): Expanded to track the Toplevel, implement
5402 `AnonymousMethod.Compatible' to tell whether an anonymous method
5403 can be converted to a target delegate type.
5405 The routine now also produces the anonymous method content
5407 (AnonymousDelegate): A helper class that derives from
5408 DelegateCreation, this is used to generate the code necessary to
5409 produce the delegate for the anonymous method that was created.
5411 * assign.cs: API adjustments for new changes in
5412 Convert.ImplicitStandardConversionExists.
5414 * class.cs: Adjustments to cope with the fact that now toplevel
5415 blocks are of type `ToplevelBlock'.
5417 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5418 insteda of standard blocks.
5420 Flag errors if params arguments are passed to anonymous methods.
5422 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5423 `CurrentAnonymousMethod' which points to the current Anonymous
5424 Method. The variable points to the AnonymousMethod class that
5425 holds the code being compiled. It is set in the new EmitContext
5426 created for the anonymous method.
5428 (EmitContext.Phase): Introduce a variable and an enumeration to
5429 assist in enforcing some rules about when and where we are allowed
5430 to invoke certain methods (EmitContext.NeedsReturnLabel is the
5431 only one that enfonces this right now).
5433 (EmitContext.HaveCaptureInfo): new helper method that returns
5434 whether we have a CapturedContext initialized.
5436 (EmitContext.CaptureVariable): New method used to register that a
5437 LocalInfo must be flagged for capturing.
5439 (EmitContext.CapturedParameter): New method used to register that a
5440 parameters must be flagged for capturing.
5442 (EmitContext.CapturedField): New method used to register that a
5443 field must be flagged for capturing.
5445 (EmitContext.HaveCapturedVariables,
5446 EmitContext.HaveCapturedFields): Return whether there are captured
5447 variables or fields.
5449 (EmitContext.EmitMethodHostInstance): This is used to emit the
5450 instance for the anonymous method. The instance might be null
5451 (static methods), this (for anonymous methods that capture nothing
5452 and happen to live side-by-side with the current method body) or a
5453 more complicated expression if the method has a CaptureContext.
5455 (EmitContext.EmitTopBlock): Routine that drives the emission of
5456 code: it will first resolve the top block, then emit any metadata
5457 and then emit the code. The split is done so that we can extract
5458 any anonymous methods and flag any captured variables/parameters.
5460 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5461 during this phase, the ILGenerator should not be used as labels
5462 and local variables declared here might not be accessible to any
5463 code that is part of an anonymous method.
5465 Exceptions to this include the temporary variables that are
5466 created by some statements internally for holding temporary
5469 (EmitContext.EmitMeta): New routine, in charge of emitting all the
5472 (EmitContext.TemporaryReturn): This method is typically called
5473 from the Emit phase, and its the only place where we allow the
5474 ReturnLabel to be defined other than the EmitMeta. The reason is
5475 that otherwise we would have to duplicate a lot of logic in the
5476 Resolve phases of various methods that today is on the Emit
5479 (EmitContext.NeedReturnLabel): This no longer creates the label,
5480 as the ILGenerator is not valid during the resolve phase.
5482 (EmitContext.EmitThis): Extended the knowledge in this class to
5483 work in anonymous methods in addition to iterators.
5485 (EmitContext.EmitCapturedVariableInstance): This emits whatever
5486 code is necessary on the stack to access the instance to a local
5487 variable (the variable will be accessed as a field).
5489 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5490 EmitContext.EmitAddressOfParameter): Routines to support
5491 parameters (not completed at this point).
5493 Removals: Removed RemapLocal and RemapLocalLValue. We probably
5494 will also remove the parameters.
5496 * convert.cs (Convert): Define a `ConstantEC' which points to a
5497 null. This is just to prefity some code that uses
5498 ImplicitStandardConversion code and do not have an EmitContext
5501 The idea is to flag explicitly that at that point in time, it is
5502 known that the conversion will not trigger the delegate checking
5503 code in implicit conversions (which requires a valid
5506 Everywhere: pass new EmitContext parameter since
5507 ImplicitStandardConversionExists now requires it to check for
5508 anonymous method conversions.
5510 (Convert.ImplicitStandardConversionExists): If the type of an
5511 expression is the anonymous_method_type, and the type is a
5512 delegate, we invoke the AnonymousMethod.Compatible method to check
5513 whether an implicit conversion is possible.
5515 (Convert.ImplicitConversionStandard): Only do implicit method
5516 group conversions if the language level is not ISO_1.
5518 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5519 MethodInfo for the Invoke method. used by Delegate and
5522 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5523 method conversions if the target type is a delegate.
5525 Removed extra debugging nops.
5527 (LocalVariableReference): Turn the `local_info' into a public
5530 Add `prepared' field, the same hack used for FieldExprs to cope
5531 with composed assignments, as Local variables do not necessarily
5532 operate purely on the stack as they used to: they can be captured
5535 Add `temp' for a temporary result, like fields.
5537 Refactor DoResolve and DoResolveLValue into DoResolveBase.
5539 It now copes with Local variables that are captured and emits the
5540 proper instance variable to load it from a field in the captured
5543 (ParameterReference.DoResolveBase): During the resolve phase,
5544 capture parameters if we are in an anonymous method.
5546 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5547 anonymous method, use the EmitContext helper routines to emit the
5548 parameter reference.
5550 * iterators.cs: Set RemapToProxy to true/false during the
5553 * parameters.cs (GetParameterByName): New helper method.
5555 * typemanager.cs (anonymous_method_type) a new type that
5556 represents an anonyous method. This is always an internal type,
5557 used as a fencepost to test against the anonymous-methodness of an
5560 2004-10-20 Marek Safar <marek.safar@seznam.cz>
5562 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5564 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5566 2004-11-10 Martin Baulig <martin@ximian.com>
5568 * expression.cs (Invocation.BetterFunction): If two methods have
5569 equal parameter types, but only one of them is generic, the
5570 non-generic one wins.
5571 (New.DoResolve): Don't set `is_struct' to false if we're a generic
5572 instance; just use `Type.IsValueType' to determine whether
5573 something is a struct or not.
5574 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
5575 so we can be called multiple times.
5577 2004-11-10 Martin Baulig <martin@ximian.com>
5579 * generic.cs (TypeParameter.DefineConstraints): New public method.
5580 (TypeParameter.CheckAccessLevel): Override this and return true.
5581 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
5582 override ResolveType() anymore.
5583 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
5585 2004-11-10 Martin Baulig <martin@ximian.com>
5587 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
5588 call DeclSpace.ResolveNestedType() on it.
5590 2004-11-10 Martin Baulig <martin@ximian.com>
5592 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
5593 non-null, call ParameterModifier() on it.
5595 2004-11-10 Martin Baulig <martin@ximian.com>
5598 (Iterators): Added `current_type' and `this_type' fields.
5599 (Iterators.DefineIterator): Create a new EmitContext and store it
5600 in `ec'; compute `this_type'.
5602 2004-11-10 Martin Baulig <martin@ximian.com>
5605 (TypeManager.IsPrivateAccessible): New public method.
5606 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
5608 2004-11-10 Martin Baulig <martin@ximian.com>
5610 * class.cs (TypeContainer.DefineType): Call
5611 TypeBuilder.DefineGenericParameters() before resolving the type
5613 (MethodData.parent_method): New protected field.
5614 (MethodData..ctor): Added `MethodInfo parent_method' argument.
5615 (MethodData.Define): Compute `parent_method'.
5618 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5619 (MemberCore.GetClsCompliantAttributeValue): Likewise.
5620 (DeclSpace.ec): New protected field; store the EmitContext here.
5621 (DeclSpace.EmitContext): New public property.
5622 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
5623 (DeclSpace.ResolveNestedType): New public method.
5624 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
5625 (DeclSpace.NestedAccessible): Added `Type tb' argument.
5626 (DeclSpace.FamilyAccessible): Likewise.
5627 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
5628 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5631 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
5634 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5635 (Enum.Emit): Don't create a new EmitContext.
5637 2004-10-18 Martin Baulig <martin@ximian.com>
5639 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5640 `Type' directly, but call ResolveType() on it.
5641 (Catch.Resolve): Likewise.
5642 (Foreach.Resolve): Likewise.
5644 2004-10-18 Martin Baulig <martin@ximian.com>
5646 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5647 `Type' directly, but call ResolveType() on it.
5648 (Probe.DoResolve): Likewise.
5649 (ArrayCreation.LookupType): Likewise.
5650 (TypeOf.DoResolve): Likewise.
5651 (SizeOf.DoResolve): Likewise.
5653 2004-10-18 Raja R Harinath <rharinath@novell.com>
5655 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5658 2004-10-17 John Luke <john.luke@gmail.com>
5660 * class.cs (Operator.GetSignatureForError): use CSharpName
5662 * parameter.cs (Parameter.GetSignatureForError): Returns
5663 correct name even if was not defined.
5665 2004-10-13 Raja R Harinath <rharinath@novell.com>
5668 * class.cs (TypeContainer.EmitContext): New property.
5669 (DefineNestedTypes): Create an emitcontext for each part.
5670 (MethodCore.DoDefineParameters): Use container's emitcontext.
5671 Pass type array to InternalParameters.
5672 (MemberBase.DoDefine): Use container's emitcontext.
5673 (FieldMember.Define): Likewise.
5674 (Event.Define): Likewise.
5675 (SetMethod.GetParameterInfo): Change argument to EmitContext.
5676 Pass type array to InternalParameters.
5677 (SetIndexerMethod.GetParameterInfo): Likewise.
5678 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5679 * delegate.cs (Define): Pass emitcontext to
5680 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
5681 array to InternalParameters.
5682 * expression.cs (ParameterReference.DoResolveBase): Pass
5683 emitcontext to GetParameterInfo.
5684 (ComposedCast.DoResolveAsTypeStep): Remove check on
5685 ec.ResolvingTypeTree.
5686 * parameter.cs (Parameter.Resolve): Change argument to
5687 EmitContext. Use ResolveAsTypeTerminal.
5688 (Parameter.GetSignature): Change argument to EmitContext.
5689 (Parameters.ComputeSignature): Likewise.
5690 (Parameters.ComputeParameterTypes): Likewise.
5691 (Parameters.GetParameterInfo): Likewise.
5692 (Parameters.ComputeAndDefineParameterTypes): Likewise.
5693 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
5694 * support.cs (InternalParameters..ctor): Remove variant that takes
5696 * typemanager.cs (system_intptr_expr): New.
5697 (InitExpressionTypes): Initialize it.
5699 2004-10-12 Chris Toshok <toshok@ximian.com>
5701 * cs-parser.jay: fix location for try_statement and catch_clause.
5703 2004-10-18 Martin Baulig <martin@ximian.com>
5705 * class.cs (FieldMember.Define): Don't access the TypeExpr's
5706 `Type' directly, but call ResolveType() on it.
5707 (MemberBase.DoDefine): Likewise.
5709 * expression.cs (New.DoResolve): Don't access the TypeExpr's
5710 `Type' directly, but call ResolveType() on it.
5711 (ComposedCast.DoResolveAsTypeStep): Likewise.
5713 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5714 `Type' directly, but call ResolveType() on it.
5716 2004-10-17 John Luke <john.luke@gmail.com>
5718 * class.cs (Operator.GetSignatureForError): use CSharpName
5720 * parameter.cs (Parameter.GetSignatureForError): Returns
5721 correct name even if was not defined.
5723 2004-10-13 Raja R Harinath <rharinath@novell.com>
5726 * class.cs (TypeContainer.EmitContext): New property.
5727 (DefineNestedTypes): Create an emitcontext for each part.
5728 (MethodCore.DoDefineParameters): Use container's emitcontext.
5729 Pass type array to InternalParameters.
5730 (MemberBase.DoDefine): Use container's emitcontext.
5731 (FieldMember.Define): Likewise.
5732 (Event.Define): Likewise.
5733 (SetMethod.GetParameterInfo): Change argument to EmitContext.
5734 Pass type array to InternalParameters.
5735 (SetIndexerMethod.GetParameterInfo): Likewise.
5736 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5737 * delegate.cs (Define): Pass emitcontext to
5738 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
5739 array to InternalParameters.
5740 * expression.cs (ParameterReference.DoResolveBase): Pass
5741 emitcontext to GetParameterInfo.
5742 (ComposedCast.DoResolveAsTypeStep): Remove check on
5743 ec.ResolvingTypeTree.
5744 * parameter.cs (Parameter.Resolve): Change argument to
5745 EmitContext. Use ResolveAsTypeTerminal.
5746 (Parameter.GetSignature): Change argument to EmitContext.
5747 (Parameters.ComputeSignature): Likewise.
5748 (Parameters.ComputeParameterTypes): Likewise.
5749 (Parameters.GetParameterInfo): Likewise.
5750 (Parameters.ComputeAndDefineParameterTypes): Likewise.
5751 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
5752 * support.cs (InternalParameters..ctor): Remove variant that takes
5754 * typemanager.cs (system_intptr_expr): New.
5755 (InitExpressionTypes): Initialize it.
5757 2004-10-12 Chris Toshok <toshok@ximian.com>
5759 * cs-parser.jay: fix location for try_statement and catch_clause.
5761 2004-10-07 Raja R Harinath <rharinath@novell.com>
5763 More DeclSpace.ResolveType avoidance.
5764 * decl.cs (MemberCore.InUnsafe): New property.
5765 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
5766 with newly created EmitContext.
5767 (FieldMember.Define): Likewise.
5768 * delegate.cs (Delegate.Define): Likewise.
5769 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5770 only if normal name-lookup fails.
5771 (TypeExpr.DoResolve): Enable error-checking.
5772 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5773 (SizeOf.DoResolve): Likewise.
5774 (ComposedCast.DoResolveAsTypeStep): Likewise.
5775 (StackAlloc.DoResolve): Likewise.
5776 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5777 (Block.Unsafe): New property.
5778 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5779 (Unsafe): Set 'unsafe' flag of contained block.
5780 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5781 (Fixed.Resolve): Likewise.
5782 (Catch.Resolve): Likewise.
5783 (Using.ResolveLocalVariableDecls): Likewise.
5784 (Foreach.Resolve): Likewise.
5786 2004-10-05 John Luke <john.luke@gmail.com>
5788 * cs-parser.jay: add location to error CS0175
5790 2004-10-04 Miguel de Icaza <miguel@ximian.com>
5792 * ecore.cs (Expression.Constantity): Add support for turning null
5795 * const.cs (Const.Define): Allow constants to be reference types
5796 as long as the value is Null.
5798 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
5800 * namespace.cs (NamespaceEntry.Using): No matter which warning
5801 level is set, check if this namespace name has already been added.
5803 2004-10-03 Ben Maurer <bmaurer@ximian.com>
5805 * expression.cs: reftype [!=]= null should always use br[true,false].
5808 2004-10-03 Marek Safar <marek.safar@seznam.cz>
5811 * attribute.cs: Enum conversion moved to
5812 GetAttributeArgumentExpression to be applied to the all
5815 2004-10-01 Raja R Harinath <rharinath@novell.com>
5817 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5818 * class.c (TypeContainer.DefineType): Flag error if
5819 base types aren't accessible due to access permissions.
5820 * decl.cs (DeclSpace.ResolveType): Move logic to
5821 Expression.ResolveAsTypeTerminal.
5822 (DeclSpace.ResolveTypeExpr): Thin layer over
5823 Expression.ResolveAsTypeTerminal.
5824 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5825 Refactor code into NestedAccess. Use it.
5826 (DeclSpace.NestedAccess): New.
5827 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5828 argument to silence errors. Check access permissions.
5829 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5830 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5831 (Cast.DoResolve): Likewise.
5832 (New.DoResolve): Likewise.
5833 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5834 (TypeOf.DoResolve): Likewise.
5836 * expression.cs (Invocation.BetterConversion): Return the Type of
5837 the better conversion. Implement section 14.4.2.3 more faithfully.
5838 (Invocation.BetterFunction): Make boolean. Make correspondence to
5839 section 14.4.2.2 explicit.
5840 (Invocation.OverloadResolve): Update.
5841 (Invocation): Remove is_base field.
5842 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
5843 (Invocation.Emit): Likewise.
5845 2004-09-24 Marek Safar <marek.safar@seznam.cz>
5847 * cs-parser.jay: Reverted 642 warning fix.
5849 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5852 * decl.cs (FindMemberWithSameName): Indexer can have more than
5855 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5857 * expression.cs (LocalVariableReference.DoResolveLValue):
5858 Do not report warning 219 for out values.
5859 (EmptyExpression.Null): New member to avoid extra allocations.
5861 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5863 * cs-parser.jay: Fix wrong warning 642 report.
5865 * cs-tokenizer.cs (CheckNextToken): New helper;
5866 Inspect next character if is same as expected.
5868 2004-09-23 Martin Baulig <martin@ximian.com>
5870 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5871 (Convert.ImplicitReferenceConversionExists): Likewise.
5873 2004-11-09 Raja R Harinath <rharinath@novell.com>
5875 * Makefile (DISTFILES): Comment out a few missing files.
5877 2004-10-29 Raja R Harinath <rharinath@novell.com>
5879 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5880 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
5881 (gmcs.exe): Invoke bootstrap-libs.
5882 (clean-local): Clean the net_2_0_bootstrap profile too.
5883 (PROGRAM_INSTALL_DIR): New.
5884 (install-local): Use it.
5886 2004-10-13 Martin Baulig <martin@ximian.com>
5888 * generic.cs (TypeManager.InflatedConstraints): New nested class.
5889 (TypeParameter.DefineType): If we're a method type parameter and
5890 that method is overriding something, "inflate" its constraints.
5892 2004-10-12 Martin Baulig <martin@ximian.com>
5894 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5895 and have type arguments, create and resolve a ConstructedType.
5897 2004-10-12 Martin Baulig <martin@ximian.com>
5899 * decl.cs (MemberCache.FindMemberToOverride): Use
5900 TypeManager.IsEqual() to compare the parameters and Type.Equals()
5901 to compare the invocationType.
5903 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5904 When comparing two type parameters, only do the signature-only
5905 comparision for method type parameters.
5907 2004-10-11 Martin Baulig <martin@ximian.com>
5909 * report.cs: Don't make --fatal abort on warnings, we have
5910 -warnaserror for that.
5912 2004-10-11 Martin Baulig <martin@ximian.com>
5915 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5916 (TypeManager.IsEqual): Call ourself recursively instead of using
5919 2004-10-11 Martin Baulig <martin@ximian.com>
5921 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5922 on our own type parameters, not on the ones we inherit from a containing
5925 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5928 * generic.cs (TypeParameter.Define): We may only be called once.
5930 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5931 instead of TypeManager.IsEqual().
5933 2004-09-28 Martin Baulig <martin@ximian.com>
5936 (GenericConstraints.EffectiveBaseClass): New public property.
5937 (TypeParameter.GenericConstraints): New public property.
5938 (ConstructedType.CheckConstraints): Improved.
5940 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5941 (Convert.TypeParameterConversion): New private method; use this in
5942 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5943 for all conversions related to type parameters.
5945 2004-09-24 Martin Baulig <martin@ximian.com>
5947 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5948 type parameter conversions for type parameters which are known to
5951 2004-09-24 Martin Baulig <martin@ximian.com>
5953 * generic.cs (GenericConstraints): Added `IsReferenceType' and
5954 `IsValueType' properties.
5956 * support.cs (ReflectionConstraints): Use
5957 Type.GetGenericParameterConstraints() instead of the old hack.
5959 2004-09-24 Martin Baulig <martin@ximian.com>
5961 * generic.cs (GenericConstraints): Moved here and made it an
5964 * support.cs (GenericConstraints): Moved to generic.cs.
5966 2004-09-24 Martin Baulig <martin@ximian.com>
5969 (ReflectionConstraints): Un-nested this class and made it public.
5972 (TypeManager.GetTypeParameterConstraints): New public method.
5973 (TypeManager.HasConstructorConstraint): Use the attributes.
5975 2004-09-24 Martin Baulig <martin@ximian.com>
5977 * support.cs (GenericConstraints): Replaced `HasConstructor',
5978 `IsReferenceType' and `IsValueType' with `Attributes'.
5979 (ReflectionParameters.ReflectionConstraints): Removed the Create()
5980 method and made the .ctor public.
5982 * generic.cs (Constraints.Attributes): New public property.
5983 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5984 `IsReferenceType' -> `HasReferenceTypeConstraint' and
5985 `IsValueType' -> `HasValueTypeConstraint'.
5987 2004-09-23 Martin Baulig <martin@ximian.com>
5989 * generic.cs (Constraints): Reflect latest runtime changes.
5991 2004-09-23 Martin Baulig <martin@ximian.com>
5993 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5994 (Convert.ImplicitReferenceConversionExists): Likewise.
5996 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5998 * class.cs (Operator.Define): Add error 448 and 559 report.
6000 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6002 * class.cs (MemberBase.IsTypePermitted): New protected
6003 method for checking error CS0610.
6005 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6007 * class.cs (TypeContainer.HasExplicitLayout): New property
6008 Returns whether container has StructLayout attribute set Explicit.
6009 (FieldMember): New abstract class for consts and fields.
6010 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
6011 (Field): Reuse FieldMember.
6013 * const.cs (Const): Reuse FieldMember.
6015 * rootcontext.cs: EmitConstants call moved to class.
6017 2004-09-22 Martin Baulig <martin@ximian.com>
6019 Marek and me just fixed one of our oldest bugs: #28562 :-)
6021 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
6023 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
6024 we're an EnumConstant, just return that.
6025 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
6026 an EnumConstant. In this case, we need to use GetValueAsEnumType()
6027 to get the value which'll actually be written into the attribute.
6028 However, we have to use GetValue() to access the attribute's value
6031 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6033 * constant.cs (Constant.IsNegative): New abstract property
6036 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
6037 (StackAlloc.DoResolve): Reused IsNegative.
6039 2004-09-22 Martin Baulig <martin@ximian.com>
6041 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
6042 public method; like LookupTypeContainer, but also works for
6045 * report.cs (Report.SymbolRelatedToPreviousError): Use
6046 TypeManager.LookupGenericTypeContainer().
6048 2004-09-22 Martin Baulig <martin@ximian.com>
6050 Thanks to Peter Sestoft for this bug report.
6052 * expression.cs (Conditional): If both the `trueExpr' and the
6053 `falseExpr' is a NullLiteral, return a NullLiteral.
6055 2004-09-22 Martin Baulig <martin@ximian.com>
6057 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
6058 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
6059 for the "get_Current" call.
6061 2004-09-21 Martin Baulig <martin@ximian.com>
6063 * convert.cs (Convert.ImplicitReferenceConversion): When
6064 converting to an interface type, first check whether we're
6065 converting from a reference type.
6067 2004-09-14 Martin Baulig <martin@ximian.com>
6069 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6071 2004-09-14 Marek Safar <marek.safar@seznam.cz>
6074 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6075 called and is obsolete then this member suppress message
6076 when call is inside next [Obsolete] method or type.
6078 * expression.cs: Use TestObsoleteMethodUsage member.
6080 2004-09-14 Martin Baulig <martin@ximian.com>
6082 * genericparser.cs: Removed.
6084 2004-09-13 Marek Safar <marek.safar@seznam.cz>
6086 * class.cs (MethodCore.CheckBase): Fix bug #65757.
6088 2004-09-12 Marek Safar <marek.safar@seznam.cz>
6090 * attribute.cs (Attribute.Resolve): Add error 653 report.
6092 * class.cs (Class.ApplyAttributeBuilder): Add error 641
6094 (Method.ApplyAttributeBuilder): Add error 685 report.
6095 (Operator.Define): Add error 564 report.
6097 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
6099 * expression.cs (Invocation.DoResolve): Add error
6102 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
6105 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6107 * class.cs (ConstructorInitializer.Resolve):
6108 Wrong error number (515->516).
6110 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6112 * class.cs (Indexer.Define): Add error 631 report.
6114 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6116 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
6118 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6120 * expression.cs (Probe.DoResolve): Add error CS0241 report.
6122 2004-09-10 Marek Safar <marek.safar@seznam.cz>
6124 * cs-parser.jay: Added error CS0241 report.
6126 2004-09-10 Raja R Harinath <rharinath@novell.com>
6128 * cs-parser.jay (fixed_statement): Introduce a scope for the
6129 declaration in the 'fixed' statement.
6131 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6133 * cs-parser.jay: Added CS0230 error report.
6135 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6137 * cs-parser.jay: Added errors CS0231 and CS0257 report.
6139 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6141 * expression.cs (Argument.Resolve): Added error CS0192 and
6144 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6146 C# 2.0 #pragma warning feature
6148 * cs-tokenizer.cs (PreProcessPragma): New method;
6149 Handles #pragma directive.
6151 * report.cs (WarningRegions): New class; Support
6152 class for #pragma warning directive. It tests whether
6153 warning is enabled for a given line.
6155 2004-09-08 Miguel de Icaza <miguel@ximian.com>
6157 * const.cs: Add more descriptive error report, tahnks to
6160 2004-09-08 Marek Safar <marek.safar@seznam.cz>
6162 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
6164 2004-09-07 Miguel de Icaza <miguel@ximian.com>
6166 * expression.cs: Apply patch from Ben: Remove dead code from
6167 ArrayCreation, and remove the TurnintoConstant call in const.cs,
6168 as that code just threw an exception anwyays.
6170 * const.cs: Remove the call to the turnintoconstant, for details
6173 * literal.cs: The type of the null-literal is the null type; So
6174 we use a placeholder type (literal.cs:System.Null, defined here)
6177 * expression.cs (Conditional.DoResolve): Remove some old code that
6178 is no longer needed, conversions have been fixed.
6180 (ArrayCreationExpression.DoResolve): Return false if we fail to
6181 resolve the inner expression.
6183 2004-09-07 Raja R Harinath <rharinath@novell.com>
6186 * cs-parser.jay (delegate_declaration): Record a delegate
6187 declaration as a type declaration.
6188 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
6190 2004-09-06 Miguel de Icaza <miguel@ximian.com>
6192 * parameter.cs: Do not crash if the type can not be resolved.
6194 * expression.cs: Report errors with unsafe pointers, fixes #64896
6196 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
6198 * expression.cs: Pointer arith always needs to do a conv.i
6199 if the operand is a long. fix 65320
6201 2004-09-04 Marek Safar <marek.safar@seznam.cz>
6203 Fixed cs0619-37.cs, cs0619-38.cs
6205 * enum.cs (GetObsoleteAttribute): Removed.
6207 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
6208 on Enum member is double staged. The first is tested member
6211 2004-09-04 Marek Safar <marek.safar@seznam.cz>
6213 Fixed #56986, #63631, #65231
6215 * class.cs: (TypeContainer.AddToMemberContainer): New method,
6216 adds member to name container.
6217 (TypeContainer.AddToTypeContainer): New method, adds type to
6219 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6220 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6221 AddOperator): Simplified by reusing AddToMemberContainer.
6222 (TypeContainer.UserDefinedStaticConstructor): Changed to property
6224 (Method.CheckForDuplications): Fixed implementation to test all
6226 (MemberBase): Detection whether member is explicit interface
6227 implementation is now in constructor.
6228 (MemberBase.UpdateMemberName): Handles IndexerName.
6229 (Accessor): Changed to keep also location information.
6230 (AbstractPropertyEventMethod): Is derived from MemberCore.
6231 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6232 will be emited or not.
6233 (PropertyBase.AreAccessorsDuplicateImplementation):
6234 Tests whether accessors are not in collision with some method.
6235 (Operator): Is derived from MethodCore to simplify common
6238 * decl.cs (Flags.TestMethodDuplication): Test for duplication
6240 (DeclSpace.AddToContainer): Adds the member to defined_names
6241 table. It tests for duplications and enclosing name conflicts.
6243 * enum.cs (EnumMember): Clean up to reuse the base structures
6245 2004-09-03 Martin Baulig <martin@ximian.com>
6247 Merged latest changes into gmcs. Please keep this comment in
6248 here, it makes it easier for me to see what changed in MCS since
6249 the last time I merged.
6251 2004-09-03 Martin Baulig <martin@ximian.com>
6253 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6254 into TypeContainer, to make partial classes work again.
6256 2004-09-03 Martin Baulig <martin@ximian.com>
6258 * rootcontext.cs (RootContext.V2): Removed.
6260 2004-03-23 Martin Baulig <martin@ximian.com>
6262 * expression.cs (Invocation.OverloadResolve): Added `bool
6263 may_fail' argument and use it instead of the Location.IsNull() hack.
6265 2004-09-09 Martin Baulig <martin@ximian.com>
6267 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
6269 2004-09-09 Martin Baulig <martin@ximian.com>
6271 * generic.cs (TypeParameter.DefineType): Added support for
6272 explicit interface methods.
6274 2004-09-09 Martin Baulig <martin@ximian.com>
6276 * README.Changes: New document. Started to list important changes
6277 between MCS and GMCS here.
6279 2004-09-08 Martin Baulig <martin@ximian.com>
6282 (TypeContainer.CheckRecursiveDefinition): New protected method.
6283 (TypeContainer.DefineType): Move the CS0146 check into
6284 CheckRecursiveDefinition().
6286 2004-09-06 Martin Baulig <martin@ximian.com>
6288 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
6289 types for the constructor constraint.
6291 2004-09-03 Martin Baulig <martin@ximian.com>
6293 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6294 into TypeContainer, to make partial classes work again.
6296 2004-09-03 Martin Baulig <martin@ximian.com>
6298 * rootcontext.cs (RootContext.V2): Removed.
6300 2004-03-23 Martin Baulig <martin@ximian.com>
6302 * expression.cs (Invocation.OverloadResolve): Added `bool
6303 may_fail' argument and use it instead of the Location.IsNull() hack.
6305 2004-09-03 Martin Baulig <martin@ximian.com>
6307 Merged latest changes into gmcs. Please keep this comment in
6308 here, it makes it easier for me to see what changed in MCS since
6309 the last time I merged.
6311 2004-09-03 Raja R Harinath <rharinath@novell.com>
6314 * expression.cs (BetterConversion): Don't allow either conversion
6315 to be null. Remove redundant implicit conversion test when 'q ==
6316 null' -- when this function is invoked, we already know that the
6317 implicit conversion exists.
6318 (BetterFunction): Assume that 'best' is non-null. Remove
6319 redundant reimplementation of IsApplicable when 'best' is null.
6320 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6321 number of arguments.
6322 (IsAncestralType): Extract from OverloadResolve.
6323 (OverloadResolve): Make robust to the MethodGroupExpr being
6324 unsorted. Implement all the logic of Section 14.5.5.1, and
6325 support overloading of methods from multiple applicable types.
6326 Clean up logic somewhat. Don't pass null methods to BetterFunction.
6328 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6329 (RealError, Warning): Append type of report to related symbol.
6331 2004-09-03 Marek Safar <marek.safar@seznam.cz>
6333 * enum.cs: Fixed CLS-Compliance checks for enum members.
6334 Error tests cs3008-8.cs, cs3014-8.cs
6336 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6338 Fixed bug #62342, #63102
6339 * class.cs: ImplementIndexer uses member.IsExplicitImpl
6340 like ImplementMethod.
6342 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6344 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6347 2004-09-02 Martin Baulig <martin@ximian.com>
6349 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6350 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6353 2004-09-01 Marek Safar <marek.safar@seznam.cz>
6355 C# 2.0 Static classes implemented
6357 * class.cs (TypeContainer): instance_constructors,
6358 initialized_fields, initialized_static_fields,
6359 default_constructor, base_inteface_types are protected to be
6360 accessible from StaticClass.
6361 (TypeContainer.DefineDefaultConstructor): New virtual method
6362 for custom default constructor generating
6363 (StaticClass): New class to handle "Static classes" feature.
6365 * cs-parser.jay: Handle static keyword on class like instance
6368 * driver.cs: Added "/langversion" command line switch with two
6369 options (iso-1, default).
6371 2004-08-31 Marek Safar <marek.safar@seznam.cz>
6373 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6375 2004-08-31 Miguel de Icaza <miguel@ximian.com>
6377 * delegate.cs: Style.
6379 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
6381 * delegate.cs: Add seperate instance expr field for miguel.
6383 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6385 * PointerArithmetic (Resolve): make sure we are not doing
6386 pointer arith on void*. Also, make sure we are resolved
6387 by not setting eclass until resolve.
6389 All callers: Make sure that PointerArithmetic gets resolved.
6391 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6393 * ArrayCreation (LookupType): If the type does not resolve
6394 to an array, give an error.
6396 2004-08-27 Marek Safar <marek.safar@seznam.cz>
6398 * statement.cs (Try.Resolve): Fixed bug #64222
6400 2004-08-27 Martin Baulig <martin@ximian.com>
6403 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6406 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6408 * ecore.cs (Constantify): Get underlying type via
6409 System.Enum.GetUnderlyingType to avoid StackOverflow on the
6410 Windows in special cases.
6412 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6414 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6415 for obtaining also private methods.
6416 (GetRemoveMethod): Used GetRemoveMethod (true)
6417 for obtaining also private methods.
6419 2004-09-02 Martin Baulig <martin@ximian.com>
6421 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6422 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6425 2004-08-27 Martin Baulig <martin@ximian.com>
6428 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6431 2004-08-25 Martin Baulig <martin@ximian.com>
6433 * support.cs (ReflectionParameters..ctor): If this is a generic
6434 method, retrieve and store its type parameters.
6435 (InternalParameters..ctor): Added `TypeParameter[]' argument.
6436 (ReflectionParameters.GenericConstraints): The argument specifies
6437 the type parameter, not the method parameter.
6438 (InternalParameters.GenericConstraints): Likewise.
6440 * generic.cs (TypeParameter.DefineType): Correctly handle
6441 constraints wrt. generic methods in interfaces and their
6444 2004-08-24 Martin Baulig <martin@ximian.com>
6446 * generic.cs (TypeParameter.IsSubclassOf): New public method.
6447 (Constraints.IsSubclassOf): New internal method.
6449 * typemanager.cs (TypeManager.FindMembers): Added special support
6450 for GenericTypeParameterBuilder's.
6451 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
6454 2004-08-24 Martin Baulig <martin@ximian.com>
6457 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6458 this for accessibility checks.
6459 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6460 IsNestedFamilyAccessible.
6461 (TypeManager.IsSubclassOf): New method, do what the name actually
6464 2004-08-24 Martin Baulig <martin@ximian.com>
6466 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
6467 as a SimpleName, include the generic arity.
6469 2004-08-24 Martin Baulig <martin@ximian.com>
6471 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6472 MethodAttributes.HideBySig for operators.
6474 2004-08-23 Martin Baulig <martin@ximian.com>
6476 Back to the old error reporting system :-)
6478 * report.cs (Message): Removed.
6479 (Report.MessageData, ErrorData, WarningData): Removed.
6480 (Report.Error, Warning): Back to the old system.
6482 2004-08-23 Martin Baulig <martin@ximian.com>
6484 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6486 * class.cs (TypeContainer.ParentContainer): New public virtual
6487 method; replaces the explicit interface implementation.
6488 (ClassPart.ParentContainer): Override.
6490 2004-08-23 Martin Baulig <martin@ximian.com>
6492 * statement.cs (Switch): Added support for constant switches; see
6493 #59428 or test-285.cs.
6495 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6498 * statement.cs (GetEnumeratorFilter): Removed useless
6499 logic because C# specs is strict. GetEnumerator must be
6502 2004-08-22 Martin Baulig <martin@ximian.com>
6504 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6505 a switch and may break, reset the barrier. Fixes #59867.
6507 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6509 CLS-Compliance speed up (~5% for corlib)
6511 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6512 New method. Tests container for CLS-Compliant names
6514 * class.cs (TypeContainer.VerifyClsName): New method.
6515 Checks whether container name is CLS Compliant.
6516 (Constructor): Implements IMethodData.
6518 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6519 low-case table for CLS Compliance test.
6520 (MemberCache.VerifyClsParameterConflict): New method.
6521 Checks method parameters for CS3006 error.
6523 * enum.cs (EnumMember): Is derived from MemberCore.
6524 (Enum.VerifyClsName): Optimized for better performance.
6526 2004-08-06 Marek Safar <marek.safar@seznam.cz>
6528 * report.cs: Renamed Error_T to Error and changed all
6531 2004-08-06 Marek Safar <marek.safar@seznam.cz>
6533 * class.cs (TypeContainer.IndexerArrayList): New inner class
6534 container for indexers.
6535 (TypeContainer.DefaultIndexerName): New constant for default
6536 indexer name. Replaced all "Item" with this constant.
6537 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6539 * typemanager.cs (TypeManager.default_member_ctor): Cache here
6540 DefaultMemberAttribute constructor.
6542 2004-08-05 Martin Baulig <martin@ximian.com>
6544 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6547 2004-08-05 Marek Safar <marek.safar@seznam.cz>
6549 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6550 multi platforms problem.
6552 * compiler.csproj: Included shared files.
6554 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6556 Fix bug 60333, 55971 in the more general way
6557 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6558 Added arg_type argument for constant conversion.
6559 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6561 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6564 * class.cs (TypeContainer ): New inner classes MethodArrayList,
6565 OperatorArrayList, MethodCoreArrayList for typecontainer
6566 containers. Changed class member types to these new types.
6567 (MethodArrayList.DefineMembers): Added test for CS0659.
6569 2004-08-04 Miguel de Icaza <miguel@ximian.com>
6571 * cfold.cs: Synchronize the folding with the code in expression.cs
6572 Binary.DoNumericPromotions for uint operands.
6574 * attribute.cs: Revert patch from Raja, it introduced a regression
6575 while building Blam-1.2.1 (hard to isolate a test case).
6577 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6581 (TypeContainer.Define): Renamed to DefineContainerMembers because of
6583 (MethodCore.parent_method): New member. The method we're overriding
6584 if this is an override method.
6585 (MethodCore.CheckBase): Moved from Method class and made common.
6586 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6588 (MethodCore.CheckForDuplications): New abstract method. For custom
6589 member duplication search in a container
6590 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6591 method and its return type.
6592 (Event.conflict_symbol): New member. Symbol with same name in the
6596 (MemberCache.FindMemberWithSameName): New method. The method
6597 is looking for conflict with inherited symbols.
6599 2004-08-04 Martin Baulig <martin@ximian.com>
6601 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6603 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6605 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6607 * report.cs (Message): New enum for better error, warning reference in
6609 (MessageData): New inner abstract class. It generally handles printing of
6610 error and warning messages.
6611 Removed unused Error, Warning, Message methods.
6613 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6615 Fix for cs0592-8.cs test
6617 (Attributable.ValidAttributeTargets): Made public.
6618 (Attribute.ExplicitTarget): New member for explicit target value.
6619 (Attribute.CheckTargets): Now we translate explicit attribute
6620 target to Target here.
6622 2004-08-03 Ben Maurer <bmaurer@ximian.com>
6624 * ecore.cs (MethodGroupExpr): new IsBase property.
6626 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6628 * delegate.cs (DelegateCreation): store a MethodGroupExpr
6629 rather than an instance expr.
6631 (DelegateCreation.Emit): Use the method group rather than
6632 the instance expression. Also, if you have base.Foo as the
6633 method for a delegate, make sure to emit ldftn, not ldftnvirt.
6635 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
6637 (NewDelegate.DoResolve): Only check for the existance of Invoke
6638 if the method is going to be needed. Use MethodGroupExpr.
6640 (NewDelegate.Emit): Remove, DelegateCreation implements this.
6642 * expression.cs: For pointer arith., make sure to use
6643 the size of the type, not the size of the pointer to
6646 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6649 * class.cs (Class): Added error CS0502 test.
6651 2004-08-03 John Luke <jluke@cfl.rr.com>
6652 Raja R Harinath <rharinath@novell.com>
6655 * attribute.cs (Attribute.complained_before): New flag.
6656 (Attribute.ResolveType, Attribute.Resolve),
6657 (Attribute.DefinePInvokeMethod): Set it.
6658 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6660 2004-08-03 Martin Baulig <martin@ximian.com>
6662 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6663 use a user-defined operator; we still need to do numeric
6664 promotions in case one argument is a builtin type and the other
6665 one has an implicit conversion to that type. Fixes #62322.
6667 2004-08-18 Martin Baulig <martin@ximian.com>
6669 * class.cs (Method.Define): Use the correct method name when
6670 creating the MethodBuilder for a generic method.
6672 2004-08-17 Martin Baulig <martin@ximian.com>
6674 * generic.cs (Constraints): Support type parameter constraints.
6676 2004-08-16 Martin Baulig <martin@ximian.com>
6678 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
6679 (Token.GENERIC_DIMENSION): New token; this is returned if we
6680 encounter an unbound generic type in a typeof() expression.
6682 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
6683 this token is only generated while parsing a typeof() expression.
6684 (typeof_expression): Removed the old unbound_type hack.
6686 * generic.cs (TypeArguments.IsUnbound): New public property.
6688 * decl.cs (MemberName): Added support for unbound types.
6690 2004-08-14 Martin Baulig <martin@ximian.com>
6693 (TypeManager.IsEqualGenericInstance): New static method.
6694 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
6695 just used to check accessibility, so follow the rules of 26.1.6.
6697 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
6698 ConstructedType instead of a TypeExpression if we have type arguments.
6700 * cs-parser.jay (typeof_expression): Support unbound generic types.
6702 * ecore.cs (UnboundTypeExpression): New public class.
6704 2004-08-12 Martin Baulig <martin@ximian.com>
6706 * typemanager.cs (TypeManager.IsNestedChildOf): Use
6707 TypeManager.IsEqual() rather than `=='.
6709 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
6710 generic instances as well.
6712 2004-08-12 Martin Baulig <martin@ximian.com>
6714 * expression.cs (Invocation.InferType): We can only infer method
6715 type parameters. Fixes #62647.
6717 2004-08-11 Martin Baulig <martin@ximian.com>
6719 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
6720 before resolving the base classes.
6722 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6724 * Makefile: install .mdb file too.
6726 2004-08-05 Martin Baulig <martin@ximian.com>
6728 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
6729 initializer, the current type is just the TypeBuilder, not the
6730 instantiated generic type.
6731 (FieldExpr.IsFieldInitializer): New public property.
6733 2004-08-04 Martin Baulig <martin@ximian.com>
6735 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6737 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6739 2004-08-03 Martin Baulig <martin@ximian.com>
6741 * class.cs (MethodData.Define): If we're an explicit
6742 implementation, remove the generic arity from the type name.
6744 2004-08-03 Martin Baulig <martin@ximian.com>
6746 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6747 use a user-defined operator; we still need to do numeric
6748 promotions in case one argument is a builtin type and the other
6749 one has an implicit conversion to that type. Fixes #62322.
6751 2004-08-02 Martin Baulig <martin@ximian.com>
6753 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
6755 (TypeContainer.GetClassBases): Return the unexpanded list of
6756 interfaces; we expand them later.
6757 (TypeContainer.DefineType): After creating the TypeBuilder, call
6758 TypeManager.ExpandInterfaces() to get an expanded and resolved
6761 * ecore.cs (TypeExpr.GetInterfaces): Removed
6763 * generics.cs (Constraints.InterfaceConstraints): Remove.
6764 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
6765 register the interface constraints.
6768 (TypeManager.AddUserType): Removed the `ifaces' argument.
6769 (TypeManager.AddTypeParameter): Likewise.
6770 (TypeManager.AddUserInterface): Removed, was unused.
6771 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
6772 `TypeExpr[]' array for the interfaces.
6773 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
6774 has been defined, returns a list of the resolved interfaces types.
6775 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
6776 (TypeManager.GetExplicitInterfaces): Likewise.
6778 2004-08-02 Martin Baulig <martin@ximian.com>
6780 * expression.cs (Invocation.EmitCall): If we're invoking a method
6781 on a type parameter, use the new `Constrained' prefix opcode.
6783 2004-08-02 Martin Baulig <martin@ximian.com>
6785 * statement.cs (LocalInfo.Flags): Added `IsThis'.
6786 (LocalInfo.IsThis): New public property.
6787 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6789 2004-08-01 Martin Baulig <martin@ximian.com>
6791 * class.cs (TypeContainer.GetClassBases): Don't set the default
6792 here since we may get called from GetPartialBases().
6793 (TypeContainer.DefineType): If GetClassBases() didn't return a
6794 parent, use the default one.
6796 2004-07-30 Martin Baulig <martin@ximian.com>
6798 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6800 * class.cs (SourceMethod): New public class, derive from the
6801 symbol writer's ISourceMethod.
6802 (Method): Use the new symbol writer API.
6804 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6805 as argument and use the new symbol writer.
6808 (SourceFile): Implement the symbol writer's ISourceFile.
6809 (Location.SymbolDocument): Removed.
6810 (Location.SourceFile): New public property.
6812 * symbolwriter.cs: Use the new symbol writer API.
6814 2004-07-30 Raja R Harinath <rharinath@novell.com>
6816 * Makefile (install-local): Remove. Functionality moved to
6819 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
6821 * Makefile: Install mcs.exe.config file together with mcs.exe.
6822 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6823 correct runtime version.
6825 2004-07-25 Martin Baulig <martin@ximian.com>
6828 (TypeContainer.RegisterOrder): Removed, this was unused.
6829 (TypeContainer, interface_order): Removed.
6830 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6831 TypeContainer as argument since we can also be called with a
6832 `PartialContainer' for a partial class/struct/interface.
6833 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6834 of checking whether we're an `Interface' - we could be a
6836 (PartialContainer.Register): Override; call
6837 AddClass()/AddStruct()/AddInterface() on our parent.
6839 * cs-parser.jay (interface_member_declaration): Add things to the
6840 `current_container', not the `current_class'.
6842 * rootcontext.cs (RegisterOrder): The overloaded version which
6843 takes an `Interface' was unused, removed.
6845 * typemanager.cs (TypeManager.LookupInterface): Return a
6846 `TypeContainer', not an `Interface'.
6847 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6848 contain a `PartialContainer' for an interface, so check it's
6849 `Kind' to figure out what it is.
6851 2004-07-25 Martin Baulig <martin@ximian.com>
6853 * class.cs (Class.DefaultTypeAttributes): New public constant.
6854 (Struct.DefaultTypeAttributes): Likewise.
6855 (Interface.DefaultTypeAttributes): Likewise.
6856 (PartialContainer.TypeAttr): Override this and add the
6857 DefaultTypeAttributes.
6859 2004-07-25 Martin Baulig <martin@ximian.com>
6861 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6862 we can just use the `Parent' field instead.
6864 2004-07-25 Martin Baulig <martin@ximian.com>
6866 * class.cs (TypeContainer.Emit): Renamed to EmitType().
6868 2004-07-25 Martin Baulig <martin@ximian.com>
6870 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6871 our parts before defining any methods.
6872 (TypeContainer.VerifyImplements): Make this virtual.
6873 (ClassPart.VerifyImplements): Override and call VerifyImplements()
6874 on our PartialContainer.
6876 2004-07-25 Martin Baulig <martin@ximian.com>
6878 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6880 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6881 argument, we can just use the `Parent' field instead.
6884 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
6885 (MemberBase.DoDefine): Likewise.
6887 2004-07-24 Martin Baulig <martin@ximian.com>
6889 * decl.cs (MemberCore.Parent): New public field.
6890 (DeclSpace.Parent): Moved to MemberCore.
6892 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6893 (MemberBase.ctor): Added TypeContainer argument, pass it to our
6895 (FieldBase, Field, Operator): Likewise.
6896 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6897 (EventField, Event): Likewise.
6899 2004-07-23 Martin Baulig <martin@ximian.com>
6901 * class.cs (PartialContainer): New public class.
6902 (ClassPart): New public class.
6903 (TypeContainer): Added support for partial classes.
6904 (TypeContainer.GetClassBases): Splitted some of the functionality
6905 out into GetNormalBases() and GetPartialBases().
6907 * cs-tokenizer.cs (Token.PARTIAL): New token.
6908 (Tokenizer.consume_identifier): Added some hacks to recognize
6909 `partial', but only if it's immediately followed by `class',
6910 `struct' or `interface'.
6912 * cs-parser.jay: Added support for partial clases.
6914 2004-07-23 Martin Baulig <martin@ximian.com>
6916 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6917 a `DeclSpace' and also made it readonly.
6918 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6919 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6920 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6922 * cs-parser.jay: Pass the `current_class', not the
6923 `current_container' (at the moment, this is still the same thing)
6924 to a new Method, Property, Event, Indexer or Constructor.
6926 2004-07-23 Martin Baulig <martin@ximian.com>
6928 * cs-parser.jay (CSharpParser): Added a new `current_class' field
6929 and removed the `current_interface' one.
6930 (struct_declaration, class_declaration, interface_declaration):
6931 Set `current_class' to the newly created class/struct/interface;
6932 set their `Bases' and call Register() before parsing their body.
6934 2004-07-23 Martin Baulig <martin@ximian.com>
6936 * class.cs (Kind): New public enum.
6937 (TypeContainer): Made this class abstract.
6938 (TypeContainer.Kind): New public readonly field.
6939 (TypeContainer.CheckDef): New public method; moved here from
6941 (TypeContainer.Register): New public abstract method.
6942 (TypeContainer.GetPendingImplementations): New public abstract
6944 (TypeContainer.GetClassBases): Removed the `is_class' and
6945 `is_iface' parameters.
6946 (TypeContainer.DefineNestedTypes): Formerly known as
6948 (ClassOrStruct): Made this class abstract.
6950 * tree.cs (RootTypes): New public type.
6952 2004-07-20 Martin Baulig <martin@ximian.com>
6954 * tree.cs (Tree.RecordNamespace): Removed.
6955 (Tree.Namespaces): Removed.
6957 * rootcontext.cs (RootContext.IsNamespace): Removed.
6959 * cs-parser.jay (namespace_declaration): Just create a new
6960 NamespaceEntry here.
6962 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
6964 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6965 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6966 entry to make sure it runs in the correct runtime version.
6968 2004-07-18 Martin Baulig <martin@ximian.com>
6970 * generic.cs (ConstructedType.CheckConstraints): Improved
6971 constraints checking.
6973 2004-07-18 Martin Baulig <martin@ximian.com>
6975 * expression.cs (Invocation.BetterMethod): Call
6976 TypeManager.TypeToCoreType() on all types and removed my previous
6977 hack; we're already doig the right thing here.
6979 2004-07-17 Martin Baulig <martin@ximian.com>
6981 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6983 2004-07-16 Martin Baulig <martin@ximian.com>
6985 * iterators.cs: Added generics support.
6987 2004-07-16 Martin Baulig <martin@ximian.com>
6989 * iterators.cs: Rewrote this. We're now using one single Proxy
6990 class for both the IEnumerable and the IEnumerator interface and
6991 `Iterator' derives from Class so we can use the high-level API.
6993 * class.cs (TypeContainer.AddIterator): New method.
6994 (TypeContainer.DoDefineType): New protected virtual method, which
6995 is called from DefineType().
6996 (TypeContainer.DoDefineMembers): Call DefineType() and
6997 DefineMembers() on all our iterators.
6998 (TypeContainer.Emit): Call Emit() on all our iterators.
6999 (TypeContainer.CloseType): Call CloseType() on all our iterators.
7001 * codegen.cs (EmitContext.CurrentIterator): New public field.
7003 2004-07-15 Martin Baulig <martin@ximian.com>
7006 (TypeManager.not_supported_exception_type): New type.
7008 2004-07-14 Martin Baulig <martin@ximian.com>
7011 (TypeManager.generic_ienumerable_type): New type.
7012 (TypeManager.generic_ienumerator_type): New type.
7015 (RootContext.interfaces_first_stage): Added
7016 "System.Collections.Generic.IEnumerator`1" and
7017 "System.Collections.Generic.IEnumerable`1".
7019 2004-07-14 Martin Baulig <martin@ximian.com>
7021 * iterators.cs: Use real error numbers.
7023 2004-07-14 Martin Baulig <martin@ximian.com>
7025 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
7026 requires this to be a System.Collection.IEnumerable and not a
7027 class implementing that interface.
7028 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
7030 2004-07-13 Marek Safar <marek.safar@seznam.cz>
7032 * class.cs: Fixed previous fix, it broke some error tests.
7034 2004-07-12 Martin Baulig <martin@ximian.com>
7036 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
7039 2004-07-14 Martin Baulig <martin@ximian.com>
7041 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
7042 an exclamation mark (!) for the generic arity to reflect the
7043 latest spec changes; ie. use "System.Collections.Generic.IList`1".
7045 2004-07-13 Martin Baulig <martin@ximian.com>
7047 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
7048 specifiers being part of a type argument.
7050 2004-07-13 Martin Baulig <martin@ximian.com>
7052 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
7053 name for generic types.
7055 2004-07-13 Martin Baulig <martin@ximian.com>
7057 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
7060 2004-07-09 Miguel de Icaza <miguel@ximian.com>
7062 * assign.cs (LocalTemporary): Add new argument: is_address,If
7063 `is_address' is true, then the value that we store is the address
7064 to the real value, and not the value itself.
7066 * ecore.cs (PropertyExpr): use the new local temporary
7067 stuff to allow us to handle X.Y += z (where X is a struct)
7069 2004-07-08 Martin Baulig <martin@ximian.com>
7071 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7072 not always return, just like we're doing in Using.Resolve().
7074 2004-07-07 Miguel de Icaza <miguel@ximian.com>
7076 * cs-parser.jay (fixed_statement): flag this as Pinned.
7078 2004-07-06 Miguel de Icaza <miguel@ximian.com>
7080 * typemanager.cs (TypeManager): Removed MakePinned method, this
7081 mechanism is replaced with the .NET 2.x compatible mechanism of
7082 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7084 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
7085 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7086 `IsFixed' property which has a different meaning.
7088 2004-07-02 Raja R Harinath <rharinath@novell.com>
7090 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7091 visible from inside a nested class, not just the names of the
7092 immediately enclosing class.
7095 2004-06-24 Raja R Harinath <rharinath@novell.com>
7097 * expression.cs (BetterConversion): Remove buggy special-case
7098 handling of "implicit constant expression conversions". At this
7099 point, we already know that the conversion is possible -- we're
7100 only checking to see which is better.
7102 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7104 * cs-parser.jay: Added error CS0210 test.
7106 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7108 * cs-parser.jay: Added error CS0134 test.
7110 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7113 * cs-parser.jay: Added error CS0145 test.
7115 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7117 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7119 2004-06-23 Ben Maurer <bmaurer@ximian.com>
7121 * expression.cs (StackAlloc.Resolve): The argument may not
7122 be a constant; deal with this case.
7124 2004-06-23 Marek Safar <marek.safar@seznam.cz>
7126 * attribute.cs (IndexerName_GetIndexerName): Renamed to
7127 GetIndexerAttributeValue.
7128 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7130 * class.cs (Indexer.Define): Added error tests for CS0415,
7133 2004-06-23 Miguel de Icaza <miguel@ximian.com>
7135 * attribute.cs (Attribute.Resolve): Keep field code in sync with
7138 2004-06-23 Martin Baulig <martin@ximian.com>
7140 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7141 neither return nor throw, reset the barrier as well. Fixes #60457.
7143 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
7145 * class.cs : EventAttributes is now set to None by default.
7146 This fixes bug #60459.
7148 2004-06-18 Marek Safar <marek.safar@seznam.cz>
7151 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7152 Don't throw exception but return null (it's sufficient now).
7154 2004-06-18 Marek Safar <marek.safar@seznam.cz>
7156 * typemanager.cs (GetArgumentTypes): Faster implementation.
7158 2004-06-18 Martin Baulig <martin@ximian.com>
7160 * attribute.cs (Attribute.Resolve): Check whether we're an
7161 EmptyCast which a Constant child. Fixes #60333.
7163 2004-06-17 Ben Maurer <bmaurer@ximian.com>
7165 * statement.cs (EmitCollectionForeach): Account for the fact that
7166 not all valuetypes are in areas which we can take the address of.
7167 For these variables, we store to a temporary variable. Also, make
7168 sure that we dont emit a `callvirt' on a valuetype method.
7170 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7172 * expression.cs (StackAlloc.DoReSolve): Added test for
7173 negative parameter (CS0247).
7175 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7178 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7180 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7183 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7186 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7188 Fix bug #58254 & cs1555.cs, cs1556.cs
7189 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7191 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7193 * cs-parser.jay: Added error CS1669 test for indexers.
7195 2004-06-18 Martin Baulig <martin@ximian.com>
7197 * generics.cs (GenericMethod.ctor): Don't take an Attributes
7198 argument. Fixes #60441.
7200 2004-06-16 Ben Maurer <bmaurer@ximian.com>
7201 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
7202 The name needs to have the actual name of the method in order
7203 for other tests (such as the one in OverloadResolve for Invoke
7204 on a delegate) to work. As well, it does not really help
7205 error reporting because the method group had multiple methods.
7206 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
7207 Make profiling work.
7209 2004-06-13 Martin Baulig <martin@ximian.com>
7211 * cs-parser.jay: Don't allow generic attributes.
7213 2004-06-13 Martin Baulig <martin@ximian.com>
7215 * class.cs (MemberBase.DoDefineBase): New protected method.
7216 (MemberBase.DoDefine): Compute the `flags' in the new
7217 DoDefineBase() which must be called first.
7218 (Method.Define): Call DoDefineBase() first so we have the flags
7219 when defining the generic method.
7221 * cs-parser.jay (interface_method_declaration): Support generic methods.
7223 2004-06-13 Martin Baulig <martin@ximian.com>
7225 * decl.cs (TypeName): Removed.
7226 (MemberName): Removed TypeName and MemberNow; now we just have
7229 * cs-parser.jay: Don't distinguish between type arguments and type
7230 parameters in the grammar and simplified the rules a bit. The
7231 reduce/reduce conflicts are now gone (except the one we inherited
7234 2004-06-11 Martin Baulig <martin@ximian.com>
7236 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7237 call this twice: for params and varargs methods.
7239 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7242 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7244 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7246 * attribute.cs (Attribute.GetValidTargets): Made public.
7249 (AbstractPropertyEventMethod): New class for better code sharing.
7250 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7252 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7254 2004-06-09 Martin Baulig <martin@ximian.com>
7256 * cs-parser.jay: Removed a reduce/reduce conflict.
7258 2004-06-03 Martin Baulig <martin@ximian.com>
7260 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
7261 GetSimpleName() and return a SimpleName.
7263 * ecore.cs (SimpleName.Arguments): New public field.
7264 (SimpleName): Added overloaded ctor which takes an additional
7265 TypeArguments argument.
7266 (SimpleName.SimpleNameResolve): Added support for generic methods.
7267 (MethodGroupExpr.ResolveGeneric): New public method. The code was
7268 formerly in MemberAccess.DoResolve(), but we also need it in
7269 SimpleNameResolve().
7271 * expression.cs (MemberAccess.DoResolve): Use the new
7272 MethodGroupExpr.ResolveGeneric().
7274 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7276 * decl.cs: If possible, use lookuptypedirect here. We can only do
7277 this if there is no `.' after the namespace. Avoids using
7278 LookupType, which does lots of slow processing.
7279 (FindNestedType) New method, does what it says :-).
7280 * namespace.cs: use LookupTypeDirect.
7281 * rootcontext.cs: use membercache, if possible.
7282 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7284 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7287 According to the spec,
7289 In a member access of the form E.I, if E is a single identifier,
7290 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7291 field, property, localvariable, or parameter with the same type as
7292 the meaning of E as a type-name (§3.8), then both possible
7293 meanings of E are permitted.
7295 We did not check that E as a simple-name had the same type as E as
7298 This trivial check gives us 5-7% on bootstrap time.
7300 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7302 * expression.cs (Invocation.OverloadResolve): Avoid the
7303 use of hashtables and boxing here by allocating on demand.
7305 2004-05-30 Martin Baulig <martin@ximian.com>
7307 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7308 we're doing a silent lookup. Don't try to lookup nested types in
7309 TypeManager.object_type (thanks to Ben Maurer).
7311 2004-05-30 Martin Baulig <martin@ximian.com>
7313 Committing a patch from Ben Maurer.
7315 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7317 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7319 * convert.cs: add a trivial cache for overload operator resolution.
7321 2004-05-31 Marek Safar <marek.safar@seznam.cz>
7324 (AttributeTester.GetObsoleteAttribute): Returns instance of
7325 ObsoleteAttribute when type is obsolete.
7328 (TypeContainer.VerifyObsoleteAttribute): Override.
7329 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7330 (MethodCode.VerifyObsoleteAttribute): Override.
7331 (MemberBase.VerifyObsoleteAttribute): Override.
7334 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7335 and report proper error.
7338 (Delegate.VerifyObsoleteAttribute): Override.
7341 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7342 and report proper error.
7343 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7346 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7350 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7351 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7352 Added test for ObsoleteAttribute.
7355 (Catch): Derived from Statement.
7357 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7359 * decl.cs: If possible, use lookuptypedirect here. We can only do
7360 this if there is no `.' after the namespace. Avoids using
7361 LookupType, which does lots of slow processing.
7362 (FindNestedType) New method, does what it says :-).
7363 * namespace.cs: use LookupTypeDirect.
7364 * rootcontext.cs: use membercache, if possible.
7365 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7367 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7370 According to the spec,
7372 In a member access of the form E.I, if E is a single identifier,
7373 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7374 field, property, localvariable, or parameter with the same type as
7375 the meaning of E as a type-name (§3.8), then both possible
7376 meanings of E are permitted.
7378 We did not check that E as a simple-name had the same type as E as
7381 This trivial check gives us 5-7% on bootstrap time.
7383 2004-05-30 Marek Safar <marek.safar@seznam.cz>
7385 Fixed bug #59071 & cs0160.cs
7386 * statement.cs (Try.Resolve): Check here whether order of catch
7387 clauses matches their dependencies.
7389 2004-05-30 Marek Safar <marek.safar@seznam.cz>
7392 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
7395 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7397 * expression.cs (Invocation.OverloadResolve): Avoid the
7398 use of hashtables and boxing here by allocating on demand.
7400 2004-05-30 Martin Baulig <martin@ximian.com>
7402 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7403 we're doing a silent lookup. Don't try to lookup nested types in
7404 TypeManager.object_type (thanks to Ben Maurer).
7406 2004-05-30 Martin Baulig <martin@ximian.com>
7408 Committing a patch from Ben Maurer.
7410 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7412 2004-05-29 Martin Baulig <martin@ximian.com>
7414 * class.cs (IMethodData.ShouldIgnore): New method.
7416 * typemanager.cs (TypeManager.MethodFlags): Don't take a
7417 `Location' argument, we don't need it anywhere. Use
7418 `IMethodData.ShouldIgnore ()' instead of
7419 `MethodData.GetMethodFlags ()'.
7420 (TypeManager.AddMethod): Removed.
7421 (TypeManager.AddMethod2): Renamed to AddMethod.
7423 2004-05-29 Martin Baulig <martin@ximian.com>
7425 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7427 * convert.cs (Convert.ImplicitReferenceConversion): If we're
7428 converting from a class type S to an interface type and we already
7429 have an object on the stack, don't box it again. Fixes #52578.
7431 2004-05-29 Martin Baulig <martin@ximian.com>
7433 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7434 Added support for `params' parameters. Fixes #59267.
7436 2004-05-29 Martin Baulig <martin@ximian.com>
7438 * literal.cs (NullPointer): Provide a private .ctor which sets
7439 `type' to TypeManager.object_type. Fixes #59048.
7441 2004-05-29 Martin Baulig <martin@ximian.com>
7443 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7444 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
7446 * ecore.cs (EventExpr.instance_expr): Make the field private.
7448 2004-05-26 Marek Safar <marek.safar@seznam.cz>
7450 Fixed bug #50080 & cs0214-2.cs
7451 * expression.cs (Cast.DoResolve): Check unsafe context here.
7453 * statement.cs (Resolve.DoResolve): Likewise.
7455 2004-05-26 Martin Baulig <martin@ximian.com>
7457 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7459 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7460 (RootContext.LookupType): Pass down the `silent' flag.
7462 2004-05-25 Martin Baulig <martin@ximian.com>
7465 (MethodGroupExpr.IdenticalTypeName): New public property.
7466 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7467 expression actually refers to a type.
7469 2004-05-25 Martin Baulig <martin@ximian.com>
7471 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7472 for #56176 and made it actually work.
7474 2004-05-25 Martin Baulig <martin@ximian.com>
7476 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7477 (FieldExpr, PropertyExpr): Override and implement
7478 CacheTemporaries. Fixes #52279.
7480 2004-05-25 Miguel de Icaza <miguel@ximian.com>
7482 * location.cs: In the new compiler listing a file twice is a
7483 warning, not an error.
7485 2004-05-24 Martin Baulig <martin@ximian.com>
7487 * enum.cs (Enum.DefineType): For the `BaseType' to be a
7488 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
7490 2004-05-24 Martin Baulig <martin@ximian.com>
7492 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7493 walking the `using' list. Fixes #53921.
7495 2004-05-24 Martin Baulig <martin@ximian.com>
7497 * const.cs (Const.LookupConstantValue): Added support for
7498 EmptyCast's; fixes #55251.
7500 2004-05-24 Martin Baulig <martin@ximian.com>
7502 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7503 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7504 which does the CS0135 check. The reason is that we first need to
7505 check whether the variable actually exists.
7507 2004-05-24 Martin Baulig <martin@ximian.com>
7509 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7510 than RootContext.LookupType() to find the explicit interface
7513 2004-05-24 Raja R Harinath <rharinath@novell.com>
7515 * Makefile: Simplify. Use executable.make.
7516 * mcs.exe.sources: New file. List of sources of mcs.exe.
7518 2004-05-24 Anders Carlsson <andersca@gnome.org>
7522 Use the invariant culture when doing String.Compare for CLS case
7525 2004-05-23 Martin Baulig <martin@ximian.com>
7527 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7528 don't have any dots. Fixes #52622, added cs0246-8.cs.
7530 * namespace.cs (NamespaceEntry.Lookup): Likewise.
7532 2004-05-23 Marek Safar <marek.safar@seznam.cz>
7534 * class.cs (MemberBase.Define): Reuse MemberType member for
7535 resolved type. Other methods can use it too.
7537 2004-05-23 Martin Baulig <martin@ximian.com>
7539 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7540 the variable also exists in the current block (otherwise, we need
7541 to report a CS0103). Fixes #58670.
7543 2004-05-23 Martin Baulig <martin@ximian.com>
7545 * flowanalysis.cs (Reachability.Reachable): Compute this
7546 on-the-fly rather than storing it as a field.
7548 2004-05-23 Martin Baulig <martin@ximian.com>
7550 * flowanalysis.cs (Reachability.And): Manually compute the
7551 resulting `barrier' from the reachability.
7553 2004-05-23 Marek Safar <marek.safar@seznam.cz>
7556 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7557 instance of ObsoleteAttribute when symbol is obsolete.
7560 (IMethodData): Extended interface for ObsoleteAttribute support.
7562 2004-05-22 Marek Safar <marek.safar@seznam.cz>
7564 * attribute.cs: Fix bug #55970
7566 2004-05-22 Marek Safar <marek.safar@seznam.cz>
7570 (GetObsoleteAttribute): New method. Creates the instance of
7572 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7573 ObsoleteAttribute when member is obsolete.
7574 (AttributeTester.Report_ObsoleteMessage): Common method for
7575 Obsolete error/warning reporting.
7578 (TypeContainer.base_classs_type): New member for storing parent type.
7581 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7582 for this MemberCore.
7584 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7586 * attribute.cs, const.cs: Fix bug #58590
7588 2004-05-21 Martin Baulig <martin@ximian.com>
7590 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7591 out parameters if the end of the method is unreachable. Fixes
7594 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7596 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7597 Hari was right, why extra method.
7599 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7601 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7603 2004-05-20 Martin Baulig <martin@ximian.com>
7605 * delegate.cs: Convert this file to Unix mode - like the original
7608 2004-05-20 Martin Baulig <martin@ximian.com>
7610 * attribute.cs: Convert this file to Unix mode - like the original
7613 2004-05-19 Marek Safar <marek.safar@seznam.cz>
7615 Fix bug #58688 (MCS does not report error when the same attribute
7618 * attribute.cs (Attribute.Emit): Distinction between null and default.
7620 2004-05-19 Raja R Harinath <rharinath@novell.com>
7622 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7623 of a top-level attribute without an attribute target.
7624 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
7626 (Attribute.Conditional_GetConditionName),
7627 (Attribute.Obsolete_GetObsoleteMessage): Update.
7628 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
7629 part of ScanForIndexerName.
7630 (Attribute.CanIgnoreInvalidAttribute): New function.
7631 (Attribute.ScanForIndexerName): Move to ...
7632 (Attributes.ScanForIndexerName): ... here.
7633 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7634 (Attributes.Search): New internal variant that can choose not to
7635 complain if types aren't resolved. The original signature now
7637 (Attributes.GetClsCompliantAttribute): Use internal variant, with
7638 complaints suppressed.
7639 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7640 only if it not useful.
7641 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7642 top-level for attributes that are shared between the assembly
7643 and a top-level class.
7644 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7645 * class.cs: Update to reflect changes.
7646 (DefineIndexers): Fuse loops.
7647 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
7648 a couple more variants of attribute names.
7650 2004-05-18 Marek Safar <marek.safar@seznam.cz>
7652 Fix bug #52585 (Implemented explicit attribute declaration)
7655 (Attributable.ValidAttributeTargets): New abstract method. It gets
7656 list of valid attribute targets for explicit target declaration.
7657 (Attribute.Target): It holds target itself.
7658 (AttributeSection): Removed.
7659 (Attribute.CheckTargets): New method. It checks whether attribute
7660 target is valid for the current element.
7663 (EventProperty): New class. For events that are declared like
7664 property (with add and remove accessors).
7665 (EventField): New class. For events that are declared like field.
7668 * cs-parser.jay: Implemented explicit attribute target declaration.
7670 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
7671 Override ValidAttributeTargets.
7674 (ReturnParameter): Class for applying custom attributes on
7676 (ParameterAtribute): New class. Class for applying custom
7677 attributes on the parameter type.
7679 2004-05-17 Miguel de Icaza <miguel@ximian.com>
7681 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7684 (Method): Allow UNSAFE here.
7686 * modifiers.cs: Support unsafe reporting.
7688 2004-05-17 Marek Safar <marek.safar@seznam.cz>
7690 * decl.cs: Fix bug #58478.
7692 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7694 * statement.cs: When checking for unreachable code on an EmptyStatement,
7695 set the location. Fixes bug #58488.
7697 2004-05-13 Miguel de Icaza <miguel@ximian.com>
7699 * driver.cs: Add -pkg handling.
7701 From Gonzalo: UseShelLExecute=false
7703 2004-05-12 Marek Safar <marek.safar@seznam.cz>
7706 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7708 (Attribute.IsClsCompliaceRequired): Moved to base for better
7710 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7711 when attribute is AttributeUsageAttribute.
7712 (Attribute.GetValidTargets): Simplified.
7713 (Attribute.GetAttributeUsage): New method returns AttributeUsage
7714 attribute for this type.
7715 (Attribute.ApplyAttributes): Method renamed to Emit and make
7717 (GlobalAttributeSection): New class for special handling of global
7718 attributes (assembly, module).
7719 (AttributeSection.Emit): New method.
7721 * class.cs: Implemented Attributable abstract methods.
7722 (MethodCore.LabelParameters): Moved to Parameter class.
7723 (Accessor): Is back simple class.
7724 (PropertyMethod): Implemented Attributable abstract class.
7725 (DelegateMethod): Implemented Attributable abstract class.
7726 (Event): New constructor for disctintion between normal Event
7727 and Event with accessors.
7729 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7731 * codegen.cs, const.cs, decl.cs, delegate.cs:
7732 (CommonAssemblyModulClass): Implemented Attributable abstract class
7735 * enum.cs: Implement IAttributeSupport interface.
7736 (EnumMember): New class for emum members. Implemented Attributable
7740 (ParameterBase): Is abstract.
7741 (ReturnParameter): New class for easier [return:] attribute handling.
7743 * typemanager.cs: Removed builder_to_attr.
7745 2004-05-11 Raja R Harinath <rharinath@novell.com>
7748 * attribute.cs (Attribute.GetPositionalValue): New function.
7749 * class.cs (TypeContainer.VerifyMembers): New function.
7750 (TypeContainer.Emit): Use it.
7751 (ClassOrStruct): New base class for Class and Struct.
7752 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
7753 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7755 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7756 then each non-static field should have a FieldOffset attribute.
7757 Otherwise, none of the fields should have a FieldOffset attribute.
7758 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
7759 and FieldOffset attributes.
7760 * typemanager.cs (TypeManager.struct_layout_attribute_type)
7761 (TypeManager.field_offset_attribute_type): New core types.
7762 (TypeManager.InitCoreTypes): Initialize them.
7764 2004-05-11 Michal Moskal <malekith@pld-linux.org>
7766 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7767 Return correct type.
7770 2004-05-09 Miguel de Icaza <miguel@ximian.com>
7772 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7773 be implicitly converted to ulong.
7775 * expression.cs: The logic for allowing operator &, | and ^ worked
7776 was wrong, it worked before because we did not report an error in
7777 an else branch. Fixes 57895.
7779 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7780 allow volatile fields to be reference types.
7782 2004-05-07 Miguel de Icaza <miguel@ximian.com>
7784 * driver.cs: Add support for /debug-
7786 2004-05-07 Raja R Harinath <rharinath@novell.com>
7788 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
7789 Add a 'complain' parameter to silence errors.
7790 (Attribute.Resolve): Update to changes. Put in sanity check to catch
7791 silently overlooked type-resolutions.
7792 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7794 (Attributes.Search): New function.
7795 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7796 (Attributes.GetAttributeFullName): Remove hack.
7797 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
7798 Update to reflect changes.
7799 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7800 Use Attributes.Search instead of nested loops.
7802 2004-05-07 Marek Safar <marek.safar@seznam.cz>
7805 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7806 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7807 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7809 * report.cs: (Report.Warning): Renamed to Warning_T because of
7810 parameter collision.
7812 2004-05-05 Raja R Harinath <rharinath@novell.com>
7814 * expression.cs (MemberAccess.ResolveMemberAccess):
7815 Exit with non-zero status after Report.Error.
7816 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7818 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7820 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7822 * support.cs: Don't hang when the file is empty.
7824 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7826 * support.cs: In SeekableStreamReader, compute the preamble size of the
7827 underlying stream. Position changes should take into account that initial
7830 2004-05-03 Todd Berman <tberman@sevenl.net>
7832 * driver.cs: remove unused GetSysVersion function.
7834 2004-05-03 Todd Berman <tberman@sevenl.net>
7836 * driver.cs: Remove the hack from saturday, as well as the hack
7837 from jackson (LoadAssemblyFromGac), also adds the CWD to the
7838 link_paths to get that bit proper.
7840 2004-05-01 Todd Berman <tberman@sevenl.net>
7842 * driver.cs: Try a LoadFrom before a Load, this checks the current
7843 path. This is currently a bug in mono that is be fixed, however, this
7844 provides a workaround for now. This will be removed when the bug
7847 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
7849 * CryptoConvert.cs: Updated to latest version. Fix issue with
7850 incomplete key pairs (#57941).
7852 2004-05-01 Todd Berman <tberman@sevenl.net>
7854 * driver.cs: Remove '.' from path_chars, now System.* loads properly
7857 2004-04-30 Jackson Harper <jackson@ximian.com>
7859 * codegen.cs: Open keys readonly.
7861 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7863 * typemanager.cs: don't report cyclic struct layout when a struct
7864 contains 2 or more fields of the same type. Failed for Pango.AttrShape
7865 which has 2 Pango.Rectangle fields.
7867 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
7869 * expression.cs: Handle IntPtr comparisons with IL code
7870 rather than a method call.
7872 2004-04-29 Martin Baulig <martin@ximian.com>
7874 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
7875 the list of PropertyInfo's in class hierarchy and find the
7876 accessor. Fixes #56013.
7878 2004-04-29 Martin Baulig <martin@ximian.com>
7880 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7882 2004-04-29 Martin Baulig <martin@ximian.com>
7884 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7886 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7888 2004-04-29 Martin Baulig <martin@ximian.com>
7890 * class.cs (ConstructorInitializer.Resolve): Check whether the
7891 parent .ctor is accessible. Fixes #52146.
7893 2004-04-29 Martin Baulig <martin@ximian.com>
7895 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7897 * statement.cs (Using.EmitLocalVariableDecls): Use
7898 TypeManager.idisposable_type, not typeof (IDisposable).
7899 (Foreach.EmitCollectionForeach): Added support for valuetypes.
7901 2004-04-29 Martin Baulig <martin@ximian.com>
7903 * class.cs (Event.Define): Don't emit the field and don't set
7904 RTSpecialName and SpecialName for events on interfaces. Fixes
7907 2004-04-29 Raja R Harinath <rharinath@novell.com>
7909 Refactor Attribute.ApplyAttributes.
7910 * attribute.cs (Attributable): New base class for objects that can
7911 have Attributes applied on them.
7912 (Attribute): Make AttributeUsage fields public.
7913 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7914 (Attribute.IsInternalCall): New property.
7915 (Attribute.UsageAttr): Convert to a public read-only property.
7916 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7917 (Attribute.ResolveType, Attribute.Resolve)
7918 (Attribute.ScanForIndexerName): Update to reflect changes.
7919 (Attribute.CheckAttributeTarget): Re-format.
7920 (Attribute.ApplyAttributes): Refactor, to various
7921 Attributable.ApplyAttributeBuilder methods.
7922 * decl.cs (MemberCore): Make Attributable.
7923 * class.cs (Accessor): Make Attributable.
7924 (MethodData.ApplyAttributes): Use proper attribute types, not
7926 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7927 (TypeContainer.ApplyAttributeBuilder)
7928 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7929 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
7930 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7931 (Operator.ApplyAttributeBuilder): New factored-out methods.
7932 * const.cs (Const.ApplyAttributeBuilder): Likewise.
7933 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7934 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7935 * parameter.cs (ParameterBase): New Attributable base class
7936 that can also represent Return types.
7937 (Parameter): Update to the changes.
7939 2004-04-29 Jackson Harper <jackson@ximian.com>
7941 * driver.cs: Prefer the corlib system version when looking for
7942 assemblies in the GAC. This is still a hack, but its a better hack
7945 2004-04-29 Marek Safar <marek.safar@seznam.cz>
7947 * decl.cs, enum.cs: Improved error 3005 reporting.
7949 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7950 (related_symbols): New private member for list of symbols
7951 related to reported error/warning.
7953 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7955 2004-04-29 Martin Baulig <martin@ximian.com>
7957 * ecore.cs (Expression.Constantify): If we're an enum and
7958 TypeManager.TypeToCoreType() doesn't give us another type, use
7959 t.UnderlyingSystemType. Fixes #56178.
7961 2004-04-29 Martin Baulig <martin@ximian.com>
7963 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7964 interfaces and for each interface, only add members directly
7965 declared in that interface. Fixes #53255.
7967 2004-04-28 Martin Baulig <martin@ximian.com>
7969 * expression.cs (ConditionalLogicalOperator): Use a temporary
7970 variable for `left' to avoid that we evaluate it more than once;
7973 2004-04-28 Martin Baulig <martin@ximian.com>
7975 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7978 2004-04-28 Martin Baulig <martin@ximian.com>
7980 * statement.cs (LocalInfo.Resolve): Check whether the type is not
7983 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7984 whether the type is not void (CS1547).
7986 2004-04-28 Martin Baulig <martin@ximian.com>
7988 * expression.cs (Unary.DoResolveLValue): Override this and report
7989 CS0131 for anything but Operator.Indirection.
7991 2004-04-28 Martin Baulig <martin@ximian.com>
7993 Committing a patch from Ben Maurer; see bug #50820.
7995 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7998 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8001 2004-04-28 Martin Baulig <martin@ximian.com>
8003 Committing a patch from Ben Maurer; see bug #50820.
8005 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8008 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8011 2004-04-28 Martin Baulig <martin@ximian.com>
8013 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
8014 (Block.AddLabel): Call DoLookupLabel() to only search in the
8017 2004-04-28 Martin Baulig <martin@ximian.com>
8019 * cfold.cs (ConstantFold.BinaryFold): Added special support for
8020 comparing StringConstants and NullLiterals in Equality and Inequality.
8022 2004-04-28 Jackson Harper <jackson@ximian.com>
8024 * driver.cs: Attempt to load referenced assemblies from the
8025 GAC. This is the quick and dirty version of this method that
8026 doesnt take into account versions and just takes the first
8027 canidate found. Will be good enough for now as we will not have more
8028 then one version installed into the GAC until I update this method.
8030 2004-04-28 Martin Baulig <martin@ximian.com>
8032 * typemanager.cs (TypeManager.CheckStructCycles): New public
8033 static method to check for cycles in the struct layout.
8035 * rootcontext.cs (RootContext.PopulateTypes): Call
8036 TypeManager.CheckStructCycles() for each TypeContainer.
8037 [Note: We only need to visit each type once.]
8039 2004-04-28 Martin Baulig <martin@ximian.com>
8041 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
8043 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
8044 success and added `out object value'. Use a `bool resolved' field
8045 to check whether we've already been called rather than
8046 `ConstantValue != null' since this breaks for NullLiterals.
8048 2004-04-28 Raja R Harinath <rharinath@novell.com>
8050 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
8051 setting of this flag, since the 'set' method may be non-public.
8053 2004-04-28 Raja R Harinath <rharinath@novell.com>
8055 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
8056 check on current_vector.Block.
8058 2004-04-27 Martin Baulig <martin@ximian.com>
8060 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
8061 a field initializer. Fixes #56459.
8063 2004-04-27 Martin Baulig <martin@ximian.com>
8065 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
8066 we're not attempting to use an indexer. Fixes #52154.
8068 2004-04-27 Martin Baulig <martin@ximian.com>
8070 * statement.cs (Return): Don't create a return label if we don't
8071 need it; reverts my change from January 20th. Thanks to Ben
8074 2004-04-27 Martin Baulig <martin@ximian.com>
8076 According to the spec, `goto' can only leave a nested scope, but
8079 * statement.cs (Block.LookupLabel): Only lookup in the current
8080 block, don't recurse into parent or child blocks.
8081 (Block.AddLabel): Check in parent and child blocks, report
8082 CS0140/CS0158 if we find a duplicate.
8083 (Block): Removed this indexer for label lookups.
8084 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8085 this already does the error reporting for us.
8088 (FlowBranching.UsageVector.Block): New public variable; may be null.
8089 (FlowBranching.CreateSibling): Added `Block' argument.
8090 (FlowBranching.LookupLabel): New public virtual method. Lookup a
8091 label for the target of a `goto' and check whether we're not
8092 leaving a `finally'.
8094 2004-04-27 Martin Baulig <martin@ximian.com>
8096 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8097 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8100 2004-04-27 Martin Baulig <martin@ximian.com>
8102 * statement.cs (Block.AddLabel): Also check for implicit blocks
8103 and added a CS0158 check.
8105 2004-04-27 Martin Baulig <martin@ximian.com>
8107 * flowanalysis.cs (FlowBranchingLoop): New class.
8108 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
8109 UsageVector's instead of an ArrayList.
8110 (FlowBranching.Label): Likewise.
8111 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
8112 (FlowBranching.AddBreakVector): New method.
8114 2004-04-27 Miguel de Icaza <miguel@ximian.com>
8116 * attribute.cs: Small regression fix: only convert the type if we
8117 the type is different, fixes System.Drawing build.
8119 2004-04-27 Martin Baulig <martin@ximian.com>
8121 * attribute.cs (Attribute.Resolve): If we have a constant value
8122 for a named field or property, implicity convert it to the correct
8125 2004-04-27 Raja R Harinath <rharinath@novell.com>
8127 * statement.cs (Block.Block): Implicit blocks share
8128 'child_variable_names' fields with parent blocks.
8129 (Block.AddChildVariableNames): Remove.
8130 (Block.AddVariable): Mark variable as "used by a child block" in
8131 every surrounding block.
8132 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
8133 been used in a child block, complain about violation of "Invariant
8134 meaning in blocks" rule.
8135 * cs-parser.jay (declare_local_variables): Don't use
8136 AddChildVariableNames.
8137 (foreach_statement): Don't create an implicit block: 'foreach'
8140 2004-04-23 Miguel de Icaza <miguel@ximian.com>
8142 * convert.cs (ImplicitNumericConversion): 0 is also positive when
8143 converting from 0L to ulong. Fixes 57522.
8145 2004-04-22 Marek Safar <marek.safar@seznam.cz>
8147 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
8148 derived class hides via 'new' keyword field from base class (test-242.cs).
8149 TODO: Handle this in the more general way.
8151 * class.cs (CheckBase): Ditto.
8153 2004-04-22 Marek Safar <marek.safar@seznam.cz>
8155 * decl.cs (caching_flags): New member for storing cached values
8157 (MemberCore.Flags): New enum where bit flags for caching_flags
8159 (MemberCore.cls_compliance): Moved to caching_flags.
8160 (DeclSpace.Created): Moved to caching_flags.
8162 * class.cs: Use caching_flags instead of DeclSpace.Created
8164 2004-04-21 Miguel de Icaza <miguel@ximian.com>
8166 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
8167 if we are only a derived class, not a nested class.
8169 * typemanager.cs: Same as above, but do this at the MemberLookup
8170 level (used by field and methods, properties are handled in
8171 PropertyExpr). Allow for the qualified access if we are a nested
8174 2004-04-21 Marek Safar <marek.safar@seznam.cz>
8176 * class.cs: Refactoring.
8177 (IMethodData): New inteface; Holds links to parent members
8178 to avoid member duplication (reduced memory allocation).
8179 (Method): Implemented IMethodData interface.
8180 (PropertyBase): New inner classes for get/set methods.
8181 (PropertyBase.PropertyMethod): Implemented IMethodData interface
8182 (Event): New inner classes for add/remove methods.
8183 (Event.DelegateMethod): Implemented IMethodData interface.
8185 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8186 EmitContext (related to class.cs refactoring).
8188 2004-04-21 Raja R Harinath <rharinath@novell.com>
8190 * delegate.cs (Delegate.VerifyApplicability): If the number of
8191 arguments are the same as the number of parameters, first try to
8192 verify applicability ignoring any 'params' modifier on the last
8196 2004-04-08 Martin Baulig <martin@ximian.com>
8198 Merged latest changes into gmcs. Please keep this comment in
8199 here, it makes it easier for me to see what changed in MCS since
8200 the last time I merged.
8202 2004-04-16 Raja R Harinath <rharinath@novell.com>
8204 * class.cs (TypeContainer.AddIndexer): Use
8205 'ExplicitInterfaceName' to determine if interface name was
8206 explicitly specified. 'InterfaceType' is not initialized at this time.
8207 (TypeContainer.DefineIndexers): Remove use of temporary list. The
8208 Indexers array is already in the required order. Initialize
8209 'IndexerName' only if there are normal indexers.
8210 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8211 (TypeContainer.Emit): Emit DefaultMember attribute only if
8212 IndexerName is initialized.
8215 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
8217 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8220 2004-04-15 Raja R Harinath <rharinath@novell.com>
8222 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
8226 * attribute.cs (Attribute.Resolve): Check for duplicate named
8230 2004-04-15 Miguel de Icaza <miguel@ximian.com>
8232 * iterators.cs (MarkYield): track whether we are in an exception,
8233 and generate code accordingly. Use a temporary value to store the
8234 result for our state.
8236 I had ignored a bit the interaction of try/catch with iterators
8237 since their behavior was not entirely obvious, but now it is
8238 possible to verify that our behavior is the same as MS .NET 2.0
8242 2004-04-14 Miguel de Icaza <miguel@ximian.com>
8244 * iterators.cs: Avoid creating temporaries if there is no work to
8247 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8248 Enumerations, use TypeManager.EnumToUnderlying and call
8251 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8254 (This.Emit): Use EmitContext.EmitThis to emit our
8257 (This.EmitAssign): Ditto.
8259 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8260 codepaths, we will move all the functionality into
8263 (FieldExpr.EmitAssign): Ditto.
8265 This fixes several hidden bugs that I uncovered while doing a code
8266 review of this today.
8268 * codegen.cs (EmitThis): reworked so the semantics are more clear
8269 and also support value types "this" instances.
8271 * iterators.cs: Changed so that for iterators in value types, we
8272 do not pass the value type as a parameter.
8274 Initialization of the enumerator helpers is now done in the caller
8275 instead of passing the parameters to the constructors and having
8276 the constructor set the fields.
8278 The fields have now `assembly' visibility instead of private.
8280 2004-04-11 Miguel de Icaza <miguel@ximian.com>
8282 * expression.cs (Argument.Resolve): Check if fields passed as ref
8283 or out are contained in a MarshalByRefObject.
8285 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8286 another compiler type.
8288 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
8290 * class.cs (Indexer.Define): use the new name checking method.
8291 Also, return false on an error.
8292 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8293 (is_identifier_[start/part]_character): make static.
8295 2004-04-10 Miguel de Icaza <miguel@ximian.com>
8297 * expression.cs (Binary.ResolveOperator): Do no append strings
8298 twice: since we can be invoked more than once (array evaluation)
8299 on the same concatenation, take care of this here. Based on a fix
8300 from Ben (bug #56454)
8302 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8304 * codegen.cs: Fix another case where CS1548 must be reported (when
8305 delay-sign isn't specified and no private is available #56564). Fix
8306 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8307 error when MCS is used on the MS runtime and we need to delay-sign
8308 (which seems unsupported by AssemblyBuilder - see #56621).
8310 2004-04-08 Marek Safar <marek.safar@seznam.cz>
8312 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8313 (TypeManager.ComputeNamespaces): Faster implementation for
8316 * compiler.csproj: Updated AssemblyName to mcs.
8318 2004-05-11 Jackson Harper <jackson@ximian.com>
8320 * Makefile: Preserve MONO_PATH
8322 2004-05-11 Jackson Harper <jackson@ximian.com>
8324 * Makefile: Use mono and mcs to build gmcs
8326 2004-05-03 Miguel de Icaza <miguel@ximian.com>
8328 * codegen.cs: Add patch from Robert Shade
8329 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
8332 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
8334 * CryptoConvert.cs: Updated to latest version. Fix issue with
8335 incomplete key pairs (#57941).
8337 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8339 * codegen.cs: Fix another case where CS1548 must be reported (when
8340 delay-sign isn't specified and no private is available #56564). Fix
8341 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8342 error when MCS is used on the MS runtime and we need to delay-sign
8343 (which seems unsupported by AssemblyBuilder - see #56621).
8345 2004-04-29 Jackson Harper <jackson@ximian.com>
8347 * Makefile: Set MONO_PATH to use the bootstrap corlib
8348 * driver.cs: Check the GAC for referenced assemblies.
8350 2004-04-29 Martin Baulig <martin@ximian.com>
8352 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
8354 2004-04-07 Martin Baulig <martin@ximian.com>
8356 * expression.cs (Binary.ResolveOperator): Added special case for
8357 Equality/Inequality between a type parameter and a null literal.
8359 2004-04-07 Martin Baulig <martin@ximian.com>
8361 * convert.cs: Check null literal -> type parameter conversions.
8363 2004-04-07 Martin Baulig <martin@ximian.com>
8365 * generic.cs (ConstructedType.CheckConstraints): Enforce the
8366 `class' and `struct' constraints.
8368 2004-04-07 Martin Baulig <martin@ximian.com>
8370 * generic.cs (SpecialConstraint): New public enum.
8371 (Constraints.Resolve): Added support for the `class' and `struct'
8374 * cs-parser.jay (type_parameter_constraint): Added support for the
8375 `class' and `struct' constraints.
8377 2004-04-07 Martin Baulig <martin@ximian.com>
8379 * support.cs (GenericConstraints): Replaced `Types' by
8380 `ClassConstraint' and `InterfaceConstraints'; added
8381 `HasClassConstraint'.
8383 2004-04-07 Martin Baulig <martin@ximian.com>
8386 (Constraints.InterfaceConstraints): New public property.
8387 (Constraints.Types): Make this property public
8388 (TypeParameter): Implement IMemberContainer.
8389 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
8390 instead of a TypeBuilder/MethodBuilder; pass the interface
8391 constraints to TypeManager.AddTypeParameter().
8392 (TypeParameter.DefineType): Just take an EmitContext and no
8393 TypeBuilder/MethodBuilder. Use the new public API.
8395 * typemanager.cs (TypeManager.AddTypeParameter): Added
8396 `TypeExpr[]' argument; add the interfaces to the
8397 `builder_to_ifaces' hash.
8398 (TypeManager.LookupMemberContainer): For
8399 GenericTypeParameterBuilders, get the TypeParameter from the
8400 `builder_to_type_param'.
8401 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
8402 the TypeParameter and call FindMembers on it.
8404 2004-04-07 Martin Baulig <martin@ximian.com>
8407 (MethodCore.GenericMethod): Moved this field here from Method.
8408 (MethodCore.IsDuplicateImplementation): Take the number of type
8409 parameters into account if we're a generic method.
8411 * expression.cs (Invocation.InferTypeArguments): Don't return true
8412 if `arguments' is null; we still need to check whether we actually
8413 don't need to infer anything in this case.
8414 (MemberAccess): Merged the functionality from GenericMemberAccess
8417 * generic.cs (GenericMemberAccess): Removed.
8419 2004-04-05 Martin Baulig <martin@ximian.com>
8421 * decl.cs (MemberCore): For generic classes, interfaces and
8422 structs, `Name' now includes the number of type parameters
8424 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
8425 encode the number of type arguments in the type name.
8427 * expression.cs (Expression.MemberLookup): Removed the
8428 `num_type_args' argument; we now encode the number of type
8429 arguments in the type name.
8431 * ecore.cs (SimpleName): Encode the number of type arguments in
8432 the type name itself.
8434 * generic.cs (ConstructedType): Likewise.
8436 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
8437 `MemberName'; we now include the number of type parameters in the
8440 * typemanager.cs (TypeManager.CheckGeneric): Removed.
8441 (TypeManager.MemberLookup): Removed the
8442 `num_type_args' argument; we now encode the number of type
8443 arguments in the type name.
8445 2004-04-03 Martin Baulig <martin@ximian.com>
8447 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
8448 (MemberCore.MemberName): Moved here from MemberBase.
8449 (DeclSpace.SetParameterInfo): Just take the constraints as an
8450 ArrayList; we already have the type parameters in our
8451 `MemberName'; also do the CS0080 reporting here.
8453 * cs-parser.jay (struct_declaration): Use `member_name' instead of
8454 `IDENTIFIER opt_type_parameter_list'; when constructing our
8455 `MemberName', it'll already include our type parameters.
8456 (class_declaration, interface_declaration): Likewise.
8457 (delegate_declaration): Likewise.
8458 (MakeName): Take a MemberName and return a MemberName.
8459 The following two changes are required to avoid shift/reduce conflicts:
8460 (member_name): Don't include a TypeName anymore; ie. this is now
8461 just 'IDENTIFIER opt_type_parameter_list'.
8462 (property_declaration, event_declaration): Use a
8463 `namespace_or_type_name' instead of a `member_name'.
8465 2004-04-03 Martin Baulig <martin@ximian.com>
8467 * decl.cs (MemberName): Renamed to `TypeName' and created a new
8469 (TypeName): Formerly known as MemberName.
8471 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
8472 instead of a `MemberName'.
8474 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
8475 (member_name): New rule; create a MemberName.
8477 2004-04-02 Martin Baulig <martin@ximian.com>
8479 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
8480 (CS0305 and CS0308).
8482 2004-04-02 Martin Baulig <martin@ximian.com>
8484 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
8485 support for nested types.
8487 2004-04-02 Martin Baulig <martin@ximian.com>
8489 * ecore.cs (IAlias): New public interface.
8490 (TypeExpr, TypeExpression): Implement IAlias.
8491 (TypeAliasExpression): New public class.
8493 * namespace.cs (Namespace): Implement IAlias.
8494 (Namespace.Lookup): Return an IAlias instead on an object.
8495 (Namespace.DefineName): Take an IAlias instead of an object.
8496 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
8498 (NamespaceEntry.UsingAlias): Take a Membername instead of an
8500 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
8502 (NamespaceEntry.Lookup): Likewise.
8504 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
8507 * decl.cs (DeclSpace): Implement IAlias.
8508 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
8510 * generic.cs (ConstructedType): Improved error checking.
8512 2004-04-02 Martin Baulig <martin@ximian.com>
8514 * convert.cs: Added type parameter conversions.
8517 (UnboxCast.Emit): Emit an `unbox.any' for type params.
8518 (ClassCast.Emit): If the source type is a type parameter, box it.
8519 If the target type is a type parameter, emit an `unbox.any'
8520 instead of a `classcast'.1
8522 2004-04-01 Martin Baulig <martin@ximian.com>
8524 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
8526 2004-04-01 Martin Baulig <martin@ximian.com>
8528 * generic.cs (ConstructedType.CheckConstraints): Use
8529 Convert.ImplicitStandardConversionExists(); user-defined implicit
8530 conversions are not allowed according to the spec.
8532 2004-03-30 Martin Baulig <martin@ximian.com>
8534 * expression.cs (New): Added support for type parameters.
8537 (TypeManager.activator_type): New public static field.
8538 (TypeManager.activator_create_instance): Likewise.
8540 2004-03-30 Martin Baulig <martin@ximian.com>
8542 * typemanager.cs (TypeManager.HasConstructorConstraint): New
8545 2004-03-30 Martin Baulig <martin@ximian.com>
8547 * generic.cs (ConstructedType.CheckConstraints): Actually follow
8548 the spec here: the argument type must be convertible to the
8551 2004-03-30 Martin Baulig <martin@ximian.com>
8554 (TypeParameter.Define, TypeParameter.DefineMethod): Call
8555 TypeManager.AddTypeParameter().
8556 (ConstructedType.CheckConstraints): Re-enable this and actually
8557 check whether we have a constructor constraint.
8560 (TypeManager.builder_to_type_param): New static field.
8561 (TypeManager.AddTypeParameter): New static method.
8562 (TypeManager.LookupTypeParameter): New public method.
8564 2004-03-30 Martin Baulig <martin@ximian.com>
8566 * generic.cs (TypeParameter.DefineType): Return a boolean and use
8567 the new API to actually define the constructor constraint.
8570 (TypeManager.new_constraint_attr_type): New static field.
8571 (TypeManager.InitCoreTypes): Initialize it.
8573 2004-03-30 Martin Baulig <martin@ximian.com>
8575 * generic.cs (Constraints): Completed error checking, use correct
8578 2004-03-29 Martin Baulig <martin@ximian.com>
8580 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
8582 * expression.cs (Invocation.InferTypeArguments): Added overloaded
8583 public version which takes a `ParameterData pd' instead of an
8586 2004-03-29 Martin Baulig <martin@ximian.com>
8588 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
8591 2004-03-29 Martin Baulig <martin@ximian.com>
8593 * expression.cs (Argument.ResolveMethodGroup): If we're a
8594 ConstructedType, call GetMemberAccess() on it.
8596 2004-03-29 Martin Baulig <martin@ximian.com>
8598 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
8599 (MethodCore.CheckGenericOverride): When overriding a generic
8600 method, check whether the constraints match.
8602 * support.cs (GenericConstraints): New public interface.
8603 (ParameterData.GenericConstraints): New public method.
8605 * parameter.cs (Parameter.Resolve): Check whether we're a generic
8606 method parameter and compute our constraints if appropriate.
8607 (Parameter.GenericConstraints): New public property.
8609 * generic.cs (Constraints): Implement GenericConstraints.
8611 2004-03-29 Martin Baulig <martin@ximian.com>
8613 * decl.cs (MemberCache.FindMemberToOverride): Use
8614 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
8616 2004-03-29 Martin Baulig <martin@ximian.com>
8618 * generic.cs (GenericMethod.Define): Resolve our type parameters.
8620 2004-03-29 Martin Baulig <martin@ximian.com>
8622 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
8623 not allowed on non-generic declarations").
8625 2004-03-29 Martin Baulig <martin@ximian.com>
8627 * expression.cs (Invocation.InferTypeArguments): Added overloaded
8628 public version of this method.
8630 * class.cs (MethodCore.IsDuplicateImplementation): Use
8631 Invocation.InferTypeArguments() to check this.
8633 2004-03-29 Martin Baulig <martin@ximian.com>
8635 * convert.cs: Use TypeManager.IsDelegateType() instead of
8636 comparing types correctly.
8638 2004-03-29 Martin Baulig <martin@ximian.com>
8640 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
8641 types directly to make it work for generic instances.
8643 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
8645 2004-03-29 Martin Baulig <martin@ximian.com>
8647 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
8650 2004-03-24 Martin Baulig <martin@ximian.com>
8652 * decl.cs (DeclSpace.FindType): Also use
8653 TypeManager.CheckGeneric() for types from the using clauses.
8655 2004-03-23 Martin Baulig <martin@ximian.com>
8657 * expression.cs (Invocation.OverloadResolve): Added `bool
8658 may_fail' argument and use it instead of the Location.IsNull() hack.
8660 2004-03-23 Martin Baulig <martin@ximian.com>
8662 * expression.cs (Invocation.InferType): Use correct type inference
8665 2004-03-23 Martin Baulig <martin@ximian.com>
8667 * ecore.cs (MethodGroupExpr.Name): Use
8668 TypeManager.CSharpSignature() instead of just the name.
8670 * expression.cs (Invocation.OverloadResolve): Provide better error
8672 (Invocation.DoResolve): OverloadResolve() never returns null
8673 without reporting an error, so removed the error -6 reporting here.
8675 2004-03-23 Martin Baulig <martin@ximian.com>
8677 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
8680 * cs-parser.jay (delegate_declaration): Support generic delegates.
8682 * delegate.cs: Support generic delegates.
8684 2004-03-22 Martin Baulig <martin@ximian.com>
8686 * expression.cs (Invocation.InferParamsTypeArguments): New static
8687 method; does type inference for params arguments.
8689 2004-03-21 Martin Baulig <martin@ximian.com>
8691 * typemanager.cs (TypeManager.IsGenericMethod): New public static
8692 method; checks whether a method is a generic method.
8694 * expression.cs (Invocation.InferTypeArguments): New static method;
8695 infer type arguments for generic method invocation.
8697 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
8698 property; we set this to true if we're resolving a generic method
8699 invocation and the user specified type arguments, ie. we're not
8700 doing type inference.
8702 2004-03-20 Martin Baulig <martin@ximian.com>
8704 * class.cs (MethodData.DeclaringType): New public property.
8705 (MethodData.Define): Set DeclaringType here.
8706 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
8707 instead of OperatorMethodBuilder.DeclaringType.
8709 2004-03-20 Martin Baulig <martin@ximian.com>
8711 * cs-tokenizer.cs (xtoken): Return a special
8712 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
8714 * cs-parser.jay (default_value_expression): Switch to the new
8717 2004-03-19 Martin Baulig <martin@ximian.com>
8719 * decl.cs (MemberName): New class. We use this to "construct"
8720 namespace_or_type_name's.
8722 * generics.cs (TypeArguments.GetDeclarations): New public method;
8723 returns the type arguments as a string[] and reports a CS0081 if
8724 one of them is not an identifier.
8726 * class.cs (MemberBase): The .ctor now takes the name as a
8727 MemberName instead of a string.
8728 (MemberBase.ExplicitInterfaceName): Changed type from string to
8730 (MemberBase.DoDefine): If we're an explicit implementation, the
8731 InterfaceType may be a generic instance.
8733 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
8734 (namespace_name): Call MemberName.GetName () to transform the
8735 MemberName into a string and ensure we don't have any type
8737 (type_name): Call MemberName.GetTypeExpression() to transfrom the
8738 MemberName into an expression.
8739 (method_header): Use namespace_or_type_name instead of member_name.
8741 2004-04-07 Miguel de Icaza <miguel@ximian.com>
8743 * rootcontext.cs: Add new types to the boot resolution.
8745 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8746 MulticastDelegate is not allowed.
8748 * typemanager.cs: Add new types to lookup: System.TypedReference
8751 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8752 check for TypedReference or ArgIterator, they are not allowed.
8754 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8755 makes us properly catch 1510 in some conditions (see bug 56016 for
8758 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
8760 * CryptoConvert.cs: update from corlib version
8763 2004-04-05 Miguel de Icaza <miguel@ximian.com>
8765 * class.cs (Indexer.Define): Check indexername declaration
8767 2004-04-05 Marek Safar <marek.safar@seznam.cz>
8769 * attribute.cs (IsClsCompliant): Fixed problem with handling
8770 all three states (compliant, not-compliant, undetected).
8772 2004-03-30 Marek Safar <marek.safar@seznam.cz>
8774 * attribute.cs (Attribute): Location is now public.
8775 (Resolve): Store resolved arguments (pos_values) in attribute class.
8776 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8777 (GetClsCompliantAttributeValue): New method that gets
8778 CLSCompliantAttribute value.
8779 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8780 if exists else null.
8781 (AttributeTester): New class for CLS-Compliant verification routines.
8783 * class.cs (Emit): Add CLS-Compliant verification.
8784 (Method.GetSignatureForError): Implemented.
8785 (Constructor.GetSignatureForError): Implemented
8786 (Constructor.HasCompliantArgs): Returns if constructor has
8787 CLS-Compliant arguments.
8788 (Constructor.Emit): Override.
8789 (Construcor.IsIdentifierClsCompliant): New method; For constructors
8790 is needed to test only parameters.
8791 (FieldBase.GetSignatureForError): Implemented.
8792 (TypeContainer): New member for storing base interfaces.
8793 (TypeContainer.FindMembers): Search in base interfaces too.
8795 * codegen.cs (GetClsComplianceAttribute): New method that gets
8796 assembly or module CLSCompliantAttribute value.
8797 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8799 (ModuleClass.Emit): Add error 3012 test.
8801 * const.cs (Emit): Override and call base for CLS-Compliant tests.
8803 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8804 state for all decl types.
8805 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8806 if CLS-Compliant tests are required.
8807 (IsClsCompliaceRequired): New method. Analyze whether code
8808 must be CLS-Compliant.
8809 (IsExposedFromAssembly): New method. Returns true when MemberCore
8810 is exposed from assembly.
8811 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8812 value or gets cached value.
8813 (HasClsCompliantAttribute): New method. Returns true if MemberCore
8814 is explicitly marked with CLSCompliantAttribute.
8815 (IsIdentifierClsCompliant): New abstract method. This method is
8816 used to testing error 3005.
8817 (IsIdentifierAndParamClsCompliant): New method. Common helper method
8818 for identifier and parameters CLS-Compliant testing.
8819 (VerifyClsCompliance): New method. The main virtual method for
8820 CLS-Compliant verifications.
8821 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8822 null. I don't know why is null (too many public members !).
8823 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8824 and get value of first CLSCompliantAttribute that found.
8826 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8827 (VerifyClsCompliance): Override and add extra tests.
8829 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8830 clscheck- disable CLS-Compliant verification event if assembly is has
8831 CLSCompliantAttribute(true).
8833 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8834 ApllyAttribute is now called in emit section as in the other cases.
8835 Possible future Emit integration.
8836 (IsIdentifierClsCompliant): New override.
8837 (VerifyClsCompliance): New override.
8838 (GetEnumeratorName): Returns full enum name.
8840 * parameter.cs (GetSignatureForError): Implemented.
8842 * report.cs (WarningData): New struct for Warning message information.
8843 (LocationOfPreviousError): New method.
8844 (Warning): New method. Reports warning based on the warning table.
8845 (Error_T): New method. Reports error based on the error table.
8847 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8848 verifications are done here.
8850 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8852 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8853 CLSCompliantAttribute.
8854 (all_imported_types): New member holds all imported types from other
8856 (LoadAllImportedTypes): New method fills static table with exported types
8857 from all referenced assemblies.
8858 (Modules): New property returns all assembly modules.
8860 2004-03-30 Miguel de Icaza <miguel@ximian.com>
8862 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8863 throwing a parser error.
8865 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8866 which removes the hardcoded get_/set_ prefixes for properties, as
8867 IL allows for the properties to be named something else.
8871 * expression.cs: Do not override operand before we know if it is
8874 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8876 * typemanager.cs: support for pinned variables.
8878 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8880 * decl.cs, typemanager.cs: Avoid using an arraylist
8881 as a buffer if there is only one result set.
8883 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8885 * expression.cs: Make sure you cant call a static method
8886 with an instance expression, bug #56174.
8888 2004-03-29 Miguel de Icaza <miguel@ximian.com>
8890 * class.cs (IsDuplicateImplementation): Improve error reporting to
8891 flag 663 (method only differs in parameter modifier).
8893 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8894 in preprocessor directives.
8896 * location.cs (LookupFile): Allow for the empty path.
8898 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
8899 better approach for some of that patch, but its failing with the
8900 CharSet enumeration. For now try/catch will do.
8902 * typemanager.cs: Do not crash if a struct does not have fields.
8905 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8907 * expression.cs: cs0213, cant fix a fixed expression.
8910 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8912 * cs-parser.jay: detect invalid embeded statements gracefully.
8915 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8917 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8920 the invocation type may not be a subclass of the tye of the item/
8921 The type of the item must be a subclass of the invocation item.
8926 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
8928 * attribute.cs: Added methods to get a string and a bool from an
8929 attribute. Required to information from AssemblyKeyFileAttribute,
8930 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8931 * codegen.cs: Modified AssemblyName creation to include support for
8932 strongnames. Catch additional exceptions to report them as CS1548.
8933 * compiler.csproj: Updated include CryptoConvert.cs.
8934 * compiler.csproj.user: Removed file - user specific configuration.
8935 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
8936 Mono.Security assembly. The original class is maintained and tested in
8937 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8938 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8939 like CSC 8.0 (C# v2) supports.
8940 * Makefile: Added CryptoConvert.cs to mcs sources.
8941 * rootcontext.cs: Added new options for strongnames.
8943 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
8945 * driver.cs: For --expect-error, report error code `2'
8946 if the program compiled with no errors, error code `1' if
8947 it compiled with an error other than the one expected.
8949 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
8951 * compiler.csproj: Updated for Visual Studio .NET 2003.
8952 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8953 * compiler.sln: Updated for Visual Studio .NET 2003.
8955 2004-03-24 Ravi Pratap M <ravi@ximian.com>
8957 * expression.cs: Fix bug #47234. We basically need to apply the
8958 rule that we prefer the conversion of null to a reference type
8959 when faced with a conversion to 'object' (csc behaviour).
8961 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8963 * statement.cs: Shorter form for foreach, eliminates
8964 a local variable. r=Martin.
8966 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8968 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8969 checks if we can use brtrue/brfalse to test for 0.
8970 * expression.cs: use the above in the test for using brtrue/brfalse.
8973 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8975 * expression.cs: Rewrite string concat stuff. Benefits:
8977 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8978 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8979 rather than a concat chain.
8981 * typemanager.cs: Add lookups for more concat overloads.
8983 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8985 * expression.cs: Emit shorter il code for array init.
9002 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
9004 * statement.cs: Before, two switch blocks would be merged if the
9005 total size of the blocks (end_item - begin_item + 1) was less than
9006 two times the combined sizes of the blocks.
9008 Now, it will only merge if after the merge at least half of the
9013 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
9015 * class.cs : csc build fix for GetMethods(). See bug #52503.
9017 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
9019 * expression.cs: Make sure fp comparisons work with NaN.
9020 This fixes bug #54303. Mig approved this patch a long
9021 time ago, but we were not able to test b/c the runtime
9024 2004-03-19 Miguel de Icaza <miguel@ximian.com>
9026 * ecore.cs (TypExpr.GetHashCode): implement this overload.
9028 2004-03-19 Martin Baulig <martin@ximian.com>
9030 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
9031 two overloads may unify for some type parameter substitutions and
9032 report a CS0408 if appropriate.
9034 2004-03-19 Martin Baulig <martin@ximian.com>
9036 * class.cs (MemberCore.IsDuplicateImplementation): Report the
9037 error here and not in our caller.
9039 2004-03-19 Martin Baulig <martin@ximian.com>
9041 * interface.cs: Completely killed this file.
9042 (Interface): We're now a TypeContainer and live in class.cs.
9044 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9045 argument; we're now also called for interfaces.
9046 (TypeContainer.DefineMembers): Allow this method being called
9048 (TypeContainer.GetMethods): New public method; formerly known as
9049 Interface.GetMethod(). This is used by PendingImplementation.
9050 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9051 it's now private and non-static.
9052 (Interface): Moved this here; it's now implemented similar to
9054 (Method, Property, Event, Indexer): Added `bool is_interface'
9055 argument to their .ctor's.
9056 (MemberBase.IsInterface): New public field.
9058 * cs-parser.jay: Create normal Method, Property, Event, Indexer
9059 instances instead of InterfaceMethod, InterfaceProperty, etc.
9060 (opt_interface_base): Removed; we now use `opt_class_base' instead.
9061 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9063 2004-03-19 Martin Baulig <martin@ximian.com>
9065 * class.cs (MethodCore.IsDuplicateImplementation): New private
9066 method which does the CS0111 checking.
9067 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9068 Use IsDuplicateImplementation().
9070 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
9072 * decl.cs (FindMemberToOverride): New method to find the correct
9073 method or property to override in the base class.
9075 - Make Method/Property use the above method to find the
9076 version in the base class.
9077 - Remove the InheritableMemberSignatureCompare as it is now
9080 This patch makes large code bases much faster to compile, as it is
9081 O(n) rather than O(n^2) to do this validation.
9083 Also, it fixes bug 52458 which is that nested classes are not
9084 taken into account when finding the base class member.
9086 Reviewed/Approved by Martin.
9088 2004-03-17 Martin Baulig <martin@ximian.com>
9090 * expression.cs (MemberAccess.DoResolve): Take the parent's number
9091 of type arguments into account; use the `real_num_type_args'
9092 approach like in DoResolveAsTypeStep().
9094 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
9097 2004-03-17 Marek Safar <marek.safar@seznam.cz>
9099 * interface.cs: In all interface classes removed redundant
9100 member initialization.
9102 2004-03-16 Martin Baulig <martin@ximian.com>
9104 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9106 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9108 * decl.cs (DefineTypeAndParents): New helper method to define a
9109 type's containers before the type itself is defined; This is a
9110 bug exposed by the recent changes to Windows.Forms when an
9111 implemented interface was defined inside a class that had not been
9114 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9116 (Check): Loop correctly to report errors modifiers
9117 (UNSAFE was not in the loop, since it was the same as TOP).
9119 * interface.cs: Every interface member now takes a ModFlags,
9120 instead of a "is_new" bool, which we set on the base MemberCore.
9122 Every place where we called "UnsafeOk" in the interface, now we
9123 call the proper member (InterfaceMethod.UnsafeOK) instead to get
9124 the unsafe settings from the member declaration instead of the
9125 container interface.
9127 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
9129 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9130 `set_indexer_name' to the pending bits (one per type).
9132 We fixed a bug today that was picking the wrong method to
9133 override, since for properties the existing InterfaceMethod code
9134 basically ignored the method name. Now we make sure that the
9135 method name is one of the valid indexer names.
9137 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
9139 * support.cs (SeekableStreamReader): Keep track of stream byte
9140 positions and don't mix them with character offsets to the buffer.
9142 Patch from Gustavo Giráldez
9144 2004-03-15 Marek Safar <marek.safar@seznam.cz>
9146 * interface.cs (InterfaceSetGetBase): Removed double member
9147 initialization, base class does it as well.
9149 2004-03-13 Martin Baulig <martin@ximian.com>
9151 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9152 when compiling corlib.
9154 2004-03-13 Miguel de Icaza <miguel@ximian.com>
9156 * convert.cs (ExplicitConversion): We were reporting an error on
9157 certain conversions (object_type source to a value type, when the
9158 expression was `null') before we had a chance to pass it through
9159 the user defined conversions.
9161 * driver.cs: Replace / and \ in resource specifications to dots.
9164 * class.cs: Add check for duplicate operators. Fixes 52477
9166 2004-03-11 Miguel de Icaza <miguel@ximian.com>
9168 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9169 that are in the middle of the statements, not only at the end.
9172 * class.cs (TypeContainer.AddField): No longer set the
9173 `HaveStaticConstructor' flag, now we call it
9174 `UserDefineStaticConstructor' to diferentiate the slightly
9175 semantic difference.
9177 The situation is that we were not adding BeforeFieldInit (from
9178 Modifiers.TypeAttr) to classes that could have it.
9179 BeforeFieldInit should be set to classes that have no static
9184 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9186 And most importantly Zoltan's comment:
9188 http://bugzilla.ximian.com/show_bug.cgi?id=44229
9190 "I think beforefieldinit means 'it's ok to initialize the type sometime
9191 before its static fields are used', i.e. initialization does not need
9192 to be triggered by the first access to the type. Setting this flag
9193 helps the JIT to compile better code, since it can run the static
9194 constructor at JIT time, and does not need to generate code to call it
9195 (possibly lots of times) at runtime. Unfortunately, mcs does not set
9196 this flag for lots of classes like String.
9198 csc sets this flag if the type does not have an explicit static
9199 constructor. The reasoning seems to be that if there are only static
9200 initalizers for a type, and no static constructor, then the programmer
9201 does not care when this initialization happens, so beforefieldinit
9204 This bug prevents the AOT compiler from being usable, since it
9205 generates so many calls to mono_runtime_class_init that the AOT code
9206 is much slower than the JITted code. The JITted code is faster,
9207 because it does not generate these calls if the vtable is type is
9208 already initialized, which is true in the majority of cases. But the
9209 AOT compiler can't do this."
9211 2004-03-10 Miguel de Icaza <miguel@ximian.com>
9213 * class.cs (MethodData.Emit): Refactor the code so symbolic
9214 information is generated for destructors; For some reasons we
9215 were taking a code path that did not generate symbolic information
9218 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
9220 * class.cs: Create a Constructor.CheckBase method that
9221 takes care of all validation type code. The method
9222 contains some code that was moved from Define.
9224 It also includes new code that checks for duplicate ctors.
9225 This fixes bug #55148.
9227 2004-03-09 Joshua Tauberer <tauberer@for.net>
9229 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9230 a { ... }-style array creation invokes EmitStaticInitializers
9231 which is not good for reference-type arrays. String, decimal
9232 and now null constants (NullCast) are not counted toward
9233 static initializers.
9235 2004-03-05 Martin Baulig <martin@ximian.com>
9237 * location.cs (SourceFile.HasLineDirective): New public field;
9238 specifies whether the file contains or is referenced by a "#line"
9240 (Location.DefineSymbolDocuments): Ignore source files which
9241 either contain or are referenced by a "#line" directive.
9243 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
9245 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9246 direct access to our parent, so check the method inline there.
9248 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
9250 * expression.cs (Invocation.EmitCall): Miguel's last commit
9251 caused a regression. If you had:
9256 In Foo the implict this would be null.
9258 2004-02-27 Miguel de Icaza <miguel@ximian.com>
9260 * expression.cs (Invocation.EmitCall): If the method is not
9261 virtual, do not emit a CallVirt to it, use Call.
9263 * typemanager.cs (GetFullNameSignature): Improve the method to
9264 cope with ".ctor" and replace it with the type name.
9266 * class.cs (ConstructorInitializer.Resolve): Now the method takes
9267 as an argument the ConstructorBuilder where it is being defined,
9268 to catch the recursive constructor invocations.
9270 2004-03-16 Martin Baulig <martin@ximian.com>
9272 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
9273 ConstructedType, call ResolveType() on it to get the type rather
9274 than just using `expr.Type'.
9276 2004-03-16 Martin Baulig <martin@ximian.com>
9278 * generics.cs (ConstructedType.GetMemberAccess): Take the
9279 EmitContext instead on the TypeExpr and use
9280 ec.TypeContainer.CurrentType/ec.ContainerType.
9282 2004-03-16 Martin Baulig <martin@ximian.com>
9284 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
9285 parameters before aliases.
9287 2004-03-16 Martin Baulig <martin@ximian.com>
9289 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
9290 New oublic function; checks whether two generic instances may become
9291 equal under some instantiations (26.3.1).
9293 * class.cs (TypeContainer.Define): Call
9294 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
9297 2004-03-16 Martin Baulig <martin@ximian.com>
9299 * class.cs (TypeContainer.GetClassBases): Moved
9300 Error_TypeParameterAsBase() here and also check whether the base
9301 class is not an attribute.
9303 2004-03-16 Martin Baulig <martin@ximian.com>
9305 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9307 2004-03-16 Martin Baulig <martin@ximian.com>
9309 * class.cs (Error_TypeParameterAsBase): Use correct error number
9312 2004-03-16 Martin Baulig <martin@ximian.com>
9314 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
9317 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
9320 2004-03-15 Martin Baulig <martin@ximian.com>
9322 * typemanager.cs (TypeManager.GetFullName): New public method.
9323 (TypeManager.MemberLookup): Added `int_num_type_arguments'
9324 argument; only return members with the correct number of type
9326 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
9327 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
9328 whether the number of type arguments matches.
9330 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
9331 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
9333 * expression.cs (MemberAccess): Added public `NumTypeArguments'
9334 field; it's set by the protected .ctor when we're actually a
9335 GenericMemberAccess.
9336 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
9337 arguments and pass it to MemberLookupFinal ().
9339 * ecore.cs (Expression.MemberLookup): Added `int
9340 num_type_arguments' argument; only return members with the correct
9341 number of type arguments.
9342 (Expression.MemberLookupFailed): Check whether the MemberLookup
9343 failed because we did not have the correct number of type
9344 arguments; report CS0305 in this case.
9346 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
9347 `e.ResolveAsTypeTerminal()' already did so.
9349 2004-03-15 Martin Baulig <martin@ximian.com>
9351 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
9352 we're a ConstructedType; in this case, the caller must report an
9353 error (for instance CS0131).
9355 * generic.cs (TypeArguments): Added Location argument to the .ctor.
9356 (TypeArguments.Resolve): Actually report errors here.
9358 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9360 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9361 `set_indexer_name' to the pending bits (one per type).
9363 We fixed a bug today that was picking the wrong method to
9364 override, since for properties the existing InterfaceMethod code
9365 basically ignored the method name. Now we make sure that the
9366 method name is one of the valid indexer names.
9368 2004-03-15 Martin Baulig <martin@ximian.com>
9370 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
9371 for generic instances.
9373 2004-03-13 Martin Baulig <martin@ximian.com>
9375 * class.cs (TypeContainer.DefineType): Call
9376 TypeManager.AddUserType() immediately after creating the
9377 TypeBuilder; pass all type parameters when creating the
9380 * decl.cs (DeclSpace.FindNestedType): New public method.
9381 (DeclSpace.FindType): Added `int num_type_args' argument; only
9382 return types with the correct number of type parameters.
9383 (DeclSpace.CountTypeParams): New public property.
9385 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
9386 the number of type parameters; defaults to zero.
9388 * generic.cs (TypeArguments.Count): New public property.
9389 (ConstructedType.DoResolveAsTypeStep): First call
9390 ds.FindNestedType() to find out whether we're nested in the
9391 current generic type; in this case, we inherit all type parameters
9392 from the current class.
9394 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
9395 num_type_args' argument.
9396 (RootContext.LookupType): Added overloaded version which takes the
9397 number of type arguments; only return types with the correct
9398 number of type arguments.
9400 * typemanager.cs (TypeManager.CheckGeneric): New public function;
9401 checks whether `Type t' has `int num_type_args'.
9403 2004-03-13 Martin Baulig <martin@ximian.com>
9405 * generic.cs (GenericMethod.DefineType): New method; calls
9406 DefineType() on all the type parameters.
9408 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
9409 (MethodData.Define): If we're a generic method, call
9410 GenericMethod.DefineType() to define the type parameters.
9412 2004-03-10 Martin Baulig <martin@ximian.com>
9414 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
9415 instead of IsAssignableFrom.
9417 2004-03-10 Martin Baulig <martin@ximian.com>
9419 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
9421 * support.cs (ParameterData.HasArrayParameter): New property.
9422 (ReflectionParameters.ctor): Take a MethodBase instead of a
9423 ParameterInfo[]. If we have any type parameters, get the generic
9424 method definition and ask it whether we have variable arguments.
9426 2004-02-26 Miguel de Icaza <miguel@ximian.com>
9428 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9429 routines to check if a type is an enumerable/enumerator allow
9430 classes that implement the IEnumerable or IEnumerator interfaces.
9432 * class.cs (Property, Operator): Implement IIteratorContainer, and
9433 implement SetYields.
9435 (Property.Define): Do the block swapping for get_methods in the
9436 context of iterators. We need to check if Properties also
9437 include indexers or not.
9439 (Operator): Assign the Block before invoking the
9440 OperatorMethod.Define, so we can trigger the Iterator code
9443 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
9444 Property and Operator classes are not created when we parse the
9445 declarator but until we have the block completed, so we use a
9446 singleton SimpleIteratorContainer.Simple to flag whether the
9447 SetYields has been invoked.
9449 We propagate this setting then to the Property or the Operator to
9450 allow the `yield' to function.
9452 2004-02-25 Marek Safar <marek.safar@seznam.cz>
9454 * codegen.cs: Implemented attribute support for modules.
9455 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9456 Assembly/Module functionality.
9458 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9459 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9460 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9462 2004-02-16 Marek Safar <marek.safar@seznam.cz>
9464 * interface.cs (FindMembers): The operation is performed on all base
9465 interfaces and not only on the first. It is required for future CLS Compliance patch.
9467 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
9469 * statement.cs, codegen.cs:
9470 This patch deals with patterns such as:
9472 public class List : IEnumerable {
9474 public MyEnumerator GetEnumerator () {
9475 return new MyEnumerator(this);
9478 IEnumerator IEnumerable.GetEnumerator () {
9482 public struct MyEnumerator : IEnumerator {
9487 Before, there were a few things we did wrong:
9488 1) we would emit callvirt on a struct, which is illegal
9489 2) we emited ldarg when we needed to emit ldarga
9490 3) we would mistakenly call the interface methods on an enumerator
9491 type that derived from IEnumerator and was in another assembly. For example:
9493 public class MyEnumerator : IEnumerator
9495 Would have the interface methods called, even if there were public impls of the
9496 method. In a struct, this lead to invalid IL code.
9498 2004-02-11 Marek Safar <marek.safar@seznam.cz>
9500 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9503 * delegate.cs (Define): Fixed crash when delegate type is undefined.
9505 2004-02-11 Miguel de Icaza <miguel@ximian.com>
9507 * cs-parser.jay: Fix small regression: we were not testing V2
9508 compiler features correctly.
9510 * interface.cs: If the emit context is null, then create one
9512 2004-02-09 Marek Safar <marek.safar@seznam.cz>
9514 * decl.cs (GetSignatureForError): New virtual method to get full name
9517 * attribute.cs (IAttributeSupport): New interface for attribute setting.
9518 Now it is possible to rewrite ApplyAttributes method to be less if/else.
9520 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9521 Duplicated members and code in these classes has been removed.
9522 Better encapsulation in these classes.
9524 2004-02-07 Miguel de Icaza <miguel@ximian.com>
9526 * assign.cs (Assign.DoResolve): When dealing with compound
9527 assignments, there is a new rule in ECMA C# 2.4 (might have been
9528 there before, but it is documented here) that states that in:
9532 If b is of type int, and the `op' is a shift-operator, then the
9533 above is evaluated as:
9537 * expression.cs (Binary.ResolveOperator): Instead of testing for
9538 int/uint/long/ulong, try to implicitly convert to any of those
9539 types and use that in pointer arithmetic.
9541 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9542 method to print information for from the type, not from the
9543 null-method we were given.
9545 2004-02-01 Duncan Mak <duncan@ximian.com>
9547 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9548 parsing for cmd, fixes bug #53694.
9550 2004-02-04 Marek Safar <marek.safar@seznam.cz>
9552 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9553 in the member name duplication tests. Property and operator name duplication
9554 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9556 2004-02-03 Marek Safar <marek.safar@seznam.cz>
9558 * interface.cs (PopulateMethod): Fixed crash when interface method
9559 returns not existing type (error test cs0246-3.cs).
9561 2004-02-02 Ravi Pratap M <ravi@ximian.com>
9563 * cs-parser.jay (interface_accessors): Re-write actions to also
9564 store attributes attached to get and set methods. Fix spelling
9567 (inteface_property_declaration): Modify accordingly.
9569 (InterfaceAccessorInfo): New helper class to store information to pass
9570 around between rules that use interface_accessors.
9572 * interface.cs (Emit): Apply attributes on the get and set
9573 accessors of properties and indexers too.
9575 * attribute.cs (ApplyAttributes): Modify accordingly to use the
9576 right MethodBuilder when applying attributes to the get and set accessors.
9578 2004-01-31 Miguel de Icaza <miguel@ximian.com>
9580 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9582 2004-01-26 Miguel de Icaza <miguel@ximian.com>
9584 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9586 2004-01-25 Miguel de Icaza <miguel@ximian.com>
9588 * cs-parser.jay: Remove YIELD token, instead use the new grammar
9589 changes that treat `yield' specially when present before `break'
9592 * cs-tokenizer.cs: yield is no longer a keyword.
9594 2004-01-23 Marek Safar <marek.safar@seznam.cz>
9596 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9597 setting for default constructors.
9598 For default constructors are almost every time set wrong Modifier. The
9599 generated IL code has been alright. But inside mcs this values was
9600 wrong and this was reason why several of my CLS Compliance tests
9603 2004-02-27 Martin Baulig <martin@ximian.com>
9605 * generics.cs (ConstructedType.ResolveType): Make the nested type
9606 stuff actually work.
9608 2004-02-25 Martin Baulig <martin@ximian.com>
9610 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
9611 property; returns the type parameters just from the current type,
9612 ie. with the ones from outer classes.
9613 (DeclSpace.LookupGeneric): First search in the current class, then
9615 (DeclSpace.initialize_type_params): When hiding a type parameter
9616 from an outer class, put it into the `type_param_list' anyways.
9618 * expression.cs (MemberAccess.expr): Made this field protected.
9620 * class.cs (TypeContainer.Define): The `CurrentType' just contains
9621 the type parameters from the current class.
9623 * generic.cs (ConstructedType.ResolveType): Support nested generic
9624 types by taking the type parameters which we inherit from outer
9625 classes into account.
9626 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
9627 support for nested generic types.
9629 2004-02-23 Martin Baulig <martin@ximian.com>
9631 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
9632 field and check whether we're nested inside a generic type.
9633 (DeclSpace.ResolveType): If we're resolving to a generic type
9634 definition, create a ConstructedType and return its resolved type.
9635 (DeclSpace.initialize_type_params): New private method;
9636 initializes the `type_param_list' field from the type parameters
9637 from this and all enclosing classes.
9638 (DeclSpace.TypeParameters): Call initialize_type_params() unless
9639 we're already initialized.
9641 2004-02-23 Martin Baulig <martin@ximian.com>
9643 * class.cs (Method.Define): Create the generic method before
9645 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
9646 the TypeContainer one); we use this for generic methods.
9648 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
9649 parent's TypeBuilder.
9651 2004-02-18 Martin Baulig <martin@ximian.com>
9653 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
9654 to check for equality.
9656 2004-02-05 Martin Baulig <martin@ximian.com>
9658 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
9659 `ec.TypeContainer.CurrentType', use it instead of
9660 `ec.ContainerType' to check whether we're in the type's ctor.
9662 2004-01-29 Martin Baulig <martin@ximian.com>
9664 * expression.cs (Invocation.DoResolve): If we're a
9665 `ConstructedType', then we're actually a generic method, so
9666 rewrite the expr as a GenericMemberAccess.
9668 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
9669 here; manually parse it into a string.
9671 2004-01-28 Martin Baulig <martin@ximian.com>
9673 * typemanager.cs (TypeManager.IsEqual): New static method.
9674 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
9675 check for equality instead of using `=='.
9677 2004-01-26 Martin Baulig <martin@ximian.com>
9679 * decl.cs (DeclSpace.CurrentType): New public field.
9681 * expression.cs (This.ResolveBase): If we have an
9682 `ec.TypeContainer.CurrentType', use it instead of
9685 * class.cs (TypeContainer.DefineType): If we're a generic type,
9686 create the `CurrentType' (unresolved).
9687 (TypeContainer.GenericType): New private field.
9688 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
9689 it and store it in `GenericType' before creating the MemberCache.
9690 (TypeContainer.GetMembers): If we have a `GenericType', call
9691 TypeManager.FindMembers() on it.
9693 * interface.cs (Interface.GenericType): New private field.
9694 (Interface.DefineType): If we're a generic type, create the
9695 `CurrentType' (unresolved).
9696 (Interface.DefineMembers): If we have a `CurrentType', resolve it
9697 and store it in `GenericType' before creating the MemberCache.
9698 (Interface.GetMembers): If we have a `GenericType', call
9699 TypeManager.FindMembers() on it.
9701 2004-01-22 Martin Baulig <martin@ximian.com>
9703 * cs-parser.jay (namespace_or_type_name): Return an Expression,
9704 not a QualifiedIdentifier. This is what `type_name_expression'
9705 was previously doing.
9706 (type_name_expression): Removed; the code is now in
9707 `namespace_or_type_name'.
9708 (qualified_identifier): Removed, use `namespace_or_type_name'
9710 (QualifiedIdentifier): Removed this class.
9712 2004-01-22 Martin Baulig <martin@ximian.com>
9714 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9715 not a string as alias name.
9717 2004-01-21 Miguel de Icaza <miguel@ximian.com>
9719 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9720 #52730 bug, and instead compute correctly the need to use a
9721 temporary variable when requesting an address based on the
9722 static/instace modified of the field and the constructor.
9724 2004-01-21 Martin Baulig <martin@ximian.com>
9726 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9727 class and namespace before looking up aliases. Fixes #52517.
9729 2004-01-21 Martin Baulig <martin@ximian.com>
9731 * flowanalysis.cs (UsageVector.Merge): Allow variables being
9732 assinged in a 'try'; fixes exception4.cs.
9734 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9735 * class.cs : Implemented parameter-less constructor for TypeContainer
9737 * decl.cs: Attributes are now stored here. New property OptAttributes
9739 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9741 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9743 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9745 * typemanager.cs (CSharpSignature): Now reports also inner class name.
9746 (CSharpSignature): New method for indexer and property signature.
9748 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9750 * pending.cs (IsVirtualFilter): Faster implementation.
9752 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9754 * typemanager.cs: Avoid inclusion of same assembly more than once.
9756 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9758 * cs-parser.jay: Fixed problem where the last assembly attribute
9759 has been applied also to following declaration (class, struct, etc.)
9761 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9763 * class.cs: Added error CS0538, CS0539 reporting.
9764 Fixed crash on Microsoft runtime when field type is void.
9766 * cs-parser.jay: Added error CS0537 reporting.
9768 * pending.cs: Added error CS0535 reporting.
9769 Improved error report for errors CS0536, CS0534.
9771 2004-01-20 Miguel de Icaza <miguel@ximian.com>
9773 Merge a few bits from the Anonymous Method MCS tree.
9775 * statement.cs (ToplevelBlock): New class for toplevel methods,
9776 will hold anonymous methods, lifted variables.
9778 * cs-parser.jay: Create toplevel blocks for delegates and for
9779 regular blocks of code.
9781 2004-01-20 Martin Baulig <martin@ximian.com>
9783 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9784 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9785 and `NeedExplicitReturn'; added `IsLastStatement'.
9786 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9787 have a `ReturnLabel' or we're not unreachable.
9789 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9790 child's reachability; don't just override ours with it. Fixes
9791 #58058 (lluis's example).
9792 (FlowBranching): Added public InTryOrCatch(), InCatch(),
9793 InFinally(), InLoop(), InSwitch() and
9794 BreakCrossesTryCatchBoundary() methods.
9796 * statement.cs (Return): Do all error checking in Resolve().
9797 Unless we are the last statement in a top-level block, always
9798 create a return label and jump to it.
9799 (Break, Continue): Do all error checking in Resolve(); also make
9800 sure we aren't leaving a `finally'.
9801 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9802 statement in a top-level block.
9803 (Block.Flags): Added `IsDestructor'.
9804 (Block.IsDestructor): New public property.
9806 2004-01-20 Martin Baulig <martin@ximian.com>
9808 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9810 2004-01-20 Martin Baulig <martin@ximian.com>
9812 * statement.cs (Statement.ResolveUnreachable): New public method.
9813 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9814 (Block.Resolve): Resolve unreachable statements.
9816 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9818 * expression.cs: We need to fix the case where we do
9819 not have a temp variable here.
9821 * assign.cs: Only expression compound assignments need
9822 temporary variables.
9824 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9826 * flowanalysis.cs: Reduce memory allocation in a few ways:
9827 - A block with no variables should not allocate a bit
9829 - A method with no out parameters does not need any tracking
9830 for assignment of the parameters, so we need not allocate
9833 public readonly Type[] VariableTypes;
9834 public readonly string[] VariableNames;
9835 Are redundant. The data is already stored in the variable
9836 map, so we need not allocate another array for it.
9837 - We need to add alot of checks for if (params | locals) == null
9838 due to the first two changes.
9840 2004-01-18 Miguel de Icaza <miguel@ximian.com>
9842 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9843 implement IMemoryLocation, we store a copy on a local variable and
9844 take the address of it. Patch from Benjamin Jemlich
9846 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9847 to use a special "type_name_expression" rule which reduces the
9848 number of "QualifiedIdentifier" classes created, and instead
9849 directly creates MemberAccess expressions.
9851 2004-01-17 Miguel de Icaza <miguel@ximian.com>
9853 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9854 that fixes #52853. Null literal assignment to ValueType
9856 * class.cs (MethodData.Emit): Instead of checking the name of the
9857 method to determine if its a destructor, create a new derived
9858 class from Method called Destructor, and test for that.
9860 * cs-parser.jay: Create a Destructor object instead of a Method.
9862 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9866 2004-01-16 Miguel de Icaza <miguel@ximian.com>
9868 * expression.cs (Binary.ResolveOperator): Perform an implicit
9869 conversion from MethodGroups to their delegate types on the
9872 * delegate.cs: Introduce a new class DelegateCreation that is the
9873 base class for `NewDelegate' and `ImplicitDelegateCreation',
9874 factor some code in here.
9876 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9877 conversion from MethodGroups to compatible delegate types.
9879 * ecore.cs (Expression.Resolve): Do not flag error 654
9880 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9881 we allow conversions from MethodGroups to delegate types now.
9883 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9884 assignments in v2 either.
9886 2004-01-10 Miguel de Icaza <miguel@ximian.com>
9888 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9889 static read-only fields in ctors.
9891 Applied patch from Benjamin Jemlich
9893 * expression.cs (UnaryMutator): Avoid leaking local variables.
9895 2004-01-09 Miguel de Icaza <miguel@ximian.com>
9897 * cs-tokenizer.cs (IsCastToken): Allow the various native types
9898 here to return true, as they can be used like this:
9902 Fixed 49836 and all the other dups
9904 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
9906 * driver.cs: Implement /win32res and /win32icon.
9908 2004-01-08 Miguel de Icaza <miguel@ximian.com>
9910 * cs-parser.jay: Add a rule to improve error handling for the
9911 common mistake of placing modifiers after the type.
9913 2004-01-07 Miguel de Icaza <miguel@ximian.com>
9915 * cs-parser.jay (interface_event_declaration): Catch
9916 initialization of events on interfaces, and report cs0068
9918 * cs-parser.jay (interface_event_declaration): Catch
9919 initialization of events.
9921 * ecore.cs: Better report missing constructors.
9923 * expression.cs (Binary.ResolveOperator): My previous bug fix had
9924 the error reporting done in the wrong place. Fix.
9926 * expression.cs (Binary.ResolveOperator): Catch the
9927 operator + (E x, E y) error earlier, and later allow for implicit
9928 conversions in operator +/- (E e, U x) from U to the underlying
9931 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9932 52596, if the container class is abstract, the default constructor
9933 is protected otherwise its public (before, we were always public).
9935 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9938 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9939 Jemlich that fixes bug #52597, MCS was generating invalid code for
9940 idisposable structs. Thanks to Ben for following up with this
9943 2004-01-06 Miguel de Icaza <miguel@ximian.com>
9945 * driver.cs: Allow assemblies without code to be generated, fixes
9948 2004-01-07 Nick Drochak <ndrochak@gol.com>
9950 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9952 2004-01-05 Miguel de Icaza <miguel@ximian.com>
9954 * cs-parser.jay: Add rules to improve error reporting if fields or
9955 methods are declared at the namespace level (error 116)
9957 * Add rules to catch event add/remove
9959 2004-01-04 David Sheldon <dave-mono@earth.li>
9961 * expression.cs: Added matching ")" to error message for
9964 2004-01-03 Todd Berman <tberman@gentoo.org>
9966 * ecore.cs, attribute.cs:
9967 Applying fix from #52429.
9969 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9971 * ecore.cs, expression.cs, statement.cs:
9972 Total rewrite of how we handle branching. We
9973 now handle complex boolean expressions with fewer
9974 jumps. As well if (x == 0) no longer emits a ceq.
9976 if (x is Foo) is much faster now, because we generate
9979 Overall, we get a pretty big improvement on our benchmark
9980 tests. The code we generate is smaller and more readable.
9982 I did a full two-stage bootstrap. The patch was reviewed
9983 by Martin and Miguel.
9985 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9987 * cs-parser.jay: Make primary_expression not take a QI.
9988 we dont need this because the member_access rule covers
9989 us here. So we replace the rule with just IDENTIFIER.
9991 This has two good effects. First, we remove a s/r conflict.
9992 Second, we allocate many fewer QualifiedIdentifier objects.
9994 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9996 * attribute.cs: Handle MarshalAs attributes as pseudo, and
9997 set the correct information via SRE. This prevents
9998 hanging on the MS runtime. Fixes #29374.
10000 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10002 * convert.cs: correctly handle conversions to value types
10003 from Enum and ValueType as unboxing conversions.
10005 Fixes bug #52569. Patch by Benjamin Jemlich.
10007 2004-01-02 Ravi Pratap <ravi@ximian.com>
10009 * expression.cs (BetterConversion): Prefer int -> uint
10010 over int -> ulong (csc's behaviour). This fixed bug #52046.
10012 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
10014 * decl.cs (MemberCache.FindMembers): now returns a
10017 * typemanager.cs: In general, go with with ^^.
10018 (CopyNewMethods): take an IList.
10019 (RealMemberLookup): Only allocate an arraylist
10020 if we copy from two sets of methods.
10022 This change basically does two things:
10023 1) Fewer array lists allocated due to CopyNewMethods.
10024 2) the explicit cast in MemberList costed ALOT.
10026 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
10028 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10029 a hashtable to avoid needless string allocations when an identifier is
10030 used more than once (the common case).
10032 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10034 * pending.cs: MS's TypeBuilder.GetInterfaces ()
10035 is broken, it will not return anything. So, we
10036 have to use the information we have in mcs to
10039 * typemanager.cs: Add a cache for GetInterfaces,
10040 since this will now be used more often (due to ^^)
10042 (GetExplicitInterfaces) New method that gets the
10043 declared, not effective, interfaces on a type
10044 builder (eg, if you have interface IFoo, interface
10045 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10048 This patch makes MCS able to bootstrap itself on
10051 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10053 * expression.cs: Remove the Nop's that Miguel put
10056 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10058 * report.cs, codegen.cs: Give the real stack trace to
10059 the error when an exception is thrown.
10061 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10063 * decl.cs: only allocate hashtables for ifaces if
10066 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10068 * expression.cs: fix the error from cs0121-2.cs
10069 (a parent interface has two child interfaces that
10070 have a function with the same name and 0 params
10071 and the function is called through the parent).
10073 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
10075 * class.cs, rootcontext.cs, typmanager.cs: do not
10078 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
10080 * codegen.cs: remove stack for the ec flow branching.
10081 It is already a linked list, so no need.
10083 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
10085 * Makefile: Allow custom profiler here.
10087 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10089 * typemanager.cs (LookupType):
10090 - Use a static char [], because split takes
10091 a param array for args, so it was allocating
10093 - Do not store true in a hashtable, it boxes.
10095 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10097 * flowanalysis.cs: bytify common enums.
10099 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10101 * modifiers.cs: Add a new set of flags for the
10102 flags allowed on explicit interface impls.
10103 * cs-parser.jay: catch the use of modifiers in
10104 interfaces correctly.
10105 * class.cs: catch private void IFoo.Blah ().
10107 All related to bug #50572.
10109 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10111 * decl.cs: Rewrite the consistant accessability checking.
10112 Accessability is not linear, it must be implemented in
10113 a tableish way. Fixes #49704.
10115 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10117 * expression.cs: Handle negation in a checked context.
10118 We must use subtraction from zero. Fixes #38674.
10120 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10122 * class.cs: Ignore static void main in DLLs.
10123 * rootcontext.cs: Handle the target type here,
10124 since we are have to access it from class.cs
10125 * driver.cs: account for the above.
10127 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10129 * report.cs: Give line numbers and files if available.
10131 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
10133 * driver.cs: Implement /addmodule.
10135 * typemanager.cs: Change 'modules' field so it now contains Modules not
10138 2003-12-20 Martin Baulig <martin@ximian.com>
10140 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10141 (FieldBase.IsAssigned): Removed this field.
10142 (FieldBase.SetAssigned): New public method.
10143 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10145 2003-12-20 Martin Baulig <martin@ximian.com>
10147 * expression.cs (LocalVariableReference.DoResolve): Don't set
10148 `vi.Used' if we're called from DoResolveLValue().
10150 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10151 returns the usage vector it just merged into the current one -
10152 pass this one to UsageWarning().
10153 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10154 of the `EmitContext', don't call this recursively on our children.
10156 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
10158 * driver.cs: Implement /target:module.
10160 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
10162 * support.cs (CharArrayHashtable): New helper class.
10164 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
10165 char arrays, not strings, so we can avoid creating a string in
10166 consume_identifier if the identifier is a keyword.
10168 2003-12-16 Martin Baulig <martin@ximian.com>
10170 * statement.cs (LocalInfo.Assigned): Removed this property.
10171 (LocalInfo.Flags): Removed `Assigned'.
10172 (LocalInfo.IsAssigned): New public method; takes the EmitContext
10173 and uses flow analysis.
10174 (Block.UsageWarning): Made this method private.
10175 (Block.Resolve): Call UsageWarning() if appropriate.
10177 * expression.cs (LocalVariableReference.DoResolve): Always set
10178 LocalInfo.Used here.
10180 2003-12-13 Martin Baulig <martin@ximian.com>
10182 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10183 any value here; we're now using flow analysis to figure out
10184 whether a statement/block returns a value.
10186 2003-12-13 Martin Baulig <martin@ximian.com>
10188 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10190 (FlowBranching.MergeFinally): Don't call
10191 `branching.CheckOutParameters()' here, this is called in
10193 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10194 when adding the `finally' vector.
10196 2003-12-13 Martin Baulig <martin@ximian.com>
10199 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10200 actually work and also fix #48962.
10202 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
10204 * decl.cs: Do not check System.Object for nested types,
10205 since we know it does not have any. Big bang for buck:
10208 Run 1: 8.35 seconds
10209 Run 2: 8.32 seconds
10210 corlib: 17.99 seconds
10212 Run 1: 8.17 seconds
10213 Run 2: 8.17 seconds
10214 corlib: 17.39 seconds
10216 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
10218 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10219 time we are returning 0 members, so we save alot here.
10221 2003-12-11 Martin Baulig <martin@ximian.com>
10223 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10224 `MergeChild()', also just take the `FlowBranching' as argument;
10225 call Merge() on it and return the result.
10226 (FlowBranching.Merge): We don't need to do anything if we just
10229 2003-12-11 Martin Baulig <martin@ximian.com>
10231 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10232 them in an `ArrayList' to reduce memory usage. Thanks to Ben
10233 Maurer for this idea.
10235 2003-12-11 Martin Baulig <martin@ximian.com>
10237 * flowanalysis.cs (MergeResult): This class is now gone; we now
10238 use the `UsageVector' for this. The reason for this is that if a
10239 branching just has one sibling, we don't need to "merge" them at
10240 all - that's the next step to do.
10241 (FlowBranching.Merge): We now return a `UsageVector' instead of a
10244 2003-12-11 Martin Baulig <martin@ximian.com>
10246 Reworked flow analyis and made it more precise and bug-free. The
10247 most important change is that we're now using a special `Reachability'
10248 class instead of having "magic" meanings of `FlowReturns'. I'll
10249 do some more cleanups and optimizations and also add some more
10250 documentation this week.
10252 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10253 largely reworked this class.
10254 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10255 the new `Reachability' class instead of having "magic" values here.
10256 (FlowBranching): We're now using an instance of `Reachability'
10257 instead of having separate `Returns', `Breaks' etc. fields.
10259 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10260 based on flow analysis; ignore the return value of block.Emit ().
10262 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10264 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10265 if they are private.
10267 2003-12-09 Martin Baulig <martin@ximian.com>
10269 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10270 call them directly on the UsageVector.
10272 2003-12-09 Martin Baulig <martin@ximian.com>
10274 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10275 Changed return type from `FlowReturns' to `Reachability'.
10277 2003-12-09 Martin Baulig <martin@ximian.com>
10279 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10280 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10281 `Reachable' fields with a single `Reachability' one.
10283 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10285 * class.cs (FindMembers): Remove foreach's.
10290 Run 1: 8.74 seconds
10291 Run 2: 8.71 seconds
10294 Run 1: 8.64 seconds
10295 Run 2: 8.58 seconds
10298 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10303 This patch does a few things:
10304 1. EmptyStatement is now a singleton, so it is never reallocated.
10305 2. All blah is EmptyStatement constructs have been changed to
10306 blah == EmptyStatement.Value, which is much faster and valid
10307 now that EmptyStatement is a singleton.
10308 3. When resolving a block, rather than allocating a new array for
10309 the non-empty statements, empty statements are replaced with
10310 EmptyStatement.Value
10311 4. Some recursive functions have been made non-recursive.
10312 Mainly the performance impact is from (3), however (1) and (2) are needed for
10313 this to work. (4) does not make a big difference in normal situations, however
10314 it makes the profile look saner.
10319 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10320 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10321 Total memory allocated: 56397 KB
10324 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10325 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10326 Total memory allocated: 55666 KB
10328 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10330 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10331 than the hashtable in a hashtable version
10333 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10334 we always end up concating a string. This results in a huge perf
10335 loss, because many strings have to be tracked by the GC. In this
10336 patch, we first use a hashtable that works with two keys, so that
10337 the strings do not need to be concat'ed.
10341 Run 1: 8.74 seconds
10342 Run 2: 8.71 seconds
10345 Run 1: 8.65 seconds
10346 Run 2: 8.56 seconds
10348 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10350 * Makefile: Add a new target `do-time' that does a quick and simple
10351 profile, leaving easy to parse output.
10353 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
10355 * codegen.cs (Init): Create the dynamic assembly with
10356 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10358 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
10360 * support.cs: Make the PtrHashtable use only one
10361 instance of its comparer.
10363 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
10365 * typemanager.cs: Fix lookup of GetNamespaces.
10367 2003-11-29 Miguel de Icaza <miguel@ximian.com>
10369 * expression.cs: Removed redundant line.
10371 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10372 ArrayLists, use for loops with bounds.
10374 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10377 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10378 arraylists, use for loop with bounds.
10380 The above three changes give us a 0.071 second performance
10381 improvement out of 3.294 seconds down to 3.223. On my machine
10382 the above changes reduced the memory usage by 1,387 KB during
10383 compiler bootstrap.
10385 * cs-parser.jay (QualifiedIdentifier): New class used to represent
10386 QualifiedIdentifiers. Before we created a new string through
10387 concatenation, and mostly later on, the result would be
10388 manipulated by DecomposeQI through string manipulation.
10390 This reduced the compiler memory usage for bootstrapping from
10391 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10392 compile times in 0.05 seconds.
10394 2003-11-28 Dick Porter <dick@ximian.com>
10396 * support.cs: Do string compares with the Invariant culture.
10404 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10405 the comparison is done with the Invariant culture.
10407 2003-11-27 Miguel de Icaza <miguel@ximian.com>
10409 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10410 GetEnumerator method.
10412 (ProbeCollectionType): Iterate starting at the most specific type
10413 upwards looking for a GetEnumerator
10415 * expression.cs: Shift count can be up to 31 for int/uint and 63
10418 2003-11-26 Miguel de Icaza <miguel@ximian.com>
10420 * statement.cs (Block.LookupLabel): Also look for the label on the
10421 children blocks. Use a hash table to keep track of visited
10424 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10425 we actually did transform the other operand, otherwise fall back
10426 to the common codepath that casts to long.
10428 * cs-tokenizer.cs: Use the same code pattern as the int case.
10429 Maybe I should do the parsing myself, and avoid depending on the
10430 Parse routines to get this done.
10432 2003-11-25 Miguel de Icaza <miguel@ximian.com>
10434 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10435 which fixes bug 51347. This time test it.
10437 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10438 attributes for example can not tell the difference between these.
10439 The difference was only a syntax feature of the language.
10441 * attribute.cs: Apply attributes to delegates.
10443 * delegate.cs: Call the apply attributes method.
10445 2003-11-24 Miguel de Icaza <miguel@ximian.com>
10447 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10448 comparing 0 vs Byte.MinValue, not the value
10450 (ImplicitConversionRequired): When reporting a conversion error,
10451 use error 31 to print out the constant error instead of the
10454 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10455 which fixes bug 51347.
10457 2003-11-22 Miguel de Icaza <miguel@ximian.com>
10459 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
10460 which fixes the -warnaserror command line option.
10462 2003-11-21 Miguel de Icaza <miguel@ximian.com>
10464 * cfold.cs (DoNumericPromotions): During constant folding of
10465 additions on UIntConstant, special case intconstants with
10466 IntConstants like we do on the expression binary operator.
10468 2003-11-12 Miguel de Icaza <miguel@ximian.com>
10470 * convert.cs (ImplicitReferenceConversion): We were missing a case
10471 (System.Enum are not value types or class types, so we need to
10472 classify them separatedly).
10474 * driver.cs: We do not support error 2007.
10476 2003-11-12 Jackson Harper <jackson@ximian.com>
10478 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10479 system directory. Also use the full file name so users can
10480 libraries names mscorlib-o-tron.dll in a non system dir.
10482 2004-01-04 David Sheldon <dave-mono@earth.li>
10484 * expression.cs: Added matching ")" to error message for CS0077.
10486 2003-12-19 Martin Baulig <martin@ximian.com>
10488 * typemanager.cs (TypeManager.IsEqualGenericType): New public
10489 static method; see documentation in the method.
10490 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
10492 * convert.cs (Convert.ImplicitReferenceConversion,
10493 Convert.ImplicitReferenceConversionExists): Add support for
10494 generic type declarations; see gen-36.cs.
10496 2003-12-19 Martin Baulig <martin@ximian.com>
10498 * pending.cs (Pending.InterfaceMethod): Use
10499 `Type.IsAssignableFrom()' instead of `=='.
10501 2003-12-18 Martin Baulig <martin@ximian.com>
10503 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
10506 * convert.cs (Convert.ImplicitStandardConversionExists): Use
10507 `expr_type.Equals (target_type)' instead of `=='.
10509 2003-12-08 Martin Baulig <martin@ximian.com>
10511 * generics.cs (Constraints.Types): Removed.
10512 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
10514 (Constraints.ResolveTypes): New public method; resolves the
10515 TypeExpr's to Type's.
10516 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
10517 longer takes the constraints.
10518 (TypeParameter.DefineMethod): Likewise.
10519 (TypeParameter.DefineType): New public method. Calls
10520 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
10523 2003-12-08 Martin Baulig <martin@ximian.com>
10525 * convert.cs (Convert.ImplicitConversionStandard): Use
10526 `expr_type.Equals (target_type)' instead of `=='.
10528 2003-12-08 Martin Baulig <martin@ximian.com>
10530 * typemanager.cs (TypeManager.GetReferenceType): Call
10531 `Type.MakeByRefType ()'.
10533 2003-12-08 Martin Baulig <martin@ximian.com>
10535 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
10536 just has some special meaning in some situations. For instance,
10537 it is allowed to use `where' as the name of a variable etc.
10539 2003-12-04 Martin Baulig <martin@ximian.com>
10541 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10542 `Type.MakeArrayType()' for array types.
10544 2003-11-18 Miguel de Icaza <miguel@ximian.com>
10546 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
10549 (SizeOf.DoResolve): assign the `type_queried' field. This gets
10552 2003-11-16 Martin Baulig <martin@ximian.com>
10554 * codegen.cs (EmitContext.IsGeneric): Removed.
10556 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
10557 ResolveGeneric() on the DeclSpace.
10559 2003-11-16 Martin Baulig <martin@ximian.com>
10561 * generic.cs (TypeArguments.Resolve):
10562 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
10563 `ResolveType()' on it to get the Type.
10565 2003-11-15 Martin Baulig <martin@ximian.com>
10567 * generic.cs (ConstructedType.GetInterfaces): Override this.
10569 2003-11-14 Martin Baulig <martin@ximian.com>
10571 * interface.cs (Interface.DefineType): Define all type parameters
10572 before adding the interfaces we inherit.
10574 2003-11-11 Martin Baulig <martin@ximian.com>
10576 * generic.cs (ConstructedType.ResolveType): Always call
10577 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
10579 2003-11-10 Martin Baulig <martin@ximian.com>
10581 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10582 (TypeManager.InitCoreTypes): Initialize them here, but instead of
10583 calling `ResolveType()' on them, directly assign their `Type'.
10585 2003-11-08 Martin Baulig <martin@ximian.com>
10587 * generic.cs (ConstructedType): Override `IsClass' etc.
10589 2003-11-08 Martin Baulig <martin@ximian.com>
10591 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10592 return value and the `out parent' parameter.
10593 (TypeContainer.DefineType): Moved the CS0644 check into
10594 GetClassBases(). Don't pass the interface types to the
10595 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10596 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10598 * ecore.cs (TypeExpr.IsAttribute): New property.
10599 (TypeExpr.GetInterfaces): New method.
10601 * interface.cs (Interface.GetInterfaceTypeByName): Return a
10602 TypeExpr instead of a Type.
10603 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10604 (Interface.DefineType): Don't pass the interface types to the
10605 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10606 them later and then call `TypeBulider.AddInterfaceImplementation()'.
10608 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10609 instead of a `Type[]'.
10610 (TypeManager.RegisterBuilder): Likewise.
10611 (TypeManager.AddUserInterface): Likewise.
10612 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10613 `Type[]' and also return a `TypeExpr[]'.
10614 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10616 2003-11-08 Martin Baulig <martin@ximian.com>
10618 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10621 2003-11-08 Martin Baulig <martin@ximian.com>
10623 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10624 TypeManager.ResolveExpressionTypes().
10626 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10627 instead of an Expression.
10628 (TypeExpr): This is now an abstract base class for `TypeExpression'.
10629 (TypeExpression): New public class; formerly known as `TypeExpr'.
10631 * expression.cs (ComposedCast): Derive from TypeExpr.
10633 * typemanager.cs (TypeManager.system_*_expr): These are now
10634 TypExpr's instead of Expression's.
10635 (TypeManager.ResolveExpressionTypes): New public static function;
10636 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10639 2003-11-06 Miguel de Icaza <miguel@ximian.com>
10641 * expression.cs (New.DoResolve): Do not dereference value that
10642 might be a null return.
10644 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10645 sure that the constant value has the right type. Fixes an
10646 unreported bug, similar to 50425.
10648 * const.cs (Const.LookupConstantValue): Call
10649 ImplicitStandardConversionExists before doing a conversion to
10650 avoid havng the TypeManager.ChangeType do conversions.
10652 Reduced the number of casts used
10654 (Const.ChangeType): New routine to enable reuse of the constant
10655 type changing code from statement.
10657 * typemanager.cs (ChangeType): Move common initialization to
10658 static global variables.
10662 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10663 every value type to go through, even if it was void. Fix that.
10665 * cs-tokenizer.cs: Use is_identifier_start_character on the start
10666 character of the define, and the is_identifier_part_character for
10667 the rest of the string.
10669 2003-11-05 Miguel de Icaza <miguel@ximian.com>
10671 * expression.cs (UnaryMutator.EmitCode): When I updated
10672 LocalVariableReference.DoResolve, I overdid it, and dropped an
10673 optimization done on local variable references.
10675 2003-11-04 Miguel de Icaza <miguel@ximian.com>
10677 * ecore.cs: Convert the return from Ldlen into an int.
10679 2003-10-20 Miguel de Icaza <miguel@ximian.com>
10681 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10682 the accessibility, this is a special case for toplevel non-public
10683 classes (internal for instance).
10685 2003-10-20 Nick Drochak <ndrochak@gol.com>
10687 * ecore.cs: Fix typo and build. Needed another right paren.
10689 2003-10-19 Miguel de Icaza <miguel@ximian.com>
10691 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
10692 `internal' case regular and protected, but not allowing protected
10693 to be evaluated later. Bug 49840
10695 2003-10-15 Miguel de Icaza <miguel@ximian.com>
10697 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10698 to kb.Nlast, and not the kb.nFirst to isolate the switch
10701 Extract the underlying type, so enumerations of long/ulong are
10702 treated like long/ulong.
10704 2003-10-14 Miguel de Icaza <miguel@ximian.com>
10706 * expression.cs (New): Overload the meaning of RequestedType to
10707 track the possible creation of the NewDelegate type, since
10708 DoResolve is invoked more than once for new constructors on field
10711 See bugs: #48800 and #37014
10713 * cs-parser.jay (declare_local_constants): Take an arraylist
10714 instead of a single constant.
10716 (local_constant_declaration): It should take a
10717 constant_declarators, not a constant_declarator. Fixes 49487
10719 * convert.cs: Fix error report.
10721 2003-10-13 Jackson Harper <jackson@ximian.com>
10723 * typemanager.cs (TypeToCoreType): Add float and double this fixes
10726 2003-11-03 Martin Baulig <martin@ximian.com>
10728 * expression.cs (ArrayAccess.GetStoreOpcode): Added
10729 `out bool has_type_arg'; if set, we need to pass the type to
10731 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
10732 Stelem_Any/Ldelem_Any for generic parameters.
10734 2003-11-02 Martin Baulig <martin@ximian.com>
10736 * expression.cs (Invocation.EmitCall): Use
10737 `TypeManager.IsValueType()' to check whether it's a value type.
10738 Don't set `struct_call' when calling a method on a type parameter.
10740 2003-11-02 Martin Baulig <martin@ximian.com>
10742 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
10743 and removed the TypeBuilder argument.
10745 * typemanager.cs (TypeManager.IsValueType): Return
10746 `t.IsGenericParameter || t.IsValueType'.
10748 2003-10-25 Martin Baulig <martin@ximian.com>
10750 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
10751 call ConstructedType.Resolve() on it.
10753 * generic.cs (ConstructedType.Resolve): Set `type' on success.
10755 2003-10-25 Martin Baulig <martin@ximian.com>
10757 * class.cs (TypeContainer.GetClassBases): Changed
10758 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
10759 CS8214 reporting here.
10760 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
10761 instead of a `Type' for our parent. In case of a recursive
10762 declaration (see tests/gen-23.cs for an example), our parent is a
10763 ConstructedType and it doesn't have its type set. So, first
10764 create our own TypeBuilder, then call constructed.Resolve() to get
10765 the parent's type and finally TypeBuilder.SetParent() it.
10767 * ecore.cs (TypeExpr.Name): New public virtual property.
10770 (ConstructedType): We're now a TypeExpr and not just an Expression.
10771 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
10772 arguments here; this is done later.
10773 (ConstructedType.Resolve): New public method to resolve the type
10774 arguments and bind them.
10776 2003-10-21 Martin Baulig <martin@ximian.com>
10778 * convert.cs: Use `TypeManager.IsValueType' instead of
10779 'type.IsValueType' everywhere.
10781 * typemanager.cs (TypeManager.IsValueType): Return true for type
10782 parameters. The reason for this is that we need to box a type
10783 parameter when converting it to a reference type.
10785 * cs-parser.jay: Added support for default value expressions.
10787 * generics.cs (DefaultValueExpression): New public class.
10789 2003-10-17 Martin Baulig <martin@ximian.com>
10791 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
10792 TypeContainer so we can also use this for Interfaces.
10793 (TypeParameter.Resolve): Likewise.
10795 * interface.cs (Interface.DefineType): Added support for generic
10798 * cs-parser.jay: Added support for generic structs and interfaces.
10800 2003-10-17 Martin Baulig <martin@ximian.com>
10802 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
10803 call generic methods :-)
10805 2003-10-16 Martin Baulig <martin@ximian.com>
10807 * cs-parser.jay (namespace_or_type_name): Only create a
10808 GenericMemberAccess if we actually have type arguments.
10810 2003-10-13 Martin Baulig <martin@ximian.com>
10812 * class.cs (Method.Define): If we're a generic method, call
10813 TypeBuilder.DefineGenericMethod () before resolving
10815 (MethodData): Added .ctor which takes an additional MethodBuilder
10816 argument; this is used for generic methods.
10817 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
10818 we already have a MethodBuilder.
10820 2003-10-10 Martin Baulig <martin@ximian.com>
10822 * class.cs (Method): Added .ctor which takes a `GenericMethod'
10823 instead of a `DeclSpace'. This is used for generic methods.
10825 * cs-parser.jay (method_header): Added support for generic
10826 methods; create a `GenericMethod' instance and pass it to the
10827 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
10828 parameters and locals.
10830 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
10831 since we already have the location. Check whether we're a generic
10832 type declaration or a generic method and create the correct type
10835 * generic.cs (TypeParameter.DefineMethod): New public method.
10836 (GenericMethod): New public class; derives from DeclSpace and is
10837 used for generic methods.
10839 2003-10-09 Martin Baulig <martin@ximian.com>
10841 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10843 (MethodCore.DoDefineParameters): Removed the TypeContainer
10844 argument; use the DeclSpace which was passed to the .ctor instead.
10845 (MethodCore.CheckParameter): Take a DeclSpace instead of a
10846 TypeContainer; we only need a DeclSpace here.
10848 2003-10-09 Martin Baulig <martin@ximian.com>
10850 * class.cs (MethodData): Added additional `DeclSpace ds' argument
10852 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10853 EmitContext's .ctor.
10855 2003-10-09 Martin Baulig <martin@ximian.com>
10857 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10858 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10859 AsAccessible(), moved them as well.
10861 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10863 2003-10-07 Miguel de Icaza <miguel@ximian.com>
10865 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10866 generation for >=, as spotted by Paolo, bug 48679.
10867 Patch from David Waite.
10869 * cs-tokenizer.cs: Add handling for #pragma.
10871 * cs-parser.jay: Allow for both yield and yield return in the
10872 syntax. The anti-cobolization of C# fight will go on!
10874 * class.cs (TypeBuilder.DefineType): Catch error condition here
10875 (Parent.DefineType erroring out and returning null).
10877 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10878 coping with enumerations variables, we were mistakenly processing
10879 them as a regular value type instead of built-in types. Fixes the
10882 * typemanager.cs (IsBuiltinOrEnum): New method.
10884 2003-09-30 Miguel de Icaza <miguel@ximian.com>
10886 * cs-parser.jay: Upgrade: yield now needs the return clause.
10888 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10890 * cs-parser.jay : Renamed yyName to yyNames related to jay.
10892 2003-09-29 Martin Baulig <martin@ximian.com>
10894 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10895 inflated generic methods.
10897 * generics.cs (ConstructedType): Distinguish between open and
10898 closed constructed types; correctly resolve the arguments.
10900 2003-09-22 Martin Baulig <martin@ximian.com>
10902 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10903 all type arguments meet their constraints.
10905 2003-09-19 Martin Baulig <martin@ximian.com>
10907 * decl.cs (MemberCache.SetupCacheForInterface): Take a
10908 `MemberCache parent' argument. Normally, an interface doesn't
10909 have a parent type except System.Object, but we use this in gmcs
10910 for generic type parameters.
10912 2003-09-18 Martin Baulig <martin@ximian.com>
10914 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10915 on `type.IsInterface'; don't check whether the type has a parent
10916 to determine whether it's an interface.
10918 2003-09-17 Martin Baulig <martin@ximian.com>
10920 * generic.cs (ConstructedType.ToString): Always use `name' as the
10923 2003-09-15 Martin Baulig <martin@ximian.com>
10925 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10927 * generic.cs (Constraints.Resolve): New public method; this is
10928 called to resolve the constraint types and to check whether all
10929 the constraints are correct.
10930 (Constraints.Types): New public property.
10931 (TypeParameter.Resolve): New public method; resolves all the
10932 type's constraints.
10934 * class.cs (TypeContainer.DefineType): Call
10935 TypeParameter.Resolve() before actually defining the type.
10937 2003-09-15 Martin Baulig <martin@ximian.com>
10939 * class.cs (TypeContainer.DefineType): Added an error flag to
10940 avoid reporting duplicate CS0146's ("class definition is
10943 * driver.cs (Driver.MainDriver): Abort if
10944 RootContext.ResolveTree() reported any errors.
10946 2003-09-07 Martin Baulig <martin@ximian.com>
10948 * report.cs (Error, Warning): Added overloaded versions which take
10949 a `params object[] args' and call String.Format().
10951 2003-09-07 Martin Baulig <martin@ximian.com>
10953 * decl.cs (DeclSpace..ctor): Don't call
10954 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10955 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
10956 (DeclSpace.RecordDecl): New method.
10958 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10960 2003-09-02 Ravi Pratap <ravi@ximian.com>
10962 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10963 value attributes to be applied to ParameterBuilders.
10965 * class.cs (MethodCore.LabelParameters): Make static and more
10966 generic so that it can be used from other places - like interface
10967 methods, for instance.
10969 * interface.cs (Interface.Emit): Call LabelParameters before
10970 emitting attributes on the InterfaceMethod.
10972 2003-09-07 Martin Baulig <martin@ximian.com>
10974 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10975 if the number of type parameters doesn't match.
10977 2003-09-04 Martin Baulig <martin@ximian.com>
10979 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10980 for arrays of generic type params (ie. `!0[]').
10982 2003-09-04 Martin Baulig <martin@ximian.com>
10984 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10987 2003-09-04 Martin Baulig <martin@ximian.com>
10989 * decl.cs (DeclSpace.LookupGeneric): New method.
10990 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10993 * generic.cs (TypeParameterExpr): Take a TypeParameter as
10994 argument, not just a string.
10995 (TypeParameter.Define): New public method; this is called to
10996 actually define the generic parameter; after this, you can use the
10997 new `Type' property to get the type.
10999 2003-09-04 Martin Baulig <martin@ximian.com>
11001 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
11002 is now an ArrayList; initialize the result of the `TypeParameters'
11004 (DeclSpace.GetGenericData): Removed.
11005 (DeclSpace.LookupGeneric): Temporarily removed; we need to
11006 implement this in a different way.
11007 (DeclSpace.GetTypeParameters): Removed; there's now a
11008 `TypeParameters' property.
11009 (DeclSpace.TypeParameters): New public property.
11011 * generic.cs (Constraints): Make this class public.
11012 (TypeParameter): New public class.
11014 2003-09-04 Martin Baulig <martin@ximian.com>
11016 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
11017 generic parameters.
11019 * class.cs (TypeContainer.DefineType): Call
11020 TypeBuilder.DefineGenericParameter () on all generic parameters if
11021 this is a generic type.
11023 2003-08-28 Martin Baulig <martin@ximian.com>
11025 * sample-stack.il: Compile this with ilasm: "ilasm /dll
11028 * sample-hello.cs: Compile this with gmcs: "gmcs
11029 /r:sample-stack.dll sample-hello.cs".
11031 2003-08-28 Martin Baulig <martin@ximian.com>
11033 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
11034 the parameters to the generic type.
11036 2003-08-28 Martin Baulig <martin@ximian.com>
11038 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
11040 2003-08-28 Martin Baulig <martin@ximian.com>
11042 * cs-parser.jay (opt_type_argument_list): Use
11043 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
11044 (primary_expression): Replace `qualified_identifier' with `type_name'.
11045 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
11047 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
11048 parser to check whether it is syntactically a type parameter list;
11049 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
11052 2003-08-26 Martin Baulig <martin@ximian.com>
11054 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11055 resolving aliases; fixes #47927.
11057 2003-08-26 Martin Baulig <martin@ximian.com>
11059 * statement.cs (Using.DoResolve): This is internally emitting a
11060 try/finally clause, so we need to set ec.NeedExplicitReturn if we
11061 do not always return. Fixes #47681.
11063 2003-08-26 Martin Baulig <martin@ximian.com>
11065 * decl.cs (MemberCore): Moved WarningNotHiding(),
11066 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11068 (AdditionResult): Make this nested in DeclSpace.
11069 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11070 argument; call NamespaceEntry.Define() unless we're nested in a
11073 * namespace.cs (Namespace.DefineName): New public function. This
11074 is called from DeclSpace's .ctor to add
11075 (Namespace.Lookup): Include DeclSpaces in the lookup.
11077 * class.cs (Operator): Derive from MemberBase, not MemberCore.
11079 * const.cs (Const): Derive from MemberBase, not MemberCore.
11081 2003-08-25 Martin Baulig <martin@ximian.com>
11083 * convert.cs (Convert.ExplicitReferenceConversion): When
11084 converting from an interface type to a class, unbox if the target
11085 type is a struct type. Fixes #47822.
11087 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11089 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11092 2003-08-22 Martin Baulig <martin@ximian.com>
11094 * class.cs (TypeManager.DefineType): When defining a nested type,
11095 call DefineType() on our parent; fixes #47801.
11097 2003-08-22 Martin Baulig <martin@ximian.com>
11099 * class.cs (MethodData.Define): While checking if a method is an
11100 interface implementation, improve the test a bit more to fix #47654.
11102 2003-08-22 Martin Baulig <martin@ximian.com>
11104 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11105 correctly; fixes #47722.
11107 2003-08-22 Martin Baulig <martin@ximian.com>
11109 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11110 LocalVariableReference, ensure it's not read-only. Fixes #47536.
11112 * statement.cs (Fixed.DoResolve): Make all variables read-only.
11114 2003-08-22 Martin Baulig <martin@ximian.com>
11116 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11117 can only be assigned in static constructors. Fixes #47161.
11119 2003-08-22 Martin Baulig <martin@ximian.com>
11121 Rewrote and improved the flow analysis code.
11123 * flowbranching.cs (FlowBranching): Make this class abstract.
11124 (FlowBranching.CreateBranching): New static function to create a
11125 new flow branching.
11126 (FlowBranchingBlock, FlowBranchingException): New classes.
11127 (FlowBranching.UsageVector.Type): New public readonly field.
11128 (FlowBranching.UsageVector.Breaks): Removed the setter.
11129 (FlowBranching.UsageVector.Returns): Removed the setter.
11130 (FlowBranching.UsageVector): Added Break(), Return(),
11131 NeverReachable() and Throw() methods to modify the reachability.
11132 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11133 done by FlowBranching.Merge().
11134 (FlowBranching.UsageVector.MergeChild): New method; merges the
11135 merge result into the current vector.
11136 (FlowBranching.Merge): New abstract method to merge a branching.
11138 2003-08-12 Martin Baulig <martin@ximian.com>
11140 * expression.cs (Indirection.CacheTemporaries): Create the
11141 LocalTemporary with the pointer type, not its element type.
11143 2003-08-10 Miguel de Icaza <miguel@ximian.com>
11145 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11146 token was a keyword or not.
11148 Add `error' options where an IDENTIFIER was expected; Provide
11149 CheckToken and CheckIdentifierToken convenience error reporting
11152 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11154 * decl.cs: Rename `NamespaceEntry Namespace' public field into
11155 NameSpaceEntry NameSpaceEntry.
11157 (LookupInterfaceOrClass): Avoid creating a full qualified name
11158 from namespace and name: avoid doing lookups when we know the
11159 namespace is non-existant. Use new Tree.LookupByNamespace which
11160 looks up DeclSpaces based on their namespace, name pair.
11162 * driver.cs: Provide a new `parser verbose' to display the
11163 exception thrown during parsing. This is turned off by default
11164 now, so the output of a failure from mcs is more graceful.
11166 * namespace.cs: Track all the namespaces defined in a hashtable
11169 (IsNamespace): New method
11171 2003-08-09 Miguel de Icaza <miguel@ximian.com>
11173 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
11174 we know that we need to concatenate (full typename can never be
11179 * statement.cs: Use a bitfield; Do not initialize to null things
11180 which are done by the constructor by default.
11182 * cs-parser.jay: bug fix, parameter was 4, not 3.
11184 * expression.cs: Just use the property;
11186 * statement.cs: No need for GetVariableInfo method.
11188 2003-08-08 Martin Baulig <martin@ximian.com>
11190 * flowanalysis.cs (FlowReturns): This is now nested in the
11191 `FlowBranching' class.
11192 (MyBitVector): Moved this here from statement.cs.
11193 (FlowBranching.SiblingType): New enum type.
11194 (FlowBranching.CreateSibling): Added `SiblingType' argument.
11196 2003-08-07 Martin Baulig <martin@ximian.com>
11198 * flowanalysis.cs (FlowBranchingType): This is now nested in the
11199 `FlowBranching' class and called `BranchingType'.
11201 2003-08-07 Martin Baulig <martin@ximian.com>
11203 * flowanalysis.cs: Moved all the control flow analysis code into
11206 2003-08-07 Martin Baulig <martin@ximian.com>
11208 * assign.cs (Assign.DoResolve): `target' must either be an
11209 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
11212 2003-08-07 Miguel de Icaza <miguel@ximian.com>
11214 * expression.cs (BinaryMethod): This kind of expression is created by the
11215 Binary class if it determines that the operator has to be handled
11218 (BinaryDelegate): This kind of expression is created if we are
11219 dealing with a + or - operator on delegates.
11221 (Binary): remove method, argumetns, and DelegateOperator: when
11222 dealing with methods,
11224 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11226 * statement.cs (Block): use bitfields for the three extra booleans
11227 we had in use. Remove unused topblock parameter.
11229 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11231 * assign.cs: Drop extra unneeded tests.
11233 2003-08-06 Miguel de Icaza <miguel@ximian.com>
11235 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11237 * statement.cs (Foreach): Use VariableStorage instead of
11240 * codegen.cs (VariableStorage): New class used by clients that
11241 require a variable stored: locals or fields for variables that
11242 need to live across yield.
11244 Maybe provide a convenience api for EmitThis+EmitLoad?
11246 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11249 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11251 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11252 RemapParameterLValue): New methods that are used to turn a
11253 precomputed FieldInfo into an expression like this:
11257 The idea is to use this instead of making LocalVariableReference
11258 have more than one meaning.
11260 * cs-parser.jay: Add error production to BASE.
11262 * ecore.cs: Deal with TypeManager.GetField returning null, which
11263 is now a valid return value.
11265 (FieldExprNoAddress): New expression for Fields whose address can
11268 * expression.cs (LocalVariableReference): During the resolve
11269 phases, create new expressions if we are in a remapping context.
11270 Remove code that dealt with remapping here.
11272 (ParameterReference): same.
11274 (ProxyInstance): New expression, like the `This' expression, but
11275 it is born fully resolved. We know what we are doing, so remove
11276 the errors that are targeted to user-provided uses of `this'.
11278 * statement.cs (Foreach): our variable is now stored as an
11279 Expression; During resolution, follow the protocol, dont just
11280 assume it will return this.
11282 2003-08-06 Martin Baulig <martin@ximian.com>
11284 * support.cs (SeekableStreamReader.cs): New public class.
11286 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11287 SeekableStreamReader instead of the normal StreamReader.
11289 2003-08-04 Martin Baulig <martin@ximian.com>
11291 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11292 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11293 deambiguate casts and delegate invocations.
11294 (parenthesized_expression): Use the new tokens to ensure this is
11295 not a cast of method invocation.
11297 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11298 when reading a `)' and Deambiguate_CloseParens () was previously
11301 * expression.cs (ParenthesizedExpression): New class. This is
11302 just used for the CS0075 test.
11303 (Binary.DoResolve): Check for CS0075.
11305 2003-07-29 Ravi Pratap <ravi@ximian.com>
11307 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11308 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11309 reference comparison.
11311 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11312 examine the ReturnType for equality - this is necessary in the
11313 cases of implicit and explicit operators whose signature also
11314 includes the return type.
11316 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11318 * namespace.cs: Cache the result of the namespace computation,
11319 instead of computing it every time.
11321 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11323 * decl.cs: Use a global arraylist that we reuse over invocations
11324 to avoid excesive memory consumption. Reduces memory usage on an
11325 mcs compile by one meg (45 average).
11327 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11328 private, work around that.
11330 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11332 * literal.cs (IntLiteral): Define Zero and One static literals.
11334 * cs-parser.jay (integer_literal): use static literals to reduce
11335 memory usage for the most used literals (0, 1 and -1). 211kb
11336 reduced in memory usage.
11338 Replace all calls to `new ArrayList' with `new
11339 ArrayList(4)' which is a good average number for most allocations,
11340 and also requires only 16 bytes of memory for its buffer by
11343 This reduced MCS memory usage in seven megabytes for the RSS after
11346 2003-07-28 Ravi Pratap <ravi@ximian.com>
11348 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11349 handle params methods the correct way by forming only one
11350 applicable set with params and normal methods in them. Earlier we
11351 were looking at params methods only if we found no normal methods
11352 which was not the correct thing to do.
11354 (Invocation.BetterFunction): Take separate arguments indicating
11355 when candidate and the best method are params methods in their
11358 This fixes bugs #43367 and #46199.
11360 * attribute.cs: Documentation updates.
11362 (CheckAttribute): Rename to CheckAttributeTarget.
11363 (GetValidPlaces): Rename to GetValidTargets.
11365 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11366 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11370 2003-07-28 Miguel de Icaza <miguel@ximian.com>
11372 * codegen.cs: Compute IsGeneric correctly.
11374 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
11377 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
11378 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
11379 regressions, and I was chasing more bugs than I required.
11381 * interface.cs: Use expressions for base type names (like classes
11382 and structs have been doing for a while now), and resolve that.
11383 This patch should probably go into head as well.
11385 This makes it one less user of FindType.
11387 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11389 This compiler can not self host currently. Need to fix that.
11391 * Makefile: compile to `gmcs.exe'
11393 * driver.cs: Turn on v2 by default on gmcs.
11395 * generic.cs (ConstructedType): Does no longer take a container
11396 type argument; That will be taken care of later.
11398 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
11399 Use SimpleName to resolve for now, so we can continue the work on
11400 the parser, until we get Type.GetType that understands generics.
11402 (ConstructedType.ToString): Implement
11404 (TypeArguments.Resolve): Resolve the child expressions as types.
11406 * cs-parser.jay: Rename interface_constraints to
11407 type_parameter_constraints
11409 (namespace_or_type_name): Only use constructed types for the basic
11410 construction, we will deal with identifier<...> later.
11412 (type/type_name): No longer call DecomposeQI, as
11413 namespace_or_type_name is always decoded now.
11415 2003-07-22 Ravi Pratap <ravi@ximian.com>
11417 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11418 closely: we eliminate methods in base types when we have an
11419 applicable method in a top-level type.
11421 Please see section 14.5.5.1 for an exact description of what goes
11424 This fixes bug #45127 and a host of other related to corlib compilation.
11426 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11427 array is the method corresponding to the top-level type (this is
11428 because of the changes made to icall.c) so we change this
11431 (MethodGroupExpr.Name): This too.
11433 * typemanager.cs (GetElementType): New method which does the right
11434 thing when compiling corlib.
11436 * everywhere: Make use of the above in the relevant places.
11438 2003-07-22 Martin Baulig <martin@ximian.com>
11440 * cs-parser.jay (invocation_expression): Moved
11441 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11442 `cast_expression', but create a InvocationOrCast which later
11443 resolves to either an Invocation or a Cast.
11445 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11446 method; call this before EmitStatement() to make sure that this
11447 expression can be used as a statement.
11449 * expression.cs (InvocationOrCast): New class; resolves to either
11450 an Invocation or a Cast.
11452 * statement.cs (StatementExpression): Call ResolveStatement() on
11453 the ExpressionStatement before emitting it.
11455 2003-07-21 Martin Baulig <martin@ximian.com>
11457 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11458 `ref' and `out' attributes match; fixes #46220.
11459 (MemberAccess.ResolveMemberAccess): You can't reference a type
11460 through an expression; fixes #33180.
11461 (Indexers.GetIndexersForType): Don't return the indexers from
11462 interfaces the class implements; fixes #46502.
11464 2003-07-21 Martin Baulig <martin@ximian.com>
11466 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11467 CS0661 checks; fixes bug #30442.
11469 2003-07-21 Martin Baulig <martin@ximian.com>
11471 * decl.cs (AdditionResult): Added `Error'.
11473 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11475 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
11476 cs0031.cs actually work.
11478 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11480 * cs-parser.jay (namespace_name): do not use
11481 namespace_or_type_name, use qualified_identifier, because
11482 namespace_or_type_name will soon return a composed expression
11483 instead of a string.
11485 (namespace_or_type_name): Instead of returning a string, now this
11486 production returns an expression.
11488 * codegen.cs (EmitContext): Setup IsGeneric property based on
11489 whether our DeclSpace is generic, our the method is generic.
11491 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
11492 the method is generic.
11494 * cs-parser.jay (type_arguments, opt_type_argument_list,
11495 type_parameters, type_parameter_list, opt_type_parameter_list,
11496 type_parameter,, opt_type_parameter_constraints_clauses,
11497 type_parameter_constraints_clauses,
11498 type_parameter_constraint_clause, type_parameter_constraint,
11499 interface_constraints): Add new production
11501 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
11502 DeclSpace is generic or not.
11504 (DeclSpace.SetParameterInfo): New routine, used to set the
11505 parameter info for a type.
11507 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
11508 returns a GenericTypeExpr
11510 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
11511 generic, lookup the generic argument.
11513 * attribute.cs: Do not allow TypeParameterExpressions in
11516 * class.cs: Do not allow the Main method to be defined in a
11519 * expression.cs (SizeOf): Do not allow generic types to be used as
11520 arguments to sizeof.
11522 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
11523 it: whether a type is generic or not. Only works for types we are
11524 currently building for now.
11526 2003-07-20 Martin Baulig <martin@ximian.com>
11528 * namespace.cs: Fixed that bug which caused a crash when compiling
11529 the debugger's GUI.
11531 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11533 * typemanager.cs (LookupTypeReflection): Never expose types which
11534 are NotPublic, NestedPrivate, NestedAssembly, or
11535 NestedFamANDAssem. We used to return these, and later do a check
11536 that would report a meaningful error, but the problem is that we
11537 would not get the real match, if there was a name override.
11539 2003-07-18 Miguel de Icaza <miguel@ximian.com>
11541 * namespace.cs (Namespace, Name): Do not compute the namespace
11542 name dynamically, compute it in the constructor. This reduced
11543 memory usage by 1697 KB.
11545 * driver.cs: Use --pause to pause at the end.
11547 2003-07-17 Peter Williams <peter@newton.cx>
11549 * Makefile: Change the name of the test target so that it doesn't
11550 conflict with the recursive test target.
11552 2003-07-17 Miguel de Icaza <miguel@ximian.com>
11554 * expression.cs (LocalVariableReference.Emit, EmitAssign,
11555 AddressOf): Do not use EmitThis, that was wrong, use the actual
11558 2003-07-15 Miguel de Icaza <miguel@ximian.com>
11560 * class.cs (MethodData.Define): While checking if a method is an
11561 interface implementation, improve the test: If we are not public
11562 (use new test here: use the computed MethodAttributes directly,
11563 instead of the parsed modifier flags) check if the `implementing'
11564 method comes from an interface or not.
11566 * pending.cs (VerifyPendingMethods): Slightly better error
11569 * makefile: add test target that does the mcs bootstrap.
11571 2003-07-16 Ravi Pratap <ravi@ximian.com>
11573 * interface.cs (Define): Do nothing here since there are no
11574 members to populate etc. Move the attribute emission out of here
11575 since this was just totally the wrong place to put it. Attribute
11576 application happens during the 'Emit' phase, not in the 'Define'
11579 (Emit): Add this method and move the attribute emission here
11581 * rootcontext.cs (EmitCode): Call the Emit method on interface
11584 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11586 * expression.cs (OverloadResolve): Report error only if Location
11587 is not 'Null' which means that there was a probe going on.
11589 2003-07-14 Martin Baulig <martin@ximian.com>
11591 * expression.cs (ConditionalLogicalOperator): New public class to
11592 implement user defined conditional logical operators.
11593 This is section 14.11.2 in the spec and bug #40505.
11595 2003-07-14 Martin Baulig <martin@ximian.com>
11597 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11599 2003-07-14 Martin Baulig <martin@ximian.com>
11601 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11603 * ecore.cs (IVariable.VerifyFixed): New interface method.
11605 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11606 operator, check whether the variable is actually fixed. Fixes bug
11607 #36055. Set a variable definitely assigned when taking its
11608 address as required by the spec.
11610 * statement.cs (LocalInfo.IsFixed): New field.
11611 (LocalInfo.MakePinned): Set `IsFixed' to true.
11613 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11615 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11616 for .ctors, ensure that we only ask for members declared in the
11617 attribute type (BindingFlags.DeclaredOnly).
11621 * expression.cs (Error_WrongNumArguments): Report error 1501
11622 correctly the way CSC does.
11624 2003-07-13 Martin Baulig <martin@ximian.com>
11626 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11627 lookup on the fully qualified name, to make things like "X.X" work
11628 where "X.X" is a fully qualified type name, but we also have a
11629 namespace "X" in the using list. Fixes #41975.
11631 2003-07-13 Martin Baulig <martin@ximian.com>
11633 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11634 function. If we're a CompoundAssign, we need to create an embedded
11635 CompoundAssign, not an embedded Assign.
11636 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11639 2003-07-13 Martin Baulig <martin@ximian.com>
11641 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11642 work to fix bug #46088.
11644 2003-07-13 Ravi Pratap <ravi@ximian.com>
11646 * class.cs (Operator.Emit): Do not emit attributes here - it is
11647 taken care of by the Method class that we delegate too. This takes
11648 care of bug #45876.
11650 2003-07-10 Martin Baulig <martin@ximian.com>
11652 * expression.cs (TypeOfVoid): New class.
11653 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
11655 2003-07-10 Martin Baulig <martin@ximian.com>
11657 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11660 2003-07-10 Martin Baulig <martin@ximian.com>
11662 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11663 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11665 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11667 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11669 2003-07-10 Martin Baulig <martin@ximian.com>
11671 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11672 of decimal. Fixes #42850.
11674 NOTE: I also fixed the created byte blob, but this doesn't work on
11675 the MS runtime and csc never produces any byte blobs for decimal
11678 2003-07-10 Martin Baulig <martin@ximian.com>
11680 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11681 structs; fixes #32068.
11682 (Block.AddChildVariableNames): Fixed #44302.
11684 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11686 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11688 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11690 * attribute.cs: And this test is onger needed.
11692 2003-07-08 Martin Baulig <martin@ximian.com>
11694 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11695 inaccessible types. Fixes #36313.
11697 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11699 * namespace.cs (NamespaceEntry): Create implicit entries for all
11700 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11701 implicit entries for N1.N2 and N1.
11703 2003-07-08 Martin Baulig <martin@ximian.com>
11705 Rewrote the handling of namespaces to fix a lot of the issues
11706 wrt. `using' aliases etc.
11708 * namespace.cs (Namespace): Splitted this class into a
11709 per-assembly `Namespace' and a per-file `NamespaceEntry'.
11711 * typemanager.cs (TypeManager.IsNamespace): Removed.
11712 (TypeManager.ComputeNamespaces): Only compute namespaces from
11713 loaded assemblies here, not the namespaces from the assembly we're
11714 currently compiling.
11716 2003-07-08 Martin Baulig <martin@ximian.com>
11718 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11720 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11722 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11725 I thought about the memory savings here, but LookupTypeReflection
11726 is used under already very constrained scenarios. Compiling
11727 corlib or mcs only exposes one hit, so it would not really reduce
11728 any memory consumption.
11730 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11732 * typemanager.cs: fixes bug #45889 by only adding public types from
11733 other assemblies to the list of known types.
11735 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11737 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11738 on the type we resolved.
11740 2003-07-05 Martin Baulig <martin@ximian.com>
11742 * pending.cs (PendingImplementation.ParentImplements): Don't
11743 create the proxy if the parent is abstract.
11745 * class.cs (TypeContainer.DefineIndexers): Process explicit
11746 interface implementations first. Fixes #37714.
11748 2003-07-04 Miguel de Icaza <miguel@ximian.com>
11750 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11751 defined recursively; but since we modify the input parameters
11752 (left is set to `this' temporarily), we reset this value if the
11753 left_is_explicit is false, which gives the original semantics to
11756 * literal.cs (NullPointer): new class used to represent a null
11757 literal in a pointer context.
11759 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11760 type is a pointer, use a NullPointer object instead of a
11761 NullLiteral. Closes 43687
11763 (ExplicitConversion): Convert pointer values using
11764 the conv opcode to the proper type.
11766 * ecore.cs (New): change ValueTypeVariable property into a method,
11767 that returns whether the valuetype is suitable for being used.
11769 * expression.cs (Binary.DoNumericPromotions): Only return if we
11770 the int constant was a valid uint, and we can return both left and
11771 right as uints. If not, we continue processing, to trigger the
11772 type conversion. This fixes 39018.
11774 * statement.cs (Block.EmitMeta): During constant resolution, set
11775 the CurrentBlock property on the emitcontext, so that we resolve
11776 constants propertly.
11778 2003-07-02 Martin Baulig <martin@ximian.com>
11780 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11781 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11783 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11784 than emitting it here.
11786 * statement.cs: Fixed some more flow analysis bugs.
11788 2003-07-02 Martin Baulig <martin@ximian.com>
11790 * class.cs (MethodData.Define): When implementing interface
11791 methods, set Final unless we're Virtual.
11793 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11794 check work for interface methods.
11796 2003-07-01 Martin Baulig <martin@ximian.com>
11798 * ecore.cs (EmitContext.This): Replaced this property with a
11799 GetThis() method which takes a Location argument. This ensures
11800 that we get the correct error location for a CS0188.
11802 2003-07-01 Miguel de Icaza <miguel@ximian.com>
11804 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11805 ImplicitStandardConversion.
11807 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11809 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
11811 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11814 2003-06-30 Miguel de Icaza <miguel@ximian.com>
11816 * class.cs (Constructor.Define): Turn off initlocals for unsafe
11819 (MethodData.Define): Turn off initlocals for unsafe methods.
11821 2003-06-29 Miguel de Icaza <miguel@ximian.com>
11823 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11824 complete; Fixes #37521.
11826 * delegate.cs: Use Modifiers.TypeAttr to compute the
11827 TypeAttributes, instead of rolling our own. This makes the flags
11828 correct for the delegates.
11830 2003-06-28 Miguel de Icaza <miguel@ximian.com>
11832 * class.cs (Constructor.Define): Set the private flag for static
11833 constructors as well.
11835 * cs-parser.jay (statement_expression): Set the return value to
11836 null, to avoid a crash when we catch an error.
11838 2003-06-24 Miguel de Icaza <miguel@ximian.com>
11840 * cs-parser.jay: Applied patch from Jackson that adds support for
11841 extern and unsafe modifiers to destructor declarations.
11843 * expression.cs: Report error 21 if the user is trying to index a
11846 * driver.cs: Add an error message, suggested by the bug report.
11848 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11849 if we do not have a ": this ()" constructor initializer. Fixes 45149
11851 2003-06-14 Miguel de Icaza <miguel@ximian.com>
11853 * namespace.cs: Add some information to reduce FAQs.
11855 2003-06-13 Miguel de Icaza <miguel@ximian.com>
11857 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11858 underlying enumeration types. Fixes #43915.
11860 * expression.cs: Treat ushort/short as legal values to be used in
11861 bitwise operations.
11863 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11865 * delegate.cs: transfer custom attributes for paramenters from
11866 the delegate declaration to Invoke and BeginInvoke.
11868 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11870 * attribute.cs: handle custom marshalers and emit marshal info
11873 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
11875 * makefile.gnu: Added anonymous.cs to the compiler sources.
11877 2003-05-28 Miguel de Icaza <miguel@ximian.com>
11879 * iterators.cs: Change the name of the proxy class to include two
11882 * cs-parser.jay: Update grammar to include anonymous methods.
11884 * anonymous.cs: new file.
11886 2003-05-27 Miguel de Icaza <miguel@ximian.com>
11888 * class.cs (Field.Define): Add missing test for pointers and
11891 2003-05-27 Ravi Pratap <ravi@ximian.com>
11893 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11894 we use the stobj opcode.
11896 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11897 since it wasn't the correct fix.
11899 It still is puzzling that we are required to use stobj for IntPtr
11900 which seems to be a ValueType.
11902 2003-05-26 Miguel de Icaza <miguel@ximian.com>
11904 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11905 during regular simple name resolution. Now, the trick is that
11906 instead of returning for processing the simplename, we do a
11907 TypeManager.LookupType (ie, a rooted lookup as opposed to a
11908 contextual lookup type). If a match is found, return that, if
11909 not, return for further composition.
11911 This fixes long-standing 30485.
11913 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11914 using the address to initialize an object, do an Stobj instead of
11915 using the regular Stelem.
11917 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11918 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11919 Because if we are a BaseIndexerAccess that value will be true.
11922 * statement.cs (GotoCase.Resolve): Return after reporting an
11923 error, do not attempt to continue.
11925 * expression.cs (PointerArithmetic.Emit): If our operand is a
11926 long, convert our constants to match the operand before
11927 multiplying. Convert to I type before adding. Fixes 43670.
11929 2003-05-14 Ravi Pratap <ravi@ximian.com>
11931 * enum.cs (ImplicitConversionExists) : Rename to
11932 ImplicitEnumConversionExists to remove ambiguity.
11934 * ecore.cs (NullCast): New type of cast expression class which
11935 basically is very similar to EmptyCast with the difference being
11936 it still is a constant since it is used only to cast a null to
11938 (eg. (string) null)
11940 * convert.cs (ImplicitReferenceConversion): When casting a null
11941 literal, we return a NullCast.
11943 * literal.cs (NullLiteralTyped): Remove - I don't see why this
11944 should be around anymore.
11946 The renaming (reported was slightly wrong). Corrections:
11948 ConvertImplicitStandard -> ImplicitConversionStandard
11949 ConvertExplicitStandard -> ExplicitConversionStandard
11951 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11952 before passing them in !
11954 * convert.cs (ImplicitConversionStandard): When comparing for
11955 equal expr and target types, ensure that expr is not a
11958 In general, we must not be checking (expr_type ==
11959 target_type) in the top level conversion methods
11960 (ImplicitConversion, ExplicitConversion etc). This checking is
11961 done in the methods that they delegate to.
11963 2003-05-20 Miguel de Icaza <miguel@ximian.com>
11965 * convert.cs: Move Error_CannotConvertType,
11966 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11967 ImplicitNumericConversion, ImplicitConversionExists,
11968 ImplicitUserConversionExists, StandardConversionExists,
11969 FindMostEncompassedType, FindMostSpecificSource,
11970 FindMostSpecificTarget, ImplicitUserConversion,
11971 ExplicitUserConversion, GetConversionOperators,
11972 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11973 TryImplicitIntConversion, Error_CannotConvertImplicit,
11974 ConvertImplicitRequired, ConvertNumericExplicit,
11975 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11976 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11979 Perform the following renames:
11981 StandardConversionExists -> ImplicitStandardConversionExists
11982 ConvertImplicit -> ImplicitConversion
11983 ConvertImplicitStandard -> ImplicitStandardConversion
11984 TryImplicitIntConversion -> ImplicitIntConversion
11985 ConvertImplicitRequired -> ImplicitConversionRequired
11986 ConvertNumericExplicit -> ExplicitNumericConversion
11987 ConvertReferenceExplicit -> ExplicitReferenceConversion
11988 ConvertExplicit -> ExplicitConversion
11989 ConvertExplicitStandard -> ExplicitStandardConversion
11991 2003-05-19 Martin Baulig <martin@ximian.com>
11993 * statement.cs (TypeInfo.StructInfo): Made this type protected.
11994 (TypeInfo): Added support for structs having structs as fields.
11996 * ecore.cs (FieldExpr): Implement IVariable.
11997 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11998 VariableInfo for the field.
12000 2003-05-18 Martin Baulig <martin@ximian.com>
12002 * expression.cs (This.DoResolve): Report a CS0027 if we're
12003 emitting a field initializer.
12005 2003-05-18 Martin Baulig <martin@ximian.com>
12007 * expression.cs (This.ResolveBase): New public function.
12008 (This.DoResolve): Check for CS0188.
12010 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12013 * ecore.cs (MethodGroupExpr.DoResolve): Set the
12014 `instance_expression' to null if we don't have any non-static
12017 2003-05-18 Martin Baulig <martin@ximian.com>
12019 Reworked the way how local variables and parameters are handled by
12020 the flow analysis code.
12022 * statement.cs (TypeInfo, VariableMap): New public classes.
12023 (VariableInfo): New public class. This is now responsible for
12024 checking whether a variable has been assigned. It is used for
12025 parameters and local variables.
12026 (Block.EmitMeta): Take the InternalParameters as argument; compute
12027 the layout of the flow vectors here.
12028 (Block.LocalMap, Block.ParameterMap): New public properties.
12029 (FlowBranching): The .ctor doesn't get the InternalParameters
12030 anymore since Block.EmitMeta() now computes the layout of the flow
12032 (MyStructInfo): This class is now known as `StructInfo' and nested
12033 in `TypeInfo'; we don't access this directly anymore.
12035 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12036 property and removed IsAssigned(), IsFieldAssigned(),
12037 SetAssigned() and SetFieldAssigned(); we now call them on the
12038 VariableInfo so we don't need to duplicate this code everywhere.
12040 * expression.cs (ParameterReference): Added `Block block' argument
12042 (LocalVariableReference, ParameterReference, This): The new
12043 VariableInfo class is now responsible for all the definite
12046 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12047 IsParameterAssigned, SetParameterAssigned): Removed.
12049 2003-05-18 Martin Baulig <martin@ximian.com>
12051 * typemanager.cs (InitCoreTypes): Try calling
12052 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12053 the 3-args-version. Corlib now also needs our `void_type'.
12054 (GetMethod): Added overloaded version which takes an optional
12055 `bool report_errors' to allow lookups of optional methods.
12057 2003-05-12 Martin Baulig <martin@ximian.com>
12059 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12060 only used for locals and not for parameters.
12062 2003-05-12 Miguel de Icaza <miguel@ximian.com>
12064 * support.cs (InternalParameters.ParameterType): Return the
12065 ExternalType of the parameter.
12067 * parameter.cs (Parameter.ExternalType): drop the two arguments,
12070 2003-05-11 Miguel de Icaza <miguel@ximian.com>
12072 * class.cs (MethodData.Define): Do not set the `newslot' on
12073 interface members, if they are also flagged as "override".
12075 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12076 better code for ++i and i++. This only works for static fields
12077 and local variables.
12079 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12080 want to pull the DeclSpace out of the builder_to_declspace instead
12081 of the TypeBuilder (like in TypeContainer.FindMembers).
12083 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12084 instead of LookupTypeContainer. Fixes the crash on .NET for
12085 looking up interface members.
12087 * const.cs: Create our own emit context during the Definition
12088 stage, so that constants are evaluated in the proper context, when
12089 a recursive definition happens.
12091 2003-05-11 Martin Baulig <martin@ximian.com>
12093 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
12094 new block for a switch section.
12095 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12096 the adding/lookup in the switch block. Fixes #39828.
12098 2003-05-09 Miguel de Icaza <miguel@ximian.com>
12100 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12101 functionality: I needed to convert the data after I had performed
12102 the add/sub operation into the operands type size.
12104 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12105 pass the type for the box operation, otherwise the resulting
12106 object would have been of type object.
12108 (BoxedCast): Add constructor to specify the type to box as.
12110 2003-05-07 Miguel de Icaza <miguel@ximian.com>
12112 * iterators.cs: I was reusing the `count' variable inadvertently,
12113 take steps to not allow this to happen.
12115 2003-05-06 Miguel de Icaza <miguel@ximian.com>
12117 * attribute.cs (Attribute.Resolve): Params attributes are encoded
12118 by creating an array at the point where the params starts and
12119 putting all those arguments there, then adjusting the size of the
12122 2003-05-05 Miguel de Icaza <miguel@ximian.com>
12124 * expression.cs (New.AddressOf): Implement interface
12125 IMemoryLocation. This is used when the `new' operator is used in
12126 the context of an invocation to a method on a value type.
12128 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12131 * namespace.cs: Also check the using aliases here.
12133 * driver.cs: Move the test for using validity after the types have
12134 been entered, so we do a single pass that also includes the using
12137 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12138 in the regular case. CreateSiblingForFinally is doing extra
12141 * attribute.cs (GetAttributeArgumentExpression): Store the result
12142 on an out value, and use the return value to indicate failure
12143 instead of using null (which is a valid return for Constant.GetValue).
12145 * statement.cs: Perform the analysis flow for the increment
12146 portion after the statement, because this will be the real flow of
12147 execution. Fixes #42385
12149 * codegen.cs (EmitContext.EmitArgument,
12150 EmitContext.EmitStoreArgument): New helper functions when the
12151 RemapToProxy flag is set.
12153 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12156 Add support for remapping parameters.
12158 * iterators.cs: Propagate parameter values; Store parameter
12159 values in the proxy classes.
12161 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12163 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12164 need a proxy reference; I do not know what I was thinking
12166 * cs-parser.jay (constructor_initializer): catch another error,
12167 and display nice message.
12169 (field_declaration): catch void field declaration
12170 to flag a better error.
12172 * class.cs (MemberBase.CheckBase): Report an error instead of a
12173 warning if a new protected member is declared in a struct.
12174 (Field.Define): catch the error of readonly/volatile.
12176 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12178 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12179 volatile variable is taken
12181 2003-05-02 Miguel de Icaza <miguel@ximian.com>
12183 * statement.cs (Fixed.Resolve): Report an error if we are not in
12186 2003-05-01 Miguel de Icaza <miguel@ximian.com>
12188 * typemanager.cs: reuse the code that handles type clashes for
12189 delegates and enumerations.
12191 * class.cs (Report28): Always report.
12193 * expression.cs (EncodeAsAttribute): Allow nulls here.
12195 2003-04-28 Miguel de Icaza <miguel@ximian.com>
12197 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12198 the functionality for testing whether an expression is valid for
12199 an attribute here. Also handle the case of arrays of elements
12202 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12203 encoding a linear array into an array of objects that are suitable
12204 to be passed to an CustomAttributeBuilder.
12206 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12208 * ecore.cs: (FieldExpr): Handle field remapping here.
12210 * iteratators.cs: Pass the instance variable (if the method is an
12211 instance method) to the constructors, so we can access the field
12212 variables on the class.
12214 TODO: Test this with structs. I think the THIS variable on
12215 structs might have to be a pointer, and not a refenrece
12217 2003-04-27 Miguel de Icaza <miguel@ximian.com>
12219 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12220 local variables to fields in a proxy class.
12222 * iterators.cs (PopulateProxy): Rename our internal fields to
12224 Create a <THIS> field if we are an instance method, so we can
12225 reference our parent container variables.
12226 (MapVariable): Called back from the EmitContext code to enter a
12227 new variable to field mapping into the proxy class (we just create
12231 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12232 for using the remapped locals to fields.
12234 I placed the code here, because that gives the same semantics to
12235 local variables, and only changes the Emit code.
12237 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12238 statements inside iterators.
12239 (VariableInfo): Add a FieldBuilder for the cases when we are
12240 remapping local variables to fields in a proxy class
12242 * ecore.cs (SimpleNameResolve): Avoid testing two times for
12243 current_block != null.
12245 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12246 not cope with strings, as it has been moved to the
12247 TableSwitchEmit. Fixed bug in switch generation.
12249 * expression.cs (New.DoResolve): Provide more context for the user
12250 when reporting an error.
12252 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12255 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12256 check the permissions for it. Note than in a type-resolution
12257 context the check was already present in DeclSpace.ResolveType,
12258 but was missing from the MemberAccess.
12260 (ArrayCreation.CheckIndices): warn if the user has
12261 more nested levels of expressions, but there are no more
12262 dimensions specified. Avoids crash on bug 41906.
12264 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12266 * statement.cs (Block): replace Implicit bool, for a generic
12268 New flag: `Unchecked'. This is used during the EmitMeta phase
12269 (which is out-of-line with the regular Resolve/Emit process for a
12270 statement, as this is done ahead of time, but still gets a chance
12271 to call constant resolve).
12273 (Block.Flags): new enum for adding a new flag.
12275 (Block.EmitMeta): track the state of unchecked.
12277 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12278 to enable constant resolution to work there as well.
12280 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12282 * typemanager.cs (ienumerable_type): Also look up
12283 System.Collections.IEnumerable.
12285 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12287 TODO: Test more than one conditional per method.
12289 * class.cs (Indexer.Define): Report the location where the user is
12290 referencing the unsupported feature.
12292 (MethodData): Overload the use of `conditionals' to
12293 minimize the creation of needless ArrayLists. This saves roughly
12294 212kb on my machine.
12296 (Method): Implement the new IIteratorContainer interface.
12297 (Method.SetYields): Implement the method by setting the ModFlags
12298 to contain METHOD_YIELDS.
12300 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12301 which just got set to null.
12303 * iterators.cs: New file.
12305 (Yield, YieldBreak): New statements.
12307 * statement.cs (Return.Resolve): Flag an error if we are used in
12308 an iterator method.
12310 * codegen.cs (InIterator): New flag set if the code is being
12311 compiled in an iterator method.
12313 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12314 internal modifier, and we just use it to avoid adding extra
12315 fields, as this is seldom used.
12317 * cs-parser.jay: Add yield_statement (yield and yield break).
12319 * driver.cs: New flag -v2 to turn on version 2 features.
12321 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12322 hashtable when v2 is enabled.
12324 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12326 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12327 there is already a namespace defined with this name.
12329 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12330 people upgraded their corlibs.
12332 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12333 always use fully qualified types, no need to use the compiler
12336 (TypeManager.IsNamespace): Use binarysearch.
12338 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12339 AddDelegate): I did not quite use the new IsValid API properly: I
12340 have to pass the short-name and the fullname. I was passing only
12341 the basename instead of the fullname sometimes.
12343 (TypeContainer.DefineType): call NamespaceClash.
12345 * interface.cs (Interface.DefineType): use NamespaceClash before
12348 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12351 * enum.cs: (Enum.DefineType): use NamespaceClash before
12354 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12355 speed increase. First, use the negative_hits cache when we get a
12356 negative. Second, add the type with its full original name
12357 instead of the new . and + encoded name (reflection uses + to
12358 separate type from a nested type). Use LookupTypeReflection
12359 directly which bypasses the type->name hashtable (that we already
12360 know does not contain the type.
12362 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12363 location/container type.
12365 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12367 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12369 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12371 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12372 method is being referenced in the method group from a static
12373 context, and report error 120 if so.
12375 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12378 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12379 is created, we create the A namespace).
12381 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12384 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12386 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12387 invocation to ModuleBuilder.GetType with the same values will
12388 return a new type instance, so we need to cache its return
12391 * expression.cs (Binary.ResolveOperator): Only allow the compare
12392 operators on enums if they are of the same type.
12394 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12395 types of ValueType on their own case. Before we were giving them
12396 the same treatment as objects.
12398 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12399 fullname. Short name is used to compare against container name.
12400 Fullname is used to check against defined namespace names.
12402 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12403 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12405 (Method.CheckBase): Call parent.
12406 (MemberBase.CheckBase): Check for protected members on sealed
12408 (PropertyBase.CheckBase): Call parent.
12409 (Field.Define): Call parent.
12411 * report.cs: Negative error codes are now mapped to 8000 - code,
12412 so that the display is render more nicely.
12414 * typemanager.cs: Do not use try/catch, instead report a regular
12417 (GetPointerType, GetReferenceType): These methods provide
12418 mechanisms to obtain the T* and T& from a T. We had the code
12419 previously scattered around the code base, and it also used
12420 TypeManager.LookupType that would go through plenty of caches.
12421 This one goes directly to the type source.
12423 In some places we did the Type.GetType followed by
12424 ModuleBuilder.GetType, but not in others, so this unifies the
12425 processing as well.
12427 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12428 statements now that we have namespace information.
12430 * typemanager.cs (IsNamespace): New method, returns whether the
12431 string presented is a namespace or not.
12433 (ComputeNamespaces): New public entry point, computes the list of
12434 available namespaces, using the GetNamespaces API call in Mono, or
12435 the slower version in MS.NET.
12437 Now before we start the semantic analysis phase, we have a
12438 complete list of namespaces including everything that the user has
12441 Deleted old code to cache namespaces in .nsc files.
12443 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12445 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12446 class/struct location definition Location for the implicit
12447 constructor location.
12449 (Operator.Define): Use the location of the operator for the
12450 implicit Method definition.
12452 (Constructor.Emit): use the constructor location for the implicit
12453 base initializer constructor.
12455 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12456 and the Expression class now contains two new methods:
12458 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12459 isolate type lookup from the rest of the resolution process.
12461 Since we use Expressions to hold type definitions due to the way
12462 we parse the input we have historically overloaded Resolve to
12463 perform the Type lookups if a special flag is passed. Now this is
12464 eliminated and two methods take their place.
12466 The differences in the two methods between xStep and xTerminal is
12467 that xStep is involved in our current lookup system that uses
12468 SimpleNames to compose a name, while xTerminal is used just to
12469 catch the case where the simplename lookup failed.
12471 2003-04-16 Miguel de Icaza <miguel@ximian.com>
12473 * expression.cs (ResolveMemberAccess): Remove redundant code.
12474 TypeExpr expressions are always born fully resolved.
12476 * interface.cs (PopulateMethod): Do not lookup the types twice.
12477 We were doing it once during SemanticAnalysis and once during
12480 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12481 in local variable type definitions, were being returned as a
12482 SimpleName (we decomposed everything into a string), that is
12483 because primary_expression was being used instead of a type in the
12484 grammar (reduce/reduce conflicts).
12486 The part that was wrong is that we converted the expression into a
12487 string (an oversimplification in one hand, compounded with primary
12488 expressions doing string concatenation).
12494 Would return "A.B.C[]" as a SimpleName. This stopped things like
12495 using clauses from working on this particular context. And a type
12496 was being matched directly against "A.B.C[]".
12498 We now use the correct approach, and allow for ComposedCast to be
12499 part of the unary expression. So the "A.B.C []" become a composed
12500 cast of "A.B.C" (as a nested group of MemberAccess with a
12501 SimpleName at the end) plus the rank composition "[]".
12505 2003-04-10 Miguel de Icaza <miguel@ximian.com>
12507 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12508 for the access level checking.
12510 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
12511 `TypeContainer container', because I kept getting confused when I
12512 was debugging this code.
12514 * expression.cs (Indexers): Instead of tracking getters/setters,
12515 we now track them in parallel. We create one arraylist less, but
12516 most importantly it is possible now for the LValue code to find a
12517 matching get for a set.
12519 (IndexerAccess.DoResolveLValue): Update the code.
12520 GetIndexersForType has been modified already to extract all the
12521 indexers from a type. The code assumed it did not.
12523 Also make the code set the correct return type for the indexer.
12524 This was fixed a long time ago for properties, but was missing for
12525 indexers. It used to be void_type.
12527 (Binary.Emit): Test first for doubles instead of
12528 floats, as they are more common.
12530 (Binary.EmitBranchable): Use the .un version of the branch opcodes
12531 when dealing with floats and the <=, >= operators. This fixes bug
12534 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12535 to load the array value by emitting a load on the foreach variable
12536 type. This was incorrect.
12538 We now emit the code to load an element using the the array
12539 variable type, and then we emit the conversion operator.
12543 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
12545 * attribute.cs: Avoid allocation of ArrayLists in the common case.
12547 2003-04-09 Miguel de Icaza <miguel@ximian.com>
12549 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12550 test for protection before we test for signatures.
12552 (MethodSignature.ToString): implement.
12554 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12555 to the case where we reduced into a LongConstant.
12557 * decl.cs (CheckAccessLevel): If the type is an array, we can not
12558 depend on whether the information is acurrate, because the
12559 Microsoft runtime will always claim that the array type is public,
12560 regardless of the real state.
12562 If the type is a pointer, another problem happens: the type is
12563 reported as non-public in Microsoft.
12565 In both cases we have to call CheckAccessLevel recursively with
12566 the underlying type as the argument to be tested.
12568 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12570 * assign.cs (Assign.Emit): If we are dealing with a compound
12571 assignment expression, we should use the code path that stores the
12572 intermediate result in a temporary value. This fixes #40903.
12574 *expression.cs (Indirection.ToString): Provide ToString method for
12577 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12579 * class.cs: Null out fields holding references to Block objects so
12580 they can be garbage collected.
12582 * expression.cs (OverloadResolve): Remove unused local.
12584 2003-04-07 Martin Baulig <martin@ximian.com>
12586 * codegen.cs (EmitContext.CurrentFile): New public field.
12587 (EmitContext.Mark): Use the CurrentFile to check whether the
12588 location is in the correct file.
12589 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12591 2003-04-07 Martin Baulig <martin@ximian.com>
12593 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12595 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12596 location. [FIXME: The location argument which gets passed to this
12597 method is sometimes wrong!]
12599 2003-04-07 Nick Drochak <ndrochak@gol.com>
12601 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12603 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12605 * expression.cs (Indirection.EmitAssign): We were using the
12606 temporary, but returning immediately instead of continuing the
12609 2003-04-06 Martin Baulig <martin@ximian.com>
12611 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12612 if it's a nested child, but also deriving from the outer class.
12615 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12616 nested child, but also deriving from the outer class. See
12618 (FilterWithClosure): We may access private members of the outer
12619 class if we're a nested child and deriving from the outer class.
12620 (RealMemberLookup): Only set `closure_private_ok' if the
12621 `original_bf' contained BindingFlags.NonPublic.
12623 2003-04-05 Martin Baulig <martin@ximian.com>
12625 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
12626 probe if its a type parameter, and if so, flag an error.
12628 * decl.cs: Move here the SetParameterInfo code from class.cs.
12629 Handle IsGeneric here.
12631 Handle a variety of errors in the parameter info definition.
12633 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
12634 type parameters here.
12636 * cs-parser.jay (class_declaration): report errors for parameters
12639 2003-01-21 Miguel de Icaza <miguel@ximian.com>
12641 * generic.cs: New file, contains support code for generics.
12643 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
12644 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
12646 Update parser for the above removals.
12648 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
12649 now taken care of in the parser.
12651 2003-04-02 Miguel de Icaza <miguel@ximian.com>
12653 * class.cs (Event.Define): Do not allow abstract events to have
12656 2003-04-01 Miguel de Icaza <miguel@ximian.com>
12658 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12659 block in event declarations.
12661 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12662 value type, get its address.
12664 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12665 leaving a class on the stack instead of a boolean value (int
12666 0/1). Change the code so we compare against null, and then the
12667 result against zero.
12669 * class.cs (TypeContainer.GetClassBases): We were checking for the
12670 parent class being sealed too late.
12672 * expression.cs (Binary.Emit): For <= and >= when dealing with
12673 floating point values, use cgt.un and clt.un instead of cgt and
12676 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
12678 * statement.cs: Apply the same optimization as MS: skip the
12679 GetEnumerator returning an IEnumerator, and use the one returning a
12680 CharEnumerator instead. This allows us to avoid the try-finally block
12683 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
12685 * cs-parser.jay: Attributes cannot be applied to
12686 namespaces. Fixes #40473
12688 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12691 (Add*): check if the name is valid using the full name for constants,
12692 fields, properties and events.
12694 2003-03-28 Miguel de Icaza <miguel@ximian.com>
12696 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12697 char constants to be part of the enumeration.
12699 * expression.cs (Conditional.DoResolve): Add support for operator
12700 true. Implements the missing functionality from 14.12
12702 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12703 operator true/false as required by the spec.
12705 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12706 implicit conversion to boolean.
12708 * statement.cs (Statement.ResolveBoolean): A boolean expression is
12709 also one where the type implements `operator true'.
12711 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12712 get an expression that will invoke operator true based on an
12715 (GetConversionOperators): Removed the hack that called op_True
12718 (Expression.ResolveBoolean): Move this from Statement.
12720 2003-03-17 Miguel de Icaza <miguel@ximian.com>
12722 * ecore.cs (FieldExpr): do not allow initialization of initonly
12723 fields on derived classes
12725 2003-03-13 Martin Baulig <martin@ximian.com>
12727 * statement.cs (Block.Emit): Call ig.BeginScope() and
12728 ig.EndScope() when compiling with debugging info; call
12729 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12731 2003-03-08 Miguel de Icaza <miguel@ximian.com>
12733 * expression.cs (Indexers): Do not construct immediately, allow
12734 for new members to be appended as we go. Fixes 38143
12736 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12738 * expression.cs: save/restore context when resolving an unchecked
12741 2003-03-05 Miguel de Icaza <miguel@ximian.com>
12743 * cfold.cs: Catch division by zero in modulus operator during
12746 2003-03-03 Miguel de Icaza <miguel@ximian.com>
12748 * interface.cs (Interface.DefineMembers): Avoid defining members
12751 2003-02-27 Miguel de Icaza <miguel@ximian.com>
12753 * driver.cs: handle the +/- options for -noconfig
12755 * statement.cs (Unckeched.Resolve): Also track the state of
12756 unchecked in the Resolve phase.
12758 2003-02-27 Martin Baulig <martin@ximian.com>
12760 * ecore.cs (Expression.MemberLookup): Don't create a
12761 MethodGroupExpr for something which is not a method. Fixes #38291.
12763 2003-02-25 Miguel de Icaza <miguel@ximian.com>
12765 * class.cs (MemberBase.CheckParameters): Also check that the type
12766 is unmanaged if it is a pointer.
12768 * expression.cs (SizeOf.Resolve): Add location information.
12770 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12771 a managed type is declared.
12773 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12774 parameter modifiers as well. Fixes bug 38606
12776 * class.cs: Very sad. Am backing out the speed up changes
12777 introduced by the ArrayList -> Array in the TypeContainer, as they
12778 were not actually that much faster, and introduced a bug (no error
12779 reports on duplicated methods).
12781 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12782 source first, this will guarantee that we have a valid expression
12783 before calling in lower levels functions that will require a
12784 resolved object. Then use this original_source in the
12785 target.ResolveLValue instead of the original source that was
12788 Another change. Use target.Resolve instead of LValueResolve.
12789 Although we are resolving for LValues, we will let the Assign code
12790 take care of that (it will be called again from Resolve). This
12791 basically allows code like this:
12793 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12794 class Y { void A (X x) { x [0] += o; }
12796 The problem was that the indexer was trying to resolve for
12797 set_Item (idx, object o) and never finding one. The real set_Item
12798 was set_Item (idx, X). By delaying the process we get the right
12803 2003-02-23 Martin Baulig <martin@ximian.com>
12805 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12806 while calling DoEmit ().
12808 * codegen.cs (EmitContext.Mark): Don't mark locations in other
12809 source files; if you use the #line directive inside a method, the
12810 compiler stops emitting line numbers for the debugger until it
12811 reaches the end of the method or another #line directive which
12812 restores the original file.
12814 2003-02-23 Martin Baulig <martin@ximian.com>
12816 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12818 2003-02-23 Martin Baulig <martin@ximian.com>
12820 * statement.cs (Block.AddChildVariableNames): We need to call this
12821 recursively, not just for our immediate children.
12823 2003-02-23 Martin Baulig <martin@ximian.com>
12825 * class.cs (Event.Define): Always make the field private, like csc does.
12827 * typemanager.cs (TypeManager.RealMemberLookup): Make events
12828 actually work, fixes bug #37521.
12830 2003-02-23 Miguel de Icaza <miguel@ximian.com>
12832 * delegate.cs: When creating the various temporary "Parameters"
12833 classes, make sure that we call the ComputeAndDefineParameterTypes
12834 on those new parameters (just like we do with the formal ones), to
12835 allow them to be resolved in the context of the DeclSpace.
12837 This fixes the bug that Dick observed in Bugzilla #38530.
12839 2003-02-22 Miguel de Icaza <miguel@ximian.com>
12841 * expression.cs (ResolveMemberAccess): When resolving a constant,
12842 do not attempt to pull a constant if the value was not able to
12843 generate a valid constant.
12845 * const.cs (LookupConstantValue): Do not report more errors than required.
12847 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12849 * expression.cs: fixes bug #38328.
12851 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12853 * class.cs: Changed all the various members that can be part of a
12854 class from being an ArrayList to be an Array of the right type.
12855 During the DefineType type_list, interface_list, delegate_list and
12856 enum_list are turned into types, interfaces, delegates and enums
12859 And during the member population, indexer_list, event_list,
12860 constant_list, field_list, instance_constructor_list, method_list,
12861 operator_list and property_list are turned into their real arrays.
12863 Although we could probably perform this operation earlier, for
12864 good error reporting we need to keep the lists and remove the
12865 lists for longer than required.
12867 This optimization was triggered by Paolo profiling the compiler
12868 speed on the output of `gen-sample-program.pl' perl script.
12870 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12871 not crash in methods like MemberLookupFailed that use this field.
12873 This problem arises when the compiler fails to resolve a type
12874 during interface type definition for example.
12876 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12878 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12879 inherit from System.Object, so we have to stop at null, not only
12880 when reaching System.Object.
12882 2003-02-17 Miguel de Icaza <miguel@ximian.com>
12884 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12885 DeclaredOnly because the parent indexer might have had a different
12886 name, but did not loop until the top of the hierarchy was reached.
12888 The problem this one fixes is 35492: when a class implemented an
12889 indexer from an interface, we were getting the interface method
12890 (which was abstract) and we were flagging an error (can not invoke
12893 This also keeps bug 33089 functioning, and test-148 functioning.
12895 * typemanager.cs (IsSpecialMethod): The correct way of figuring
12896 out if a method is special is to see if it is declared in a
12897 property or event, or whether it is one of the predefined operator
12898 names. This should fix correctly #36804.
12900 2003-02-15 Miguel de Icaza <miguel@ximian.com>
12902 The goal here is to remove the dependency on EmptyCast.Peel ().
12903 Killing it completely.
12905 The problem is that currently in a number of places where
12906 constants are expected, we have to "probe" for an EmptyCast, and
12907 Peel, which is not the correct thing to do, as this will be
12908 repetitive and will likely lead to errors.
12910 The idea is to remove any EmptyCasts that are used in casts that
12911 can be reduced to constants, so we only have to cope with
12914 This bug hunt was triggered by Bug 37363 and the desire to remove
12915 the duplicate pattern where we were "peeling" emptycasts to check
12916 whether they were constants. Now constants will always be
12919 * ecore.cs: Use an enumconstant here instead of wrapping with
12922 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12923 throwing me off. By handling this we can get rid of a few hacks.
12925 * statement.cs (Switch): Removed Peel() code.
12927 2003-02-14 Miguel de Icaza <miguel@ximian.com>
12929 * class.cs: Location information for error 508
12931 * expression.cs (New.DoResolve): Add a guard against double
12932 resolution of an expression.
12934 The New DoResolve might be called twice when initializing field
12935 expressions (see EmitFieldInitializers, the call to
12936 GetInitializerExpression will perform a resolve on the expression,
12937 and later the assign will trigger another resolution
12939 This leads to bugs (#37014)
12941 * delegate.cs: The signature for EndInvoke should contain any ref
12942 or out parameters as well. We were not doing this in the past.
12944 * class.cs (Field.Define): Do not overwrite the type definition
12945 inside the `volatile' group. Turns out that volatile enumerations
12946 were changing the type here to perform a validity test, which
12949 2003-02-12 Miguel de Icaza <miguel@ximian.com>
12951 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12952 and structs, we do not want to load the instance variable
12954 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12955 enum_type has to be handled like an object reference (implicit
12956 conversions exists from this to object), but the regular IsClass
12957 and IsValueType tests will never return true for this one.
12959 Also we use TypeManager.IsValueType instead of type.IsValueType,
12960 just for consistency with the rest of the code (this is only
12961 needed if we ever use the construct exposed by test-180.cs inside
12962 corlib, which we dont today).
12964 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
12966 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12969 2003-02-09 Martin Baulig <martin@ximian.com>
12971 * namespace.cs (Namespace..ctor): Added SourceFile argument.
12972 (Namespace.DefineNamespaces): New static public method; this is
12973 called when we're compiling with debugging to add all namespaces
12974 to the symbol file.
12976 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12977 pass it to the Namespace's .ctor.
12979 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12980 and MethodBase arguments; pass the namespace ID to the symwriter;
12981 pass the MethodBase instead of the token to the symwriter.
12982 (SymbolWriter.DefineNamespace): New method to add a namespace to
12985 2003-02-09 Martin Baulig <martin@ximian.com>
12987 * symbolwriter.cs: New file. This is a wrapper around
12988 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
12989 methods here in near future.
12991 2003-02-09 Martin Baulig <martin@ximian.com>
12993 * codegen.cs (EmitContext.Mark): Just pass the arguments to
12994 ILGenerator.MarkSequencePoint() which are actually used by the
12997 2003-02-09 Martin Baulig <martin@ximian.com>
12999 * location.cs (SourceFile): New public sealed class. This
13000 contains the name and an index which is used in the location's token.
13001 (Location): Reserve an appropriate number of bits in the token for
13002 the source file instead of walking over that list, this gives us a
13003 really huge performance improvement when compiling with debugging.
13005 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13006 `SourceFile' argument instead of a string.
13007 (Driver.ProcessFile): Add all the files via Location.AddFile(),
13008 but don't parse/tokenize here, we need to generate the list of all
13009 source files before we do that.
13010 (Driver.ProcessFiles): New static function. Parses/tokenizes all
13013 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13014 instead of a string.
13016 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13019 2003-02-09 Martin Baulig <martin@ximian.com>
13021 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13022 filename on `#line default'.
13024 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13026 * statement.cs: don't clear the pinned var when the fixed statement
13027 returns from the method (fixes bug#37752).
13029 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13031 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
13034 2003-02-07 Martin Baulig <martin@ximian.com>
13036 * driver.cs: Removed the `--debug-args' command line argument.
13038 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13039 automatically by the AsssemblyBuilder.
13040 (CodeGen.InitializeSymbolWriter): We don't need to call any
13041 initialization function on the symbol writer anymore. This method
13042 doesn't take any arguments.
13044 2003-02-03 Miguel de Icaza <miguel@ximian.com>
13046 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13047 from referenced assemblies as well.
13049 2003-02-02 Martin Baulig <martin@ximian.com>
13051 * class.cs (MethodData.Emit): Generate debugging info for external methods.
13053 2003-02-02 Martin Baulig <martin@ximian.com>
13055 * class.cs (Constructor.Emit): Open the symbol writer before
13056 emitting the constructor initializer.
13057 (ConstructorInitializer.Emit): Call ec.Mark() to allow
13058 single-stepping through constructor initializers.
13060 2003-01-30 Miguel de Icaza <miguel@ximian.com>
13062 * class.cs: Handle error 549: do not allow virtual methods in
13065 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13067 * decl.cs: Check access levels when resolving types
13069 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13071 * statement.cs: Add parameters and locals set in catch blocks that might
13072 return to set vector
13074 2003-01-29 Miguel de Icaza <miguel@ximian.com>
13076 * class.cs (Operator): Set the SpecialName flags for operators.
13078 * expression.cs (Invocation.DoResolve): Only block calls to
13079 accessors and operators on SpecialName methods.
13081 (Cast.TryReduce): Handle conversions from char constants.
13084 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13086 * statement.cs: small memory and time optimization in FlowBranching.
13088 2003-01-28 Pedro Mart <yoros@wanadoo.es>
13090 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13091 problem that the last fix but in the other sid (Set).
13093 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13094 access when there is no indexer in the hierarchy.
13096 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13098 * class.cs: Combine some if statements.
13100 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13102 * driver.cs: fixed bug #37187.
13104 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
13106 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13107 any indexer, it's needed to build a list with all the indexers in the
13108 hierarchy (AllGetters), else we have problems. Fixes #35653.
13110 2003-01-23 Miguel de Icaza <miguel@ximian.com>
13112 * class.cs (MethodData.Define): It is wrong for an interface
13113 implementation to be static in both cases: explicit and implicit.
13114 We were only handling this in one case.
13116 Improve the if situation there to not have negations.
13118 * class.cs (Field.Define): Turns out that we do not need to check
13119 the unsafe bit on field definition, only on usage. Remove the test.
13121 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13123 * driver.cs: use assembly.Location instead of Codebase (the latest
13124 patch made mcs fail when using MS assemblies).
13126 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
13128 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13129 get the path to *corlib.dll.
13131 2003-01-21 Nick Drochak <ndrochak@gol.com>
13135 * typemanager.cs: Remove compiler warnings
13137 2003-01-20 Duncan Mak <duncan@ximian.com>
13139 * AssemblyInfo.cs: Bump the version number to 0.19.
13141 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13143 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13145 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
13147 * class.cs (Constructor::Emit): Emit debugging info for constructors.
13149 2003-01-17 Miguel de Icaza <miguel@ximian.com>
13151 * cs-parser.jay: Small fix: we were not comparing the constructor
13152 name correctly. Thanks to Zoltan for the initial pointer.
13154 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13156 * cs-tokenizer.cs: Set file name when specified with #line
13158 2003-01-15 Miguel de Icaza <miguel@ximian.com>
13160 * cs-parser.jay: Only perform the constructor checks here if we
13161 are named like the class; This will help provider a better
13162 error. The constructor path is taken when a type definition is
13163 not found, but most likely the user forgot to add the type, so
13164 report that rather than the constructor error.
13166 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13168 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13171 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13173 * cs-parser.jay: Add cleanup call.
13175 2003-01-13 Duncan Mak <duncan@ximian.com>
13177 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13178 consistent with other methods.
13180 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13182 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13184 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13186 * attribute.cs: only set GuidAttr to true when we have a
13189 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13193 * typemanager.cs: fixes to allow mcs compile corlib with the new
13194 Type.IsSubclassOf fix.
13196 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13198 * expression.cs (LocalVariableReference.DoResolve): Classify a
13199 constant as a value, not as a variable. Also, set the type for
13202 * cs-parser.jay (fixed_statement): take a type instead of a
13203 pointer_type, so we can produce a better error message later.
13205 * statement.cs (Fixed.Resolve): Flag types that are not pointers
13208 (For.DoEmit): Make inifinite loops have a
13209 non-conditional branch back.
13211 (Fixed.DoEmit): First populate the pinned variables, then emit the
13212 statement, then clear the variables. Before I was emitting the
13213 code once for each fixed piece.
13216 2003-01-08 Martin Baulig <martin@ximian.com>
13218 * statement.cs (FlowBranching.MergeChild): A break in a
13219 SWITCH_SECTION does not leave a loop. Fixes #36155.
13221 2003-01-08 Martin Baulig <martin@ximian.com>
13223 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13224 lives in the same number space than `param_map'. Fixes #36154.
13226 2003-01-07 Miguel de Icaza <miguel@ximian.com>
13228 * cs-parser.jay (constructor_declaration): Set the
13229 Constructor.ModFlags before probing for it. This makes the
13230 compiler report 514, 515 and 132 (the code was there, but got
13233 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13234 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13235 (GotoCase.Resolve): Set `Returns' to ALWAYS.
13237 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13239 * enum.cs: create the enum static fields using the enum type.
13241 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13243 * class.cs: don't try to create the ParamBuilder for the return
13244 type if it's not needed (and handle it breaking for the ms runtime
13247 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13249 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13251 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13253 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13254 the command. This showed up while compiling the JANET source
13255 code, which used \r as its only newline separator.
13257 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13259 * class.cs (Method.Define): If we are an operator (because it
13260 reuses our code), then set the SpecialName and HideBySig. #36128
13262 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13264 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13265 exception, report error 120 `object reference required'.
13267 * driver.cs: Add --pause option, used during to measure the size
13268 of the process as it goes with --timestamp.
13270 * expression.cs (Invocation.DoResolve): Do not allow methods with
13271 SpecialName to be invoked.
13273 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13275 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13276 number before adding it.
13278 2002-12-21 Ravi Pratap <ravi@ximian.com>
13280 * ecore.cs (StandardImplicitConversion): When in an unsafe
13281 context, we allow conversion between void * to any other pointer
13282 type. This fixes bug #35973.
13284 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13286 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13287 is not thrown when extensionless outputs are used
13289 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13291 * rootcontext.cs: fixed compilation of corlib.
13293 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13295 * attribute.cs (Attributes.Contains): Add new method.
13297 * class.cs (MethodCore.LabelParameters): if the parameter is an
13298 `out' parameter, check that no attribute `[In]' has been passed.
13300 * enum.cs: Handle the `value__' name in an enumeration.
13302 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13304 * decl.cs: Added special case to allow overrides on "protected
13307 2002-12-18 Ravi Pratap <ravi@ximian.com>
13309 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13310 since it makes much more sense.
13312 (Attributes.ctor): Don't require a Location parameter.
13314 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13316 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13317 since we already have that information per attribute.
13319 * everywhere : make appropriate changes.
13321 * class.cs (LabelParameters): Write the code which actually
13322 applies attributes to the return type. We can't do this on the MS
13323 .NET runtime so we flag a warning in the case an exception is
13326 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13328 * const.cs: Handle implicit null conversions here too.
13330 2002-12-17 Ravi Pratap <ravi@ximian.com>
13332 * class.cs (MethodCore.LabelParameters): Remove the extra
13333 Type [] parameter since it is completely unnecessary. Instead
13334 pass in the method's attributes so that we can extract
13335 the "return" attribute.
13337 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13339 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13340 of ignoring it and letting the compile continue.
13342 * typemanager.cs (ChangeType): use an extra argument to return an
13343 error condition instead of throwing an exception.
13345 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13347 * expression.cs (Unary.TryReduce): mimic the code for the regular
13348 code path. Perform an implicit cast in the cases where we can
13349 implicitly convert to one of the integral types, and then reduce
13350 based on that constant. This fixes bug #35483.
13352 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13354 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13356 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13358 * namespace.cs: fixed bug #35489.
13360 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13362 * class.cs: Remove some dead code.
13364 * cs-parser.jay: Estimate the number of methods needed
13365 (RootContext.MethodCount);
13367 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13368 numbers instead of StringBuilders.
13370 * support.cs (PtrHashtable): Add constructor with initial size;
13371 We can now reduce reallocations of the method table.
13373 2002-12-10 Ravi Pratap <ravi@ximian.com>
13375 * attribute.cs (ApplyAttributes): Keep track of the emitted
13376 attributes on a per-target basis. This fixes bug #35413.
13378 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13380 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13381 default to the Windows 1252 encoding.
13383 (UnixParseOption): Support version, thanks to Alp for the missing
13386 * AssemblyInfo.cs: Add nice assembly information.
13388 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13391 * cs-parser.jay: Allow a trailing comma before the close bracked
13392 in the attribute_section production.
13394 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13395 address of the instance was being taken, I will take this out,
13396 because we take the address of the object immediately here.
13398 2002-12-09 Ravi Pratap <ravi@ximian.com>
13400 * typemanager.cs (AreMultipleAllowed): Take care of the most
13401 obvious case where attribute type is not in the current assembly -
13404 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13406 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13407 definitions, instead of doing that afterwards.
13409 Also we use a nice little hack, depending on the constructor, we
13410 know if we are a "composed" name or a simple name. Hence, we
13411 avoid the IndexOf test, and we avoid
13413 * codegen.cs: Add code to assist in a bug reporter to track down
13414 the source of a compiler crash.
13416 2002-12-07 Ravi Pratap <ravi@ximian.com>
13418 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13419 types have been emitted for a given element and flag an error
13420 if something which does not have AllowMultiple set is used more
13423 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13424 attribute types and their corresponding AllowMultiple properties
13426 (AreMultipleAllowed): Check the property for a given type.
13428 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13429 property in the case we have a TypeContainer.
13431 (Attributes.AddAttribute): Detect duplicates and just skip on
13432 adding them. This trivial fix catches a pretty gross error in our
13433 attribute emission - global attributes were being emitted twice!
13435 Bugzilla bug #33187 is now fixed.
13437 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13439 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13440 instead of pp_and).
13442 * expression.cs (Binary.ResolveOperator): I can only use the
13443 Concat (string, string, string) and Concat (string, string,
13444 string, string) if the child is actually a concatenation of
13447 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13449 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13450 context where we need a 2-character lookahead.
13452 * pending.cs (PendingImplementation): Rework so we can keep track
13453 of interface types all the time, and flag those which were
13454 implemented by parents as optional.
13456 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13458 * expression.cs (Binary.ResolveOperator): Use
13459 String.Concat(string,string,string) or
13460 String.Concat(string,string,string,string) when possible.
13462 * typemanager: More helper methods.
13465 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13467 * pending.cs: remove the bogus return from GetMissingInterfaces()
13468 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13470 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13472 * namespace.cs: avoid duplicated 'using xxx' being added to
13473 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13474 when we get more than one 'using' statement for the same namespace.
13475 Report a CS0105 warning for it.
13477 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13479 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13480 of calling getChar/putback, uses internal knowledge of it.
13482 (xtoken): Reorder tokenizer so most common patterns are checked
13483 first. This reduces the compilation time in another 5% (from 8.11s
13484 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13486 The parsing time is 22% of the compilation in mcs, and from that
13487 64% is spent on the tokenization process.
13489 I tried using a binary search for keywords, but this is slower
13490 than the hashtable. Another option would be to do a couple of
13493 * Not use a StringBuilder, instead use an array of chars,
13494 with a set value. Notice that this way we could catch
13495 the 645 error without having to do it *afterwards*.
13497 * We could write a hand-parser to avoid the hashtable
13498 compares altogether.
13500 The identifier consumption process takes 37% of the tokenization
13501 time. Another 15% is spent on is_number. 56% of the time spent
13502 on is_number is spent on Int64.Parse:
13504 * We could probably choose based on the string length to
13505 use Int32.Parse or Int64.Parse and avoid all the 64-bit
13508 Another 3% is spend on wrapping `xtoken' in the `token' function.
13510 Handle 0xa0 as whitespace (#34752)
13512 2002-11-26 Miguel de Icaza <miguel@ximian.com>
13514 * typemanager.cs (IsCLRType): New routine to tell whether a type
13515 is one of the builtin types.
13517 Maybe it needs to use TypeCodes to be faster. Maybe we could use
13518 typecode in more places instead of doing pointer comparissions.
13519 We could leverage some knowledge about the way the typecodes are
13522 New code to cache namespaces in assemblies, it is currently not
13523 invoked, to be used soon.
13525 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13527 * expression.cs (Binary.ResolveOperator): specially handle
13528 strings, and do not perform user-defined operator overloading for
13531 2002-11-24 Miguel de Icaza <miguel@ximian.com>
13533 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13534 internalcall as it is a pretty simple operation; Avoid whenever
13535 possible to call Char.IsLetter.
13537 (consume_identifier): Cut by half the number of
13538 hashtable calls by merging the is_keyword and GetKeyword behavior.
13540 Do not short-circuit, because if we do, we
13541 report errors (ie, #if false && true would produce an invalid
13545 2002-11-24 Martin Baulig <martin@ximian.com>
13547 * expression.cs (Cast.TryReduce): If we're in checked syntax,
13548 check constant ranges and report a CS0221. Fixes #33186.
13550 2002-11-24 Martin Baulig <martin@ximian.com>
13552 * cs-parser.jay: Make this work for uninitialized variable
13553 declarations in the `for' initializer. Fixes #32416.
13555 2002-11-24 Martin Baulig <martin@ximian.com>
13557 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13558 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
13560 2002-11-24 Martin Baulig <martin@ximian.com>
13562 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13563 argument; if true, we also check for user-defined conversions.
13564 This is only needed if both arguments are of a user-defined type.
13565 Fixes #30443, added test-175.cs.
13566 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13568 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13570 2002-11-24 Martin Baulig <martin@ximian.com>
13572 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13573 function to get the store opcode.
13574 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13575 only emit the Ldelema if the store opcode is Stobj. You must run
13576 both test-34 and test-167 to test this. Fixes #34529.
13578 2002-11-23 Martin Baulig <martin@ximian.com>
13580 * ecore.cs (Expression.MemberLookup): Added additional
13581 `qualifier_type' argument which is used when we're being called
13582 from MemberAccess.DoResolve() and null if we're called from a
13584 (Expression.MemberLookupFailed): New method to report errors; this
13585 does the CS1540 check and reports the correct error message.
13587 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13588 argument for the CS1540 check and redone the way how we're dealing
13589 with private members. See the comment in the source code for details.
13590 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13591 `closure_start_type' to `closure_qualifier_type' and check whether
13592 it's not null. It was not this filter being broken, it was just
13593 being called with the wrong arguments.
13595 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13596 and pass it the correct `qualifier_type'; this also does the error
13599 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13601 * expression.cs (Invocation.EmitParams): If the we are dealing
13602 with a non-built-in value type, load its address as well.
13604 (ArrayCreation): Use a a pretty constant instead
13605 of the hardcoded value 2. Use 6 instead of 2 for the number of
13606 static initializers.
13608 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13609 because they are not really value types, just glorified integers.
13611 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13613 * ecore.cs: Remove redundant code for enumerations, make them use
13614 the same code path as everything else, fixes the casting issue
13615 with enumerations in Windows.Forms.
13617 * attribute.cs: Do only cast to string if it is a string, the
13618 validation happens later.
13620 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13621 people upgrade their corlibs.
13623 * ecore.cs: Oops, enumerations were not following the entire code path
13625 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13627 * typemanager.cs (FilterWithClosure): Commented out the test for
13628 1540 in typemanager.cs, as it has problems when accessing
13629 protected methods from a parent class (see test-174.cs).
13631 * attribute.cs (Attribute.ValidateGuid): new method.
13632 (Attribute.Resolve): Use above.
13634 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13636 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13638 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13639 handling for enumerations, as we only needed the TypeContainer
13640 functionality to begin with (this is required for the fix below to
13641 work for enums that reference constants in a container class for
13644 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13646 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13647 a valid TypeBuilder to perform lookups on.o
13649 * class.cs (InheritableMemberSignatureCompare): Use true in the
13650 call to GetGetMethod and GetSetMethod, because we are comparing
13651 the signature, and we need to get the methods *even* if they are
13654 (PropertyBase.CheckBase): ditto.
13656 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13657 GotoCase.Resolve): Use Peel on EmpytCasts.
13659 * ecore.cs (EmptyCast): drop child, add Peel method.
13661 2002-11-17 Martin Baulig <martin@ximian.com>
13663 * ecore.cs (EmptyCast.Child): New public property.
13665 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13666 label resolved to an EmptyCast. Fixes #34162.
13667 (GotoCase.Resolve): Likewise.
13668 (Block.EmitMeta): Likewise.
13670 2002-11-17 Martin Baulig <martin@ximian.com>
13672 * expression.cs (Invocation.BetterConversion): Prefer int over
13673 uint; short over ushort; long over ulong for integer literals.
13674 Use ImplicitConversionExists instead of StandardConversionExists
13675 since we also need to check for user-defined implicit conversions.
13676 Fixes #34165. Added test-173.cs.
13678 2002-11-16 Martin Baulig <martin@ximian.com>
13680 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13681 with the `true' and `false' literals. Fixes #33151.
13683 2002-11-16 Martin Baulig <martin@ximian.com>
13685 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13686 October 22nd; don't do the cs1540 check for static members.
13688 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13689 now using our own filter here and doing the cs1540 check again.
13691 2002-11-16 Martin Baulig <martin@ximian.com>
13693 * support.cs (InternalParameters): Don't crash if we don't have
13694 any fixed parameters. Fixes #33532.
13696 2002-11-16 Martin Baulig <martin@ximian.com>
13698 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13699 when looking up static methods to make this work on Windows.
13702 2002-11-16 Martin Baulig <martin@ximian.com>
13704 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13705 a setter rather than using PropertyInfo.CanWrite.
13707 2002-11-15 Nick Drochak <ndrochak@gol.com>
13709 * class.cs: Allow acces to block member by subclasses. Fixes build
13712 2002-11-14 Martin Baulig <martin@ximian.com>
13714 * class.cs (Constructor.Emit): Added the extern/block check.
13717 2002-11-14 Martin Baulig <martin@ximian.com>
13719 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13720 iteration while looking for indexers, this is needed because the
13721 indexer may have a different name in our base classes. Fixed the
13722 error reporting (no indexers at all, not get accessor, no
13723 overloaded match). Fixes bug #33089.
13724 (IndexerAccess.DoResolveLValue): Likewise.
13726 2002-11-14 Martin Baulig <martin@ximian.com>
13728 * class.cs (PropertyBase.CheckBase): Make this work for multiple
13729 indexers. Fixes the first part of bug #33089.
13730 (MethodSignature.InheritableMemberSignatureCompare): Added support
13733 2002-11-13 Ravi Pratap <ravi@ximian.com>
13735 * attribute.cs (Attribute.Resolve): Catch the
13736 NullReferenceException and report it since it isn't supposed to
13739 2002-11-12 Miguel de Icaza <miguel@ximian.com>
13741 * expression.cs (Binary.EmitBranchable): Also handle the cases for
13742 LogicalOr and LogicalAnd that can benefit from recursively
13743 handling EmitBranchable. The code now should be nice for Paolo.
13745 2002-11-08 Miguel de Icaza <miguel@ximian.com>
13747 * typemanager.cs (LookupType): Added a negative-hit hashtable for
13748 the Type lookups, as we perform quite a number of lookups on
13749 non-Types. This can be removed once we can deterministically tell
13750 whether we have a type or a namespace in advance.
13752 But this might require special hacks from our corlib.
13756 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13757 and double which avoids a conversion from an integer to a double.
13759 * expression.cs: tiny optimization, avoid calling IsConstant,
13760 because it effectively performs the lookup twice.
13762 2002-11-06 Miguel de Icaza <miguel@ximian.com>
13764 But a bogus return here to keep the semantics of the old code
13765 until the Mono runtime is fixed.
13767 * pending.cs (GetMissingInterfaces): New method used to remove all
13768 the interfaces that are already implemented by our parent
13769 classes from the list of pending methods.
13771 * interface.cs: Add checks for calls after ResolveTypeExpr.
13773 2002-11-05 Miguel de Icaza <miguel@ximian.com>
13775 * class.cs (Class.Emit): Report warning 67: event not used if the
13776 warning level is beyond 3.
13778 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13779 being a NullLiteral.
13781 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13784 * class.cs (TypeContainer.GetClassBases): Cover a missing code
13785 path that might fail if a type can not be resolved.
13787 * expression.cs (Binary.Emit): Emit unsigned versions of the
13790 * driver.cs: use error 5.
13792 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13794 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13796 2002-11-01 Miguel de Icaza <miguel@ximian.com>
13798 * cs-parser.jay (switch_section): A beautiful patch from Martin
13799 Baulig that fixed 33094.
13801 2002-10-31 Miguel de Icaza <miguel@ximian.com>
13803 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13804 Check whether the base is abstract and report an error if so.
13806 * expression.cs (IndexerAccess.DoResolveLValue,
13807 IndexerAccess.DoResolve): ditto.
13809 (Invocation.DoResolve): ditto.
13811 (Invocation.FullMethodDesc): Improve the report string.
13813 * statement.cs (Block): Eliminate IsVariableDefined as it is
13814 basically just a wrapper for GetVariableInfo.
13816 * ecore.cs (SimpleName): Use new
13818 * support.cs (ReflectionParamter.ParameterType): We unwrap the
13819 type, as we return the actual parameter ref/unref state on a
13822 2002-10-30 Miguel de Icaza <miguel@ximian.com>
13824 * support.cs: Return proper flags REF/OUT fixing the previous
13827 * expression.cs: Reverted last patch, that was wrong. Is_ref is
13828 not used to mean `ref' but `ref or out' in ParameterReference
13830 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13831 full type signature instead of calling TypeManger.CSharpName
13834 * support.cs (InternalParameters.ParameterDesc): Do not compare
13835 directly to the modflags, because REF/OUT will actually be bitsets
13838 * delegate.cs (VerifyMethod): Check also the modifiers.
13840 * cs-tokenizer.cs: Fix bug where floating point values with an
13841 exponent where a sign was missing was ignored.
13843 * driver.cs: Allow multiple assemblies to be specified in a single
13846 2002-10-28 Miguel de Icaza <miguel@ximian.com>
13848 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
13849 because identifiers after a parenthesis would end up in this kind
13850 of production, and we needed to desamiguate it for having casts
13853 (UserDefinedType *) xxx
13855 2002-10-24 Miguel de Icaza <miguel@ximian.com>
13857 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13858 we should set on the Bindingflags.NonPublic, but not turn on
13859 private_ok. private_ok controls whether a Private member is
13860 returned (this is chekced on the filter routine), while the
13861 BindingFlags.NonPublic just controls whether private/protected
13862 will be allowed. This fixes the problem part of the problem of
13863 private properties being allowed to be used in derived classes.
13865 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13866 so we can call the children DoResolveLValue method (this will
13867 properly signal errors on lvalue assignments to base properties)
13869 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13870 getter are null, and we have a property info, we know that this
13871 happened because the lookup failed, so we report an error 122 for
13872 protection level violation.
13874 We also silently return if setter and getter are null in the
13875 resolve functions, this condition only happens if we have flagged
13876 the error before. This is the other half of the problem.
13878 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13879 not have accessibility information, that is why we were returning
13880 true in the filter function in typemanager.cs.
13882 To properly report 122 (property is inaccessible because of its
13883 protection level) correctly, we report this error in ResolveAccess
13884 by failing if both the setter and the getter are lacking (ie, the
13887 DoResolve and DoLResolve have been modified to check for both
13888 setter/getter being null and returning silently, the reason being
13889 that I did not want to put the knowledge about this error in upper
13892 int old = Report.Errors;
13893 x = new PropertyExpr (...);
13894 if (old != Report.Errors)
13899 So the property expr is returned, but it is invalid, so the error
13900 will be flagged during the resolve process.
13902 * class.cs: Remove InheritablePropertySignatureCompare from the
13903 class, as we no longer depend on the property signature to compute
13904 whether it is possible to implement a method or not.
13906 The reason is that calling PropertyInfo.GetGetMethod will return
13907 null (in .NET, in Mono it works, and we should change this), in
13908 cases where the Get Method does not exist in that particular
13913 class X { public virtual int A { get { return 1; } } }
13915 class Z : Y { public override int A { get { return 2; } } }
13917 Would fail in Z because the parent (Y) would not have the property
13918 defined. So we avoid this completely now (because the alternative
13919 fix was ugly and slow), and we now depend exclusively on the
13922 (PropertyBase.CheckBase): Use a method-base mechanism to find our
13923 reference method, instead of using the property.
13925 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13926 routines are gone now.
13928 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13929 names, they were incorrectly named.
13931 * cs-tokenizer.cs: Return are more gentle token on failure.
13933 * pending.cs (PendingImplementation.InterfaceMethod): This routine
13934 had an out-of-sync index variable, which caused it to remove from
13935 the list of pending methods the wrong method sometimes.
13937 2002-10-22 Miguel de Icaza <miguel@ximian.com>
13939 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13940 CanWrite, because those refer to this particular instance of the
13941 property, and do not take into account the fact that we can
13942 override single members of a property.
13944 Constructor requires an EmitContext. The resolution process does
13945 not happen here, but we need to compute the accessors before,
13946 because the resolution does not always happen for properties.
13948 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13949 subclass, before we did not update this flag, but we did update
13952 (GetAccessors): Drop this routine, as it did not work in the
13953 presence of partially overwritten set/get methods.
13955 Notice that this broke the cs1540 detection, but that will require
13958 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13962 * driver.cs: issue a warning instead of an error if we don't support
13963 debugging for the platform. Also ignore a couple of errors that may
13964 arise when trying to write the symbols. Undo my previous patch.
13966 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13968 * driver.cs: ignore /debug switch except for Unix platforms.
13970 2002-10-23 Nick Drochak <ndrochak@gol.com>
13972 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13974 2002-10-21 Miguel de Icaza <miguel@ximian.com>
13976 * driver.cs: Do not make mcs-debug conditional, so we do not break
13977 builds that use it.
13979 * statement.cs (UsageVector.MergeChildren): I would like Martin to
13980 review this patch. But basically after all the children variables
13981 have been merged, the value of "Breaks" was not being set to
13982 new_breaks for Switch blocks. I think that it should be set after
13983 it has executed. Currently I set this to the value of new_breaks,
13984 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13985 conservative, but I do not understand this code very well.
13987 I did not break anything in the build, so that is good ;-)
13989 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13991 2002-10-20 Mark Crichton <crichton@gimp.org>
13993 * cfold.cs: Fixed compile blocker. Really fixed it this time.
13995 2002-10-20 Nick Drochak <ndrochak@gol.com>
13997 * cfold.cs: Fixed compile blocker.
13999 2002-10-20 Miguel de Icaza <miguel@ximian.com>
14001 * driver.cs: I was chekcing the key, not the file.
14003 2002-10-19 Ravi Pratap <ravi@ximian.com>
14005 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14006 message that we were generating - we just need to silently return
14009 2002-10-19 Miguel de Icaza <miguel@ximian.com>
14011 * class.cs (Event.Define): Change my previous commit, as this
14012 breaks the debugger. This is a temporary hack, as it seems like
14013 the compiler is generating events incorrectly to begin with.
14015 * expression.cs (Binary.ResolveOperator): Added support for
14016 "U operator - (E x, E y)"
14018 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14021 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14022 init-only variables, but this path did not take into account that
14023 there might be also instance readonly variables. Correct this
14026 This fixes bug 32253
14028 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14031 * driver.cs: Change the extension for modules to `netmodule'
14033 * cs-parser.jay: Improved slightly the location tracking for
14034 the debugger symbols.
14036 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14037 modifiers that were specified instead of the hardcoded value
14038 (FamAndAssem). This was basically ignoring the static modifier,
14039 and others. Fixes 32429.
14041 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14042 fixed a bug in the process (32476)
14044 * expression.cs (ArrayAccess.EmitAssign): Patch from
14045 hwang_rob@yahoo.ca that fixes bug 31834.3
14047 2002-10-18 Miguel de Icaza <miguel@ximian.com>
14049 * driver.cs: Make the module extension .netmodule.
14051 2002-10-16 Miguel de Icaza <miguel@ximian.com>
14053 * driver.cs: Report an error if the resource file is not found
14054 instead of crashing.
14056 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14057 false, like Emit does.
14059 2002-10-16 Nick Drochak <ndrochak@gol.com>
14061 * typemanager.cs: Remove unused private member. Also reported mcs
14062 bug to report this as a warning like csc.
14064 2002-10-15 Martin Baulig <martin@gnome.org>
14066 * statement.cs (Statement.Emit): Made this a virtual method; emits
14067 the line number info and calls DoEmit().
14068 (Statement.DoEmit): New protected abstract method, formerly knows
14069 as Statement.Emit().
14071 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14073 2002-10-11 Miguel de Icaza <miguel@ximian.com>
14075 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14076 have fixed a remaining problem: not every AddXXXX was adding a
14077 fully qualified name.
14079 Now everyone registers a fully qualified name in the DeclSpace as
14080 being defined instead of the partial name.
14082 Downsides: we are slower than we need to be due to the excess
14083 copies and the names being registered this way.
14085 The reason for this is that we currently depend (on the corlib
14086 bootstrap for instance) that types are fully qualified, because
14087 we dump all the types in the namespace, and we should really have
14088 types inserted into the proper namespace, so we can only store the
14089 basenames in the defined_names array.
14091 2002-10-10 Martin Baulig <martin@gnome.org>
14093 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14094 from bug #31834, see the bug report for a testcase which is
14097 2002-10-10 Martin Baulig <martin@gnome.org>
14099 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14100 flow analysis code for this.
14102 * statement.cs (Do, While, For): Tell the flow analysis code about
14104 (FlowBranching.UsageVector): Added support for infinite loops.
14105 (Block.Resolve): Moved the dead code elimination here and use flow
14108 2002-10-09 Miguel de Icaza <miguel@ximian.com>
14110 * class.cs (Field.Define): Catch cycles on struct type
14113 * typemanager.cs (IsUnmanagedtype): Do not recursively check
14114 fields if the fields are static. We only need to check instance
14117 * expression.cs (As.DoResolve): Test for reference type.
14119 * statement.cs (Using.ResolveExpression): Use
14120 ConvertImplicitRequired, not ConvertImplicit which reports an
14122 (Using.ResolveLocalVariableDecls): ditto.
14124 * expression.cs (Binary.ResolveOperator): Report errors in a few
14125 places where we had to.
14127 * typemanager.cs (IsUnmanagedtype): Finish implementation.
14129 2002-10-08 Miguel de Icaza <miguel@ximian.com>
14131 * expression.cs: Use StoreFromPtr instead of extracting the type
14132 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
14134 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14135 an enumeration value to a System.Enum, but System.Enum is not a
14136 value type, but an class type, so we need to box.
14138 (Expression.ConvertExplicit): One codepath could return
14139 errors but not flag them. Fix this. Fixes #31853
14141 * parameter.cs (Resolve): Do not allow void as a parameter type.
14143 2002-10-06 Martin Baulig <martin@gnome.org>
14145 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14146 if it's a class type and not a struct. Fixes #31815.
14148 2002-10-06 Martin Baulig <martin@gnome.org>
14150 * statement.cs: Reworked the flow analysis code a bit to make it
14151 usable for dead code elimination.
14153 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14155 * cs-parser.jay: allow empty source files. Fixes bug #31781.
14157 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14159 * expression.cs (ComposedCast.DoResolveType): A quick workaround
14160 to fix the test 165, will investigate deeper.
14162 2002-10-04 Martin Baulig <martin@gnome.org>
14164 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14165 finally blocks actually work.
14166 (Try.Resolve): We don't need to create a sibling for `finally' if
14167 there is no finally block.
14169 2002-10-04 Martin Baulig <martin@gnome.org>
14171 * class.cs (Constructor.Define): The default accessibility for a
14172 non-default constructor is private, not public.
14174 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14176 * class.cs (Constructor): Make AllowedModifiers public, add
14179 * cs-parser.jay: Perform the modifiers test here, as the
14180 constructor for the Constructor class usually receives a zero
14181 because of the way we create it (first we create, later we
14182 customize, and we were never checking the modifiers).
14184 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14185 is a version of LookupTypeReflection that includes the type-name
14186 cache. This can be used as a fast path for functions that know
14187 the fully qualified name and are only calling into *.GetType() to
14188 obtain a composed type.
14190 This is also used by TypeManager.LookupType during its type
14193 (LookupType): We now also track the real type name, as sometimes
14194 we can get a quey for the real type name from things like
14195 ComposedCast. This fixes bug 31422.
14197 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14198 complete type fullname, it does not have to go through the type
14199 resolution system to obtain the composed version of the type (for
14200 obtaining arrays or pointers).
14202 (Conditional.Emit): Use the EmitBoolExpression to
14203 generate nicer code, as requested by Paolo.
14205 (ArrayCreation.CheckIndices): Use the patch from
14206 hwang_rob@yahoo.ca to validate the array initializers.
14208 2002-10-03 Miguel de Icaza <miguel@ximian.com>
14210 * class.cs (ConstructorInitializer.Emit): simplify code by using
14211 Invocation.EmitCall, and at the same time, fix the bugs in calling
14212 parent constructors that took variable arguments.
14214 * ecore.cs (Expression.ConvertNumericExplicit,
14215 Expression.ImplicitNumericConversion): Remove the code that
14216 manually wrapped decimal (InternalTypeConstructor call is now gone
14219 * expression.cs (Cast.TryReduce): Also handle decimal types when
14220 trying to perform a constant fold on the type.
14222 * typemanager.cs (IsUnmanagedtype): Partially implemented.
14224 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14225 that only turned off an error report, and did nothing else.
14227 2002-10-02 Miguel de Icaza <miguel@ximian.com>
14229 * driver.cs: Handle and ignore /fullpaths
14231 2002-10-01 Miguel de Icaza <miguel@ximian.com>
14233 * expression.cs (Binary.ResolveOperator): Catch the case where
14234 DoNumericPromotions returns true,
14236 (Binary.DoNumericPromotions): Simplify the code, and the tests.
14238 2002-09-27 Miguel de Icaza <miguel@ximian.com>
14240 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14243 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14245 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14246 conversion exists, but it is also required that the conversion be
14247 performed. This manifested in "(Type64Enum) 2".
14249 * class.cs (TypeManager.AddMethod): The fix is not to change
14250 AddEnum, because that one was using a fully qualified name (every
14251 DeclSpace derivative does), but to change the AddMethod routine
14252 that was using an un-namespaced name. This now correctly reports
14253 the duplicated name.
14255 Revert patch until I can properly fix it. The issue
14256 is that we have a shared Type space across all namespaces
14257 currently, which is wrong.
14259 Options include making the Namespace a DeclSpace, and merge
14260 current_namespace/current_container in the parser.
14262 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14264 * cs-parser.jay: Improve error reporting when we get a different
14265 kind of expression in local_variable_type and
14266 local_variable_pointer_type.
14268 Propagate this to avoid missleading errors being reported.
14270 * ecore.cs (ImplicitReferenceConversion): treat
14271 TypeManager.value_type as a target just like object_type. As
14276 Is valid, and needs to result in the int 1 being boxed before it
14277 is assigned to the value type v.
14279 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14280 to validate the enumeration name.
14282 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14283 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14284 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14286 * ecore.cs (TryImplicitIntConversion): When doing an
14287 implicit-enumeration-conversion, check if the type is 64-bits and
14288 perform a conversion before passing to EnumConstant.
14290 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14292 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14293 report ambiguous type references. Unlike the MS version, we
14294 report what the ambiguity is. Innovation at work ;-)
14296 (DeclSpace.FindType): Require a location argument to
14297 display when we display an ambiguous error.
14299 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14301 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14303 * expression.cs (EmitDynamicInitializers): Apply patch from
14304 hwang_rob@yahoo.ca that fixes the order in which we emit our
14307 2002-09-21 Martin Baulig <martin@gnome.org>
14309 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14310 delegate takes no arguments.
14312 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14314 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14317 * expression.cs: Extract the underlying type.
14319 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14321 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14323 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14325 * class.cs (TypeContainer.DefineType): We can not use the nice
14326 PackingSize with the size set to 1 DefineType method, because it
14327 will not allow us to define the interfaces that the struct
14330 This completes the fixing of bug 27287
14332 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14333 means also structs. This fixes part of the problem.
14334 (Expresion.ImplicitReferenceConversionExists): ditto.
14336 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14337 error if there were no errors reported during the type lookup
14338 process, to avoid duplicates or redundant errors. Without this
14339 you would get an ambiguous errors plus a type not found. We have
14340 beaten the user enough with the first error.
14342 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14345 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14346 during the resolution process, stop the lookup, this avoids
14347 repeated error reports (same error twice).
14349 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14351 * typemanager.cs (LookupType): Redo the type lookup code to match
14352 the needs of System.Reflection.
14354 The issue is that System.Reflection requires references to nested
14355 types to begin with a "+" sign instead of a dot. So toplevel
14356 types look like: "NameSpace.TopLevelClass", and nested ones look
14357 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14360 2002-09-19 Martin Baulig <martin@gnome.org>
14362 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14363 says that a method always returns or always throws an exception,
14364 don't report the CS0161.
14366 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14367 set `Returns = new_returns'.
14369 2002-09-19 Martin Baulig <martin@gnome.org>
14371 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14372 to an enum constant, check for a CS0176.
14374 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14376 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14377 for operators that must be in pairs and report errors.
14379 * ecore.cs (SimpleName.DoResolveType): During the initial type
14380 resolution process, when we define types recursively, we must
14381 check first for types in our current scope before we perform
14382 lookups in the enclosing scopes.
14384 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14386 (Invocation.VerifyArgumentsCompat): Call
14387 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14388 I thought we were supposed to always call this, but there are a
14389 few places in the code where we dont do it.
14391 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14393 * driver.cs: Add support in -linkres and -resource to specify the
14394 name of the identifier.
14396 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14398 * ecore.cs (StandardConversionExists): Sync with the conversion
14399 code: allow anything-* to void* conversions.
14401 (FindMostSpecificSource): Use an Expression argument
14402 instead of a Type, because we might be handed over a Literal which
14403 gets a few more implicit conversions that plain types do not. So
14404 this information was being lost.
14406 Also, we drop the temporary type-holder expression when not
14409 2002-09-17 Martin Baulig <martin@gnome.org>
14411 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14412 this is an explicit interface implementation.
14414 2002-09-17 Martin Baulig <martin@gnome.org>
14416 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14417 different `IndexerName' attributes.
14419 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14420 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14421 virtual CommonResolve().
14423 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14425 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14426 and convert that to the UnderlyingType.
14428 * statement.cs (Foreach.Resolve): Indexers are just like variables
14429 or PropertyAccesses.
14431 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14432 inside quoted strings, we were not doing this before.
14434 2002-09-16 Martin Baulig <martin@gnome.org>
14436 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14437 resolve it. This is needed for the definite assignment check of the
14438 instance expression, fixes bug #29846.
14439 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14441 2002-09-16 Nick Drochak <ndrochak@gol.com>
14443 * parameter.cs: Fix compile error. Cannot reference static member
14444 from an instance object. Is this an mcs bug?
14446 2002-09-14 Martin Baulig <martin@gnome.org>
14448 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14449 multiple times. Fixes bug #30295, added test-166.cs.
14451 2002-09-14 Martin Baulig <martin@gnome.org>
14453 * statement.cs (Block.Emit): Don't emit unreachable code.
14454 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14455 `break' statements.
14456 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14458 2002-09-14 Martin Baulig <martin@gnome.org>
14460 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14463 2002-09-14 Martin Baulig <martin@gnome.org>
14465 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14466 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14467 be false on the ms runtime.
14469 2002-09-13 Martin Baulig <martin@gnome.org>
14471 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14472 the CS0038 error message.
14474 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14476 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14477 constant inside, return it.
14479 2002-09-12 Martin Baulig <martin@gnome.org>
14481 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14482 implicit conversion can be done between enum types.
14484 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14485 check whether an implicit conversion to the current enum's UnderlyingType
14486 exists and report an error if not.
14488 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14489 without debugging support.
14491 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14492 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14494 2002-09-12 Martin Baulig <martin@gnome.org>
14496 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14498 * ecore.cs (IMemberExpr.DeclaringType): New property.
14499 (SimpleName.SimpleNameResolve): Check whether we're accessing a
14500 nonstatic member of an outer type (CS0038).
14502 2002-09-11 Miguel de Icaza <miguel@ximian.com>
14504 * driver.cs: Activate the using-error detector at warning level
14505 4 (at least for MS-compatible APIs).
14507 * namespace.cs (VerifyUsing): Small buglett fix.
14509 * pending.cs (PendingImplementation): pass the container pointer.
14511 * interface.cs (GetMethods): Allow for recursive definition. Long
14512 term, I would like to move every type to support recursive
14513 definitions, not the current ordering mechanism that we have right
14516 The situation is this: Attributes are handled before interfaces,
14517 so we can apply attributes to interfaces. But some attributes
14518 implement interfaces, we will now handle the simple cases
14519 (recursive definitions will just get an error).
14521 * parameter.cs: Only invalidate types at the end if we fail to
14524 2002-09-09 Martin Baulig <martin@gnome.org>
14526 * ecore.cs (PropertyExpr.Emit): Also check for
14527 TypeManager.system_int_array_get_length so this'll also work when
14528 compiling corlib. Fixes #30003.
14530 2002-09-09 Martin Baulig <martin@gnome.org>
14532 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14533 and throw an exception if we can't get the type's size. Fixed #30040,
14536 2002-09-09 Martin Baulig <martin@gnome.org>
14538 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14540 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14541 context. Fixes bug #30027.
14543 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14544 virtual functions. Fixes bug #30043, added test-164.cs.
14546 2002-09-08 Ravi Pratap <ravi@ximian.com>
14548 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14550 2002-09-08 Nick Drochak <ndrochak@gol.com>
14552 * driver.cs: Use an object to get the windows codepage since it's not a
14555 2002-09-08 Miguel de Icaza <miguel@ximian.com>
14557 * statement.cs (For.Emit): for infinite loops (test == null)
14558 return whether there is a break inside, not always "true".
14560 * namespace.cs (UsingEntry): New struct to hold the name of the
14561 using definition, the location where it is defined, and whether it
14562 has been used in a successful type lookup.
14564 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14569 2002-09-06 Ravi Pratap <ravi@ximian.com>
14571 * attribute.cs : Fix incorrect code which relied on catching
14572 a NullReferenceException to detect a null being passed in
14573 where an object was expected.
14575 2002-09-06 Miguel de Icaza <miguel@ximian.com>
14577 * statement.cs (Try): flag the catch variable as assigned
14579 * expression.cs (Cast): Simplified by using ResolveType instead of
14580 manually resolving.
14582 * statement.cs (Catch): Fix bug by using ResolveType.
14584 2002-09-06 Ravi Pratap <ravi@ximian.com>
14586 * expression.cs (BetterConversion): Special case for when we have
14587 a NullLiteral as the argument and we have to choose between string
14588 and object types - we choose string the way csc does.
14590 * attribute.cs (Attribute.Resolve): Catch the
14591 NullReferenceException and report error #182 since the Mono
14592 runtime no more has the bug and having this exception raised means
14593 we tried to select a constructor which takes an object and is
14596 2002-09-05 Ravi Pratap <ravi@ximian.com>
14598 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14599 message (1502, 1503) when we can't locate a method after overload
14600 resolution. This is much more informative and closes the bug
14603 * interface.cs (PopulateMethod): Return if there are no argument
14604 types. Fixes a NullReferenceException bug.
14606 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14607 expressions too. Previously we were checking only in one place for
14608 positional arguments leaving out named arguments.
14610 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14611 type to the enum type is not allowed. Remove code corresponding to
14614 (ConvertNumericExplicit): Allow explicit conversions from
14615 the underlying type to enum type. This precisely follows the spec
14616 and closes a bug filed by Gonzalo.
14618 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14621 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14623 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14625 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14626 it was important that we stored the right value after the
14627 reduction in `converted'.
14629 2002-09-04 Martin Baulig <martin@gnome.org>
14631 * location.cs (Location.SymbolDocument): Use full pathnames for the
14634 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14636 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14637 of the expression resolve mechanism, because that will catch the
14638 SimpleName error failures.
14640 (Conditional): If we can not resolve the
14641 expression, return, do not crash.
14643 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14646 (location): display token name instead of its number.
14648 2002-08-28 Martin Baulig <martin@gnome.org>
14650 * expression.cs (Binary.ResolveOperator): Don't silently return
14651 but return an error if an operator cannot be applied between two
14654 2002-08-28 Martin Baulig <martin@gnome.org>
14656 * class.cs (Constructor.Define): Set the permission attributes
14657 correctly instead of making all constructors public.
14659 2002-08-28 Martin Baulig <martin@gnome.org>
14661 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14662 for private members before reporting a CS0103; if we find anything,
14665 2002-08-28 Martin Baulig <martin@gnome.org>
14667 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14668 to check whether `closure_start_type == closure_invocation_type',
14669 we also need to check whether `m.DeclaringType == closure_invocation_type'
14670 before bypassing the permission checks. We might be accessing
14671 protected/private members from the base class.
14672 (TypeManager.RealMemberLookup): Only set private_ok if private
14673 members were requested via BindingFlags.NonPublic.
14675 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14677 * expression.cs (MemberAccess.ResolveMemberAccess): Set
14678 MethodGroupExpr.IsExplicitImpl if appropriate.
14679 (Invocation.DoResolve): Don't report the CS0120 for explicit
14680 interface implementations.
14682 2002-08-27 Martin Baulig <martin@gnome.org>
14684 * expression.cs (Invocation.DoResolve): If this is a static
14685 method and we don't have an InstanceExpression, we must report
14688 2002-08-25 Martin Baulig <martin@gnome.org>
14690 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14691 `==' between a valuetype and an object.
14693 2002-08-25 Miguel de Icaza <miguel@ximian.com>
14695 * ecore.cs (TypeExpr): Provide a ToString method.
14697 2002-08-24 Martin Baulig <martin@gnome.org>
14699 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14700 now called proggie.dbg and it's a binary file.
14702 2002-08-23 Martin Baulig <martin@gnome.org>
14704 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14706 2002-08-23 Martin Baulig <martin@gnome.org>
14708 * struct.cs (MyStructInfo.ctor): Make this work with empty
14709 structs; it's not allowed to use foreach() on null.
14711 2002-08-23 Martin Baulig <martin@gnome.org>
14713 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14714 writer the full pathname of the generated assembly.
14716 2002-08-23 Martin Baulig <martin@gnome.org>
14718 * statements.cs (FlowBranching.UsageVector.MergeChildren):
14719 A `finally' block never returns or breaks; improved handling of
14722 2002-08-23 Martin Baulig <martin@gnome.org>
14724 * statement.cs (Throw.Resolve): Allow `throw null'.
14726 2002-08-23 Martin Baulig <martin@gnome.org>
14728 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14729 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14730 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
14731 MemberLookup would return a wrong event if this is an explicit
14732 interface implementation and the class has an event with the same
14735 2002-08-23 Martin Baulig <martin@gnome.org>
14737 * statement.cs (Block.AddChildVariableNames): New public method.
14738 (Block.AddChildVariableName): Likewise.
14739 (Block.IsVariableNameUsedInChildBlock): Likewise.
14740 (Block.AddVariable): Check whether a variable name has already
14741 been used in a child block.
14743 * cs-parser.jay (declare_local_variables): Mark all variable names
14744 from the current block as being used in a child block in the
14747 2002-08-23 Martin Baulig <martin@gnome.org>
14749 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14750 find the symbol writer.
14752 * driver.cs: csc also allows the arguments to /define being
14753 separated by commas, not only by semicolons.
14755 2002-08-23 Martin Baulig <martin@gnome.org>
14757 * interface.cs (Interface.GetMembers): Added static check for events.
14759 2002-08-15 Martin Baulig <martin@gnome.org>
14761 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14762 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14764 * ecore.cs (Expression.MemberLookup): Added documentation and explained
14765 why the MethodData.EmitDestructor() change was necessary.
14767 2002-08-20 Martin Baulig <martin@gnome.org>
14769 * class.cs (TypeContainer.FindMembers): Added static check for events.
14771 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14773 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14774 use Type.GetEvents(), not Type.FindMembers().
14776 2002-08-20 Martin Baulig <martin@gnome.org>
14778 * decl.cs (MemberCache): Added a special method cache which will
14779 be used for method-only searched. This ensures that a method
14780 search will return a MethodInfo with the correct ReflectedType for
14783 2002-08-20 Martin Baulig <martin@gnome.org>
14785 * decl.cs (DeclSpace.FindMembers): Made this public.
14787 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14789 * delegate.cs: fixed build on windows.
14790 [FIXME: Filed as bug #29150: MCS must report these errors.]
14792 2002-08-19 Ravi Pratap <ravi@ximian.com>
14794 * ecore.cs (StandardConversionExists): Return a false
14795 if we are trying to convert the void type to anything else
14796 since that is not allowed.
14798 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14799 we flag error 70 in the event an event is trying to be accessed
14800 directly from outside the declaring type.
14802 2002-08-20 Martin Baulig <martin@gnome.org>
14804 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14805 MemberCache from typemanager.cs to decl.cs.
14807 2002-08-19 Martin Baulig <martin@gnome.org>
14809 * class.cs (TypeContainer): Implement IMemberContainer.
14810 (TypeContainer.DefineMembers): Create the MemberCache.
14811 (TypeContainer.FindMembers): Do better BindingFlags checking; only
14812 return public members if BindingFlags.Public was given, check
14813 whether members are static.
14815 2002-08-16 Martin Baulig <martin@gnome.org>
14817 * decl.cs (DeclSpace.Define): Splitted this in Define and
14818 DefineMembers. DefineMembers is called first and initializes the
14821 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
14822 DefineMembers() on all our DeclSpaces.
14824 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14825 but call DefineMembers() on all nested interfaces. We call their
14826 Define() in our new Define() function.
14828 * interface.cs (Interface): Implement IMemberContainer.
14829 (Interface.Define): Moved all code except the attribute stuf to
14831 (Interface.DefineMembers): Initialize the member cache.
14833 * typemanager.cs (IMemberFinder): Removed this interface, we don't
14834 need this anymore since we can use MemberCache.FindMembers directly.
14836 2002-08-19 Martin Baulig <martin@gnome.org>
14838 * typemanager.cs (MemberCache): When creating the cache for an
14839 interface type, add all inherited members.
14840 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14841 to `out bool used_cache' and documented it.
14842 (TypeManager.MemberLookup): If we already used the cache in the first
14843 iteration, we don't need to do the interfaces check.
14845 2002-08-19 Martin Baulig <martin@gnome.org>
14847 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
14848 here from IMemberFinder and don't implement this interface anymore.
14849 (DeclSpace.MemberCache): Moved here from IMemberFinder.
14851 * typemanager.cs (IMemberFinder): This interface is now only used by
14852 classes which actually support the member cache.
14853 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14854 since we only put DeclSpaces into this Hashtable.
14855 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14856 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14858 2002-08-16 Martin Baulig <martin@gnome.org>
14860 * typemanager.cs (ICachingMemberFinder): Removed.
14861 (IMemberFinder.MemberCache): New property.
14862 (TypeManager.FindMembers): Merged this with RealFindMembers().
14863 This function will never be called from TypeManager.MemberLookup()
14864 so we can't use the cache here, just the IMemberFinder.
14865 (TypeManager.MemberLookup_FindMembers): Check whether the
14866 IMemberFinder has a MemberCache and call the cache's FindMembers
14868 (MemberCache): Rewrote larger parts of this yet another time and
14869 cleaned it up a bit.
14871 2002-08-15 Miguel de Icaza <miguel@ximian.com>
14873 * driver.cs (LoadArgs): Support quoting.
14875 (Usage): Show the CSC-like command line arguments.
14877 Improved a few error messages.
14879 2002-08-15 Martin Baulig <martin@gnome.org>
14881 * typemanager.cs (IMemberContainer.Type): New property.
14882 (IMemberContainer.IsInterface): New property.
14884 The following changes are conditional to BROKEN_RUNTIME, which is
14885 defined at the top of the file.
14887 * typemanager.cs (MemberCache.MemberCache): Don't add the base
14888 class'es members, but add all members from TypeHandle.ObjectType
14889 if we're an interface.
14890 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14891 is the current type.
14892 (MemberCache.CacheEntry.Container): Removed this field.
14893 (TypeHandle.GetMembers): Include inherited members.
14895 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14897 * typemanager.cs: fixed compilation and added a comment on a field that
14900 2002-08-15 Martin Baulig <martin@gnome.org>
14902 * class.cs (ConstructorInitializer.Resolve): In the
14903 Expression.MemberLookup call, use the queried_type as
14906 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14907 declared' attribute, it's always true.
14908 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14909 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14910 temporary wrapper for FindMembers which tells MemberLookup whether
14911 members from the base classes are included in the return value.
14912 This will go away soon.
14913 (TypeManager.MemberLookup): Use this temporary hack here; once the
14914 new MemberCache is completed, we don't need to do the DeclaredOnly
14915 looping here anymore since the MemberCache will take care of this.
14916 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14917 (MemberCache): When creating the MemberCache for a class, get
14918 members from the current class and all its base classes.
14919 (MemberCache.CacheEntry.Container): New field. This is a
14920 temporary hack until the Mono runtime is fixed to distinguish
14921 between ReflectedType and DeclaringType. It allows us to use MCS
14922 with both the MS runtime and the unfixed Mono runtime without
14923 problems and without accecting performance.
14924 (MemberCache.SearchMembers): The DeclaredOnly looping from
14925 TypeManager.MemberLookup is now done here.
14927 2002-08-14 Martin Baulig <martin@gnome.org>
14929 * statement.cs (MyStructInfo.MyStructInfo): Don't call
14930 Type.GetFields on dynamic types but get the fields from the
14931 corresponding TypeContainer.
14932 (MyStructInfo.GetStructInfo): Added check for enum types.
14934 * typemanager.cs (MemberList.IsSynchronized): Implemented.
14935 (MemberList.SyncRoot): Implemented.
14936 (TypeManager.FilterWithClosure): No need to check permissions if
14937 closure_start_type == closure_invocation_type, don't crash if
14938 closure_invocation_type is null.
14940 2002-08-13 Martin Baulig <martin@gnome.org>
14942 Rewrote TypeContainer.FindMembers to use a member cache. This
14943 gives us a speed increase of about 35% for the self-hosting MCS
14944 build and of about 15-20% for the class libs (both on GNU/Linux).
14946 * report.cs (Timer): New class to get enhanced profiling. This
14947 whole class is "TIMER" conditional since it remarkably slows down
14950 * class.cs (MemberList): New class. This is an IList wrapper
14951 which we're now using instead of passing MemberInfo[]'s around to
14952 avoid copying this array unnecessarily.
14953 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14954 (ICachingMemberFinder, IMemberContainer): New interface.
14955 (TypeManager.FilterWithClosure): If `criteria' is null, the name
14956 has already been checked, otherwise use it for the name comparision.
14957 (TypeManager.FindMembers): Renamed to RealMemberFinder and
14958 provided wrapper which tries to use ICachingMemberFinder.FindMembers
14959 if possible. Returns a MemberList, not a MemberInfo [].
14960 (TypeHandle): New class, implements IMemberContainer. We create
14961 one instance of this class per type, it contains a MemberCache
14962 which is used to do the member lookups.
14963 (MemberCache): New class. Each instance of this class contains
14964 all members of a type and a name-based hash table.
14965 (MemberCache.FindMembers): This is our new member lookup
14966 function. First, it looks up all members of the requested name in
14967 the hash table. Then, it walks this list and sorts out all
14968 applicable members and returns them.
14970 2002-08-13 Martin Baulig <martin@gnome.org>
14972 In addition to a nice code cleanup, this gives us a performance
14973 increase of about 1.4% on GNU/Linux - not much, but it's already
14974 half a second for the self-hosting MCS compilation.
14976 * typemanager.cs (IMemberFinder): New interface. It is used by
14977 TypeManager.FindMembers to call FindMembers on a TypeContainer,
14978 Enum, Delegate or Interface.
14979 (TypeManager.finder_to_member_finder): New PtrHashtable.
14980 (TypeManager.finder_to_container): Removed.
14981 (TypeManager.finder_to_delegate): Removed.
14982 (TypeManager.finder_to_interface): Removed.
14983 (TypeManager.finder_to_enum): Removed.
14985 * interface.cs (Interface): Implement IMemberFinder.
14987 * delegate.cs (Delegate): Implement IMemberFinder.
14989 * enum.cs (Enum): Implement IMemberFinder.
14991 * class.cs (TypeContainer): Implement IMemberFinder.
14993 2002-08-12 Martin Baulig <martin@gnome.org>
14995 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14997 2002-08-12 Martin Baulig <martin@gnome.org>
14999 * ecore.cs (ITypeExpression): New interface for expressions which
15001 (TypeExpression): Renamed to TypeLookupExpression.
15002 (Expression.DoResolve): If we're doing a types-only lookup, the
15003 expression must implement the ITypeExpression interface and we
15004 call DoResolveType() on it.
15005 (SimpleName): Implement the new ITypeExpression interface.
15006 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15007 hack, the situation that we're only looking up types can't happen
15008 anymore when this method is called. Moved the type lookup code to
15009 DoResolveType() and call it.
15010 (SimpleName.DoResolveType): This ITypeExpression interface method
15011 is now doing the types-only lookup.
15012 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15013 (ResolveFlags): Added MaskExprClass.
15015 * expression.cs (MemberAccess): Implement the ITypeExpression
15017 (MemberAccess.DoResolve): Added support for a types-only lookup
15018 when we're called via ITypeExpression.DoResolveType().
15019 (ComposedCast): Implement the ITypeExpression interface.
15021 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
15022 Expression.Resolve() with ResolveFlags.Type instead.
15024 2002-08-12 Martin Baulig <martin@gnome.org>
15026 * interface.cs (Interface.Define): Apply attributes.
15028 * attribute.cs (Attribute.ApplyAttributes): Added support for
15029 interface attributes.
15031 2002-08-11 Martin Baulig <martin@gnome.org>
15033 * statement.cs (Block.Emit): Only check the "this" variable if we
15034 do not always throw an exception.
15036 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15037 whether the property has a set accessor.
15039 2002-08-11 Martin Baulig <martin@gnome.org>
15041 Added control flow analysis support for structs.
15043 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15044 with control flow analysis turned off.
15045 (IVariable): New interface.
15046 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15047 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15048 (FieldExpr.DoResolve): Resolve the instance expression with flow
15049 analysis turned off and do the definite assignment check after the
15050 resolving when we know what the expression will resolve to.
15052 * expression.cs (LocalVariableReference, ParameterReference):
15053 Implement the new IVariable interface, only call the flow analysis
15054 code if ec.DoFlowAnalysis is true.
15055 (This): Added constructor which takes a Block argument. Implement
15056 the new IVariable interface.
15057 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15058 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15059 This does the definite assignment checks for struct members.
15061 * class.cs (Constructor.Emit): If this is a non-static `struct'
15062 constructor which doesn't have any initializer, call
15063 Block.AddThisVariable() to tell the flow analysis code that all
15064 struct elements must be initialized before control returns from
15067 * statement.cs (MyStructInfo): New public class.
15068 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15069 argument to this indexer. If non-zero, check an individual struct
15070 member, not the whole struct.
15071 (FlowBranching.CheckOutParameters): Check struct members.
15072 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15073 overloaded versions of these methods which take an additional
15074 `int field_idx' argument to check struct members.
15075 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15076 overloaded versions of these methods which take an additional
15077 `string field_name' argument to check struct member.s
15078 (VariableInfo): Implement the IVariable interface.
15079 (VariableInfo.StructInfo): New public property. Returns the
15080 MyStructInfo instance of the variable if it's a struct or null.
15081 (Block.AddThisVariable): New public method. This is called from
15082 Constructor.Emit() for non-static `struct' constructor which do
15083 not have any initializer. It creates a special variable for the
15084 "this" instance variable which will be checked by the flow
15085 analysis code to ensure that all of the struct's fields are
15086 initialized before control returns from the constructor.
15087 (UsageVector): Added support for struct members. If a
15088 variable/parameter is a struct with N members, we reserve a slot
15089 in the usage vector for each member. A struct is considered fully
15090 initialized if either the struct itself (slot 0) or all its
15091 members are initialized.
15093 2002-08-08 Martin Baulig <martin@gnome.org>
15095 * driver.cs (Driver.MainDriver): Only report an error CS5001
15096 if there were no compilation errors.
15098 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15099 `UnsafeContext' property to determine whether the parent is in
15100 unsafe context rather than checking the parent's ModFlags:
15101 classes nested in an unsafe class are unsafe as well.
15103 2002-08-08 Martin Baulig <martin@gnome.org>
15105 * statement.cs (UsageVector.MergeChildren): Distinguish between
15106 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15107 we return. Added test17() and test18() to test-154.cs.
15109 2002-08-08 Martin Baulig <martin@gnome.org>
15111 * typemanager.cs (TypeManager.FilterWithClosure): If we have
15112 Family access, make sure the invoking type isn't a subclass of the
15113 queried type (that'd be a CS1540).
15115 * ecore.cs (Expression.MemberLookup): Added overloaded version of
15116 this method which takes an additional `Type invocation_type'.
15118 * expression.cs (BaseAccess.DoResolve): Use the base type as
15119 invocation and query type.
15120 (MemberAccess.DoResolve): If the lookup failed and we're about to
15121 report a CS0122, try a lookup with the ec.ContainerType - if this
15122 succeeds, we must report a CS1540.
15124 2002-08-08 Martin Baulig <martin@gnome.org>
15126 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15127 (MethodGroupExpr): Implement the IMemberExpr interface.
15129 * expression (MemberAccess.ResolveMemberAccess): No need to have
15130 any special code for MethodGroupExprs anymore, they're now
15133 2002-08-08 Martin Baulig <martin@gnome.org>
15135 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15136 Family, FamANDAssem and FamORAssem permissions.
15137 (TypeManager.IsSubclassOrNestedChildOf): New public method.
15139 2002-08-08 Martin Baulig <martin@gnome.org>
15141 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15142 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15145 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15147 * driver.cs: implemented /resource option to embed managed resources.
15149 2002-08-07 Martin Baulig <martin@gnome.org>
15151 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15152 (FieldBase.HasFieldInitializer): New public property.
15153 (FieldBase.GetInitializerExpression): New public method. Resolves and
15154 returns the field initializer and makes sure it is only resolved once.
15155 (TypeContainer.EmitFieldInitializers): Call
15156 FieldBase.GetInitializerExpression to get the initializer, this ensures
15157 that it isn't resolved multiple times.
15159 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
15160 the resolving process (SimpleName/MemberLookup) that we're currently
15161 emitting a field initializer (which must not access any instance members,
15162 this is an error CS0236).
15164 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15165 argument, if the `IsFieldInitializer' flag is set, we must report and
15166 error CS0236 and not an error CS0120.
15168 2002-08-07 Martin Baulig <martin@gnome.org>
15170 * ecore.cs (IMemberExpr): New public interface.
15171 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15172 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15173 if the expression is an IMemberExpr.
15175 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15176 to be null, implicitly default to `this' if we're non-static in
15177 this case. Simplified the code a lot by using the new IMemberExpr
15178 interface. Also fixed bug #28176 here.
15180 2002-08-06 Martin Baulig <martin@gnome.org>
15182 * cs-parser.jay (SimpleLookup): Removed. We need to create
15183 ParameterReferences during semantic analysis so that we can do a
15184 type-only search when resolving Cast, TypeOf and SizeOf.
15185 (block): Pass the `current_local_parameters' to the Block's
15188 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15189 argument to the constructor.
15190 (ConstructorInitializer.Resolve): Create a temporary implicit
15191 block with the parameters.
15193 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15194 references here if we aren't doing a type-only search.
15196 * statement.cs (Block): Added constructor which takes a
15197 `Parameters parameters' argument.
15198 (Block.Parameters): New public property.
15200 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15201 to `Parameters' and made it public readonly.
15203 2002-08-06 Martin Baulig <martin@gnome.org>
15205 * ecore.cs (Expression.Warning): Made this public as well.
15207 * report.cs (Report.Debug): Print the contents of collections.
15209 2002-08-06 Martin Baulig <martin@gnome.org>
15211 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
15212 used to tell Resolve() which kinds of expressions it may return.
15213 (Expression.Resolve): Added overloaded version of this method which
15214 takes a `ResolveFlags flags' argument. This can be used to tell
15215 Resolve() which kinds of expressions it may return. Reports a
15217 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15218 ResolveFlags.SimpleName.
15219 (Expression.Error118): Added overloaded version of this method which
15220 takes a `ResolveFlags flags' argument. It uses the flags to determine
15221 which kinds of expressions are allowed.
15223 * expression.cs (Argument.ResolveMethodGroup): New public method.
15224 Resolves an argument, but allows a MethodGroup to be returned.
15225 This is used when invoking a delegate.
15227 * TODO: Updated a bit.
15229 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15231 Fixed compilation with csc.
15233 * ecore.cs: Expression.Error made public. Is this correct? Should
15234 Warning be made public too?
15236 * expression.cs: use ea.Location instead of ea.loc.
15237 [FIXME: Filed as bug #28607: MCS must report these errors.]
15239 2002-08-06 Martin Baulig <martin@gnome.org>
15241 * ecore.cs (Expression.loc): Moved the location here instead of
15242 duplicating it in all derived classes.
15243 (Expression.Location): New public property.
15244 (Expression.Error, Expression.Warning): Made them non-static and
15245 removed the location argument.
15246 (Expression.Warning): Added overloaded version which takes an
15247 `int level' argument.
15248 (Expression.Error118): Make this non-static and removed the
15249 expression and location arguments.
15250 (TypeExpr): Added location argument to the constructor.
15252 * expression.cs (StaticCallExpr): Added location argument to
15254 (Indirection, PointerArithmetic): Likewise.
15255 (CheckedExpr, UnCheckedExpr): Likewise.
15256 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15257 (StringPtr): Likewise.
15260 2002-08-05 Martin Baulig <martin@gnome.org>
15262 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15264 * assign.cs (Assign.DoResolve): Check whether the source
15265 expression is a value or variable.
15267 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15268 while resolving the corresponding blocks.
15270 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15271 an error, don't silently return null.
15273 * statement.cs (Block.AddVariable): Do the error reporting here
15274 and distinguish between CS0128 and CS0136.
15275 (Block.DoResolve): Report all unused labels (warning CS0164).
15276 (LabeledStatement): Pass the location to the constructor.
15277 (LabeledStatement.HasBeenReferenced): New property.
15278 (LabeledStatement.Resolve): Set it to true here.
15280 * statement.cs (Return.Emit): Return success even after reporting
15281 a type mismatch error (CS0126 or CS0127), this is what csc does and
15282 it avoids confusing the users with any consecutive errors.
15284 2002-08-05 Martin Baulig <martin@gnome.org>
15286 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15288 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15290 * expression.cs (MemberAccess.DoResolve): Silently return if an
15291 error has already been reported.
15293 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15294 error has already been reported.
15296 2002-08-05 Martin Baulig <martin@gnome.org>
15298 * statement.cs (UsageVector): Only initialize the `parameters'
15299 vector if we actually have any "out" parameters.
15301 2002-08-05 Martin Baulig <martin@gnome.org>
15303 * expression.cs (Binary.ResolveOperator): When combining delegates,
15304 they must have the same type.
15306 2002-08-05 Martin Baulig <martin@gnome.org>
15308 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15309 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15310 work with the ms runtime and we also don't need it: if we're a
15311 PropertyBuilder and not in the `indexer_arguments' hash, then we
15312 are a property and not an indexer.
15314 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15315 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15316 since the latter one doesn't work with the ms runtime.
15318 2002-08-03 Martin Baulig <martin@gnome.org>
15320 Fixed bugs #27998 and #22735.
15322 * class.cs (Method.IsOperator): New public field.
15323 (Method.CheckBase): Report CS0111 if there's already a method
15324 with the same parameters in the current class. Report CS0508 when
15325 attempting to change the return type of an inherited method.
15326 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15327 and it's not marked abstract or extern.
15328 (PropertyBase): New abstract base class for Property and Indexer.
15329 (PropertyBase.CheckBase): Moved here from Property and made it work
15331 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15332 the same so we can reuse it there.
15333 (Property, Indexer): Derive from PropertyBase.
15334 (MethodSignature.inheritable_property_signature_filter): New delegate
15335 to find properties and indexers.
15337 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15338 argument and improved error reporting.
15340 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15341 EmptyReadOnlyParameters and made it a property.
15343 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15344 version of this method which takes a `PropertyInfo indexer'.
15345 (TypeManager.RegisterIndexer): New method.
15347 * class.cs: Added myself as author of this file :-)
15349 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15351 * class.cs: fixed compilation on windoze.
15353 2002-08-03 Martin Baulig <martin@gnome.org>
15355 * interface.cs (Interface.GetInterfaceBases): Check whether all
15356 base interfaces are at least as accessible than the current one.
15358 * class.cs (TypeContainer.GetClassBases): Check whether base types
15359 are at least as accessible than the current type.
15360 (TypeContainer.AsAccessible): Implemented and made non-static.
15361 (MemberBase.CheckParameters): Report errors if the accessibility
15364 * delegate.cs (Delegate.Delegate): The default visibility is
15365 internal for top-level types and private for nested types.
15366 (Delegate.Define): Report errors if the accessibility checks fail.
15368 * enum.cs (Enum.Enum): The default visibility is internal for
15369 top-level types and private for nested types.
15370 (Enum.DefineType): Compute the correct visibility.
15372 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15373 function which takes a `bool is_toplevel' instead of a TypeContainer.
15375 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15378 2002-08-02 Martin Baulig <martin@gnome.org>
15380 * expression.cs (LocalVariableReferenc): Added constructor which
15381 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15382 (LocalVariableReference.IsReadOnly): New property.
15383 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15384 variable is readonly, use our own readonly flag to do this; you can
15385 use the new constructor to get a writable reference to a read-only
15388 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15389 reference to the local variable.
15391 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15393 * rootcontext.cs (ResolveCore): Also include System.Exception
15395 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15396 we reach an EmptyStatement.
15398 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15401 * expression.cs (Binary.ResolveOperator): Check error result in
15404 use brtrue/brfalse directly and avoid compares to null.
15406 2002-08-02 Martin Baulig <martin@gnome.org>
15408 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15409 Fixes bug #28407, added test-155.cs.
15411 2002-08-01 Martin Baulig <martin@gnome.org>
15413 * class.cs (Event.EmitDefaultMethod): Make this work with static
15414 events. Fixes #28311, added verify-3.cs.
15416 2002-08-01 Martin Baulig <martin@gnome.org>
15418 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15419 `is_disposable' fields.
15420 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15421 `hm.is_disposable' if we're using the collection pattern.
15422 (Foreach.EmitCollectionForeach): Use the correct type for the
15423 enumerator's local variable, only emit the try/finally block if
15424 necessary (fixes #27713).
15426 2002-08-01 Martin Baulig <martin@gnome.org>
15428 * ecore.cs (Expression.report118): Renamed to Error118 and made
15431 * statement.cs (Throw.Resolve): Check whether the expression is of
15432 the correct type (CS0118) and whether the type derives from
15433 System.Exception (CS0155).
15434 (Catch.Resolve): New method. Do the type lookup here and check
15435 whether it derives from System.Exception (CS0155).
15436 (Catch.CatchType, Catch.IsGeneral): New public properties.
15438 * typemanager.cs (TypeManager.exception_type): Added.
15440 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15442 * driver.cs: Updated About function.
15444 2002-07-31 Martin Baulig <martin@gnome.org>
15446 Implemented Control Flow Analysis.
15448 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15449 (EmitContext.CurrentBranching): Added.
15450 (EmitContext.StartFlowBranching): Added.
15451 (EmitContext.EndFlowBranching): Added.
15452 (EmitContext.KillFlowBranching): Added.
15453 (EmitContext.IsVariableAssigned): Added.
15454 (EmitContext.SetVariableAssigned): Added.
15455 (EmitContext.IsParameterAssigned): Added.
15456 (EmitContext.SetParameterAssigned): Added.
15457 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15458 Added control flow analysis stuff here.
15460 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15461 resolve the expression as lvalue.
15462 (LocalVariableReference.DoResolve): Check whether the variable has
15463 already been assigned.
15464 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15465 the parameter as assigned here.
15466 (ParameterReference.DoResolve): Check whether the parameter has already
15468 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15469 expression as lvalue.
15471 * statement.cs (FlowBranching): New class for the flow analysis code.
15472 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15473 (LabeledStatement.IsDefined): New public property.
15474 (LabeledStatement.AddUsageVector): New public method to tell flow
15475 analyis that the label may be reached via a forward jump.
15476 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15478 (VariableInfo.Number): New public field. This is used by flow analysis
15479 to number all locals of a block.
15480 (Block.CountVariables): New public property. This is the number of
15481 local variables in this block (including the locals from all parent
15483 (Block.EmitMeta): Number all the variables.
15485 * statement.cs: Added flow analysis support to all classes.
15487 2002-07-31 Martin Baulig <martin@gnome.org>
15489 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15490 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15491 then use this argument.
15493 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15495 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15496 use this to specify /define options.
15498 2002-07-29 Martin Baulig <martin@gnome.org>
15500 * statement.cs (Fixed): Moved all code that does variable lookups
15501 and resolvings from Emit to Resolve.
15503 * statement.cs (For): Moved all code that does variable lookups
15504 and resolvings from Emit to Resolve.
15506 * statement.cs (Using): Moved all code that does variable lookups
15507 and resolvings from Emit to Resolve.
15509 2002-07-29 Martin Baulig <martin@gnome.org>
15511 * attribute.cs (Attribute.Resolve): Explicitly catch a
15512 System.NullReferenceException when creating the
15513 CustromAttributeBuilder and report a different warning message.
15515 2002-07-29 Martin Baulig <martin@gnome.org>
15517 * support.cs (ParameterData.ParameterName): Added method to
15518 get the name of a parameter.
15520 * typemanager.cs (TypeManager.IsValueType): New public method.
15522 2002-07-29 Martin Baulig <martin@gnome.org>
15524 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
15525 is a flag which specifies that it's either ref or out.
15526 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15527 the out parameter to `out Parameter.Modifier mod', also set the
15528 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15530 * support.cs (InternalParameters.ParameterModifier): Distinguish
15531 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15532 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15534 * expression.cs (Argument.GetParameterModifier): Distinguish
15535 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15536 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15538 2002-07-29 Martin Baulig <martin@gnome.org>
15540 * expression.cs (ParameterReference.ParameterReference): Added
15541 `Location loc' argument to the constructor.
15543 * cs-parser.jay: Pass location to ParameterReference.
15545 2002-07-28 Miguel de Icaza <miguel@ximian.com>
15547 * statement.cs (Try): Initialize the location.
15549 * cs-parser.jay: pass location to Try.
15551 * expression.cs (Unary.Reduce): Change the prototype to return
15552 whether a constant fold could be performed or not. The result is
15553 returned in an out parameters. In the case of Indirection and
15554 AddressOf, we want to perform the full tests.
15556 2002-07-26 Miguel de Icaza <miguel@ximian.com>
15558 * statement.cs (Statement.Emit): Flag dead code.
15560 2002-07-27 Andrew Birkett <andy@nobugs.org>
15562 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15564 2002-07-27 Martin Baulig <martin@gnome.org>
15566 * class.cs (MethodData.Define): Put back call to
15567 TypeManager.AddMethod(), accidentally commented this out.
15569 * report.cs (Debug): New public method to print debugging information,
15570 this is `[Conditional ("DEBUG")]'.
15572 2002-07-26 Martin Baulig <martin@gnome.org>
15574 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15575 (switch_statement): Push the current_block to the switch_stack and
15576 pop it again when we're done with the switch.
15577 (switch_section): The new block is a child of the current_block.
15578 Fixes bug #24007, added test-152.cs.
15580 2002-07-27 Martin Baulig <martin@gnome.org>
15582 * expression.cs (Invocation.EmitArguments): When calling a varargs
15583 function with only its fixed arguments, we need to pass an empty
15586 2002-07-27 Martin Baulig <martin@gnome.org>
15588 Mono 0.13 has been released.
15590 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15592 * driver.cs: Rename --resource to --linkres, because that is what
15593 we do currently, we dont support --resource yet.
15595 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15597 2002-07-25 Martin Baulig <martin@gnome.org>
15599 * class.cs (MethodData): New public class. This is a `method builder'
15600 class for a method or one accessor of a Property/Indexer/Event.
15601 (MethodData.GetMethodFlags): Moved here from MemberBase.
15602 (MethodData.ApplyAttributes): Likewise.
15603 (MethodData.ApplyObsoleteAttribute): Likewise.
15604 (MethodData.ApplyConditionalAttribute): Likewise.
15605 (MethodData.ApplyDllImportAttribute): Likewise.
15606 (MethodData.CheckAbstractAndExternal): Likewise.
15607 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15608 (MethodData.Emit): Formerly known as Method.Emit().
15609 (MemberBase): Moved everything which was specific to a single
15610 accessor/method to MethodData.
15611 (Method): Create a new MethodData and call Define() and Emit() on it.
15612 (Property, Indexer, Event): Create a new MethodData objects for each
15613 accessor and call Define() and Emit() on them.
15615 2002-07-25 Martin Baulig <martin@gnome.org>
15617 Made MethodCore derive from MemberBase to reuse the code from there.
15618 MemberBase now also checks for attributes.
15620 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15621 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15623 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15624 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15625 (MemberBase.ApplyAttributes): New virtual method; applies the
15626 attributes to a method or accessor.
15627 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15628 (MemberBase.ApplyConditionalAttribute): Likewise.
15629 (MemberBase.ApplyDllImportAttribute): Likewise.
15630 (MemberBase.CheckAbstractAndExternal): Likewise.
15631 (MethodCore.ParameterTypes): This is now a property instead of a
15632 method, it's initialized from DoDefineParameters().
15633 (MethodCore.ParameterInfo): Removed the set accessor.
15634 (MethodCore.DoDefineParameters): New protected virtual method to
15635 initialize ParameterTypes and ParameterInfo.
15636 (Method.GetReturnType): We can now simply return the MemberType.
15637 (Method.GetMethodFlags): Override the MemberBase version and add
15638 the conditional flags.
15639 (Method.CheckBase): Moved some code from Define() here, call
15640 DoDefineParameters() here.
15641 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15642 here to avoid some larger code duplication.
15643 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15644 ensure that abstract and external accessors don't declare a body.
15646 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15647 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15648 lookup in the attribute's parent classes, so we need to abort as soon
15649 as we found the first match.
15650 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15651 the attribute has no arguments.
15653 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15656 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15658 * cs-parser.jay: reverted previous patch.
15660 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15662 * cs-parser.jay: fixed bug #22119.
15664 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15666 * attribute.cs: fixed compilation. The error was:
15667 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
15668 be assigned to before control leaves the current method."
15669 [FIXME: Filed as bug #28186: MCS must report this error.]
15671 2002-07-25 Martin Baulig <martin@gnome.org>
15673 * attribute.cs (Attribute.Conditional_GetConditionName): New static
15674 method to pull the condition name ouf of a Conditional attribute.
15675 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15676 the obsolete message and error flag out of an Obsolete attribute.
15678 * class.cs (Method.GetMethodFlags): New public method to get the
15679 TypeManager.MethodFlags for this method.
15680 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15682 (Method.Define): Get and apply the Obsolete and Conditional attributes;
15683 if we're overriding a virtual function, set the new private variable
15684 `parent_method'; call the new TypeManager.AddMethod().
15686 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
15687 the MethodBuilder and the Method in a PtrHashtable.
15688 (TypeManager.builder_to_method): Added for this purpose.
15689 (TypeManager.MethodFlags): Added IsObsoleteError.
15690 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
15691 Obsolete and Conditional arguments in MethodBuilders. If we discover
15692 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15693 the message from the attribute.
15695 2002-07-24 Martin Baulig <martin@gnome.org>
15697 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15698 preprocessor directives, ensure that the argument to #define/#undef is
15699 exactly one identifier and that it's actually an identifier.
15701 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15704 2002-07-24 Martin Baulig <martin@gnome.org>
15706 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15707 initialize it to TypeManager.object_type in the constructor.
15708 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15709 of the `hm.get_current' method if we're using the collection pattern.
15710 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15711 for the explicit conversion to make it work when we're using the collection
15712 pattern and the `Current' property has a different return type than `object'.
15715 2002-07-24 Martin Baulig <martin@gnome.org>
15717 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15718 does not match, but don't report any errors. This method is called in
15719 order for all methods in a MethodGroupExpr until a matching method is
15720 found, so we don't want to bail out if the first method doesn't match.
15721 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15722 matches, report the 123. Fixes #28070.
15724 2002-07-24 Martin Baulig <martin@gnome.org>
15726 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15727 TypeManager.TypeToCoreType() to the top of the method so the
15728 following equality checks will work. Fixes #28107.
15730 2002-07-24 Martin Baulig <martin@gnome.org>
15732 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15733 operand is of type uint, and the other operand is of type sbyte,
15734 short or int, the operands are converted to type long." -
15735 Actually do what this comment already told us. Fixes bug #28106,
15738 2002-07-24 Martin Baulig <martin@gnome.org>
15740 * class.cs (MethodBase): New abstract class. This is now a base
15741 class for Property, Indexer and Event to avoid some code duplication
15742 in their Define() and DefineMethods() methods.
15743 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15744 generic methods for Define() and DefineMethods().
15745 (FieldBase): Derive from MemberBase, not MemberCore.
15746 (Property): Derive from MemberBase, not MemberCore.
15747 (Property.DefineMethod): Moved all the code from this method to the
15748 new MethodBase.DefineAccessor(), just call it with appropriate
15750 (Property.Define): Call the new Property.DoDefine(), this does some
15751 sanity checks and we don't need to duplicate the code everywhere.
15752 (Event): Derive from MemberBase, not MemberCore.
15753 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15754 accessors, this will also make them work with interface events.
15755 (Indexer): Derive from MemberBase, not MemberCore.
15756 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15757 (Indexer.Define): Use the new MethodBase functions.
15759 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15760 argument to the constructor.
15761 (Interface.FindMembers): Added support for interface events.
15762 (Interface.PopluateEvent): Implemented.
15764 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
15766 2002-07-22 Miguel de Icaza <miguel@ximian.com>
15768 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15769 but this is required to check for a method name being the same as
15770 the containing class.
15774 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15776 * interface.cs: initialize variable.
15778 2002-07-23 Martin Baulig <martin@gnome.org>
15780 Implemented the IndexerName attribute in interfaces.
15782 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15783 name if this is an explicit interface implementation.
15784 (Indexer.InterfaceIndexerName): New public variable. If we're
15785 implementing an interface indexer, this is the IndexerName in that
15786 interface. Otherwise, it's the IndexerName.
15787 (Indexer.DefineMethod): If we're implementing interface indexer,
15788 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
15789 and Pending.ImplementIndexer methods.
15790 (Indexer.Define): Also define the PropertyBuilder if we're
15791 implementing an interface indexer and this is neither an explicit
15792 interface implementation nor do the IndexerName match the one in
15795 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15796 If a method is defined here, then we always need to create a proxy
15797 for it. This is used when implementing interface indexers.
15798 (Pending.IsInterfaceIndexer): New public method.
15799 (Pending.ImplementIndexer): New public method.
15800 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15801 This is used when implementing interface indexers to define a proxy
15803 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15804 define a proxy if necessary.
15806 * interface.cs (Interface.IndexerName): New public variable.
15807 (Interface.PopulateIndexer): Set the IndexerName.
15808 (Interface.DefineIndexers): New private method. Populate all the
15809 indexers and make sure their IndexerNames match.
15811 * typemanager.cs (IndexerPropertyName): Added support for interface
15814 2002-07-22 Martin Baulig <martin@gnome.org>
15816 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15817 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15818 ret if HasReturnLabel.
15819 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15822 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15823 and set the ec.LoopBeginTryCatchLevel.
15824 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15825 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15826 the current ec.TryCatchLevel, the branch goes out of an exception
15827 block. In this case, we need to use Leave and not Br.
15829 2002-07-22 Martin Baulig <martin@gnome.org>
15831 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15832 block unless the block does not always return or it is contained in
15833 another try { ... } catch { ... } block. Fixes bug #26506.
15834 Added verify-1.cs to the test suite.
15836 2002-07-22 Martin Baulig <martin@gnome.org>
15838 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15839 then we do not always return. Fixes bug #24985.
15841 2002-07-22 Martin Baulig <martin@gnome.org>
15843 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15844 lookup on a per-class level; ie. walk up the class hierarchy until we
15845 found at least one applicable method, then choose the best among them.
15846 Fixes bug #24463 and test-29.cs.
15848 2002-07-22 Martin Baulig <martin@gnome.org>
15850 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15851 return types of the methods. The return type is not part of the
15852 signature and we must not check it to make the `new' modifier work.
15853 Fixes bug #27999, also added test-147.cs.
15854 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15856 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15857 on the method's return type.
15859 2002-07-21 Martin Baulig <martin@gnome.org>
15861 * assign.cs: Make this work if the rightmost source is a constant and
15862 we need to do an implicit type conversion. Also adding a few more tests
15863 to test-38.cs which should have caught this.
15865 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15866 target in the makefile for this. The makefile.gnu is primarily intended
15867 for end-users who don't want to debug the compiler.
15869 2002-07-21 Martin Baulig <martin@gnome.org>
15871 * assign.cs: Improved the Assign class so it can now handle embedded
15872 assignments (X = Y = Z = something). As a side-effect this'll now also
15873 consume less local variables. test-38.cs now passes with MCS, added
15874 a few new test cases to that test.
15876 2002-07-20 Martin Baulig <martin@gnome.org>
15878 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15879 instructions. Fixes bug #27977, also added test-146.cs.
15881 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15883 * cs-tokenizer.cs: fixed getHex ().
15885 2002-07-19 Martin Baulig <martin@gnome.org>
15887 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15888 not Type.GetType() to lookup the array type. This is needed when
15889 we're constructing an array of a user-defined type.
15890 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15891 single-dimensional arrays, but also for single-dimensial arrays of
15894 2002-07-19 Martin Baulig <martin@gnome.org>
15896 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15897 this function is called, it's not allowed to share LocalBuilders
15898 among ILGenerators.
15900 2002-07-19 Martin Baulig <martin@gnome.org>
15902 * expression.cs (Argument.Resolve): Report an error 118 when trying
15903 to pass a type as argument.
15905 2002-07-18 Martin Baulig <martin@gnome.org>
15907 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15908 Conv_R_Un for the signed `long' type.
15910 2002-07-15 Miguel de Icaza <miguel@ximian.com>
15912 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15913 `expr' for the temporary result, as that will fail if we do
15914 multiple resolves on the same expression.
15916 2002-07-05 Miguel de Icaza <miguel@ximian.com>
15918 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15919 ec.TypeContainer for looking up aliases.
15921 * class.cs (TypeContainer): Remove LookupAlias from here.
15923 * decl.cs (DeclSpace); Move here.
15925 2002-07-01 Miguel de Icaza <miguel@ximian.com>
15927 * class.cs (FindMembers): Only call filter if the constructor
15928 bulider is not null.
15930 Also handle delegates in `NestedTypes' now. Now we will perform
15931 type lookups using the standard resolution process. This also
15934 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15935 This uses Expressions (the limited kind that can be parsed by the
15936 tree) instead of strings.
15938 * expression.cs (ComposedCast.ToString): Implement, used to flag
15939 errors since now we have to render expressions.
15941 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
15944 * ecore.cs (SimpleName.ToString): ditto.
15946 * cs-parser.jay: Instead of using strings to assemble types, use
15947 Expressions to assemble the type (using SimpleName, ComposedCast,
15948 MemberAccess). This should fix the type lookups in declarations,
15949 because we were using a different code path for this.
15951 * statement.cs (Block.Resolve): Continue processing statements
15952 even when there is an error.
15954 2002-07-17 Miguel de Icaza <miguel@ximian.com>
15956 * class.cs (Event.Define): Also remove the `remove' method from
15957 the list of pending items.
15959 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15960 generate more compact code.
15962 2002-07-17 Martin Baulig <martin@gnome.org>
15964 * const.cs (Const.LookupConstantValue): Add support for constant
15965 `unchecked' and `checked' expressions.
15966 Also adding test case test-140.cs for this.
15968 2002-07-17 Martin Baulig <martin@gnome.org>
15970 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15971 check whether mi.ReturnType implements the IEnumerator interface; the
15972 `==' and the IsAssignableFrom() will fail in this situation.
15974 2002-07-16 Ravi Pratap <ravi@ximian.com>
15976 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
15979 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15981 * expression.cs: fixed bug #27811.
15983 2002-07-14 Miguel de Icaza <miguel@ximian.com>
15985 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15986 Molaro: when we are a ref, the value already contains a pointer
15987 value, do not take the address of it.
15989 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15990 * removed mb-parser.jay and mb-tokenizer.cs
15992 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15994 * expression.cs: check against the building corlib void type.
15996 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15998 * ecore.cs: fix for valuetype static readonly fields: when
15999 initializing them, we need their address, not the address of a copy.
16001 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16003 * typemanager.cs: register also enum_type in corlib.
16005 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16007 * class.cs: allow calling this (but not base) initializers in structs.
16009 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16011 * ecore.cs: make sure we compare against the building base types
16014 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16016 * typemanager.cs: fix TypeToCoreType() to handle void and object
16017 (corlib gets no more typerefs after this change).
16019 2002-07-12 Miguel de Icaza <miguel@ximian.com>
16021 * expression.cs (ArrayCreation.EmitArrayArguments): use
16022 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16024 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16025 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
16026 array indexes, the runtime actually forbids them.
16028 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16029 for array arguments here.
16031 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16032 instead of the default for ValueTypes.
16034 (New.DoEmit): Use IsValueType instead of
16035 IsSubclassOf (value_type)
16036 (New.DoResolve): ditto.
16037 (Invocation.EmitCall): ditto.
16039 * assign.cs (Assign): ditto.
16041 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16042 Statements *are* currently doing part of their resolution during
16045 Expressions do always resolve during resolve, but statements are
16046 only required to propagate resolution to their children.
16048 2002-07-11 Miguel de Icaza <miguel@ximian.com>
16050 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16052 (LoadAssembly): Do not add the dll if it is already specified
16054 (MainDriver): Add the System directory to the link path at the end,
16055 after all the other -L arguments.
16057 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16058 wrong opcode for loading bytes and bools (ldelem.i1 instead of
16059 ldelem.u1) and using the opposite for sbytes.
16061 This fixes Digger, and we can finally run it.
16063 * driver.cs (UnixParseOption): Move the option parsing here.
16064 (CSCParseOption): Implement CSC-like parsing of options.
16066 We now support both modes of operation, the old Unix way, and the
16067 new CSC-like way. This should help those who wanted to make cross
16068 platform makefiles.
16070 The only thing broken is that /r:, /reference: and /lib: are not
16071 implemented, because I want to make those have the same semantics
16072 as the CSC compiler has, and kill once and for all the confussion
16073 around this. Will be doing this tomorrow.
16075 * statement.cs (Unsafe.Resolve): The state is checked during
16076 resolve, not emit, so we have to set the flags for IsUnsfe here.
16078 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16080 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16081 not catch the Error_ObjectRefRequired in SimpleName (as it is
16082 possible to have a class/instance variable name that later gets
16083 deambiguated), we have to check this here.
16085 2002-07-10 Ravi Pratap <ravi@ximian.com>
16087 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16088 make static and put into Expression.
16090 (Event.Define): Register the private field of the event with the
16091 TypeManager so that GetFieldFromEvent can get at it.
16093 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16094 keep track of the private field associated with an event which
16097 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16100 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16102 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16104 * expression.cs (Binary.EmitBranchable): this routine emits the
16105 Binary expression in a branchable context. This basically means:
16106 we need to branch somewhere, not just get the value on the stack.
16108 This works together with Statement.EmitBoolExpression.
16110 * statement.cs (Statement.EmitBoolExpression): Use
16113 2002-07-09 Miguel de Icaza <miguel@ximian.com>
16115 * statement.cs (For): Reduce the number of jumps in loops.
16117 (For): Implement loop inversion for the For statement.
16119 (Break): We can be breaking out of a Try/Catch controlled section
16120 (foreach might have an implicit try/catch clause), so we need to
16121 use Leave instead of Br.
16123 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16124 now). If the instace expression supports IMemoryLocation, we use
16125 the AddressOf method from the IMemoryLocation to extract the
16126 address instead of emitting the instance.
16128 This showed up with `This', as we were emitting the instance
16129 always (Emit) instead of the Address of This. Particularly
16130 interesting when This is a value type, as we dont want the Emit
16131 effect (which was to load the object).
16133 2002-07-08 Miguel de Icaza <miguel@ximian.com>
16135 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16137 * statement.cs (Checked): Set the CheckedState during the resolve
16138 process too, as the ConvCast operations track the checked state on
16139 the resolve process, and not emit.
16141 * cs-parser.jay (namespace_member_declaration): Flag that we have
16142 found a declaration when we do. This is used to flag error 1529
16144 * driver.cs: Report ok when we display the help only.
16146 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
16148 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16150 2002-07-04 Miguel de Icaza <miguel@ximian.com>
16152 * cs-tokenizer.cs (define): We also have to track locally the
16153 defines. AllDefines is just used for the Conditional Attribute,
16154 but we also need the local defines for the current source code.
16156 2002-07-03 Miguel de Icaza <miguel@ximian.com>
16158 * statement.cs (While, For, Do): These loops can exit through a
16159 Break statement, use this information to tell whether the
16160 statement is the last piece of code.
16162 (Break): Flag that we break.
16164 * codegen.cs (EmitContexts): New `Breaks' state variable.
16166 2002-07-03 Martin Baulig <martin@gnome.org>
16168 * class.cs (TypeContainer.MethodModifiersValid): Allow override
16169 modifiers in method declarations in structs. Otherwise, you won't
16170 be able to override things like Object.Equals().
16172 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16174 * class.cs (Method, Property, Indexer): Do not allow the public
16175 modifier to be used in explicit interface implementations.
16177 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16178 override modifiers in method declarations in structs
16180 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16182 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16183 integer or real overflow, report an error
16185 2002-07-02 Martin Baulig <martin@gnome.org>
16187 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16188 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16189 to tell the runtime about our newly created System.Object and
16190 System.ValueType types.
16192 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16194 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16195 struct instead of Ldarg/Starg.
16197 2002-07-02 Martin Baulig <martin@gnome.org>
16199 * expression.cs (Indirection.Indirection): Call
16200 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16202 2002-07-02 Martin Baulig <martin@gnome.org>
16204 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16205 ValueType, call TypeManager.TypeToCoreType() on it.
16206 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16207 the OpCodes.Newarr argument.
16209 2002-07-02 Martin Baulig <martin@gnome.org>
16211 * expression.cs (Invocation.EmitCall): When compiling corlib,
16212 replace all calls to the system's System.Array type to calls to
16213 the newly created one.
16215 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16216 System.Array methods.
16217 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16218 from the system's System.Array type which must be replaced.
16220 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16222 * typemanager.cs: load unverifiable_code_ctor so we can build
16223 corlib using the correct type. Avoid using GetTypeCode() with
16225 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16226 TypeManager.object_type to allow building corlib.
16228 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16230 * ecore.cs: handle System.Enum separately in LoadFromPtr().
16232 2002-07-01 Martin Baulig <martin@gnome.org>
16234 * class.cs: Make the last change actually work, we need to check
16235 whether `ifaces != null' to avoid a crash.
16237 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16239 * class.cs: when we build structs without fields that implement
16240 interfaces, we need to add the interfaces separately, since there is
16241 no API to both set the size and add the interfaces at type creation
16244 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16246 * expression.cs: the dimension arguments to the array constructors
16247 need to be converted if they are a long.
16249 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16251 * class.cs: don't emit ldarg.0 if there is no parent constructor
16252 (fixes showstopper for corlib).
16254 2002-06-29 Martin Baulig <martin@gnome.org>
16256 MCS now compiles corlib on GNU/Linux :-)
16258 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16259 ie. check for MethodImplOptions.InternalCall.
16261 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16262 and TypeManager.attribute_type are null, so we must explicitly check
16263 whether parent is not null to find out whether it's an attribute type.
16264 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16265 and SetBuilder, not only if the property is neither abstract nor external.
16266 This is necessary to set the MethodImplOptions on the accessor methods.
16267 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16268 SetBuilder, see Property.Emit().
16270 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16271 populate "System.Object", "System.ValueType" and "System.Attribute" since
16272 they've already been populated from BootCorlib_PopulateCoreTypes().
16274 2002-06-29 Martin Baulig <martin@gnome.org>
16276 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16277 is the NullLiteral, we also need to make sure that target_type is not
16280 2002-06-29 Martin Baulig <martin@gnome.org>
16282 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16283 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16284 before calling BootstrapCorlib_ResolveDelegate ().
16286 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16288 * statement.cs: fixed build-breaker. All tests passed ok.
16290 2002-06-27 Martin Baulig <martin@gnome.org>
16292 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16293 for System.Decimal when compiling corlib.
16295 2002-06-27 Martin Baulig <martin@gnome.org>
16297 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16298 switch blocks which contain nothing but a default clause.
16300 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16302 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16304 2002-06-27 Martin Baulig <martin@gnome.org>
16306 * ecore.cs (PropertyExpr.PropertyExpr): Call
16307 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16309 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16310 is already a TypeBuilder.
16312 2002-06-27 Martin Baulig <martin@gnome.org>
16314 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16315 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16316 the "from an array-type to System.Array" case. This makes it work
16317 when compiling corlib.
16319 2002-06-27 Martin Baulig <martin@gnome.org>
16321 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16322 non-static PropertyExpr, set its InstanceExpression. This makes
16323 the `ICollection.Count' property work in System/Array.cs.
16325 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16327 * driver.cs: Made error handling more consistent. Errors now
16328 tracked by Report class, so many methods which used to return int
16329 now return void. Main() now prints success/failure and
16330 errors/warnings message.
16332 Renamed '--probe' compiler argument to '--expect-error'. Removed
16333 the magic number return values (123 and 124). Now, if the
16334 expected error occurs, the compiler exits with success (exit value
16335 0). If the compilation completes without seeing that particular
16336 error, the compiler exits with failure (exit value 1). The
16337 makefile in mcs/errors has been changed to handle the new behaviour.
16339 * report.cs: Made 'expected error' number a property and renamed
16340 it from 'Probe' to 'ExpectedError'.
16342 * genericparser.cs: Removed error handling support, since it is
16343 now all done by Report class.
16345 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16346 class, so parse() no longer returns an int.
16348 * namespace.cs: Use Report.Error instead of GenericParser.error
16350 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16352 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16353 TypeContainer.AddOperator): At the front of the list put the
16354 explicit implementations, so they get resolved/defined first.
16356 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16358 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16359 interface type is implemented by this TypeContainer. Used during
16360 explicit interface implementation.
16362 (Property.Define, Indexer.Define, Method.Define): Validate that
16363 the given interface in the explicit implementation is one of the
16364 base classes for the containing type.
16366 Also if we are explicitly implementing an interface, but there is
16367 no match in the pending implementation table, report an error.
16369 (Property.Define): Only define the property if we are
16370 not explicitly implementing a property from an interface. Use the
16371 correct name also for those properties (the same CSC uses,
16372 although that is really not needed).
16374 (Property.Emit): Do not emit attributes for explicitly implemented
16375 properties, as there is no TypeBuilder.
16377 (Indexer.Emit): ditto.
16379 Hiding then means that we do not really *implement* a pending
16380 implementation, which makes code fail.
16382 2002-06-22 Martin Baulig <martin@gnome.org>
16384 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16385 the return value of Object.GetType(). [FIXME: we need to do this whenever
16386 we get a type back from the reflection library].
16388 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16390 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16392 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16394 * attribute.cs: Return null if we can not look up the type.
16396 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16397 the interface types found.
16399 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16400 interface types found.
16402 * typemanager.cs (GetInterfaces): Make this routine returns alll
16403 the interfaces and work around the lame differences between
16404 System.Type and System.Reflection.Emit.TypeBuilder in the results
16405 result for GetInterfaces.
16407 (ExpandInterfaces): Given an array of interface types, expand and
16408 eliminate repeated ocurrences of an interface. This expands in
16409 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16412 2002-06-21 Martin Baulig <martin@gnome.org>
16414 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16417 2002-06-21 Martin Baulig <martin@gnome.org>
16419 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16420 and called with one of the core types, return the corresponding typebuilder for
16423 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16426 2002-06-21 Martin Baulig <martin@gnome.org>
16428 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16429 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16430 (Expression.ConvertReferenceExplicit): Likewise.
16432 * expression.cs (ElementAccess.DoResolve): Likewise.
16433 (ElementAccess.DoResolveLValue): Likewise.
16435 2002-06-10 Martin Baulig <martin@gnome.org>
16437 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16438 add the "value" parameter to the parameter list.
16440 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16443 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16445 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16446 the argument to an int, uint, long or ulong, per the spec. Also
16447 catch negative constants in array creation.
16449 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16451 * class.cs: do not allow the same interface to appear twice in
16452 the definition list.
16454 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16456 * ecore.cs: don't use ldlen with System.Array.
16458 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16460 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16462 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16464 * modifiers.cs: produce correct field attributes for protected
16465 internal. Easy fix so miguel can work on ther harder stuff:-)
16467 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16469 * pending.cs: New file. Move the code from class.cs here.
16470 Support clearning the pending flag for all methods (when not doing
16471 explicit interface implementation).
16473 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16475 * rootcontext.cs: added a couple more types needed to bootstrap.
16477 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16479 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16480 constructor in the type, instead of any constructor in the type
16481 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16482 a bug in the Mono runtime when applying the params attribute).
16484 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16485 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16487 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16489 * expression.cs (Unary.ResolveOperator): Use TypeManager
16490 to resolve the type.
16492 2002-06-13 Ravi Pratap <ravi@ximian.com>
16494 * cs-parser.jay (enum_member_declaration): Pass in the attributes
16497 * enum.cs (AddEnumMember): Add support to store the attributes associated
16498 with each member too.
16500 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16501 field builders too - this takes care of the enum member case.
16503 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
16505 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16506 address-of operator on both value types and pointers.
16508 2002-06-10 Martin Baulig <martin@gnome.org>
16510 * interface.cs (Interface.PopulateIndexer): Add the indexer's
16511 PropertyBuilder to the `property_builders' list.
16513 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16514 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16515 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
16516 find any indexers which are inherited from an interface.
16518 2002-06-09 Martin Baulig <martin@gnome.org>
16520 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16521 the same type as the constant if necessary. There's also a test-130.cs
16524 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16526 * typemanager.cs (TypeManager.ChangeType): Previously known as
16527 Enum.ChangeEnumType().
16529 2002-06-09 Martin Baulig <martin@gnome.org>
16531 * expression.cs (Cast.TryReduce): Added support for consts.
16533 2002-06-08 Ravi Pratap <ravi@ximian.com>
16535 * class.cs (Accessor): Hold attributes information so we can pass
16538 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16539 Modify to pass in attributes attached to the methods.
16541 (add_accessor_declaration, remove_accessor_declaration): Ditto.
16543 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16544 to handle the Accessor kind :-)
16546 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16548 2002-06-08 Martin Baulig <martin@gnome.org>
16550 * expression.cs (Unary.TryReduceNegative): Added support for
16553 2002-06-08 Martin Baulig <martin@gnome.org>
16555 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16556 name can't be found in the `defined_names' - the caller will do a
16557 MemberLookup in this case and thus find methods in System.Enum
16558 such as Enum.IsDefined().
16560 2002-06-08 Martin Baulig <martin@gnome.org>
16562 * enum.cs (Enum.ChangeEnumType): This is a custom version of
16563 Convert.ChangeType() which works with TypeBuilder created types.
16564 (Enum.LookupEnumValue, Enum.Define): Use it here.
16566 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16567 `TypeBuilder.BaseType != null' check.
16568 (TypeContainer.FindMembers): Only lookup parent members if we
16569 actually have a parent.
16570 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16571 (ConstructorInitializer.Resolve): Likewise.
16573 * interface.cs (Interface.FindMembers): Added
16574 `TypeBuilder.BaseType != null' check.
16576 * rootcontext.cs (RootContext.ResolveCore): Added
16577 "System.Runtime.CompilerServices.IndexerNameAttribute" to
16578 classes_second_stage.
16580 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16581 debug_type and trace_type when compiling with --nostdlib.
16583 2002-06-07 Martin Baulig <martin@gnome.org>
16585 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16586 (AddField): Set it to true when adding a non-static field.
16587 (DefineType): Use `have_nonstatic_fields' to find out whether we
16588 have non-static fields, not `Fields != null'.
16590 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16592 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16593 dereferencing a null on the static-field code path)
16595 2002-05-30 Martin Baulig <martin@gnome.org>
16597 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16598 to take command line arguments. Use reflection to call the new
16599 custom `Initialize' function on the symbol writer and pass it the
16600 command line arguments.
16602 * driver.cs (--debug-args): New command line argument to pass command
16603 line arguments to the symbol writer.
16605 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16607 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16608 the target type for indexers and properties. Thanks to Joe for
16611 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16613 * typemanager.cs (MethodFlags): returns the method flags
16614 (Obsolete/ShouldIgnore) that control warning emission and whether
16615 the invocation should be made, or ignored.
16617 * expression.cs (Invocation.Emit): Remove previous hack, we should
16618 not do this on matching a base type, we should do this based on an attribute
16620 Only emit calls to System.Diagnostics.Debug and
16621 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16622 on the command line.
16624 * rootcontext.cs: Global settings for tracing and debugging.
16626 * cs-tokenizer.cs (define): New utility function to track
16627 defines. Set the global settings for TRACE and DEBUG if found.
16629 2002-05-25 Ravi Pratap <ravi@ximian.com>
16631 * interface.cs (Populate*): Pass in the TypeContainer as well as
16632 the DeclSpace as parameters so that we can create EmitContexts and
16633 then use that to apply attributes etc.
16635 (PopulateMethod, PopulateEvent, PopulateProperty)
16636 (PopulateIndexer): Apply attributes everywhere.
16638 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16641 (ApplyAttributes): Update accordingly.
16643 We now apply interface attributes for all members too.
16645 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16647 * class.cs (Indexer.Define); Correctly check if we are explicit
16648 implementation (instead of checking the Name for a ".", we
16649 directly look up if the InterfaceType was specified).
16651 Delay the creation of the PropertyBuilder.
16653 Only create the PropertyBuilder if we are not an explicit
16654 interface implementation. This means that explicit interface
16655 implementation members do not participate in regular function
16656 lookups, and hence fixes another major ambiguity problem in
16657 overload resolution (that was the visible effect).
16659 (DefineMethod): Return whether we are doing an interface
16662 * typemanager.cs: Temporary hack until we get attributes in
16663 interfaces (Ravi is working on that) and we get IndexerName
16664 support in interfaces.
16666 * interface.cs: Register the indexers as properties.
16668 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16669 warning, I have verified that this is a bug in the .NET runtime
16670 (JavaScript suffers of the same problem).
16672 * typemanager.cs (MemberLookup): When looking up members for
16673 interfaces, the parent of an interface is the implicit
16674 System.Object (so we succeed in searches of Object methods in an
16675 interface method invocation. Example: IEnumerable x; x.ToString
16678 2002-05-25 Miguel de Icaza <miguel@ximian.com>
16680 * class.cs (Event): Events should also register if they do
16681 implement the methods that an interface requires.
16683 * typemanager.cs (MemberLookup); use the new GetInterfaces
16686 (GetInterfaces): The code used to lookup interfaces for a type is
16687 used in more than one place, factor it here.
16689 * driver.cs: Track the errors at the bottom of the file, we kept
16692 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16693 instance if the method we are calling is static!
16695 2002-05-24 Miguel de Icaza <miguel@ximian.com>
16697 * attribute.cs (ApplyAttributes): Make this function filter out
16698 the IndexerName attribute (as that attribute in reality is never
16699 applied) and return the string constant for the IndexerName
16702 * class.cs (TypeContainer.Emit): Validate that all the indexers
16703 have the same IndexerName attribute, and if so, set the
16704 DefaultName attribute on the class.
16706 * typemanager.cs: The return value might contain other stuff (not
16707 only methods). For instance, consider a method with an "Item"
16708 property and an Item method.
16710 * class.cs: If there is a problem with the parameter types,
16713 2002-05-24 Ravi Pratap <ravi@ximian.com>
16715 * ecore.cs (ImplicitConversionExists): Wrapper function which also
16716 looks at user defined conversion after making a call to
16717 StandardConversionExists - we need this for overload resolution.
16719 * expression.cs : Update accordingly the various method calls.
16721 This fixes 2 bugs filed against implicit user defined conversions
16723 2002-05-22 Miguel de Icaza <miguel@ximian.com>
16725 * statement.cs: Track the result of the assignment.
16727 2002-05-21 Miguel de Icaza <miguel@ximian.com>
16729 * expression.cs (MemberAccess): Improved error reporting for
16730 inaccessible members.
16732 2002-05-22 Martin Baulig <martin@gnome.org>
16734 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
16735 itself with debugging support.
16737 2002-05-22 Martin Baulig <martin@gnome.org>
16739 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16740 Removed, this isn't needed anymore.
16742 2002-05-20 Martin Baulig <martin@gnome.org>
16744 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16745 be underlying type for an enum.
16747 2002-05-20 Miguel de Icaza <miguel@ximian.com>
16749 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16750 that splits out the loading of just the core types.
16752 * rootcontext.cs (ResolveCore): Split the struct resolution in
16753 two, so we can load the enumeration underlying types before any
16756 * expression.cs (Is): Bandaid until we fix properly Switch (see
16757 bug #24985 for details).
16759 * typemanager.cs (ImplementsInterface): The hashtable will contain
16760 a null if there are no interfaces implemented.
16762 2002-05-18 Miguel de Icaza <miguel@ximian.com>
16764 * cs-parser.jay (indexer_declarator): It is fine to have array
16767 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16769 * typemanager.cs: (RegisterBuilder): New function used to register
16770 TypeBuilders that implement interfaces. Since
16771 TypeBuilder.GetInterfaces (as usual) does not work with lame
16773 (AddUserType): register interfaces.
16775 (ImplementsInterface): Use the builder_to_ifaces hash if we are
16776 dealing with TypeBuilder. Also, arrays are showing up as
16777 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16778 methods can not be invoked on them!
16780 * ecore.cs (ExplicitReferenceConversionExists): Made public.
16781 (ImplicitReferenceConversionExists): Split out from
16782 StandardConversionExists.
16784 * expression.cs (As): We were only implementing one of the three
16785 cases for the as operator. We now implement them all.
16786 (Is): Implement the various other cases for Is as well.
16788 * typemanager.cs (CACHE): New define used to control if we want or
16789 not the FindMembers cache. Seems to have a negative impact on
16790 performance currently
16792 (MemberLookup): Nested types have full acess to
16793 enclosing type members
16795 Remove code that coped with instance/static returns for events, we
16796 now catch this in RealFindMembers.
16798 (RealFindMembers): only perform static lookup if the instance
16799 lookup did not return a type or an event.
16801 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16803 * assign.cs (CompoundAssign): We pass more semantic information
16804 now to Compound Assignments than we did before: now we have all
16805 the information at hand, and now we resolve the target *before* we
16806 do the expression expansion, which allows the "CacheValue" method
16807 to have the effect we intended (before, a [x] += 1 would generate
16808 two differen ArrayAccess expressions from the ElementAccess,
16809 during the resolution process).
16811 (CompoundAssign.DoResolve): Resolve target and original_source here.
16813 2002-05-16 Miguel de Icaza <miguel@ximian.com>
16815 * expression.cs (ArrayAccess): dropped debugging information.
16817 * typemanager.cs: Small bug fix: I was always returning i_members,
16818 instead of one of i_members or s_members (depending on which had
16821 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
16822 method is invoked before any code generation takes place, and it
16823 is a mechanism to inform that the expression will be invoked more
16824 than once, and that the method should use temporary values to
16825 avoid having side effects
16827 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16829 * ecore.cs (Expression.CacheTemporaries): Provide empty default
16832 * expression.cs (Indirection, ArrayAccess): Add support for
16833 CacheTemporaries in these two bad boys.
16835 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16836 ldobj or ldind_ref.
16837 (StoreFromPtr): Handle stobj as well.
16839 * expression.cs (UnaryMutator): Share more code.
16841 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16842 down: I was not tracking the Filter function as well, which
16843 was affecting the results of the cache.
16845 2002-05-15 Miguel de Icaza <miguel@ximian.com>
16847 * attribute.cs: Remove the hack to handle the CharSet property on
16850 2002-05-14 Miguel de Icaza <miguel@ximian.com>
16852 * attribute.cs (DoResolve): More uglyness, we now only try to
16853 resolve the attribute partially, to extract the CharSet
16854 information (only if we are a StructLayout attribute). Otherwise
16856 (GetExtraTypeInfo): Add some code to conditionally kill in the
16857 future this. I am more and more convinced that the .NET
16858 framework has special code to handle the attribute setting on
16861 * expression.cs (IsParamsMethodApplicable): Revert my previous
16862 foreach change here, it was wrong.
16864 2002-05-13 Miguel de Icaza <miguel@ximian.com>
16866 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16867 (pp_expr): do not abort on unknown input, just return.
16868 (eval): abort if there are pending chars.
16870 * attribute.cs (Attribute.Resolve): Positional parameters are
16871 optional. Deal with that case.
16873 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16874 the Ansi/Unicode/Auto information for the type.
16876 (TypeContainer.DefineType): instantiate the EmitContext here, as
16877 we will be using it during the type definition (to resolve
16878 attributes) and during the emit phase.
16880 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16881 to pull type information out of the attributes
16883 (Attribute.Resolve): track the constructor builder, and allow for
16884 multiple invocations (structs and classes will use this).
16886 * ecore.cs (MemberLookupFinal): new version with all the
16887 parameters customizable.
16889 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16890 constructors. Return if the result value is null (as the error
16891 would have been flagged already by MemberLookupFinal)
16893 Do not allow instances of abstract classes or interfaces to be
16896 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16897 We have to compare the assembly property here when dealing with
16898 FamANDAssem and Assembly access modifiers, because we might be
16899 creating an assembly from *modules* (that means that we are not
16900 getting TypeBuilders for types defined in other modules that are
16901 part of this assembly).
16903 (Method.Emit): If the method is marked abstract and has a body,
16906 (TypeContainer.DefineMembers): If both the defined member and the
16907 parent name match are methods, then do not emit any warnings: let
16908 the Method.Define routine take care of flagging warnings. But if
16909 there is a mismatch (method overrides something else, or method is
16910 overriwritten by something, then emit warning).
16912 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16913 set to null, this means `do not check for the return type on the
16916 (Method.Define): set the return type for the method signature to
16917 null, so that we get methods with the same name and parameters and
16918 different return types. This is used to flag warning 114 (you are
16919 hiding a method, and you probably want to use the new/override
16922 * typemanager.cs (MemberLookup): Implemented proper access
16923 control, closing a long standing set of bug reports. The problem
16924 was that the Framework only has two bits: Public and NonPublic,
16925 and NonPublic includes private and protected methods, but we need
16926 to enforce the FamANDAssem, FamOrAssem and Family.
16928 2002-05-11 Miguel de Icaza <miguel@ximian.com>
16930 * statement.cs (GotoCase): Return true: Ammounts to giving up
16931 knowledge on whether we return or not, and letting the other case
16932 be responsible for it.
16934 2002-05-10 Miguel de Icaza <miguel@ximian.com>
16936 * driver.cs: Do not load directories for each file processed, only
16937 do it if there is a pattern.
16939 * ecore.cs: Report readonly assigns here as well, as we might have
16940 been resolved only by MemberAccess.
16942 (SimpleName.SimpleNameResolve): Also be useful for LValue
16943 resolution. We need this to propagate assign to local readonly variables
16945 * typemanager.cs: Use a ptrhashtable for the criteria, because we
16946 do not want to reuse potential criteria memory.
16948 * class.cs (MyEventBuilder): Set reflected_type;
16950 * ecore.cs (Constantify): Added support for constifying bools.
16952 (RootContext.LookupType): Added a cache for values looked up in
16953 the declaration space.
16955 * typemanager.cs (FindMembers): Now is a front-end to
16956 RealFindMembers, and provides a two-level hashtable-based cache to
16959 15% performance improvement: from 22.5 to 19.2 seconds.
16961 * expression.cs (IsParamsMethodApplicable): use foreach.
16962 (Invocation.DoResolve): ditto.
16963 (New.DoResolve): ditto.
16964 (ArrayCreation.DoResolve): ditto.
16966 * ecore.cs (FindMostEncompassingType): use foreach.
16968 * delegate.cs (NewDelegate.DoResolve): Use foreach
16970 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16971 (RemoveMethods): use foreach.
16973 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16974 nested foreach statements instead of for, and also break out of
16975 the inner loop once a match is found.
16977 (Invocation.OverloadResolve): Use foreach, simplify the code.
16979 2002-05-08 Miguel de Icaza <miguel@ximian.com>
16981 * cfold.cs (BinaryFold): During an enumeration evaluation context,
16982 we actually unwrap the expression to allow for extra information
16985 * expression.cs: Use Shr_Un on unsigned operations.
16987 2002-05-08 Ravi Pratap <ravi@ximian.com>
16989 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
16990 applicable operators was not being considered correctly. This closes
16991 the bug Miguel reported.
16993 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16995 * attribute.cs: check that the type derives from System.Attribute
16996 and report the correct error in that case (moved the duplicate code to
16997 its own method, too).
16999 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17001 * attribute.cs: lookup attribute type name as the spec says: first the
17002 bare attribute name and then name + "Attribute" (nant compiles with
17003 mcs after this fix).
17005 2002-05-07 Miguel de Icaza <miguel@ximian.com>
17007 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
17008 Because of the way we parse things, we should try to see if a
17009 UIntConstant can fit in an integer.
17011 2002-05-07 Ravi Pratap <ravi@ximian.com>
17013 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17014 when we are in an explicit context.
17016 (ConvertReferenceExplicit): When converting from Iface type S to Class
17017 T make sure the rules are implemented as an OR.
17019 * parameter.cs (ParameterType): Make it a property for now although the
17020 purpose really isn't anything immediate.
17022 * expression.cs (Is*Applicable): Do better checking on the parameter type
17023 of a ref/out parameter. The ones from the system assemblies are already
17024 marked with the correct type so we don't need to do any correction.
17026 * ecore.cs (StandardConversionExists): Conversion from Interface types to
17027 the object type is standard too so include that.
17029 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17031 * ecore.cs (StandardConversionExists): Augment with missing code:
17032 deal with IntConstant, LongConstants and Enumerations.
17034 * assign.cs: Report the error, instead of failing silently
17036 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17037 typecontainer that they are declared, because the
17038 typecontainer/namespace will have the list of using clauses that
17039 need to be applied.
17041 Assembly Attributes were escaping the normal registration
17044 (EmitCode): Apply attributes within an EmitContext that represents
17045 the container they were declared on.
17047 * cs-parser.jay: Track bases for structs. How did I get this wrong?
17049 2002-05-06 Ravi Pratap <ravi@ximian.com>
17051 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17052 Revamp completely - make much cleaner as we now operate only
17055 (FindMostSpecificSource, FindMostSpecificTarget): New methods
17056 to implement the logic detailed in the spec more correctly.
17058 (UserDefinedConversion): Update accordingly.
17060 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17062 * statement.cs: Return flow analysis information up.
17064 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17067 (token): Do not consume an extra character before calling
17070 2002-05-06 Piers Haken <piersh@friskit.com>
17072 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17074 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17076 * class.cs (Constructor.Emit): Set the IsStatic flag in the
17077 EmitContext during the instance constructor initializer
17078 resolution, to stop access to instance variables.
17080 This is mandated by the spec, last paragraph of the `constructor
17081 initializers' section.
17083 2002-05-05 Miguel de Icaza <miguel@ximian.com>
17085 * cs-parser.jay, class.cs (Accessor): new class used to represent
17086 an accessor (get or set). In the past we used `null' to represent
17087 a missing accessor. But this is ambiguous because there was no
17088 way to tell in abstract indexers/properties if one of them was
17091 Now there is a way of addressing that.
17093 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17094 instead of FindMembers.
17096 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17097 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17099 * attribute.cs: Treat indexers and properties as the same in terms
17100 of applying attributes
17102 * ecore.cs (FindMostEncompassedType): Use statically initialized
17103 EmptyExpressions()s like we do elsewhere to avoid creating useless
17104 objects (and we take this out of the tight loop).
17106 (GetConversionOperators): Move the code to extract the actual
17107 operators to a separate routine to clean things up.
17109 2002-05-04 Miguel de Icaza <miguel@ximian.com>
17111 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17112 events are always registered FieldBuilders.
17114 * class.cs (FieldBase): New class shared by Fields
17116 * delegate.cs: If we are a toplevel delegate, use our full name.
17117 If we are a nested delegate, then only use our tail name.
17119 2002-05-02 Ravi Pratap <ravi@ximian.com>
17121 * expression.cs (IsApplicable): Ensure that we add the "&" to
17122 ref/out types before comparing it with the type of the argument.
17124 (IsParamsMethodApplicable): Ditto.
17126 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
17129 * delegate.cs : Handle the case when we have more than one applicable
17130 method. Flag an error only when we finish checking all.
17132 2002-05-02 Miguel de Icaza <miguel@ximian.com>
17134 * expression.cs: Add support for boolean static initializers.
17136 2002-05-01 Miguel de Icaza <miguel@ximian.com>
17138 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17140 * parameter.cs (ComputeParameterTypes,
17141 ComputeAndDefineParameterTypes): Better error handling: now we
17142 clear the `types' cache if we fail during any of the type lookups.
17143 We also return the status code correctly to our caller
17145 * delegate.cs: If we fail to define a delegate, abort the extra
17148 * expression.cs (Binary.ResolveOperator): for
17149 operator==(object,object) and operator !=(object, object) we also
17150 have to verify that there is an implicit conversion from one to
17153 (ArrayAccess.DoResolve): Array Access can operate on
17156 2002-04-30 Miguel de Icaza <miguel@ximian.com>
17158 * assign.cs (CompoundAssign): A new class used as a "flag" that
17159 the assignment actually is happening as part of a compound
17160 assignment operator.
17162 During compound assignment, a few new rules exist to enable things
17169 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17170 to the type of x) if y is implicitly convertible to the type of x,
17171 and the operator is a builtin operator and the return type of the
17172 operator is explicitly convertible to the type of x.
17174 * rootcontext.cs: Reset warning level to 2. 4 catches various
17175 "interesting" features in mcs, we must clean this up at some
17176 point, but currently am trying to kill other bugs ;-)
17178 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17179 in container classes as well.
17181 * expression.cs (Binary.ResolveOperator): Handle string case
17182 before anything else (as operator overloading does emit an error
17183 before doing anything else).
17185 This code could go away when we move to a table driven model, but
17186 i could not come up with a good plan last night.
17188 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17190 * typemanager.cs (CSharpName): reimplementation using regex.
17191 * class.cs: added null check for fields in Emit
17192 * rootcontext.cs: set warninglevel to 4
17194 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17196 * typemanager.cs (CSharpName): reimplemented with Lupus
17199 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17201 * statement.cs (If): correclty implement Resolve, because we were
17202 not catching sem errors in there. The same process is needed
17204 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17207 (Statement.Warning_DeadCodeFound): Factorize code.
17208 (While): Report dead code here too.
17210 (Statement): Added Resolve virtual method to allow
17211 for resolution split from the emit code.
17213 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17215 * statement.cs (EmitBoolExpression): No longer try to resolve the
17217 (MakeBoolean): New utility function that resolve, implicitly
17218 converts to boolean and tags the expression.
17221 (If, Do): Implement dead code elimination.
17222 (While): Implement loop inversion
17224 (Do, While, For, If): Resolve the expression prior to calling our
17227 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
17230 - added method Report28 (warning: program has more than one entry point)
17231 - added method IsEntryPoint, implements paragraph 10.1 of the spec
17232 - modified method Method.Define, the part at the end of the method
17234 * rootcontext.cs: added static public Location EntryPointLocation;
17236 * ../errors/cs0028.cs : Add test case for the above warning.
17239 - modified method CSharpName to allow arrays of primitive type to
17240 be printed nicely (e.g. instead of System.Int32[][] it now prints
17242 - added method CSharpSignature: returns the signature of a method
17243 in string format to be used in reporting errors, warnings, etc.
17245 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17248 2002-04-26 Ravi Pratap <ravi@ximian.com>
17250 * delegate.cs (Define): Fix extremely silly bug where I was
17251 setting the type of the 'object' parameter of the BeginInvoke
17252 method to System.IAsyncResult instead of System.Object ;-)
17254 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17256 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17259 (Constructor.Emit): return if we fail to initialize the
17260 constructor. Another door closed!
17262 * expression.cs (New.DoResolve): Improve error message (from -6 to
17263 1501). Use DeclaredOnly lookup to find the exact constructor.
17265 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17266 loop. This is useful.
17268 * cs-parser.jay: Adjust the default parameters so that destructors
17269 have the proper signature.
17271 2002-04-26 Martin Baulig <martin@gnome.org>
17273 * driver.cs (LoadAssembly): If `assembly' contains any characters
17274 which are only valid in path names and not in assembly names
17275 (currently slash, backslash and point), use Assembly.LoadFrom ()
17276 instead of Assembly.Load () on the `assembly' (before iteration
17277 over the link_paths).
17279 2002-04-26 Martin Baulig <martin@gnome.org>
17281 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17283 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17285 * class.cs (Property): use the new typemanager.MemberLookup
17287 (TypeContainer.MemberLookup): Implement using the
17288 TypeManager.MemberLookup now.
17290 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17291 and return MemberInfos, so that these can be used without an
17292 EmitContext (what we had before).
17294 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17296 * expression.cs: Fix the case where the argument to params if the
17297 type of the params. I omitted handling this before. Fixed
17299 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17301 * driver.cs: Call BootCorlib_PopulateCoreType
17303 * class.cs (Property.CheckBase): Check for properties only, not
17306 * interface.cs: Temporary hack: try/catch around the
17307 CustomAttributeBuilder, because I am getting an exception that I
17310 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17311 types whose definitions are required to be there (attributes are
17312 defined before standard types).
17314 Compute definitions as we boot the various types, as they are used
17315 immediately (value_type class will need object_type, but if we do
17316 not initialize object_type, we will pass a null, which will let
17317 the runtime pick the System.Object from the existing corlib, which
17318 is not what we want).
17320 2002-04-22 Patrik Torstensson <totte@labs2.com>
17322 * cs-tokenizer.cs: fixed a number of trim() issues.
17324 2002-04-22 Ravi Pratap <ravi@ximian.com>
17326 * expression.cs (Argument.Type): Ensure that we return the correct
17327 type when we have out or ref parameters [in which case we
17330 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17332 * class.cs (Property, Indexer): Allow extern modifier in there.
17334 * typemanager.cs (InitBaseTypes): Initializes object_type and
17335 value_type, since those will be used early on during the bootstrap
17336 process to compile corlib.
17338 (InitCoreTypes): Move code from here to InitBaseTypes.
17340 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17342 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17343 single-dimension arrays as using the ldlen opcode.
17345 Daniel Lewis discovered this optimization.
17347 * typemanager.cs: Add signature for System.Array::get_Length
17349 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17351 * statement.cs: report the error when the foreach does not apply to an
17352 array nor a collection.
17354 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17356 * expression.cs: Add implicit conversions to the operator ~.
17358 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17360 * typemanager.cs: Locate the decimal constructor.
17362 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17364 * attribute.cs: use the new property of TypeOf.
17365 * expression.cs: added 'get' property around typearg.
17367 These changes fix a build breaker reported by NickD. Is this the
17368 correct way to fix? If not, please, revert my changes and make it
17371 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17373 * attribute.cs: Add support for typeof in attribute invocations.
17374 I am not sure that this is right though.
17376 2002-04-14 Duncan Mak <duncan@ximian.com>
17378 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17379 Binary.Operator.Division case.
17381 2002-04-13 Ravi Pratap <ravi@ximian.com>
17383 * class.cs (DefineType): Ensure that we do a proper check on
17384 attribute types and also register it with the TypeManager.
17386 (TypeContainer.Targets): The default for attribute types is
17387 AttributeTargets.All.
17389 * attribute.cs (ApplyAttributes): Registering the attribute type
17390 is done elsewhere, not when we discover we have a Usage attribute.
17392 2002-04-12 Ravi Pratap <ravi@ximian.com>
17394 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17395 and get rid of is_delegate parameter.
17397 * everywhere : update.
17399 2002-04-12 Ravi Pratap <ravi@ximian.com>
17401 * cs-parser.jay (compilation_unit): Revamp completely to use
17402 some new ideas that I got from Rhys' grammar to solve the problems
17403 with assembly level attributes.
17405 (outer_declaration): New grammar production.
17407 (attribute_sections): Add.
17409 (opt_attributes): Base on attribute_sections
17411 (namespace_declaration): Allow opt_attributes to tackle the case
17412 when we have assembly level attributes - we are clever in this
17415 * attribute.cs (ApplyAttributes): Do not worry about assembly
17416 attributes in the non-global context.
17418 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17419 instead of SetGlobalAttributes.
17421 * class.cs, rootcontext.cs : Ensure we define and generate
17422 attribute types before anything else.
17424 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17425 and flag the new error -20 for the case when the attribute type
17426 does not have valid targets specified. csc does not catch this.
17428 * ../errors/errors.txt : update for error # -20
17430 2002-04-11 Ravi Pratap <ravi@ximian.com>
17432 * support.cs (InternalParameters.ParameterModifier): Do some null
17433 checking and return sane values.
17435 * class.cs (Method.Define): If we are a PInvoke method, ensure
17436 that we are static and extern. Report error # 601
17438 * ../errors/cs0601.cs : Add test case for the above error.
17440 2002-04-07 Ravi Pratap <ravi@ximian.com>
17442 * rootcontext.cs (attribute_types): We need to keep type of
17443 all attribute types separately and emit code for them first.
17445 (RegisterAttribute) : Implement.
17447 * class.cs (DefineType): Check if the current Type is a custom
17448 attribute type and register it accordingly.
17450 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17451 adding the first attribute twice and rename to
17453 (SetGlobalAttributes): this.
17455 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17458 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17459 if we are processing global arguments. Hmm, I am unsure of this.
17461 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17463 * expression.cs: added static array of strings to avoid calling
17464 Enum.ToString () for Operator in Binary. Significant recover of
17467 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17469 * class.cs (FindMembers): Allow the Builders of the various
17470 members to be null. If they are skip them. This only happens
17471 during the PInvoke declaration.
17473 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17475 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17476 failure, so we do not keep going afterwards.
17478 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17479 wanted to pass `false' as the `is_delegate' argument. If this is
17480 the case, why not use delegate_type == null to mean `is_delegate =
17481 false' and anything else as is_delegate = true.
17483 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17485 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17486 code for the section, not the beginning of the tests.
17488 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17490 * cfold.cs: Handle operator + (Enum x, Underlying x)
17492 * expression.cs (Binary): same. Warn about errors where we have
17493 Enum/Enum in operator + as well.
17495 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
17498 - added support for switch(bool)
17499 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17500 - add TableSwitchEmit() to handle table-based switch statements
17502 2002-04-05 Ravi Pratap <ravi@ximian.com>
17504 * expression.cs (Invocation.OverloadResolve): Factor out code which
17505 does parameter compatibility checking with arguments so that we can
17506 re-use the code even from Delegate.VerifyApplicability
17508 (VerifyArgumentsCompat): Move above code here.
17510 * delegate.cs (VerifyApplicability): Get rid of duplicate code
17511 and instead make a call to the above method.
17513 2002-03-31 Ravi Pratap <ravi@ximian.com>
17515 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17516 We use it to keep track of classes which are attribute types.
17518 2002-04-02 Miguel de Icaza <miguel@ximian.com>
17520 * delegate.cs (Delegate.Define): Correctly define the types in the
17521 presence of fixed and array parameters.
17523 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17526 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17527 include NonPublic after the first iteration.
17529 * class.cs (Indexer.CheckBase): Only check if both parents are
17532 * cs-parser.jay (accessor_body): If empty, set to null.
17534 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17535 same code path here to resolve constants names that we did have in
17536 MemberAccess.DoResolve. There is too much code duplicated here.
17538 2002-04-01 Miguel de Icaza <miguel@ximian.com>
17540 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17542 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17545 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17546 tokens, numbers and strings.
17548 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17551 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17552 asyncronous parameters and the regular parameters.
17554 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17555 specify the target directory.
17557 * expression.cs: (This.DoResolve): Simplify
17558 (As.Emit): Optimize, do not generate IsInst if the expression is
17559 always of the given type.
17561 (Is.DoResolve): Bug fix, we were reporting both always/never for
17564 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17565 creating too many unnecessary arrays.
17567 2002-03-31 Miguel de Icaza <miguel@ximian.com>
17569 * class.cs (EmitFieldInitializer): Use Assign expression to assign
17570 fields instead of rolling our own initializer. Takes care of all
17571 implicit conversions, and drops unnecessary static checks/argument.
17573 2002-03-31 Dick Porter <dick@ximian.com>
17575 * driver.cs: use the GetDirectories() return values properly, and
17576 use "/" as path separator.
17578 2002-03-30 Miguel de Icaza <miguel@ximian.com>
17580 * expression.cs (Unary): Optimize - - expr into expr.
17581 (Binary): Optimize a + (-b) into a -b.
17583 * codegen.cs (CodeGen): Made all methods static.
17585 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17589 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17590 TypeBuilder property.
17592 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17595 * tree.cs: Removed the various RecordXXXX, and replaced with a
17596 single RecordDecl. Removed all the accessor methods, and just
17597 left a single access point Type
17599 * enum.cs: Rename DefineEnum to DefineType.
17601 * decl.cs: New abstract method `DefineType' used to unify the
17602 Defines for Enumerations, Interfaces, TypeContainers and
17605 (FindType): Moved LookupInterfaceOrClass here. Moved the
17606 LookupBaseClasses method that used to live in class.cs and
17607 interface.cs here, and renamed to FindType.
17609 * delegate.cs: Implement DefineType. Take advantage of the
17610 refactored pattern for locating the parent builder without taking
17611 the parent_builder argument (which we know does not work if we are
17612 nested, and triggering a toplevel definition).
17614 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17616 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17617 accessibility of a member has changed during override and report
17620 * class.cs (Method.Define, Property.Define): Only complain on
17621 overrides if the method is private, any other accessibility is
17622 fine (and since we just checked the permission is the same, we are
17625 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17626 and elif are processed always. The other pre-processing
17627 directives are only processed if we are "taking" the path
17629 2002-03-29 Martin Baulig <martin@gnome.org>
17631 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17632 current location is not Null.
17634 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17635 a separate method so we can profile it.
17637 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17638 `span.Seconds' are just seconds, but no minutes or hours.
17639 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17641 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17643 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17644 Remove the gratuitous set of Final:
17646 // If an interface implementation, then we can set Final.
17647 if (((flags & MethodAttributes.Abstract) == 0) &&
17648 implementing.DeclaringType.IsInterface)
17649 flags |= MethodAttributes.Final;
17651 I do not know what I was smoking when I used that.
17654 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17655 step into fixing the name resolution issues for delegates and
17656 unifying the toplevel name resolution.
17658 2002-03-28 Martin Baulig <martin@gnome.org>
17660 * class.cs (Method.Emit): If we have a symbol writer, call its
17661 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17662 tell it about the current method.
17664 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17665 writer that we're going to emit the first byte of IL code for a new
17666 statement (a new source line).
17667 (EmitContext.EmitTopBlock): If we have a symbol writer, call
17668 EmitContext.Mark() before emitting any code.
17670 * location.cs (SymbolDocument): Return null when we're Null.
17672 * statement.cs (Statement): Moved the `Location loc' variable here.
17673 (Statement.EmitBoolExpression): If we have a symbol writer, call
17674 ec.Mark() before emitting any code to tell it that we're at the
17675 beginning of a new statement.
17676 (StatementExpression): Added `Location' argument to the constructor.
17677 (Block): Added public readonly variable `StartLocation' and public
17678 variable `EndLocation'. The latter is to be set using SetEndLocation().
17679 (Block): Added constructor which takes a start and end location.
17680 (Block.SetEndLocation): New method. This sets the end location.
17681 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17682 local variables we create.
17683 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17684 each statement and do also mark the begin and end of the block.
17686 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17687 tell it the current lexer.Location, use Location.Null for the end of the
17689 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17690 current block, set its end location using SetEndLocation().
17691 (statement_expression): StatementExpression constructor now takes the
17692 lexer.Location as additional argument.
17693 (for_statement, declare_local_variables): Likewise.
17694 (declare_local_variables): When creating a new implicit block, use the
17695 new Block constructor and pass it the lexer.Location.
17697 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17699 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17700 members also on the parent interfaces recursively.
17702 2002-03-27 Miguel de Icaza <miguel@ximian.com>
17704 * report.cs: Use new formats, since Gonzalo finished the missing
17707 * expression.cs (Binary.ResolveOperator): added missing operator|
17708 operator& and operator^ for bool/bool.
17710 * cs-parser.jay: CheckDef now takes a Location argument that is
17711 used to report errors more precisly (instead of reporting the end
17712 of a definition, we try to track something which is a lot closer
17713 to the source of the problem).
17715 * cs-tokenizer.cs: Track global token use, so we can properly flag
17716 the use of #define/#undef after the first token has been seen.
17718 Also, rename the reportXXXX to Error_DescriptiveName
17720 * decl.cs (DeclSpace.IsTopLevel): Move property here from
17721 TypeContainer, so that Enum and Interface can use this too.
17723 * class.cs (TypeContainer.LookupInterfaceOrClass,
17724 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17725 `builder' argument. Typically this was used to pass the parent
17726 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17729 The problem is that a nested class could trigger the definition of
17730 a toplevel class, and the builder would be obviously wrong in that
17733 So we drop this argument, and we compute dynamically the
17734 TypeBuilder/ModuleBuilder (the correct information was available
17735 to us anyways from DeclSpace.Parent)
17737 * interface.cs (Interface.DefineInterface): Drop builder
17738 parameter cleanup like class.cs
17740 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
17743 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17746 (Try.Emit): Propagate the returns value from the statement.
17748 (Return.Emit): Even if we are leavning
17750 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17752 * modifiers.cs: Fix the computation of MethodAttributes flags.
17754 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17756 * driver.cs: allow compilation of files that start with '/'.
17757 Add a default case when checking the argument of --target.
17759 2002-03-25 Miguel de Icaza <miguel@ximian.com>
17761 * interface.cs: Implement the same search algorithm for types in
17762 the interface code.
17764 * delegate.cs: Do not allow multiple definition.
17766 * Recovered ChangeLog that got accidentally amputated
17768 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17770 * rootcontext.cs: Load manually enum to allow core classes to
17771 contain enumerations.
17773 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17774 Update to new static methods in TypeManager.
17776 * typemanager.cs (GetMethod, GetConstructor): Use our
17777 implementation of FindMembers to find the members, since during
17778 corlib compilation, the types are TypeBuilders and GetMethod and
17779 GetConstructor do not work.
17781 Make all methods in TypeManager static.
17783 (InitCodeHelpers): Split the functionality from
17784 the InitCodeTypes function.
17786 * driver.cs: Call InitCodeHelpers after we have populated the
17789 * cs-parser.jay (delegate_declaration): we did not used to compute
17790 the delegate name correctly for void delegates.
17792 2002-03-24 Miguel de Icaza <miguel@ximian.com>
17794 * rootcontext.cs (RootContext): Init the interface_resolve_order
17795 and type_container_resolve_order always.
17797 (ResolveCore, BootstrapCorlib_ResolveClass,
17798 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17799 compiler when compiling with --nostdlib
17801 * class.cs (TypeContainer.DefineType): Check that our parent is
17802 not null. This test is most important when we are bootstraping
17805 * codegen.cs: Split out the symbol writing code.
17807 2002-03-25 Martin Baulig <martin@gnome.org>
17809 * driver.cs (-g): Made -g an alias for --debug.
17811 2002-03-24 Martin Baulig <martin@gnome.org>
17813 * codegen.cs (SymbolWriter): New public variable. Returns the
17814 current symbol writer.
17815 (CodeGen): Added `bool want_debugging_support' argument to the
17816 constructor. If true, tell the ModuleBuild that we want debugging
17817 support and ask it for the ISymbolWriter.
17818 (Save): If we have a symbol writer, call it's Close() method after
17819 saving the assembly.
17821 * driver.c (--debug): New command line argument to create a
17822 debugger information file.
17824 * location.cs (SymbolDocument): New public property. Returns an
17825 ISymbolDocumentWriter object for the current source file or null
17826 if we don't have a symbol writer.
17828 2002-03-21 Miguel de Icaza <miguel@ximian.com>
17830 * driver.cs (LoadAssembly): Correctly return when all the paths
17831 have been tried and not before.
17833 * statement.cs (Switch.Emit): return the actual coverage for this
17834 statement (returns/not-returns)
17836 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17837 switch of the statement if we are the last switch section. That
17838 kills two problems: try/catch problems (we used to emit an empty
17839 nop at the end) and switch statements where all branches would
17842 2002-03-19 Miguel de Icaza <miguel@ximian.com>
17844 * driver.cs: Add default assemblies (the equivalent to the
17845 Microsoft CSC.RSP file)
17847 * cs-tokenizer.cs: When updating `cols and setting it to zero,
17848 also update tokens_seen and set it to false.
17850 * driver.cs: Implement --recurse for Mike.
17852 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17853 correctly splitting out the paths.
17855 2002-03-18 Miguel de Icaza <miguel@ximian.com>
17857 * interface.cs (Interface.PopulateProperty): Instead of using
17858 `parent' as the declaration space for the set parameters, use
17861 * support.cs (InternalParameters): InternalParameters constructor
17862 takes a DeclSpace instead of a TypeContainer.
17864 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17865 types are being initialized, load the address of it before calling
17868 (New): Provide a mechanism to disable the generation of local
17869 value type temporaries when the caller will be providing us with
17870 an address to store it.
17872 (ArrayCreation.EmitDynamicInitializers): Use it.
17874 2002-03-17 Miguel de Icaza <miguel@ximian.com>
17876 * expression.cs (Invocation.EmitArguments): Only probe for array
17877 property if there is more than one argument. Sorry about that.
17879 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17880 empty param arrays.
17882 * class.cs (Method.LabelParameters): Fix incorrect code path that
17883 prevented the `ParamArrayAttribute' from being applied to the
17886 2002-03-16 Miguel de Icaza <miguel@ximian.com>
17888 * support.cs (ReflectionParameters): Correctly compute whether the
17889 last argument is a params array. Fixes the problem with
17892 * typemanager.cs: Make the assemblies array always be non-null
17893 (empty, but non-null)
17895 * tree.cs (RecordDecl): New function that abstracts the recording
17896 of names. This reports error 101, and provides a pointer to the
17897 previous declaration. Fixes a crash in the compiler.
17899 * cs-parser.jay (constructor_declaration): Update to new grammar,
17900 and provide a constructor_body that can be empty.
17902 2002-03-15 Miguel de Icaza <miguel@ximian.com>
17904 * driver.cs: Add support for --resources.
17906 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17907 Make all types for the various array helper methods be integer.
17909 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17910 CheckState to ConvCast.
17912 (ConvCast): Now it takes a `checked' state argument, to avoid
17913 depending on the emit context for the conversion, and just using
17914 the resolve time setting.
17916 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17917 instead of Invocation.EmitArguments. We do not emit the original
17918 arguments, instead we emit those which have been converted to
17919 unsigned int expressions.
17921 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17923 * codegen.cs: ditto.
17925 * expression.cs (LocalVariableReference): Drop the use of the
17926 Store function that depended on the variable index.
17928 * statement.cs (VariableInfo): Drop the `Idx' property from this
17929 class, as this is not taking into account the indexes for
17930 temporaries tat we generate during the execution, getting the
17933 * class.cs: First emit class initializers, then call the parent
17936 * expression.cs (Binary): Fix opcode emision.
17937 (UnaryMutator.EmitCode): Support checked code generation
17939 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17940 matches for events for both the Static and Instance scans,
17941 pointing to the same element. Fix that.
17943 2002-03-14 Miguel de Icaza <miguel@ximian.com>
17945 * rootcontext.cs (ResolveTree): Always set the
17946 interface_resolve_order, because nested interfaces will be calling
17949 * class.cs (GetInterfaceOrClass): Track the same resolution
17950 process used by TypeManager.LookupType. This fixes the nested
17951 type lookups in class declarations (separate path from
17954 (TypeContainer.DefineType): Also define nested interfaces.
17955 (TypeContainer.RegisterOrder): New public function used to
17956 register the order in which child interfaces need to be closed.
17958 Nested interfaces need to be closed after their parents have been
17961 * interface.cs (InterfaceAttr): Put all the logic for computing
17962 the interface attribute here.
17964 (DefineInterface): Register our interface order with the
17965 RootContext or with the TypeContainer depending on the case.
17967 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17969 * cs-parser.jay: rework foreach statement to work with the new
17970 changes to the policy on SimpleNames.
17972 * report.cs: support Stacktrace on warnings as well.
17974 * makefile: drop --unsafe and /unsafe from the compile.
17976 2002-03-13 Ravi Pratap <ravi@ximian.com>
17978 * ecore.cs (StandardConversionExists): Modify to take an Expression
17979 as the first parameter. Ensure we do null -> reference type conversion
17982 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17983 temporary Expression objects.
17985 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17987 * interface.cs: workaround bug in method overloading resolution
17988 (there is already a bugzilla bug for it).
17990 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17992 We could also solve this problem by having a separate path for
17993 performing type lookups, instead of DoResolve, we could have a
17994 ResolveType entry point, and only participating pieces of the
17995 production (simplename, deref, array) would implement this.
17997 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17998 signal SimpleName to only resolve type names and not attempt to
17999 resolve anything else.
18001 * expression.cs (Cast): Set the flag.
18003 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18005 * class.cs: Only report 108 if there is no `new' modifier.
18007 * cs-parser.jay: rework foreach statement to work with the new
18008 changes to the policy on SimpleNames.
18010 * report.cs: support Stacktrace on warnings as well.
18012 * makefile: drop --unsafe and /unsafe from the compile.
18014 2002-03-11 Miguel de Icaza <miguel@ximian.com>
18016 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18017 lookups here, instead of doing that at parse time. This means
18018 that our grammar will not introduce `LocalVariableReferences' as
18019 expressions at this point. That solves the problem of code like
18023 static void Main ()
18027 This is only half the fix. The full fix requires parameters to
18028 also be handled in this way.
18030 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18031 makes the use more obvious of the DeclSpace. The
18032 ec.TypeContainer.TypeBuilder is now only used to pull the
18033 TypeBuilder for it.
18035 My theory is that I can get rid of the TypeBuilder completely from
18036 the EmitContext, and have typecasts where it is used (from
18037 DeclSpace to where it matters).
18039 The only pending problem is that the code that implements Aliases
18040 is on TypeContainer, and probably should go in DeclSpace.
18042 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18043 lookups here, instead of doing that at parse time. This means
18044 that our grammar will not introduce `LocalVariableReferences' as
18045 expressions at this point. That solves the problem of code like
18049 static void Main ()
18053 This is only half the fix. The full fix requires parameters to
18054 also be handled in this way.
18056 * class.cs (Property.DefineMethod): When implementing an interface
18057 method, set newslot, when implementing an abstract method, do not
18058 set the flag (before we tried never setting it, or always setting
18059 it, which is the difference).
18060 (Indexer.DefineMethod): same.
18061 (Method.DefineMethod): same.
18063 * ecore.cs: Only set the status used flag if we get back a Field.
18065 * attribute.cs: Temporary hack, so Paolo can keep working.
18067 2002-03-08 Ravi Pratap <ravi@ximian.com>
18069 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18070 the unmanaged type in the case we have a MarshalAs attribute.
18072 (Resolve): Handle the case when we are parsing the special MarshalAs
18073 attribute [we need to store the unmanaged type to use later]
18075 * typemanager.cs (marshal_as_attr_type): Built in type for the
18076 MarshalAs Attribute.
18078 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
18079 on parameters and accordingly set the marshalling info.
18081 2002-03-09 Miguel de Icaza <miguel@ximian.com>
18083 * class.cs: Optimizing slightly by removing redundant code after
18084 we switched to the `NoTypes' return value.
18085 (Property.DefineMethod): use NoTypes here too.
18087 This fixes the bug I introduced in my last batch of changes.
18089 2002-03-05 Ravi Pratap <ravi@ximian.com>
18091 * tree.cs (RecordEnum): Add. We now keep track of enums too.
18093 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18094 Enums since those are types too.
18096 * cs-parser.jay (enum_declaration): Record enums as we parse them.
18098 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
18099 thanks to a call during the lookup process.
18101 2002-03-07 Miguel de Icaza <miguel@ximian.com>
18103 * statement.cs (Foreach): Lots of work to accomodate a particular
18104 kind of foreach statement that I had not kept in mind. It is
18105 possible to have foreachs on classes that provide a GetEnumerator
18106 method that return objects that implement the "pattern" for using
18107 a foreach, there is no need to support GetEnumerator
18110 This is needed to compile nant.
18112 * decl.cs: Only report 114 if the member is not `Finalize' and if
18113 the warning level is at least 2.
18115 * class.cs: Moved the compare function from Method to
18118 (MethodSignature.InheritableMemberSignatureCompare): Add new
18119 filter function that is used to extract inheritable methods from a
18122 (Method.Define): Use the new `inheritable_method_signature_filter'
18125 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18128 2002-03-06 Miguel de Icaza <miguel@ximian.com>
18130 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18132 * cs-parser.jay: Add opt_semicolon to the interface declaration.
18134 * expression.cs: Pass location information to
18135 ConvertImplicitStandard.
18137 * class.cs: Added debugging code to track return values from
18140 2002-03-05 Miguel de Icaza <miguel@ximian.com>
18142 * expression.cs (Is.DoResolve): If either side of the `is' is an
18143 interface, do not flag the warning.
18145 * ecore.cs (ImplicitReferenceConversion): We need a separate test
18148 * report.cs: Allow for --fatal to be used with --probe.
18150 * typemanager.cs (NoTypes): Move the definition for the empty Type
18153 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18155 (TypeContainer.DefineProxy): New function used to proxy to parent
18156 implementations when implementing interfaces.
18157 (TypeContainer.ParentImplements): used to lookup if our parent
18158 implements a public function that is required by an interface.
18159 (TypeContainer.VerifyPendingMethods): Hook this up.
18161 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18162 `modules' and `assemblies' arraylists into arrays. We only grow
18163 these are the very early start up of the program, so this improves
18164 the speedof LookupType (nicely measured).
18166 * expression.cs (MakeByteBlob): Replaced unsafe code with
18167 BitConverter, as suggested by Paolo.
18169 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18170 folding of string concatenation, but if either side is a string,
18171 and the other is not, then return null, and let the runtime use
18172 the concatenation on the string plus the object (using
18173 `Object.ToString').
18175 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18177 Constant Folding has been implemented now.
18179 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18180 the error instead on types that are not supported in one's
18183 * constant.cs (Constant and all children): New set of functions to
18184 perform implict and explicit conversions.
18186 * ecore.cs (EnumConstant): Implement the new functions to perform
18187 conversion by proxying to the child expression.
18189 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18190 own separate setting that can not be turned off from the command
18191 line using --unchecked or --checked and is only controlled using
18192 the checked/unchecked statements and expressions. This setting is
18193 used by the constant folder to flag errors.
18195 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18196 ConstantCheckState as well.
18198 During Resolve, they also have to flag the state, because the
18199 constant folder runs completely in the Resolve phase.
18201 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18204 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18206 * cfold.cs: New file, this file contains the constant folder.
18208 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18209 argument to track whether we are using the resulting address to
18210 load or store a value and provide better error messages.
18212 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18213 new AddressOf arguments.
18215 * statement.cs (Foreach.EmitCollectionForeach): Update
18217 * expression.cs (Argument.Emit): Call AddressOf with proper
18218 arguments to track usage.
18220 (New.DoEmit): Call AddressOf with new arguments.
18222 (Unary.Emit): Adjust AddressOf call.
18224 2002-03-01 Ravi Pratap <ravi@ximian.com>
18226 * cs-parser.jay (member_access): Change the case for pre-defined types
18227 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
18230 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18233 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18234 essentially like methods and apply attributes like MethodImplOptions to them too.
18236 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18239 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18240 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18243 * Update code everywhere accordingly.
18245 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18247 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18249 2002-02-28 Ravi Pratap <ravi@ximian.com>
18251 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18252 try performing lookups against those instead of jumping straight into using
18253 the 'using' clauses.
18255 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18257 (LookupType): Perform lookups in implicit parents too.
18259 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18260 sequence as RootContext.LookupType.
18262 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18263 the various cases of namespace lookups into this method.
18265 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18267 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18268 in positional arguments)
18270 * class.cs (Operator): Update the AllowedModifiers to contain
18273 * cs-parser.jay: Update operator declaration to allow for the
18274 operator body to be empty.
18276 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18279 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18281 * class.cs (Method.Emit): Label parameters.
18283 * driver.cs: Return 1 or 0 as the program exit code.
18285 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18287 * expression.cs: Special case the `null' object when trying to
18288 auto-compute the type, as anything can be explicitly converted to
18291 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18292 spotting this Paolo.
18294 (Expression.ImplicitNumericConversion): Perform comparissions of
18295 the type using the underlying type in the case of an enumeration
18296 rather than using the enumeration type for the compare.
18298 Cope with the underlying == type case, which is not possible to
18301 (Expression.ConvertNumericExplicit): Perform comparissions of
18302 the type using the underlying type in the case of an enumeration
18303 rather than using the enumeration type for the compare.
18305 * driver.cs: If the user does not supply an extension, assume .exe
18307 * cs-parser.jay (if_statement): Rewrote so that we can track the
18308 location for the if statement.
18310 * expression.cs (Binary.ConstantFold): Only concat strings when
18311 the operation is "+", not everything ;-)
18313 * statement.cs (Statement.EmitBoolExpression): Take a location
18315 (If, While, Do): Track location.
18317 * expression.cs (Binary.ResolveOperator): In the object + string
18318 case, I was missing a call to ConvertImplicit
18320 2002-02-25 Ravi Pratap <ravi@ximian.com>
18322 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18323 Location arguments. Ensure we use RootContext.LookupType to do our work
18324 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18326 * interface.cs (PopulateMethod): Handle the type of the parameter being
18329 * expression.cs (Invocation.BetterFunction): Handle the case when we
18330 have a params method with no fixed arguments and a call is made with no
18333 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18335 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18336 the verbatim-string-literal
18338 * support.cs (InternalParameters.ParameterModifier): handle null
18340 (InternalParameters.ParameterType): ditto.
18342 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18343 duplicating the name of the variable parameter.
18344 (GetParameterByName): Fix bug where we were not looking up array
18345 paramters if they were the only present (thanks Paolo!).
18346 (GetParameterInfo): We only have an empty set of types if both
18347 fixed and array are set to null.
18348 (GetParameterInfo-idx): Handle FixedParameter == null
18350 * cs-parser.jay: Handle the case where there is no catch
18351 statements (missing null test).
18353 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18355 * driver.cs (MainDriver): Be conservative on our command line
18358 Catch DirectoryNotFoundException when calling GetFiles.
18360 (SplitPathAndPattern): Used to split the input specification into
18361 a path and a pattern that we can feed to Directory.GetFiles.
18363 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18365 * statement.cs (Fixed): Implement the last case of the Fixed
18366 statement (string handling).
18368 * expression.cs (StringPtr): New class used to return a char * to
18369 a string; Used by the Fixed statement.
18371 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18373 * expression.cs (Binary.ResolveOperator): Remove redundant
18374 MemberLookup pn parent type.
18375 Optimize union call, we do not need a union if the types are the same.
18376 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18379 Specialize the use of MemberLookup everywhere, instead of using
18380 the default settings.
18382 (StackAlloc): Implement stackalloc keyword.
18384 * cs-parser.jay: Add rule to parse stackalloc.
18386 * driver.cs: Handle /h, /help, /?
18388 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18389 before we supported unsafe code.
18391 * makefile: add --unsafe to the self compilation of mcs.
18393 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18395 * expression.cs (PointerArithmetic): New class that is used to
18396 perform pointer arithmetic.
18397 (Binary.Resolve): Handle pointer arithmetic
18398 Handle pointer comparission.
18399 (ArrayPtr): Utility expression class that is used to take the
18400 address of an array.
18402 (ElementAccess): Implement array access for pointers
18404 * statement.cs (Fixed): Implement fixed statement for arrays, we
18405 are missing one more case before we are done.
18407 * expression.cs (Indirection): Implement EmitAssign and set the
18408 ExprClass to Variable. This allows pointer dereferences to be
18409 treated as variables, and to have values assigned to them.
18411 * ecore.cs (Expression.StoreFromPtr): New utility function to
18412 store values dereferencing.
18414 2002-02-20 Ravi Pratap <ravi@ximian.com>
18416 * expression.cs (Binary.ResolveOperator): Ensure that we are
18417 not trying to operate on a void type - this fixes the reported
18420 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18421 the parent implementation is sealed.
18423 * ../errors/cs0239.cs : Add.
18425 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18427 * typemanager.cs (unverifiable_code_type): Corresponds to
18428 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18429 which have unsafe code in them.
18431 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18434 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18436 * cs-tokenizer.cs: Add support for @"litreal strings"
18438 Make tokenizer accept pre-processor directives
18439 on any column (remove the old C-like limitation).
18441 * rootcontext.cs (EmitCode): Emit any global attributes.
18442 (AddGlobalAttributes): Used to keep track of assembly attributes.
18444 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18446 * cs-parser.jay: Add support for global attributes.
18448 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18450 * expression.cs (Indirection): New helper class. Unary will
18451 create Indirection classes to be able to implement the
18452 IMemoryLocation interface on it.
18454 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18456 * cs-parser.jay (fixed_statement): reference the right statement.
18458 * statement.cs (Fixed.Emit): Finish implementing the fixed
18459 statement for the &x case.
18461 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18463 * class.cs (Property.Define, Method.Define): Remove newslot when
18466 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18467 wrong. NewSlot should only be used if the `new' keyword is present.
18469 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18470 locating our system dir. Sorry about this.
18472 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18474 * driver.cs (GetSystemDir): Compute correctly the location of our
18475 system assemblies. I was using the compiler directory instead of
18476 the library directory.
18478 2002-02-13 Ravi Pratap <ravi@ximian.com>
18480 * expression.cs (BetterFunction): Put back in what Miguel commented out
18481 since it is the correct fix. The problem is elsewhere ;-)
18483 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18484 parameters of the parms method are themselves compatible or not !
18486 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18487 to check that a class implements an interface before saying that an implicit
18488 conversion was allowed. Use ImplementsInterface to do the checking.
18490 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18492 * class.cs (Method.Define): Track whether we are an explicit
18493 implementation or not. And only call DefineMethodOverride if we
18494 are an explicit implementation.
18496 (Property.DefineMethod): Ditto.
18498 2002-02-11 Ravi Pratap <ravi@ximian.com>
18500 * expression.cs (BetterFunction): Catch hideous bug which was
18501 preventing us from detecting ambiguous calls due to implicit casts i.e
18504 2002-01-29 Miguel de Icaza <miguel@ximian.com>
18506 * support.cs (Pair): Remove un-needed method. I figured why I was
18507 getting the error in cs-parser.jay, the variable in a foreach loop
18508 is readonly, and the compiler does not really treat this as a variable.
18510 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
18511 instead of EQUALS in grammar.
18513 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18515 * expression.cs (Unary.DoResolve): Check whether the argument is
18518 2002-01-28 Miguel de Icaza <miguel@ximian.com>
18520 * support.cs: Api for Pair to set a value. Despite the fact that
18521 the variables are public the MS C# compiler refuses to compile
18522 code that accesses the field if the variable is part of a foreach
18525 * statement.cs (Fixed): Begin implementation of the fixed
18528 (Block.AddVariable): Return the VariableInfo on success and null
18529 on failure instead of true/false.
18531 * cs-parser.jay (foreach): Catch errors on variables already
18532 defined (we were ignoring this value before) and properly unwind
18533 the block hierarchy
18535 (fixed_statement): grammar for the fixed statement.
18537 2002-01-25 Miguel de Icaza <miguel@ximian.com>
18539 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18540 pointer types to be incretemented.
18542 (SizeOf): Implement.
18544 * cs-parser.jay (pointer_member_access): Implement
18545 expr->IDENTIFIER production.
18547 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18548 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18551 (Unary): Implement indirection.
18553 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18554 use in non-unsafe context).
18556 (SimpleName.DoResolve): Check for pointers in field access on safe
18559 (Expression.LoadFromPtr): Factor the load-indirect code in this
18560 function. This was duplicated in UnboxCast and ParameterReference
18562 2002-01-24 Miguel de Icaza <miguel@ximian.com>
18564 * expression.cs (ComposedCast): report an error if a pointer cast
18565 is used in a safe region.
18567 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18568 pointer type casts in unsafe context.
18570 * codegen.cs (EmitContext): Set up IsUnsafe.
18572 * cs-parser.jay (non_expression_type): Add productions for pointer
18575 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18576 code. We should not use force into static mode if the method is
18577 not virtual. Fixes bug in MIS
18579 * statement.cs (Do.Emit, While.Emit, For.Emit,
18580 Statement.EmitBoolExpression): Add support to Do and While to
18581 propagate infinite loop as `I do return' semantics.
18583 Improve the For case to also test for boolean constants.
18585 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18586 to the list of attributes we can add.
18588 Remove `EmitContext' argument.
18590 * class.cs (Method.Define): Apply parameter attributes.
18591 (Constructor.Define): Apply parameter attributes.
18592 (MethodCore.LabelParameters): Move here the core of labeling
18595 * support.cs (ReflectionParameters.ParameterModifier,
18596 InternalParameters.ParameterModifier): Use IsByRef on the type and
18597 only return the OUT bit for these parameters instead of in/out/ref
18600 This is because I miss-understood things. The ParameterInfo.IsIn
18601 and IsOut represent whether the parameter has the [In] and [Out]
18604 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18606 * ecore.cs (FieldExpr.Emit): Release temporaries.
18608 * assign.cs (LocalTemporary.Release): new function.
18610 * codegen.cs (EmitContext.GetTemporaryStorage,
18611 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18612 temporary storage. Now we can "put back" localbuilders when we
18615 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18617 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18618 need to make a copy of the variable to generate verifiable code.
18620 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18622 * driver.cs: Compute dynamically the system directory.
18624 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18625 Slower, but more generally useful. Used by the abstract
18626 registering implementation.
18628 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18629 the rules for the special rule on Type/instances. First check if
18630 we have the same name, and if so, try that special static path
18631 rather than the instance path.
18633 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18635 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18638 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18639 Enum, ValueType, Delegate or Array for non-corlib compiles.
18641 * cs-tokenizer.cs: Catch long identifiers (645)
18643 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18646 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18647 fix, we were returning too early, so we were not registering
18648 pending methods from abstract classes.
18650 Do not register pending methods if the class is abstract.
18652 * expression.cs (Conditional.DoResolve): Report circular implicit
18653 conversions when we neecd to compute it for conditional
18656 (Is.DoResolve): If the expression is always of the provided type,
18657 flag warning 183. If the expression can not ever be of the
18658 provided type flag warning 184.
18660 * class.cs: Catch 169 as well.
18662 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18665 2002-01-18 Nick Drochak <ndrochak@gol.com>
18667 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
18669 2002-01-17 Miguel de Icaza <miguel@ximian.com>
18671 * interface.cs: (PopulateMethod): Check for pointers being defined
18672 only if the unsafe context is active.
18673 (PopulateProperty): ditto.
18674 (PopulateIndexer): ditto.
18676 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18677 specified. If pointers are present, make sure that they are
18678 present in an unsafe context.
18679 (Constructor, Constructor.Define): ditto.
18680 (Field, Field.Define): ditto.
18681 (Property, Property.Define): ditto.
18682 (Event, Event.Define): ditto.
18684 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18685 hashtable if there are classes or structs defined.
18687 * expression.cs (LocalVariableReference.DoResolve): Simplify this
18688 code, as the constant resolution moved.
18690 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18691 the metadata, so we can flag error 133.
18693 * decl.cs (MemberCore.UnsafeOK): New function to test that a
18694 pointer is being declared in an unsafe context.
18696 2002-01-16 Miguel de Icaza <miguel@ximian.com>
18698 * modifiers.cs (Modifiers.Check): Require a Location argument.
18699 Report error 227 for Unsafe use.
18701 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18703 * statement.cs (For.Emit): If the test is null, then report that
18704 we do `return', as we wont reach anything afterwards.
18706 (Switch.SwitchGoverningType): Track the expression that matched
18709 * driver.cs: Allow negative numbers as an error code to flag.
18711 * cs-parser.jay: Handle 1551.
18713 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18715 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18717 * cs-parser.jay: Report 1518 (type declaration can only contain
18718 class, struct, interface, enum or delegate)
18720 (switch_label): Report 1523 (keywords `case' or `default' must
18723 (opt_switch_sections): Report 1522 (empty switch)
18725 * driver.cs: Report 1515 (response file specified multiple times)
18726 Report 1516 (Source file specified multiple times).
18728 * expression.cs (Argument.Resolve): Signal 1510
18730 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18731 access not allowed in static code)
18733 2002-01-11 Ravi Pratap <ravi@ximian.com>
18735 * typemanager.cs (IsPointerType): Utility method which we are going
18738 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18739 the object type, so we take care of that.
18741 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18743 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18744 added to non-params parameters :-)
18746 * typemanager.cs (CSharpName): Include 'void' type too.
18748 (void_ptr_type): Include in the set of core types.
18750 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
18753 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
18756 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
18757 completely forgotten about it.
18759 2002-01-10 Ravi Pratap <ravi@ximian.com>
18761 * cs-parser.jay (pointer_type): Add. This begins our implementation
18762 of parsing rules for unsafe code.
18764 (unsafe_statement): Implement.
18766 (embedded_statement): Modify to include the above.
18768 * statement.cs (Unsafe): Implement new class for unsafe blocks.
18770 * codegen.cs (EmitContext.InUnsafe): Add. This determines
18771 if the current context is an unsafe one.
18773 * cs-parser.jay (local_variable_pointer_type): Since local variable types
18774 are handled differently, we need separate rules for them.
18776 (local_variable_declaration): Update to use local_variable_pointer_type
18777 to allow variable declarations of unmanaged pointer types.
18779 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18780 in unsafe contexts.
18782 * ../errors/cs0214.cs : Add.
18784 2002-01-16 Nick Drochak <ndrochak@gol.com>
18786 * makefile: remove 'response' file when cleaning.
18788 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18790 * cs-parser.jay: Report 1524.
18792 2002-01-14 Miguel de Icaza <miguel@ximian.com>
18794 * typemanager.cs (RegisterMethod): drop checking if we have
18795 registered this from here
18797 2002-01-12 Miguel de Icaza <miguel@ximian.com>
18799 * class.cs (Method.EmitDestructor): Implement calling our base
18802 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18803 value of InFinally.
18805 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18806 this routine and will wrap the call in a try/catch block. Deal
18809 2002-01-11 Miguel de Icaza <miguel@ximian.com>
18811 * ecore.cs (Expression.MemberLookup): instead of taking a
18812 parameter `same_type' that was used to tell whether we could
18813 access private members we compute our containing type from the
18816 (FieldExpr): Added partial support for volatile fields. This does
18817 not work for volatile fields exposed from assemblies, as I can not
18818 figure out how to extract the modreq from it.
18820 Updated all the source files to use this.
18822 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18823 because it is referenced by MemberLookup very often.
18825 2002-01-09 Ravi Pratap <ravi@ximian.com>
18827 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18828 TypeBuilder.GetCustomAttributes to retrieve what we need.
18830 Get rid of redundant default_member_attr_type as this is the same as
18831 default_member_type which already exists.
18833 * interface.cs, attribute.cs : Update accordingly.
18835 2002-01-08 Miguel de Icaza <miguel@ximian.com>
18837 * typemanager.cs: Enable IndexerPropertyName again. It does not
18838 work for TYpeBuilders though. Ravi, can you please fix this?
18840 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18842 * expression.cs (Argument.Emit): Handle the case of ref objects
18843 being passed to ref functions;
18845 (ParameterReference.EmitLoad): Loads the content of the pointer
18846 without dereferencing.
18848 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18850 * cs-tokenizer.cs: Implemented the pre-processing expressions.
18852 2002-01-08 Ravi Pratap <ravi@ximian.com>
18854 * class.cs (Indexer.DefineMethod): Incorporate the interface
18855 type in the name of the method if we are doing explicit interface
18858 * expression.cs (ConversionExists): Remove as it is completely obsolete.
18860 (BetterConversion): Fix extremely trivial bug where we were referring to
18861 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18864 * ../errors/bug16.cs : Add although we have fixed it.
18866 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18868 * expression.cs (BaseIndexer): Begin implementation.
18870 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18872 * cs-parser.jay (indexer_declarator): Use qualified_identifier
18873 production directly to remove a shift/reduce, and implement
18874 explicit interface implementation.
18876 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18877 after a floating point suffix.
18879 * expression.cs (DoNumericPromotions): Improved the conversion for
18880 uint/uint. If we have a constant, we avoid doing a typecast to a
18883 * class.cs (Indexer): Implement explicit interface implementation
18886 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18888 * class.cs: make the default instance constructor public and hidebysig.
18890 2001-01-03 Ravi Pratap <ravi@ximian.com>
18892 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18893 so we can call it from elsewhere.
18895 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18896 we emit it internally if the class has a defined indexer; otherwise the user
18897 emits it by decorating the class definition with the DefaultMemberAttribute.
18899 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18900 attribute is not used on a type which defines an indexer.
18902 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18903 character when we skip whitespace.
18905 * ../errors/cs0646.cs : Add.
18907 2002-01-03 Miguel de Icaza <miguel@ximian.com>
18909 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18912 * makefile: Add practical target `mcs3.exe' which builds the third
18913 generation compiler.
18915 * expression.cs (New): Fix structures constructor calling.
18917 * class.cs (Property, Method, Indexer): Emit Final flag on the
18918 method if we are an interface implementation and we are not
18921 * ecore.cs (PropertyExpr): New public field `IsBase', tells
18922 whether this property is referencing a `base' method.
18924 * expression.cs (Invocation.EmitCall): take an extra argument:
18925 is_base, this is used to determine whether the `call' or
18926 `callvirt' opcode should be used.
18929 * delegate.cs: update EmitCall.
18931 * class.cs (Method.Define): Set NewSlot for the cases where we are
18932 not implementing an interface method.
18934 (Property.Define): ditto.
18936 2002-01-02 Miguel de Icaza <miguel@ximian.com>
18938 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18939 'r'. Allows mcs to parse itself fully.
18941 2002-01-02 Ravi Pratap <ravi@ximian.com>
18943 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18944 of the number of initializers that require the InitializeArray method.
18946 (CheckIndices): Store the Expression in all cases - not the plain value. Also
18947 update the above field where necessary.
18949 (MakeByteBlob): Update accordingly.
18951 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
18954 (EmitDynamicInitializers): Update in accordance with the new optimization.
18956 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18957 same OpCode applies.
18959 * cs-parser.jay : Fix some glaring errors I introduced.
18961 2002-01-01 Ravi Pratap <ravi@ximian.com>
18963 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18964 so that we can check for name clashes there too.
18966 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18967 for interface indexers.
18969 * interfaces.cs (Define): Emit the default member attribute.
18971 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18972 variable was being referred to while setting the value ;-)
18974 2002-01-01 Miguel de Icaza <miguel@ximian.com>
18976 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18977 byte-by-byte information when we know the data is zero.
18979 Make the block always a multiple of 4, because
18980 DefineInitializedData has a bug.
18982 * assign.cs: Fix, we should assign from the temporary, not from
18985 * expression.cs (MakeByteBlob): Fix my incorrect code.
18987 2001-12-31 Miguel de Icaza <miguel@ximian.com>
18989 * typemanager.cs (EnumToUnderlying): This function is used to get
18990 the underlying type from an enumeration, because it does not
18993 * constant.cs: Use the I4_S form for values between -128 and 127.
18995 * statement.cs (Block.LookupLabel): Looks up a label.
18996 (Block): Drop support for labeled blocks.
18998 (LabeledStatement): New kind of statement that represents a label
19001 (Goto): Finally implement this bad boy.
19003 * cs-parser.jay: Update to reflect new mechanism to implement
19006 2001-12-30 Miguel de Icaza <miguel@ximian.com>
19008 * codegen.cs (EmitContext.This): a codegen property that keeps the
19009 a single instance of this instead of creating many different this
19012 * delegate.cs (Delegate.DoResolve): Update to use the property;
19014 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19016 * expression.cs (BaseAccess.DoResolve): Ditto.
19018 2001-12-29 Ravi Pratap <ravi@ximian.com>
19020 * typemanager.cs (methodimpl_attr_type): Add to hold the type
19021 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19023 (InitCoreTypes): Update accordingly.
19025 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19026 so we can quickly store the state.
19028 (ApplyAttributes): Set the correct implementation flags
19029 for InternalCall methods.
19031 2001-12-29 Miguel de Icaza <miguel@ximian.com>
19033 * expression.cs (EmitCall): if a method is not virtual, then do
19034 not use callvirt on it.
19036 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19037 user defined stuff) requires the use of stobj, which takes an
19038 address on the stack instead of an array and an index. So emit
19039 the Ldelema operation for it.
19041 (EmitStoreOpcode): Use stobj for valuetypes.
19043 (UnaryMutator.EmitCode): Use the right 1 value depending on
19044 whether we are dealing with int64/uint64, float or doubles.
19046 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19047 constructors that I implemented last night.
19049 (Constructor.IsDefault): Fix to work properly for static
19052 * cs-parser.jay (CheckDef): report method signature errors.
19053 Update error number 103 to be 132.
19055 * decl.cs: New AdditionResult enumeration value: MethodExists.
19056 Although we do this check for methods later on in the semantic
19057 analysis, catching repeated default constructors is so easy that
19058 we catch these here.
19060 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19063 (ParameterReference.EmitAssign, Emit): handle
19066 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19067 (ArrayAccess.EmitStoreOpcode): ditto.
19069 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19071 * expression.cs (MakeByteBlob): Complete all the missing types
19072 (uint, short, ushort, byte, sbyte)
19074 * class.cs: Only init instance field initializers on instance
19077 Rename `constructors' to instance_constructors.
19079 (TypeContainer.AddConstructor): Only add constructors to the list
19080 if it is not static.
19082 Make sure that we handle default_static_constructor independently
19083 everywhere where we handle instance_constructors
19085 2001-12-28 Miguel de Icaza <miguel@ximian.com>
19087 * class.cs: Do not lookup or create a base initializer for a
19088 static constructor.
19090 (ConstructorInitializer.Resolve): use the proper type to lookup
19093 * cs-parser.jay: Report error 1585 (modifiers between type and name).
19095 * enum.cs, interface.cs: Remove CloseType, this is taken care by
19098 * decl.cs: CloseType is now an virtual method, the default
19099 implementation just closes this type.
19101 2001-12-28 Ravi Pratap <ravi@ximian.com>
19103 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19104 to PreserveSig by default. Also emit HideBySig on such methods.
19106 Basically, set the defaults to standard values.
19108 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19109 argument, if candidate is better, it can't be worse than the best !
19111 (Invocation): Re-write bits to differentiate between methods being
19112 applicable in their expanded form and their normal form - for params
19115 Get rid of use_standard everywhere as only standard conversions are allowed
19116 in overload resolution.
19118 More spec conformance.
19120 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19122 * driver.cs: Add --timestamp, to see where the compiler spends
19125 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19126 `this' in static code.
19128 (SimpleName.DoResolve): Implement in terms of a helper function
19129 that allows static-references to be passed upstream to
19132 (Expression.ResolveWithSimpleName): Resolve specially simple
19133 names when called by MemberAccess to implement the special
19136 (Expression.ImplicitReferenceConversion): Handle conversions from
19137 Null to reference types before others, as Null's type is
19140 * expression.cs (Invocation.EmitCall): Handle the special case of
19141 calling methods declared on a reference type from a ValueType
19142 (Base classes System.Object and System.Enum)
19144 (MemberAccess.Resolve): Only perform lookups on Enumerations if
19145 the left hand side is a TypeExpr, not on every enumeration.
19147 (Binary.Resolve): If types are reference types, then do a cast to
19148 object on operators != and == of both arguments.
19150 * typemanager.cs (FindMembers): Extract instance and static
19151 members if requested.
19153 * interface.cs (PopulateProperty): Use void_type instead of null
19154 as the return type for the setter method.
19156 (PopulateIndexer): ditto.
19158 2001-12-27 Ravi Pratap <ravi@ximian.com>
19160 * support.cs (ReflectionParameters): Fix minor bug where we
19161 were examining the wrong parameter for the ParamArray attribute.
19163 Cope with requests for the type of the parameter at position
19164 greater than the params parameter's. We now return the element
19165 type of the params array as that makes more sense.
19167 * expression.cs (Invocation.IsParamsMethodApplicable): Update
19168 accordingly as we no longer have to extract the element type
19171 (Invocation.OverloadResolve): Update.
19173 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19175 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19176 against IEnumerator, test whether the return value is a descendant
19177 of the IEnumerator interface.
19179 * class.cs (Indexer.Define): Use an auxiliary method to implement
19180 the other bits of the method definition. Begin support for
19181 explicit interface implementation.
19183 (Property.DefineMethod): Use TypeManager.void_type instead of null
19184 for an empty return value.
19186 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19188 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19189 dealing with a FieldExpr which is composed of a FieldBuilder, in
19190 the code path we did extract the constant, but we should have
19191 obtained the underlying value to be able to cast it (otherwise we
19192 end up in an infinite loop, this is what Ravi was running into).
19194 (ArrayCreation.UpdateIndices): Arrays might be empty.
19196 (MemberAccess.ResolveMemberAccess): Add support for section
19197 14.5.4.1 that deals with the special case of E.I when E is a type
19198 and something else, that I can be a reference to a static member.
19200 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19201 handle a particular array type to create byte blobs, it is just
19202 something we dont generate byteblobs for.
19204 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19207 * location.cs (Push): remove the key from the hashtable that we
19208 are about to add. This happens for empty files.
19210 * driver.cs: Dispose files after we have parsed them.
19212 (tokenize): new function that only runs the tokenizer on its
19213 input, for speed testing.
19215 2001-12-26 Ravi Pratap <ravi@ximian.com>
19217 * class.cs (Event.Define): Define the private field only if there
19218 are no accessors defined.
19220 * expression.cs (ResolveMemberAccess): If there is no associated
19221 field with the event, that means we have an event defined with its
19222 own accessors and we should flag error cs0070 since transforming
19223 ourselves into a field is not valid in that case.
19225 * ecore.cs (SimpleName.DoResolve): Same as above.
19227 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19228 and charset to sane values.
19230 2001-12-25 Ravi Pratap <ravi@ximian.com>
19232 * assign.cs (DoResolve): Perform check on events only if they
19233 are being accessed outside the declaring type.
19235 * cs-parser.jay (event_declarations): Update rules to correctly
19236 set the type of the implicit parameter etc.
19238 (add_accessor, remove_accessor): Set current local parameters.
19240 * expression.cs (Binary): For delegate addition and subtraction,
19241 cast the return value from the method into the appropriate delegate
19244 2001-12-24 Ravi Pratap <ravi@ximian.com>
19246 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19247 of these as the workaround is unnecessary.
19249 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19250 delegate data - none of that is needed at all.
19252 Re-write bits to extract the instance expression and the delegate method
19255 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19258 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19259 of attaching attributes instead of duplicating code everywhere.
19261 * everywhere : Update code to do attribute emission using the above method.
19263 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19265 * expression.cs (IsParamsMethodApplicable): if there are not
19266 parameters, return immediately.
19268 * ecore.cs: The 0 literal can be implicity converted to an enum
19271 (SimpleName.DoResolve): First lookup the type, then lookup the
19274 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19275 want to get its address. If the InstanceExpression is not
19276 addressable, store the result in a temporary variable, then get
19279 * codegen.cs: Only display 219 errors on warning level or above.
19281 * expression.cs (ArrayAccess): Make it implement the
19282 IMemoryLocation interface.
19284 (Binary.DoResolve): handle the operator == (object a, object b)
19285 and operator != (object a, object b) without incurring into a
19286 BoxedCast (because 5 != o should never be performed).
19288 Handle binary enumerator operators.
19290 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19291 value type, otherwise use Ldelem_ref.
19293 Use precomputed names;
19295 (AddressOf): Implement address of
19297 * cs-parser.jay (labeled_statement): Fix recursive block
19298 addition by reworking the production.
19300 * expression.cs (New.DoEmit): New has a special case:
19302 If we are dealing with a ValueType, we have a few
19303 situations to deal with:
19305 * The target of New is a ValueType variable, that is
19306 easy, we just pass this as the variable reference
19308 * The target of New is being passed as an argument,
19309 to a boxing operation or a function that takes a
19312 In this case, we need to create a temporary variable
19313 that is the argument of New.
19316 2001-12-23 Ravi Pratap <ravi@ximian.com>
19318 * rootcontext.cs (LookupType): Check that current_type is not null before
19319 going about looking at nested types.
19321 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19322 not implement the IAssignMethod interface any more.
19324 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19325 where we tranform them into FieldExprs if they are being resolved from within
19326 the declaring type.
19328 * ecore.cs (SimpleName.DoResolve): Do the same here.
19330 * assign.cs (DoResolve, Emit): Clean up code considerably.
19332 * ../errors/bug10.cs : Add.
19334 * ../errors/cs0070.cs : Add.
19336 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19338 * assign.cs : Get rid of EventIsLocal everywhere.
19340 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19342 * ecore.cs (ConvertIntLiteral): finished the implementation.
19344 * statement.cs (SwitchLabel): Convert the value we are using as a
19345 key before looking up the table.
19347 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19349 * codegen.cs (EmitTopBlock): Require a Location argument now.
19351 * cs-parser.jay (constructor_declarator): We need to setup
19352 current_local_parameters before we parse the
19353 opt_constructor_initializer, to allow the variables to be bound
19354 to the constructor arguments.
19356 * rootcontext.cs (LookupType): First lookup nested classes in our
19357 class and our parents before we go looking outside our class.
19359 * expression.cs (ConstantFold): Extract/debox the values at the
19362 * rootcontext.cs (EmitCode): Resolve the constants first before we
19363 resolve the types. This is not really needed, but it helps debugging.
19365 * statement.cs: report location.
19367 * cs-parser.jay: pass location to throw statement.
19369 * driver.cs: Small bug fix.
19371 * report.cs: Updated format to be 4-zero filled digits.
19373 2001-12-22 Ravi Pratap <ravi@ximian.com>
19375 * expression.cs (CheckIndices): Fix minor bug where the wrong
19376 variable was being referred to ;-)
19378 (DoEmit): Do not call EmitStaticInitializers when the
19379 underlying type is System.Object.
19381 2001-12-21 Ravi Pratap <ravi@ximian.com>
19383 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19384 and do the usual workaround for SRE.
19386 * class.cs (MyEventBuilder.EventType): New member to get at the type
19387 of the event, quickly.
19389 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19391 * assign.cs (Assign.DoResolve): Handle the case when the target
19392 is an EventExpr and perform the necessary checks.
19394 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19397 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19399 (EventExpr): Set the type in the constructor itself since we
19400 are meant to be born fully resolved.
19402 (EventExpr.Define): Revert code I wrote earlier.
19404 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19405 instance expression is null. The instance expression is a This in that case
19406 or a null, depending on whether it is a static method or not.
19408 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19409 refers to more than one method.
19411 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19412 and accordingly flag errors.
19414 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19416 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19418 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19420 * location.cs (ToString): Provide useful rutine.
19422 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19424 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19425 objects, return the actual integral boxed.
19427 * statement.cs (SwitchLabel): define an ILLabel for each
19430 (Switch.CheckSwitch): If the value is a Literal, extract
19431 the underlying literal.
19433 Also in the unused hashtable we had, add the SwitchLabel so we can
19434 quickly look this value up.
19436 * constant.cs: Implement a bunch of new constants. Rewrite
19437 Literal based on this. Made changes everywhere to adapt to this.
19439 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19440 dereferencing array only once, and also copes with enumrations.
19442 bytes are two bytes wide, not one.
19444 (Cast): Perform constant conversions.
19446 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19447 wrappers to the literals here.
19449 * expression.cs (DoNumericPromotions): long literals can converted
19450 to ulong implicity (this is taken care of elsewhere, but I was
19451 missing this spot).
19453 * ecore.cs (Expression.Literalize): Make the return type Literal,
19454 to improve type checking.
19456 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19458 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19460 * literal.cs: Revert code from ravi that checked the bounds. The
19461 bounds are sane by the definition of the type itself.
19463 * typemanager.cs: Fix implementation of ImplementsInterface. We
19464 need to actually look up in our parent hierarchy for interfaces
19467 * const.cs: Use the underlying type for enumerations
19469 * delegate.cs: Compute the basename for the delegate creation,
19470 that should fix the delegate test case, and restore the correct
19471 Type Lookup semantics in rootcontext
19473 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19474 referencing a nested type with the Reflection API is using the "+"
19477 * cs-parser.jay: Do not require EOF token at the end.
19479 2001-12-20 Ravi Pratap <ravi@ximian.com>
19481 * rootcontext.cs (LookupType): Concatenate type names with
19482 a '.' instead of a '+' The test suite passes again.
19484 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19485 field of the enumeration.
19487 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19488 the case when the member is an EventExpr.
19490 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19491 static has an associated instance expression.
19493 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19495 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19497 * class.cs (Event.Define): Register event and perform appropriate checks
19500 We define the Add and Remove methods even if the use provides none because
19501 in that case, we provide default implementations ourselves.
19503 Define a private field of the type of the event. This is done by the CSC compiler
19504 and we should be doing it too ;-)
19506 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19507 More methods we use in code we generate.
19509 (multicast_delegate_type, delegate_type): Two separate types since the distinction
19512 (InitCoreTypes): Update accordingly for the above.
19514 * class.cs (Event.Emit): Generate code for default accessors that we provide
19516 (EmitDefaultMethod): Do the job in the above.
19518 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
19521 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19523 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19524 builders even if we were missing one.
19526 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19527 pass the Basename as our class name instead of the Name. The
19528 basename will be correctly composed for us.
19530 * parameter.cs (Paramters): Now takes a Location argument.
19532 * decl.cs (DeclSpace.LookupType): Removed convenience function and
19533 make all the code call directly LookupType in RootContext and take
19534 this chance to pass the Location information everywhere.
19536 * Everywhere: pass Location information.
19538 2001-12-19 Miguel de Icaza <miguel@ximian.com>
19540 * class.cs (Constructor.Define): Updated way of detecting the
19541 length of the parameters.
19543 (TypeContainer.DefineType): Use basename as the type name for
19546 (TypeContainer.Define): Do not recursively define types here, as
19547 definition is taken care in order by the RootContext.
19549 * tree.cs: Keep track of namespaces in a per-file basis.
19551 * parameter.cs (Parameter.ComputeSignature): Update to use
19554 (Parameters.GetSignature): ditto.
19556 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19557 instead of a TypeContainer.
19559 (Interface.SemanticAnalysis): Use `this' instead of our parent to
19560 resolve names. Because we need to be resolve in our context, not
19563 * driver.cs: Implement response files.
19565 * class.cs (TypeContainer.DefineType): If we are defined, do not
19566 redefine ourselves.
19568 (Event.Emit): Emit the code for add/remove handlers.
19569 (Event.Define): Save the MethodBuilders for add/remove.
19571 * typemanager.cs: Use pair here too.
19573 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19574 DictionaryEntry requires the first argument to be non-null.
19576 (enum_declaration): Compute full name for registering the
19579 (delegate_declaration): Instead of using
19580 formal_parameter_list, use opt_formal_parameter_list as the list
19583 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19584 (EventParsing): New property that controls whether `add' and
19585 `remove' are returned as tokens or identifiers (for events);
19587 2001-12-19 Ravi Pratap <ravi@ximian.com>
19589 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19590 use MyEventBuilder only and let it wrap the real builder for us.
19592 (MyEventBuilder): Revamp constructor etc.
19594 Implement all operations that we perform on EventBuilder in precisely the same
19597 (FindMembers): Update to use the EventBuilder member.
19599 (Event.Emit): Update accordingly.
19601 2001-12-18 Ravi Pratap <ravi@ximian.com>
19603 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19604 by calling the appropriate methods.
19606 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19609 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19611 2001-12-17 Ravi Pratap <ravi@ximian.com>
19613 * delegate.cs (Delegate.Populate): Check that the return type
19614 and various parameters types are indeed accessible.
19616 * class.cs (Constructor.Define): Same here.
19618 (Field.Define): Ditto.
19620 (Event.Define): Ditto.
19622 (Operator.Define): Check that the underlying Method defined itself
19623 correctly - so it's MethodBuilder should not be null.
19625 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19626 expression happens to be null.
19628 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19629 members but as of now we don't seem to be able to do anything really useful with it.
19631 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19632 not the EventBuilder.
19634 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19636 * cs-tokenizer.cs: Add support for defines.
19637 Add support for #if, #elif, #else, #endif
19639 (eval_var): evaluates a variable.
19640 (eval): stubbed for evaluating functions.
19642 * cs-parser.jay: Pass the defines information
19644 * driver.cs: Add --define command line option.
19646 * decl.cs: Move MemberCore here.
19648 Make it the base class for DeclSpace. This allows us to catch and
19649 report 108 and 109 for everything now.
19651 * class.cs (TypeContainer.Define): Extract all the members
19652 before populating and emit the warning 108 (new keyword required
19653 to override) instead of having each member implement this.
19655 (MemberCore.Define): New abstract method, we will be using this in
19656 the warning reporting engine in Populate.
19658 (Operator.Define): Adjust to new MemberCore protocol.
19660 * const.cs (Const): This does not derive from Expression, it is a
19661 temporary object we use to create fields, it is a MemberCore.
19663 * class.cs (Method.Define): Allow the entry point to be in a
19666 * driver.cs: Rewrite the argument handler to clean it up a bit.
19668 * rootcontext.cs: Made it just an auxiliary namespace feature by
19669 making everything static.
19671 * driver.cs: Adapt code to use RootContext type name instead of
19674 * delegate.cs: Remove RootContext argument.
19676 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19679 * class.cs (Event.Define): The lookup can fail.
19681 * cs-tokenizer.cs: Begin implementation of pre-procesor.
19683 * expression.cs: Resolve the this instance before invoking the code.
19685 2001-12-17 Miguel de Icaza <miguel@ximian.com>
19687 * cs-parser.jay: Add a production in element_access that allows
19688 the thing to become a "type" reference. This way we can parse
19689 things like "(string [])" as a type.
19691 Note that this still does not handle the more complex rules of
19695 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
19697 * ecore.cs: (CopyNewMethods): new utility function used to
19698 assemble the list of methods from running FindMembers.
19700 (MemberLookup): Rework FindMembers so that
19702 2001-12-16 Miguel de Icaza <miguel@ximian.com>
19704 * class.cs (TypeContainer): Remove Delegates who fail to be
19707 * delegate.cs (Populate): Verify that we dont get null return
19708 values. TODO: Check for AsAccessible.
19710 * cs-parser.jay: Use basename to emit error 574 (destructor should
19711 have the same name as container class), not the full name.
19713 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19714 possible representation.
19716 Also implements integer type suffixes U and L.
19718 2001-12-15 Miguel de Icaza <miguel@ximian.com>
19720 * expression.cs (ArrayCreation.DoResolve): We need to do the
19721 argument resolution *always*.
19723 * decl.cs: Make this hold the namespace. Hold the root context as
19725 (LookupType): Move here.
19727 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19729 * location.cs (Row, Name): Fixed the code, it was always returning
19730 references to the first file.
19732 * interface.cs: Register properties defined through interfaces.
19734 * driver.cs: Add support for globbing on the command line
19736 * class.cs (Field): Make it derive from MemberCore as well.
19739 2001-12-15 Ravi Pratap <ravi@ximian.com>
19741 * class.cs (Event::Define): Check that the type of the event is a delegate
19742 type else flag error #66.
19744 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19747 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19748 values of EntryPoint, CharSet etc etc.
19750 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19752 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19753 be null and we should ignore this. I am not sure if this is really clean. Apparently,
19754 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19755 which needs this to do its work.
19757 * ../errors/cs0066.cs : Add.
19759 2001-12-14 Miguel de Icaza <miguel@ximian.com>
19761 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19764 * class.cs: (MethodSignature.MethodSignature): Removed hack that
19765 clears out the parameters field.
19766 (MemberSignatureCompare): Cleanup
19768 (MemberCore): New base class used to share code between MethodCore
19771 (RegisterRequiredImplementations) BindingFlags.Public requires
19772 either BindingFlags.Instace or Static. Use instance here.
19774 (Property): Refactored code to cope better with the full spec.
19776 * parameter.cs (GetParameterInfo): Return an empty array instead
19779 * class.cs (Property): Abstract or extern properties have no bodies.
19781 * parameter.cs (GetParameterInfo): return a zero-sized array.
19783 * class.cs (TypeContainer.MethodModifiersValid): Move all the
19784 method modifier validation to the typecontainer so we can reuse
19785 this on properties.
19787 (MethodCore.ParameterTypes): return an empty sized array of types.
19789 (Property.Define): Test property modifier validity.
19791 Add tests for sealed/override too.
19793 (Method.Emit): abstract or extern methods have no bodies.
19795 2001-12-14 Ravi Pratap <ravi@ximian.com>
19797 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19800 (Method::Define, ::Emit): Modify accordingly.
19802 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19804 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19806 * makefile: Pass in /unsafe.
19808 2001-12-13 Miguel de Icaza <miguel@ximian.com>
19810 * class.cs (MakeKey): Kill routine.
19812 * class.cs (TypeContainer.Define): Correctly define explicit
19813 method implementations (they require the full interface name plus
19816 * typemanager.cs: Deply the PtrHashtable here and stop using the
19817 lame keys. Things work so much better.
19819 This of course broke everyone who depended on `RegisterMethod' to
19820 do the `test for existance' test. This has to be done elsewhere.
19822 * support.cs (PtrHashtable): A hashtable that avoid comparing with
19823 the object stupid Equals method (because, that like fails all over
19824 the place). We still do not use it.
19826 * class.cs (TypeContainer.SetRequiredInterface,
19827 TypeContainer.RequireMethods): Killed these two routines and moved
19828 all the functionality to RegisterRequiredImplementations.
19830 (TypeContainer.RegisterRequiredImplementations): This routine now
19831 registers all the implementations required in an array for the
19832 interfaces and abstract methods. We use an array of structures
19833 which can be computed ahead of time to reduce memory usage and we
19834 also assume that lookups are cheap as most classes will not
19835 implement too many interfaces.
19837 We also avoid creating too many MethodSignatures.
19839 (TypeContainer.IsInterfaceMethod): Update and optionally does not
19840 clear the "pending" bit if we find that there are problems with
19843 (TypeContainer.VerifyPendingMethods): Update to report errors of
19844 methods that look like implementations but are not.
19846 (TypeContainer.Define): Add support for explicit interface method
19849 2001-12-12 Miguel de Icaza <miguel@ximian.com>
19851 * typemanager.cs: Keep track of the parameters here instead of
19852 being a feature of the TypeContainer.
19854 * class.cs: Drop the registration of parameters here, as
19855 InterfaceMethods are also interface declarations.
19857 * delegate.cs: Register methods with the TypeManager not only with
19858 the TypeContainer. This code was buggy.
19860 * interface.cs: Full registation here.
19862 2001-12-11 Miguel de Icaza <miguel@ximian.com>
19864 * expression.cs: Remove reducer for binary expressions, it can not
19867 * const.cs: Put here the code that used to go into constant.cs
19869 * constant.cs: Put here the code for constants, this is a new base
19870 class for Literals.
19872 * literal.cs: Make Literal derive from Constant.
19874 2001-12-09 Miguel de Icaza <miguel@ximian.com>
19876 * statement.cs (Return.Emit): Report error 157 if the user
19877 attempts to return from a finally block.
19879 (Return.Emit): Instead of emitting a return, jump to the end of
19882 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19883 LocalBuilder to store the result of the function. ReturnLabel is
19884 the target where we jump.
19887 2001-12-09 Radek Doulik <rodo@ximian.com>
19889 * cs-parser.jay: remember alias in current namespace
19891 * ecore.cs (SimpleName::DoResolve): use aliases for types or
19894 * class.cs (LookupAlias): lookup alias in my_namespace
19896 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19898 (LookupAlias): lookup alias in this and if needed in parent
19901 2001-12-08 Miguel de Icaza <miguel@ximian.com>
19905 * rootcontext.cs: (ModuleBuilder) Made static, first step into
19906 making things static. I need this to avoid passing the
19907 TypeContainer when calling ParameterType.
19909 * support.cs (InternalParameters.ParameterType): Remove ugly hack
19910 that did string manipulation to compute the type and then call
19911 GetType. Use Parameter.ParameterType instead.
19913 * cs-tokenizer.cs: Consume the suffix for floating values.
19915 * expression.cs (ParameterReference): figure out whether this is a
19916 reference parameter or not. Kill an extra variable by computing
19917 the arg_idx during emission.
19919 * parameter.cs (Parameters.GetParameterInfo): New overloaded
19920 function that returns whether a parameter is an out/ref value or not.
19922 (Parameter.ParameterType): The type of the parameter (base,
19923 without ref/out applied).
19925 (Parameter.Resolve): Perform resolution here.
19926 (Parameter.ExternalType): The full type (with ref/out applied).
19928 * statement.cs (Using.Emit, Using.EmitExpression): Implement
19929 support for expressions on the using statement.
19931 2001-12-07 Miguel de Icaza <miguel@ximian.com>
19933 * statement.cs (Using.EmitLocalVariableDecls): Split the
19934 localvariable handling of the using statement.
19936 (Block.EmitMeta): Keep track of variable count across blocks. We
19937 were reusing slots on separate branches of blocks.
19939 (Try.Emit): Emit the general code block, we were not emitting it.
19941 Check the type of the declaration to be an IDisposable or
19942 something that can be implicity converted to it.
19944 Emit conversions if required.
19946 * ecore.cs (EmptyExpression): New utility class.
19947 (Expression.ImplicitConversionExists): New utility function.
19949 2001-12-06 Miguel de Icaza <miguel@ximian.com>
19951 * statement.cs (Using): Implement.
19953 * expression.cs (LocalVariableReference): Support read only variables.
19955 * statement.cs: Remove the explicit emit for the Leave opcode.
19956 (VariableInfo): Add a readonly field.
19958 2001-12-05 Miguel de Icaza <miguel@ximian.com>
19960 * ecore.cs (ConvCast): new class used to encapsulate the various
19961 explicit integer conversions that works in both checked and
19962 unchecked contexts.
19964 (Expression.ConvertNumericExplicit): Use new ConvCast class to
19965 properly generate the overflow opcodes.
19967 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19969 * statement.cs: The correct type for the EmptyExpression is the
19970 element_type, not the variable type. Ravi pointed this out.
19972 2001-12-04 Ravi Pratap <ravi@ximian.com>
19974 * class.cs (Method::Define): Handle PInvoke methods specially
19975 by using DefinePInvokeMethod instead of the usual one.
19977 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19978 above to do the task of extracting information and defining the method.
19980 2001-12-04 Ravi Pratap <ravi@ximian.com>
19982 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19983 of the condition for string type.
19985 (Emit): Move that here.
19987 (ArrayCreation::CheckIndices): Keep string literals in their expression
19990 (EmitDynamicInitializers): Handle strings appropriately.
19992 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19994 * codegen.cs (EmitContext): Replace multiple variables with a
19995 single pointer to the current Switch statement.
19997 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20000 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20004 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20007 (Foreach.Emit): Foreach on arrays was not setting
20008 up the loop variables (for break/continue).
20010 (GotoCase): Semi-implented.
20012 2001-12-03 Ravi Pratap <ravi@ximian.com>
20014 * attribute.cs (CheckAttribute): Handle system attributes by using
20015 Attribute.GetAttributes to examine information we need.
20017 (GetValidPlaces): Same here.
20019 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20021 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20023 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20025 (Method::Define): Set appropriate flags if we have a DllImport attribute.
20027 (Method::Emit): Handle the case when we are a PInvoke method.
20029 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20031 * expression.cs: Use ResolveWithSimpleName on compound names.
20033 2001-12-02 Ravi Pratap <ravi@ximian.com>
20035 * constant.cs (EmitConstant): Make sure we resolve the associated expression
20036 before trying to reduce it.
20038 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20040 * constant.cs (LookupConstantValue): Implement.
20042 (EmitConstant): Use the above in emitting the constant.
20044 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20045 that are user-defined by doing a LookupConstantValue on them.
20047 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20050 2001-11-29 Miguel de Icaza <miguel@ximian.com>
20052 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20054 (BaseAccess.DoResolve): Implement.
20056 (MemberAccess.DoResolve): Split this routine into a
20057 ResolveMemberAccess routine that can be used independently
20059 2001-11-28 Miguel de Icaza <miguel@ximian.com>
20061 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20062 As that share bits of the implementation. Is returns a boolean,
20063 while As returns the Type that is being probed.
20065 2001-12-01 Ravi Pratap <ravi@ximian.com>
20067 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20068 instead of a Literal - much easier.
20070 (EnumInTransit): Remove - utterly useless :-)
20072 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20074 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20076 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20077 chain when we have no associated expression.
20079 2001-11-30 Ravi Pratap <ravi@ximian.com>
20081 * constant.cs (Define): Use Location while reporting the errror.
20083 Also emit a warning when 'new' is used and there is no inherited
20086 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
20089 (LookupEnumValue): Implement to lookup an enum member's value and define it
20092 (Populate): Re-write accordingly to use the above routine.
20094 2001-11-27 Miguel de Icaza <miguel@ximian.com>
20096 * expression.cs (This): Fix prototype for DoResolveLValue to
20097 override the base class DoResolveLValue.
20099 * cs-parser.cs: Report errors cs574 and cs575 (destructor
20102 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20103 (we need to load the address of the field here). This fixes
20106 (FieldExpr.DoResolveLValue): Call the DoResolve
20107 function to initialize the Instance expression.
20109 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20110 correctly the GetEnumerator operation on a value type.
20112 * cs-parser.jay: Add more simple parsing error catches.
20114 * statement.cs (Switch): Add support for string switches.
20115 Handle null specially.
20117 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
20119 2001-11-28 Ravi Pratap <ravi@ximian.com>
20121 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20123 (declare_local_constant): New helper function.
20125 * statement.cs (AddConstant): Keep a separate record of constants
20127 (IsConstant): Implement to determine if a variable is a constant.
20129 (GetConstantExpression): Implement.
20131 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20133 * statement.cs (IsVariableDefined): Re-write.
20135 2001-11-27 Ravi Pratap <ravi@ximian.com>
20137 * class.cs (TypeContainer::FindMembers): Look for constants
20138 in the case when we are looking for MemberTypes.Field
20140 * expression.cs (MemberAccess::DoResolve): Check that in the
20141 case we are a FieldExpr and a Literal, we are not being accessed
20142 by an instance reference.
20144 * cs-parser.jay (local_constant_declaration): Implement.
20146 (declaration_statement): Implement for constant declarations.
20148 2001-11-26 Miguel de Icaza <miguel@ximian.com>
20150 * statement.cs (Switch): Catch double defaults.
20152 (Switch): More work on the switch() statement
20153 implementation. It works for integral values now, need to finish
20157 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20159 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20160 integer literals into other integer literals. To be used by
20163 2001-11-24 Ravi Pratap <ravi@ximian.com>
20165 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20168 (EmitDynamicInitializers): Cope with the above since we extract data
20169 directly from ArrayData now.
20171 (ExpectInitializers): Keep track of whether initializers are mandatory
20174 (Bounds): Make it a hashtable to prevent the same dimension being
20175 recorded for every element in that dimension.
20177 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20180 Also fix bug which was causing the indices to be emitted in the reverse
20183 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20185 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20186 unfinished. They do not work, because the underlying code is
20189 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20191 * cs-parser.jay: Remove bogus fixme.
20193 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20194 on Switch statement.
20196 2001-11-23 Ravi Pratap <ravi@ximian.com>
20198 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20201 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20202 parameter. Apparently, any expression is allowed.
20204 (ValidateInitializers): Update accordingly.
20206 (CheckIndices): Fix some tricky bugs thanks to recursion.
20208 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
20209 I was being completely brain-dead.
20211 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20212 and re-write acordingly.
20214 (DelegateInvocation): Re-write accordingly.
20216 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20218 (MakeByteBlob): Handle types more correctly.
20220 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20221 initialization from expressions but it is incomplete because I am a complete
20224 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20226 * statement.cs (If.Emit): Fix a bug that generated incorrect code
20227 on If. Basically, we have to return `true' (ie, we do return to
20228 our caller) only if both branches of the if return.
20230 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20231 short-circuit operators, handle them as short circuit operators.
20233 (Cast.DoResolve): Resolve type.
20234 (Cast.Cast): Take an expression as the target type.
20236 * cs-parser.jay (cast_expression): Remove old hack that only
20237 allowed a limited set of types to be handled. Now we take a
20238 unary_expression and we resolve to a type during semantic
20241 Use the grammar productions from Rhys to handle casts (this is
20242 not complete like Rhys syntax yet, we fail to handle that corner
20243 case that C# has regarding (-x), but we will get there.
20245 2001-11-22 Ravi Pratap <ravi@ximian.com>
20247 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20248 field which is an array type.
20250 * cs-parser.jay (declare_local_variables): Support array initialization too.
20252 * typemanager.cs (MakeKey): Implement.
20254 (everywhere): Use the above appropriately.
20256 * cs-parser.jay (for_statement): Update for array initialization while
20257 declaring variables.
20259 * ecore.cs : The error message was correct, it's the variable's names that
20260 were misleading ;-) Make the code more readable.
20262 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20263 the correct type etc.
20265 (ConvertExplicit): Handle Enum types by examining the underlying type.
20267 2001-11-21 Ravi Pratap <ravi@ximian.com>
20269 * parameter.cs (GetCallingConvention): Always return
20270 CallingConventions.Standard for now.
20272 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20274 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20275 and `r' after calling DoNumericPromotions.
20277 * ecore.cs: Fix error message (the types were in the wrong order).
20279 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20280 BindingFlags.Instance as well
20282 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20283 implicit int literal conversion in an empty cast so that we
20284 propagate the right type upstream.
20286 (UnboxCast): new class used to unbox value types.
20287 (Expression.ConvertExplicit): Add explicit type conversions done
20290 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20291 the target type before applying the implicit LongLiterals to ULong
20294 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20296 * cs-parser.jay (for_statement): Reworked the way For works: now
20297 we declare manually any variables that are introduced in
20298 for_initializer to solve the problem of having out-of-band code
20299 emition (that is what got for broken).
20301 (declaration_statement): Perform the actual variable declaration
20302 that used to be done in local_variable_declaration here.
20304 (local_variable_declaration): Do not declare anything, just pass
20305 the information on a DictionaryEntry
20307 2001-11-20 Ravi Pratap <ravi@ximian.com>
20309 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20310 re-write of the logic to now make it recursive.
20312 (UpdateIndices): Re-write accordingly.
20314 Store element data in a separate ArrayData list in the above methods.
20316 (MakeByteBlob): Implement to dump the array data into a byte array.
20318 2001-11-19 Ravi Pratap <ravi@ximian.com>
20320 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20323 * constant.cs (Define): Implement.
20325 (EmitConstant): Re-write fully.
20327 Pass in location info.
20329 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20332 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20333 DictionaryEntry since we need location info too.
20335 (constant_declaration): Update accordingly.
20337 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20338 code into another method : UpdateIndices.
20340 2001-11-18 Ravi Pratap <ravi@ximian.com>
20342 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20343 some type checking etc.
20345 2001-11-17 Ravi Pratap <ravi@ximian.com>
20347 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20348 bits to provide dimension info if the user skips doing that.
20350 Update second constructor to store the rank correctly.
20352 2001-11-16 Ravi Pratap <ravi@ximian.com>
20354 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20355 and try to implement.
20357 * ../errors/cs0150.cs : Add.
20359 * ../errors/cs0178.cs : Add.
20361 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20363 * statement.cs: Implement foreach on multi-dimensional arrays.
20365 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20366 name of the params argument.
20368 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20369 initializing the array.
20371 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20372 we can use this elsewhere.
20374 * statement.cs: Finish implementation of foreach for single
20377 * cs-parser.jay: Use an out-of-band stack to pass information
20378 around, I wonder why I need this.
20380 foreach_block: Make the new foreach_block the current_block.
20382 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20383 function used to return a static Parameters structure. Used for
20384 empty parameters, as those are created very frequently.
20386 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20388 2001-11-15 Ravi Pratap <ravi@ximian.com>
20390 * interface.cs : Default modifier is private, not public. The
20391 make verify test passes again.
20393 2001-11-15 Ravi Pratap <ravi@ximian.com>
20395 * support.cs (ReflectionParameters): Fix logic to determine
20396 whether the last parameter is a params one. Test 9 passes again.
20398 * delegate.cs (Populate): Register the builders we define with
20399 RegisterParameterForBuilder. Test 19 passes again.
20401 * cs-parser.jay (property_declaration): Reference $6 instead
20402 of $$ to get at the location.
20404 (indexer_declaration): Similar stuff.
20406 (attribute): Ditto.
20408 * class.cs (Property): Register parameters for the Get and Set methods
20409 if they exist. Test 23 passes again.
20411 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20412 call to EmitArguments as we are sure there aren't any params arguments.
20413 Test 32 passes again.
20415 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20416 IndexOutOfRangeException.
20418 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20419 Test 33 now passes again.
20421 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20423 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20424 broke a bunch of things. Will have to come up with a better way
20425 of tracking locations.
20427 * statement.cs: Implemented foreach for single dimension arrays.
20429 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20431 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20432 an error. This removes the lookup from the critical path.
20434 * cs-parser.jay: Removed use of temporary_loc, which is completely
20437 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20439 * support.cs (ReflectionParameters.ParameterModifier): Report
20440 whether the argument is a PARAMS argument or not.
20442 * class.cs: Set the attribute `ParamArrayAttribute' on the
20443 parameter argument.
20445 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20446 and cons_param_array_attribute (ConstructorInfo for
20447 ParamArrayAttribute).,
20449 * codegen.cs: Emit the return using the `Return' statement, that
20450 way we can report the error correctly for missing return values.
20452 * class.cs (Method.Emit): Clean up.
20454 * expression.cs (Argument.Resolve): Take another argument: the
20455 location where this argument is used. Notice that this is not
20456 part of the "Argument" class as to reduce the size of the
20457 structure (we know the approximate location anyways).
20459 Test if the argument is a variable-reference, if not, then
20460 complain with a 206.
20462 (Argument.Emit): Emit addresses of variables.
20464 (Argument.FullDesc): Simplify.
20466 (Invocation.DoResolve): Update for Argument.Resolve.
20468 (ElementAccess.DoResolve): ditto.
20470 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20471 method should be virtual, as this method is always virtual.
20473 (NewDelegate.DoResolve): Update for Argument.Resolve.
20475 * class.cs (ConstructorInitializer.DoResolve): ditto.
20477 * attribute.cs (Attribute.Resolve): ditto.
20479 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20481 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20483 * expression.cs (ParameterReference): Drop IStackStorage and implement
20484 IAssignMethod instead.
20486 (LocalVariableReference): ditto.
20488 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20489 IAssignMethod instead.
20491 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20493 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20494 enumerations that are used in heavily used structures derive from
20495 byte in a laughable and pathetic attempt to reduce memory usage.
20496 This is the kind of pre-optimzations that you should not do at
20497 home without adult supervision.
20499 * expression.cs (UnaryMutator): New class, used to handle ++ and
20500 -- separatedly from the other unary operators. Cleans up the
20501 code, and kills the ExpressionStatement dependency in Unary.
20503 (Unary): Removed `method' and `Arguments' from this class, making
20504 it smaller, and moving it all to SimpleCall, so I can reuse this
20505 code in other locations and avoid creating a lot of transient data
20506 strucutres when not required.
20508 * cs-parser.jay: Adjust for new changes.
20510 2001-11-11 Miguel de Icaza <miguel@ximian.com>
20512 * enum.cs (Enum.Populate): If there is a failure during
20515 * cs-parser.jay (opt_enum_base): we used to catch type errors
20516 here, but this is really incorrect. The type error should be
20517 catched during semantic analysis.
20519 2001-12-11 Ravi Pratap <ravi@ximian.com>
20521 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20522 current_local_parameters as expected since I, in my stupidity, had forgotten
20525 * attribute.cs (GetValidPlaces): Fix stupid bug.
20527 * class.cs (Method::Emit): Perform check on applicability of attributes.
20529 (Constructor::Emit): Ditto.
20531 (Field::Emit): Ditto.
20533 (Field.Location): Store location information.
20535 (Property, Event, Indexer, Operator): Ditto.
20537 * cs-parser.jay (field_declaration): Pass in location for each field.
20539 * ../errors/cs0592.cs : Add.
20541 2001-11-12 Ravi Pratap <ravi@ximian.com>
20543 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20545 (InitCoreTypes): Update accordingly.
20547 (RegisterAttrType, LookupAttr): Implement.
20549 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20550 info about the same.
20552 (Resolve): Update to populate the above as necessary.
20554 (Error592): Helper.
20556 (GetValidPlaces): Helper to the above.
20558 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20560 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20562 2001-11-12 Ravi Pratap <ravi@ximian.com>
20564 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20566 * ../errors/cs0617.cs : Add.
20568 2001-11-11 Ravi Pratap <ravi@ximian.com>
20570 * enum.cs (Emit): Rename to Populate to be more consistent with what
20571 we expect it to do and when exactly it is called.
20573 * class.cs, rootcontext.cs : Update accordingly.
20575 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20576 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20578 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20580 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20581 of a fieldinfo using the above, when dealing with a FieldBuilder.
20583 2001-11-10 Ravi Pratap <ravi@ximian.com>
20585 * ../errors/cs0031.cs : Add.
20587 * ../errors/cs1008.cs : Add.
20589 * ../errrors/cs0543.cs : Add.
20591 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20594 (FindMembers): Implement.
20596 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20597 enums and delegates too.
20599 (enum_types): Rename to builder_to_enum.
20601 (delegate_types): Rename to builder_to_delegate.
20603 * delegate.cs (FindMembers): Implement.
20605 2001-11-09 Ravi Pratap <ravi@ximian.com>
20607 * typemanager.cs (IsEnumType): Implement.
20609 * enum.cs (Emit): Re-write parts to account for the underlying type
20610 better and perform checking etc.
20612 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20613 of the underlying type.
20615 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20618 * enum.cs (error31): Helper to report error #31.
20620 * cs-parser.jay (enum_declaration): Store location of each member too.
20622 * enum.cs (member_to_location): New hashtable.
20624 (AddEnumMember): Update location hashtable.
20626 (Emit): Use the location of each member while reporting errors.
20628 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20630 * cs-parser.jay: A for_initializer if is a
20631 local_variable_declaration really ammount to have an implicit
20632 block with the variable declaration and no initializer for for.
20634 * statement.cs (For.Emit): Cope with null initializers.
20636 This fixes the infinite loop on for initializers.
20638 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20640 * enum.cs: More cleanup.
20642 * ecore.cs: Remove dead code.
20644 * class.cs (Property.Emit): More simplification.
20645 (Event.Emit): ditto.
20647 Reworked to have less levels of indentation.
20649 2001-11-08 Ravi Pratap <ravi@ximian.com>
20651 * class.cs (Property): Emit attributes.
20661 * enum.cs (Emit): Ditto.
20663 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20666 * class.cs (Field, Event, etc.): Move attribute generation into the
20667 Emit method everywhere.
20669 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20670 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20671 as we had no way of defining nested enums !
20673 * rootcontext.cs : Adjust code accordingly.
20675 * typemanager.cs (AddEnumType): To keep track of enum types separately.
20677 2001-11-07 Ravi Pratap <ravi@ximian.com>
20679 * expression.cs (EvalConstantExpression): Move into ecore.cs
20681 * enum.cs (Enum): Rename some members and make them public and readonly
20682 according to our convention.
20684 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20687 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20689 (Enum::Emit): Write a simple version for now which doesn't try to compute
20690 expressions. I shall modify this to be more robust in just a while.
20692 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20694 (TypeContainer::CloseType): Create the Enum types too.
20696 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20698 * expression.cs (EvalConstantExpression): Get rid of completely.
20700 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20701 user-defined values and other cases.
20703 (IsValidEnumLiteral): Helper function.
20705 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
20706 out there in the case we had a literal FieldExpr.
20708 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20710 (Literalize): Revamp a bit to take two arguments.
20712 (EnumLiteral): New class which derives from Literal to wrap enum literals.
20714 2001-11-06 Ravi Pratap <ravi@ximian.com>
20716 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20718 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20720 (Resolve): Use the above to ensure we have proper initializers.
20722 2001-11-05 Ravi Pratap <ravi@ximian.com>
20724 * expression.cs (Expression::EvalConstantExpression): New method to
20725 evaluate constant expressions.
20727 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20729 2001-11-07 Miguel de Icaza <miguel@ximian.com>
20731 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20734 (Binary.ResolveOperator): Handle operator != (object a, object b)
20735 and operator == (object a, object b);
20737 (Binary.DoNumericPromotions): Indicate whether the numeric
20738 promotion was possible.
20740 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20743 Made the ArrayAccess implement interface IAssignMethod instead of
20744 IStackStore as the order in which arguments are passed reflects
20747 * assign.cs: Instead of using expr.ExprClass to select the way of
20748 assinging, probe for the IStackStore/IAssignMethod interfaces.
20750 * typemanager.cs: Load InitializeArray definition.
20752 * rootcontext.cs (RootContext.MakeStaticData): Used to define
20753 static data that can be used to initialize arrays.
20755 2001-11-05 Miguel de Icaza <miguel@ximian.com>
20757 * expression.cs: Handle operator== and operator!= for booleans.
20759 (Conditioal.Reduce): Implement reducer for the ?: operator.
20761 (Conditional.Resolve): Implement dead code elimination.
20763 (Binary.Resolve): Catch string literals and return a new
20764 concatenated string.
20766 (Unary.Reduce): Implement reduction of unary expressions.
20768 * ecore.cs: Split out the expression core handling here.
20770 (Expression.Reduce): New method used to perform constant folding
20771 and CSE. This is needed to support constant-expressions.
20773 * statement.cs (Statement.EmitBoolExpression): Pass true and false
20774 targets, and optimize for !x.
20776 2001-11-04 Ravi Pratap <ravi@ximian.com>
20778 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20779 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20780 set custom atttributes.
20782 * literal.cs (Literal::GetValue): New abstract method to return the actual
20783 value of the literal, cast as an object.
20785 (*Literal): Implement GetValue method.
20787 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20788 expressions to the arraylist but objects of type Argument.
20790 * class.cs (TypeContainer::Emit): Emit our attributes too.
20792 (Method::Emit, Constructor::Emit): Ditto.
20794 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20795 to be ignoring earlier.
20797 2001-11-03 Ravi Pratap <ravi@ximian.com>
20799 * attribute.cs (AttributeSection::Define): Implement to do the business
20800 of constructing a CustomAttributeBuilder.
20802 (Attribute): New trivial class. Increases readability of code.
20804 * cs-parser.jay : Update accordingly.
20806 (positional_argument_list, named_argument_list, named_argument): New rules
20808 (attribute_arguments): Use the above so that we are more correct.
20810 2001-11-02 Ravi Pratap <ravi@ximian.com>
20812 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20813 to perform all checks for a method with a params parameter.
20815 (Invocation::OverloadResolve): Update to use the above method and therefore
20816 cope correctly with params method invocations.
20818 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
20821 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20822 constructors in our parent too because we can't afford to miss out on
20825 * attribute.cs (AttributeSection): New name for the class Attribute
20827 Other trivial changes to improve readability.
20829 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20830 use the new class names.
20832 2001-11-01 Ravi Pratap <ravi@ximian.com>
20834 * class.cs (Method::Define): Complete definition for params types too
20836 (Indexer::Define): Ditto.
20838 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20839 Cope everywhere with a request for info about the array parameter.
20841 2001-11-01 Ravi Pratap <ravi@ximian.com>
20843 * tree.cs (RecordNamespace): Fix up to check for the correct key.
20845 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
20846 local_variable_type to extract the string corresponding to the type.
20848 (local_variable_type): Fixup the action to use the new helper method.
20850 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
20853 * expression.cs : Clean out code which uses the above.
20855 2001-10-31 Ravi Pratap <ravi@ximian.com>
20857 * typemanager.cs (RegisterMethod): Check if we already have an existing key
20858 and bale out if necessary by returning a false.
20860 (RegisterProperty): Ditto.
20862 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20863 and print out appropriate error messages.
20865 * interface.cs (everywhere): Ditto.
20867 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20868 location to constructor.
20870 * class.cs (Property, Event, Indexer): Update accordingly.
20872 * ../errors/cs111.cs : Added.
20874 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20875 of a method, as laid down by the spec.
20877 (Invocation::OverloadResolve): Use the above method.
20879 2001-10-31 Ravi Pratap <ravi@ximian.com>
20881 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20882 now take a TypeContainer and a Parameters object.
20884 (ParameterData): Modify return type of ParameterModifier method to be
20885 Parameter.Modifier and not a string.
20887 (ReflectionParameters, InternalParameters): Update accordingly.
20889 * expression.cs (Argument::GetParameterModifier): Same here.
20891 * support.cs (InternalParameters::ParameterType): Find a better way of determining
20892 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20893 symbol in it at all so maybe this is only for now.
20895 2001-10-30 Ravi Pratap <ravi@ximian.com>
20897 * support.cs (InternalParameters): Constructor now takes an extra argument
20898 which is the actual Parameters class.
20900 (ParameterDesc): Update to provide info on ref/out modifiers.
20902 * class.cs (everywhere): Update call to InternalParameters to pass in
20903 the second argument too.
20905 * support.cs (ParameterData): Add ParameterModifier, which is a method
20906 to return the modifier info [ref/out etc]
20908 (InternalParameters, ReflectionParameters): Implement the above.
20910 * expression.cs (Argument::ParameterModifier): Similar function to return
20911 info about the argument's modifiers.
20913 (Invocation::OverloadResolve): Update to take into account matching modifiers
20916 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20917 a new SetFormalParameters object which we pass to InternalParameters.
20919 2001-10-30 Ravi Pratap <ravi@ximian.com>
20921 * expression.cs (NewArray): Merge into the ArrayCreation class.
20923 2001-10-29 Ravi Pratap <ravi@ximian.com>
20925 * expression.cs (NewArray): Merge classes NewBuiltinArray and
20926 NewUserdefinedArray into one as there wasn't much of a use in having
20929 * expression.cs (Argument): Change field's name to ArgType from Type.
20931 (Type): New readonly property which returns the proper type, taking into
20932 account ref/out modifiers.
20934 (everywhere): Adjust code accordingly for the above.
20936 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20937 whether we are emitting for a ref or out parameter.
20939 * expression.cs (Argument::Emit): Use the above field to set the state.
20941 (LocalVariableReference::Emit): Update to honour the flag and emit the
20944 * parameter.cs (Attributes): Set the correct flags for ref parameters.
20946 * expression.cs (Argument::FullDesc): New function to provide a full desc.
20948 * support.cs (ParameterData): Add method ParameterDesc to the interface.
20950 (ReflectionParameters, InternalParameters): Implement the above method.
20952 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20955 (Invocation::FullMethodDesc): Ditto.
20957 2001-10-29 Miguel de Icaza <miguel@ximian.com>
20959 * cs-parser.jay: Add extra production for the second form of array
20962 * expression.cs (ArrayCreation): Update to reflect the above
20965 * Small changes to prepare for Array initialization.
20967 2001-10-28 Miguel de Icaza <miguel@ximian.com>
20969 * typemanager.cs (ImplementsInterface): interface might be null;
20970 Deal with this problem;
20972 Also, we do store negative hits on the cache (null values), so use
20973 this instead of calling t.GetInterfaces on the type everytime.
20975 2001-10-28 Ravi Pratap <ravi@ximian.com>
20977 * typemanager.cs (IsBuiltinType): New method to help determine the same.
20979 * expression.cs (New::DoResolve): Get rid of array creation code and instead
20980 split functionality out into different classes.
20982 (New::FormArrayType): Move into NewBuiltinArray.
20984 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20987 (NewBuiltinArray): New class to handle creation of built-in arrays.
20989 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20990 account creation of one-dimensional arrays.
20992 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20994 (NewUserdefinedArray::DoResolve): Implement.
20996 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20998 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20999 we maintain inside the TypeManager. This is necessary to perform lookups on the
21002 (LookupType): Update to perform GetType on the module builders too.
21004 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21006 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21008 2001-10-23 Ravi Pratap <ravi@ximian.com>
21010 * expression.cs (New::DoResolve): Implement guts of array creation.
21012 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21014 2001-10-27 Miguel de Icaza <miguel@ximian.com>
21016 * expression.cs: Fix bug I introduced lsat night that broke
21019 (Expression.Resolve): Report a 246 error (can not resolve name)
21020 if we find a SimpleName in the stream.
21022 (Expression.ResolveLValue): Ditto.
21024 (Expression.ResolveWithSimpleName): This function is a variant of
21025 ResolveName, this one allows SimpleNames to be returned without a
21026 warning. The only consumer of SimpleNames is MemberAccess
21028 2001-10-26 Miguel de Icaza <miguel@ximian.com>
21030 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21031 might arrive here. I have my doubts that this is correct.
21033 * statement.cs (Lock): Implement lock statement.
21035 * cs-parser.jay: Small fixes to support `lock' and `using'
21037 * cs-tokenizer.cs: Remove extra space
21039 * driver.cs: New flag --checked, allows to turn on integer math
21042 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21043 Threading.Monitor.Exit
21045 2001-10-23 Miguel de Icaza <miguel@ximian.com>
21047 * expression.cs (IndexerAccess::DoResolveLValue): Set the
21048 Expression Class to be IndexerAccess.
21050 Notice that Indexer::DoResolve sets the eclass to Value.
21052 2001-10-22 Miguel de Icaza <miguel@ximian.com>
21054 * class.cs (TypeContainer::Emit): Emit code for indexers.
21056 * assign.cs (IAssignMethod): New interface implemented by Indexers
21057 and Properties for handling assignment.
21059 (Assign::Emit): Simplify and reuse code.
21061 * expression.cs (IndexerAccess, PropertyExpr): Implement
21062 IAssignMethod, clean up old code.
21064 2001-10-22 Ravi Pratap <ravi@ximian.com>
21066 * typemanager.cs (ImplementsInterface): New method to determine if a type
21067 implements a given interface. Provides a nice cache too.
21069 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21072 (ConvertReferenceExplicit): Ditto.
21074 * delegate.cs (Delegate::Populate): Update to define the parameters on the
21075 various methods, with correct names etc.
21077 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
21078 Operator.UnaryNegation.
21080 * cs-parser.jay (operator_declarator): Be a little clever in the case where
21081 we have a unary plus or minus operator.
21083 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
21086 * everywhere : update accordingly.
21088 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21091 * class.cs (Method::Define): For the case where we are implementing a method
21092 inherited from an interface, we need to set the MethodAttributes.Final flag too.
21093 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21095 2001-10-21 Ravi Pratap <ravi@ximian.com>
21097 * interface.cs (FindMembers): Implement to work around S.R.E
21100 * typemanager.cs (IsInterfaceType): Implement.
21102 (FindMembers): Update to handle interface types too.
21104 * expression.cs (ImplicitReferenceConversion): Re-write bits which
21105 use IsAssignableFrom as that is not correct - it doesn't work.
21107 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21108 and accordingly override EmitStatement.
21110 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21111 using the correct logic :-)
21113 2001-10-19 Ravi Pratap <ravi@ximian.com>
21115 * ../errors/cs-11.cs : Add to demonstrate error -11
21117 2001-10-17 Miguel de Icaza <miguel@ximian.com>
21119 * assign.cs (Assign::Resolve): Resolve right hand side first, and
21120 then pass this as a hint to ResolveLValue.
21122 * expression.cs (FieldExpr): Add Location information
21124 (FieldExpr::LValueResolve): Report assignment to readonly
21127 (Expression::ExprClassFromMemberInfo): Pass location information.
21129 (Expression::ResolveLValue): Add new method that resolves an
21132 (Expression::DoResolveLValue): Default invocation calls
21135 (Indexers): New class used to keep track of indexers in a given
21138 (IStackStore): Renamed from LValue, as it did not really describe
21139 what this did. Also ResolveLValue is gone from this interface and
21140 now is part of Expression.
21142 (ElementAccess): Depending on the element access type
21144 * typemanager.cs: Add `indexer_name_type' as a Core type
21145 (System.Runtime.CompilerServices.IndexerNameAttribute)
21147 * statement.cs (Goto): Take a location.
21149 2001-10-18 Ravi Pratap <ravi@ximian.com>
21151 * delegate.cs (Delegate::VerifyDelegate): New method to verify
21152 if two delegates are compatible.
21154 (NewDelegate::DoResolve): Update to take care of the case when
21155 we instantiate a delegate from another delegate.
21157 * typemanager.cs (FindMembers): Don't even try to look up members
21158 of Delegate types for now.
21160 2001-10-18 Ravi Pratap <ravi@ximian.com>
21162 * delegate.cs (NewDelegate): New class to take care of delegate
21165 * expression.cs (New): Split the delegate related code out into
21166 the NewDelegate class.
21168 * delegate.cs (DelegateInvocation): New class to handle delegate
21171 * expression.cs (Invocation): Split out delegate related code into
21172 the DelegateInvocation class.
21174 2001-10-17 Ravi Pratap <ravi@ximian.com>
21176 * expression.cs (New::DoResolve): Implement delegate creation fully
21177 and according to the spec.
21179 (New::DoEmit): Update to handle delegates differently.
21181 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21182 because of which we were printing out arguments in reverse order !
21184 * delegate.cs (VerifyMethod): Implement to check if the given method
21185 matches the delegate.
21187 (FullDelegateDesc): Implement.
21189 (VerifyApplicability): Implement.
21191 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21192 delegate invocations too.
21194 (Invocation::Emit): Ditto.
21196 * ../errors/cs1593.cs : Added.
21198 * ../errors/cs1594.cs : Added.
21200 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21202 2001-10-16 Ravi Pratap <ravi@ximian.com>
21204 * typemanager.cs (intptr_type): Core type for System.IntPtr
21206 (InitCoreTypes): Update for the same.
21208 (iasyncresult_type, asynccallback_type): Ditto.
21210 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21213 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21216 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21217 the builders for the 4 members of a delegate type :-)
21219 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21222 * expression.cs (New::DoResolve): Implement guts for delegate creation.
21224 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21226 2001-10-15 Miguel de Icaza <miguel@ximian.com>
21228 * statement.cs (Break::Emit): Implement.
21229 (Continue::Emit): Implement.
21231 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
21232 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
21233 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
21234 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
21237 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21238 properties that track the label for the current loop (begin of the
21239 loop and end of the loop).
21241 2001-10-15 Ravi Pratap <ravi@ximian.com>
21243 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21244 use of emitting anything at all.
21246 * class.cs, rootcontext.cs : Get rid of calls to the same.
21248 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21250 (Populate): Define the constructor correctly and set the implementation
21253 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21256 (AddDelegateType): Implement.
21258 (IsDelegateType): Implement helper method.
21260 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21262 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21263 and accordingly handle it.
21265 * delegate.cs (Populate): Take TypeContainer argument.
21266 Implement bits to define the Invoke method. However, I still haven't figured out
21267 how to take care of the native int bit :-(
21269 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21270 Qualify the name of the delegate, not its return type !
21272 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21275 (StandardConversionExists): Checking for array types turns out to be recursive.
21277 (ConvertReferenceExplicit): Implement array conversion.
21279 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21281 2001-10-12 Ravi Pratap <ravi@ximian.com>
21283 * cs-parser.jay (delegate_declaration): Store the fully qualified
21284 name as it is a type declaration.
21286 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21289 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21290 as TypeContainer::DefineType.
21292 (Populate): Method in which all the definition of the various methods (Invoke)
21295 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21298 (CloseDelegate): Finally creates the delegate.
21300 * class.cs (TypeContainer::DefineType): Update to define delegates.
21301 (Populate, Emit and CloseType): Do the same thing here too.
21303 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21304 delegates in all these operations.
21306 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21308 * expression.cs: LocalTemporary: a new expression used to
21309 reference a temporary that has been created.
21311 * assign.cs: Handle PropertyAccess back here, so that we can
21312 provide the proper semantic access to properties.
21314 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21315 a few more explicit conversions.
21317 * modifiers.cs: `NEW' modifier maps to HideBySig.
21319 * expression.cs (PropertyExpr): Make this into an
21320 ExpressionStatement, and support the EmitStatement code path.
21322 Perform get/set error checking, clean up the interface.
21324 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21325 them into toplevel access objects.
21327 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21329 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21332 * typemanager.cs: Keep track here of our PropertyBuilders again to
21333 work around lameness in SRE.
21335 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21337 * expression.cs (LValue::LValueResolve): New method in the
21338 interface, used to perform a second resolution pass for LValues.
21340 (This::DoResolve): Catch the use of this in static methods.
21342 (This::LValueResolve): Implement.
21344 (This::Store): Remove warning, assigning to `this' in structures
21347 (Invocation::Emit): Deal with invocation of
21348 methods on value types. We need to pass the address to structure
21349 methods rather than the object itself. (The equivalent code to
21350 emit "this" for structures leaves the entire structure on the
21351 stack instead of a pointer to it).
21353 (ParameterReference::DoResolve): Compute the real index for the
21354 argument based on whether the method takes or not a `this' pointer
21355 (ie, the method is static).
21357 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21358 value types returned from functions when we need to invoke a
21359 method on the sturcture.
21362 2001-10-11 Ravi Pratap <ravi@ximian.com>
21364 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21365 defining the type in the Modulebuilder or Typebuilder. This is to take
21366 care of nested types which need to be defined on the TypeBuilder using
21367 DefineNestedMethod.
21369 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21370 methods in RootContext, only ported to be part of TypeContainer.
21372 (TypeContainer::GetInterfaceOrClass): Ditto.
21374 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21376 * interface.cs (Interface::DefineInterface): New method. Does exactly
21377 what RootContext.CreateInterface did earlier, only it takes care of nested types
21380 (Interface::GetInterfaces): Move from RootContext here and port.
21382 (Interface::GetInterfaceByName): Same here.
21384 * rootcontext.cs (ResolveTree): Re-write.
21386 (PopulateTypes): Re-write.
21388 * class.cs (TypeContainer::Populate): Populate nested types too.
21389 (TypeContainer::Emit): Emit nested members too.
21391 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21392 instead just use the name argument passed in as it is already fully
21395 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21396 to TypeContainer mapping to see if a type is user-defined.
21398 * class.cs (TypeContainer::CloseType): Implement.
21400 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21401 the default constructor.
21403 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21406 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21408 * interface.cs (CloseType): Create the type here.
21410 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21413 Remove all the methods which are now in TypeContainer.
21415 2001-10-10 Ravi Pratap <ravi@ximian.com>
21417 * delegate.cs (Define): Re-write bits to define the delegate
21420 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21422 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21424 * expression.cs (ImplicitReferenceConversion): handle null as well
21425 as a source to convert to any reference type.
21427 * statement.cs (Return): Perform any implicit conversions to
21428 expected return type.
21430 Validate use of return statement.
21432 * codegen.cs (EmitContext): Pass the expected return type here.
21434 * class.cs (Method, Constructor, Property): Pass expected return
21435 type to EmitContext.
21437 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21439 * expression.cs: Make DoResolve take an EmitContext instead of a
21442 Replaced `l' and `location' for `loc', for consistency.
21444 (Error, Warning): Remove unneeded Tc argument.
21446 * assign.cs, literal.cs, constant.cs: Update to new calling
21449 * codegen.cs: EmitContext now contains a flag indicating whether
21450 code is being generated in a static method or not.
21452 * cs-parser.jay: DecomposeQI, new function that replaces the old
21453 QualifiedIdentifier. Now we always decompose the assembled
21454 strings from qualified_identifier productions into a group of
21457 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21459 * rootcontext.cs: Deal with field-less struct types correctly now
21460 by passing the size option to Define Type.
21462 * class.cs: Removed hack that created one static field.
21464 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21466 * statement.cs: Moved most of the code generation here.
21468 2001-10-09 Ravi Pratap <ravi@ximian.com>
21470 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21473 (ElementAccess): Remove useless bits for now - keep checks as the spec
21476 2001-10-08 Ravi Pratap <ravi@ximian.com>
21478 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21479 and start performing checks according to the spec.
21481 2001-10-07 Ravi Pratap <ravi@ximian.com>
21483 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21484 rank_specifiers instead.
21486 (rank_specifiers): Change the order in which the rank specifiers are stored
21488 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21490 * expression.cs (ElementAccess): Implement the LValue interface too.
21492 2001-10-06 Ravi Pratap <ravi@ximian.com>
21494 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21495 except that user defined conversions are not included.
21497 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
21498 perform the conversion of the return type, if necessary.
21500 (New::DoResolve): Check whether we are creating an array or an object
21501 and accordingly do the needful.
21503 (New::Emit): Same here.
21505 (New::DoResolve): Implement guts of array creation.
21507 (New::FormLookupType): Helper function.
21509 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21511 * codegen.cs: Removed most of the code generation here, and move the
21512 corresponding code generation bits to the statement classes.
21514 Added support for try/catch/finalize and throw.
21516 * cs-parser.jay: Added support for try/catch/finalize.
21518 * class.cs: Catch static methods having the flags override,
21519 virtual or abstract.
21521 * expression.cs (UserCast): This user cast was not really doing
21522 what it was supposed to do. Which is to be born in fully resolved
21523 state. Parts of the resolution were being performed at Emit time!
21527 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21529 * expression.cs: Implicity convert the result from UserCast.
21531 2001-10-05 Ravi Pratap <ravi@ximian.com>
21533 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21534 prevented it from working correctly.
21536 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21537 merely ConvertImplicit.
21539 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21541 * typemanager.cs: Make the LookupTypeContainer function static,
21542 and not per-instance.
21544 * class.cs: Make static FindMembers (the one that takes a Type
21547 * codegen.cs: Add EmitForeach here.
21549 * cs-parser.jay: Make foreach a toplevel object instead of the
21550 inline expansion, as we need to perform semantic analysis on it.
21552 2001-10-05 Ravi Pratap <ravi@ximian.com>
21554 * expression.cs (Expression::ImplicitUserConversion): Rename to
21555 UserDefinedConversion.
21557 (Expression::UserDefinedConversion): Take an extra argument specifying
21558 whether we look for explicit user conversions too.
21560 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21562 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21564 (ExplicitUserConversion): Make it a call to UserDefinedConversion
21565 with the appropriate arguments.
21567 * cs-parser.jay (cast_expression): Record location too.
21569 * expression.cs (Cast): Record location info.
21571 (Expression::ConvertExplicit): Take location argument.
21573 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21574 to determine if we are doing explicit conversions.
21576 (UserCast::Emit): Update accordingly.
21578 (Expression::ConvertExplicit): Report an error if everything fails.
21580 * ../errors/cs0030.cs : Add.
21582 2001-10-04 Miguel de Icaza <miguel@ximian.com>
21584 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21585 virtual and newslot bits.
21587 * class.cs (TypeContainer::RegisterRequiredImplementations):
21588 Record methods we need.
21590 (TypeContainer::MakeKey): Helper function to make keys for
21591 MethodBases, since the Methodbase key is useless.
21593 (TypeContainer::Populate): Call RegisterRequiredImplementations
21594 before defining the methods.
21596 Create a mapping for method_builders_to_methods ahead of time
21597 instead of inside a tight loop.
21599 (::RequireMethods): Accept an object as the data to set into the
21600 hashtable so we can report interface vs abstract method mismatch.
21602 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21604 * report.cs: Make all of it static.
21606 * rootcontext.cs: Drop object_type and value_type computations, as
21607 we have those in the TypeManager anyways.
21609 Drop report instance variable too, now it is a global.
21611 * driver.cs: Use try/catch on command line handling.
21613 Add --probe option to debug the error reporting system with a test
21616 * report.cs: Add support for exiting program when a probe
21617 condition is reached.
21619 2001-10-03 Ravi Pratap <ravi@ximian.com>
21621 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21622 we do a forcible conversion regardless of type, to check if
21623 ForceConversion returns a null.
21625 (Binary::error19): Use location to report error.
21627 (Unary::error23): Use location here too.
21629 * ../errors/cs0019.cs : Check in.
21631 * ../errors/cs0023.cs : Check in.
21633 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21634 case of a non-null MethodInfo object with a length of 0 !
21636 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21637 an applicable member - according to the spec :-)
21638 Also fix logic to find members in base types.
21640 (Unary::ResolveOperator): Same here.
21642 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21643 as I was getting thoroughly confused between this and error19 :-)
21645 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21646 (::FindMostEncompassedType): Implement.
21647 (::FindMostEncompassingType): Implement.
21648 (::StandardConversionExists): Implement.
21650 (UserImplicitCast): Re-vamp. We now need info about most specific
21651 source and target types so that we can do the necessary conversions.
21653 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21654 mathematical union with no duplicates.
21656 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21658 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21659 in order from base classes to child classes, so that we can in
21660 child classes look up in our parent for method names and
21661 attributes (required for handling abstract, virtual, new, override
21662 constructs: we need to instrospect our base class, and if we dont
21663 populate the classes in order, the introspection might be
21664 incorrect. For example, a method could query its parent before
21665 the parent has any methods and would determine that the parent has
21666 no abstract methods (while it could have had them)).
21668 (RootContext::CreateType): Record the order in which we define the
21671 2001-10-02 Miguel de Icaza <miguel@ximian.com>
21673 * class.cs (TypeContainer::Populate): Also method definitions can
21674 fail now, keep track of this.
21676 (TypeContainer::FindMembers): Implement support for
21677 DeclaredOnly/noDeclaredOnly flag.
21679 (Constructor::Emit) Return the ConstructorBuilder.
21681 (Method::Emit) Return the MethodBuilder.
21682 Check for abstract or virtual methods to be public.
21684 * rootcontext.cs (RootContext::CreateType): Register all the
21685 abstract methods required for the class to be complete and the
21686 interface methods that must be implemented.
21688 * cs-parser.jay: Report error 501 (method requires body if it is
21689 not marked abstract or extern).
21691 * expression.cs (TypeOf::Emit): Implement.
21693 * typemanager.cs: runtime_handle_type, new global type.
21695 * class.cs (Property::Emit): Generate code for properties.
21697 2001-10-02 Ravi Pratap <ravi@ximian.com>
21699 * expression.cs (Unary::ResolveOperator): Find operators on base type
21700 too - we now conform exactly to the spec.
21702 (Binary::ResolveOperator): Same here.
21704 * class.cs (Operator::Define): Fix minor quirk in the tests.
21706 * ../errors/cs0215.cs : Added.
21708 * ../errors/cs0556.cs : Added.
21710 * ../errors/cs0555.cs : Added.
21712 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21714 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21715 single integer which is really efficient
21717 2001-10-01 Ravi Pratap <ravi@ximian.com>
21719 * expression.cs (Expression::ImplicitUserConversion): Use location
21720 even in the case when we are examining True operators.
21722 * class.cs (Operator::Define): Perform extensive checks to conform
21723 with the rules for operator overloading in the spec.
21725 * expression.cs (Expression::ImplicitReferenceConversion): Implement
21726 some of the other conversions mentioned in the spec.
21728 * typemanager.cs (array_type): New static member for the System.Array built-in
21731 (cloneable_interface): For System.ICloneable interface.
21733 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21734 we start resolving the tree and populating types.
21736 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21738 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21740 * expression.cs (Expression::ExprClassFromMemberInfo,
21741 Expression::Literalize): Create literal expressions from
21742 FieldInfos which are literals.
21744 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21745 type casts, because they were wrong. The test suite in tests
21748 (ImplicitNumericConversion): ushort to ulong requires a widening
21751 Int32 constant to long requires widening cast as well.
21753 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21754 for integers because the type on the stack is not i4.
21756 2001-09-30 Miguel de Icaza <miguel@ximian.com>
21758 * expression.cs (report118): require location argument.
21760 * parameter.cs: Do not dereference potential null value.
21762 * class.cs: Catch methods that lack the `new' keyword when
21763 overriding a name. Report warnings when `new' is used without
21764 anything being there to override.
21766 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21768 * class.cs: Only add constructor to hashtable if it is non-null
21769 (as now constructors can fail on define).
21771 (TypeManager, Class, Struct): Take location arguments.
21773 Catch field instance initialization in structs as errors.
21775 accepting_filter: a new filter for FindMembers that is static so
21776 that we dont create an instance per invocation.
21778 (Constructor::Define): Catch errors where a struct constructor is
21781 * cs-parser.jay: Pass location information for various new
21784 * delegate.cs (Delegate): take a location argument.
21786 * driver.cs: Do not call EmitCode if there were problesm in the
21787 Definition of the types, as many Builders wont be there.
21789 * decl.cs (Decl::Decl): Require a location argument.
21791 * cs-tokenizer.cs: Handle properly hex constants that can not fit
21792 into integers, and find the most appropiate integer for it.
21794 * literal.cs: Implement ULongLiteral.
21796 * rootcontext.cs: Provide better information about the location of
21797 failure when CreateType fails.
21799 2001-09-29 Miguel de Icaza <miguel@ximian.com>
21801 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21804 * expression.cs (Binary::CheckShiftArguments): Add missing type
21806 (Binary::ResolveOperator): Add type to the logical and and logical
21807 or, Bitwise And/Or and Exclusive Or code paths, it was missing
21810 (Binary::DoNumericPromotions): In the case where either argument
21811 is ulong (and most signed types combined with ulong cause an
21812 error) perform implicit integer constant conversions as well.
21814 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21816 * expression.cs (UserImplicitCast): Method should always be
21818 (Invocation::BetterConversion): Simplified test for IntLiteral.
21820 (Expression::ImplicitNumericConversion): Split this routine out.
21821 Put the code that performs implicit constant integer conversions
21824 (Expression::Resolve): Become a wrapper around DoResolve so we can
21825 check eclass and type being set after resolve.
21827 (Invocation::Badness): Remove this dead function
21829 (Binary::ResolveOperator): Do not compute the expensive argumnets
21830 unless we have a union for it.
21832 (Probe::Emit): Is needs to do an isinst and then
21833 compare against null.
21835 (::CanConvert): Added Location argument. If the Location argument
21836 is null (Location.Null), then we do not report errors. This is
21837 used by the `probe' mechanism of the Explicit conversion. We do
21838 not want to generate an error for something that the user
21839 explicitly requested to be casted. But the pipeline for an
21840 explicit cast first tests for potential implicit casts.
21842 So for now, if the Location is null, it means `Probe only' to
21843 avoid adding another argument. Might have to revise this
21846 (ClassCast): New class used to type cast objects into arbitrary
21847 classes (used in Explicit Reference Conversions).
21849 Implement `as' as well.
21851 Reverted all the patches from Ravi below: they were broken:
21853 * The use of `level' as a mechanism to stop recursive
21854 invocations is wrong. That was there just to catch the
21855 bug with a strack trace but not as a way of addressing
21858 To fix the problem we have to *understand* what is going
21859 on and the interactions and come up with a plan, not
21860 just get things going.
21862 * The use of the type conversion cache that I proposed
21863 last night had an open topic: How does this work across
21864 protection domains. A user defined conversion might not
21865 be public in the location where we are applying the
21866 conversion, a different conversion might be selected
21867 (ie, private A->B (better) but public B->A (worse),
21868 inside A, A->B applies, but outside it, B->A will
21871 * On top of that (ie, even if the above is solved),
21872 conversions in a cache need to be abstract. Ie, `To
21873 convert from an Int to a Short use an OpcodeCast', not
21874 `To convert from an Int to a Short use the OpcodeCast on
21875 the variable 5' (which is what this patch was doing).
21877 2001-09-28 Ravi Pratap <ravi@ximian.com>
21879 * expression.cs (Invocation::ConversionExists): Re-write to use
21880 the conversion cache
21882 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21883 cache all conversions done, not just user-defined ones.
21885 (Invocation::BetterConversion): The real culprit. Use ConversionExists
21886 to determine if a conversion exists instead of acutually trying to
21887 perform the conversion. It's faster too.
21889 (Expression::ConvertExplicit): Modify to use ConversionExists to check
21890 and only then attempt the implicit conversion.
21892 2001-09-28 Ravi Pratap <ravi@ximian.com>
21894 * expression.cs (ConvertImplicit): Use a cache for conversions
21895 already found. Check level of recursion and bail out if necessary.
21897 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21899 * typemanager.cs (string_concat_string_string, string_concat_object_object):
21900 Export standard methods that we expect for string operations.
21902 * statement.cs (Block::UsageWarning): Track usage of variables and
21903 report the errors for not used variables.
21905 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21908 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21910 * codegen.cs: remove unnneded code
21912 * expression.cs: Removed BuiltinTypeAccess class
21914 Fix the order in which implicit conversions are
21917 The previous fixed dropped support for boxed conversions (adding a
21918 test to the test suite now)
21920 (UserImplicitCast::CanConvert): Remove test for source being null,
21921 that code is broken. We should not feed a null to begin with, if
21922 we do, then we should track the bug where the problem originates
21923 and not try to cover it up here.
21925 Return a resolved expression of type UserImplicitCast on success
21926 rather than true/false. Ravi: this is what I was talking about,
21927 the pattern is to use a static method as a "constructor" for
21930 Also, do not create arguments until the very last minute,
21931 otherwise we always create the arguments even for lookups that
21932 will never be performed.
21934 (UserImplicitCast::Resolve): Eliminate, objects of type
21935 UserImplicitCast are born in a fully resolved state.
21937 * typemanager.cs (InitCoreTypes): Init also value_type
21938 (System.ValueType).
21940 * expression.cs (Cast::Resolve): First resolve the child expression.
21942 (LValue): Add new method AddressOf to be used by
21945 Change the argument of Store to take an EmitContext instead of an
21946 ILGenerator, because things like FieldExpr need to be able to call
21947 their children expression to generate the instance code.
21949 (Expression::Error, Expression::Warning): Sugar functions for
21952 (Expression::MemberLookup): Accept a TypeContainer instead of a
21953 Report as the first argument.
21955 (Expression::ResolvePrimary): Killed. I still want to improve
21956 this as currently the code is just not right.
21958 (Expression::ResolveMemberAccess): Simplify, but it is still
21961 (Unary::Resolve): Catch errors in AddressOf operators.
21963 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21964 index to a byte for the short-version, or the compiler will choose
21965 the wrong Emit call, which generates the wrong data.
21967 (ParameterReference::Emit, ::Store): same.
21969 (FieldExpr::AddressOf): Implement.
21971 * typemanager.cs: TypeManager: made public variable instead of
21974 * driver.cs: document --fatal.
21976 * report.cs (ErrorMessage, WarningMessage): new names for the old
21977 Error and Warning classes.
21979 * cs-parser.jay (member_access): Turn built-in access to types
21980 into a normal simplename
21982 2001-09-27 Ravi Pratap <ravi@ximian.com>
21984 * expression.cs (Invocation::BetterConversion): Fix to cope
21985 with q being null, since this was introducing a bug.
21987 * expression.cs (ConvertImplicit): Do built-in conversions first.
21989 2001-09-27 Ravi Pratap <ravi@ximian.com>
21991 * expression.cs (UserImplicitCast::Resolve): Fix bug.
21993 2001-09-27 Ravi Pratap <ravi@ximian.com>
21995 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21996 I had introduced long ago (what's new ?).
21998 * expression.cs (UserImplicitCast::CanConvert): Static method to do
21999 the work of all the checking.
22000 (ConvertImplicit): Call CanConvert and only then create object if necessary.
22001 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22003 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22004 that is the right way.
22006 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
22007 overloading resolution. Use everywhere instead of cutting and pasting code.
22009 (Binary::ResolveOperator): Use MakeUnionSet.
22011 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
22012 we have to convert to bool types. Not complete yet.
22014 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22016 * typemanager.cs (TypeManager::CSharpName): support ushort.
22018 * expression.cs (Expression::TryImplicitIntConversion): Attempts
22019 to provide an expression that performsn an implicit constant int
22020 conversion (section 6.1.6).
22021 (Expression::ConvertImplicitRequired): Reworked to include
22022 implicit constant expression conversions.
22024 (Expression::ConvertNumericExplicit): Finished.
22026 (Invocation::Emit): If InstanceExpression is null, then it means
22027 that we perform a call on this.
22029 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22031 * expression.cs (Unary::Emit): Remove some dead code.
22032 (Probe): Implement Resolve and Emit for `is'.
22033 (Expression::ConvertImplicitRequired): Attempt to do constant
22034 expression conversions here. Maybe should be moved to
22035 ConvertImplicit, but I am not sure.
22036 (Expression::ImplicitLongConstantConversionPossible,
22037 Expression::ImplicitIntConstantConversionPossible): New functions
22038 that tell whether is it possible to apply an implicit constant
22039 expression conversion.
22041 (ConvertNumericExplicit): Started work on explicit numeric
22044 * cs-parser.jay: Update operator constants.
22046 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22047 (Parameters::GetSignature): Hook up VerifyArgs here.
22048 (Parameters::VerifyArgs): Verifies that no two arguments have the
22051 * class.cs (Operator): Update the operator names to reflect the
22052 ones that the spec expects (as we are just stringizing the
22055 * expression.cs (Unary::ResolveOperator): Fix bug: Use
22056 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22057 previous usage did only work for our methods.
22058 (Expression::ConvertImplicit): Handle decimal implicit numeric
22059 conversions as well.
22060 (Expression::InternalTypeConstructor): Used to invoke constructors
22061 on internal types for default promotions.
22063 (Unary::Emit): Implement special handling for the pre/post
22064 increment/decrement for overloaded operators, as they need to have
22065 the same semantics as the other operators.
22067 (Binary::ResolveOperator): ditto.
22068 (Invocation::ConversionExists): ditto.
22069 (UserImplicitCast::Resolve): ditto.
22071 2001-09-26 Ravi Pratap <ravi@ximian.com>
22073 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22074 operator, return after emitting body. Regression tests pass again !
22076 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22077 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22078 (Invocation::OverloadResolve): Ditto.
22079 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22081 * everywhere : update calls to the above methods accordingly.
22083 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22085 * assign.cs (Assign): Make it inherit from ExpressionStatement.
22087 * expression.cs (ExpressionStatement): New base class used for
22088 expressions that can appear in statements, so that we can provide
22089 an alternate path to generate expression that do not leave a value
22092 (Expression::Emit, and all the derivatives): We no longer return
22093 whether a value is left on the stack or not. Every expression
22094 after being emitted leaves a single value on the stack.
22096 * codegen.cs (EmitContext::EmitStatementExpression): Use the
22097 facilties of ExpressionStatement if possible.
22099 * cs-parser.jay: Update statement_expression.
22101 2001-09-25 Miguel de Icaza <miguel@ximian.com>
22103 * driver.cs: Change the wording of message
22105 2001-09-25 Ravi Pratap <ravi@ximian.com>
22107 * expression.cs (Binary::ResolveOperator): Had forgottten to set
22108 the type of the expression to the return type of the method if
22109 we have an overloaded operator match ! The regression tests pass again !
22110 (Unary::ResolveOperator): Ditto.
22112 * expression.cs (Invocation::ConversionExists): Correct the member lookup
22113 to find "op_Implicit", not "implicit" ;-)
22114 (UserImplicitCast): New class to take care of user-defined implicit conversions.
22115 (ConvertImplicit, ForceConversion): Take TypeContainer argument
22117 * everywhere : Correct calls to the above accordingly.
22119 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22120 (ConvertImplicit): Do user-defined conversion if it exists.
22122 2001-09-24 Miguel de Icaza <miguel@ximian.com>
22124 * assign.cs: track location.
22125 (Resolve): Use implicit conversions on assignment.
22127 * literal.cs: Oops. Not good, Emit of short access values should
22128 pass (Bytes) or the wrong argument will be selected.
22130 * expression.cs (Unary::Emit): Emit code for -expr.
22132 (Unary::ResolveOperator): Handle `Substract' for non-constants
22133 (substract from zero from the non-constants).
22134 Deal with Doubles as well.
22136 (Expression::ConvertImplicitRequired): New routine that reports an
22137 error if no implicit conversion exists.
22139 (Invocation::OverloadResolve): Store the converted implicit
22140 expressions if we make them
22142 2001-09-24 Ravi Pratap <ravi@ximian.com>
22144 * class.cs (ConstructorInitializer): Take a Location argument.
22145 (ConstructorBaseInitializer): Same here.
22146 (ConstructorThisInitializer): Same here.
22148 * cs-parser.jay : Update all calls accordingly.
22150 * expression.cs (Unary, Binary, New): Take location argument.
22151 Update accordingly everywhere.
22153 * cs-parser.jay : Update all calls to the above to take a location
22156 * class.cs : Ditto.
22158 2001-09-24 Ravi Pratap <ravi@ximian.com>
22160 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22161 (Invocation::BetterConversion): Same here
22162 (Invocation::ConversionExists): Ditto.
22164 (Invocation::ConversionExists): Implement.
22166 2001-09-22 Ravi Pratap <ravi@ximian.com>
22168 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22169 Also take an additional TypeContainer argument.
22171 * All over : Pass in TypeContainer as argument to OverloadResolve.
22173 * typemanager.cs (CSharpName): Update to check for the string type and return
22176 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22179 2001-09-21 Ravi Pratap <ravi@ximian.com>
22181 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22182 (Invocation::BetterFunction): Implement.
22183 (Invocation::BetterConversion): Implement.
22184 (Invocation::ConversionExists): Skeleton, no implementation yet.
22186 Okay, things work fine !
22188 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22190 * typemanager.cs: declare and load enum_type, delegate_type and
22193 * expression.cs (Expression::Emit): Now emit returns a value that
22194 tells whether a value is left on the stack or not. This strategy
22195 might be reveted tomorrow with a mechanism that would address
22196 multiple assignments.
22197 (Expression::report118): Utility routine to report mismatches on
22200 (Unary::Report23): Report impossible type/operator combination
22203 (Unary::IsIncrementableNumber): Whether the type can be
22204 incremented or decremented with add.
22205 (Unary::ResolveOperator): Also allow enumerations to be bitwise
22207 (Unary::ResolveOperator): Implement ++, !, ~,
22209 (Invocation::Emit): Deal with new Emit convetion.
22211 * All Expression derivatives: Updated their Emit method to return
22212 whether they leave values on the stack or not.
22214 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22215 stack for expressions that are statements.
22217 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22219 * expression.cs (LValue): New interface. Must be implemented by
22221 (LocalVariableReference, ParameterReference, FieldExpr): Implement
22224 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22225 interface for generating code, simplifies the code.
22227 2001-09-20 Ravi Pratap <ravi@ximian.com>
22229 * expression.cs (everywhere): Comment out return statements in ::Resolve
22230 methods to avoid the warnings.
22232 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22234 * driver.cs (parse): Report error 2001 if we can not open the
22237 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22240 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22243 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22244 otherwise nested blocks end up with the same index.
22246 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22248 * expression.cs: Instead of having FIXMEs in the Resolve
22249 functions, throw exceptions so it is obvious that we are facing a
22252 * cs-parser.jay (invocation_expression): Pass Location information.
22254 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22255 Use a basename for those routines because .NET does not like paths
22258 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22261 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22263 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22264 are loading the correct data types (throws an exception if not).
22265 (TypeManager::InitCoreTypes): Use CoreLookupType
22267 * expression.cs (Unary::ResolveOperator): return the child
22268 expression for expressions which are just +expr.
22269 (Unary::ResolveOperator): Return negative literals for -LITERAL
22270 expressions (otherwise they are Unary {Literal}).
22271 (Invocation::Badness): Take into account `Implicit constant
22272 expression conversions'.
22274 * literal.cs (LongLiteral): Implement long literal class.
22275 (IntLiteral): export the `Value' of the intliteral.
22277 2001-09-19 Ravi Pratap <ravi@ximian.com>
22279 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22281 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22282 instead of 'Operator'
22284 * expression.cs (Binary::ResolveOperator): Update accordingly.
22285 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22288 * cs-parser.jay (unary_expression): Update to use the new names.
22290 * gen-treedump.cs (GetUnary): Same here.
22292 * expression.cs (Unary::Resolve): Implement.
22293 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22294 operators are found instead of making noise ;-)
22295 (Unary::ResolveOperator): New method to do precisely the same thing which
22296 Binary::ResolveOperator does for Binary expressions.
22297 (Unary.method, .Arguments): Add.
22298 (Unary::OperName): Implement.
22299 (Unary::ForceConversion): Copy and Paste !
22301 * class.cs (Operator::Define): Fix a small bug for the case when we have
22304 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22305 for the inbuilt operators. Only overloading works for now ;-)
22307 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22309 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22310 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22312 * expression.cs (This::Emit): Implement.
22313 (This::Resolve): Implement.
22314 (TypeOf:Resolve): Implement.
22315 (Expression::ResolveSimpleName): Add an implicit this to instance
22317 (MemberAccess::Resolve): Deal with Parameters and Fields.
22318 Bind instance variable to Field expressions.
22319 (FieldExpr::Instance): New field used to track the expression that
22320 represents the object instance.
22321 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22323 (FieldExpr::Emit): Implement.
22325 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22326 the last instruction contains a return opcode to avoid generating
22327 the last `ret' instruction (this generates correct code, and it is
22328 nice to pass the peverify output).
22330 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22331 initializer for static and instance variables.
22332 (Constructor::Emit): Allow initializer to be null in the case of
22333 static constructors. Only emit initializer for instance
22336 (TypeContainer::FindMembers): Return a null array if there are no
22339 Also fix the code for the MemberTypes.Method branch, as it was not
22340 scanning that for operators (or tried to access null variables before).
22342 * assign.cs (Assign::Emit): Handle instance and static fields.
22346 * driver.cs: Stop compilation if there are parse errors.
22348 * cs-parser.jay (constructor_declaration): Provide default base
22349 initializer for non-static constructors.
22350 (constructor_declarator): Do not provide a default base
22351 initializers if none was specified.
22352 Catch the fact that constructors should not have parameters.
22354 * class.cs: Do not emit parent class initializers for static
22355 constructors, that should be flagged as an error.
22357 2001-09-18 Ravi Pratap <ravi@ximian.com>
22359 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22360 Move back code into TypeContainer::Populate.
22362 2001-09-18 Ravi Pratap <ravi@ximian.com>
22364 * class.cs (TypeContainer::AddConstructor): Fix the check to
22365 compare against Name, not Basename.
22366 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22368 * cs-parser.jay : Update accordingly.
22370 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22371 for methods, don't forget to look into the operators too.
22372 (RegisterMethodBuilder): Helper method to take care of this for
22373 methods, constructors and operators.
22374 (Operator::Define): Completely revamp.
22375 (Operator.OperatorMethod, MethodName): New fields.
22376 (TypeContainer::Populate): Move the registering of builders into
22377 RegisterMethodBuilder.
22378 (Operator::Emit): Re-write.
22380 * expression.cs (Binary::Emit): Comment out code path to emit method
22381 invocation stuff for the case when we have a user defined operator. I am
22382 just not able to get it right !
22384 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22386 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22389 (Expression::MemberLookup): Provide a version that allows to
22390 specify the MemberTypes and BindingFlags.
22392 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22393 so it was not fetching variable information from outer blocks.
22395 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22396 Beforefieldinit as it was buggy.
22398 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22399 that Ravi put here.
22401 * class.cs (Constructor::Emit): Only emit if block is not null.
22402 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22403 deal with this by semantically definining it as if the user had
22406 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22407 constructors as we now "emit" them at a higher level.
22409 (TypeContainer::DefineDefaultConstructor): Used to define the
22410 default constructors if none was provided.
22412 (ConstructorInitializer): Add methods Resolve and Emit.
22414 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22416 2001-09-17 Ravi Pratap <ravi@ximian.com>
22418 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22419 the default constructor builder with our hashtable for methodbuilders
22422 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22423 and argument_count is 0 in which case we have a match.
22424 (Binary::ResolveOperator): More null checking and miscellaneous coding
22427 2001-09-17 Ravi Pratap <ravi@ximian.com>
22429 * rootcontext.cs (IsNameSpace): Compare against null.
22431 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22433 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22434 and Unary::Operator.
22436 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22439 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22440 we have overloaded operators.
22441 (Binary::ResolveOperator): Implement the part which does the operator overload
22444 * class.cs (Operator::Emit): Implement.
22445 (TypeContainer::Emit): Emit the operators we have too.
22447 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22448 the case when we have a user-defined operator.
22450 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22452 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22454 2001-09-16 Ravi Pratap <ravi@ximian.com>
22456 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22457 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22458 (Constructor::Emit): Implement.
22459 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22460 if we have no work to do.
22461 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22464 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22465 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22467 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22470 2001-09-15 Ravi Pratap <ravi@ximian.com>
22472 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22474 (Tree::RecordNamespace): Method to do what the name says ;-)
22475 (Tree::Namespaces): Property to get at the namespaces hashtable.
22477 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22480 * rootcontext.cs (IsNamespace): Fixed it :-)
22482 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22484 * class.cs (TypeContainer::FindMembers): Add support for
22486 (MethodCore): New class that encapsulates both the shared aspects
22487 of a Constructor and a Method.
22488 (Method, Constructor): Factored pieces into MethodCore.
22490 * driver.cs: Added --fatal which makes errors throw exceptions.
22491 Load System assembly as well as part of the standard library.
22493 * report.cs: Allow throwing exceptions on errors for debugging.
22495 * modifiers.cs: Do not use `parent', instead use the real type
22496 container to evaluate permission settings.
22498 * class.cs: Put Ravi's patch back in. He is right, and we will
22499 have to cope with the
22501 2001-09-14 Ravi Pratap <ravi@ximian.com>
22503 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22504 FamORAssem, not FamANDAssem.
22506 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22508 * driver.cs: Added --parse option that only parses its input files
22511 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
22512 incorrect. IsTopLevel is not used to tell whether an object is
22513 root_types or not (that can be achieved by testing this ==
22514 root_types). But to see if this is a top-level *class* (not
22515 necessarly our "toplevel" container).
22517 2001-09-14 Ravi Pratap <ravi@ximian.com>
22519 * enum.cs (Enum::Define): Modify to call the Lookup method on the
22520 parent instead of a direct call to GetType.
22522 2001-09-14 Ravi Pratap <ravi@ximian.com>
22524 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22525 Modifiers.TypeAttr. This should just be a call to that method.
22527 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22528 object so that we can determine if we are top-level or not.
22530 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
22533 * enum.cs (Enum::Define): Ditto.
22535 * modifiers.cs (FieldAttr): Re-write.
22537 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22538 (TypeContainer::HaveStaticConstructor): New property to provide access
22539 to precisely that info.
22541 * modifiers.cs (MethodAttr): Re-write.
22542 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22544 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22545 of top-level types as claimed.
22547 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22549 * expression.cs (MemberLookup): Fruitless attempt to lookup
22550 constructors. Maybe I need to emit default constructors? That
22551 might be it (currently .NET emits this for me automatically).
22552 (Invocation::OverloadResolve): Cope with Arguments == null.
22553 (Invocation::EmitArguments): new function, shared by the new
22554 constructor and us.
22555 (Invocation::Emit): Handle static and instance methods. Emit
22556 proper call instruction for virtual or non-virtual invocations.
22557 (New::Emit): Implement.
22558 (New::Resolve): Implement.
22559 (MemberAccess:Resolve): Implement.
22560 (MethodGroupExpr::InstanceExpression): used conforming to the spec
22561 to track instances.
22562 (FieldExpr::Resolve): Set type.
22564 * support.cs: Handle empty arguments.
22566 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22567 SimpleLookup): Auxiliary routines to help parse a qualifier
22570 Update qualifier_identifier rule.
22572 * codegen.cs: Removed debugging messages.
22574 * class.cs: Make this a global thing, this acts just as a "key" to
22575 objects that we might have around.
22577 (Populate): Only initialize method_builders_to_methods once.
22579 * expression.cs (PropertyExpr): Initialize type from the
22582 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22583 Resolve pattern. Attempt to implicitly convert value to boolean.
22586 * expression.cs: Set the type for the int32/int32 argument case.
22587 (Binary::ResolveOperator): Set the return type to boolean for
22588 comparission operators
22590 * typemanager.cs: Remove debugging print code.
22592 (Invocation::Resolve): resolve type.
22594 * class.cs: Allocate a MemberInfo of the correct size, as the code
22595 elsewhere depends on the test to reflect the correct contents.
22597 (Method::) Keep track of parameters, due to System.Reflection holes
22599 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22602 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22603 of the exact size and return that.
22605 (Class::LookupMethodByBuilder): New function that maps
22606 MethodBuilders to its methods. Required to locate the information
22607 on methods because System.Reflection bit us again.
22609 * support.cs: New file, contains an interface ParameterData and
22610 two implementations: ReflectionParameters and InternalParameters
22611 used to access Parameter information. We will need to grow this
22614 * expression.cs (Invocation::GetParameterData): implement a cache
22615 and a wrapper around the ParameterData creation for methods.
22616 (Invocation::OverloadResolve): Use new code.
22618 2001-09-13 Ravi Pratap <ravi@ximian.com>
22620 * class.cs (TypeContainer::EmitField): Remove and move into
22621 (Field::Define): here and modify accordingly.
22622 (Field.FieldBuilder): New member.
22623 (TypeContainer::Populate): Update accordingly.
22624 (TypeContainer::FindMembers): Implement.
22626 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22628 * statement.cs: (VariableInfo::VariableType): New field to be
22629 initialized with the full type once it is resolved.
22631 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22633 * parameter.cs (GetParameterInfo): Use a type cache to compute
22634 things only once, and to reuse this information
22636 * expression.cs (LocalVariableReference::Emit): Implement.
22637 (OpcodeCast::Emit): fix.
22639 (ParameterReference::Resolve): Implement.
22640 (ParameterReference::Emit): Implement.
22642 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22643 that are expressions need to stay as Expressions.
22645 * typemanager.cs (CSharpName): Returns the C# name of a type if
22648 * expression.cs (Expression::ConvertImplicit): New function that
22649 implements implicit type conversions.
22651 (Expression::ImplicitReferenceConversion): Implements implicit
22652 reference conversions.
22654 (EmptyCast): New type for transparent casts.
22656 (OpcodeCast): New type for casts of types that are performed with
22657 a sequence of bytecodes.
22659 (BoxedCast): New type used for casting value types into reference
22660 types. Emits a box opcode.
22662 (Binary::DoNumericPromotions): Implements numeric promotions of
22663 and computation of the Binary::Type.
22665 (Binary::EmitBranchable): Optimization.
22667 (Binary::Emit): Implement code emission for expressions.
22669 * typemanager.cs (TypeManager): Added two new core types: sbyte
22672 2001-09-12 Ravi Pratap <ravi@ximian.com>
22674 * class.cs (TypeContainer::FindMembers): Method which does exactly
22675 what Type.FindMembers does, only we don't have to use reflection. No
22676 implementation yet.
22678 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22679 typecontainer objects as we need to get at them.
22680 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22682 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22683 typecontainer object.
22685 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22686 of just a Report object.
22688 2001-09-11 Ravi Pratap <ravi@ximian.com>
22690 * class.cs (Event::Define): Go back to using the prefixes "add_" and
22692 (TypeContainer::Populate): Now define the delegates of the type too.
22693 (TypeContainer.Delegates): Property to access the list of delegates defined
22696 * delegates.cs (Delegate::Define): Implement partially.
22698 * modifiers.cs (TypeAttr): Handle more flags.
22700 2001-09-11 Ravi Pratap <ravi@ximian.com>
22702 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22704 (Operator::Define): Re-write logic to get types by using the LookupType method
22705 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22706 (Indexer::Define): Ditto.
22707 (Event::Define): Ditto.
22708 (Property::Define): Ditto.
22710 2001-09-10 Ravi Pratap <ravi@ximian.com>
22712 * class.cs (TypeContainer::Populate): Now define operators too.
22713 (TypeContainer.Operators): New property to access the list of operators
22715 (Operator.OperatorMethodBuilder): New member to hold the method builder
22716 for the operator we are defining.
22717 (Operator::Define): Implement.
22719 2001-09-10 Ravi Pratap <ravi@ximian.com>
22721 * class.cs (Event::Define): Make the prefixes of the accessor methods
22722 addOn_ and removeOn_
22724 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22725 of the location being passed in too. Ideally, this should go later since all
22726 error reporting should be done through the Report object.
22728 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22729 (Populate): Iterate thru the indexers we have and define them too.
22730 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22731 for the get and set accessors.
22732 (Indexer::Define): Implement.
22734 2001-09-09 Miguel de Icaza <miguel@ximian.com>
22736 * expression.cs (Binary::Resolve): Beginning of it. I scratched
22737 my previous implementation, did not work.
22739 * typemanager.cs: Add a couple of missing types (the longs).
22741 * literal.cs: Use TypeManager.bool_type instead of getting it.
22743 * expression.cs (EventExpr): New kind of expressions.
22744 (Expressio::ExprClassFromMemberInfo): finish
22746 2001-09-08 Miguel de Icaza <miguel@ximian.com>
22748 * assign.cs: Emit stores to static fields differently.
22750 2001-09-08 Ravi Pratap <ravi@ximian.com>
22752 * Merge in changes and adjust code to tackle conflicts. Backed out my
22753 code in Assign::Resolve ;-)
22755 2001-09-08 Ravi Pratap <ravi@ximian.com>
22757 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22758 instead Report.Error and also pass in the location.
22759 (CSharpParser::Lexer): New readonly property to return the reference
22760 to the Tokenizer object.
22761 (declare_local_variables): Use Report.Error with location instead of plain
22765 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22766 (Operator.CheckBinaryOperator): Ditto.
22768 * cs-parser.jay (operator_declarator): Update accordingly.
22770 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22771 (CheckBinaryOperator): Same here.
22773 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22774 on the name without any prefixes of namespace names etc. This is because we
22775 already might have something already fully qualified like
22776 'System.Console.WriteLine'
22778 * assign.cs (Resolve): Begin implementation. Stuck ;-)
22780 2001-09-07 Ravi Pratap <ravi@ximian.com>
22782 * cs-tokenizer.cs (location): Return a string which also contains
22785 * expression.cs (ElementAccess): New class for expressions of the
22786 type 'element access.'
22787 (BaseAccess): New class for expressions of the type 'base access.'
22788 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22791 * cs-parser.jay (element_access): Implement action.
22792 (base_access): Implement actions.
22793 (checked_expression, unchecked_expression): Implement.
22795 * cs-parser.jay (local_variable_type): Correct and implement.
22796 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22798 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22800 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22801 name and the specifiers.
22803 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22805 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
22806 making them all public ;-)
22808 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22811 2001-09-07 Miguel de Icaza <miguel@ximian.com>
22813 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22815 (FieldExpr, PropertyExprs): New resolved expressions.
22816 (SimpleName::MemberStaticCheck): Perform static checks for access
22817 to non-static fields on static methods. Maybe this should be
22818 generalized for MemberAccesses.
22819 (SimpleName::ResolveSimpleName): More work on simple name
22822 * cs-parser.jay (primary_expression/qualified_identifier): track
22823 the parameter index.
22825 * codegen.cs (CodeGen::Save): Catch save exception, report error.
22826 (EmitContext::EmitBoolExpression): Chain to expression generation
22827 instead of temporary hack.
22828 (::EmitStatementExpression): Put generic expression code generation.
22830 * assign.cs (Assign::Emit): Implement variable assignments to
22831 local variables, parameters and fields.
22833 2001-09-06 Miguel de Icaza <miguel@ximian.com>
22835 * statement.cs (Block::GetVariableInfo): New method, returns the
22836 VariableInfo for a variable name in a block.
22837 (Block::GetVariableType): Implement in terms of GetVariableInfo
22839 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22840 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22842 2001-09-06 Ravi Pratap <ravi@ximian.com>
22844 * cs-parser.jay (operator_declaration): Continue on my quest : update
22845 to take attributes argument.
22846 (event_declaration): Ditto.
22847 (enum_declaration): Ditto.
22848 (indexer_declaration): Ditto.
22850 * class.cs (Operator::Operator): Update constructor accordingly.
22851 (Event::Event): Ditto.
22853 * delegate.cs (Delegate::Delegate): Same here.
22855 * enum.cs (Enum::Enum): Same here.
22857 2001-09-05 Ravi Pratap <ravi@ximian.com>
22859 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22861 * ../tests/cs0658.cs : New file to demonstrate error 0658.
22863 * attribute.cs (Attributes): New class to encapsulate all attributes which were
22864 being passed around as an arraylist.
22865 (Attributes::AddAttribute): Method to add attribute sections.
22867 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22868 (struct_declaration): Update accordingly.
22869 (constant_declaration): Update.
22870 (field_declaration): Update.
22871 (method_header): Update.
22872 (fixed_parameter): Update.
22873 (parameter_array): Ditto.
22874 (property_declaration): Ditto.
22875 (destructor_declaration): Ditto.
22877 * class.cs (Struct::Struct): Update constructors accordingly.
22878 (Class::Class): Ditto.
22879 (Field::Field): Ditto.
22880 (Method::Method): Ditto.
22881 (Property::Property): Ditto.
22882 (TypeContainer::OptAttribute): update property's return type.
22884 * interface.cs (Interface.opt_attributes): New member.
22885 (Interface::Interface): Update to take the extra Attributes argument.
22887 * parameter.cs (Parameter::Parameter): Ditto.
22889 * constant.cs (Constant::Constant): Ditto.
22891 * interface.cs (InterfaceMemberBase): New OptAttributes field.
22892 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
22893 the attributes as a parameter.
22894 (InterfaceProperty): Update constructor call.
22895 (InterfaceEvent): Ditto.
22896 (InterfaceMethod): Ditto.
22897 (InterfaceIndexer): Ditto.
22899 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
22900 pass the attributes too.
22901 (interface_event_declaration): Ditto.
22902 (interface_property_declaration): Ditto.
22903 (interface_method_declaration): Ditto.
22904 (interface_declaration): Ditto.
22906 2001-09-05 Miguel de Icaza <miguel@ximian.com>
22908 * class.cs (Method::Define): Track the "static Main" definition to
22909 create an entry point.
22911 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22912 EntryPoint if we find it.
22914 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22915 (EmitContext::ig): Make this variable public.
22917 * driver.cs: Make the default output file be the first file name
22918 with the .exe extension.
22920 Detect empty compilations
22922 Handle various kinds of output targets. Handle --target and
22923 rename -t to --dumper.
22925 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22926 methods inherited from Expression return now an Expression. This
22927 will is used during the tree rewriting as we resolve them during
22930 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22931 the spec. Missing entirely is the information about
22932 accessability of elements of it.
22934 (Expression::ExprClassFromMemberInfo): New constructor for
22935 Expressions that creates a fully initialized Expression based on
22936 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22939 (Invocation::Resolve): Begin implementing resolution of invocations.
22941 * literal.cs (StringLiteral): Implement Emit.
22943 2001-09-05 Ravi Pratap <ravi@ximian.com>
22945 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22948 2001-09-04 Ravi Pratap <ravi@ximian.com>
22950 * cs-parser.jay (attribute_arguments): Implement actions.
22951 (attribute): Fix bug in production. Implement action.
22952 (attribute_list): Implement.
22953 (attribute_target): Implement.
22954 (attribute_target_specifier, opt_target_specifier): Implement
22955 (CheckAttributeTarget): New method to check if the attribute target
22957 (attribute_section): Implement.
22958 (opt_attributes): Implement.
22960 * attribute.cs : New file to handle attributes.
22961 (Attribute): Class to hold attribute info.
22963 * cs-parser.jay (opt_attribute_target_specifier): Remove production
22964 (attribute_section): Modify production to use 2 different rules to
22965 achieve the same thing. 1 s/r conflict down !
22966 Clean out commented, useless, non-reducing dimension_separator rules.
22968 * class.cs (TypeContainer.attributes): New member to hold list
22969 of attributes for a type.
22970 (Struct::Struct): Modify to take one more argument, the attribute list.
22971 (Class::Class): Ditto.
22972 (Field::Field): Ditto.
22973 (Method::Method): Ditto.
22974 (Property::Property): Ditto.
22976 * cs-parser.jay (struct_declaration): Update constructor call to
22977 pass in the attributes too.
22978 (class_declaration): Ditto.
22979 (constant_declaration): Ditto.
22980 (field_declaration): Ditto.
22981 (method_header): Ditto.
22982 (fixed_parameter): Ditto.
22983 (parameter_array): Ditto.
22984 (property_declaration): Ditto.
22986 * constant.cs (Constant::Constant): Update constructor similarly.
22987 Use System.Collections.
22989 * parameter.cs (Parameter::Parameter): Update as above.
22991 2001-09-02 Ravi Pratap <ravi@ximian.com>
22993 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22994 (TypeContainer.delegates): New member to hold list of delegates.
22996 * cs-parser.jay (delegate_declaration): Implement the action correctly
22997 this time as I seem to be on crack ;-)
22999 2001-09-02 Miguel de Icaza <miguel@ximian.com>
23001 * rootcontext.cs (RootContext::IsNamespace): new function, used to
23002 tell whether an identifier represents a namespace.
23004 * expression.cs (NamespaceExpr): A namespace expression, used only
23005 temporarly during expression resolution.
23006 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23007 utility functions to resolve names on expressions.
23009 2001-09-01 Miguel de Icaza <miguel@ximian.com>
23011 * codegen.cs: Add hook for StatementExpressions.
23013 * class.cs: Fix inverted test for static flag in methods.
23015 2001-09-02 Ravi Pratap <ravi@ximian.com>
23017 * class.cs (Operator::CheckUnaryOperator): Correct error number used
23018 to make it coincide with MS' number.
23019 (Operator::CheckBinaryOperator): Ditto.
23021 * ../errors/errors.txt : Remove error numbers added earlier.
23023 * ../errors/cs1019.cs : Test case for error # 1019
23025 * ../errros/cs1020.cs : Test case for error # 1020
23027 * cs-parser.jay : Clean out commented cruft.
23028 (dimension_separators, dimension_separator): Comment out. Ostensibly not
23029 used anywhere - non-reducing rule.
23030 (namespace_declarations): Non-reducing rule - comment out.
23032 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23033 with TypeContainer::AddEnum.
23035 * delegate.cs : New file for delegate handling classes.
23036 (Delegate): Class for declaring delegates.
23038 * makefile : Update.
23040 * cs-parser.jay (delegate_declaration): Implement.
23042 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
23044 * class.cs (Event::Define): Implement.
23045 (Event.EventBuilder): New member.
23047 * class.cs (TypeContainer::Populate): Update to define all enums and events
23049 (Events): New property for the events arraylist we hold. Shouldn't we move to using
23050 readonly fields for all these cases ?
23052 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23054 * class.cs (Property): Revamp to use the convention of making fields readonly.
23055 Accordingly modify code elsewhere.
23057 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23058 the Define method of the Property class.
23060 * class.cs : Clean up applied patch and update references to variables etc. Fix
23062 (TypeContainer::Populate): Update to define all the properties we have. Also
23063 define all enumerations.
23065 * enum.cs (Define): Implement.
23067 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23069 * cs-parser.jay (overloadable_operator): The semantic value is an
23070 enum of the Operator class.
23071 (operator_declarator): Implement actions.
23072 (operator_declaration): Implement.
23074 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23075 validity of definitions.
23076 (Operator::CheckBinaryOperator): Static method to check for binary operators
23077 (TypeContainer::AddOperator): New method to add an operator to a type.
23079 * cs-parser.jay (indexer_declaration): Added line to actually call the
23080 AddIndexer method so it gets added ;-)
23082 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
23083 already taken care of by the MS compiler ?
23085 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23087 * class.cs (Operator): New class for operator declarations.
23088 (Operator::OpType): Enum for the various operators.
23090 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23092 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23093 ostensibly handle this in semantic analysis.
23095 * cs-parser.jay (general_catch_clause): Comment out
23096 (specific_catch_clauses, specific_catch_clause): Ditto.
23097 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23098 (catch_args, opt_catch_args): New productions.
23099 (catch_clause): Rewrite to use the new productions above
23100 (catch_clauses): Modify accordingly.
23101 (opt_catch_clauses): New production to use in try_statement
23102 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23103 and re-write the code in the actions to extract the specific and
23104 general catch clauses by being a little smart ;-)
23106 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23107 Hooray, try and catch statements parse fine !
23109 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23111 * statement.cs (Block::GetVariableType): Fix logic to extract the type
23112 string from the hashtable of variables.
23114 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23115 I end up making that mistake ;-)
23116 (catch_clauses): Fixed gross error which made Key and Value of the
23117 DictionaryEntry the same : $1 !!
23119 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23121 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23123 * cs-parser.jay (event_declaration): Correct to remove the semicolon
23124 when the add and remove accessors are specified.
23126 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23128 * cs-parser.jay (IndexerDeclaration): New helper class to hold
23129 information about indexer_declarator.
23130 (indexer_declarator): Implement actions.
23131 (parsing_indexer): New local boolean used to keep track of whether
23132 we are parsing indexers or properties. This is necessary because
23133 implicit_parameters come into picture even for the get accessor in the
23134 case of an indexer.
23135 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23137 * class.cs (Indexer): New class for indexer declarations.
23138 (TypeContainer::AddIndexer): New method to add an indexer to a type.
23139 (TypeContainer::indexers): New member to hold list of indexers for the
23142 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23144 * cs-parser.jay (add_accessor_declaration): Implement action.
23145 (remove_accessor_declaration): Implement action.
23146 (event_accessors_declaration): Implement
23147 (variable_declarators): swap statements for first rule - trivial.
23149 * class.cs (Event): New class to hold information about event
23151 (TypeContainer::AddEvent): New method to add an event to a type
23152 (TypeContainer::events): New member to hold list of events.
23154 * cs-parser.jay (event_declaration): Implement actions.
23156 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23158 * cs-parser.jay (dim_separators): Implement. Make it a string
23159 concatenating all the commas together, just as they appear.
23160 (opt_dim_separators): Modify accordingly
23161 (rank_specifiers): Update accordingly. Basically do the same
23162 thing - instead, collect the brackets here.
23163 (opt_rank_sepcifiers): Modify accordingly.
23164 (array_type): Modify to actually return the complete type string
23165 instead of ignoring the rank_specifiers.
23166 (expression_list): Implement to collect the expressions
23167 (variable_initializer): Implement. We make it a list of expressions
23168 essentially so that we can handle the array_initializer case neatly too.
23169 (variable_initializer_list): Implement.
23170 (array_initializer): Make it a list of variable_initializers
23171 (opt_array_initializer): Modify accordingly.
23173 * expression.cs (New::NType): Add enumeration to help us
23174 keep track of whether we have an object/delegate creation
23175 or an array creation.
23176 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23177 members to hold data about array creation.
23178 (New:New): Modify to update NewType
23179 (New:New): New Overloaded contructor for the array creation
23182 * cs-parser.jay (array_creation_expression): Implement to call
23183 the overloaded New constructor.
23185 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23187 * class.cs (TypeContainer::Constructors): Return member
23188 constructors instead of returning null.
23190 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23192 * typemanager.cs (InitCoreTypes): Initialize the various core
23193 types after we have populated the type manager with the user
23194 defined types (this distinction will be important later while
23195 compiling corlib.dll)
23197 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23198 on Expression Classification. Now all expressions have a method
23199 `Resolve' and a method `Emit'.
23201 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23202 generation from working. Also add some temporary debugging
23205 2001-08-24 Miguel de Icaza <miguel@ximian.com>
23207 * codegen.cs: Lots of code generation pieces. This is only the
23208 beginning, will continue tomorrow with more touches of polish. We
23209 handle the fundamentals of if, while, do, for, return. Others are
23210 trickier and I need to start working on invocations soon.
23212 * gen-treedump.cs: Bug fix, use s.Increment here instead of
23215 * codegen.cs (EmitContext): New struct, used during code
23216 emission to keep a context. Most of the code generation will be
23219 * cs-parser.jay: Add embedded blocks to the list of statements of
23220 this block. So code generation proceeds in a top down fashion.
23222 2001-08-23 Miguel de Icaza <miguel@ximian.com>
23224 * statement.cs: Add support for multiple child blocks.
23226 2001-08-22 Miguel de Icaza <miguel@ximian.com>
23228 * codegen.cs (EmitCode): New function, will emit the code for a
23229 Block of code given a TypeContainer and its ILGenerator.
23231 * statement.cs (Block): Standard public readonly optimization.
23232 (Block::Block constructors): Link children.
23233 (Block::Child): Child Linker.
23234 (Block::EmitVariables): Emits IL variable declarations.
23236 * class.cs: Drop support for MethodGroups here, delay until
23238 (Method::): Applied the same simplification that I did before, and
23239 move from Properties to public readonly fields.
23240 (Method::ParameterTypes): Returns the parameter types for the
23241 function, and implements a cache that will be useful later when I
23242 do error checking and the semantic analysis on the methods is
23244 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23245 and made a method, optional argument tells whether this is a class
23246 or a structure to apply the `has-this' bit.
23247 (Method::GetCallingConvention): Implement, returns the calling
23249 (Method::Define): Defines the type, a second pass is performed
23250 later to populate the methods.
23252 (Constructor::ParameterTypes): implement a cache similar to the
23253 one on Method::ParameterTypes, useful later when we do semantic
23256 (TypeContainer::EmitMethod): New method. Emits methods.
23258 * expression.cs: Removed MethodGroup class from here.
23260 * parameter.cs (Parameters::GetCallingConvention): new method.
23262 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23264 * class.cs (TypeContainer::Populate): Drop RootContext from the
23267 (Constructor::CallingConvention): Returns the calling convention.
23268 (Constructor::ParameterTypes): Returns the constructor parameter
23271 (TypeContainer::AddConstructor): Keep track of default constructor
23272 and the default static constructor.
23274 (Constructor::) Another class that starts using `public readonly'
23275 instead of properties.
23277 (Constructor::IsDefault): Whether this is a default constructor.
23279 (Field::) use readonly public fields instead of properties also.
23281 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23282 track of static constructors; If none is used, turn on
23283 BeforeFieldInit in the TypeAttributes.
23285 * cs-parser.jay (opt_argument_list): now the return can be null
23286 for the cases where there are no arguments.
23288 (constructor_declarator): If there is no implicit `base' or
23289 `this', then invoke the default parent constructor.
23291 * modifiers.cs (MethodAttr): New static function maps a set of
23292 modifiers flags into a MethodAttributes enum
23293 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23294 MethodAttr, TypeAttr to represent the various mappings where the
23295 modifiers are used.
23296 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23298 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23300 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23303 * interface.cs (PopulateIndexer): Implemented the code generator
23304 for interface indexers.
23306 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23308 * interface.cs (InterfaceMemberBase): Now we track the new status
23311 (PopulateProperty): Implement property population. Woohoo! Got
23312 Methods and Properties going today.
23314 Removed all the properties for interfaces, and replaced them with
23315 `public readonly' fields.
23317 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23319 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23320 initialize their hashtables/arraylists only when they are needed
23321 instead of doing this always.
23323 * parameter.cs: Handle refs and out parameters.
23325 * cs-parser.jay: Use an ArrayList to construct the arguments
23326 instead of the ParameterCollection, and then cast that to a
23329 * parameter.cs: Drop the use of ParameterCollection and use
23330 instead arrays of Parameters.
23332 (GetParameterInfo): Use the Type, not the Name when resolving
23335 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23337 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23338 and instead use public readonly fields.
23340 * class.cs: Put back walking code for type containers.
23342 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23344 * class.cs (MakeConstant): Code to define constants.
23346 * rootcontext.cs (LookupType): New function. Used to locate types
23349 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23351 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23352 this System.Reflection code is. Kudos to Microsoft
23354 * typemanager.cs: Implement a type cache and avoid loading all
23355 types at boot time. Wrap in LookupType the internals. This made
23356 the compiler so much faster. Wow. I rule!
23358 * driver.cs: Make sure we always load mscorlib first (for
23359 debugging purposes, nothing really important).
23361 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23362 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23364 * rootcontext.cs: Lookup types on their namespace; Lookup types
23365 on namespaces that have been imported using the `using' keyword.
23367 * class.cs (TypeContainer::TypeAttr): Virtualize.
23368 (Class::TypeAttr): Return attributes suitable for this bad boy.
23369 (Struct::TypeAttr): ditto.
23370 Handle nested classes.
23371 (TypeContainer::) Remove all the type visiting code, it is now
23372 replaced with the rootcontext.cs code
23374 * rootcontext.cs (GetClassBases): Added support for structs.
23376 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23378 * interface.cs, statement.cs, class.cs, parameter.cs,
23379 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23380 Drop use of TypeRefs, and use strings instead.
23382 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23386 * class.cs (Struct::Struct): set the SEALED flags after
23387 checking the modifiers.
23388 (TypeContainer::TypeAttr): new property, returns the
23389 TypeAttributes for a class.
23391 * cs-parser.jay (type_list): Oops, list production was creating a
23392 new list of base types.
23394 * rootcontext.cs (StdLib): New property.
23395 (GetInterfaceTypeByName): returns an interface by type name, and
23396 encapsulates error handling here.
23397 (GetInterfaces): simplified.
23398 (ResolveTree): Encapsulated all the tree resolution here.
23399 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23402 * driver.cs: Add support for --nostdlib, to avoid loading the
23403 default assemblies.
23404 (Main): Do not put tree resolution here.
23406 * rootcontext.cs: Beginning of the class resolution.
23408 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23410 * rootcontext.cs: Provide better error reporting.
23412 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23414 * rootcontext.cs (CreateInterface): Handle the case where there
23415 are no parent interfaces.
23417 (CloseTypes): Routine to flush types at the end.
23418 (CreateInterface): Track types.
23419 (GetInterfaces): Returns an array of Types from the list of
23420 defined interfaces.
23422 * typemanager.c (AddUserType): Mechanism to track user types (puts
23423 the type on the global type hash, and allows us to close it at the
23426 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23428 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23429 RecordInterface instead.
23431 * cs-parser.jay: Updated to reflect changes above.
23433 * decl.cs (Definition): Keep track of the TypeBuilder type that
23434 represents this type here. Not sure we will use it in the long
23435 run, but wont hurt for now.
23437 * driver.cs: Smaller changes to accomodate the new code.
23439 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23442 * rootcontext.cs (CreateInterface): New method, used to create
23443 the System.TypeBuilder type for interfaces.
23444 (ResolveInterfaces): new entry point to resolve the interface
23446 (CodeGen): Property, used to keep track of the code generator.
23448 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23450 * cs-parser.jay: Add a second production for delegate_declaration
23453 (enum_body): Put an opt_comma here instead of putting it on
23454 enum_body or enum_member_declarations so we can handle trailing
23455 commas on enumeration members. Gets rid of a shift/reduce.
23457 (type_list): Need a COMMA in the middle.
23459 (indexer_declaration): Tell tokenizer to recognize get/set
23461 * Remove old targets.
23463 * Re-add the parser target.
23465 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23467 * cs-parser.jay: Add precendence rules for a number of operators
23468 ot reduce the number of shift/reduce conflicts in the grammar.
23470 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23472 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23475 Get rid of old crufty code.
23477 * rootcontext.cs: Use this to keep track of the parsed
23478 representation and the defined types available to the program.
23480 * gen-treedump.cs: adjust for new convention.
23482 * type.cs: Split out the type manager, and the assembly builder
23485 * typemanager.cs: the type manager will live here now.
23487 * cil-codegen.cs: And the code generator here.
23489 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23491 * makefile: Fixed up for easy making.
23493 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23495 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23498 (unary_expression): Expand pre_increment_expression and
23499 post_decrement_expression to reduce a shift/reduce.
23501 2001-07-11 Simon Cozens
23503 * cs-tokenizer.cs: Hex numbers should begin with a 0.
23505 Improve allow_keyword_as_indent name.
23507 2001-06-19 Miguel de Icaza <miguel@ximian.com>
23509 * Adjustments for Beta2.
23511 2001-06-13 Miguel de Icaza <miguel@ximian.com>
23513 * decl.cs: Added `Define' abstract method.
23514 (InTransit): new property, used to catch recursive definitions.
23516 * interface.cs: Implement `Define'.
23518 * modifiers.cs: Map Modifiers.constants to
23519 System.Reflection.TypeAttribute flags.
23521 * class.cs: Keep track of types and user-defined types.
23522 (BuilderInit): New method for creating an assembly
23523 (ResolveType): New function to launch the resolution process, only
23524 used by interfaces for now.
23526 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23527 that are inserted into the name space.
23529 2001-06-08 Miguel de Icaza <miguel@ximian.com>
23531 * ARGH. I have screwed up my tree so many times due to the use of
23532 rsync rather than using CVS. Going to fix this at once.
23534 * driver.cs: Objetify driver. Load assemblies, use assemblies to
23537 2001-06-07 Miguel de Icaza <miguel@ximian.com>
23539 * Experiment successful: Use System.Type rather that our own
23542 2001-05-25 Miguel de Icaza <miguel@ximian.com>
23544 * cs-parser.jay: Removed nsAliases from here.
23546 Use new namespaces, handle `using XXX;'
23548 * namespace.cs: Reimplemented namespace handling, use a recursive
23549 definition of the class. Now we can keep track of using clauses
23550 and catch invalid using clauses.
23552 2001-05-24 Miguel de Icaza <miguel@ximian.com>
23554 * gen-treedump.cs: Adapted for all the renaming.
23556 * expression.cs (Expression): this class now has a Type property
23557 which returns an expression Type.
23559 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23560 `Type', as this has a different meaning now in the base
23562 2001-05-22 Miguel de Icaza <miguel@ximian.com>
23564 * interface.cs, class.cs: Removed from all the sources the
23565 references to signature computation, as we can not do method
23566 signature computation during the parsing time, as we are not
23567 trying to solve at that point distinguishing:
23571 void a (NS.Blah x) {}
23574 Which depending on the context might be valid or not, as we do not
23575 know if Blah is the same thing as NS.Blah at that point.
23577 * Redid everything so the code uses TypeRefs now instead of
23578 Types. TypeRefs are just temporary type placeholders, that need
23579 to be resolved. They initially have a pointer to a string and the
23580 current scope in which they are used. This is used later by the
23581 compiler to resolve the reference to an actual Type.
23583 * DeclSpace is no longer a CIR.Type, and neither are
23584 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23585 are all DeclSpaces, but no Types.
23587 * type.cs (TypeRefManager): This implements the TypeRef manager,
23588 which keeps track of all the types that need to be resolved after
23589 the parsing has finished.
23591 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23593 * ARGH. We are going to have to store `foreach' as a class rather
23594 than resolving it, as we need to verify error 1579 after name
23595 resolution. *OR* we could keep a flag that says `This request to
23596 IEnumerator comes from a foreach statement' which we can then use
23597 to generate the error.
23599 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23601 * class.cs (TypeContainer.AddMethod): we now add methods to the
23602 MethodGroup instead of the method hashtable.
23604 * expression.cs: Add MethodGroup abstraction, which gets us one
23605 step closer to the specification in the way we handle method
23608 * cs-parser.jay (primary_expression): qualified_identifier now
23609 tried to match up an identifier to a local variable reference or
23610 to a parameter reference.
23612 current_local_parameters is now a parser global variable that
23613 points to the current parameters for the block, used during name
23616 (property_declaration): Now creates an implicit `value' argument to
23619 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23621 * parameter.cs: Do not use `param' arguments as part of the
23622 signature, per the spec.
23624 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23626 * decl.cs: Base class for classes, structs and interfaces. This
23627 is the "Declaration Space"
23629 * cs-parser.jay: Use CheckDef for checking declaration errors
23630 instead of having one on each function.
23632 * class.cs: Factor out some code for handling error handling in
23633 accordance to the "Declarations" section in the "Basic Concepts"
23634 chapter in the ECMA C# spec.
23636 * interface.cs: Make all interface member classes derive from
23637 InterfaceMemberBase.
23639 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23641 * Many things: all interfaces are parsed and generated in
23642 gen-treedump. Support for member variables, constructors,
23643 destructors, properties, constants is there.
23645 Beginning of the IL backend, but very little done, just there for
23648 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23650 * cs-parser.jay: Fix labeled statement.
23652 * cs-tokenizer.cs (escape): Escape " and ' always.
23653 ref_line, ref_name: keep track of the line/filename as instructed
23654 by #line by the compiler.
23657 2001-04-27 Miguel de Icaza <miguel@ximian.com>
23659 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23660 to match the values in System.CodeDOM.
23662 Divid renamed to Divide.
23664 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23666 (Statements.set): remove.
23668 * System.CodeDOM/CodeCatchClause.cs: always have a valid
23671 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23672 falseStatements always have valid values.
23674 * cs-parser.jay: Use System.CodeDOM now.