1 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3 * typemanager.cs (TypeManager): Added
4 TypeManager.internals_visible_attr_type to cache
5 S.R.CompilerServices.InternalsVisibleToAttribute.
7 * codegen.cs (AssemblyClass): Added checks for
8 InternalsVisibleToAttribute in new method
9 CheckInternalsVisibleAttribute () and also cache the
10 AssemblyName in AssemblyClass.Name.
12 2005-10-24 Martin Baulig <martin@ximian.com>
15 (TypeManager.ExpandInterfaces): Added overloaded version which
16 just takes a `Type[]' array.
19 (Constraints.Resolve): Don't expand the interfaces here; ie. we
20 just use the interfaces which were explicitly specified and not
21 the interfaces they inherit. Fixes #76482.
22 (TypeParameter.FindMembers): Expand the interfaces here.
24 2005-10-21 Martin Baulig <martin@ximian.com>
27 (Constraints.Resolve): Also resolve the actual types here.
28 (Constraints.ResolveTypes): Just check the constraints here.
29 Fixes #76363; see gtest-218.cs.
31 2005-10-21 Martin Baulig <martin@ximian.com>
34 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
35 instead of a `BoxedCast'; fixes gtest-217.cs.
37 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
39 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
40 1) "new()" is specified as generic parameter constraint and 2) the
41 type is TypeBuilder and 3) the type is abstract even if it has a
42 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
44 2005-10-20 Martin Baulig <martin@ximian.com>
47 (GenericConstraints.TypeParameter): New public property.
48 (TypeParameter.ctor): Also take a `DeclSpace' argument.
49 (TypeParameter.DeclSpace): New public property.
50 (TypeParameter.DefineType): Inflate the constraints if our
51 `DeclSpace' is an `Iterator'.
53 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
55 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
56 GenericMethod argument to compare methods' generic type arguments.
59 2005-10-19 Martin Baulig <martin@ximian.com>
61 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
62 not ResolveType() when resolving the base type, so we're not
63 checking the constraints here.
64 (TypeContainer.ResolveType): Call ResolveType() on our base_type
67 2005-10-19 Martin Baulig <martin@ximian.com>
69 * generic.cs (ConstructedType.CheckConstraints): Committing
70 untested fix for #76441.
72 2005-10-18 Raja R Harinath <rharinath@novell.com>
75 * class.cs (TypeContainer.DefineType): Move updating of
76 topological sort earlier in the code.
77 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
79 2005-10-18 Marek Safar <marek.safar@seznam.cz>
82 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
84 * constant.cs (Constant.TryReduce): Moved from Cast class.
85 (Reduce): Made little bit more OO and fixed missing conversions.
87 * ecore.cs (Reduce): Implemented.
88 (Binary.EnumLiftUp): New method to upgrade values to enum values.
90 * literal.cs (Reduce): Implemented.
92 * class.cs: Reverted Miguel's wrong commit.
94 2005-10-14 Miguel de Icaza <miguel@novell.com>
96 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
98 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
100 * cs-parser.jay, expression.cs : CS0214 was missing error location
101 for constants. Fixed bug #76404.
103 2005-10-10 Raja R Harinath <rharinath@novell.com>
105 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
107 (PropertyExpr.EmitCall): Likewise.
108 * expression.cs (Invocation.EmitArguments): Handle case where
110 (Invocation.EmitCall): Avoid allocating temporary variable if
111 there are no arguments.
113 2005-10-11 Marek Safar <marek.safar@seznam.cz>
116 * convert.cs (ExplicitConversionCore): Fixed object->enum
119 2005-10-07 Raja R Harinath <rharinath@novell.com>
122 * convert.cs (ImplicitConversionStandard): Move conversion of
123 void* to arbitrary pointer types ...
124 (ExplicitConversionStandard): .. here.
125 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
126 error to always print typenames.
128 2005-10-07 Raja R Harinath <rharinath@novell.com>
130 * convert.cs (GetConversionOperator): Rename from
131 GetConversionOperators. Move operator selection code from ...
132 (UserDefinedConversion): ... here.
134 2005-10-06 Marek Safar <marek.safar@seznam.cz>
136 * convert.cs (ExplicitConversionCore): Removed duplicate enum
139 2005-10-05 Marek Safar <marek.safar@seznam.cz>
141 * assign.cs (Assign.DoResolve): Error method changed.
143 * cfold.cs (DoConstantNumericPromotions): Error method changed.
145 * const.cs (ResolveValue): Reset in_transit immediately.
147 * constant.cs: Error method changed.
149 * convert.cs: Removed useless location parameter.
150 (ExplicitNumericConversion): Don't do double enum check.
151 (ExplicitConversionCore): Renamed from ExplicitConversion.
152 (ExplicitUnsafe): Extracted from ExplicitConversion.
153 (ExplicitConversion): Uses for error reporting.
155 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
157 (ResolveBoolean): Uses common error method.
158 (CastToDecimal): Get rid of ec.
159 (CastFromDecimal): Optimized.
160 (ConvCast): Get rid of ec.
162 * enum.cs (ResolveValue): Reset in_transit immediately.
163 (Emit): Return after first error.
165 * expression.cs: Convert changes.
167 * literal.cs: Error method changed.
169 * statement.cs: Error method changed.
171 2005-10-06 Raja R Harinath <rharinath@novell.com>
173 Fix gtest-131.cs and gtest-211.cs.
174 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
175 Only emit code for a label if it is used. Unreachable code can
176 violate ECMA evaluation stack invariants.
178 2005-09-27 Marek Safar <marek.safar@seznam.cz>
180 * anonymous.cs: Implemented ExprClassName.
182 * assign.cs (Assign.DoResolve): Don't chrash when type is not
185 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
188 * class.cs (StaticClass.DefineContainerMembers): Report protected
191 * codegen.cs: if(ed) PRODUCTION.
193 * convert.cs (Error_CannotImplicitConversion): Better error
196 * cs-parser.jay: More error checks.
198 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
200 * driver.cs (CSCParseOption): Enabled wrong option check.
202 * ecore.cs (Expression.ExprClassName): Turned to property.
203 (MemberExpr.CheckIntermediateModification): For checking boxed
204 value types modification.
206 * statement.cs (Fixed.Resolve): Expression type must be
207 convertible to fixed type.
208 (CollectionForeach.GetEnumeratorFilter,TryType):
209 Small refactoring for easier error checking.
211 2005-09-26 Marek Safar <marek.safar@seznam.cz>
213 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
216 * class.cs (GeneratedBaseInitializer): New class for customization
217 compiler generated initializers.
218 (MemberBase.DoDefine): Check Obsolete attribute here.
219 (FieldMember.DoDefine): Ditto.
221 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
224 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
225 (MemberCore.GetObsoleteAttribute): Removed argument.
226 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
227 (MemberCore.CheckObsoleteType): New helper.
231 * statement.cs: Updates after MemberCore changes.
233 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
234 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
236 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
237 obsolete attribute for compiler construct.
238 (As.DoResolve): Cache result.
240 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
242 2005-10-01 Miguel de Icaza <miguel@novell.com>
244 * expression.cs (Probe): instead of having a "Type probe_type"
245 keep the extra information as a TypeExpr probe_type_expr since the
246 "As" operator needs to perform some type checks.
248 * (As.DoResolve): If the type is a type parameter, ensure that it
249 is constrained by a class.
251 2005-09-22 Miguel de Icaza <miguel@novell.com>
253 * statement.cs (Lock): Use the TemporaryVariable class instead of
254 manually using local variables as those do not work when variables
257 * ecore.cs: Moved the TemporaryVariable class from being a nested
258 class inside Foreach to be a public class that can be employed in
261 2005-09-19 Marek Safar <marek.safar@seznam.cz>
263 * cs-parser.jay: interface_accessors replaced by
264 accessor_declarations.
266 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
269 * statement.cs (GotoCase.Resolve): Convert null constant to
271 (SwitchLabel.ResolveAndReduce): Ditto.
272 (SwitchLabel.NullStringCase): Custom null stamp.
273 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
275 typemanager.cs (CSharpSignature): Don't skip first argument
278 2005-09-16 Marek Safar <marek.safar@seznam.cz>
280 * cfold.cs, constant.cs, convert.cs, ecore.cs,
281 expression.cs, iterators.cs, literal.cs: Store constants and
284 * class.cs (MemberBase.ShortName): Pass location.
286 * cs-parser.jay: Some location fixes.
288 * ecore.cs (Expression.Location): Made virtual.
290 2005-09-27 Marek Safar <marek.safar@seznam.cz>
293 * const.cs (Const.ResolveValue): Check for assigning non-null
294 value to reference type.
296 2005-09-26 Raja R Harinath <rharinath@novell.com>
299 * expression.cs (This.VerifyFixed): In a value type T, the type of
300 'this' is T&, iow, 'this' is either an out or ref parameter. In a
301 value type R, 'this' is treated as a value parameter.
303 2005-09-05 Miguel de Icaza <miguel@novell.com>
305 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
306 if the underlying types are the same, otherwise we need to produce
307 code that will do the proper cast.
309 This was exposed by Marek's constant rewrite which produced
310 invalid code for the call site:
317 This fixes test-49.cs
319 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
321 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
322 Type/Object should be allowed as well. Fixed bug #75968.
324 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
326 * expression.cs : (Binary.DoResolve): when one is enum constant and
327 another is constant 0, then return enum one *as enum type*.
330 2005-10-04 Martin Baulig <martin@ximian.com>
332 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
333 `SetMemberIsUsed()' work for generics, too.
335 2005-10-04 Martin Baulig <martin@ximian.com>
337 * expression.cs (DelegateInvocation.EmitStatement): Make this work
338 for corlib. Fixes #75691.
340 2005-09-28 Marek Safar <marek.safar@seznam.cz>
343 * driver.cs: Fix compilation files with full root path.
345 2005-09-25 Miguel de Icaza <miguel@novell.com>
347 * report.cs (SymbolRelatedToPreviousError): Format the output so
348 it does not use an open parenthesis that is never closed.
350 * driver.cs: Follow coding guidelines
352 2005-09-18 Miguel de Icaza <miguel@novell.com>
354 * driver.cs: Set InEmacs based on the environment variable EMACS.
356 * location.cs (InEmacs): in this mode, do not report column
357 location as it confuses Emacs.
359 2005-10-03 Raja R Harinath <rharinath@novell.com>
361 * support.cs (SeekableStreamReader.Position): Don't error out when
362 the requested position is just beyond the end of the current
365 2005-09-28 Raja R Harinath <rharinath@novell.com>
367 * support.cs (SeekableStreamReader): Simplify drastically. Don't
368 try to keep in sync with the byte count of the underlying Stream.
369 However, this limits us to a window size of 2048 characters: i.e.,
370 the maximum lookahead of our lexer/parser can be 2048 characters.
372 2005-09-22 Martin Baulig <martin@ximian.com>
374 * driver.cs: Removed a debugging FIXME.
376 2005-09-21 Raja R Harinath <rharinath@novell.com>
378 * cs-parser.jay (type_arguments): Add CS1644 check.
379 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
381 2005-09-15 Raja R Harinath <rharinath@novell.com>
383 * Makefile (PROGRAM): Make profile specific.
384 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
385 the current directory.
388 * expression.cs (Invocation.EmitCall): Remove optimization on
389 this_call since it doesn't handle 'this' being a value type.
391 2005-09-05 Geoff Norton <gnorton@customerdna.com>
393 * driver.cs: Ensure file handles are closed after parsing
395 2005-09-05 Miguel de Icaza <miguel@novell.com>
397 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
398 if the underlying types are the same, otherwise we need to produce
399 code that will do the proper cast.
401 This was exposed by Marek's constant rewrite which produced
402 invalid code for the call site:
409 This fixes test-49.cs
411 2005-09-05 Martin Baulig <martin@ximian.com>
413 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
414 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
416 * cs-parser.jay (delegate_declaration): Small fix for #75852.
418 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
420 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
421 to be a pointer type due to the spec 25.2, so check if declaring
422 type is generic type definition. Fixed bug #75772.
424 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
427 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
428 both types are not defined by methods.
429 * expression.cs : (Invocation.IsApplicable): it should work when
430 the argument type is equal to the parameter type, not only when
431 ImplicitConversionExists() returns true.
433 2005-09-02 Raja R Harinath <rharinath@novell.com>
435 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
439 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
440 flow-branching for LocalVariableReferences in case we were invoked
442 * expression.cs (LocalVariableReference.VerifyAssigned): New.
444 (LocalVariableReference.DoResolveBase): ... this.
445 (MemberAccess.Resolve): Do the check that was disabled during
448 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
451 (PartialContainer.Create): check abstract/sealed/static strictly
452 but abstract/sealed can exist only at one side. Fixed bug #75883.
454 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
457 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
458 specified, don't default to UnmanagedType.I4.
460 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
462 * expression.cs : conditional operator should check possibly
463 incorrect assign expression. Fixed bug #75946.
465 2005-08-30 Raja R Harinath <rharinath@novell.com>
468 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
469 (ScopeInfo.EmitScopeType): Use it to construct field names from
470 names of captured locals.
473 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
474 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
475 Pass 'target_type' to BoxedCast. Don't default to 'object'.
476 (ExplicitConversion): Remove enum cases already handled by
477 implicit conversion. Move implicit conversion check to the beginning.
478 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
479 * expression.cs (ArrayCreation.EmitDynamicInitializers):
480 Don't treat System.Enum as a struct.
482 2005-08-30 Jb Evain <jbevain@gmail.com>
484 * attribute.cs: handles as expression in parameters.
486 2005-08-30 Raja R Harinath <rharinath@novell.com>
489 * class.cs (TypeContainer.VerifyClsName): Don't use a
490 PartialContainer when verifying CLS compliance.
491 (AbstractPropertyEventMethod): Set Parent here, ...
492 (PropertyMethod): ... not here.
494 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
496 * attribute.cs : escaped attribute name should not be allowed to be
497 resolved (e.g. @class as classAttribute). Fixed bug #75930.
499 2005-08-29 Raja R Harinath <rharinath@novell.com>
502 * convert.cs (ImplicitStandardConversionExists): Allow zero also
503 when converting a long constant to unsigned long.
504 * expression.cs (Invocation.OverloadResolve): Add sanity check to
505 detect where IsApplicable and VerifyArgumentsCompat disagree.
507 2005-08-29 Raja R Harinath <rharinath@novell.com>
508 and Carlos Alberto Cortez <carlos@unixmexico.org>
511 * class.cs (TypeContainer.CanElideInitializer): New helper.
512 (TypeContainer.EmitFieldInitializers): Use it to determine if we
513 can safely emitting the initializer of a field.
515 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
517 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
518 allowed inside a switch (without loop). Fixed bug #75433.
520 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
522 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
523 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
525 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
527 * driver.cs : kinda reverting the default encoding changes (not exact
528 revert since I noticed that "codepage:reset" might not work fine).
530 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
532 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
533 Location. Now getter and setter store location correctly.
534 (errors/cs0111-12.cs now reports the expected location.)
536 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
538 * driver.cs : Use default encoding on the environment.
539 Removed (now that) extra parameter for SeekableStreamReader.
540 * support.cs : (SeekableStreamReader) third .ctor() argument for
541 StreamReader is not required (always true). preamble size could
542 be acquired in simpler and safe way.
544 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
546 * cs-parser.jay: report CS0642 at warning level 3
547 and report CS0642 for an if else statement also
548 fixes bug #74745. Patch by John Luke (and a bit
550 Removed extra CS0642 warning check for "while",
552 * statement.cs: In Block.Resolve(), CS0642 check
553 is reimplemented to check a sequence of an empty
554 statement and a block.
558 2005-08-24 Marek Safar <marek.safar@seznam.cz>
560 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
561 detection until I fix it.
563 * cs-tokenizer.cs: Changed error message.
565 * cs-parser.jay: Fixed 2 error locations.
567 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
568 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
571 * enum.cs (GetSignatureForError): Fixed.
573 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
577 * typemanager.cs (RegisterProperty): Removed.
579 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
581 2005-08-24 Raja R Harinath <rharinath@novell.com>
584 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
585 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
587 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
589 * expression.cs : tiny fix is required for not warning positive ulong.
592 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
594 * expression.cs : add CS0652 check for constant and integral
595 expression. Fixed bug #53974.
597 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
599 * expression.cs : in DoNumericPromotions(), check if there is implicit
600 conversion overload for string (to check CS0034). Fixed bug #52492.
602 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
604 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
606 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
608 * ecore.cs : report location when it is *not* Null.
610 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
616 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
617 correctly. Fixed bug #75721.
619 2005-08-23 Raja R Harinath <rharinath@novell.com>
621 * support.cs (SeekableStreamReader.Position): Avoid an expensive
622 loop that performs 'min (pos, char_count)'.
625 * expression.cs (Unary.ResolveOperator): Don't discard implicit
626 converted value in Operator.OnesComplement.
628 2005-08-22 Ben Maurer <bmaurer@ximian.com>
630 * anonymous.cs: If the anon method is pulled into a helper class,
631 it needs to be `internal' not `private'. Fixes runtime behavior on
634 2005-08-17 Marek Safar <marek.safar@seznam.cz>
637 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
640 2005-08-16 Marek Safar <marek.safar@seznam.cz>
642 The big constants rewrite
643 Fix #75746, #75685 and more
644 As a side effect saved 1MB for MWF ;-)
646 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
647 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
648 enum based for corlib compilation.
650 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
653 * class.cs (FixedField.Define): Use ResolveAsConstant.
655 * const.cs (IConstant): Interface constants and enums.
656 (Const.ResolveValue): New method for constant resolvning.
657 (ExternalConstant): Constants from imported assemblies.
659 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
660 conversion; like enums.
661 (Constant.ToType): Converts this constant to different type.
662 (Constant.Increment): Adds 1.
664 * convert.cs (ImplicitConversionRequired): Simplified.
666 * cs-parser.jay: Create EnumMember directly.
668 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
670 * doc.cs (GenerateEnumDocComment): Removed.
672 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
673 (ConvertIntLiteral): Removed.
674 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
676 * enum.cs (EnumMember): Implement IConstant.
677 (Enum.IsValidEnumConstant): Removed.
678 (Enum.GetNextDefaultValue): Removed.
679 (Enum.FindMembers): Updated.
680 (Enum.GenerateDocComment): Iterate enum members.
682 * expression.cs (Cast.TryReduce): Handle enums correctly.
683 (New.Constantify): Made public.
684 (MemberAccess.DoResolve): Removed contant specific if(s).
686 * literal.cs (NullLiteral): Implement new abstract methods.
688 * statement.cs (GotoCase.Resolve): Use new constant methods.
689 (SwitchLabel.ResolveAndReduce): Use new constant methods.
691 * typemanager.cs (LookupEnum): Removed.
692 (IsEnumType): Fixed to work with corlib.
693 (RegisterConstant): Removed.
694 (LookupConstant): Removed.
695 (GetConstant): Changed to work with IConstant.
697 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
699 * location.cs : Fixed overflown (>255) column number.
701 2005-08-03 Raja R Harinath <rharinath@novell.com>
703 First cut of the qualified-alias-member feature.
704 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
706 * cs-parser.jay (DOUBLE_COLON): New token.
707 (namespace_or_type_name): Add rule for recognizing
708 qualified-alias-members.
709 (primary_expression): Likewise.
710 (element_access): Allow QualifiedAliasMember as a possible
711 type-bearing expression.
712 (local_variable_type, local_variable_pointer_type): Likewise.
713 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
714 aliases in the current and enclosing namespace declarations.
715 (NamespaceEntry.UsingAlias): Add CS0440 warning.
716 * decl.cs (MemberName.is_double_colon): New.
717 (MemberName.MemberName): Add new constructor for alias-member.
718 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
719 * expression.cs (QualifiedAliasMember): New expression type.
721 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
723 * location.cs : it borked when no argument was specified.
725 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
727 * location.cs : tiny ToString() format fix.
729 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
731 * statement.cs : oops, it was missing.
733 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
735 A set of fixes for precise line/column location.
738 "token" field now holds a file/line "delta", a line number offset
739 from the segment, and a column number. See also:
740 http://lists.ximian.com/pipermail/mono-devel-list/2004-
742 Removed static IsNull. Use instance IsNull property instead.
744 For some tokens it stores Location. For Identifier it stores
745 LocatedToken which is a pair of string name and location.
746 Column numbers are adjusted only at getChar().
748 Use Location.ToString() for reporting (it now contains column).
750 Largely modified to use LocatedToken instead of
751 string (IDENTIFIER), and to acquire Location from some tokens.
752 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
753 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
755 Now MemberName holds Location. DeclSpace.ctor() receives Location
756 as a parameter. Removed extra parameters to all derived classes.
757 Replaced Location.IsNull() with instance property.
758 * assign.cs, expression.cs :
759 Added .ctor() overload that omits Location.
761 Added "nameEscaped" flag that indicates the identifier was escaped
762 in the source file. This fixes bug #57047.
764 2005-09-02 Martin Baulig <martin@ximian.com>
766 * class.cs: Make CS3005 a warning, not an error.
768 2005-08-02 Marek Safar <marek.safar@seznam.cz>
770 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
771 New method, looking for lo-case imported cls type.
773 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
776 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
778 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
780 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
782 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
784 Optimized to save 3.5 MB for SWF compilation.
786 2005-08-01 Marek Safar <marek.safar@seznam.cz>
788 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
789 (PartialContainer.Create): Moved logic AddToContainer.
790 (PartialContainer.MarkForDuplicationCheck): Shares name.
792 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
795 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
797 (Namespace.GetSignatureForError): New method.
799 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
800 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
802 2005-08-01 Raja R Harinath <rharinath@novell.com>
805 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
806 member lookup rather than qualifier_type, since qualifier_type can
809 2005-08-01 Marek Safar <marek.safar@seznam.cz>
811 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
814 2005-07-31 Miguel de Icaza <miguel@novell.com>
816 * statement.cs: Copy the local exception into the exception
817 captured local. Fixes 75674
819 2005-07-31 Raja R Harinath <harinath@gmail.com>
822 * expression.cs (Invocation.OverloadResolve): Don't report error
823 CS1501 if error CS1502 has been reported.
824 (New.DoResolve): Delegate CS1501 reporting to
825 Invocation.OverloadResolve.
828 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
829 invariant-meaning-in-block property in an enclosing block if
832 2005-07-29 Marek Safar <marek.safar@seznam.cz>
834 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
835 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
836 (Switch.CheckSwitch): Just save 50kb for SWF.
838 2005-07-27 Martin Baulig <martin@ximian.com>
840 * anonymous.cs (CaptureContext.AddField): Added
841 `AnonymousContainer am' argument; compute its toplevel scope if
842 it's not already computed. Fixes #75649.
844 2005-07-26 Raja R Harinath <rharinath@novell.com>
847 * class.cs (Constructor.Emit): Reset block to null if the block
850 2005-07-25 Marek Safar <marek.safar@seznam.cz>
852 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
854 2005-07-25 Marek Safar <marek.safar@seznam.cz>
856 * class.cs (MethodData.Define): Check whether accessor implementing
859 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
861 2005-07-22 Marek Safar <marek.safar@seznam.cz>
864 * namespace.cs (LookupType): Moved same type check to...
866 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
869 2005-07-21 Raja R Harinath <rharinath@novell.com>
871 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
872 already found a typebuilder.
873 * class.cs (MethodCore.IsDuplicateImplementation): Compare
874 MemberNames, not strings.
876 * const.cs (Error_ExpressionMustBeConst):
877 Rename from Error_EpressionMustBeConst.
878 * const.cs, class.cs, statement.cd: Update.
880 2005-07-21 Marek Safar <marek.safar@seznam.cz>
884 * const.cs (Const.LookupConstantValue): Report missing contant expression
886 (Error_EpressionMustBeConstant): Only one error method.
888 * class.cs, statement.c: Updated.
890 2005-07-20 Raja R Harinath <rharinath@novell.com>
892 * statement.cs (Block.Flags): Add back HasVarargs.
893 (Block.flags): Make protected.
894 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
896 * typemanager.cs (types, typecontainers, user_types): Remove.
897 (UserTypes, TypeContainers): Likewise.
898 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
899 (CleanUp, Reset): Update.
900 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
901 (GetNestedType): Use Type.GetNestedType.
902 (CoreLookupType): Take two arguments, the namespace and the
903 basename of the type. Update to use the Namespace.Lookup
905 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
906 (RealMemberLookup): Use IsNestedChildOf instead of playing with
907 string concatenation and substring matches.
908 * class.cs, enum.cs, delegate.cs: Update to changes.
910 2005-07-20 Marek Safar <marek.safar@seznam.cz>
912 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
913 Expression and made virtual.
915 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
916 (ImplicitStandardConversionExists): Fixed `byte' typo ?
918 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
920 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
923 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
926 2005-07-18 Marek Safar <marek.safar@seznam.cz>
929 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
930 AssemblyCultureAttribute is not used on executable.
933 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
935 2005-07-16 Raja R Harinath <rharinath@novell.com>
938 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
939 New. Reports CS0252/CS0253.
940 Mostly taken from preliminary patch by Duncak Mak.
941 (Binary.DoResolveOperator): Store results of operator lookup.
942 Use them to detect if we need to warn about unintended reference
945 2005-07-15 Raja R Harinath <rharinath@novell.com>
948 * namespace.cs (Namespace.Lookup): Add back location parameter.
949 (Namespace.LookupType): Add CS0436 report. Add location parameter.
950 * delegate.cs, ecore.cs, expression.cs: Update to changes.
952 * codegen.cs (EmitContext.DeclSpace): Make readonly.
953 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
954 (Namespace.LookupType): ... this.
955 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
957 * typemanager.cs (LookupTypeReflection): Remove buggy code that
958 purported to handle pointers.
959 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
962 2005-07-15 Marek Safar <marek.safar@seznam.cz>
964 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
967 2005-07-15 Raja R Harinath <rharinath@novell.com>
969 * namespace.cs (Namespace.Lookup): Drop location parameter.
970 (NamespaceEntry.LookupAlias): Remove. Merge into ...
971 (NamespaceEntry.Lookup): ... this.
972 (NamespaceEntry.Error_AmbiguousTypeReference):
973 Move here from DeclSpace.
974 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
976 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
977 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
978 Move to NamespaceEntry.
979 * delegate.cs, expression.cs: Update to changes.
981 2005-08-31 Martin Baulig <martin@ximian.com>
983 Committing a patch from Atsushi Enomoto for #75850.
985 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
986 Prefer a generic enumerator over a non-generic one.
988 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
990 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
991 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
993 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
995 * driver.cs : reverting default encoding change as well as mcs.
997 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
999 * driver.cs, support.cs : merged r48826.
1001 > could you integrate your mcs changes to gmcs otherwise
1002 > gmcs cannot compile some files.
1004 2005-08-20 Martin Baulig <martin@ximian.com>
1006 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1007 scope if we don't already have it.
1009 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1010 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1013 2005-07-31 Miguel de Icaza <miguel@novell.com>
1015 * statement.cs: Copy the local exception into the exception
1016 captured local. Fixes 75674
1018 2005-07-15 Marek Safar <marek.safar@seznam.cz>
1020 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1023 2005-08-12 Martin Baulig <martin@ximian.com>
1025 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
1026 for nested types here to avoid hitting the cache too early.
1028 2005-08-09 Miguel de Icaza <miguel@novell.com>
1030 * enum.cs: On the new compiler CLS error 3005 is now a warning not
1033 2005-08-03 Martin Baulig <martin@ximian.com>
1035 Make iterators in generic methods work; see gtest-191.cs.
1038 (Constraints.Resolve): Protect against being called twice.
1041 (TypeContainer.GetClassBases): Make this `protected virtual'.
1043 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
1044 (Iterator.GetClassBases): Override this and compute the base
1046 (Iterator.DefineNestedTypes): If we're a generic method, all our
1047 method type parameters become class type parameters on the proxy
1051 (ToplevelBlock.Parameters): Make this a property, not a field.
1052 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
1054 2005-08-03 Martin Baulig <martin@ximian.com>
1056 * typemanager.cs (TypeManager.IsSubclassOf): Use
1057 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
1058 (TypeManager.GetFullName_recursed): Improved.
1060 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1063 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
1064 Private accessor case, using TypeManager.IsPrivateAccessible instead of
1065 invocation_type == mi.DeclaringType, since the first one also checks
1066 other condition used by generic instances.
1068 2005-07-27 Martin Baulig <martin@ximian.com>
1070 * anonymous.cs (CaptureContext.AddField): Added
1071 `AnonymousContainer am' argument; compute its toplevel scope if
1072 it's not already computed. Fixes #75649.
1074 2005-07-14 Marek Safar <marek.safar@seznam.cz>
1076 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1077 CheckAttributeType and refactored.
1078 (Attribute.ResolvePossibleAttributeType): Changed to reuse
1079 ResolveAsTypeTerminal error handling.
1080 (ResolveAsTypeTerminal): Introduced because of global attributes extra
1082 (GetSignatureForError): Print errors in same way.
1085 * codegen.cs: Reflect attribute GetSignatureForError change.
1088 * expression.cs: Add silent parameter to ResolveAsTypeStep.
1090 * namespace.cs (UsingEntry): Refactored to make fields private.
1093 statement.cs: Error_UnexpectedKind has extra parameter.
1095 2005-07-14 Raja R Harinath <rharinath@novell.com>
1097 * ecore.cs (IAlias): Remove.
1098 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
1099 that implement the interface.
1100 * namespace.cs (Namespace): Likewise.
1101 (Namespace.declspaces): Renamed from 'defined_names'.
1102 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
1103 DeclSpace instead of an IAlias.
1104 * tree.cs (Tree.AddDecl): Update.
1106 2005-07-12 Raja R Harinath <rharinath@novell.com>
1108 * statement.cs (Block.Flags); Remove HasVarargs.
1109 (Block.HasVarargs): Move to ToplevelBlock.
1110 (Block.ThisVariable, Block.AddThisVariable): Likewise.
1111 (Block.Variables): Make protected. Initialize variable hashtable
1113 (Block.AddVariable): Update.
1114 (Block.Resolve): Update to changes.
1115 (ToplevelBlock.HasVarargs): New boolean.
1116 (ToplevelBlock.ThisVariable): Move here from Block.
1117 (ToplevelBlock.AddThisVariable): Likewise.
1118 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
1119 * expression.cs (This.ResolveBase): Update to changes.
1120 (ArglistAccess.DoResolve): Likewise.
1122 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1125 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1127 * class.cs (TypeContainer.VerifyMembers): Distinguish between
1128 not used and not used & assigned.
1129 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1131 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1134 * expression.cs (Is.DoResolve): null is never provided type.
1136 2005-07-08 Marek Safar <marek.safar@seznam.cz>
1139 * cs-parser.jay: Less strict event error rule to catch more errors.
1141 2005-07-11 Martin Baulig <martin@ximian.com>
1143 * generic.cs (ConstructedType.CheckConstraints): Improve the check
1144 for the constructor constraint: we do not only have to check
1145 whether the class has a public constructor, but also ensure that
1146 it's parameterless. Fixes #75492.
1148 2005-07-11 Martin Baulig <martin@ximian.com>
1150 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
1151 between type parameters if they either have the reference type
1152 constraint or the class constraint.
1154 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
1156 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
1158 2005-07-07 Marek Safar <marek.safar@seznam.cz>
1161 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1162 (ExtractSecurityPermissionSet): Cope with self referencing security
1163 attributes properly.
1165 * driver.cs (SetOutputFile): Made public property OutputFile.
1167 2005-07-07 Raja R Harinath <rharinath@novell.com>
1170 * class.cs (TypeContainer.first_nonstatic_field): Rename from
1171 has_nonstatic_fields. Make into a FieldBase pointer.
1172 (TypeContainer.AddField): Add CS0282 check.
1173 (TypeContainer.EmitType): Update.
1175 2005-07-06 Miguel de Icaza <miguel@novell.com>
1177 * cs-tokenizer.cs (consume_identifier): Do not create strings to
1178 compare if they start with __.
1180 2005-07-06 Raja R Harinath <rharinath@novell.com>
1182 * statement.cs (Switch.SwitchGoverningType): Only look at
1183 UserCasts that don't need implicit standard conversions to one of
1184 the allowed switch types (Fixes test-322.cs).
1185 (LocalInfo.Resolve): Re-enable sanity-test.
1187 2005-07-06 Marek Safar <marek.safar@seznam.cz>
1189 * cs-tokenizer.cs (consume_identifier): Detect double undescores
1191 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1193 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1195 2005-07-06 Raja R Harinath <rharinath@novell.com>
1198 * ecore.cs (SimpleName.GetSignatureForError): Add.
1199 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1200 (MemberAccess.GetSignatureForError): Add.
1202 2005-07-05 Marek Safar <marek.safar@seznam.cz>
1204 The big error and warning messages review.
1234 * typemanager.cs: Updated.
1236 * class.cs: (MethodCore.SetYields): Moved here to share.
1237 (PropertyMethod.Define): Moved iterator setup here.
1239 * iterators.cs: Add orig_method to have full access to parent
1242 2005-07-05 Raja R Harinath <rharinath@novell.com>
1244 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1245 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1246 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1247 variable of struct type.
1248 * expression.cs (Unary.ResolveOperator): Update to change.
1249 (Indirection.VerifyFixed): Likewise.
1250 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1251 (ParameterReference.VerifyFixed): Value parameters are fixed.
1252 (This.VerifyFixed): Treat 'this' as a value parameter.
1253 * statement.cs (LocalInfo.IsFixed): Remove.
1255 2005-07-01 Martin Baulig <martin@ximian.com>
1257 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1258 `ec.EmitThis ()' to get the correct scope.
1260 2005-07-01 Martin Baulig <martin@ximian.com>
1262 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1263 instance is a ParameterReference; fixes #75299.
1265 2005-06-30 Raja R Harinath <rharinath@novell.com>
1268 * expression.cs (Indexers.map): Remove.
1269 (Indexers.Append): Filter out inaccessible setters and getters.
1270 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1273 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
1275 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1276 (FieldExpr.Emit, PropertyExpr.Emit): Update.
1277 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1278 * expression.cs (Invocation.EmitCall): Add CS0120 check.
1280 2005-06-30 Marek Safar <marek.safar@seznam.cz>
1283 * class.cs (FieldBase.GetInitializerExpression): One more field
1286 2005-06-28 Miguel de Icaza <miguel@novell.com>
1288 * pending.cs: Do not define a proxy if the base method is virtual,
1289 it will be picked up by the runtime (bug 75270).
1291 2005-07-08 Martin Baulig <martin@ximian.com>
1293 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1294 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1296 2005-07-07 Martin Baulig <martin@ximian.com>
1298 * generic.cs (ConstructedType.CheckConstraint): Use
1299 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
1300 called recursively; fixes #75329.
1302 2005-07-06 Martin Baulig <martin@ximian.com>
1304 * generic.cs (TypeManager.InferTypeArguments): Added support for
1305 anonymous methods; fixes #75461.
1307 2005-07-01 Martin Baulig <martin@ximian.com>
1309 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1310 `ec.EmitThis ()' to get the correct scope.
1312 2005-07-01 Martin Baulig <martin@ximian.com>
1314 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
1315 instance is `This'; fixes #75299.
1317 2005-06-30 Martin Baulig <martin@ximian.com>
1319 * class.cs (Indexer): Implement IIteratorContainer; added support
1320 for iterators in indexers.
1323 (EmitContext.CurrentIterator): Make this a property, not a field.
1325 * anonymous.cs (AnonymousContainer.Iterator): New public property.
1327 2005-06-28 Miguel de Icaza <miguel@novell.com>
1329 * pending.cs: Do not define a proxy if the base method is virtual,
1330 it will be picked up by the runtime (bug 75270).
1332 2005-06-28 Martin Baulig <martin@ximian.com>
1334 * cs-parser.jay (interface_method_declaration): Avoid a
1335 reduce/reduce conflict by moving some of the code into a separate
1336 `interface_method_declaration_body' rule; fixes #75368.
1338 2005-06-28 Martin Baulig <martin@ximian.com>
1340 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
1341 array check after the check for TypeBuilder's.
1343 2005-06-21 Raja R Harinath <rharinath@novell.com>
1345 * convert.cs (FindMostEncompassedType): Add two trivial special
1346 cases (number_of_types == 0 || number_of_types == 1).
1347 (FindMostEncompasingType): Likewise.
1349 2005-06-17 Raja R Harinath <rharinath@novell.com>
1351 Some cleanups preparing for the fix of #75283.
1352 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1354 (EventExpr.InstanceResolve): Likewise.
1355 (EventExpr.DoResolve): Remove redundant checks.
1357 2005-06-08 Miguel de Icaza <miguel@novell.com>
1359 * class.cs: Small fix.
1361 2005-06-08 Raja R Harinath <rharinath@novell.com>
1364 * class.cs (GetPartialBases): Fix return value check of
1367 2005-06-07 Raja R Harinath <rharinath@novell.com>
1369 Ensure that partial classes are registered in their enclosing
1370 namespace. Initial part of fix of #75160.
1371 * tree.cs (Tree.RecordDecl): Add new namespace argument.
1372 Register declspace with namespace here, not in
1373 DeclSpace.RecordDecl.
1374 * cs-parser.jay: Pass namespace to RecordDecl.
1375 * class.cs (PartialContainer.Create): Likewise.
1376 (ClassPart.DefineType): New sanity-check. Throws an exception if
1378 * decl.cs (Declspace.RecordDecl): Remove.
1379 * namespace.cs (NamespaceEntry.DefineName): Remove.
1381 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1383 * rootcontext.cs: Reset TargetExt as well.
1385 2005-06-03 Raja R Harinath <rharinath@novell.com>
1387 * ecore.cs (Expression.Resolve): Emit CS0654 error when
1390 2005-06-02 Raja R Harinath <rharinath@novell.com>
1392 Fix #75080, cs0119.cs.
1393 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
1395 (Expression.Resolve): ... this. Use it. Remove bogus code
1396 allowing ExprClass.Type and ExprClass.Namespace for
1397 ResolveFlags.VariableOrValue.
1398 (Expression.Resolve) [1-argument variant]: Change default resolve
1399 flags based on language version.
1400 (Expression.Error_UnexpectedKind): Use a simple string array
1401 rather than an ArrayList.
1402 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1404 (TypeOfVoid.DoResolve): Likewise.
1405 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
1406 flags argument -- it always has the same value.
1408 2005-05-31 Raja R Harinath <rharinath@novell.com>
1411 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1412 Use it in the error message.
1413 * assign.cs, expression.cs, statement.cs: Update.
1415 2005-05-30 Raja R Harinath <rharinath@novell.com>
1418 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1419 the "almostMatchedMember" case too.
1420 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1421 that failed the accessibility checks to 'almost_match'.
1423 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
1425 * attribute.cs: Use internal MethodBuilder methods to set
1426 ExactSpelling and SetLastError on PInvoke methods, instead
1427 of passing them via charset. Fixes #75060.
1429 2005-05-27 Raja R Harinath <rharinath@novell.com>
1431 * parameter.cs (Parameter): Remove TODO comment.
1432 (Parameter.DefineParameter): Remove Location parameter.
1433 (Parameters.LabelParameters): Likewise.
1434 * class.cs (Constructor.Emit): Update to change.
1435 (MethodData.Emit): Likewise.
1436 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
1437 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1439 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
1442 Removed Parameters.Location and added Parameter.Location instead.
1443 Removed Location parameter from Emit() and GetSignature().
1450 Modified all related calls.
1452 2005-06-21 Martin Baulig <martin@ximian.com>
1454 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
1455 left-hand side is not a nullable type; fixes #75328.
1457 2005-06-21 Martin Baulig <martin@ximian.com>
1460 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
1461 (TypeManager.GetFullNameSignature): Likewise.
1463 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
1464 `source.FullName' and `target.FullName' to check whether there are
1465 two conflicting definitions.
1467 2005-06-21 Martin Baulig <martin@ximian.com>
1469 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
1470 a BoxedCast - also for reference types - to be compatible with csc.
1472 2005-06-21 Martin Baulig <martin@ximian.com>
1474 * expression.cs (MemberAccess.DoResolve): Add support for nested
1475 types in a generic instance; fixes #75320.
1477 2005-06-20 Martin Baulig <martin@ximian.com>
1479 * generic.cs (TypeManager.InferType): Also walk the class
1480 hierarchy for generic instances; fixes #75261.
1482 2005-06-17 Martin Baulig <martin@ximian.com>
1484 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
1485 to make things work for corlib.
1487 2005-06-15 Martin Baulig <martin@ximian.com>
1489 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
1490 obsolete `SecurityAction' values.
1492 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1494 * rootcontext.cs: Reset TargetExt as well.
1496 2005-06-09 Martin Baulig <martin@ximian.com>
1498 * delegate.cs (Delegate.VerifyMethod): Added
1499 `MethodGroupExpr old_mg' argument; inherit its
1500 `HasTypeParameters'; fix #75085.
1502 2005-06-09 Martin Baulig <martin@ximian.com>
1504 * expression.cs (Invocation.OverloadResolve): Correctly handle
1505 generic methods for the SetMemberIsUsed(); fix #75064.
1507 2005-06-09 Martin Baulig <martin@ximian.com>
1509 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
1512 2005-06-08 Martin Baulig <martin@ximian.com>
1514 * cs-parser.jay (nullable_type_or_conditional): If we put the
1515 nullable back and our `type' is a `ComposedCast', remove the
1516 nullable from it. Fixes #75156.
1518 * expression.cs (ComposedCast.RemoveNullable): New public method.
1520 2005-06-08 Martin Baulig <martin@ximian.com>
1522 The big Iterators rewrite :-)
1524 * iterators.cs: Rewrite this to use the anonymous methods framework.
1526 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1527 before the TypeContainers; see 2test-21.cs.
1530 (TypeContainer.DefineType): Don't create a new EmitContext if we
1531 already have one (this only happens if we're an Iterator).
1532 (TypeContainer.Define): Also call Define() on all our iterators.
1533 (Method.CreateEmitContext): Added support for iterators.
1536 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1537 (AnonymousContainer.CreateMethodHost): Moved here from
1538 AnonymousMethod and made abstract.
1539 (AnonymousContainer.CreateScopeType): New abstract method.
1540 (AnonymousContainer.IsIterator): New public property.
1541 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1542 get the ScopeTypeBuilder rather than manually defining it here.
1543 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1546 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1547 before RootContext.DefineTypes().
1549 * codegen.cs (EmitContext.RemapToProxy): Removed.
1550 (EmitContext.CurrentAnonymousMethod): Changed type from
1551 AnonymousMethod -> AnonymousContainer.
1552 (EmitContext.ResolveTopBlock): Protect from being called twice.
1553 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1554 (EmitContext.EmitThis): Removed the iterators hacks; use the
1555 anonymous methods framework for that.
1558 (ToplevelBlock.Container): Make this a property, not a field.
1559 (ToplevelBlock.ReParent): New public method; move the
1560 ToplevelBlock into a new container.
1561 (Foreach.TemporaryVariable): Simplify.
1563 2005-06-05 Martin Baulig <martin@ximian.com>
1565 * statement.cs (LocalInfo.CompilerGenerated): New flag.
1566 (Block.AddTemporaryVariable): New public method; creates a new
1567 `LocalInfo' for a temporary variable.
1568 (Block.EmitMeta): Create the LocalBuilders for all the temporary
1570 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1571 non-iterator variables.
1573 2005-06-05 Martin Baulig <martin@ximian.com>
1575 * statement.cs (Foreach.TemporaryVariable): Create the
1576 LocalBuilder in the Emit phase and not in Resolve since in some
1577 situations, we don't have an ILGenerator during Resolve; see
1578 2test-19.cs for an example.
1580 2005-06-04 Martin Baulig <martin@ximian.com>
1582 The big Foreach rewrite - Part II.
1584 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1585 with `PropertyInfo ienumerator_getcurrent'.
1587 * codegen.cs (VariableStorage): Removed.
1590 (Foreach): Derive from Statement, not ExceptionStatement.
1591 (Foreach.CollectionForeach): New nested class. Moved all the code
1592 dealing with collection foreach here.
1593 (Foreach.ForeachHelperMethods): Removed.
1594 (Foreach.TemporaryVariable): Implement IMemoryLocation.
1596 2005-05-23 Martin Baulig <martin@ximian.com>
1598 * statement.cs (Try.DoResolve): Don't create a `finally' if we
1599 don't need to. Fix #75014.
1601 2005-05-26 Raja R Harinath <rharinath@novell.com>
1603 Improve user-defined conversion handling.
1604 * convert.cs (GetConversionOperators): Rewrite. Return only the
1605 applicable operators.
1606 (AddConversionOperators): New. Helper for GetConversionOperators.
1607 (FindMostEncompassedType, FindMostEncompassingType): Verify that
1608 there is only one most encompassed/encompassing type.
1609 (FindMostSpecificSource, FindMostSpecificTarget): Remove
1610 "applicable operator" handling.
1611 (UserConversion): Move cache here from GetConversionOperators.
1612 Directly cache the chosen operator, rather than the whole
1614 (ExplicitNumericConversion): Fix buggy implementation of Decimal
1615 case. Allow conversion of decimal to sbyte and byte too.
1616 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1617 New static methods. Used to avoid allocating EmptyExpressions in
1620 2005-05-24 Duncan Mak <duncan@novell.com>
1622 * ecore.cs (CastFromDecimal): New class for casting a decimal to
1623 another class, used in Convert.ExplicitNumericConversion.
1624 (CastToDecimal): New class, similar to above, but casts to
1625 System.Decimal, used in Convert.ImplicitNumericConversion and also
1626 in explicit convesion from double/float to decimal.
1628 * convert.cs (ImplicitNumericConversion): Handle implicit
1629 conversions to System.Decimal.
1630 (ExplicitNumericConversion): handle explicit conversions to
1635 2005-05-20 Miguel de Icaza <miguel@novell.com>
1637 * typemanager.cs: Do not throw an exception in the TypeBuilder
1638 case, we take care of it on the TypeCode.
1640 2005-05-17 Marek Safar <marek.safar@seznam.cz>
1642 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1645 * cs-parser.jay: Catch more lexical errors.
1647 * report.cs: Add one more Error method.
1650 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1652 2005-05-20 Martin Baulig <martin@ximian.com>
1654 * class.cs (TypeContainer.CircularDepException): Removed.
1655 (TypeContainer.DefineType): Removed the `InTransit' stuff.
1656 (TypeContainer.CheckRecursiveDefinition): Check for circular class
1657 (CS0146) and interface (CS0529) dependencies here.
1659 2005-05-20 Martin Baulig <martin@ximian.com>
1661 * expression.cs (New.DoResolve): Move the CS0712 check above the
1662 CS0144 check; otherwise it can never be reached.
1664 2005-05-20 Martin Baulig <martin@ximian.com>
1666 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
1668 2005-05-20 Martin Baulig <martin@ximian.com>
1670 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
1672 * typemanager.cs (TypeManager.IsAttributeType): New public method.
1674 2005-05-19 Martin Baulig <martin@ximian.com>
1677 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1678 to disable error reporting.
1680 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1681 here since we don't want to report an error; see the new test-336.cs.
1683 2005-05-19 Raja R Harinath <rharinath@novell.com>
1685 * statement.cs (ToplevelBlock.GetParameterReference)
1686 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1687 Move here from class Block.
1688 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1689 * expression.cs (ParameterReference.DoResolveBase): Likewise.
1691 2005-05-18 Martin Baulig <martin@ximian.com>
1696 (FlowBranching.Reachability): Add non-static public And() and Or()
1698 (FlowBranchingSwitch): New class; do the `break_origins' thing
1699 like in FlowBranchingLoop.
1700 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1701 reachability, not just locals and parameters.
1702 (FlowBranching.MergeChild): Remove some of the hacks for loop and
1703 switch; MergeBreakOrigins() now takes care of that.
1705 2005-05-18 Martin Baulig <martin@ximian.com>
1707 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1708 a loop and may leave it, reset the barrier; fixes #74974.
1710 2005-05-16 Raja R Harinath <rharinath@novell.com>
1712 Fix test-382.cs. Emit values of decimal constants.
1713 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1715 (TypeContainer.AddField): ... this.
1716 (TypeContainer.EmitFieldInitializers): Allow the list of fields
1717 with initializers to include 'Const's.
1718 (ClassPart.RegisterFieldForInitialization): Forward to
1720 * const.cs (Const.Const): Pass initializer to base class.
1721 (Const.Define): In case of decimal constants, register them for
1722 initialization in a static constructor.
1724 2005-05-14 Martin Baulig <martin@ximian.com>
1726 * statement.cs (Block.Resolve): Correctly handle unreachable code;
1727 do not call ResolveUnreachable() on unreachable statements in
1728 here, see the comment in the source code.
1730 2005-05-13 Raja R Harinath <rharinath@novell.com>
1733 * expression.cs (BinaryResolveOperator): If one of the operands of
1734 an equality comparison is 'null' and the other is a pointer type,
1735 convert the null to a NullPointer.
1736 * convert.cs (ImplicitReferenceConversion): If the expression is a
1737 NullLiteral and the target type is a pointer type, return a
1738 NullPointer instead.
1739 (ImplicitConversionStandard): Likewise.
1741 2005-05-13 Marek Safar <marek.safar@seznam.cz>
1743 * cs-parser.jay: Set readonly context based on special constructs.
1745 * expression.cs (LocalVariableReference.DoResolveBase): Improved
1746 readonly variable error handling.
1748 * rootcontext.cs (EmitCode): Don't verify members when error
1751 * statement.cs (LocalInfo): Add reaodnly context information.
1752 (SetReadOnlyContext, GetReadOnlyContext): New methods.
1754 2005-05-17 Martin Baulig <martin@ximian.com>
1756 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1759 2005-05-13 Martin Baulig <martin@ximian.com>
1761 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
1762 handle unreachable blocks.
1764 2005-05-13 Martin Baulig <martin@ximian.com>
1767 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1768 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1771 2005-05-13 Martin Baulig <martin@ximian.com>
1773 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1774 instance variable, not a local. Fix #74873.
1775 (Block.ResolveUnreachable): Set it to true here.
1777 2005-05-12 Martin Baulig <martin@ximian.com>
1779 * cs-parser.jay (property_declaration): Pass the `current_class',
1780 not the `current_container' to Property's .ctor. Fixes #74912.
1782 2005-05-11 Martin Baulig <martin@ximian.com>
1784 * typemanager.cs (Closure): Copy this from MCS and merge all the
1785 GMCS-specific changes into it.
1787 2005-05-12 Raja R Harinath <harinath@gmail.com>
1790 * typemanager.cs (unmanaged_enclosing_types): New.
1791 (IsUnmanagedType): Avoid infloops by using
1792 'unmanaged_enclosing_types' to talk with recursive invocations.
1794 2005-05-11 Duncan Mak <duncan@novell.com>
1796 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1797 continuing to process for 'arg'.
1798 (handle_preprocessing_directive): Check the argument of the #endif
1799 directive and report error CS1025 if there are any trailing
1802 According to the C# spec, having even whitespace after the #endif
1803 directive is illegal; however, because we call arg.TrimEnd ()
1804 beforehand, we have the same behavior as csc, allowing whitespace
1805 after the directive.
1809 2005-05-11 Marek Safar <marek.safar@seznam.cz>
1813 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1814 (Constructor.GetObsoleteAttribute): Implemented correctly.
1816 2005-05-10 Martin Baulig <martin@ximian.com>
1818 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1819 resolve the type; fixes #74864.
1820 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1821 in DoResolve(); fixes #74862.
1823 2005-05-10 Martin Baulig <martin@ximian.com>
1825 * support.cs (ReflectionParameters.ParameterModifier): Use
1826 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1827 and `ParameterAttributes.In'. Fixes #74884.
1829 2005-05-10 Martin Baulig <martin@ximian.com>
1831 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1832 the cache if we're just looking for `MemberTypes.NestedType' in a
1835 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1836 constraints if we're still resolving the type tree.
1837 (Expression.MemberLookup): If we're resolving the type tree, only
1838 look for `MemberTypes.NestedType' since we're only interested in
1841 * class.cs (TypeContainer.DefineType): Don't resolve the type
1842 parameters here; do this later in ResolveType() after the type
1843 tree has been resolved.
1844 (TypeContainer.ResolveType): New public method; this is called
1845 after the type tree is resolved and before the types are being
1846 populated. We resolve the generic constraints here.
1847 (TypeContainer.DoDefineMember): Check the constraints on our base
1848 class and interfaces.
1850 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1851 set the `ResolvingTypeTree' flag on the EmitContext.
1853 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1855 2005-05-10 Marek Safar <marek.safar@seznam.cz>
1857 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1859 * expression.cs (Argument.GetParameterModifier): Turned to property.
1860 (Invocation.Error_InvalidArguments): Add more descriptive errors.
1862 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1865 2005-05-09 Raja R Harinath <rharinath@novell.com>
1868 * decl.cs (MemberCache.AddMethods): Register override methods,
1869 rather than non-override methods.
1870 * typemanager.cs (RegisterOverride): New.
1871 (IsOverride): Update.
1873 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1875 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1877 2005-05-06 Martin Baulig <martin@ximian.com>
1880 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1881 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1883 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1887 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1888 recursive declaration.
1890 * statement.cs (Block.ResolveMeta): Report any error in resolving.
1892 2005-05-06 Marek Safar <marek.safar@seznam.cz>
1894 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1896 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1898 2005-05-05 Raja R Harinath <rharinath@novell.com>
1901 * decl.cs (DeclSpace.FamilyAccessible):
1902 Use TypeManager.IsNestedFamilyAccessible.
1904 Fix reopened #64812.
1905 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1908 2005-05-04 Raja R Harinath <rharinath@novell.com>
1909 Abin Thomas <projectmonokochi@rediffmail.com>
1910 Anoob V E <projectmonokochi@rediffmail.com>
1911 Harilal P R <projectmonokochi@rediffmail.com>
1914 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1915 allow access to all static members.
1917 2005-05-04 Martin Baulig <martin@ximian.com>
1919 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1921 2005-05-04 Martin Baulig <martin@ximian.com>
1925 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1926 section at the end; make things work if `default' is not the last
1929 2005-05-04 Martin Baulig <martin@ximian.com>
1933 * statement.cs (Switch): Replaced the `got_default' field with a
1934 `default_section' one.
1935 (Switch.CheckSwitch): Set `default_section' here.
1936 (Switch.Resolve): If we're a constant switch and the constant is
1937 not found, use the default section.
1939 2005-05-03 Martin Baulig <martin@ximian.com>
1941 * expression.cs (ArrayAccess.EmitGetLength): New public method.
1943 * statement.cs (Foreach.ArrayForeach): New nested class.
1944 (Foreach.TemporaryVariable): New nested class.
1945 (Foreach.EmitArrayForeach): Removed; this is now in the new
1948 2005-05-03 Raja R Harinath <rharinath@novell.com>
1950 * pending.cs (BaseImplements): Move the #74773 fix here. This is
1952 (VerifyPendingMethods): Revert change below.
1954 * typemanager.cs (IsOverride, RegisterNonOverride): New.
1955 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1956 that used to trigger warning -28. Remove warning -28.
1957 * expression.cs (Invocation.OverloadResolve): Use
1958 TypeManager.IsOverride to distinguish override methods.
1961 * pending.cs (VerifyPendingMethods): If a base type implements the
1962 requested interface, don't bother checking individual methods of
1963 the base type. As a side-effect, this prevents the creation of
1964 unnecessary proxies.
1966 2005-05-02 Martin Baulig <martin@ximian.com>
1970 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1971 Also `And' the locals if the old vector is null.
1972 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1973 null; in this case we basically reset all the variables.
1975 2005-05-02 Martin Baulig <martin@ximian.com>
1979 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1980 Added `FlowBranching branching' argument; always `and' the
1981 variables instead of `or'ing them unless we're an infinite loop.
1983 * statement.cs (While.Resolve): Create a new sibling unless we're
1986 2005-05-02 Martin Baulig <martin@ximian.com>
1990 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1991 arguments; use it instead of creating a new TopLevelBlock.
1992 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1993 our ConstructorInitializer.
1996 (TopLevelBlock.TopLevelBranching): New public property.
1997 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1998 and create our `TopLevelBranching'.
2000 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2001 anonymous method host, use `block.TopLevelBranching' rather than
2002 creating a new branching.
2004 2005-04-20 Miguel de Icaza <miguel@novell.com>
2006 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2007 a ScopeInfo, if any of the current children is a child of the new
2008 entry, move those children there.
2010 2005-04-30 Martin Baulig <martin@ximian.com>
2012 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2013 at the beginning of a SwitchSection. Fix #73335.
2015 2005-04-27 Marek Safar <marek.safar@seznam.cz>
2018 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2020 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2021 (FieldExpr.DoResolve): Obsolete members are ignored for field
2024 2005-04-26 Marek Safar <marek.safar@seznam.cz>
2026 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2027 of arrays detection.
2029 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2031 (Field.VerifyClsCompliance): Volatile fields are not compliant.
2033 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2036 2005-04-25 Ben Maurer <bmaurer@ximian.com>
2038 * cs-parser.jay: Use the prefered version of -unsafe in error
2041 2005-04-22 Marek Safar <marek.safar@seznam.cz>
2043 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2046 2005-04-20 John Luke <john.luke@gmail.com>
2048 * driver.cs: fix typo in error message, --outout to --output
2050 2005-04-30 Martin Baulig <martin@ximian.com>
2052 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
2053 handle the .NET 2.x security attributes.
2055 2005-04-30 Martin Baulig <martin@ximian.com>
2058 (TypeManager.ExpandInterfaces): Don't add things twice.
2061 (TypeContainer.VerifyClsCompliance): Allow generic instances.
2063 2005-04-29 Martin Baulig <martin@ximian.com>
2065 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
2067 * anonymous.cs: Added support for anonymous generic methods.
2069 2005-04-29 Martin Baulig <martin@ximian.com>
2071 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
2074 2005-04-29 Martin Baulig <martin@ximian.com>
2076 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
2078 * expression.cs (New.DoResolve): Fix the CS0304 check.
2080 2005-04-29 Martin Baulig <martin@ximian.com>
2082 * typemanager.cs (TypeManager.GetFullName): Updated to the new
2085 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
2086 explicit interface implementation, compare the interface types.
2087 (MethodData.Define): Use the new naming scheme from the latest
2089 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
2091 * decl.cs (MemberName.GetMemberName): Removed.
2092 (MemberName.MethodName, FullName): New properties.
2094 2005-04-25 Raja R Harinath <rharinath@novell.com>
2096 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
2098 2005-04-22 Martin Baulig <martin@ximian.com>
2100 * generic.cs (GenericMethod): Create the EmitContext in the
2101 `Define()'; in `Define(MethodBuilder)', create the type parameters
2102 before calling `Define()'. Fixes #73933.
2104 2005-04-22 Martin Baulig <martin@ximian.com>
2107 (Constraints.Resolve): Make things work wrt. the new type lookup system.
2108 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
2110 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
2111 ConstructedType, check its constraints.
2113 2005-04-20 Marek Safar <marek.safar@seznam.cz>
2115 * codegen.cs (InRefOutArgumentResolving): New field.
2117 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2118 fields outside contructor.
2120 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2122 2005-04-19 Miguel de Icaza <miguel@novell.com>
2124 * anonymous.cs (CaptureContext.EmitParameterInstance): The
2125 parameter code was not completed ever, so it was not as up-to-date
2126 as local variables. Must finish it.
2128 The bug fix was to compare the Toplevel of the block, not the
2129 current block. Thanks for Ben for pointing this out.
2131 2005-04-19 Raja R Harinath <rharinath@novell.com>
2133 * decl.cs (AddMethods): Use the declaring type of the problem
2134 method to determine if we want to squash a warning.
2136 2005-04-19 Marek Safar <marek.safar@seznam.cz>
2138 * attribute.cs: Removed debug output.
2140 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2142 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2145 2005-04-18 Raja R Harinath <rharinath@novell.com>
2148 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2149 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2150 all null comparisons against reference types.
2152 2005-04-18 Marek Safar <marek.safar@seznam.cz>
2155 * class.cs (TypeContainer.CircularDepException) New nested
2157 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2158 (TypeContainer.DefineType): Removed error, reset InTransit before
2160 (Class.DefineType): Throw exception when is in Transit.
2161 Catch exception and report error.
2162 (Struct.DefineType): Throw exception when is in Transit.
2163 Catch exception and report error.
2164 (Interface.DefineType): Throw exception when is in Transit.
2165 Catch exception and report error.
2167 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2168 handle nested exception handlers.
2170 * flowanalysis.cs (InTryWithCatch): New method, search for try with
2173 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2174 InFinally and InCatch storage.
2176 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2177 (Catch.Resolve): Set and Restore ec.InCatch.
2178 (Try.Resolve): Set and Restore ec.InFinally.
2179 (Try.HasCatch): True when try has catch.
2181 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
2183 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2184 for the same event member, so exclude such cases from warning 419.
2187 2005-04-16 Miguel de Icaza <miguel@novell.com>
2189 * expression.cs (Binary.ResolveOperator): Apply patch from John
2190 Luke to fix bug 59864: operators &, | and ^ on enumerations
2191 require that the same enum type on both sides.
2193 * driver.cs: Add warnings to old flag usage, this is to assist
2194 people who produce Makefiles and hope that the Makefiles will be
2197 * class.cs (TypeContainer.EmitType): Moved the definition of the
2198 special $PRIVATE$ field from the resolve phase to the Emit phase.
2199 During resolve we do not know if we are a struct with
2200 HasExplicitLayout, we know this only after the attributes for the
2203 Set the FieldOffset to zero on the dummy field that we create for
2204 the class. Fixes 74590.
2206 2005-04-16 Raja R Harinath <rharinath@novell.com>
2209 * ecore.cs (PropertyExpr.resolved): New.
2210 (DoResolve): Use it to handle a case of double resolution here.
2211 Handle a case of identical-name-and-type-name.
2212 * expression.cs (ArrayCreation.CheckIndices): Avoid double
2213 resolution by storing the results of expression resolution back
2214 into the "probes" array.
2216 2005-04-15 Raja R Harinath <rharinath@novell.com>
2218 Fix cs0208-7.cs and cs0208-8.cs.
2219 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2220 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
2221 error reporting to point out the reason a struct is not unmanaged.
2223 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2225 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
2226 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2228 2005-04-13 Raja R Harinath <rharinath@novell.com>
2231 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2232 IdenticalNameAndTypeName here.
2233 (EventExpr.InstanceResolve): Likewise.
2235 2005-04-13 Marek Safar <marek.safar@seznam.cz>
2237 C# 2.0 DefaultCharSetAttribute implementation
2239 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2240 which allows us to set GlobalNamespace for every resolve.
2241 (Attribute.ResolveArguments): Cut from Resolve.
2242 (Attribute.GetCharSetValue): Returns CharSet named argument.
2243 (Attribute.DefinePInvokeMethod): Gets default charset from
2245 (GlobalAttribute.ResolveAsTypeStep): Override.
2246 (GlobalAttribute.ResolveArguments): Override.
2248 * class.cs (TypeAttr): Is protected.
2250 * codegen.cs (ModuleClass.DefaultCharSet): New member.
2251 (ModuleClass.DefaultCharSetType): New memeber.
2252 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2254 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2255 charset from module.
2257 * delegate.cs (TypeAttr): Override.
2258 (Delegate.DefineType): Use this TypeAttr.
2260 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2261 at very early stage (before types are defined) to resolve model
2262 module attributes. It will probably not work with corlib but it
2265 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2266 charset from module.
2268 * typemanager.cs (default_charset_type): New type.
2270 2005-04-13 Raja R Harinath <rharinath@novell.com>
2272 * decl.cs (MemberCache.AddMethods): Don't warn if
2273 System.Object.Finalize has buggy MethodAttributes.
2275 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2278 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2280 * doc.cs : detect ambiguous reference to overloaded members.
2281 Fixed bug #71603. MS 1.1 csc does not detect it.
2283 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2285 * doc.cs : delegates must not be referenced with parameters.
2288 2005-04-12 Miguel de Icaza <miguel@novell.com>
2290 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2292 2005-04-10 Miguel de Icaza <miguel@novell.com>
2294 * driver.cs (MainDriver): Stop processing if the CLS stage found
2297 (CompilerCallableEntryPoint.InvokeCompiler): Always
2298 reset after execution; Take a TextWriter argument for the
2301 * report.cs: Use the error stream instead of hardcoding stderr.
2303 2005-04-09 Miguel de Icaza <miguel@novell.com>
2305 * class.cs: Reduce code paths to test, too small of an
2306 optimization to make it worth the extra testing. Always perform
2309 2005-04-08 Raja R Harinath <rharinath@novell.com>
2312 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2313 operators that had errors reported on them.
2315 2005-04-08 Marek Safar <marek.safar@seznam.cz>
2317 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2319 (Attribute.Resolve): Add named argument type checking.
2321 * class.cs (FixedField.Define): Use IsPrimitiveType
2323 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2325 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2326 unsafe parameter types.
2328 * statement.cs (Using.ResolveExpression): Add better error description.
2330 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2332 2005-04-08 Raja R Harinath <rharinath@novell.com>
2335 * attribute.cs (Attribute.GetAttributeUsage): Resolve
2336 AttributeUsageAttribute in the emitcontext of the attribute class,
2337 not in the emitcontext of the attributable entity it was attached to.
2338 * cs-parser.jay: Use 'current_class', not 'current_container',
2339 when creating a GlobalAttribute.
2341 2005-04-08 Alp Toker <alp@atoker.com>
2343 * pending.cs: The fix to #58413 failed to compile methods implementing
2344 interfaces with/without params modifiers and vice versa, even though
2345 params modifiers aren't part of the signature. Make the modifier check
2346 less strict as in csc.
2348 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
2349 Anoob V E <projectmonokochi@rediffmail.com>
2350 Harilal P R <projectmonokochi@rediffmail.com>
2353 * pending.cs (TypeAndMethods.mods): New. Store the parameter
2354 modifiers of pending methods.
2355 (PendingImplementation.PendingImplementation): Initialize it.
2356 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2357 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2358 with ParameterData. Add check for modifiers.
2359 * class.cs (MethodData.Define): Update to changes.
2361 2005-04-07 Raja R Harinath <rharinath@novell.com>
2363 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2365 2005-04-07 Marek Safar <marek.safar@seznam.cz>
2367 * class.cs (PropertyMethod.Define): Check private accessor in abstract
2370 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2373 * typemanager.cs: Registered RequiredAttributeAttribute.
2375 2005-04-06 Marek Safar <marek.safar@seznam.cz>
2377 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2378 Warning CS0169 is back at level 3.
2379 (IMethodData.SetMemberIsUsed): New method.
2381 * decl.cs (IsUsed): New value; moved from FieldBase.Status
2382 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2384 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2386 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2388 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2391 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2394 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2395 to avoid the problems with nested types.
2397 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
2398 Anoob V.E <projectmonokochi@rediffmail.com>
2399 Harilal P.R <projectmonokochi@rediffmail.com>
2400 Raja R Harinath <rharinath@novell.com>
2403 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2405 * typemanager (GetConstructor): Make public.
2407 2005-04-05 John Luke <john.luke@gmail.com>
2408 Raja R Harinath <rharinath@novell.com>
2411 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2412 struct too. Return false quicker in a few cases.
2413 (VerifyUnManaged): Use it.
2415 2005-04-05 Raja R Harinath <rharinath@novell.com>
2418 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2419 not 'unreachable_seen'.
2421 2005-04-04 Marek Safar <marek.safar@seznam.cz>
2423 * attribute.cs (Attribute.GetValue): Removed unused.
2425 * codegen.cs (CodeGen.TrimExt): Removed unused.
2427 * cs-parser.jay (output): Removed unused.
2429 * cs-tokenizer.cs (hex_digits): Removed unused.
2431 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2433 * expression.cs (Indirection.LoadExprValue): Removed unused.
2434 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2436 * iterators.cs (Iterator.param_types): Removed unused.
2438 * statement.cs (Goto.block): Removed unused.
2439 (ToplevelBlock.did): Removed unused.
2440 (Switch.ResolveConstantSwitch): Removed unused.
2442 2005-04-01 Ben Maurer <bmaurer@ximian.com>
2444 * rootcontext.cs: Allow mcs to bootstrap with the compilation
2447 2005-04-19 Martin Baulig <martin@ximian.com>
2449 Merged r42462 from MCS and made it work for GMCS.
2451 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
2453 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
2455 2005-04-01 Raja R Harinath <rharinath@novell.com>
2457 Fix #74232 and cs0208-3.cs.
2458 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2459 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2460 unmanaged type. Don't use FieldBuilders when 't' is a
2461 TypeBuilder. Use ModFlags and MemberType fields.
2462 * class.cs (MemberBase.member_type): Rename from MemberType.
2463 (MemberBase.MemberType): New property. Determines member_type on
2465 (MemberBase.DoDefine): Don't initialize MemberType here.
2466 (FieldMember.Define): Likewise.
2468 2005-04-01 Marek Safar <marek.safar@seznam.cz>
2471 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2472 Attributes are emitted there.
2474 2005-04-01 Raja R Harinath <rharinath@novell.com>
2476 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2477 keyword in 'partial enum' too.
2478 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2480 Report from Kamil Skalski <nazgul@omega.pl>.
2483 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2484 have partial containers too.
2486 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2487 in block' checks to Block.CheckInvariantMeaningInBlock.
2488 * statement.cs (Block.GetKnownVariableInfo): Make private.
2489 (Block.IsVariableUsedInChildBlock): Remove.
2490 (Block.IsVariableUsedInBlock): Likewise.
2491 (Block.CheckInvariantMeaningInBlock): New. Show location of
2492 conflicting declaration.
2493 (Block.AddVariable): Make error messages less long-winded and more
2494 specific. Show location of conflicting declaration.
2495 * parameter.cs (Parameters.Location): New readonly property.
2497 2005-03-31 Raja R Harinath <rharinath@novell.com>
2499 Clean up semantics of invoking ResolveMemberAccess.
2500 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2501 can have an instance, ensure that we pass in a non-TypeExpression
2502 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
2503 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2504 argument. Update to changes and simplify.
2505 (FieldExpr.Emitinstance): Remove CS0120 check.
2506 (PropertyExpr.EmitInstance): Likewise.
2507 * expression.cs (Argument.Resolve): Likewise.
2508 (Invocation.DoResolve): Update to changes in semantics of
2511 2005-03-31 Marek Safar <marek.safar@seznam.cz>
2514 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2517 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2519 2005-03-31 Raja R Harinath <rharinath@novell.com>
2521 Fix difference in behaviour with commandline invocation.
2522 * driver.cs (Driver.Reset): New.
2523 (CompilerCallableEntryPoint): Call it.
2525 * statement.cs (If.Resolve): Avoid spurious "uninitialized
2526 variable" warnings if the boolean expression failed to resolve.
2528 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
2530 * attribute.cs: Fix the union of several permissions when some of them
2531 are unrestricted (so the result isn't an unrestricted permission set).
2534 2005-03-30 Raja R Harinath <rharinath@novell.com>
2536 * ecore.cs (MemberExpr): New class. Convert from interface
2538 (MemberExpr.ResolveMemberAccess): Refactor and move here from
2539 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
2541 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2542 (MethodGroupExpr.IsExplicitImpl): Remove.
2543 (Expression.GetFieldFromEvent): Remove.
2544 (SimpleName.MemberStaticCheck): Remove.
2545 (SimpleName.DoSimpleNameResolve): Update to changes.
2546 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2547 (MemberAccess.IdenticalNameAndTypeName): Remove.
2548 (MemberAccess.error176): Move to MemberExpr.
2549 (MemberAccess.DoResolve): Update to changes.
2550 (BaseAccess.DoResolve): Likewise.
2552 2005-03-30 Marek Safar <marek.safar@seznam.cz>
2554 C# 2.0 Conditional attribute class implementation
2556 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2557 Analyzes class whether it has attribute which has ConditionalAttribute
2558 and its condition is not defined.
2560 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2561 (Class.IsExcluded): New method. Search for at least one defined
2562 condition in ConditionalAttribute of attribute class.
2564 2005-03-30 Raja R Harinath <rharinath@novell.com>
2566 * ecore.cs (PropertyExpr): Derive from Expression, not
2567 ExpressionStatement.
2568 (PropertyExpr.EmitStatement): Remove.
2570 2005-03-29 Raja R Harinath <rharinath@novell.com>
2573 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2574 internal field "value__" of an enum be private. The examples for
2575 "value__" that I found on MSDN all used FieldAttributes.Private.
2577 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2578 Don't mention IL method attribute names.
2580 Fix #47991. Remove a TODO.
2581 * statement.cs (Block.Toplevel): Make into a field.
2582 (Block.Parameters): Move into ToplevelBlock.
2583 (Block.known_variables): Rename from child_variable_names.
2584 (Block.Block): Remove variants that take Parameters. Initialize
2585 'Toplevel' with the immediately surrounding toplevel block.
2586 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
2587 LocalInfo parameter.
2588 (Block.GetKnownVariableInfo): New.
2589 (Block.IsVariableNameUsedInChildBlock): Update.
2590 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
2591 the block, even though it may not be in scope.
2592 (Block.AddVariable): Remove Parameters parameter. Use
2593 Toplevel.Parameters instead.
2594 (Block.AddConstant): Remove Parameters parameter.
2595 (Block.GetParameterReference): Update to use Toplevel.Parameters.
2596 (Block.IsParamaterReference): Likewise.
2597 (Block.IsLocalParameter): Likewise. Simplify a lot.
2598 (ToplevelBlock.Parameters): New. Moved from Block.
2599 (ToplevelBlock.ToplevelBlock): Update to changes. Always
2600 initialize Parameters to a non-null value.
2601 * cs-parser.jay: Update to changes.
2602 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2603 simple names that mean different things in the same block. Use
2604 Block.IsVariableNameUsedInBlock.
2606 2005-03-28 Raja R Harinath <rharinath@novell.com>
2608 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2610 2005-03-26 Raja R Harinath <harinath@acm.org>
2613 * assign.cs (Assign.DoResolve): When the RHS of an assignment
2614 fails to resolve, ensure that the LHS is still resolved as an
2617 2005-03-25 Raja R Harinath <harinath@acm.org>
2619 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2621 (Enum.current_ec): Remove.
2622 (Enum.LookupEnumValue): Remove EmitContext argument.
2623 Just uses the one created during DefineType.
2624 (Enum.FindMembers): Update.
2625 * expression.cs (MemberAccess.DoResolve): Update.
2627 2005-03-22 Marek Safar <marek.safar@seznam.cz>
2629 * assign.cs (Assign.DoResolve): Check for CS1717 when
2630 source and target are same (uses Equals).
2632 * expression.cs (LocalVariableReference, ParameterReference,
2633 This): Implemented Equals, GetHashCode.
2635 * statement.cs (Block.GetParameterReference): Removed useless
2638 2005-03-22 Raja R Harinath <rharinath@novell.com>
2641 * statement.cs (Block.AddVariable): Ensure that we skip implicit
2642 blocks before deciding whether the error is cs0136 or cs0128.
2644 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2645 (using_alias_directive, using_namespace_directive): Pass
2646 MemberName, not an expression to Namespace.UsingAlias and
2648 (MakeName): Use the MemberName of the namespace.
2649 * namespace.cs (Namespace.MemberName): New.
2650 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2651 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2653 * decl.cs (MemberName.Name): Make readonly.
2654 (MemberName.FromDotted): New "constructor".
2655 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2656 (MemberCore.Name): Compute from MemberName on demand.
2657 (MemberCore.SetMemberName): Provide a way to change the
2659 (MemberCore.AddToContainer): Don't take a fullname parameter.
2660 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2661 fully qualified name of the container to the member name.
2662 (TypeContainer.AddToTypeContainer): Use a fully qualified name
2663 only if the type is a member of the root container.
2664 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2665 MemberName.Left rather than searching for an embedded ".".
2666 (PartialContainer.CreatePart): Update to changes in RootContext.
2667 (MemberBase.ShortName): Turn into a property. Use
2668 MemberCore.SetMemberName.
2669 (MemberBase.ExplicitInterfaceName): Remove.
2670 (MemberBase.UpdateMemberName): Remove.
2671 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2672 (PropertyBase.SetMemberName): New override.
2673 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2674 (Tree.GetDecl): New.
2675 (Tree.AllDecls): Rename from Decls.
2676 * attribute.cs, enum.cs, report.cs: Update to changes.
2677 * driver.cs (MainDriver): Use MemberName.FromDotted on
2678 RootContext.MainClass.
2680 2005-03-21 Marek Safar <marek.safar@seznam.cz>
2682 * class.cs (FixedField.Define): Check for CS1664 and more sanity
2685 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2687 2005-03-18 Marek Safar <marek.safar@seznam.cz>
2689 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2690 property accessor modifiers.
2692 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2693 fixed buffer attribute (CS1716).
2694 (PropertyMethod.HasCustomAccessModifier): When property accessor
2695 has custom modifier.
2697 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2699 (PropertyExpr.DoResolveLValue): Add CS0272.
2701 2005-03-17 Miguel de Icaza <miguel@novell.com>
2703 * convert.cs: When converting to a pointer, use the proper Conv.U
2704 or Conv.I depending on the source data type.
2706 * cs-tokenizer.cs: Make the size for large decimal constants,
2709 2005-03-17 Martin Baulig <martin@ximian.com>
2711 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2712 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
2714 2005-03-17 Martin Baulig <martin@ximian.com>
2716 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2717 to bool so we can return an error condition.
2718 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2721 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
2723 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2726 2005-03-16 Raja R Harinath <rharinath@novell.com>
2728 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2729 Refactor to avoid traversing the list of assemblies, and to avoid
2730 string concatenation.
2731 * typemanager.cs (guid_attr_type): Remove.
2732 (negative_hits, pointers, references): Remove hashes.
2734 (GetConstructedType): New. Uses type_hash to handle constructed
2735 types (arrays, references, pointers).
2736 (GetReferenceType, GetPointerType): Use it.
2737 (GetNestedType): New. Uses type_hash to handle nested types of
2739 (LookupType, LookupTypeDirect): Remove.
2740 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
2741 'types' hash and LookupTypeReflection directly.
2742 (params_string, params_object): Use GetConstructedType.
2743 * namespace.cs (Namespace.cached_types): New. Cache of reflected
2745 (Namespace.Lookup): Use cached_types.
2746 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2747 provided by old TypeManager.LookupType.
2748 * rootcontext.cs (MakeFQN): Remove.
2749 * decl.cs (DeclSpace.MakeFQN): Likewise.
2750 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2751 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2752 TypeManager.GetConstructedType.
2753 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2755 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
2757 * cs-parser.jay: Fix build.
2759 2005-03-15 Marek Safar <marek.safar@seznam.cz>
2761 * class.cs (TypeContainer.CircularDepException) New nested
2762 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
2764 * cs-parser.jay: Reports CS1527 for any namespace element.
2766 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2769 * expression.cs (ParameterReference.IsAssigned): Changed error to
2771 (Error_WrongNumArguments): Moved CS0245 detection here.
2773 * statement.cs (Return.Resolve): Add CS1622 report.
2775 2005-03-11 Marek Safar <marek.safar@seznam.cz>
2777 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2779 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
2781 * attribute.cs expression.cs: Get rid of some allocations.
2783 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
2785 * doc.cs : just eliminate the latest change.
2787 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2789 * doc.cs : commented out the latest change. It breaks xml-030.cs
2791 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2793 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2794 fail. So invoke CreateType() in FindDocumentedType().
2796 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2798 * cs-tokenizer.cs : added IsKeyword().
2799 * doc.cs : Detect keyword incorrectly used as identifier.
2800 Allow identifiers prefixed by @.
2802 2005-03-10 Marek Safar <marek.safar@seznam.cz>
2804 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2805 It caused exception in namespace resolving (again!).
2807 * class.cs (Class.ctor): Removed exit.
2808 (PropertyMethod.ctor): ditto.
2810 * codegen.cs (Codegen.Reset): Reset static data.
2811 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2813 * cs-tokenizer.cs (Cleanup): Removed.
2815 * driver.cs (GetSystemDir): Rewrote to one line command.
2816 It caused problem with unloaded dynamic modules.
2817 (UnixParseOption): Removed Exit.
2818 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2819 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2820 Now can be mcs used as library.
2822 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2825 * location.cs (Reset): Reset static data.
2827 * namespace.cs (Reset): Reset static data.
2829 * report.cs (Report.Reset): Reset static data.
2831 * rootcontext.cs (RootContext.Reset): Reset static data.
2833 * tree.cs (RootTypes.ctor): Use Location.Null
2835 * typemanager.cs (TypeManager.Reset): Reset static data.
2836 (CoreLookupType): Removed Exit.
2837 (TypeHandle.Reset): Reset static data.
2839 2005-03-10 Raja R Harinath <rharinath@novell.com>
2842 * typemanager.cs (ComputeNamespaces): Import namespaces from
2843 referenced modules too.
2845 2005-03-09 Raja R Harinath <rharinath@novell.com>
2847 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2850 2005-03-09 Raja R Harinath <rharinath@novell.com>
2852 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2853 enclosing DeclSpace. This ensures that a name-lookup populates
2854 more caches and there are fewer 'TypeExpression's. Carve out
2855 nested type lookup into ...
2856 (LookupNestedTypeInHierarchy): ... this.
2858 2005-04-15 Martin Baulig <martin@ximian.com>
2860 Merged r41590 from MCS and make it work in the generics land.
2862 * generic.cs (TypeParameter.UpdateConstraints): Removed the
2865 * class.cs (PartialContainer.UpdateConstraints): Removed.
2866 (PartialContainer.CheckConstraints): Removed.
2867 (PartialContainer.SetParameterInfo): Store the constraints here.
2868 (PartialContainer.DefineTypeParameters): New public method;
2869 resolve the type parameter's constraints here. Note that the
2870 PartialContainer doesn't have an EmitContext anymore, so we must
2871 do this in the ClassPart.
2873 2005-03-09 Raja R Harinath <rharinath@novell.com>
2875 Clean up a few partial-class semantics.
2876 Fixes test-357.cs and cs1618-2.cs.
2877 * cs-parser.jay (struct_declaration): Use 'current_class' as
2878 parent of newly-created struct. Remove call to Register ().
2879 Use 'pop_current_class' to complete handing the current struct.
2880 (interface_declaration): Likewise.
2881 (class_declaration): Likewise.
2882 (enum_declaration): Use 'current_class' as parent of newly created
2884 (delegate_declaration): Likewise.
2885 (pop_current_class): New function. This is used to handle closing
2886 up the 'current_class' and 'current_container', and pointing them
2887 to the enclosing class/container.
2888 (CSharpParser): Initialize 'current_class' too.
2889 * decl.cs (MemberCore): Add check for invariant: a partial
2890 container is not a parsed entity, and thus does not enclose any
2892 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2893 (DeclSpace.BaseTypeExpr): Use it.
2894 (DeclSpace.LookupType): Add check for invariant.
2895 * class.cs (TypeContainer): Add check for invariant: a nested
2896 class should have the same NamespaceEntry as its enclosing class.
2897 (TypeContainer.EmitFieldInitializers): Make virtual.
2898 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2900 (TypeContainer.Register): Remove.
2901 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2902 null. Use TypeResolveEmitContext for resolving base types and
2903 interfaces. Move initialization of Parts.TypeBuilder here from
2905 (TypeContainer.DefineNestedTypes): ... here.
2906 (PartialContainer): Take a Namespace not a NamespaceEntry.
2907 (PartialContainer.Create): Don't use Register. Call the
2908 appropriate Add... function directly.
2909 (ClassPart): Take both the PartialContainer and the enclosing
2910 class as constructor arguments.
2911 (ClassPart.EmitFieldInitializers): Override.
2912 (ClassPart.PartFindNestedTypes): Remove.
2913 (FieldBase.GetInitializerExpression): Resolve the initializer
2914 expression in the emit context of the enclosing class.
2915 * tree.cs (RootTypes): Remove Register ().
2917 2005-03-08 Marek Safar <marek.safar@seznam.cz>
2919 * cs-parser.jay: Removed CS0134.
2921 * driver.cs: Removed CS1901.
2923 * expression.cs (SizeOf.DoResolve): Don't report CS0233
2924 for predefined types.
2926 2005-03-07 Duncan Mak <duncan@novell.com>
2928 * codegen.cs (Save): Catch UnauthorizedAccessException as
2929 well. Fixes bug #73454.
2931 2005-03-07 Marek Safar <marek.safar@seznam.cz>
2933 * cs-tokenizer.cs (xtoken): Add CS1035.
2935 * class.cs (MethodData.Define): Add CS0683.
2936 (FieldMember.ctor): Add CS0681.
2938 2005-03-07 Raja R Harinath <rharinath@novell.com>
2940 * ecore.cs (SimpleName.DoResolve): Rename from
2941 SimpleName.DoResolveAllowStatic.
2942 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2943 Pass 'intermediate' flag to MemberStaticCheck.
2944 (SimpleName.MemberStaticCheck): Skip "static check" only in case
2945 of "intermediate" lookups via MemberAccess.
2946 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
2947 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2949 2005-03-07 Raja R Harinath <rharinath@novell.com>
2952 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2953 slipped in because of variable names that are identical to a
2954 builtin type's BCL equivalent ('string String;', 'int Int32;').
2955 (PropertyExpr.EmitInstance): Likewise.
2957 2005-03-04 Marek Safar <marek.safar@seznam.cz>
2959 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2961 * report.cs (warning_ignore_table): Made public.
2963 2005-03-04 Raja R Harinath <rharinath@novell.com>
2966 * class.cs (MethodData.Emit): Pass 'container' to
2967 container.GetObsoleteAttribute instead of 'container.Parent'.
2969 2005-03-03 Marek Safar <marek.safar@seznam.cz>
2971 * cs-parser.jay: Add 1534 error test.
2973 * iterators.cs (Yield.CheckContext): Add error 1629.
2974 (Iterator.ctor): Save unsafe modifier.
2975 (MoveNextMethod.DoEmit): Restore unsafe context.
2977 * namespace.cs (UsingAlias): Better error message.
2979 2005-03-03 Dan Winship <danw@novell.com>
2981 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2982 the warning message [#73219]
2984 2005-03-03 Raja R Harinath <rharinath@novell.com>
2986 Fix compile with MCS 1.0.0.0.
2987 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2988 w_restore to not depend on string constant folding.
2990 2005-03-03 Raja R Harinath <rharinath@novell.com>
2992 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
2993 CS0246 check to users who passed 'silent = false'.
2994 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2996 (SimpleName.SimpleNameResolve): Update.
2997 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2998 (MemberAccess.IdenticalNameAndTypeName): Update.
2999 * doc.cs (FindDocumentedTypeNonArray): Update.
3001 2005-03-03 Raja R Harinath <rharinath@novell.com>
3003 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3004 * parameters.cs (ComputeAndDefineParameters): Remove.
3005 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3006 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3007 Use GetParameterInfo.
3009 2005-03-02 Marek Safar <marek.safar@seznam.cz>
3011 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3013 2005-03-02 Raja R Harinath <rharinath@novell.com>
3015 Unify DeclSpace.LookupType and DeclSpace.FindType.
3016 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
3017 is in charge of defining nested types on demand.
3018 (DeclSpace.LookupType): Use it when the current_type is a
3019 TypeBuilder. Use LookupTypeDirect for reflected types.
3020 (DeclSpace.FindType): Remove.
3021 (DeclSpace.LookupInterfaceOrClass): Likewise.
3022 (DeclSpace.DefineTypeAndParents): Likewise.
3023 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3024 DeclSpace.LookupType.
3025 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3026 * typemanager.cs (LookupType): Simplify.
3027 (AddUserType): Remove type from negative_hits.
3028 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3029 * class.cs (TypeContainer.FindMembers): Move handling of nested
3031 (TypeContainer.FindMembers_NestedTypes): ... here.
3032 (TypeContainer.FindNestedType): Implement override.
3033 (ClassPart.FindNestedType): Delegate to PartialContainer.
3034 (ClassPart.PartFindNestedType): Looks up the nested types of the
3037 2005-04-14 Martin Baulig <martin@ximian.com>
3039 * generic.cs (ConstructedType): Moved all the type lookup and
3040 nested class logic into SimpleName.
3041 (ConstructedType.ResolveConstructedType): Our underlying type is
3042 already fully resolved; all the type lookup stuff is in
3045 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
3046 constructed types here instead of in ConstructedType.
3048 * decl.cs (MemberName.GetTypeExpression): Always create a
3049 SimpleName, not a ConstructedType.
3050 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
3052 2005-03-02 Martin Baulig <martin@ximian.com>
3054 * class.cs (TypeContainer.DoDefineMembers): We also need a default
3055 static constructor in static classes.
3057 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
3059 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3060 sizeParamIndex is not specified.
3062 2005-03-01 Marek Safar <marek.safar@seznam.cz>
3065 * report.cs (WarningMessage.IsEnabled): Missing null check.
3067 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3069 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3070 in the fields and not in the properties.
3072 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
3074 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
3077 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3079 * attribute.cs: Small refactoring (improved robustness).
3080 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3081 (ValidateGuid): Removed.
3082 (Resolve): Removed referenced to above mentioned.
3083 (GetAttributeUsage): Made private and changed to work without
3085 (GetIndexerAttributeValue): Don't crash.
3086 (GetConditionalAttributeValue): Ditto.
3087 (GetClsCompliantAttributeValue): Ditto.
3088 (ExtractSecurityPermissionSet): All attributes exceptions are
3090 (GetPropertyValue): New helper.
3091 (GetMethodImplOptions): New method.
3092 (DefinePInvokeMethod): Reuse common code. Implemented handling of
3093 some missing properties.
3095 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3096 (Method.ApplyAttributeBuilder): Updated.
3098 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3101 2005-02-28 Raja R Harinath <rharinath@novell.com>
3104 * report.cs (Report.SymbolRelatedToPreviousError): Handle
3105 non-simple types (array, pointer, reference).
3107 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3109 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3111 * class.cs (MethodCore.IsDuplicateImplementation): Special error
3113 (Method.CheckBase): Catch wrong destructor here.
3114 (MethodData.Define): Add errors 550, 668.
3116 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3118 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3120 * pending.cs (VerifyPendingMethods): Add error 551.
3122 * typemanager.cs (CSharpName): Next error report helper.
3124 2005-02-25 Marek Safar <marek.safar@seznam.cz>
3126 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3127 attributes. Removed useless attribute double check.
3128 It saves almost 2MBs for corlib.
3130 2005-02-25 Raja R Harinath <rharinath@novell.com>
3133 * statement.cs (ExpressionStatement.Resolve): Make robust to being
3134 called twice in case of error.
3136 2005-02-23 Chris Toshok <toshok@ximian.com>
3138 Fix compiler portions of #72827.
3139 * statement.cs (Block.Emit): call Begin/EndScope on the
3140 EmitContext instead of the ILGenerator.
3142 * codegen.cs (EmitContext.BeginScope): new method, call
3143 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3145 (EmitContext.BeginScope): same, but EndScope and CloseScope
3147 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3148 offset and call the superclass's OpenScope(int) with it.
3149 (SymbolWriter.CloseScope): get the current il
3150 offset and call superclass's CloseScope(int) with it.
3152 2005-02-23 Marek Safar <marek.safar@seznam.cz>
3154 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3155 CS1677 for out and ref as well.
3157 * class.cs (Method.Define): Add error CS1599 detection.
3159 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3161 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3163 * delegate.cs (Delegate.Define): Add error CS1599 detection.
3165 * support.cs.cs (ModifierDesc): New helper method.
3167 2005-02-23 Raja R Harinath <rharinath@novell.com>
3168 Abin Thomas <projectmonokochi@rediffmail.com>
3169 Anoob V E <projectmonokochi@rediffmail.com>
3170 Harilal P R <projectmonokochi@rediffmail.com>
3173 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3174 MemberLookup (used for error reporting) actually returns a result.
3175 Fix error report number (122, not 112).
3177 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
3178 Anoob V E <projectmonokochi@rediffmail.com>
3179 Harilal P R <projectmonokochi@rediffmail.com>
3182 * pending.cs (PendingImplementation.GetAbstractMethods):
3183 Find NonPublic members too.
3185 2005-02-22 Marek Safar <marek.safar@seznam.cz>
3187 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3190 * class.cs (MethodCore.CheckMethodAgainstBase):
3191 Add error 239 report.
3193 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3195 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3197 * class.cs (Operator.Define): Add error 217 report.
3199 2005-02-21 Raja R Harinath <rharinath@novell.com>
3202 * expression.cs (Invocation.IsApplicable): Make public.
3203 (Invocation.IsParamsMethodApplicable): Likewise.
3204 * delegate.cs (Delegate.VerifyApplicability): Don't use
3205 Invocation.VerifyArgumentCompat for parameter applicability
3206 testing. Use Invocation.IsApplicable and
3207 Invocation.IsParamsMethodApplicable.
3209 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3211 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3213 * class.cs (Operator.Define): Add error 217 report.
3215 2005-02-21 Raja R Harinath <rharinath@novell.com>
3217 * namespace.cs (UsingEntry.Resolve): Undo change below.
3219 2005-02-21 Raja R Harinath <rharinath@novell.com>
3222 * ecore.cs (Expression.MemberLookupFailed): Add argument to
3223 disable the error message when the extended MemberLookup also
3225 (Expression.MemberLookupFinal): Update.
3226 (SimpleName.DoSimpleNameResolve): Update.
3227 * expression.cs (MemberAccess.ResolveNamespaceOrType):
3228 Don't use MemberLookupFinal.
3229 (New.DoResolve): Update.
3230 (BaseAccess.CommonResolve): Update.
3232 2005-02-21 Raja R Harinath <rharinath@novell.com>
3235 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3236 occured previously, don't resolve again.
3238 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3241 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3242 argument. Call ResolveAttributeUsage for unresolved.
3243 when types doesn't match ctor arguments.
3245 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3246 for nested attribute classes.
3247 (Class.attribute_usage): Removed.
3248 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3249 for attribute class.
3251 * ecore.cs (IsAttribute): Removed.
3253 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3255 * rootcontext.cs (RegisterAttribute): Removed, attributes are
3257 (attribute_types): Removed.
3258 (EmitCode): Global attributes are emited as the latest.
3260 2005-02-18 Marek Safar <marek.safar@seznam.cz>
3262 * class.cs (EmitFieldInitializers): Don't emit field initializer
3263 for default values when optimilization is on.
3265 * constant.cs (Constant.IsDefaultValue): New property.
3267 * driver.cs: Add /optimize handling.
3271 * literal.cs: Implement new IsDefaultValue property.
3273 * rootcontext.cs (Optimize): New field, holds /optimize option.
3275 2005-02-18 Raja R Harinath <rharinath@novell.com>
3277 Fix crasher in re-opened #72347.
3278 * namespace.cs (Namespace.Lookup): Return null if
3279 DeclSpace.DefineType returns null.
3282 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3284 2005-02-18 Raja R Harinath <rharinath@novell.com>
3286 Fix remainder of #63202. Change semantics of DoResolveLValue: it
3287 now returns null if it cannot resolve to an lvalue.
3288 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3289 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3290 returned null. Remove check for SimpleName.
3291 (EventExpr.DoResolveLValue): New.
3292 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3293 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
3295 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
3297 (Unary.ResolveOperator): Move CS0211 check ...
3298 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
3300 (Unary.DoResolveLValue): Simplify.
3301 (AddressOf.DoResolveLValue): New.
3302 (ArrayAccess.DoResolveLValue): New.
3304 2005-02-16 Marek Safar <marek.safar@seznam.cz>
3306 * attribute.cs (Attribute.Resolve): Add arguments casting for
3307 when types doesn't match ctor arguments.
3309 2005-02-16 Raja R Harinath <rharinath@novell.com>
3311 Fix parts of #63202.
3312 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3313 lookup of operator in base type. Ensure that all checks happen
3314 when the operator resolves to an "op_..." method.
3316 2005-02-15 Raja R Harinath <rharinath@novell.com>
3319 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3320 'ignore_cs0104' parameter. Pass it to ...
3321 (NamespaceEntry.Lookup): ... this.
3322 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3323 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3324 (TypeLookupExpression.DoResolveAsTypeStep): Update.
3325 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3326 Update. Request that cs0104 errors be ignored.
3327 (ComposedCast.ResolveAsTypeStep): Update.
3329 2005-02-14 Raja R Harinath <rharinath@novell.com>
3332 * expression.cs (Invocation.BetterFunction): Remove support for
3333 comparing virtual functions and their overrides.
3334 (Invocation.IsOverride): New.
3335 (Invocation.OverloadResolve): Don't consider 'override' functions
3336 during candidate selection. Store them in a lookaside list.
3337 If the selected method is a 'virtual' function, use the list to
3338 find any overrides that are closer to the LHS type.
3340 2005-02-14 Marek Safar <marek.safar@seznam.cz>
3342 * expression.cs (New.DoResolve): Add complex core type reduction.
3343 (New.Constantify): Converts complex core type syntax like 'new int ()'
3346 2005-02-14 Raja R Harinath <rharinath@novell.com>
3348 * decl.cs (EntryType.EntryType): New constructor to create an
3349 updated copy of a cache entry.
3350 (MemberCache.AddMethods): Use it.
3351 (MemberCache.ClearDeclaredOnly): Remove.
3352 (MemberCache.MemberCache): Update.
3354 2005-02-11 Miguel de Icaza <miguel@novell.com>
3356 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3357 variable. This one is represents the actual low-level declaration
3358 of the method, as opposed to the semantic level `IsStatic'.
3360 An anonymous method which is hosted into a static method might be
3361 actually an instance method. IsStatic would reflect the
3362 container, while MethodIsStatic represents the actual code
3365 * expression.cs (ParameterReference): Use the new MethodIsStatic
3366 instead of IsStatic.
3368 * anonymous.cs (AnonymousMethod.Compatible): Pass the
3369 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3370 set on the current EmitContext.
3372 * expression.cs (Cast): Overload DoResolveLValue so we can pass
3373 resolve our casted expression as an LValue. This triggers the
3374 proper LValue processing that is later required by Assign.
3378 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3380 2005-02-11 Marek Safar <marek.safar@seznam.cz>
3382 C# 2.0 Fixed buffer implementation
3384 * anonymous.cs: Update after RegisterHelperClass renaming.
3386 * attribute.cs (AttributeTester.fixed_buffer_cache):
3387 Cache of external fixed buffers.
3388 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3389 implementation if field is fixed buffer else null.
3392 (TypeContainer.AddField): Accept FieldMember instead of Field.
3393 (FieldBase.IsFieldClsCompliant): Extracted code from
3394 VerifyClsCompliance descendant customization.
3395 (FixedField): New class handles fixed buffer fields.
3396 (FixedFieldExternal): Keeps information about imported fixed
3398 (IFixedField): Make access to internal or external fixed buffer
3401 * cs-parser.jay: Add fixed buffer parsing.
3403 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3406 * expression.cs (Indirection): Extended implementation to accept
3408 (PointerArithmetic.Emit): Get element from fixed buffer as well.
3409 (ElementAccess.MakePointerAccess): Get type as parameter.
3410 (DoResolve): Add fixed buffer field expression conversion.
3411 (DoResolveLValue): Ditto.
3412 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3413 (ArrayPtr): Derives from FixedBufferPtr.
3414 (ArrayPtr.Emit): Add extra emit for array elements.
3416 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3418 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3419 for compiler generated types.
3420 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3422 * statement.cs (Fixed): Refactored to be easier add fixed buffer
3423 and consume less memory.
3424 (Fixed.Resolve): Add fixed buffer case.
3426 * typemanager.cs (compiler_generated_attr_ctor,
3427 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3428 (HasElementType): Add our own implementation to work on every
3431 2005-02-11 Miguel de Icaza <miguel@novell.com>
3433 * anonymous.cs (CaptureContext): Track whether `this' has been
3436 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
3437 only captured `this' if it was implicitly done (instance
3438 methods/variables were used).
3440 * codegen.cs (EmitContext.CaptureThis): New method to flag that
3441 `this' must be captured.
3443 2005-01-30 Miguel de Icaza <miguel@novell.com>
3445 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3446 is null it means that there has been no need to capture anything,
3447 so we just create a sibling.
3449 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3451 Just a partial fix. The other half is fairly elusive.
3453 2005-02-10 Raja R Harinath <rharinath@novell.com>
3455 Fix #52586, cs0121-4.cs.
3456 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
3457 and return a hashtable.
3458 (MemberCache.ClearDeclaredOnly): New.
3459 (MemberCache.MemberCache): Update to change. Make a deep copy of
3460 the method_hash of a base type too.
3461 (MemberCache.AddMethods): Adapt to having a deep copy of the base
3462 type methods. Overwrite entries with the same MethodHandle so
3463 that the ReflectedType is correct. The process leaves in base
3464 virtual functions and their overrides as distinct entries.
3465 (CacheEntry): Now a class instead of a struct. It shouldn't alter
3466 matters since it was boxed in a ArrayList before.
3467 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3469 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
3470 case of a virtual function and its override (choose the overload
3472 (Invocation.OverloadResolve): Avoid 'override' members during
3473 'applicable_type' calculation.
3475 2005-03-28 Raja R Harinath <rharinath@novell.com>
3477 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3478 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3479 GetTypeHandle. It is possible for a reflected type to derive from
3480 a TypeBuilder (e.g., int[] derives from the TypeBuilder
3481 System.Array during mscorlib compilation).
3482 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3483 contain a method_hash, don't create one either. Don't create a
3484 deep copy of the base cache's method_hash.
3485 (MemberCache.SetupCache): Rename back from DeepCopy.
3486 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3487 already initialized. If we see an override function, add its
3488 underlying base virtual function to the member_hash too.
3490 2005-02-09 Raja R Harinath <rharinath@novell.com>
3492 Combine two near-redundant caches.
3493 * typemanager.cs (method_params): Rename from method_internal_params.
3494 (TypeManager.GetParameterData): New. Replace
3495 Invocation.GetParameterData.
3496 (TypeManager.LookupParametersByBuilder): Remove.
3497 * expression.cs (Invocation.method_parameter_cache): Remove.
3498 (Invocation.GetParameterData): Remove.
3500 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3503 2005-02-08 Raja R Harinath <rharinath@novell.com>
3506 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3507 TypeManager.multicast_delegate_type is null, resolve it by looking
3508 up "System.MulticastDelegate".
3509 * rootcontext.cs (RootContext.ResolveCore): Simplify.
3511 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
3512 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
3513 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
3516 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3517 (LabeledStatement.AddReference): New. Set 'referenced'.
3518 (Goto.Resolve): Use it.
3520 2005-02-05 John Luke <john.luke@gmail.com>
3522 * driver.cs: remove duplicate -doc line in Usage ()
3524 2005-02-04 Raja R Harinath <rharinath@novell.com>
3526 * location.cs (Location.AddFile): Fix CS2002 error report.
3528 2005-02-02 Martin Baulig <martin@ximian.com>
3530 * delegate.cs (Delegate.DefineType): Report an internal error if
3531 TypeManager.multicast_delegate_type is null. See bug #72015 for
3534 2005-02-02 Raja R Harinath <rharinath@novell.com>
3536 Fix a crasher in a variant of #31984.
3537 * const.cs (Constant.CheckBase): New override that defers the
3538 new-or-override check in case the base type hasn't been populated
3540 (Constant.Define): Ensure the new-or-override check is performed.
3542 2005-02-01 Duncan Mak <duncan@ximian.com>
3544 * const.cs (LookupConstantValue): Check that `ce' is not null
3545 before calling GetValue ().
3547 2005-02-01 Raja R Harinath <rharinath@novell.com>
3549 Fix test-334.cs (#69519).
3550 * cs-parser.jay (using_alias_directive): Pass in an expression to
3551 NamespaceEntry.UsingAlias.
3552 (using_namespace_directive): Pass in an expression to
3553 NamespaceEntry.Using.
3554 (namespace_name): Don't flatten to a string.
3555 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3556 (NamespaceEntry.AliasEntry.Resolve): Lookup using
3558 (NamespaceEntry.UsingEntry): Likewise.
3559 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3561 (NamespaceEntry.LookupForUsing): Remove.
3562 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3564 (NamespaceEntry.Lookup): Remove support for dotted names.
3566 2005-02-01 Raja R Harinath <rharinath@novell.com>
3568 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3570 (NamespaceEntry.ImplicitParent): Compute on demand.
3571 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3572 parallels the current.
3573 (NamespaceEntry.LookupForUsing): Use it.
3574 (NamespaceEntry.Lookup): If the current namespace-entry is
3575 implicit, don't search aliases and using tables.
3577 2005-02-01 Raja R Harinath <rharinath@novell.com>
3580 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3582 (TypeContainer.BaseCache): Compute on demand.
3583 (TypeContainer.FindMembers): Define constants and types if they're
3584 not already created.
3585 (FieldMember.Define): Move resetting of ec.InUnsafe before error
3587 * const.cs (Constant.Define): Make idempotent.
3589 2005-01-29 Miguel de Icaza <miguel@novell.com>
3591 * pending.cs: Produce better code (no nops produced by using Ldarg
3594 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3595 i - 1' it should be arg + 1.
3599 2005-01-28 Raja R Harinath <rharinath@novell.com>
3601 * attribute.cs (Attribute.CheckAttributeType): Make private
3603 (Attribute.ResolveType): Make virtual.
3604 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3605 handling of RootContext.Tree.Types.
3607 2005-01-27 Raja R Harinath <rharinath@novell.com>
3609 Update attribute-handling to use the SimpleName/MemberAccess
3611 * cs-parser.jay (attribute): Pass in an expression to the
3612 constructors of Attribute and GlobalAttribute.
3613 * attribute.cs (Attribute): Take an expression for the name.
3614 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
3615 passed in attribute name expression.
3616 (Attribute.CheckAttributeType): Use it.
3617 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3618 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3619 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
3620 argument to prevent error messages if the lookup fails.
3622 2005-01-27 Marek Safar <marek.safar@seznam.cz>
3624 * expression.cs (Indirection): Implemented IVariable interface
3625 to support indirection in AddressOf operator.
3626 (PointerArithmetic.Emit): Add optimalization for case where
3627 result can be precomputed.
3629 2005-01-26 Martin Baulig <martin@ximian.com>
3631 * class.cs (TypeContainer.AttributeTargets): Return the correct
3632 AttributeTargets depending on our `Kind' instead of throwing an
3633 exception; fixes #71632.
3635 2005-01-26 Marek Safar <marek.safar@seznam.cz>
3638 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3641 2005-03-17 Martin Baulig <martin@ximian.com>
3643 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3644 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
3646 2005-03-17 Martin Baulig <martin@ximian.com>
3648 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3649 to bool so we can return an error condition.
3650 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3653 2005-03-17 Martin Baulig <martin@ximian.com>
3655 * generic.cs (TypeMananager.IsIEnumerable): New public method.
3657 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
3658 converting from an array-type of T to `IEnumerable<T>'.
3660 2005-03-16 Martin Baulig <martin@ximian.com>
3662 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
3663 (Nullable.LiftedUnaryMutator): New public class.
3665 * expression.cs (UnaryMutator.DoResolve): Added support for
3668 2005-03-14 Martin Baulig <martin@ximian.com>
3670 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
3672 2005-03-14 Martin Baulig <martin@ximian.com>
3674 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
3675 the comparision operators `<', `>', `<=' and `>='.
3677 2005-03-13 Martin Baulig <martin@ximian.com>
3680 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
3681 avoid confusion with the `NullLiteral'.
3682 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
3684 2005-03-13 Martin Baulig <martin@ximian.com>
3686 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
3687 comparing arbitrary types with the null literal.
3689 2005-03-13 Martin Baulig <martin@ximian.com>
3691 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
3692 boolean operators '&&', '||', '&' and '|'.
3693 (Nullable.OperatorTrueOrFalse): New public class.
3695 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
3696 instead of a `StaticCallExpr'; added support for nullables.
3698 2005-03-10 Martin Baulig <martin@ximian.com>
3701 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
3702 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
3704 2005-03-07 Martin Baulig <martin@ximian.com>
3706 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
3707 it work if `expr' is not an IMemoryLocation.
3708 (Nullable.Lifted): Implement IMemoryLocation.
3709 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
3712 2005-03-05 Martin Baulig <martin@ximian.com>
3714 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
3715 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
3716 (Nullable): Added support for lifted unary and binary operators.
3718 * expression.cs (Unary.DoResolve): Added support for nullable types.
3719 (Binary.DoResolve): Likewise.
3720 (Conditional.DoResolve): Likewise.
3722 2005-03-02 Martin Baulig <martin@ximian.com>
3724 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
3726 * class.cs (ClassPart.SetParameterInfo): Override this.
3727 (PartialContainer.SetParameterInfo): Override this.
3728 (TypeContainer.CheckConstraints): New protected method.
3729 (PartialContainer.CheckConstraints): Override this and check
3730 whether the same contraints were specified in all parts of a
3731 partial generic type definition.
3732 (PartialContainer.UpdateConstraints): New public method.
3734 * generic.cs (TypeParameter.UpdateConstraints): New public method.
3736 2005-03-02 Martin Baulig <martin@ximian.com>
3738 Committing a patch from Carlos Alberto Cortez to fix #72887.
3740 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
3741 casts from `T []' to `int []'.
3743 2005-03-02 Martin Baulig <martin@ximian.com>
3745 * generic.cs (TypeManager.IsEqual): Make this symmetric.
3747 * expression.cs (Binary.ResolveOperator): When resolving a
3748 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
3749 `=='. Fixes #71866. See gen-127.cs.
3751 2005-03-02 Martin Baulig <martin@ximian.com>
3753 * class.cs (TypeContainer.DoDefineMembers): We also need a default
3754 static constructor in static classes.
3756 2005-03-02 Martin Baulig <martin@ximian.com>
3759 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
3760 (Nullable.LiftedConversion): Added support for user-defined
3763 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
3765 * cs-parser.jay: Use ComposedCast everywhere instead of
3766 NullableType, so we don't need to check for NullableType
3768 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3769 case where we'll be resolved into a `parenthesized_expression_0'
3773 (Convert.UserDefinedConversion): Added nullable conversions.
3775 2005-02-28 Martin Baulig <martin@ximian.com>
3777 * generic.cs (TypeManager.IsNullableType): New static method.
3778 (Nullable): New abstract class.
3779 (Nullable.NullLiteral): New public class.
3780 (Nullable.LiftedConversion): New public class.
3782 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3783 `builtin_types opt_nullable'.
3786 (Convert.ImplicitConversionStandard): Added nullable conversions.
3787 (Convert.ExplicitConversionStandard): Likewise.
3788 (Convert.ExplicitConversion): Likewise.
3790 2005-02-26 Martin Baulig <martin@ximian.com>
3792 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3793 begin with a "?", for instance "?[]". Don't do a type lookup if
3796 2005-02-25 Martin Baulig <martin@ximian.com>
3798 The first part of Nullable Types :-)
3800 * generic.cs (NullableType): New public class.
3801 (NullCoalescingOperator): New public class.
3802 (TypeArguments.Resolve): Add a CS0306 check.
3804 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3805 (opt_nullable): New rule.
3806 (type): Added `opt_nullable' to `namespace_or_type_name',
3807 `builtin_types' and `pointer_type'.
3808 (array_type): Added `opt_nullable'.
3809 (opt_rank_specifier_or_nullable): New rule; this is the
3810 combination of `opt_rank_specifier' and `opt_nullable'.
3811 (opt_error): New rule; catch errors here.
3812 (nullable_type_or_conditional): New rule; we use this to check for
3813 nullable and still detect the conditional operator.
3814 (local_variable_type): Use `opt_rank_specifier_or_nullable'
3815 instead `opt_rank_specifier'.
3817 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3820 2005-02-24 Martin Baulig <martin@ximian.com>
3822 * README, README.Changes: Removed; they're old and obsolete.
3824 2005-02-22 Martin Baulig <martin@ximian.com>
3826 * generic.cs (TypeParameter.Resolve): If resolving the constraints
3827 returned an error, set `constraints' to null to avoid a crash
3829 (TypeParameter.ResolveType): Likewise.
3831 2005-02-22 Martin Baulig <martin@ximian.com>
3834 (Constraints.ResolveTypes): Protect against being called twice.
3835 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3836 (TypeParameter.ResolveType): New public method; calls
3837 constraints.ResolveTypes().
3838 (TypeParameter.DefineType): Moved constraints.ResolveType() out
3839 into the new ResolveType().
3840 (GenericMethod.Define): Call ResolveType() on all our
3843 2005-02-21 Martin Baulig <martin@ximian.com>
3846 (TypeManager.generic_nullable_type): New static public field.
3847 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3850 (RootContext.ResolveCore): Resolve "System.Nullable`1".
3852 2005-02-15 Martin Baulig <martin@ximian.com>
3854 * generic.cs (ConstructedType.Constraints): Correctly check
3855 constraints if the argument type is a type parameter; fixes
3858 2005-02-02 Martin Baulig <martin@ximian.com>
3860 * delegate.cs (Delegate.DefineType): Report an internal error if
3861 TypeManager.multicast_delegate_type is null. See bug #72015 for
3864 2005-01-29 Miguel de Icaza <miguel@novell.com>
3866 * pending.cs: Produce better code (no nops produced by using Ldarg
3869 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3870 i - 1' it should be arg + 1.
3874 2005-01-26 Martin Baulig <martin@ximian.com>
3876 * cs-parser.jay (indexer_declarator): Don't report an error if we
3877 have type parameters since we can be an explicit interface
3878 implementation; fixes #71449.
3880 2005-01-26 Martin Baulig <martin@ximian.com>
3882 * class.cs (TypeContainer.AttributeTargets): Return the correct
3883 AttributeTargets depending on our `Kind' instead of throwing an
3884 exception; fixes #71632.
3886 2005-01-26 Martin Baulig <martin@ximian.com>
3888 * delegate.cs (Delegate.DefineType): Correctly define our type
3889 parameters. Fixes #71483.
3891 2005-01-25 Raja R Harinath <rharinath@novell.com>
3894 * expression.cs (MemberAccess.DoResolve): Don't complain with
3895 cs0572 when the LHS of a member access has identical name and type
3898 2005-01-25 Marek Safar <marek.safar@seznam.cz>
3901 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3903 Create custom PermissionSet only for PermissionSetAttribute.
3905 2005-01-24 Marek Safar <marek.safar@seznam.cz>
3908 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3909 delegates in static class.
3911 2005-01-24 Martin Baulig <martin@ximian.com>
3913 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3914 merging an implicit block, just use its reachability.
3916 * statement.cs (Block.Resolve): Make the unreachable code check
3917 work wrt. implicit blocks; see test-337 from #63842.
3919 2005-01-21 Alp Toker <alp@atoker.com>
3921 * cs-parser.jay: destructor_declaration's container is PartialContainer
3922 not Class when partial types are used, so use Kind prop instead of
3925 2005-01-22 Miguel de Icaza <miguel@ximian.com>
3927 * cs-parser.jay: Improve error reporting when an interface
3930 2005-01-20 Dick Porter <dick@ximian.com>
3932 * support.cs: SeekableStreamReader fix from Sandor Dobos
3933 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3934 chars are read. Fixes bug 70369.
3936 2005-01-20 Raja R Harinath <rharinath@novell.com>
3938 * cs-parser.jay (catch_clause): Simplify current_block handling
3941 2005-01-17 Miguel de Icaza <miguel@ximian.com>
3943 * convert.cs (ImplicitStandardConversionExists): Synchronize the
3944 code with ImplicitStandardConversion to handle the implicit
3945 conversion of method groups into valid delegate invocations.
3947 The problem is that in parameter handling we were using this code
3948 path. Fixes bug #64698
3950 2005-01-19 Raja R Harinath <rharinath@novell.com>
3952 * cs-parser.jay: Fix several infelicities.
3953 - Avoid assigning to the parser value stack. Code like
3954 '$3 = null' is unclean. Synthesize a value for the code block
3956 - Avoid using oob_stack for storing location information. Use ...
3957 (_mark_): ... this. New (empty) rule. Saves the current location
3959 (foreach_statement): Avoid using oob_stack for current_block
3960 handling. Use technique used in for_statement and
3961 using_statement. Synthesize a value for the code block to store
3962 additional intermediate information.
3964 2005-01-13 Miguel de Icaza <miguel@ximian.com>
3966 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3967 of a different type is only allowed to private fields of a
3968 containing type, not on fields of a base class.
3970 See test-174.cs and error cs0122-9.cs
3972 2005-01-13 Raja R Harinath <rharinath@novell.com>
3974 Fix test-335.cs (bug #58126).
3975 * cs-parser.jay (argument): Split out non-expression parts of the
3976 rule into 'non_simple_argument'.
3977 (invocation_expression): Support parenthesized invocations with
3978 multiple arguments, and with single non-simple arguments.
3980 2005-01-13 Raja R Harinath <rharinath@novell.com>
3982 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3985 2005-01-12 Raja R Harinath <rharinath@novell.com>
3987 Fix cs0038-1.cs, cs1640-6.cs.
3988 * ecore.cs (Expression.Resolve): Remove special-case for
3989 SimpleName in error-handling.
3990 (Expression.almostMatchedMembers): Relax access permission to
3992 (Expression.MemberLookupFailed): Handle duplicates in
3993 almostMatchedMembers list.
3994 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3995 * expression.cs (New.DoResolve): Report CS1540 for more cases.
3996 * typemanager.cs (GetFullNameSignature): Use the MethodBase
3997 overload if the passed in MemberInfo is a MethodBase.
3999 2005-01-25 Martin Baulig <martin@ximian.com>
4002 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
4004 2005-01-12 Marek Safar <marek.safar@seznam.cz>
4007 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
4008 for non-CAS & merge permission sets properly.
4010 2005-01-11 Raja R Harinath <rharinath@novell.com>
4012 Improve standard-compliance of simple name and member access
4013 resolution. Fixes bugs #52697, #57200, #67520, #69519.
4014 * ecore.cs (FullNamedExpression): New abstract base class
4015 for Namespaces and TypeExpressions.
4016 (ResolveFlags.SimpleName): Remove.
4017 (SimpleName): Remove support for dotted names.
4018 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
4019 DeclSpace.FindType and DeclSpace.LookupType.
4020 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
4021 (Expression.ExprClassName): Make member function.
4022 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
4023 a namespace. Remove creation of dotted "SimpleName"s.
4024 (MemberAccess.DoResolve): Likewise.
4025 * decl.cs (DeclSpace.Cache): Make private.
4026 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
4027 (DeclSpace.FindType): Update.
4028 (DeclSpace.LookupType): Move here from RootContext. Return a
4029 FullNamedExpression.
4030 * namespace.cs (Namespace): Derive from FullNamedExpression
4031 so that it can be part of expression resolution.
4032 (Namespace.Lookup): Return an FullNamedExpression.
4033 (NamespaceEntry.LookupAlias): Lookup aliases only in current
4035 * rootcontext.cs (NamespaceLookup): Remove.
4036 (LookupType): Move to DeclSpace.
4037 * attribute.cs (CheckAttributeType): Update.
4038 * doc.cs (FindDocumentedType): Remove allowAlias argument.
4039 (FindDocumentedTypeNonArray): Likewise.
4041 2005-01-11 Raja R Harinath <rharinath@novell.com>
4043 Fix cs0509.cs, cs1632.cs.
4044 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
4045 is the same as IsInterface.
4046 (TypeContainer.GetClassBases): Likewise.
4047 * statement.cs (LabeledStatement.ig): New field.
4048 (LabeledStatement.LabelTarget): Save ILGenerator which created the
4050 (LabeledStatement.DoEmit): Check that the label was created with
4051 the same ILGenerator.
4053 2005-01-10 Marek Safar <marek.safar@seznam.cz>
4056 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
4057 accessors to its properties.
4059 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
4060 from accessors to property.
4062 2005-01-10 Marek Safar <marek.safar@seznam.cz>
4065 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
4068 2005-01-08 Miguel de Icaza <miguel@ximian.com>
4070 * attribute.cs: Check for null and empty strings.
4072 I have lost another battle to Paolo.
4074 2005-01-07 Marek Safar <marek.safar@seznam.cz>
4077 * class.cs (PropertyMethod): Set Parent field in ctors.
4078 (SetMethod.InternalParameters): Add unsafe switch hack.
4079 Override MarkForDuplicationCheck where it is appropriate.
4081 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
4082 It says whether container allows members with the same name.
4084 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
4085 Removed is_method parameter.
4087 2005-01-06 Duncan Mak <duncan@ximian.com>
4089 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
4090 because the previous change led to incorrect reporting of CS1032
4091 ("Cannot define/undefine preprocessor symbols after first token in
4092 file"). Instead of using `tokens_seen' as the only flag that
4093 triggers CS1040, introduce `comments_seen'. This new flag is used
4094 to signify having seen comments on the current line, so it is
4095 unset after a newline.
4097 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
4099 * doc.cs : When searching for a type, find nested type too.
4100 This fixes bug #71040.
4102 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
4105 - Warn missing member comment on those classes which also does not
4106 have doc comments. Fixed bug #71041.
4107 - Don't warn missing doc comment on default constructor.
4110 2005-01-06 Duncan Mak <duncan@ximian.com>
4112 * cs-tokenizer.cs (xtoken): After handling traditional C-style
4113 comments, set `tokens_seen' to true. This allows us to detect
4114 misplaced preprocessor directives (i.e. not at the beginning of
4115 the a line, nor after whitespaces). In that case, report error
4116 CS1040. This fixes bug #56460.
4118 * cs-parser.jay (interface_member_declaration): Add checks for
4119 IsExplicitImpl, and report CS0541 error if an interface member is
4120 defined as an explicit interface declaration.
4122 2005-01-06 Marek Safar <marek.safar@seznam.cz>
4125 * class.cs (PropertyMethod): Set Parent field in ctors.
4126 (SetMethod.InternalParameters): Add unsafe switch hack.
4128 * decl.cs (MemberCore.Parent): Cannot be readonly.
4130 2005-01-06 Raja R Harinath <rharinath@novell.com>
4132 * decl.cs (DeclSpace.ResolveType): Remove.
4133 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4134 Merge in code from ...
4135 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
4136 * class.cs, enum.cs: Update to changes.
4138 2005-01-06 Miguel de Icaza <miguel@ximian.com>
4140 * anonymous.cs: Ensure that we init the scope of our parent if it
4141 has not been initialized yet.
4143 2004-12-30 Duncan Mak <duncan@ximian.com>
4145 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
4146 if field.FieldBuilder is null. Fixes #70758.
4148 * convert.cs: Fixed some typos and updated some of the comments.
4149 (ImplicitStandardConversionExists):
4150 (TryImplicitIntConversion): If `target_type' is an interface and
4151 the type of `ic' implements this interface, return true or a new
4152 BoxedCast instead of null. This fixes #70468.
4154 2004-12-29 Duncan Mak <duncan@ximian.com>
4156 * expression.cs (Argument.Emit): Check that Expr is
4157 IMemoryLocation before casting to it, and report CS1510 otherwise.
4161 2004-12-21 Ben Maurer <bmaurer@ximian.com>
4163 * statement.cs (Block.ThisVariable): remove the recursion here, to
4164 make the --profile more sane.
4166 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
4168 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4169 assembly, by JB Evain.
4171 2004-12-17 Raja R Harinath <rharinath@novell.com>
4173 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
4174 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4175 "parent" refers to enclosing type/class. "base" refers to superclass.
4177 2004-12-17 Raja R Harinath <rharinath@novell.com>
4179 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4180 Ensure that we only have GlobalAttributes.
4181 * attribute.cs (Attribute.Emit): Make non-virtual.
4182 (GlobalAttribute.Emit): Remove.
4183 (Attribute.Resolve): Make virtual.
4184 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
4185 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4186 the argument. Don't create one.
4187 (Attribute.GetObsoleteAttribute): Likewise.
4188 (Attribute.GetClsCompliantAttributeValue): Likewise.
4189 * class.cs, decl.cs: Update to changes.
4191 2004-12-17 Marek Safar <marek.safar@seznam.cz>
4193 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4195 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4197 * statement.cs (Foreach.Resolve): Add error 186 report.
4199 2004-12-16 Marek Safar <marek.safar@seznam.cz>
4201 * expression.cs (Conditional.DoResolve): Add warning 429.
4203 * statement.cs (If.Resolve): Add warning 665.
4205 2004-12-16 Raja R Harinath <rharinath@novell.com>
4207 New invariant: RootContext.Tree.Types.NamespaceEntry == null
4208 except when in the parser, and in GlobalAttribute.
4209 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4210 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4211 RootContext.Tree.Types.NamespaceEntry once work is done.
4212 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
4213 and resets RootContext.Tree.Types.NamespaceEntry.
4215 2004-12-15 Marek Safar <marek.safar@seznam.cz>
4217 * cs-parser.jay: Don't create a block for every variable.
4219 2004-12-14 Miguel de Icaza <miguel@ximian.com>
4221 * location.cs: Provide extra information.
4223 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4224 variables from the captured environment, it is the ldarg_0.
4226 2004-12-14 Marek Safar <marek.safar@seznam.cz>
4228 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4231 * class.cs: Changed warning level for 169 to avoid developer
4232 displeasure from warning flooding. It will be changed back when they
4233 fix most of current BCL warnings.
4235 * RootContext.cs: Pushed default WarningLevel to 3.
4237 * statement.cs: Removed unused variable.
4239 2004-12-14 Marek Safar <marek.safar@seznam.cz>
4241 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4242 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4243 Add error 502 report.
4244 (StaticClass.DefineType): Add error 441 report.
4245 (Class.AllowedModifiersProp): New virtual property as temporary
4246 extension to AllowedModifiers.
4247 (Class.DefineType): Add error 418 report. Moved ModFlags check here
4248 to share implementation with StaticClass and don't call virtual
4251 * driver.cs (MainDriver): Add error 1558 test.
4253 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4254 report. Moved error 36 test here.
4256 * statement.cs (Throw.Resolve): Add error 724 report.
4258 * typemanager.cs: Add out_attribute_type core type.
4260 2004-12-13 Marek Safar <marek.safar@seznam.cz>
4262 * class.cs (TypeContainer.VerifyClsCompliance): Add error
4264 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4266 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4269 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4271 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
4272 Add error 3023 report.
4273 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4275 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4278 2004-12-12 John Luke <john.luke@gmail.com>
4280 * driver.cs (AddArgs): take -- into account when
4281 adding arguments, fixes bug 65710
4283 2004-12-12 Martin Baulig <martin@ximian.com>
4285 * expression.cs (Unary.TryReduceNegative): Added support for
4286 SByteConstant and ByteConstant.
4287 (Unary.Reduce): Check error values from TryReduceNegative().
4289 2004-12-10 Marek Safar <marek.safar@seznam.cz>
4291 * attributes.cs (Attribute.Resolve): Avoid multiple error report
4292 and report exception as error 182.
4294 2004-12-10 Raja R Harinath <rharinath@novell.com>
4296 * driver.cs (Main): Fix message when there are warnings.
4298 2004-12-09 Miguel de Icaza <miguel@ximian.com>
4300 * delegate.cs: Fixed my fix from yesterday, sorry about that.
4302 2004-12-09 Marek Safar <marek.safar@seznam.cz>
4304 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
4305 Reduced number of warnings.
4307 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4309 2004-12-08 Miguel de Icaza <miguel@ximian.com>
4311 * driver.cs: Removed message.
4313 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4315 2004-12-08 <vargaz@freemail.hu>
4317 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4319 2004-12-08 Martin Baulig <martin@ximian.com>
4321 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4322 instead of a CS3002 for properties and indexer.
4324 2004-12-08 Martin Baulig <martin@ximian.com>
4326 * decl.cs (MemberName.ToString): Make this work again.
4328 2004-12-08 Marek Safar <marek.safar@seznam.cz>
4330 * attribute.cs (Resolve): Add error 591 detection.
4332 * class.cs (FieldMember.Define): Add error 1547 detection.
4333 (Indexer.Define): Add error 620 detection.
4334 (Operator.Define): Add error 590 detection.
4336 * ecore.cs: Missing argument for error 79.
4338 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4341 2004-12-07 Marek Safar <marek.safar@seznam.cz>
4344 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4347 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4349 * cs-parser.jay : handle doc comments on implicit/explicit operators.
4350 Some operator comments were suppressed.
4351 * doc.cs : Implicit/explicit operator name in doc comments are like
4352 "op_Explicit(type)~returnType", so added suffix handling.
4354 2005-01-21 Alp Toker <alp@atoker.com>
4356 * cs-parser.jay: destructor_declaration's container is PartialContainer
4357 not Class when partial types are used, so use Kind prop instead of 'is'.
4359 2004-12-12 Martin Baulig <martin@ximian.com>
4361 * expression.cs (Unary.TryReduceNegative): Added support for
4362 SByteConstant and ByteConstant.
4363 (Unary.Reduce): Check error values from TryReduceNegative().
4365 2004-12-11 Martin Baulig <martin@ximian.com>
4367 * support.cs (ReflectionParameters.ParameterName): If we have a
4368 `gpd', call `ParameterName' on it.
4370 * parameter.cs (Parameter.GetParameterAttributes): New static method.
4372 * pending.cs (PendingImplementation.DefineProxy): Call
4373 DefineParameter() for all of the MethodBuilder's arguments.
4375 2004-12-09 Martin Baulig <martin@ximian.com>
4377 * doc.cs (DocUtil): Make this a static class.
4379 2004-12-09 Martin Baulig <martin@ximian.com>
4381 * expression.cs (Invocation.InferType): Moved the type inference
4382 implementation into TypeManager.
4384 * generics.cs (TypeManager): Moved the type inference
4385 implementation here.
4387 2004-12-09 Martin Baulig <martin@ximian.com>
4389 * typemanager.cs (TypeManager): Make this a partial class.
4392 (TypeManager): Move the generics part of `TypeManager' here.
4394 2004-12-08 Martin Baulig <martin@ximian.com>
4396 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4397 instead of a CS3002 for properties and indexer. Added CS3024
4398 check for generic interfaces.
4400 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
4401 instances are not CLS-compliant.
4403 2004-12-08 Martin Baulig <martin@ximian.com>
4406 (void_pointer_expression): New rule for `void*', `void**' etc.
4407 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
4409 2004-12-08 Martin Baulig <martin@ximian.com>
4411 * expression.cs (Invocation.InferType): Removed the hack for
4412 MethodCore.MayUnify().
4414 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4417 * class.cs (MethodCore.MayUnify): Use
4418 TypeManager.MayBecomeEqualGenericTypes().
4420 2004-12-08 Martin Baulig <martin@ximian.com>
4422 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
4423 parameter, box it. Fixes #69233.
4425 2004-12-08 Martin Baulig <martin@ximian.com>
4427 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
4428 have the ctor constraint. Fixes #68326.
4430 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4432 * cs-parser.jay : interface comment was not consumed because of
4433 extra opt_semicolon before doc handling.
4435 2004-12-03 Raja R Harinath <rharinath@novell.com>
4437 Fix test-327.cs, test-328.cs, and put in early infrastructure
4438 for eventually fixing #52697.
4439 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4440 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4442 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4443 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4444 (VerifyUsing, error246): Update.
4445 * rootcontext.cs (RootContext.NamespaceLookup): Just use
4446 'NamespaceEntry.LookupNamespaceOrType'.
4448 2004-12-07 Martin Baulig <martin@ximian.com>
4450 * driver.cs: Call it "BETA SOFTWARE" :-)
4452 2004-12-06 Raja R Harinath <rharinath@novell.com>
4454 Fix crash on cs0657-17.cs.
4455 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4456 Use RootContext.Tree.Types, not 'new RootTypes ()'.
4457 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4458 the case where the NamespaceEntry gets overwritten.
4460 2004-12-06 Marek Safar <marek.safar@seznam.cz>
4462 Fixed #69195, #56821
4463 * ecore.cs (ResolveBoolean): Tiny refactoring.
4465 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4466 of right expression resolving when left is false constant and
4467 operator is LogicalAnd OR true constant and operator is LogicalOr.
4469 * statement.cs (ResolveUnreachable): Always reports warning.
4471 2004-12-05 Miguel de Icaza <miguel@ximian.com>
4473 * class.cs: Distinguish between 1721 and 1722 (just a little help
4474 for the programmer).
4476 2004-12-03 Miguel de Icaza <miguel@ximian.com>
4478 * delegate.cs: Only allow this on new versions of the language.
4480 2004-12-02 Duncan Mak <duncan@ximian.com>
4482 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4484 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4485 here as a static method. Take an additional bool out parameter
4486 `must_do_cs1540_check' for signaling to InstanceResolve.
4487 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4488 member field from PropertyExpr class and made it an argument of
4490 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4491 check for MarshalByRefObject, and report CS0122 instead of CS1540.
4492 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4493 and `remove_accessor' as well as InstanceResolve: report CS0122
4498 2004-12-07 Martin Baulig <martin@ximian.com>
4500 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
4501 and CS0692 where appropriate.
4503 2004-12-06 Martin Baulig <martin@ximian.com>
4505 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
4506 IsDuplicateImplementation() and improved it.
4508 * expression.cs (Invocation.InferTypeArguments): Added
4509 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
4510 and removed the "ref" modifier from `infered_types'.
4512 * decl.cs (MemberName.ToString): Removed the exception.
4514 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
4516 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4517 comments are allowed.
4519 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4521 * delegate.cs: Add checks for subtypes in paramaters and return values
4522 in VerifyMethod () to add support for Covariance/Contravariance
4525 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4527 * report.cs: Remove extra closing parenthesis.
4529 * convert.cs (Error_CannotImplicitConversion): If the name of the
4530 types are the same, provide some extra information.
4532 2004-12-02 Marek Safar <marek.safar@seznam.cz>
4535 * attribute.cs (Resolve): Improved implementation of params
4536 attribute arguments.
4538 * support.cs (ParameterData): Add HasParams to be faster.
4540 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
4542 all things are for /doc support:
4544 * doc.cs: new file that supports XML documentation generation.
4545 * mcs.exe.sources: added doc.cs.
4547 Handle /doc command line option.
4548 Report error 2006 instead of 5 for missing file name for /doc.
4549 Generate XML documentation when required, after type resolution.
4551 Added support for picking up documentation (/// and /** ... */),
4552 including a new XmlCommentState enumeration.
4554 Added lines to fill Documentation element for field, constant,
4555 property, indexer, method, constructor, destructor, operator, event
4556 and class, struct, interface, delegate, enum.
4557 Added lines to warn incorrect comment.
4559 Added Documentation field (passed only when /doc was specified).
4561 Added DocComment, DocCommentHeader, GenerateDocComment() and
4562 OnGenerateDocComment() and some supporting private members for
4563 /doc feature to MemberCore.
4565 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4567 Added overriden DocCommentHeader.
4569 Added overriden DocCommentHeader and GenerateDocComment().
4571 2004-12-01 Miguel de Icaza <miguel@ximian.com>
4573 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4574 unwrapping the enumeration values, chain to
4575 DoConstantNumericPromotions again, so we can promote things to the
4576 fundamental types (takes care of enums that are bytes, sbytes).
4580 2004-12-01 Raja R Harinath <rharinath@novell.com>
4582 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4583 Fix long-standing bug in type-lookup. Use FindType instead of
4584 LookupType when ec.ResolvingTypeTree.
4585 (Attribute.ResolveType, Attribute.Resolve)
4586 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4588 (Attributes.Search): Remove internal version. Update.
4589 (Attributes.SearchMulti): Update.
4590 (Attributes.GetClsCompliantAttribute): Remove.
4591 (Attributes.GetIndexerNameAttribute): Remove.
4592 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4593 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4594 * class.cs (Indexer.Define): Likewise.
4596 2004-12-01 Marek Safar <marek.safar@seznam.cz>
4599 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4600 MarshallByReference members access.
4602 * expression.cs: Use CheckMarshallByRefAccess;
4603 Better error CS0197 message.
4605 * report.cs: Print whole related error message.
4607 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4609 * class (GetClassBases): Better error 60 report.
4610 (EventProperty): Disabled warning 67 detection.
4612 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4615 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4617 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4620 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4623 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4625 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4627 2004-11-26 Miguel de Icaza <miguel@ximian.com>
4629 * attribute.cs (Attribute.Resolve): Refine error reporting and
4630 report a cs0117 if the identifier does not exist, to distinguish
4631 from 0617 which is a miss-use of the actual identifier.
4633 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4634 between cs0070 and cs0079.
4636 * class.cs (MemberBase.DoDefine): When reporting a wrong
4637 accessibility level, we use MethodCore to compare instead of
4638 Method (this was a regression in some refactoring effort).
4640 So now we correctly report cs0056 again.
4642 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4643 testing the target_type (which was known to be object_type) and
4644 not the source type (which is anonymous_method).
4646 Fixed reporting of error cs1660.
4648 * expression.cs (UserCast.Source): Expose the underlying cast.
4650 * statement.cs (Switch.SwitchGoverningType): Sort the list of
4651 allowed types to find a match to int32 first (most common).
4653 In addition, it ignores any ImplicitUserConversions that did an
4654 internal implicit conversion (as the switch statement allows only
4655 one integral conversion to exist).
4657 * class.cs (PartialContainer.Create): rename `name' to
4658 `member_name' for clarity. Then replace the string calls with a
4659 call to MemberName.GetPartialName, as now using
4660 MemberName.ToString is an error (this is due to the side effects
4661 it had, that were fixed in the past).
4663 This will restore the error reporting on a number of partial class
4664 errors that were missusing this (and getting an exception as a
4665 results, which is now just a plain textual warning, because
4666 yyparse debug output would crash otherwise).
4668 2004-11-26 Raja R Harinath <rharinath@novell.com>
4670 * Makefile (PROGRAM_INSTALL_DIR): Remove.
4672 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4674 * rootcontext.cs (LookupType): Make sure to cache lookups that
4675 don't give us a negative result. This saves about 5% of corlib
4678 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4680 * report.cs (AbstractMessage.Print): messages are sent to stderr
4682 * class.cs (TypeContainer.GetClassBases): It is an error to have a
4683 non-interface in the list of interfaces (at this point, either
4684 parent was properly set, or a base class is being listed in the
4685 interfaces section).
4687 This flags error 1722, and resolves the crash from bug 69259.
4689 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4691 * statement.cs (Using.EmitExpressionFinally): make this work right
4692 for valuetypes. Fixes 69926.
4694 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4696 * const.cs (Const.ChangeType): Cope with the "0 literal can be
4697 converted to an enum" here, before we try to change the underlying
4698 type. This code exists, but it is a different code path than the
4699 one used while encoding constants.
4701 (ImplicitReferenceConversionExists): In addition, resynchronized
4702 the code here, so it matches the same code in
4703 ImplicitReferenceConversionExists for the `from any class-type S
4704 to any interface-type T'.
4706 2004-11-25 Marek Safar <marek.safar@seznam.cz>
4708 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4710 2004-11-24 Miguel de Icaza <miguel@ximian.com>
4712 * cs-parser.jay: Use verbosity accordingly.
4714 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4716 * expression.cs (Unary.ResolveOperator): Do not report warning;
4717 AddressOf reads from variable.
4719 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4721 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4725 * attribute.cs (Attributable): Removed CheckTargets.
4726 (Attributes.Emit): Explicit attribute targets are tested here.
4728 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4729 not enabled for interfaces.
4731 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4732 (GetAssemblyName): Ouch next bug there.
4734 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4736 * expression.cs: Error 275 added.
4738 2004-11-23 Marek Safar <marek.safar@seznam.cz>
4740 Fix bug #69177 (Implemented decimal constant support)
4742 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4743 (BinaryFold): Add DecimalConstant.
4745 * const.cs (Define): Decimal constant
4747 (ChangeType): Add decimal type handling.
4748 (LookupConstantValue): Don't set value for decimal type but
4749 emit DecimalConstantAttribute. Needed for constant optimization.
4751 * constant.cs (ToDecimal): New method.
4752 (ConvertToDecimal): New method.
4753 (IntConstant): Implemented ConvertToDecimal.
4754 (DecimalConstant.Emit): Emit optimized version for decimals in
4757 * expression.cs (ResolveOperator): Changed order of constant
4758 reduction to work correctly with native types which have
4759 overloaded operators.
4760 (ResolveMemberAccess): Extract constant value from attribute
4763 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4765 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4766 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4767 (ChangeType): Decimal is special.
4768 (TypeToCoreType): Add decimal type.
4770 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4772 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4775 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4777 * class.cs (EventField.ApplyAttributeBuilder): Fix error
4780 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4782 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4784 * pending.cs (PendingImplementation): Grab only interfaces.
4786 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4788 * statement.cs (ForeachHelperMethods): Add location member and
4789 error 202 detection.
4791 2004-11-18 Marek Safar <marek.safar@seznam.cz>
4793 * expression.cs (DoResolveBase): Fixed wrong warning for out
4796 2004-12-04 Martin Baulig <martin@ximian.com>
4798 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4799 to check whether the conversion is ok.
4801 * typemanager.cs (TypeManager.GetTypeArguments): Just return
4802 `Type.EmptyTypes' if we're not a generic TypeContainer.
4804 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4806 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4807 old bug: when converting from the null literal to a pointer,
4808 return an EmptyCast, not the NullLiteral.
4810 This fixes #69921, the recent null_type changes probably made this
4813 2004-12-03 Martin Baulig <martin@ximian.com>
4815 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4816 method as our child, call AnonymousMethod.Compatible() on it.
4818 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4820 * class.cs (FieldBase): Use an unused bit field from the field to
4821 encode the `has_offset' property from the FieldMember. This saves
4822 a couple of Ks on bootstrap compilation.
4824 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4825 method as our child, return the AnonymousMethod resolved
4828 * expression.cs (New.DoResolve): Allow return values from
4829 NewDelegate to also include AnonymousMethods.
4833 2004-11-29 Raja R Harinath <rharinath@novell.com>
4835 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4837 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4838 System.Runtime.InteropServices._Exception, since it's a base
4839 interface of the core type System.Exception in the net_2_0 profile.
4841 2004-11-27 Martin Baulig <martin@ximian.com>
4843 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4845 2004-11-26 Raja R Harinath <rharinath@novell.com>
4847 * Makefile: Convert to use executable.make.
4848 * gmcs.exe.sources: New.
4850 2004-11-25 Martin Baulig <martin@ximian.com>
4852 * expression.cs (Invocation.InferType): Added support for byref types.
4854 2004-11-25 Martin Baulig <martin@ximian.com>
4856 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4857 in TypeManager.TypeToCoreType().
4859 2004-11-25 Martin Baulig <martin@ximian.com>
4861 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4862 "Dispose" method from the `current_type'.
4863 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4864 DoDefineMembers() instead of using the MethodBuilder; this is
4865 required for generic iterators.
4867 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4869 2004-11-24 Martin Baulig <martin@ximian.com>
4871 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4873 2004-11-20 Martin Baulig <martin@ximian.com>
4875 * expression.cs (Invocation.InferType): Correctly infer generic
4876 instances; see gen-103.cs.
4877 (Invocation.InferTypeArguments): If a generic method doesn't have
4878 any unbound type parameters, we don't need to infer anything.
4880 2004-11-19 Raja R Harinath <rharinath@novell.com>
4882 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4884 2004-11-17 Raja R Harinath <rharinath@novell.com>
4886 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4887 (TypeHandle.GetMemberCache): New.
4888 (TypeHandle.TypeHandle): Update.
4889 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4890 (TypeManager.LookupParentInterfacesCache):
4891 Rename from LookupInterfaceCache. Optimize slightly.
4892 (TypeManager.MemberLookup_FindMembers): Update.
4893 * decl.cs (MemberCache.MemberCache): Set Container to null in the
4895 (AddCacheContents): Rename from AddHashtable.
4896 * class.cs (TypeContainer.parent_container): Remove.
4897 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4898 (TypeContainer.DoDefineMembers): Don't initialize it.
4899 Update to name changes.
4901 2004-11-17 Miguel de Icaza <miguel@ximian.com>
4903 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4904 that factors the code to check access modifiers on override.
4906 (PropertyBase): Use the code here.
4908 Patch from Lluis S'anchez, fixes bug #69361.
4910 2004-11-15 Miguel de Icaza <miguel@ximian.com>
4912 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4913 routine that is used to report the use of a captured variable
4914 whose address has been taken.
4916 There are two checks: one when variables are being captured and
4917 the other check is when the address of a variable is taken.
4919 (because an anonymous methods might be resolved before *or* after
4920 the address has been taken) and
4922 * expression.cs (Conditional.DoResolve): Remove the special
4923 casing that Martin added to trueExpr and falseExpr being both
4924 NullLiteral. We get the right behavior now just by introducing
4925 the null_type into the compiler.
4927 * convert.cs (ExplicitConversion): Change the code to use
4928 null_type instead of testing `expr is NullLiteral'.
4929 (ImplicitConversionStandard): use null_type too.
4930 (ImplicitReferenceConversionExists): use null_type too.
4931 (ImplicitReferenceConversion): use null_type too.
4933 * literal.cs: The type of `NullLiteral' is now null_type instead
4935 (Resolve): Set the type here.
4937 * typemanager.cs: Introduce null_type.
4939 2004-11-18 Martin Baulig <martin@ximian.com>
4942 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
4944 2004-11-18 Martin Baulig <martin@ximian.com>
4946 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
4948 2004-11-18 Martin Baulig <martin@ximian.com>
4950 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
4951 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
4952 call ResolveConstructedType() on it to resolve it without checking
4954 (Constraints.ResolveTypes): Check them here.
4955 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
4956 but don't check constraints.
4957 (ConstructedType.ResolveAsTypeTerminal): Override this and also
4958 check constraints here.
4959 (ConstructedType.ResolveConstructedType): New public method. This
4960 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
4961 resolve ourselves without checking constraints.
4963 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
4965 2004-11-18 Martin Baulig <martin@ximian.com>
4968 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
4970 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
4972 2004-11-18 Martin Baulig <martin@ximian.com>
4974 * ecore.cs (TypeExpr.ResolveType): Removed.
4975 (Expression.ResolveAsTypeTerminal): We always return a fully
4976 resolved `TypeExpr', so we can just access its `Type'.
4978 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
4980 2004-11-17 Martin Baulig <martin@ximian.com>
4982 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
4983 sure we don't return any unresolved TypeExpr's.
4984 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
4986 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
4988 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
4989 unresolved `ConstructedType's.
4991 2004-11-17 Martin Baulig <martin@ximian.com>
4993 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
4995 2004-11-17 Martin Baulig <martin@ximian.com>
4998 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
5000 * decl.cs (DeclSpace.ResolveType): Removed.
5001 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
5003 2004-11-17 Martin Baulig <martin@ximian.com>
5005 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
5006 direction, like FindMembers() does. Fixes #69546, testcase is in
5009 2004-11-16 Martin Baulig <martin@ximian.com>
5011 This is based on a patch from Marek Safar, see bug #69082.
5012 Fixes bugs #63705 and #67130.
5014 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
5015 method; create a MemberCache for an interface type and cache the
5018 * decl.cs (IMemberContainer.ParentContainer): Removed.
5019 (IMemberContainer.ParentCache): New property.
5020 (MemberCache.SetupCacheForInterface): Removed.
5021 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
5022 to create a cache for an interface's "parent".
5024 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
5027 2004-11-14 Ben Maurer <bmaurer@ximian.com>
5029 * statement.cs: Avoid adding bools to a hashtable.
5031 2004-11-15 Martin Baulig <martin@ximian.com>
5033 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
5035 2004-11-11 Martin Baulig <martin@ximian.com>
5037 * typemanager.cs (TypeManager.GetMethodName): New method.
5039 * class.cs (MethodData.Define): Include the generic arity in the
5040 name of an explicit interface; also add it to the method name.
5042 * pending.cs (PendingImplementation.InterfaceMethod): The method
5043 name now includes the generic arity.
5045 2004-11-07 Miguel de Icaza <miguel@ximian.com>
5047 * expression.cs (Invocation.OverloadResolve): Flag error if we are
5048 calling an unsafe method from a safe location.
5050 2004-11-06 Marek Safar <marek.safar@seznam.cz>
5053 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
5055 2004-11-06 Miguel de Icaza <miguel@ximian.com>
5057 * namespace.cs (VerifyUsing): use GetPartialName instead of
5060 2004-11-05 Miguel de Icaza <miguel@ximian.com>
5062 * statement.cs (Return.Resolve): Fix regression in typo: if
5063 `in_exc', we have to request a NeedReturnLabel, this was a typo
5064 introduced in the anonymous method check-in. Fixes #69131.
5066 * Indexers were using the ShortName when defining themselves,
5067 causing a regression in the compiler bootstrap when applying the
5068 patch from 2004-11-02 (first part), now they use their full name
5069 and the bug is gone.
5071 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
5073 * driver.cs: Strip the path from the names of embedded resources. Fixes
5076 2004-11-04 Raja R Harinath <rharinath@novell.com>
5078 Fix error message regression: cs0104-2.cs.
5079 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
5080 (AliasEntry.Resolve): Update.
5081 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
5083 (RootContext.LookupType): Update.
5085 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
5087 * cs-parser.jay: Add support for handling accessor modifiers
5088 * class: Add support port accessor modifiers and error checking,
5089 define PropertyMethod.Define as virtual (not abstract anymore)
5090 * ecore.cs: Add checking for proeprties access with access modifiers
5091 * iterators.cs: Modify Accessor constructor call based in the modified
5093 2004-11-02 Ben Maurer <bmaurer@ximian.com>
5095 * expression.cs (StringConcat): Handle being called twice,
5096 as when we have a concat in a field init with more than two
5099 2004-11-02 Miguel de Icaza <miguel@ximian.com>
5101 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5102 special case explicit implementations, we should always produce
5103 the .property or .event declaration.
5105 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5106 since it will not return correct data if people use this
5107 unresolved in the presence of using statements (see test-313).
5109 * class.cs (MethodData.Define): If we are an explicit interface
5110 implementation, set the method name to the full name of the
5111 interface plus the name of the method.
5113 Notice that using the method.MethodName.GetFullName() does not
5114 work, as it will only contain the name as declared on the source
5115 file (it can be a shorthand in the presence of using statements)
5116 and not the fully qualifed type name, for example:
5120 class D : ICloneable {
5121 object ICloneable.Clone () {
5125 Would produce a method called `ICloneable.Clone' instead of
5126 `System.ICloneable.Clone'.
5128 * namespace.cs (Alias.Resolve): Use GetPartialName.
5130 2004-11-01 Marek Safar <marek.safar@seznam.cz>
5132 * cs-parser.jay: Add error 1055 report.
5134 2004-11-01 Miguel de Icaza <miguel@ximian.com>
5136 * assign.cs (Assign.DoResolve): Only do the transform of
5137 assignment into a New if the types are compatible, if not, fall
5138 through and let the implicit code deal with the errors and with
5139 the necessary conversions.
5141 2004-11-01 Marek Safar <marek.safar@seznam.cz>
5143 * cs-parser.jay: Add error 1031 report.
5145 * cs-tokenizer.cs: Add location for error 1038.
5147 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5149 * cs-parser.jay: Add error 1016 report.
5151 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5153 * cs-parser.jay: Add errors 1575,1611 report.
5155 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5157 * cs-parser.jay: Add error 1001 report.
5159 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5162 * attribute.cs (GetMarshal): Add method argument for
5163 caller identification.
5165 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5166 agument for GetMarshal and RuntimeMissingSupport.
5168 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5170 * attribute.cs (ExtractSecurityPermissionSet): Removed
5171 TypeManager.code_access_permission_type.
5173 * typemanager.cs: Removed TypeManager.code_access_permission_type.
5175 2004-10-27 Miguel de Icaza <miguel@ximian.com>
5177 * expression.cs (LocalVariableReference.DoResolveLValue): Check
5178 for obsolete use of a variable here. Fixes regression on errors
5179 cs0619-25 and cs0619-26.
5181 2004-10-27 Marek Safar <marek.safar@seznam.cz>
5183 Fix #62358, implemented security attribute encoding.
5185 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5186 Tests permitted SecurityAction for assembly or other types.
5187 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5188 data from SecurityPermissionAttribute to PermisionSet class.
5190 * class.cs (ApplyAttributeBuilder): Added special handling
5191 for System.Security.Permissions.SecurityAttribute based types.
5193 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5194 special handling for System.Security.Permissions.SecurityAttribute
5197 * enum.cs (ApplyAttributeBuilder): Added special handling
5198 for System.Security.Permissions.SecurityAttribute based types.
5200 * parameter.cs (ApplyAttributeBuilder): Added special handling
5201 for System.Security.Permissions.SecurityAttribute based types.
5203 * rootcontext.cs: Next 2 core types.
5205 * typemanager.cs (TypeManager.security_permission_attr_type):
5206 Built in type for the SecurityPermission Attribute.
5207 (code_access_permission_type): Build in type.
5209 2004-10-17 Miguel de Icaza <miguel@ximian.com>
5211 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5212 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5213 all of this information into
5214 EmitContext.EmitCapturedVariableInstance.
5216 * codegen.cs (EmitCapturedVariableInstance): move here the
5217 funcionality of emitting an ldarg.0 in the presence of a
5218 remapping. This centralizes the instance emit code.
5220 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5221 then emit a load of this: it means that we have reached the
5222 topmost ScopeInfo: the one that contains the pointer to the
5223 instance of the class hosting the anonymous method.
5225 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5226 captures to the topmost CaptureContext.
5228 2004-10-12 Miguel de Icaza <miguel@ximian.com>
5230 * expression.cs (LocalVariableReference): Move the knowledge about
5231 the iterators into codegen's EmitCapturedVariableInstance.
5233 2004-10-11 Miguel de Icaza <miguel@ximian.com>
5235 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5236 all code paths return a value from an anonymous method (it is the
5237 same as the 161 error, but for anonymous methods).
5239 2004-10-08 Miguel de Icaza <miguel@ximian.com>
5241 The introduction of anonymous methods in the compiler changed
5242 various ways of doing things in the compiler. The most
5243 significant one is the hard split between the resolution phase
5244 and the emission phases of the compiler.
5246 For instance, routines that referenced local variables no
5247 longer can safely create temporary variables during the
5248 resolution phase: they must do so from the emission phase,
5249 since the variable might have been "captured", hence access to
5250 it can not be done with the local-variable operations from the runtime.
5254 (Block.Flags): New flag `IsTopLevel' to indicate that this block
5255 is a toplevel block.
5257 (ToplevelBlock): A new kind of Block, these are the blocks that
5258 are created by the parser for all toplevel method bodies. These
5259 include methods, accessors and anonymous methods.
5261 These contain some extra information not found in regular blocks:
5262 A pointer to an optional CaptureContext (for tracking captured
5263 local variables and parameters). A pointer to the parent
5266 (Return.Resolve): Catch missmatches when returning a value from an
5267 anonymous method (error 1662).
5268 Invoke NeedReturnLabel from the Resolve phase instead of the emit
5271 (Break.Resolve): ditto.
5273 (SwitchLabel): instead of defining the labels during the
5274 resolution phase, we now turned the public ILLabel and ILLabelCode
5275 labels into methods called GetILLabelCode() and GetILLabel() that
5276 only define the label during the Emit phase.
5278 (GotoCase): Track the SwitchLabel instead of the computed label
5279 (its contained therein). Emit the code by using
5280 SwitchLabel.GetILLabelCode ().
5282 (LocalInfo.Flags.Captured): A new flag has been introduce to track
5283 whether the Local has been captured or not.
5285 (LocalInfo.IsCaptured): New property, used to tell whether the
5286 local has been captured.
5288 * anonymous.cs: Vastly updated to contain the anonymous method
5291 The main classes here are: CaptureContext which tracks any
5292 captured information for a toplevel block and ScopeInfo used to
5293 track the activation frames for various local variables.
5295 Each toplevel block has an optional capture context associated
5296 with it. When a method contains an anonymous method both the
5297 toplevel method and the anonymous method will create a capture
5298 context. When variables or parameters are captured, they are
5299 recorded on the CaptureContext that owns them, for example:
5303 MyDelegate d = delegate {
5308 Here `a' will be recorded as captured on the toplevel
5309 CapturedContext, the inner captured context will not have anything
5310 (it will only have data if local variables or parameters from it
5311 are captured in a nested anonymous method.
5313 The ScopeInfo is used to track the activation frames for local
5314 variables, for example:
5316 for (int i = 0; i < 10; i++)
5317 for (int j = 0; j < 10; j++){
5318 MyDelegate d = delegate {
5323 At runtime this captures a single captured variable `i', but it
5324 captures 10 different versions of the variable `j'. The variable
5325 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5326 recorded on a child.
5328 The toplevel ScopeInfo will also track information like the `this'
5329 pointer if instance variables were referenced (this is necessary
5330 as the anonymous method lives inside a nested class in the host
5331 type of the method).
5333 (AnonymousMethod): Expanded to track the Toplevel, implement
5334 `AnonymousMethod.Compatible' to tell whether an anonymous method
5335 can be converted to a target delegate type.
5337 The routine now also produces the anonymous method content
5339 (AnonymousDelegate): A helper class that derives from
5340 DelegateCreation, this is used to generate the code necessary to
5341 produce the delegate for the anonymous method that was created.
5343 * assign.cs: API adjustments for new changes in
5344 Convert.ImplicitStandardConversionExists.
5346 * class.cs: Adjustments to cope with the fact that now toplevel
5347 blocks are of type `ToplevelBlock'.
5349 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5350 insteda of standard blocks.
5352 Flag errors if params arguments are passed to anonymous methods.
5354 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5355 `CurrentAnonymousMethod' which points to the current Anonymous
5356 Method. The variable points to the AnonymousMethod class that
5357 holds the code being compiled. It is set in the new EmitContext
5358 created for the anonymous method.
5360 (EmitContext.Phase): Introduce a variable and an enumeration to
5361 assist in enforcing some rules about when and where we are allowed
5362 to invoke certain methods (EmitContext.NeedsReturnLabel is the
5363 only one that enfonces this right now).
5365 (EmitContext.HaveCaptureInfo): new helper method that returns
5366 whether we have a CapturedContext initialized.
5368 (EmitContext.CaptureVariable): New method used to register that a
5369 LocalInfo must be flagged for capturing.
5371 (EmitContext.CapturedParameter): New method used to register that a
5372 parameters must be flagged for capturing.
5374 (EmitContext.CapturedField): New method used to register that a
5375 field must be flagged for capturing.
5377 (EmitContext.HaveCapturedVariables,
5378 EmitContext.HaveCapturedFields): Return whether there are captured
5379 variables or fields.
5381 (EmitContext.EmitMethodHostInstance): This is used to emit the
5382 instance for the anonymous method. The instance might be null
5383 (static methods), this (for anonymous methods that capture nothing
5384 and happen to live side-by-side with the current method body) or a
5385 more complicated expression if the method has a CaptureContext.
5387 (EmitContext.EmitTopBlock): Routine that drives the emission of
5388 code: it will first resolve the top block, then emit any metadata
5389 and then emit the code. The split is done so that we can extract
5390 any anonymous methods and flag any captured variables/parameters.
5392 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5393 during this phase, the ILGenerator should not be used as labels
5394 and local variables declared here might not be accessible to any
5395 code that is part of an anonymous method.
5397 Exceptions to this include the temporary variables that are
5398 created by some statements internally for holding temporary
5401 (EmitContext.EmitMeta): New routine, in charge of emitting all the
5404 (EmitContext.TemporaryReturn): This method is typically called
5405 from the Emit phase, and its the only place where we allow the
5406 ReturnLabel to be defined other than the EmitMeta. The reason is
5407 that otherwise we would have to duplicate a lot of logic in the
5408 Resolve phases of various methods that today is on the Emit
5411 (EmitContext.NeedReturnLabel): This no longer creates the label,
5412 as the ILGenerator is not valid during the resolve phase.
5414 (EmitContext.EmitThis): Extended the knowledge in this class to
5415 work in anonymous methods in addition to iterators.
5417 (EmitContext.EmitCapturedVariableInstance): This emits whatever
5418 code is necessary on the stack to access the instance to a local
5419 variable (the variable will be accessed as a field).
5421 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5422 EmitContext.EmitAddressOfParameter): Routines to support
5423 parameters (not completed at this point).
5425 Removals: Removed RemapLocal and RemapLocalLValue. We probably
5426 will also remove the parameters.
5428 * convert.cs (Convert): Define a `ConstantEC' which points to a
5429 null. This is just to prefity some code that uses
5430 ImplicitStandardConversion code and do not have an EmitContext
5433 The idea is to flag explicitly that at that point in time, it is
5434 known that the conversion will not trigger the delegate checking
5435 code in implicit conversions (which requires a valid
5438 Everywhere: pass new EmitContext parameter since
5439 ImplicitStandardConversionExists now requires it to check for
5440 anonymous method conversions.
5442 (Convert.ImplicitStandardConversionExists): If the type of an
5443 expression is the anonymous_method_type, and the type is a
5444 delegate, we invoke the AnonymousMethod.Compatible method to check
5445 whether an implicit conversion is possible.
5447 (Convert.ImplicitConversionStandard): Only do implicit method
5448 group conversions if the language level is not ISO_1.
5450 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5451 MethodInfo for the Invoke method. used by Delegate and
5454 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5455 method conversions if the target type is a delegate.
5457 Removed extra debugging nops.
5459 (LocalVariableReference): Turn the `local_info' into a public
5462 Add `prepared' field, the same hack used for FieldExprs to cope
5463 with composed assignments, as Local variables do not necessarily
5464 operate purely on the stack as they used to: they can be captured
5467 Add `temp' for a temporary result, like fields.
5469 Refactor DoResolve and DoResolveLValue into DoResolveBase.
5471 It now copes with Local variables that are captured and emits the
5472 proper instance variable to load it from a field in the captured
5475 (ParameterReference.DoResolveBase): During the resolve phase,
5476 capture parameters if we are in an anonymous method.
5478 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5479 anonymous method, use the EmitContext helper routines to emit the
5480 parameter reference.
5482 * iterators.cs: Set RemapToProxy to true/false during the
5485 * parameters.cs (GetParameterByName): New helper method.
5487 * typemanager.cs (anonymous_method_type) a new type that
5488 represents an anonyous method. This is always an internal type,
5489 used as a fencepost to test against the anonymous-methodness of an
5492 2004-10-20 Marek Safar <marek.safar@seznam.cz>
5494 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5496 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5498 2004-11-10 Martin Baulig <martin@ximian.com>
5500 * expression.cs (Invocation.BetterFunction): If two methods have
5501 equal parameter types, but only one of them is generic, the
5502 non-generic one wins.
5503 (New.DoResolve): Don't set `is_struct' to false if we're a generic
5504 instance; just use `Type.IsValueType' to determine whether
5505 something is a struct or not.
5506 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
5507 so we can be called multiple times.
5509 2004-11-10 Martin Baulig <martin@ximian.com>
5511 * generic.cs (TypeParameter.DefineConstraints): New public method.
5512 (TypeParameter.CheckAccessLevel): Override this and return true.
5513 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
5514 override ResolveType() anymore.
5515 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
5517 2004-11-10 Martin Baulig <martin@ximian.com>
5519 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
5520 call DeclSpace.ResolveNestedType() on it.
5522 2004-11-10 Martin Baulig <martin@ximian.com>
5524 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
5525 non-null, call ParameterModifier() on it.
5527 2004-11-10 Martin Baulig <martin@ximian.com>
5530 (Iterators): Added `current_type' and `this_type' fields.
5531 (Iterators.DefineIterator): Create a new EmitContext and store it
5532 in `ec'; compute `this_type'.
5534 2004-11-10 Martin Baulig <martin@ximian.com>
5537 (TypeManager.IsPrivateAccessible): New public method.
5538 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
5540 2004-11-10 Martin Baulig <martin@ximian.com>
5542 * class.cs (TypeContainer.DefineType): Call
5543 TypeBuilder.DefineGenericParameters() before resolving the type
5545 (MethodData.parent_method): New protected field.
5546 (MethodData..ctor): Added `MethodInfo parent_method' argument.
5547 (MethodData.Define): Compute `parent_method'.
5550 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5551 (MemberCore.GetClsCompliantAttributeValue): Likewise.
5552 (DeclSpace.ec): New protected field; store the EmitContext here.
5553 (DeclSpace.EmitContext): New public property.
5554 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
5555 (DeclSpace.ResolveNestedType): New public method.
5556 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
5557 (DeclSpace.NestedAccessible): Added `Type tb' argument.
5558 (DeclSpace.FamilyAccessible): Likewise.
5559 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
5560 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5563 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
5566 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5567 (Enum.Emit): Don't create a new EmitContext.
5569 2004-10-18 Martin Baulig <martin@ximian.com>
5571 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5572 `Type' directly, but call ResolveType() on it.
5573 (Catch.Resolve): Likewise.
5574 (Foreach.Resolve): Likewise.
5576 2004-10-18 Martin Baulig <martin@ximian.com>
5578 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5579 `Type' directly, but call ResolveType() on it.
5580 (Probe.DoResolve): Likewise.
5581 (ArrayCreation.LookupType): Likewise.
5582 (TypeOf.DoResolve): Likewise.
5583 (SizeOf.DoResolve): Likewise.
5585 2004-10-18 Raja R Harinath <rharinath@novell.com>
5587 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5590 2004-10-17 John Luke <john.luke@gmail.com>
5592 * class.cs (Operator.GetSignatureForError): use CSharpName
5594 * parameter.cs (Parameter.GetSignatureForError): Returns
5595 correct name even if was not defined.
5597 2004-10-13 Raja R Harinath <rharinath@novell.com>
5600 * class.cs (TypeContainer.EmitContext): New property.
5601 (DefineNestedTypes): Create an emitcontext for each part.
5602 (MethodCore.DoDefineParameters): Use container's emitcontext.
5603 Pass type array to InternalParameters.
5604 (MemberBase.DoDefine): Use container's emitcontext.
5605 (FieldMember.Define): Likewise.
5606 (Event.Define): Likewise.
5607 (SetMethod.GetParameterInfo): Change argument to EmitContext.
5608 Pass type array to InternalParameters.
5609 (SetIndexerMethod.GetParameterInfo): Likewise.
5610 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5611 * delegate.cs (Define): Pass emitcontext to
5612 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
5613 array to InternalParameters.
5614 * expression.cs (ParameterReference.DoResolveBase): Pass
5615 emitcontext to GetParameterInfo.
5616 (ComposedCast.DoResolveAsTypeStep): Remove check on
5617 ec.ResolvingTypeTree.
5618 * parameter.cs (Parameter.Resolve): Change argument to
5619 EmitContext. Use ResolveAsTypeTerminal.
5620 (Parameter.GetSignature): Change argument to EmitContext.
5621 (Parameters.ComputeSignature): Likewise.
5622 (Parameters.ComputeParameterTypes): Likewise.
5623 (Parameters.GetParameterInfo): Likewise.
5624 (Parameters.ComputeAndDefineParameterTypes): Likewise.
5625 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
5626 * support.cs (InternalParameters..ctor): Remove variant that takes
5628 * typemanager.cs (system_intptr_expr): New.
5629 (InitExpressionTypes): Initialize it.
5631 2004-10-12 Chris Toshok <toshok@ximian.com>
5633 * cs-parser.jay: fix location for try_statement and catch_clause.
5635 2004-10-18 Martin Baulig <martin@ximian.com>
5637 * class.cs (FieldMember.Define): Don't access the TypeExpr's
5638 `Type' directly, but call ResolveType() on it.
5639 (MemberBase.DoDefine): Likewise.
5641 * expression.cs (New.DoResolve): Don't access the TypeExpr's
5642 `Type' directly, but call ResolveType() on it.
5643 (ComposedCast.DoResolveAsTypeStep): Likewise.
5645 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5646 `Type' directly, but call ResolveType() on it.
5648 2004-10-17 John Luke <john.luke@gmail.com>
5650 * class.cs (Operator.GetSignatureForError): use CSharpName
5652 * parameter.cs (Parameter.GetSignatureForError): Returns
5653 correct name even if was not defined.
5655 2004-10-13 Raja R Harinath <rharinath@novell.com>
5658 * class.cs (TypeContainer.EmitContext): New property.
5659 (DefineNestedTypes): Create an emitcontext for each part.
5660 (MethodCore.DoDefineParameters): Use container's emitcontext.
5661 Pass type array to InternalParameters.
5662 (MemberBase.DoDefine): Use container's emitcontext.
5663 (FieldMember.Define): Likewise.
5664 (Event.Define): Likewise.
5665 (SetMethod.GetParameterInfo): Change argument to EmitContext.
5666 Pass type array to InternalParameters.
5667 (SetIndexerMethod.GetParameterInfo): Likewise.
5668 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5669 * delegate.cs (Define): Pass emitcontext to
5670 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
5671 array to InternalParameters.
5672 * expression.cs (ParameterReference.DoResolveBase): Pass
5673 emitcontext to GetParameterInfo.
5674 (ComposedCast.DoResolveAsTypeStep): Remove check on
5675 ec.ResolvingTypeTree.
5676 * parameter.cs (Parameter.Resolve): Change argument to
5677 EmitContext. Use ResolveAsTypeTerminal.
5678 (Parameter.GetSignature): Change argument to EmitContext.
5679 (Parameters.ComputeSignature): Likewise.
5680 (Parameters.ComputeParameterTypes): Likewise.
5681 (Parameters.GetParameterInfo): Likewise.
5682 (Parameters.ComputeAndDefineParameterTypes): Likewise.
5683 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
5684 * support.cs (InternalParameters..ctor): Remove variant that takes
5686 * typemanager.cs (system_intptr_expr): New.
5687 (InitExpressionTypes): Initialize it.
5689 2004-10-12 Chris Toshok <toshok@ximian.com>
5691 * cs-parser.jay: fix location for try_statement and catch_clause.
5693 2004-10-07 Raja R Harinath <rharinath@novell.com>
5695 More DeclSpace.ResolveType avoidance.
5696 * decl.cs (MemberCore.InUnsafe): New property.
5697 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
5698 with newly created EmitContext.
5699 (FieldMember.Define): Likewise.
5700 * delegate.cs (Delegate.Define): Likewise.
5701 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5702 only if normal name-lookup fails.
5703 (TypeExpr.DoResolve): Enable error-checking.
5704 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5705 (SizeOf.DoResolve): Likewise.
5706 (ComposedCast.DoResolveAsTypeStep): Likewise.
5707 (StackAlloc.DoResolve): Likewise.
5708 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5709 (Block.Unsafe): New property.
5710 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5711 (Unsafe): Set 'unsafe' flag of contained block.
5712 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5713 (Fixed.Resolve): Likewise.
5714 (Catch.Resolve): Likewise.
5715 (Using.ResolveLocalVariableDecls): Likewise.
5716 (Foreach.Resolve): Likewise.
5718 2004-10-05 John Luke <john.luke@gmail.com>
5720 * cs-parser.jay: add location to error CS0175
5722 2004-10-04 Miguel de Icaza <miguel@ximian.com>
5724 * ecore.cs (Expression.Constantity): Add support for turning null
5727 * const.cs (Const.Define): Allow constants to be reference types
5728 as long as the value is Null.
5730 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
5732 * namespace.cs (NamespaceEntry.Using): No matter which warning
5733 level is set, check if this namespace name has already been added.
5735 2004-10-03 Ben Maurer <bmaurer@ximian.com>
5737 * expression.cs: reftype [!=]= null should always use br[true,false].
5740 2004-10-03 Marek Safar <marek.safar@seznam.cz>
5743 * attribute.cs: Enum conversion moved to
5744 GetAttributeArgumentExpression to be applied to the all
5747 2004-10-01 Raja R Harinath <rharinath@novell.com>
5749 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5750 * class.c (TypeContainer.DefineType): Flag error if
5751 base types aren't accessible due to access permissions.
5752 * decl.cs (DeclSpace.ResolveType): Move logic to
5753 Expression.ResolveAsTypeTerminal.
5754 (DeclSpace.ResolveTypeExpr): Thin layer over
5755 Expression.ResolveAsTypeTerminal.
5756 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5757 Refactor code into NestedAccess. Use it.
5758 (DeclSpace.NestedAccess): New.
5759 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5760 argument to silence errors. Check access permissions.
5761 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5762 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5763 (Cast.DoResolve): Likewise.
5764 (New.DoResolve): Likewise.
5765 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5766 (TypeOf.DoResolve): Likewise.
5768 * expression.cs (Invocation.BetterConversion): Return the Type of
5769 the better conversion. Implement section 14.4.2.3 more faithfully.
5770 (Invocation.BetterFunction): Make boolean. Make correspondence to
5771 section 14.4.2.2 explicit.
5772 (Invocation.OverloadResolve): Update.
5773 (Invocation): Remove is_base field.
5774 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
5775 (Invocation.Emit): Likewise.
5777 2004-09-24 Marek Safar <marek.safar@seznam.cz>
5779 * cs-parser.jay: Reverted 642 warning fix.
5781 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5784 * decl.cs (FindMemberWithSameName): Indexer can have more than
5787 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5789 * expression.cs (LocalVariableReference.DoResolveLValue):
5790 Do not report warning 219 for out values.
5791 (EmptyExpression.Null): New member to avoid extra allocations.
5793 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5795 * cs-parser.jay: Fix wrong warning 642 report.
5797 * cs-tokenizer.cs (CheckNextToken): New helper;
5798 Inspect next character if is same as expected.
5800 2004-09-23 Martin Baulig <martin@ximian.com>
5802 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5803 (Convert.ImplicitReferenceConversionExists): Likewise.
5805 2004-11-09 Raja R Harinath <rharinath@novell.com>
5807 * Makefile (DISTFILES): Comment out a few missing files.
5809 2004-10-29 Raja R Harinath <rharinath@novell.com>
5811 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5812 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
5813 (gmcs.exe): Invoke bootstrap-libs.
5814 (clean-local): Clean the net_2_0_bootstrap profile too.
5815 (PROGRAM_INSTALL_DIR): New.
5816 (install-local): Use it.
5818 2004-10-13 Martin Baulig <martin@ximian.com>
5820 * generic.cs (TypeManager.InflatedConstraints): New nested class.
5821 (TypeParameter.DefineType): If we're a method type parameter and
5822 that method is overriding something, "inflate" its constraints.
5824 2004-10-12 Martin Baulig <martin@ximian.com>
5826 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5827 and have type arguments, create and resolve a ConstructedType.
5829 2004-10-12 Martin Baulig <martin@ximian.com>
5831 * decl.cs (MemberCache.FindMemberToOverride): Use
5832 TypeManager.IsEqual() to compare the parameters and Type.Equals()
5833 to compare the invocationType.
5835 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5836 When comparing two type parameters, only do the signature-only
5837 comparision for method type parameters.
5839 2004-10-11 Martin Baulig <martin@ximian.com>
5841 * report.cs: Don't make --fatal abort on warnings, we have
5842 -warnaserror for that.
5844 2004-10-11 Martin Baulig <martin@ximian.com>
5847 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5848 (TypeManager.IsEqual): Call ourself recursively instead of using
5851 2004-10-11 Martin Baulig <martin@ximian.com>
5853 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5854 on our own type parameters, not on the ones we inherit from a containing
5857 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5860 * generic.cs (TypeParameter.Define): We may only be called once.
5862 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5863 instead of TypeManager.IsEqual().
5865 2004-09-28 Martin Baulig <martin@ximian.com>
5868 (GenericConstraints.EffectiveBaseClass): New public property.
5869 (TypeParameter.GenericConstraints): New public property.
5870 (ConstructedType.CheckConstraints): Improved.
5872 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5873 (Convert.TypeParameterConversion): New private method; use this in
5874 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5875 for all conversions related to type parameters.
5877 2004-09-24 Martin Baulig <martin@ximian.com>
5879 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5880 type parameter conversions for type parameters which are known to
5883 2004-09-24 Martin Baulig <martin@ximian.com>
5885 * generic.cs (GenericConstraints): Added `IsReferenceType' and
5886 `IsValueType' properties.
5888 * support.cs (ReflectionConstraints): Use
5889 Type.GetGenericParameterConstraints() instead of the old hack.
5891 2004-09-24 Martin Baulig <martin@ximian.com>
5893 * generic.cs (GenericConstraints): Moved here and made it an
5896 * support.cs (GenericConstraints): Moved to generic.cs.
5898 2004-09-24 Martin Baulig <martin@ximian.com>
5901 (ReflectionConstraints): Un-nested this class and made it public.
5904 (TypeManager.GetTypeParameterConstraints): New public method.
5905 (TypeManager.HasConstructorConstraint): Use the attributes.
5907 2004-09-24 Martin Baulig <martin@ximian.com>
5909 * support.cs (GenericConstraints): Replaced `HasConstructor',
5910 `IsReferenceType' and `IsValueType' with `Attributes'.
5911 (ReflectionParameters.ReflectionConstraints): Removed the Create()
5912 method and made the .ctor public.
5914 * generic.cs (Constraints.Attributes): New public property.
5915 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5916 `IsReferenceType' -> `HasReferenceTypeConstraint' and
5917 `IsValueType' -> `HasValueTypeConstraint'.
5919 2004-09-23 Martin Baulig <martin@ximian.com>
5921 * generic.cs (Constraints): Reflect latest runtime changes.
5923 2004-09-23 Martin Baulig <martin@ximian.com>
5925 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5926 (Convert.ImplicitReferenceConversionExists): Likewise.
5928 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5930 * class.cs (Operator.Define): Add error 448 and 559 report.
5932 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5934 * class.cs (MemberBase.IsTypePermitted): New protected
5935 method for checking error CS0610.
5937 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5939 * class.cs (TypeContainer.HasExplicitLayout): New property
5940 Returns whether container has StructLayout attribute set Explicit.
5941 (FieldMember): New abstract class for consts and fields.
5942 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5943 (Field): Reuse FieldMember.
5945 * const.cs (Const): Reuse FieldMember.
5947 * rootcontext.cs: EmitConstants call moved to class.
5949 2004-09-22 Martin Baulig <martin@ximian.com>
5951 Marek and me just fixed one of our oldest bugs: #28562 :-)
5953 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5955 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5956 we're an EnumConstant, just return that.
5957 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5958 an EnumConstant. In this case, we need to use GetValueAsEnumType()
5959 to get the value which'll actually be written into the attribute.
5960 However, we have to use GetValue() to access the attribute's value
5963 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5965 * constant.cs (Constant.IsNegative): New abstract property
5968 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5969 (StackAlloc.DoResolve): Reused IsNegative.
5971 2004-09-22 Martin Baulig <martin@ximian.com>
5973 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
5974 public method; like LookupTypeContainer, but also works for
5977 * report.cs (Report.SymbolRelatedToPreviousError): Use
5978 TypeManager.LookupGenericTypeContainer().
5980 2004-09-22 Martin Baulig <martin@ximian.com>
5982 Thanks to Peter Sestoft for this bug report.
5984 * expression.cs (Conditional): If both the `trueExpr' and the
5985 `falseExpr' is a NullLiteral, return a NullLiteral.
5987 2004-09-22 Martin Baulig <martin@ximian.com>
5989 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5990 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5991 for the "get_Current" call.
5993 2004-09-21 Martin Baulig <martin@ximian.com>
5995 * convert.cs (Convert.ImplicitReferenceConversion): When
5996 converting to an interface type, first check whether we're
5997 converting from a reference type.
5999 2004-09-14 Martin Baulig <martin@ximian.com>
6001 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6003 2004-09-14 Marek Safar <marek.safar@seznam.cz>
6006 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6007 called and is obsolete then this member suppress message
6008 when call is inside next [Obsolete] method or type.
6010 * expression.cs: Use TestObsoleteMethodUsage member.
6012 2004-09-14 Martin Baulig <martin@ximian.com>
6014 * genericparser.cs: Removed.
6016 2004-09-13 Marek Safar <marek.safar@seznam.cz>
6018 * class.cs (MethodCore.CheckBase): Fix bug #65757.
6020 2004-09-12 Marek Safar <marek.safar@seznam.cz>
6022 * attribute.cs (Attribute.Resolve): Add error 653 report.
6024 * class.cs (Class.ApplyAttributeBuilder): Add error 641
6026 (Method.ApplyAttributeBuilder): Add error 685 report.
6027 (Operator.Define): Add error 564 report.
6029 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
6031 * expression.cs (Invocation.DoResolve): Add error
6034 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
6037 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6039 * class.cs (ConstructorInitializer.Resolve):
6040 Wrong error number (515->516).
6042 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6044 * class.cs (Indexer.Define): Add error 631 report.
6046 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6048 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
6050 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6052 * expression.cs (Probe.DoResolve): Add error CS0241 report.
6054 2004-09-10 Marek Safar <marek.safar@seznam.cz>
6056 * cs-parser.jay: Added error CS0241 report.
6058 2004-09-10 Raja R Harinath <rharinath@novell.com>
6060 * cs-parser.jay (fixed_statement): Introduce a scope for the
6061 declaration in the 'fixed' statement.
6063 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6065 * cs-parser.jay: Added CS0230 error report.
6067 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6069 * cs-parser.jay: Added errors CS0231 and CS0257 report.
6071 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6073 * expression.cs (Argument.Resolve): Added error CS0192 and
6076 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6078 C# 2.0 #pragma warning feature
6080 * cs-tokenizer.cs (PreProcessPragma): New method;
6081 Handles #pragma directive.
6083 * report.cs (WarningRegions): New class; Support
6084 class for #pragma warning directive. It tests whether
6085 warning is enabled for a given line.
6087 2004-09-08 Miguel de Icaza <miguel@ximian.com>
6089 * const.cs: Add more descriptive error report, tahnks to
6092 2004-09-08 Marek Safar <marek.safar@seznam.cz>
6094 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
6096 2004-09-07 Miguel de Icaza <miguel@ximian.com>
6098 * expression.cs: Apply patch from Ben: Remove dead code from
6099 ArrayCreation, and remove the TurnintoConstant call in const.cs,
6100 as that code just threw an exception anwyays.
6102 * const.cs: Remove the call to the turnintoconstant, for details
6105 * literal.cs: The type of the null-literal is the null type; So
6106 we use a placeholder type (literal.cs:System.Null, defined here)
6109 * expression.cs (Conditional.DoResolve): Remove some old code that
6110 is no longer needed, conversions have been fixed.
6112 (ArrayCreationExpression.DoResolve): Return false if we fail to
6113 resolve the inner expression.
6115 2004-09-07 Raja R Harinath <rharinath@novell.com>
6118 * cs-parser.jay (delegate_declaration): Record a delegate
6119 declaration as a type declaration.
6120 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
6122 2004-09-06 Miguel de Icaza <miguel@ximian.com>
6124 * parameter.cs: Do not crash if the type can not be resolved.
6126 * expression.cs: Report errors with unsafe pointers, fixes #64896
6128 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
6130 * expression.cs: Pointer arith always needs to do a conv.i
6131 if the operand is a long. fix 65320
6133 2004-09-04 Marek Safar <marek.safar@seznam.cz>
6135 Fixed cs0619-37.cs, cs0619-38.cs
6137 * enum.cs (GetObsoleteAttribute): Removed.
6139 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
6140 on Enum member is double staged. The first is tested member
6143 2004-09-04 Marek Safar <marek.safar@seznam.cz>
6145 Fixed #56986, #63631, #65231
6147 * class.cs: (TypeContainer.AddToMemberContainer): New method,
6148 adds member to name container.
6149 (TypeContainer.AddToTypeContainer): New method, adds type to
6151 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6152 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6153 AddOperator): Simplified by reusing AddToMemberContainer.
6154 (TypeContainer.UserDefinedStaticConstructor): Changed to property
6156 (Method.CheckForDuplications): Fixed implementation to test all
6158 (MemberBase): Detection whether member is explicit interface
6159 implementation is now in constructor.
6160 (MemberBase.UpdateMemberName): Handles IndexerName.
6161 (Accessor): Changed to keep also location information.
6162 (AbstractPropertyEventMethod): Is derived from MemberCore.
6163 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6164 will be emited or not.
6165 (PropertyBase.AreAccessorsDuplicateImplementation):
6166 Tests whether accessors are not in collision with some method.
6167 (Operator): Is derived from MethodCore to simplify common
6170 * decl.cs (Flags.TestMethodDuplication): Test for duplication
6172 (DeclSpace.AddToContainer): Adds the member to defined_names
6173 table. It tests for duplications and enclosing name conflicts.
6175 * enum.cs (EnumMember): Clean up to reuse the base structures
6177 2004-09-03 Martin Baulig <martin@ximian.com>
6179 Merged latest changes into gmcs. Please keep this comment in
6180 here, it makes it easier for me to see what changed in MCS since
6181 the last time I merged.
6183 2004-09-03 Martin Baulig <martin@ximian.com>
6185 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6186 into TypeContainer, to make partial classes work again.
6188 2004-09-03 Martin Baulig <martin@ximian.com>
6190 * rootcontext.cs (RootContext.V2): Removed.
6192 2004-03-23 Martin Baulig <martin@ximian.com>
6194 * expression.cs (Invocation.OverloadResolve): Added `bool
6195 may_fail' argument and use it instead of the Location.IsNull() hack.
6197 2004-09-09 Martin Baulig <martin@ximian.com>
6199 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
6201 2004-09-09 Martin Baulig <martin@ximian.com>
6203 * generic.cs (TypeParameter.DefineType): Added support for
6204 explicit interface methods.
6206 2004-09-09 Martin Baulig <martin@ximian.com>
6208 * README.Changes: New document. Started to list important changes
6209 between MCS and GMCS here.
6211 2004-09-08 Martin Baulig <martin@ximian.com>
6214 (TypeContainer.CheckRecursiveDefinition): New protected method.
6215 (TypeContainer.DefineType): Move the CS0146 check into
6216 CheckRecursiveDefinition().
6218 2004-09-06 Martin Baulig <martin@ximian.com>
6220 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
6221 types for the constructor constraint.
6223 2004-09-03 Martin Baulig <martin@ximian.com>
6225 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6226 into TypeContainer, to make partial classes work again.
6228 2004-09-03 Martin Baulig <martin@ximian.com>
6230 * rootcontext.cs (RootContext.V2): Removed.
6232 2004-03-23 Martin Baulig <martin@ximian.com>
6234 * expression.cs (Invocation.OverloadResolve): Added `bool
6235 may_fail' argument and use it instead of the Location.IsNull() hack.
6237 2004-09-03 Martin Baulig <martin@ximian.com>
6239 Merged latest changes into gmcs. Please keep this comment in
6240 here, it makes it easier for me to see what changed in MCS since
6241 the last time I merged.
6243 2004-09-03 Raja R Harinath <rharinath@novell.com>
6246 * expression.cs (BetterConversion): Don't allow either conversion
6247 to be null. Remove redundant implicit conversion test when 'q ==
6248 null' -- when this function is invoked, we already know that the
6249 implicit conversion exists.
6250 (BetterFunction): Assume that 'best' is non-null. Remove
6251 redundant reimplementation of IsApplicable when 'best' is null.
6252 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6253 number of arguments.
6254 (IsAncestralType): Extract from OverloadResolve.
6255 (OverloadResolve): Make robust to the MethodGroupExpr being
6256 unsorted. Implement all the logic of Section 14.5.5.1, and
6257 support overloading of methods from multiple applicable types.
6258 Clean up logic somewhat. Don't pass null methods to BetterFunction.
6260 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6261 (RealError, Warning): Append type of report to related symbol.
6263 2004-09-03 Marek Safar <marek.safar@seznam.cz>
6265 * enum.cs: Fixed CLS-Compliance checks for enum members.
6266 Error tests cs3008-8.cs, cs3014-8.cs
6268 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6270 Fixed bug #62342, #63102
6271 * class.cs: ImplementIndexer uses member.IsExplicitImpl
6272 like ImplementMethod.
6274 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6276 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6279 2004-09-02 Martin Baulig <martin@ximian.com>
6281 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6282 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6285 2004-09-01 Marek Safar <marek.safar@seznam.cz>
6287 C# 2.0 Static classes implemented
6289 * class.cs (TypeContainer): instance_constructors,
6290 initialized_fields, initialized_static_fields,
6291 default_constructor, base_inteface_types are protected to be
6292 accessible from StaticClass.
6293 (TypeContainer.DefineDefaultConstructor): New virtual method
6294 for custom default constructor generating
6295 (StaticClass): New class to handle "Static classes" feature.
6297 * cs-parser.jay: Handle static keyword on class like instance
6300 * driver.cs: Added "/langversion" command line switch with two
6301 options (iso-1, default).
6303 2004-08-31 Marek Safar <marek.safar@seznam.cz>
6305 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6307 2004-08-31 Miguel de Icaza <miguel@ximian.com>
6309 * delegate.cs: Style.
6311 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
6313 * delegate.cs: Add seperate instance expr field for miguel.
6315 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6317 * PointerArithmetic (Resolve): make sure we are not doing
6318 pointer arith on void*. Also, make sure we are resolved
6319 by not setting eclass until resolve.
6321 All callers: Make sure that PointerArithmetic gets resolved.
6323 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6325 * ArrayCreation (LookupType): If the type does not resolve
6326 to an array, give an error.
6328 2004-08-27 Marek Safar <marek.safar@seznam.cz>
6330 * statement.cs (Try.Resolve): Fixed bug #64222
6332 2004-08-27 Martin Baulig <martin@ximian.com>
6335 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6338 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6340 * ecore.cs (Constantify): Get underlying type via
6341 System.Enum.GetUnderlyingType to avoid StackOverflow on the
6342 Windows in special cases.
6344 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6346 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6347 for obtaining also private methods.
6348 (GetRemoveMethod): Used GetRemoveMethod (true)
6349 for obtaining also private methods.
6351 2004-09-02 Martin Baulig <martin@ximian.com>
6353 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6354 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6357 2004-08-27 Martin Baulig <martin@ximian.com>
6360 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6363 2004-08-25 Martin Baulig <martin@ximian.com>
6365 * support.cs (ReflectionParameters..ctor): If this is a generic
6366 method, retrieve and store its type parameters.
6367 (InternalParameters..ctor): Added `TypeParameter[]' argument.
6368 (ReflectionParameters.GenericConstraints): The argument specifies
6369 the type parameter, not the method parameter.
6370 (InternalParameters.GenericConstraints): Likewise.
6372 * generic.cs (TypeParameter.DefineType): Correctly handle
6373 constraints wrt. generic methods in interfaces and their
6376 2004-08-24 Martin Baulig <martin@ximian.com>
6378 * generic.cs (TypeParameter.IsSubclassOf): New public method.
6379 (Constraints.IsSubclassOf): New internal method.
6381 * typemanager.cs (TypeManager.FindMembers): Added special support
6382 for GenericTypeParameterBuilder's.
6383 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
6386 2004-08-24 Martin Baulig <martin@ximian.com>
6389 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6390 this for accessibility checks.
6391 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6392 IsNestedFamilyAccessible.
6393 (TypeManager.IsSubclassOf): New method, do what the name actually
6396 2004-08-24 Martin Baulig <martin@ximian.com>
6398 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
6399 as a SimpleName, include the generic arity.
6401 2004-08-24 Martin Baulig <martin@ximian.com>
6403 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6404 MethodAttributes.HideBySig for operators.
6406 2004-08-23 Martin Baulig <martin@ximian.com>
6408 Back to the old error reporting system :-)
6410 * report.cs (Message): Removed.
6411 (Report.MessageData, ErrorData, WarningData): Removed.
6412 (Report.Error, Warning): Back to the old system.
6414 2004-08-23 Martin Baulig <martin@ximian.com>
6416 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6418 * class.cs (TypeContainer.ParentContainer): New public virtual
6419 method; replaces the explicit interface implementation.
6420 (ClassPart.ParentContainer): Override.
6422 2004-08-23 Martin Baulig <martin@ximian.com>
6424 * statement.cs (Switch): Added support for constant switches; see
6425 #59428 or test-285.cs.
6427 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6430 * statement.cs (GetEnumeratorFilter): Removed useless
6431 logic because C# specs is strict. GetEnumerator must be
6434 2004-08-22 Martin Baulig <martin@ximian.com>
6436 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6437 a switch and may break, reset the barrier. Fixes #59867.
6439 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6441 CLS-Compliance speed up (~5% for corlib)
6443 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6444 New method. Tests container for CLS-Compliant names
6446 * class.cs (TypeContainer.VerifyClsName): New method.
6447 Checks whether container name is CLS Compliant.
6448 (Constructor): Implements IMethodData.
6450 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6451 low-case table for CLS Compliance test.
6452 (MemberCache.VerifyClsParameterConflict): New method.
6453 Checks method parameters for CS3006 error.
6455 * enum.cs (EnumMember): Is derived from MemberCore.
6456 (Enum.VerifyClsName): Optimized for better performance.
6458 2004-08-06 Marek Safar <marek.safar@seznam.cz>
6460 * report.cs: Renamed Error_T to Error and changed all
6463 2004-08-06 Marek Safar <marek.safar@seznam.cz>
6465 * class.cs (TypeContainer.IndexerArrayList): New inner class
6466 container for indexers.
6467 (TypeContainer.DefaultIndexerName): New constant for default
6468 indexer name. Replaced all "Item" with this constant.
6469 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6471 * typemanager.cs (TypeManager.default_member_ctor): Cache here
6472 DefaultMemberAttribute constructor.
6474 2004-08-05 Martin Baulig <martin@ximian.com>
6476 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6479 2004-08-05 Marek Safar <marek.safar@seznam.cz>
6481 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6482 multi platforms problem.
6484 * compiler.csproj: Included shared files.
6486 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6488 Fix bug 60333, 55971 in the more general way
6489 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6490 Added arg_type argument for constant conversion.
6491 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6493 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6496 * class.cs (TypeContainer ): New inner classes MethodArrayList,
6497 OperatorArrayList, MethodCoreArrayList for typecontainer
6498 containers. Changed class member types to these new types.
6499 (MethodArrayList.DefineMembers): Added test for CS0659.
6501 2004-08-04 Miguel de Icaza <miguel@ximian.com>
6503 * cfold.cs: Synchronize the folding with the code in expression.cs
6504 Binary.DoNumericPromotions for uint operands.
6506 * attribute.cs: Revert patch from Raja, it introduced a regression
6507 while building Blam-1.2.1 (hard to isolate a test case).
6509 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6513 (TypeContainer.Define): Renamed to DefineContainerMembers because of
6515 (MethodCore.parent_method): New member. The method we're overriding
6516 if this is an override method.
6517 (MethodCore.CheckBase): Moved from Method class and made common.
6518 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6520 (MethodCore.CheckForDuplications): New abstract method. For custom
6521 member duplication search in a container
6522 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6523 method and its return type.
6524 (Event.conflict_symbol): New member. Symbol with same name in the
6528 (MemberCache.FindMemberWithSameName): New method. The method
6529 is looking for conflict with inherited symbols.
6531 2004-08-04 Martin Baulig <martin@ximian.com>
6533 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6535 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6537 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6539 * report.cs (Message): New enum for better error, warning reference in
6541 (MessageData): New inner abstract class. It generally handles printing of
6542 error and warning messages.
6543 Removed unused Error, Warning, Message methods.
6545 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6547 Fix for cs0592-8.cs test
6549 (Attributable.ValidAttributeTargets): Made public.
6550 (Attribute.ExplicitTarget): New member for explicit target value.
6551 (Attribute.CheckTargets): Now we translate explicit attribute
6552 target to Target here.
6554 2004-08-03 Ben Maurer <bmaurer@ximian.com>
6556 * ecore.cs (MethodGroupExpr): new IsBase property.
6558 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6560 * delegate.cs (DelegateCreation): store a MethodGroupExpr
6561 rather than an instance expr.
6563 (DelegateCreation.Emit): Use the method group rather than
6564 the instance expression. Also, if you have base.Foo as the
6565 method for a delegate, make sure to emit ldftn, not ldftnvirt.
6567 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
6569 (NewDelegate.DoResolve): Only check for the existance of Invoke
6570 if the method is going to be needed. Use MethodGroupExpr.
6572 (NewDelegate.Emit): Remove, DelegateCreation implements this.
6574 * expression.cs: For pointer arith., make sure to use
6575 the size of the type, not the size of the pointer to
6578 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6581 * class.cs (Class): Added error CS0502 test.
6583 2004-08-03 John Luke <jluke@cfl.rr.com>
6584 Raja R Harinath <rharinath@novell.com>
6587 * attribute.cs (Attribute.complained_before): New flag.
6588 (Attribute.ResolveType, Attribute.Resolve),
6589 (Attribute.DefinePInvokeMethod): Set it.
6590 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6592 2004-08-03 Martin Baulig <martin@ximian.com>
6594 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6595 use a user-defined operator; we still need to do numeric
6596 promotions in case one argument is a builtin type and the other
6597 one has an implicit conversion to that type. Fixes #62322.
6599 2004-08-18 Martin Baulig <martin@ximian.com>
6601 * class.cs (Method.Define): Use the correct method name when
6602 creating the MethodBuilder for a generic method.
6604 2004-08-17 Martin Baulig <martin@ximian.com>
6606 * generic.cs (Constraints): Support type parameter constraints.
6608 2004-08-16 Martin Baulig <martin@ximian.com>
6610 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
6611 (Token.GENERIC_DIMENSION): New token; this is returned if we
6612 encounter an unbound generic type in a typeof() expression.
6614 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
6615 this token is only generated while parsing a typeof() expression.
6616 (typeof_expression): Removed the old unbound_type hack.
6618 * generic.cs (TypeArguments.IsUnbound): New public property.
6620 * decl.cs (MemberName): Added support for unbound types.
6622 2004-08-14 Martin Baulig <martin@ximian.com>
6625 (TypeManager.IsEqualGenericInstance): New static method.
6626 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
6627 just used to check accessibility, so follow the rules of 26.1.6.
6629 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
6630 ConstructedType instead of a TypeExpression if we have type arguments.
6632 * cs-parser.jay (typeof_expression): Support unbound generic types.
6634 * ecore.cs (UnboundTypeExpression): New public class.
6636 2004-08-12 Martin Baulig <martin@ximian.com>
6638 * typemanager.cs (TypeManager.IsNestedChildOf): Use
6639 TypeManager.IsEqual() rather than `=='.
6641 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
6642 generic instances as well.
6644 2004-08-12 Martin Baulig <martin@ximian.com>
6646 * expression.cs (Invocation.InferType): We can only infer method
6647 type parameters. Fixes #62647.
6649 2004-08-11 Martin Baulig <martin@ximian.com>
6651 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
6652 before resolving the base classes.
6654 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6656 * Makefile: install .mdb file too.
6658 2004-08-05 Martin Baulig <martin@ximian.com>
6660 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
6661 initializer, the current type is just the TypeBuilder, not the
6662 instantiated generic type.
6663 (FieldExpr.IsFieldInitializer): New public property.
6665 2004-08-04 Martin Baulig <martin@ximian.com>
6667 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6669 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6671 2004-08-03 Martin Baulig <martin@ximian.com>
6673 * class.cs (MethodData.Define): If we're an explicit
6674 implementation, remove the generic arity from the type name.
6676 2004-08-03 Martin Baulig <martin@ximian.com>
6678 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6679 use a user-defined operator; we still need to do numeric
6680 promotions in case one argument is a builtin type and the other
6681 one has an implicit conversion to that type. Fixes #62322.
6683 2004-08-02 Martin Baulig <martin@ximian.com>
6685 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
6687 (TypeContainer.GetClassBases): Return the unexpanded list of
6688 interfaces; we expand them later.
6689 (TypeContainer.DefineType): After creating the TypeBuilder, call
6690 TypeManager.ExpandInterfaces() to get an expanded and resolved
6693 * ecore.cs (TypeExpr.GetInterfaces): Removed
6695 * generics.cs (Constraints.InterfaceConstraints): Remove.
6696 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
6697 register the interface constraints.
6700 (TypeManager.AddUserType): Removed the `ifaces' argument.
6701 (TypeManager.AddTypeParameter): Likewise.
6702 (TypeManager.AddUserInterface): Removed, was unused.
6703 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
6704 `TypeExpr[]' array for the interfaces.
6705 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
6706 has been defined, returns a list of the resolved interfaces types.
6707 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
6708 (TypeManager.GetExplicitInterfaces): Likewise.
6710 2004-08-02 Martin Baulig <martin@ximian.com>
6712 * expression.cs (Invocation.EmitCall): If we're invoking a method
6713 on a type parameter, use the new `Constrained' prefix opcode.
6715 2004-08-02 Martin Baulig <martin@ximian.com>
6717 * statement.cs (LocalInfo.Flags): Added `IsThis'.
6718 (LocalInfo.IsThis): New public property.
6719 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6721 2004-08-01 Martin Baulig <martin@ximian.com>
6723 * class.cs (TypeContainer.GetClassBases): Don't set the default
6724 here since we may get called from GetPartialBases().
6725 (TypeContainer.DefineType): If GetClassBases() didn't return a
6726 parent, use the default one.
6728 2004-07-30 Martin Baulig <martin@ximian.com>
6730 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6732 * class.cs (SourceMethod): New public class, derive from the
6733 symbol writer's ISourceMethod.
6734 (Method): Use the new symbol writer API.
6736 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6737 as argument and use the new symbol writer.
6740 (SourceFile): Implement the symbol writer's ISourceFile.
6741 (Location.SymbolDocument): Removed.
6742 (Location.SourceFile): New public property.
6744 * symbolwriter.cs: Use the new symbol writer API.
6746 2004-07-30 Raja R Harinath <rharinath@novell.com>
6748 * Makefile (install-local): Remove. Functionality moved to
6751 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
6753 * Makefile: Install mcs.exe.config file together with mcs.exe.
6754 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6755 correct runtime version.
6757 2004-07-25 Martin Baulig <martin@ximian.com>
6760 (TypeContainer.RegisterOrder): Removed, this was unused.
6761 (TypeContainer, interface_order): Removed.
6762 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6763 TypeContainer as argument since we can also be called with a
6764 `PartialContainer' for a partial class/struct/interface.
6765 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6766 of checking whether we're an `Interface' - we could be a
6768 (PartialContainer.Register): Override; call
6769 AddClass()/AddStruct()/AddInterface() on our parent.
6771 * cs-parser.jay (interface_member_declaration): Add things to the
6772 `current_container', not the `current_class'.
6774 * rootcontext.cs (RegisterOrder): The overloaded version which
6775 takes an `Interface' was unused, removed.
6777 * typemanager.cs (TypeManager.LookupInterface): Return a
6778 `TypeContainer', not an `Interface'.
6779 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6780 contain a `PartialContainer' for an interface, so check it's
6781 `Kind' to figure out what it is.
6783 2004-07-25 Martin Baulig <martin@ximian.com>
6785 * class.cs (Class.DefaultTypeAttributes): New public constant.
6786 (Struct.DefaultTypeAttributes): Likewise.
6787 (Interface.DefaultTypeAttributes): Likewise.
6788 (PartialContainer.TypeAttr): Override this and add the
6789 DefaultTypeAttributes.
6791 2004-07-25 Martin Baulig <martin@ximian.com>
6793 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6794 we can just use the `Parent' field instead.
6796 2004-07-25 Martin Baulig <martin@ximian.com>
6798 * class.cs (TypeContainer.Emit): Renamed to EmitType().
6800 2004-07-25 Martin Baulig <martin@ximian.com>
6802 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6803 our parts before defining any methods.
6804 (TypeContainer.VerifyImplements): Make this virtual.
6805 (ClassPart.VerifyImplements): Override and call VerifyImplements()
6806 on our PartialContainer.
6808 2004-07-25 Martin Baulig <martin@ximian.com>
6810 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6812 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6813 argument, we can just use the `Parent' field instead.
6816 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
6817 (MemberBase.DoDefine): Likewise.
6819 2004-07-24 Martin Baulig <martin@ximian.com>
6821 * decl.cs (MemberCore.Parent): New public field.
6822 (DeclSpace.Parent): Moved to MemberCore.
6824 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6825 (MemberBase.ctor): Added TypeContainer argument, pass it to our
6827 (FieldBase, Field, Operator): Likewise.
6828 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6829 (EventField, Event): Likewise.
6831 2004-07-23 Martin Baulig <martin@ximian.com>
6833 * class.cs (PartialContainer): New public class.
6834 (ClassPart): New public class.
6835 (TypeContainer): Added support for partial classes.
6836 (TypeContainer.GetClassBases): Splitted some of the functionality
6837 out into GetNormalBases() and GetPartialBases().
6839 * cs-tokenizer.cs (Token.PARTIAL): New token.
6840 (Tokenizer.consume_identifier): Added some hacks to recognize
6841 `partial', but only if it's immediately followed by `class',
6842 `struct' or `interface'.
6844 * cs-parser.jay: Added support for partial clases.
6846 2004-07-23 Martin Baulig <martin@ximian.com>
6848 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6849 a `DeclSpace' and also made it readonly.
6850 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6851 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6852 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6854 * cs-parser.jay: Pass the `current_class', not the
6855 `current_container' (at the moment, this is still the same thing)
6856 to a new Method, Property, Event, Indexer or Constructor.
6858 2004-07-23 Martin Baulig <martin@ximian.com>
6860 * cs-parser.jay (CSharpParser): Added a new `current_class' field
6861 and removed the `current_interface' one.
6862 (struct_declaration, class_declaration, interface_declaration):
6863 Set `current_class' to the newly created class/struct/interface;
6864 set their `Bases' and call Register() before parsing their body.
6866 2004-07-23 Martin Baulig <martin@ximian.com>
6868 * class.cs (Kind): New public enum.
6869 (TypeContainer): Made this class abstract.
6870 (TypeContainer.Kind): New public readonly field.
6871 (TypeContainer.CheckDef): New public method; moved here from
6873 (TypeContainer.Register): New public abstract method.
6874 (TypeContainer.GetPendingImplementations): New public abstract
6876 (TypeContainer.GetClassBases): Removed the `is_class' and
6877 `is_iface' parameters.
6878 (TypeContainer.DefineNestedTypes): Formerly known as
6880 (ClassOrStruct): Made this class abstract.
6882 * tree.cs (RootTypes): New public type.
6884 2004-07-20 Martin Baulig <martin@ximian.com>
6886 * tree.cs (Tree.RecordNamespace): Removed.
6887 (Tree.Namespaces): Removed.
6889 * rootcontext.cs (RootContext.IsNamespace): Removed.
6891 * cs-parser.jay (namespace_declaration): Just create a new
6892 NamespaceEntry here.
6894 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
6896 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6897 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6898 entry to make sure it runs in the correct runtime version.
6900 2004-07-18 Martin Baulig <martin@ximian.com>
6902 * generic.cs (ConstructedType.CheckConstraints): Improved
6903 constraints checking.
6905 2004-07-18 Martin Baulig <martin@ximian.com>
6907 * expression.cs (Invocation.BetterMethod): Call
6908 TypeManager.TypeToCoreType() on all types and removed my previous
6909 hack; we're already doig the right thing here.
6911 2004-07-17 Martin Baulig <martin@ximian.com>
6913 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6915 2004-07-16 Martin Baulig <martin@ximian.com>
6917 * iterators.cs: Added generics support.
6919 2004-07-16 Martin Baulig <martin@ximian.com>
6921 * iterators.cs: Rewrote this. We're now using one single Proxy
6922 class for both the IEnumerable and the IEnumerator interface and
6923 `Iterator' derives from Class so we can use the high-level API.
6925 * class.cs (TypeContainer.AddIterator): New method.
6926 (TypeContainer.DoDefineType): New protected virtual method, which
6927 is called from DefineType().
6928 (TypeContainer.DoDefineMembers): Call DefineType() and
6929 DefineMembers() on all our iterators.
6930 (TypeContainer.Emit): Call Emit() on all our iterators.
6931 (TypeContainer.CloseType): Call CloseType() on all our iterators.
6933 * codegen.cs (EmitContext.CurrentIterator): New public field.
6935 2004-07-15 Martin Baulig <martin@ximian.com>
6938 (TypeManager.not_supported_exception_type): New type.
6940 2004-07-14 Martin Baulig <martin@ximian.com>
6943 (TypeManager.generic_ienumerable_type): New type.
6944 (TypeManager.generic_ienumerator_type): New type.
6947 (RootContext.interfaces_first_stage): Added
6948 "System.Collections.Generic.IEnumerator`1" and
6949 "System.Collections.Generic.IEnumerable`1".
6951 2004-07-14 Martin Baulig <martin@ximian.com>
6953 * iterators.cs: Use real error numbers.
6955 2004-07-14 Martin Baulig <martin@ximian.com>
6957 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6958 requires this to be a System.Collection.IEnumerable and not a
6959 class implementing that interface.
6960 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
6962 2004-07-13 Marek Safar <marek.safar@seznam.cz>
6964 * class.cs: Fixed previous fix, it broke some error tests.
6966 2004-07-12 Martin Baulig <martin@ximian.com>
6968 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6971 2004-07-14 Martin Baulig <martin@ximian.com>
6973 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
6974 an exclamation mark (!) for the generic arity to reflect the
6975 latest spec changes; ie. use "System.Collections.Generic.IList`1".
6977 2004-07-13 Martin Baulig <martin@ximian.com>
6979 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
6980 specifiers being part of a type argument.
6982 2004-07-13 Martin Baulig <martin@ximian.com>
6984 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
6985 name for generic types.
6987 2004-07-13 Martin Baulig <martin@ximian.com>
6989 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
6992 2004-07-09 Miguel de Icaza <miguel@ximian.com>
6994 * assign.cs (LocalTemporary): Add new argument: is_address,If
6995 `is_address' is true, then the value that we store is the address
6996 to the real value, and not the value itself.
6998 * ecore.cs (PropertyExpr): use the new local temporary
6999 stuff to allow us to handle X.Y += z (where X is a struct)
7001 2004-07-08 Martin Baulig <martin@ximian.com>
7003 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7004 not always return, just like we're doing in Using.Resolve().
7006 2004-07-07 Miguel de Icaza <miguel@ximian.com>
7008 * cs-parser.jay (fixed_statement): flag this as Pinned.
7010 2004-07-06 Miguel de Icaza <miguel@ximian.com>
7012 * typemanager.cs (TypeManager): Removed MakePinned method, this
7013 mechanism is replaced with the .NET 2.x compatible mechanism of
7014 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7016 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
7017 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7018 `IsFixed' property which has a different meaning.
7020 2004-07-02 Raja R Harinath <rharinath@novell.com>
7022 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7023 visible from inside a nested class, not just the names of the
7024 immediately enclosing class.
7027 2004-06-24 Raja R Harinath <rharinath@novell.com>
7029 * expression.cs (BetterConversion): Remove buggy special-case
7030 handling of "implicit constant expression conversions". At this
7031 point, we already know that the conversion is possible -- we're
7032 only checking to see which is better.
7034 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7036 * cs-parser.jay: Added error CS0210 test.
7038 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7040 * cs-parser.jay: Added error CS0134 test.
7042 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7045 * cs-parser.jay: Added error CS0145 test.
7047 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7049 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7051 2004-06-23 Ben Maurer <bmaurer@ximian.com>
7053 * expression.cs (StackAlloc.Resolve): The argument may not
7054 be a constant; deal with this case.
7056 2004-06-23 Marek Safar <marek.safar@seznam.cz>
7058 * attribute.cs (IndexerName_GetIndexerName): Renamed to
7059 GetIndexerAttributeValue.
7060 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7062 * class.cs (Indexer.Define): Added error tests for CS0415,
7065 2004-06-23 Miguel de Icaza <miguel@ximian.com>
7067 * attribute.cs (Attribute.Resolve): Keep field code in sync with
7070 2004-06-23 Martin Baulig <martin@ximian.com>
7072 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7073 neither return nor throw, reset the barrier as well. Fixes #60457.
7075 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
7077 * class.cs : EventAttributes is now set to None by default.
7078 This fixes bug #60459.
7080 2004-06-18 Marek Safar <marek.safar@seznam.cz>
7083 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7084 Don't throw exception but return null (it's sufficient now).
7086 2004-06-18 Marek Safar <marek.safar@seznam.cz>
7088 * typemanager.cs (GetArgumentTypes): Faster implementation.
7090 2004-06-18 Martin Baulig <martin@ximian.com>
7092 * attribute.cs (Attribute.Resolve): Check whether we're an
7093 EmptyCast which a Constant child. Fixes #60333.
7095 2004-06-17 Ben Maurer <bmaurer@ximian.com>
7097 * statement.cs (EmitCollectionForeach): Account for the fact that
7098 not all valuetypes are in areas which we can take the address of.
7099 For these variables, we store to a temporary variable. Also, make
7100 sure that we dont emit a `callvirt' on a valuetype method.
7102 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7104 * expression.cs (StackAlloc.DoReSolve): Added test for
7105 negative parameter (CS0247).
7107 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7110 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7112 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7115 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7118 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7120 Fix bug #58254 & cs1555.cs, cs1556.cs
7121 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7123 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7125 * cs-parser.jay: Added error CS1669 test for indexers.
7127 2004-06-18 Martin Baulig <martin@ximian.com>
7129 * generics.cs (GenericMethod.ctor): Don't take an Attributes
7130 argument. Fixes #60441.
7132 2004-06-16 Ben Maurer <bmaurer@ximian.com>
7133 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
7134 The name needs to have the actual name of the method in order
7135 for other tests (such as the one in OverloadResolve for Invoke
7136 on a delegate) to work. As well, it does not really help
7137 error reporting because the method group had multiple methods.
7138 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
7139 Make profiling work.
7141 2004-06-13 Martin Baulig <martin@ximian.com>
7143 * cs-parser.jay: Don't allow generic attributes.
7145 2004-06-13 Martin Baulig <martin@ximian.com>
7147 * class.cs (MemberBase.DoDefineBase): New protected method.
7148 (MemberBase.DoDefine): Compute the `flags' in the new
7149 DoDefineBase() which must be called first.
7150 (Method.Define): Call DoDefineBase() first so we have the flags
7151 when defining the generic method.
7153 * cs-parser.jay (interface_method_declaration): Support generic methods.
7155 2004-06-13 Martin Baulig <martin@ximian.com>
7157 * decl.cs (TypeName): Removed.
7158 (MemberName): Removed TypeName and MemberNow; now we just have
7161 * cs-parser.jay: Don't distinguish between type arguments and type
7162 parameters in the grammar and simplified the rules a bit. The
7163 reduce/reduce conflicts are now gone (except the one we inherited
7166 2004-06-11 Martin Baulig <martin@ximian.com>
7168 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7169 call this twice: for params and varargs methods.
7171 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7174 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7176 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7178 * attribute.cs (Attribute.GetValidTargets): Made public.
7181 (AbstractPropertyEventMethod): New class for better code sharing.
7182 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7184 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7186 2004-06-09 Martin Baulig <martin@ximian.com>
7188 * cs-parser.jay: Removed a reduce/reduce conflict.
7190 2004-06-03 Martin Baulig <martin@ximian.com>
7192 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
7193 GetSimpleName() and return a SimpleName.
7195 * ecore.cs (SimpleName.Arguments): New public field.
7196 (SimpleName): Added overloaded ctor which takes an additional
7197 TypeArguments argument.
7198 (SimpleName.SimpleNameResolve): Added support for generic methods.
7199 (MethodGroupExpr.ResolveGeneric): New public method. The code was
7200 formerly in MemberAccess.DoResolve(), but we also need it in
7201 SimpleNameResolve().
7203 * expression.cs (MemberAccess.DoResolve): Use the new
7204 MethodGroupExpr.ResolveGeneric().
7206 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7208 * decl.cs: If possible, use lookuptypedirect here. We can only do
7209 this if there is no `.' after the namespace. Avoids using
7210 LookupType, which does lots of slow processing.
7211 (FindNestedType) New method, does what it says :-).
7212 * namespace.cs: use LookupTypeDirect.
7213 * rootcontext.cs: use membercache, if possible.
7214 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7216 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7219 According to the spec,
7221 In a member access of the form E.I, if E is a single identifier,
7222 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7223 field, property, localvariable, or parameter with the same type as
7224 the meaning of E as a type-name (§3.8), then both possible
7225 meanings of E are permitted.
7227 We did not check that E as a simple-name had the same type as E as
7230 This trivial check gives us 5-7% on bootstrap time.
7232 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7234 * expression.cs (Invocation.OverloadResolve): Avoid the
7235 use of hashtables and boxing here by allocating on demand.
7237 2004-05-30 Martin Baulig <martin@ximian.com>
7239 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7240 we're doing a silent lookup. Don't try to lookup nested types in
7241 TypeManager.object_type (thanks to Ben Maurer).
7243 2004-05-30 Martin Baulig <martin@ximian.com>
7245 Committing a patch from Ben Maurer.
7247 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7249 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7251 * convert.cs: add a trivial cache for overload operator resolution.
7253 2004-05-31 Marek Safar <marek.safar@seznam.cz>
7256 (AttributeTester.GetObsoleteAttribute): Returns instance of
7257 ObsoleteAttribute when type is obsolete.
7260 (TypeContainer.VerifyObsoleteAttribute): Override.
7261 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7262 (MethodCode.VerifyObsoleteAttribute): Override.
7263 (MemberBase.VerifyObsoleteAttribute): Override.
7266 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7267 and report proper error.
7270 (Delegate.VerifyObsoleteAttribute): Override.
7273 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7274 and report proper error.
7275 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7278 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7282 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7283 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7284 Added test for ObsoleteAttribute.
7287 (Catch): Derived from Statement.
7289 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7291 * decl.cs: If possible, use lookuptypedirect here. We can only do
7292 this if there is no `.' after the namespace. Avoids using
7293 LookupType, which does lots of slow processing.
7294 (FindNestedType) New method, does what it says :-).
7295 * namespace.cs: use LookupTypeDirect.
7296 * rootcontext.cs: use membercache, if possible.
7297 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7299 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7302 According to the spec,
7304 In a member access of the form E.I, if E is a single identifier,
7305 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7306 field, property, localvariable, or parameter with the same type as
7307 the meaning of E as a type-name (§3.8), then both possible
7308 meanings of E are permitted.
7310 We did not check that E as a simple-name had the same type as E as
7313 This trivial check gives us 5-7% on bootstrap time.
7315 2004-05-30 Marek Safar <marek.safar@seznam.cz>
7317 Fixed bug #59071 & cs0160.cs
7318 * statement.cs (Try.Resolve): Check here whether order of catch
7319 clauses matches their dependencies.
7321 2004-05-30 Marek Safar <marek.safar@seznam.cz>
7324 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
7327 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7329 * expression.cs (Invocation.OverloadResolve): Avoid the
7330 use of hashtables and boxing here by allocating on demand.
7332 2004-05-30 Martin Baulig <martin@ximian.com>
7334 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7335 we're doing a silent lookup. Don't try to lookup nested types in
7336 TypeManager.object_type (thanks to Ben Maurer).
7338 2004-05-30 Martin Baulig <martin@ximian.com>
7340 Committing a patch from Ben Maurer.
7342 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7344 2004-05-29 Martin Baulig <martin@ximian.com>
7346 * class.cs (IMethodData.ShouldIgnore): New method.
7348 * typemanager.cs (TypeManager.MethodFlags): Don't take a
7349 `Location' argument, we don't need it anywhere. Use
7350 `IMethodData.ShouldIgnore ()' instead of
7351 `MethodData.GetMethodFlags ()'.
7352 (TypeManager.AddMethod): Removed.
7353 (TypeManager.AddMethod2): Renamed to AddMethod.
7355 2004-05-29 Martin Baulig <martin@ximian.com>
7357 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7359 * convert.cs (Convert.ImplicitReferenceConversion): If we're
7360 converting from a class type S to an interface type and we already
7361 have an object on the stack, don't box it again. Fixes #52578.
7363 2004-05-29 Martin Baulig <martin@ximian.com>
7365 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7366 Added support for `params' parameters. Fixes #59267.
7368 2004-05-29 Martin Baulig <martin@ximian.com>
7370 * literal.cs (NullPointer): Provide a private .ctor which sets
7371 `type' to TypeManager.object_type. Fixes #59048.
7373 2004-05-29 Martin Baulig <martin@ximian.com>
7375 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7376 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
7378 * ecore.cs (EventExpr.instance_expr): Make the field private.
7380 2004-05-26 Marek Safar <marek.safar@seznam.cz>
7382 Fixed bug #50080 & cs0214-2.cs
7383 * expression.cs (Cast.DoResolve): Check unsafe context here.
7385 * statement.cs (Resolve.DoResolve): Likewise.
7387 2004-05-26 Martin Baulig <martin@ximian.com>
7389 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7391 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7392 (RootContext.LookupType): Pass down the `silent' flag.
7394 2004-05-25 Martin Baulig <martin@ximian.com>
7397 (MethodGroupExpr.IdenticalTypeName): New public property.
7398 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7399 expression actually refers to a type.
7401 2004-05-25 Martin Baulig <martin@ximian.com>
7403 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7404 for #56176 and made it actually work.
7406 2004-05-25 Martin Baulig <martin@ximian.com>
7408 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7409 (FieldExpr, PropertyExpr): Override and implement
7410 CacheTemporaries. Fixes #52279.
7412 2004-05-25 Miguel de Icaza <miguel@ximian.com>
7414 * location.cs: In the new compiler listing a file twice is a
7415 warning, not an error.
7417 2004-05-24 Martin Baulig <martin@ximian.com>
7419 * enum.cs (Enum.DefineType): For the `BaseType' to be a
7420 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
7422 2004-05-24 Martin Baulig <martin@ximian.com>
7424 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7425 walking the `using' list. Fixes #53921.
7427 2004-05-24 Martin Baulig <martin@ximian.com>
7429 * const.cs (Const.LookupConstantValue): Added support for
7430 EmptyCast's; fixes #55251.
7432 2004-05-24 Martin Baulig <martin@ximian.com>
7434 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7435 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7436 which does the CS0135 check. The reason is that we first need to
7437 check whether the variable actually exists.
7439 2004-05-24 Martin Baulig <martin@ximian.com>
7441 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7442 than RootContext.LookupType() to find the explicit interface
7445 2004-05-24 Raja R Harinath <rharinath@novell.com>
7447 * Makefile: Simplify. Use executable.make.
7448 * mcs.exe.sources: New file. List of sources of mcs.exe.
7450 2004-05-24 Anders Carlsson <andersca@gnome.org>
7454 Use the invariant culture when doing String.Compare for CLS case
7457 2004-05-23 Martin Baulig <martin@ximian.com>
7459 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7460 don't have any dots. Fixes #52622, added cs0246-8.cs.
7462 * namespace.cs (NamespaceEntry.Lookup): Likewise.
7464 2004-05-23 Marek Safar <marek.safar@seznam.cz>
7466 * class.cs (MemberBase.Define): Reuse MemberType member for
7467 resolved type. Other methods can use it too.
7469 2004-05-23 Martin Baulig <martin@ximian.com>
7471 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7472 the variable also exists in the current block (otherwise, we need
7473 to report a CS0103). Fixes #58670.
7475 2004-05-23 Martin Baulig <martin@ximian.com>
7477 * flowanalysis.cs (Reachability.Reachable): Compute this
7478 on-the-fly rather than storing it as a field.
7480 2004-05-23 Martin Baulig <martin@ximian.com>
7482 * flowanalysis.cs (Reachability.And): Manually compute the
7483 resulting `barrier' from the reachability.
7485 2004-05-23 Marek Safar <marek.safar@seznam.cz>
7488 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7489 instance of ObsoleteAttribute when symbol is obsolete.
7492 (IMethodData): Extended interface for ObsoleteAttribute support.
7494 2004-05-22 Marek Safar <marek.safar@seznam.cz>
7496 * attribute.cs: Fix bug #55970
7498 2004-05-22 Marek Safar <marek.safar@seznam.cz>
7502 (GetObsoleteAttribute): New method. Creates the instance of
7504 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7505 ObsoleteAttribute when member is obsolete.
7506 (AttributeTester.Report_ObsoleteMessage): Common method for
7507 Obsolete error/warning reporting.
7510 (TypeContainer.base_classs_type): New member for storing parent type.
7513 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7514 for this MemberCore.
7516 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7518 * attribute.cs, const.cs: Fix bug #58590
7520 2004-05-21 Martin Baulig <martin@ximian.com>
7522 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7523 out parameters if the end of the method is unreachable. Fixes
7526 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7528 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7529 Hari was right, why extra method.
7531 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7533 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7535 2004-05-20 Martin Baulig <martin@ximian.com>
7537 * delegate.cs: Convert this file to Unix mode - like the original
7540 2004-05-20 Martin Baulig <martin@ximian.com>
7542 * attribute.cs: Convert this file to Unix mode - like the original
7545 2004-05-19 Marek Safar <marek.safar@seznam.cz>
7547 Fix bug #58688 (MCS does not report error when the same attribute
7550 * attribute.cs (Attribute.Emit): Distinction between null and default.
7552 2004-05-19 Raja R Harinath <rharinath@novell.com>
7554 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7555 of a top-level attribute without an attribute target.
7556 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
7558 (Attribute.Conditional_GetConditionName),
7559 (Attribute.Obsolete_GetObsoleteMessage): Update.
7560 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
7561 part of ScanForIndexerName.
7562 (Attribute.CanIgnoreInvalidAttribute): New function.
7563 (Attribute.ScanForIndexerName): Move to ...
7564 (Attributes.ScanForIndexerName): ... here.
7565 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7566 (Attributes.Search): New internal variant that can choose not to
7567 complain if types aren't resolved. The original signature now
7569 (Attributes.GetClsCompliantAttribute): Use internal variant, with
7570 complaints suppressed.
7571 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7572 only if it not useful.
7573 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7574 top-level for attributes that are shared between the assembly
7575 and a top-level class.
7576 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7577 * class.cs: Update to reflect changes.
7578 (DefineIndexers): Fuse loops.
7579 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
7580 a couple more variants of attribute names.
7582 2004-05-18 Marek Safar <marek.safar@seznam.cz>
7584 Fix bug #52585 (Implemented explicit attribute declaration)
7587 (Attributable.ValidAttributeTargets): New abstract method. It gets
7588 list of valid attribute targets for explicit target declaration.
7589 (Attribute.Target): It holds target itself.
7590 (AttributeSection): Removed.
7591 (Attribute.CheckTargets): New method. It checks whether attribute
7592 target is valid for the current element.
7595 (EventProperty): New class. For events that are declared like
7596 property (with add and remove accessors).
7597 (EventField): New class. For events that are declared like field.
7600 * cs-parser.jay: Implemented explicit attribute target declaration.
7602 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
7603 Override ValidAttributeTargets.
7606 (ReturnParameter): Class for applying custom attributes on
7608 (ParameterAtribute): New class. Class for applying custom
7609 attributes on the parameter type.
7611 2004-05-17 Miguel de Icaza <miguel@ximian.com>
7613 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7616 (Method): Allow UNSAFE here.
7618 * modifiers.cs: Support unsafe reporting.
7620 2004-05-17 Marek Safar <marek.safar@seznam.cz>
7622 * decl.cs: Fix bug #58478.
7624 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7626 * statement.cs: When checking for unreachable code on an EmptyStatement,
7627 set the location. Fixes bug #58488.
7629 2004-05-13 Miguel de Icaza <miguel@ximian.com>
7631 * driver.cs: Add -pkg handling.
7633 From Gonzalo: UseShelLExecute=false
7635 2004-05-12 Marek Safar <marek.safar@seznam.cz>
7638 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7640 (Attribute.IsClsCompliaceRequired): Moved to base for better
7642 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7643 when attribute is AttributeUsageAttribute.
7644 (Attribute.GetValidTargets): Simplified.
7645 (Attribute.GetAttributeUsage): New method returns AttributeUsage
7646 attribute for this type.
7647 (Attribute.ApplyAttributes): Method renamed to Emit and make
7649 (GlobalAttributeSection): New class for special handling of global
7650 attributes (assembly, module).
7651 (AttributeSection.Emit): New method.
7653 * class.cs: Implemented Attributable abstract methods.
7654 (MethodCore.LabelParameters): Moved to Parameter class.
7655 (Accessor): Is back simple class.
7656 (PropertyMethod): Implemented Attributable abstract class.
7657 (DelegateMethod): Implemented Attributable abstract class.
7658 (Event): New constructor for disctintion between normal Event
7659 and Event with accessors.
7661 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7663 * codegen.cs, const.cs, decl.cs, delegate.cs:
7664 (CommonAssemblyModulClass): Implemented Attributable abstract class
7667 * enum.cs: Implement IAttributeSupport interface.
7668 (EnumMember): New class for emum members. Implemented Attributable
7672 (ParameterBase): Is abstract.
7673 (ReturnParameter): New class for easier [return:] attribute handling.
7675 * typemanager.cs: Removed builder_to_attr.
7677 2004-05-11 Raja R Harinath <rharinath@novell.com>
7680 * attribute.cs (Attribute.GetPositionalValue): New function.
7681 * class.cs (TypeContainer.VerifyMembers): New function.
7682 (TypeContainer.Emit): Use it.
7683 (ClassOrStruct): New base class for Class and Struct.
7684 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
7685 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7687 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7688 then each non-static field should have a FieldOffset attribute.
7689 Otherwise, none of the fields should have a FieldOffset attribute.
7690 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
7691 and FieldOffset attributes.
7692 * typemanager.cs (TypeManager.struct_layout_attribute_type)
7693 (TypeManager.field_offset_attribute_type): New core types.
7694 (TypeManager.InitCoreTypes): Initialize them.
7696 2004-05-11 Michal Moskal <malekith@pld-linux.org>
7698 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7699 Return correct type.
7702 2004-05-09 Miguel de Icaza <miguel@ximian.com>
7704 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7705 be implicitly converted to ulong.
7707 * expression.cs: The logic for allowing operator &, | and ^ worked
7708 was wrong, it worked before because we did not report an error in
7709 an else branch. Fixes 57895.
7711 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7712 allow volatile fields to be reference types.
7714 2004-05-07 Miguel de Icaza <miguel@ximian.com>
7716 * driver.cs: Add support for /debug-
7718 2004-05-07 Raja R Harinath <rharinath@novell.com>
7720 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
7721 Add a 'complain' parameter to silence errors.
7722 (Attribute.Resolve): Update to changes. Put in sanity check to catch
7723 silently overlooked type-resolutions.
7724 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7726 (Attributes.Search): New function.
7727 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7728 (Attributes.GetAttributeFullName): Remove hack.
7729 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
7730 Update to reflect changes.
7731 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7732 Use Attributes.Search instead of nested loops.
7734 2004-05-07 Marek Safar <marek.safar@seznam.cz>
7737 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7738 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7739 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7741 * report.cs: (Report.Warning): Renamed to Warning_T because of
7742 parameter collision.
7744 2004-05-05 Raja R Harinath <rharinath@novell.com>
7746 * expression.cs (MemberAccess.ResolveMemberAccess):
7747 Exit with non-zero status after Report.Error.
7748 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7750 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7752 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7754 * support.cs: Don't hang when the file is empty.
7756 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7758 * support.cs: In SeekableStreamReader, compute the preamble size of the
7759 underlying stream. Position changes should take into account that initial
7762 2004-05-03 Todd Berman <tberman@sevenl.net>
7764 * driver.cs: remove unused GetSysVersion function.
7766 2004-05-03 Todd Berman <tberman@sevenl.net>
7768 * driver.cs: Remove the hack from saturday, as well as the hack
7769 from jackson (LoadAssemblyFromGac), also adds the CWD to the
7770 link_paths to get that bit proper.
7772 2004-05-01 Todd Berman <tberman@sevenl.net>
7774 * driver.cs: Try a LoadFrom before a Load, this checks the current
7775 path. This is currently a bug in mono that is be fixed, however, this
7776 provides a workaround for now. This will be removed when the bug
7779 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
7781 * CryptoConvert.cs: Updated to latest version. Fix issue with
7782 incomplete key pairs (#57941).
7784 2004-05-01 Todd Berman <tberman@sevenl.net>
7786 * driver.cs: Remove '.' from path_chars, now System.* loads properly
7789 2004-04-30 Jackson Harper <jackson@ximian.com>
7791 * codegen.cs: Open keys readonly.
7793 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7795 * typemanager.cs: don't report cyclic struct layout when a struct
7796 contains 2 or more fields of the same type. Failed for Pango.AttrShape
7797 which has 2 Pango.Rectangle fields.
7799 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
7801 * expression.cs: Handle IntPtr comparisons with IL code
7802 rather than a method call.
7804 2004-04-29 Martin Baulig <martin@ximian.com>
7806 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
7807 the list of PropertyInfo's in class hierarchy and find the
7808 accessor. Fixes #56013.
7810 2004-04-29 Martin Baulig <martin@ximian.com>
7812 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7814 2004-04-29 Martin Baulig <martin@ximian.com>
7816 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7818 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7820 2004-04-29 Martin Baulig <martin@ximian.com>
7822 * class.cs (ConstructorInitializer.Resolve): Check whether the
7823 parent .ctor is accessible. Fixes #52146.
7825 2004-04-29 Martin Baulig <martin@ximian.com>
7827 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7829 * statement.cs (Using.EmitLocalVariableDecls): Use
7830 TypeManager.idisposable_type, not typeof (IDisposable).
7831 (Foreach.EmitCollectionForeach): Added support for valuetypes.
7833 2004-04-29 Martin Baulig <martin@ximian.com>
7835 * class.cs (Event.Define): Don't emit the field and don't set
7836 RTSpecialName and SpecialName for events on interfaces. Fixes
7839 2004-04-29 Raja R Harinath <rharinath@novell.com>
7841 Refactor Attribute.ApplyAttributes.
7842 * attribute.cs (Attributable): New base class for objects that can
7843 have Attributes applied on them.
7844 (Attribute): Make AttributeUsage fields public.
7845 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7846 (Attribute.IsInternalCall): New property.
7847 (Attribute.UsageAttr): Convert to a public read-only property.
7848 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7849 (Attribute.ResolveType, Attribute.Resolve)
7850 (Attribute.ScanForIndexerName): Update to reflect changes.
7851 (Attribute.CheckAttributeTarget): Re-format.
7852 (Attribute.ApplyAttributes): Refactor, to various
7853 Attributable.ApplyAttributeBuilder methods.
7854 * decl.cs (MemberCore): Make Attributable.
7855 * class.cs (Accessor): Make Attributable.
7856 (MethodData.ApplyAttributes): Use proper attribute types, not
7858 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7859 (TypeContainer.ApplyAttributeBuilder)
7860 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7861 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
7862 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7863 (Operator.ApplyAttributeBuilder): New factored-out methods.
7864 * const.cs (Const.ApplyAttributeBuilder): Likewise.
7865 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7866 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7867 * parameter.cs (ParameterBase): New Attributable base class
7868 that can also represent Return types.
7869 (Parameter): Update to the changes.
7871 2004-04-29 Jackson Harper <jackson@ximian.com>
7873 * driver.cs: Prefer the corlib system version when looking for
7874 assemblies in the GAC. This is still a hack, but its a better hack
7877 2004-04-29 Marek Safar <marek.safar@seznam.cz>
7879 * decl.cs, enum.cs: Improved error 3005 reporting.
7881 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7882 (related_symbols): New private member for list of symbols
7883 related to reported error/warning.
7885 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7887 2004-04-29 Martin Baulig <martin@ximian.com>
7889 * ecore.cs (Expression.Constantify): If we're an enum and
7890 TypeManager.TypeToCoreType() doesn't give us another type, use
7891 t.UnderlyingSystemType. Fixes #56178.
7893 2004-04-29 Martin Baulig <martin@ximian.com>
7895 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7896 interfaces and for each interface, only add members directly
7897 declared in that interface. Fixes #53255.
7899 2004-04-28 Martin Baulig <martin@ximian.com>
7901 * expression.cs (ConditionalLogicalOperator): Use a temporary
7902 variable for `left' to avoid that we evaluate it more than once;
7905 2004-04-28 Martin Baulig <martin@ximian.com>
7907 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7910 2004-04-28 Martin Baulig <martin@ximian.com>
7912 * statement.cs (LocalInfo.Resolve): Check whether the type is not
7915 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7916 whether the type is not void (CS1547).
7918 2004-04-28 Martin Baulig <martin@ximian.com>
7920 * expression.cs (Unary.DoResolveLValue): Override this and report
7921 CS0131 for anything but Operator.Indirection.
7923 2004-04-28 Martin Baulig <martin@ximian.com>
7925 Committing a patch from Ben Maurer; see bug #50820.
7927 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7930 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7933 2004-04-28 Martin Baulig <martin@ximian.com>
7935 Committing a patch from Ben Maurer; see bug #50820.
7937 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7940 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7943 2004-04-28 Martin Baulig <martin@ximian.com>
7945 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7946 (Block.AddLabel): Call DoLookupLabel() to only search in the
7949 2004-04-28 Martin Baulig <martin@ximian.com>
7951 * cfold.cs (ConstantFold.BinaryFold): Added special support for
7952 comparing StringConstants and NullLiterals in Equality and Inequality.
7954 2004-04-28 Jackson Harper <jackson@ximian.com>
7956 * driver.cs: Attempt to load referenced assemblies from the
7957 GAC. This is the quick and dirty version of this method that
7958 doesnt take into account versions and just takes the first
7959 canidate found. Will be good enough for now as we will not have more
7960 then one version installed into the GAC until I update this method.
7962 2004-04-28 Martin Baulig <martin@ximian.com>
7964 * typemanager.cs (TypeManager.CheckStructCycles): New public
7965 static method to check for cycles in the struct layout.
7967 * rootcontext.cs (RootContext.PopulateTypes): Call
7968 TypeManager.CheckStructCycles() for each TypeContainer.
7969 [Note: We only need to visit each type once.]
7971 2004-04-28 Martin Baulig <martin@ximian.com>
7973 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7975 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7976 success and added `out object value'. Use a `bool resolved' field
7977 to check whether we've already been called rather than
7978 `ConstantValue != null' since this breaks for NullLiterals.
7980 2004-04-28 Raja R Harinath <rharinath@novell.com>
7982 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7983 setting of this flag, since the 'set' method may be non-public.
7985 2004-04-28 Raja R Harinath <rharinath@novell.com>
7987 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7988 check on current_vector.Block.
7990 2004-04-27 Martin Baulig <martin@ximian.com>
7992 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7993 a field initializer. Fixes #56459.
7995 2004-04-27 Martin Baulig <martin@ximian.com>
7997 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7998 we're not attempting to use an indexer. Fixes #52154.
8000 2004-04-27 Martin Baulig <martin@ximian.com>
8002 * statement.cs (Return): Don't create a return label if we don't
8003 need it; reverts my change from January 20th. Thanks to Ben
8006 2004-04-27 Martin Baulig <martin@ximian.com>
8008 According to the spec, `goto' can only leave a nested scope, but
8011 * statement.cs (Block.LookupLabel): Only lookup in the current
8012 block, don't recurse into parent or child blocks.
8013 (Block.AddLabel): Check in parent and child blocks, report
8014 CS0140/CS0158 if we find a duplicate.
8015 (Block): Removed this indexer for label lookups.
8016 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8017 this already does the error reporting for us.
8020 (FlowBranching.UsageVector.Block): New public variable; may be null.
8021 (FlowBranching.CreateSibling): Added `Block' argument.
8022 (FlowBranching.LookupLabel): New public virtual method. Lookup a
8023 label for the target of a `goto' and check whether we're not
8024 leaving a `finally'.
8026 2004-04-27 Martin Baulig <martin@ximian.com>
8028 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8029 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8032 2004-04-27 Martin Baulig <martin@ximian.com>
8034 * statement.cs (Block.AddLabel): Also check for implicit blocks
8035 and added a CS0158 check.
8037 2004-04-27 Martin Baulig <martin@ximian.com>
8039 * flowanalysis.cs (FlowBranchingLoop): New class.
8040 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
8041 UsageVector's instead of an ArrayList.
8042 (FlowBranching.Label): Likewise.
8043 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
8044 (FlowBranching.AddBreakVector): New method.
8046 2004-04-27 Miguel de Icaza <miguel@ximian.com>
8048 * attribute.cs: Small regression fix: only convert the type if we
8049 the type is different, fixes System.Drawing build.
8051 2004-04-27 Martin Baulig <martin@ximian.com>
8053 * attribute.cs (Attribute.Resolve): If we have a constant value
8054 for a named field or property, implicity convert it to the correct
8057 2004-04-27 Raja R Harinath <rharinath@novell.com>
8059 * statement.cs (Block.Block): Implicit blocks share
8060 'child_variable_names' fields with parent blocks.
8061 (Block.AddChildVariableNames): Remove.
8062 (Block.AddVariable): Mark variable as "used by a child block" in
8063 every surrounding block.
8064 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
8065 been used in a child block, complain about violation of "Invariant
8066 meaning in blocks" rule.
8067 * cs-parser.jay (declare_local_variables): Don't use
8068 AddChildVariableNames.
8069 (foreach_statement): Don't create an implicit block: 'foreach'
8072 2004-04-23 Miguel de Icaza <miguel@ximian.com>
8074 * convert.cs (ImplicitNumericConversion): 0 is also positive when
8075 converting from 0L to ulong. Fixes 57522.
8077 2004-04-22 Marek Safar <marek.safar@seznam.cz>
8079 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
8080 derived class hides via 'new' keyword field from base class (test-242.cs).
8081 TODO: Handle this in the more general way.
8083 * class.cs (CheckBase): Ditto.
8085 2004-04-22 Marek Safar <marek.safar@seznam.cz>
8087 * decl.cs (caching_flags): New member for storing cached values
8089 (MemberCore.Flags): New enum where bit flags for caching_flags
8091 (MemberCore.cls_compliance): Moved to caching_flags.
8092 (DeclSpace.Created): Moved to caching_flags.
8094 * class.cs: Use caching_flags instead of DeclSpace.Created
8096 2004-04-21 Miguel de Icaza <miguel@ximian.com>
8098 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
8099 if we are only a derived class, not a nested class.
8101 * typemanager.cs: Same as above, but do this at the MemberLookup
8102 level (used by field and methods, properties are handled in
8103 PropertyExpr). Allow for the qualified access if we are a nested
8106 2004-04-21 Marek Safar <marek.safar@seznam.cz>
8108 * class.cs: Refactoring.
8109 (IMethodData): New inteface; Holds links to parent members
8110 to avoid member duplication (reduced memory allocation).
8111 (Method): Implemented IMethodData interface.
8112 (PropertyBase): New inner classes for get/set methods.
8113 (PropertyBase.PropertyMethod): Implemented IMethodData interface
8114 (Event): New inner classes for add/remove methods.
8115 (Event.DelegateMethod): Implemented IMethodData interface.
8117 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8118 EmitContext (related to class.cs refactoring).
8120 2004-04-21 Raja R Harinath <rharinath@novell.com>
8122 * delegate.cs (Delegate.VerifyApplicability): If the number of
8123 arguments are the same as the number of parameters, first try to
8124 verify applicability ignoring any 'params' modifier on the last
8128 2004-04-08 Martin Baulig <martin@ximian.com>
8130 Merged latest changes into gmcs. Please keep this comment in
8131 here, it makes it easier for me to see what changed in MCS since
8132 the last time I merged.
8134 2004-04-16 Raja R Harinath <rharinath@novell.com>
8136 * class.cs (TypeContainer.AddIndexer): Use
8137 'ExplicitInterfaceName' to determine if interface name was
8138 explicitly specified. 'InterfaceType' is not initialized at this time.
8139 (TypeContainer.DefineIndexers): Remove use of temporary list. The
8140 Indexers array is already in the required order. Initialize
8141 'IndexerName' only if there are normal indexers.
8142 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8143 (TypeContainer.Emit): Emit DefaultMember attribute only if
8144 IndexerName is initialized.
8147 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
8149 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8152 2004-04-15 Raja R Harinath <rharinath@novell.com>
8154 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
8158 * attribute.cs (Attribute.Resolve): Check for duplicate named
8162 2004-04-15 Miguel de Icaza <miguel@ximian.com>
8164 * iterators.cs (MarkYield): track whether we are in an exception,
8165 and generate code accordingly. Use a temporary value to store the
8166 result for our state.
8168 I had ignored a bit the interaction of try/catch with iterators
8169 since their behavior was not entirely obvious, but now it is
8170 possible to verify that our behavior is the same as MS .NET 2.0
8174 2004-04-14 Miguel de Icaza <miguel@ximian.com>
8176 * iterators.cs: Avoid creating temporaries if there is no work to
8179 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8180 Enumerations, use TypeManager.EnumToUnderlying and call
8183 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8186 (This.Emit): Use EmitContext.EmitThis to emit our
8189 (This.EmitAssign): Ditto.
8191 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8192 codepaths, we will move all the functionality into
8195 (FieldExpr.EmitAssign): Ditto.
8197 This fixes several hidden bugs that I uncovered while doing a code
8198 review of this today.
8200 * codegen.cs (EmitThis): reworked so the semantics are more clear
8201 and also support value types "this" instances.
8203 * iterators.cs: Changed so that for iterators in value types, we
8204 do not pass the value type as a parameter.
8206 Initialization of the enumerator helpers is now done in the caller
8207 instead of passing the parameters to the constructors and having
8208 the constructor set the fields.
8210 The fields have now `assembly' visibility instead of private.
8212 2004-04-11 Miguel de Icaza <miguel@ximian.com>
8214 * expression.cs (Argument.Resolve): Check if fields passed as ref
8215 or out are contained in a MarshalByRefObject.
8217 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8218 another compiler type.
8220 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
8222 * class.cs (Indexer.Define): use the new name checking method.
8223 Also, return false on an error.
8224 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8225 (is_identifier_[start/part]_character): make static.
8227 2004-04-10 Miguel de Icaza <miguel@ximian.com>
8229 * expression.cs (Binary.ResolveOperator): Do no append strings
8230 twice: since we can be invoked more than once (array evaluation)
8231 on the same concatenation, take care of this here. Based on a fix
8232 from Ben (bug #56454)
8234 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8236 * codegen.cs: Fix another case where CS1548 must be reported (when
8237 delay-sign isn't specified and no private is available #56564). Fix
8238 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8239 error when MCS is used on the MS runtime and we need to delay-sign
8240 (which seems unsupported by AssemblyBuilder - see #56621).
8242 2004-04-08 Marek Safar <marek.safar@seznam.cz>
8244 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8245 (TypeManager.ComputeNamespaces): Faster implementation for
8248 * compiler.csproj: Updated AssemblyName to mcs.
8250 2004-05-11 Jackson Harper <jackson@ximian.com>
8252 * Makefile: Preserve MONO_PATH
8254 2004-05-11 Jackson Harper <jackson@ximian.com>
8256 * Makefile: Use mono and mcs to build gmcs
8258 2004-05-03 Miguel de Icaza <miguel@ximian.com>
8260 * codegen.cs: Add patch from Robert Shade
8261 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
8264 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
8266 * CryptoConvert.cs: Updated to latest version. Fix issue with
8267 incomplete key pairs (#57941).
8269 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8271 * codegen.cs: Fix another case where CS1548 must be reported (when
8272 delay-sign isn't specified and no private is available #56564). Fix
8273 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8274 error when MCS is used on the MS runtime and we need to delay-sign
8275 (which seems unsupported by AssemblyBuilder - see #56621).
8277 2004-04-29 Jackson Harper <jackson@ximian.com>
8279 * Makefile: Set MONO_PATH to use the bootstrap corlib
8280 * driver.cs: Check the GAC for referenced assemblies.
8282 2004-04-29 Martin Baulig <martin@ximian.com>
8284 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
8286 2004-04-07 Martin Baulig <martin@ximian.com>
8288 * expression.cs (Binary.ResolveOperator): Added special case for
8289 Equality/Inequality between a type parameter and a null literal.
8291 2004-04-07 Martin Baulig <martin@ximian.com>
8293 * convert.cs: Check null literal -> type parameter conversions.
8295 2004-04-07 Martin Baulig <martin@ximian.com>
8297 * generic.cs (ConstructedType.CheckConstraints): Enforce the
8298 `class' and `struct' constraints.
8300 2004-04-07 Martin Baulig <martin@ximian.com>
8302 * generic.cs (SpecialConstraint): New public enum.
8303 (Constraints.Resolve): Added support for the `class' and `struct'
8306 * cs-parser.jay (type_parameter_constraint): Added support for the
8307 `class' and `struct' constraints.
8309 2004-04-07 Martin Baulig <martin@ximian.com>
8311 * support.cs (GenericConstraints): Replaced `Types' by
8312 `ClassConstraint' and `InterfaceConstraints'; added
8313 `HasClassConstraint'.
8315 2004-04-07 Martin Baulig <martin@ximian.com>
8318 (Constraints.InterfaceConstraints): New public property.
8319 (Constraints.Types): Make this property public
8320 (TypeParameter): Implement IMemberContainer.
8321 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
8322 instead of a TypeBuilder/MethodBuilder; pass the interface
8323 constraints to TypeManager.AddTypeParameter().
8324 (TypeParameter.DefineType): Just take an EmitContext and no
8325 TypeBuilder/MethodBuilder. Use the new public API.
8327 * typemanager.cs (TypeManager.AddTypeParameter): Added
8328 `TypeExpr[]' argument; add the interfaces to the
8329 `builder_to_ifaces' hash.
8330 (TypeManager.LookupMemberContainer): For
8331 GenericTypeParameterBuilders, get the TypeParameter from the
8332 `builder_to_type_param'.
8333 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
8334 the TypeParameter and call FindMembers on it.
8336 2004-04-07 Martin Baulig <martin@ximian.com>
8339 (MethodCore.GenericMethod): Moved this field here from Method.
8340 (MethodCore.IsDuplicateImplementation): Take the number of type
8341 parameters into account if we're a generic method.
8343 * expression.cs (Invocation.InferTypeArguments): Don't return true
8344 if `arguments' is null; we still need to check whether we actually
8345 don't need to infer anything in this case.
8346 (MemberAccess): Merged the functionality from GenericMemberAccess
8349 * generic.cs (GenericMemberAccess): Removed.
8351 2004-04-05 Martin Baulig <martin@ximian.com>
8353 * decl.cs (MemberCore): For generic classes, interfaces and
8354 structs, `Name' now includes the number of type parameters
8356 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
8357 encode the number of type arguments in the type name.
8359 * expression.cs (Expression.MemberLookup): Removed the
8360 `num_type_args' argument; we now encode the number of type
8361 arguments in the type name.
8363 * ecore.cs (SimpleName): Encode the number of type arguments in
8364 the type name itself.
8366 * generic.cs (ConstructedType): Likewise.
8368 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
8369 `MemberName'; we now include the number of type parameters in the
8372 * typemanager.cs (TypeManager.CheckGeneric): Removed.
8373 (TypeManager.MemberLookup): Removed the
8374 `num_type_args' argument; we now encode the number of type
8375 arguments in the type name.
8377 2004-04-03 Martin Baulig <martin@ximian.com>
8379 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
8380 (MemberCore.MemberName): Moved here from MemberBase.
8381 (DeclSpace.SetParameterInfo): Just take the constraints as an
8382 ArrayList; we already have the type parameters in our
8383 `MemberName'; also do the CS0080 reporting here.
8385 * cs-parser.jay (struct_declaration): Use `member_name' instead of
8386 `IDENTIFIER opt_type_parameter_list'; when constructing our
8387 `MemberName', it'll already include our type parameters.
8388 (class_declaration, interface_declaration): Likewise.
8389 (delegate_declaration): Likewise.
8390 (MakeName): Take a MemberName and return a MemberName.
8391 The following two changes are required to avoid shift/reduce conflicts:
8392 (member_name): Don't include a TypeName anymore; ie. this is now
8393 just 'IDENTIFIER opt_type_parameter_list'.
8394 (property_declaration, event_declaration): Use a
8395 `namespace_or_type_name' instead of a `member_name'.
8397 2004-04-03 Martin Baulig <martin@ximian.com>
8399 * decl.cs (MemberName): Renamed to `TypeName' and created a new
8401 (TypeName): Formerly known as MemberName.
8403 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
8404 instead of a `MemberName'.
8406 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
8407 (member_name): New rule; create a MemberName.
8409 2004-04-02 Martin Baulig <martin@ximian.com>
8411 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
8412 (CS0305 and CS0308).
8414 2004-04-02 Martin Baulig <martin@ximian.com>
8416 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
8417 support for nested types.
8419 2004-04-02 Martin Baulig <martin@ximian.com>
8421 * ecore.cs (IAlias): New public interface.
8422 (TypeExpr, TypeExpression): Implement IAlias.
8423 (TypeAliasExpression): New public class.
8425 * namespace.cs (Namespace): Implement IAlias.
8426 (Namespace.Lookup): Return an IAlias instead on an object.
8427 (Namespace.DefineName): Take an IAlias instead of an object.
8428 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
8430 (NamespaceEntry.UsingAlias): Take a Membername instead of an
8432 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
8434 (NamespaceEntry.Lookup): Likewise.
8436 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
8439 * decl.cs (DeclSpace): Implement IAlias.
8440 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
8442 * generic.cs (ConstructedType): Improved error checking.
8444 2004-04-02 Martin Baulig <martin@ximian.com>
8446 * convert.cs: Added type parameter conversions.
8449 (UnboxCast.Emit): Emit an `unbox.any' for type params.
8450 (ClassCast.Emit): If the source type is a type parameter, box it.
8451 If the target type is a type parameter, emit an `unbox.any'
8452 instead of a `classcast'.1
8454 2004-04-01 Martin Baulig <martin@ximian.com>
8456 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
8458 2004-04-01 Martin Baulig <martin@ximian.com>
8460 * generic.cs (ConstructedType.CheckConstraints): Use
8461 Convert.ImplicitStandardConversionExists(); user-defined implicit
8462 conversions are not allowed according to the spec.
8464 2004-03-30 Martin Baulig <martin@ximian.com>
8466 * expression.cs (New): Added support for type parameters.
8469 (TypeManager.activator_type): New public static field.
8470 (TypeManager.activator_create_instance): Likewise.
8472 2004-03-30 Martin Baulig <martin@ximian.com>
8474 * typemanager.cs (TypeManager.HasConstructorConstraint): New
8477 2004-03-30 Martin Baulig <martin@ximian.com>
8479 * generic.cs (ConstructedType.CheckConstraints): Actually follow
8480 the spec here: the argument type must be convertible to the
8483 2004-03-30 Martin Baulig <martin@ximian.com>
8486 (TypeParameter.Define, TypeParameter.DefineMethod): Call
8487 TypeManager.AddTypeParameter().
8488 (ConstructedType.CheckConstraints): Re-enable this and actually
8489 check whether we have a constructor constraint.
8492 (TypeManager.builder_to_type_param): New static field.
8493 (TypeManager.AddTypeParameter): New static method.
8494 (TypeManager.LookupTypeParameter): New public method.
8496 2004-03-30 Martin Baulig <martin@ximian.com>
8498 * generic.cs (TypeParameter.DefineType): Return a boolean and use
8499 the new API to actually define the constructor constraint.
8502 (TypeManager.new_constraint_attr_type): New static field.
8503 (TypeManager.InitCoreTypes): Initialize it.
8505 2004-03-30 Martin Baulig <martin@ximian.com>
8507 * generic.cs (Constraints): Completed error checking, use correct
8510 2004-03-29 Martin Baulig <martin@ximian.com>
8512 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
8514 * expression.cs (Invocation.InferTypeArguments): Added overloaded
8515 public version which takes a `ParameterData pd' instead of an
8518 2004-03-29 Martin Baulig <martin@ximian.com>
8520 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
8523 2004-03-29 Martin Baulig <martin@ximian.com>
8525 * expression.cs (Argument.ResolveMethodGroup): If we're a
8526 ConstructedType, call GetMemberAccess() on it.
8528 2004-03-29 Martin Baulig <martin@ximian.com>
8530 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
8531 (MethodCore.CheckGenericOverride): When overriding a generic
8532 method, check whether the constraints match.
8534 * support.cs (GenericConstraints): New public interface.
8535 (ParameterData.GenericConstraints): New public method.
8537 * parameter.cs (Parameter.Resolve): Check whether we're a generic
8538 method parameter and compute our constraints if appropriate.
8539 (Parameter.GenericConstraints): New public property.
8541 * generic.cs (Constraints): Implement GenericConstraints.
8543 2004-03-29 Martin Baulig <martin@ximian.com>
8545 * decl.cs (MemberCache.FindMemberToOverride): Use
8546 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
8548 2004-03-29 Martin Baulig <martin@ximian.com>
8550 * generic.cs (GenericMethod.Define): Resolve our type parameters.
8552 2004-03-29 Martin Baulig <martin@ximian.com>
8554 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
8555 not allowed on non-generic declarations").
8557 2004-03-29 Martin Baulig <martin@ximian.com>
8559 * expression.cs (Invocation.InferTypeArguments): Added overloaded
8560 public version of this method.
8562 * class.cs (MethodCore.IsDuplicateImplementation): Use
8563 Invocation.InferTypeArguments() to check this.
8565 2004-03-29 Martin Baulig <martin@ximian.com>
8567 * convert.cs: Use TypeManager.IsDelegateType() instead of
8568 comparing types correctly.
8570 2004-03-29 Martin Baulig <martin@ximian.com>
8572 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
8573 types directly to make it work for generic instances.
8575 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
8577 2004-03-29 Martin Baulig <martin@ximian.com>
8579 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
8582 2004-03-24 Martin Baulig <martin@ximian.com>
8584 * decl.cs (DeclSpace.FindType): Also use
8585 TypeManager.CheckGeneric() for types from the using clauses.
8587 2004-03-23 Martin Baulig <martin@ximian.com>
8589 * expression.cs (Invocation.OverloadResolve): Added `bool
8590 may_fail' argument and use it instead of the Location.IsNull() hack.
8592 2004-03-23 Martin Baulig <martin@ximian.com>
8594 * expression.cs (Invocation.InferType): Use correct type inference
8597 2004-03-23 Martin Baulig <martin@ximian.com>
8599 * ecore.cs (MethodGroupExpr.Name): Use
8600 TypeManager.CSharpSignature() instead of just the name.
8602 * expression.cs (Invocation.OverloadResolve): Provide better error
8604 (Invocation.DoResolve): OverloadResolve() never returns null
8605 without reporting an error, so removed the error -6 reporting here.
8607 2004-03-23 Martin Baulig <martin@ximian.com>
8609 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
8612 * cs-parser.jay (delegate_declaration): Support generic delegates.
8614 * delegate.cs: Support generic delegates.
8616 2004-03-22 Martin Baulig <martin@ximian.com>
8618 * expression.cs (Invocation.InferParamsTypeArguments): New static
8619 method; does type inference for params arguments.
8621 2004-03-21 Martin Baulig <martin@ximian.com>
8623 * typemanager.cs (TypeManager.IsGenericMethod): New public static
8624 method; checks whether a method is a generic method.
8626 * expression.cs (Invocation.InferTypeArguments): New static method;
8627 infer type arguments for generic method invocation.
8629 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
8630 property; we set this to true if we're resolving a generic method
8631 invocation and the user specified type arguments, ie. we're not
8632 doing type inference.
8634 2004-03-20 Martin Baulig <martin@ximian.com>
8636 * class.cs (MethodData.DeclaringType): New public property.
8637 (MethodData.Define): Set DeclaringType here.
8638 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
8639 instead of OperatorMethodBuilder.DeclaringType.
8641 2004-03-20 Martin Baulig <martin@ximian.com>
8643 * cs-tokenizer.cs (xtoken): Return a special
8644 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
8646 * cs-parser.jay (default_value_expression): Switch to the new
8649 2004-03-19 Martin Baulig <martin@ximian.com>
8651 * decl.cs (MemberName): New class. We use this to "construct"
8652 namespace_or_type_name's.
8654 * generics.cs (TypeArguments.GetDeclarations): New public method;
8655 returns the type arguments as a string[] and reports a CS0081 if
8656 one of them is not an identifier.
8658 * class.cs (MemberBase): The .ctor now takes the name as a
8659 MemberName instead of a string.
8660 (MemberBase.ExplicitInterfaceName): Changed type from string to
8662 (MemberBase.DoDefine): If we're an explicit implementation, the
8663 InterfaceType may be a generic instance.
8665 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
8666 (namespace_name): Call MemberName.GetName () to transform the
8667 MemberName into a string and ensure we don't have any type
8669 (type_name): Call MemberName.GetTypeExpression() to transfrom the
8670 MemberName into an expression.
8671 (method_header): Use namespace_or_type_name instead of member_name.
8673 2004-04-07 Miguel de Icaza <miguel@ximian.com>
8675 * rootcontext.cs: Add new types to the boot resolution.
8677 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8678 MulticastDelegate is not allowed.
8680 * typemanager.cs: Add new types to lookup: System.TypedReference
8683 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8684 check for TypedReference or ArgIterator, they are not allowed.
8686 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8687 makes us properly catch 1510 in some conditions (see bug 56016 for
8690 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
8692 * CryptoConvert.cs: update from corlib version
8695 2004-04-05 Miguel de Icaza <miguel@ximian.com>
8697 * class.cs (Indexer.Define): Check indexername declaration
8699 2004-04-05 Marek Safar <marek.safar@seznam.cz>
8701 * attribute.cs (IsClsCompliant): Fixed problem with handling
8702 all three states (compliant, not-compliant, undetected).
8704 2004-03-30 Marek Safar <marek.safar@seznam.cz>
8706 * attribute.cs (Attribute): Location is now public.
8707 (Resolve): Store resolved arguments (pos_values) in attribute class.
8708 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8709 (GetClsCompliantAttributeValue): New method that gets
8710 CLSCompliantAttribute value.
8711 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8712 if exists else null.
8713 (AttributeTester): New class for CLS-Compliant verification routines.
8715 * class.cs (Emit): Add CLS-Compliant verification.
8716 (Method.GetSignatureForError): Implemented.
8717 (Constructor.GetSignatureForError): Implemented
8718 (Constructor.HasCompliantArgs): Returns if constructor has
8719 CLS-Compliant arguments.
8720 (Constructor.Emit): Override.
8721 (Construcor.IsIdentifierClsCompliant): New method; For constructors
8722 is needed to test only parameters.
8723 (FieldBase.GetSignatureForError): Implemented.
8724 (TypeContainer): New member for storing base interfaces.
8725 (TypeContainer.FindMembers): Search in base interfaces too.
8727 * codegen.cs (GetClsComplianceAttribute): New method that gets
8728 assembly or module CLSCompliantAttribute value.
8729 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8731 (ModuleClass.Emit): Add error 3012 test.
8733 * const.cs (Emit): Override and call base for CLS-Compliant tests.
8735 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8736 state for all decl types.
8737 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8738 if CLS-Compliant tests are required.
8739 (IsClsCompliaceRequired): New method. Analyze whether code
8740 must be CLS-Compliant.
8741 (IsExposedFromAssembly): New method. Returns true when MemberCore
8742 is exposed from assembly.
8743 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8744 value or gets cached value.
8745 (HasClsCompliantAttribute): New method. Returns true if MemberCore
8746 is explicitly marked with CLSCompliantAttribute.
8747 (IsIdentifierClsCompliant): New abstract method. This method is
8748 used to testing error 3005.
8749 (IsIdentifierAndParamClsCompliant): New method. Common helper method
8750 for identifier and parameters CLS-Compliant testing.
8751 (VerifyClsCompliance): New method. The main virtual method for
8752 CLS-Compliant verifications.
8753 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8754 null. I don't know why is null (too many public members !).
8755 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8756 and get value of first CLSCompliantAttribute that found.
8758 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8759 (VerifyClsCompliance): Override and add extra tests.
8761 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8762 clscheck- disable CLS-Compliant verification event if assembly is has
8763 CLSCompliantAttribute(true).
8765 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8766 ApllyAttribute is now called in emit section as in the other cases.
8767 Possible future Emit integration.
8768 (IsIdentifierClsCompliant): New override.
8769 (VerifyClsCompliance): New override.
8770 (GetEnumeratorName): Returns full enum name.
8772 * parameter.cs (GetSignatureForError): Implemented.
8774 * report.cs (WarningData): New struct for Warning message information.
8775 (LocationOfPreviousError): New method.
8776 (Warning): New method. Reports warning based on the warning table.
8777 (Error_T): New method. Reports error based on the error table.
8779 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8780 verifications are done here.
8782 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8784 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8785 CLSCompliantAttribute.
8786 (all_imported_types): New member holds all imported types from other
8788 (LoadAllImportedTypes): New method fills static table with exported types
8789 from all referenced assemblies.
8790 (Modules): New property returns all assembly modules.
8792 2004-03-30 Miguel de Icaza <miguel@ximian.com>
8794 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8795 throwing a parser error.
8797 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8798 which removes the hardcoded get_/set_ prefixes for properties, as
8799 IL allows for the properties to be named something else.
8803 * expression.cs: Do not override operand before we know if it is
8806 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8808 * typemanager.cs: support for pinned variables.
8810 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8812 * decl.cs, typemanager.cs: Avoid using an arraylist
8813 as a buffer if there is only one result set.
8815 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8817 * expression.cs: Make sure you cant call a static method
8818 with an instance expression, bug #56174.
8820 2004-03-29 Miguel de Icaza <miguel@ximian.com>
8822 * class.cs (IsDuplicateImplementation): Improve error reporting to
8823 flag 663 (method only differs in parameter modifier).
8825 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8826 in preprocessor directives.
8828 * location.cs (LookupFile): Allow for the empty path.
8830 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
8831 better approach for some of that patch, but its failing with the
8832 CharSet enumeration. For now try/catch will do.
8834 * typemanager.cs: Do not crash if a struct does not have fields.
8837 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8839 * expression.cs: cs0213, cant fix a fixed expression.
8842 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8844 * cs-parser.jay: detect invalid embeded statements gracefully.
8847 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8849 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8852 the invocation type may not be a subclass of the tye of the item/
8853 The type of the item must be a subclass of the invocation item.
8858 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
8860 * attribute.cs: Added methods to get a string and a bool from an
8861 attribute. Required to information from AssemblyKeyFileAttribute,
8862 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8863 * codegen.cs: Modified AssemblyName creation to include support for
8864 strongnames. Catch additional exceptions to report them as CS1548.
8865 * compiler.csproj: Updated include CryptoConvert.cs.
8866 * compiler.csproj.user: Removed file - user specific configuration.
8867 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
8868 Mono.Security assembly. The original class is maintained and tested in
8869 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8870 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8871 like CSC 8.0 (C# v2) supports.
8872 * Makefile: Added CryptoConvert.cs to mcs sources.
8873 * rootcontext.cs: Added new options for strongnames.
8875 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
8877 * driver.cs: For --expect-error, report error code `2'
8878 if the program compiled with no errors, error code `1' if
8879 it compiled with an error other than the one expected.
8881 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
8883 * compiler.csproj: Updated for Visual Studio .NET 2003.
8884 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8885 * compiler.sln: Updated for Visual Studio .NET 2003.
8887 2004-03-24 Ravi Pratap M <ravi@ximian.com>
8889 * expression.cs: Fix bug #47234. We basically need to apply the
8890 rule that we prefer the conversion of null to a reference type
8891 when faced with a conversion to 'object' (csc behaviour).
8893 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8895 * statement.cs: Shorter form for foreach, eliminates
8896 a local variable. r=Martin.
8898 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8900 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8901 checks if we can use brtrue/brfalse to test for 0.
8902 * expression.cs: use the above in the test for using brtrue/brfalse.
8905 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8907 * expression.cs: Rewrite string concat stuff. Benefits:
8909 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8910 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8911 rather than a concat chain.
8913 * typemanager.cs: Add lookups for more concat overloads.
8915 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8917 * expression.cs: Emit shorter il code for array init.
8934 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
8936 * statement.cs: Before, two switch blocks would be merged if the
8937 total size of the blocks (end_item - begin_item + 1) was less than
8938 two times the combined sizes of the blocks.
8940 Now, it will only merge if after the merge at least half of the
8945 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
8947 * class.cs : csc build fix for GetMethods(). See bug #52503.
8949 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
8951 * expression.cs: Make sure fp comparisons work with NaN.
8952 This fixes bug #54303. Mig approved this patch a long
8953 time ago, but we were not able to test b/c the runtime
8956 2004-03-19 Miguel de Icaza <miguel@ximian.com>
8958 * ecore.cs (TypExpr.GetHashCode): implement this overload.
8960 2004-03-19 Martin Baulig <martin@ximian.com>
8962 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
8963 two overloads may unify for some type parameter substitutions and
8964 report a CS0408 if appropriate.
8966 2004-03-19 Martin Baulig <martin@ximian.com>
8968 * class.cs (MemberCore.IsDuplicateImplementation): Report the
8969 error here and not in our caller.
8971 2004-03-19 Martin Baulig <martin@ximian.com>
8973 * interface.cs: Completely killed this file.
8974 (Interface): We're now a TypeContainer and live in class.cs.
8976 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8977 argument; we're now also called for interfaces.
8978 (TypeContainer.DefineMembers): Allow this method being called
8980 (TypeContainer.GetMethods): New public method; formerly known as
8981 Interface.GetMethod(). This is used by PendingImplementation.
8982 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8983 it's now private and non-static.
8984 (Interface): Moved this here; it's now implemented similar to
8986 (Method, Property, Event, Indexer): Added `bool is_interface'
8987 argument to their .ctor's.
8988 (MemberBase.IsInterface): New public field.
8990 * cs-parser.jay: Create normal Method, Property, Event, Indexer
8991 instances instead of InterfaceMethod, InterfaceProperty, etc.
8992 (opt_interface_base): Removed; we now use `opt_class_base' instead.
8993 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8995 2004-03-19 Martin Baulig <martin@ximian.com>
8997 * class.cs (MethodCore.IsDuplicateImplementation): New private
8998 method which does the CS0111 checking.
8999 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9000 Use IsDuplicateImplementation().
9002 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
9004 * decl.cs (FindMemberToOverride): New method to find the correct
9005 method or property to override in the base class.
9007 - Make Method/Property use the above method to find the
9008 version in the base class.
9009 - Remove the InheritableMemberSignatureCompare as it is now
9012 This patch makes large code bases much faster to compile, as it is
9013 O(n) rather than O(n^2) to do this validation.
9015 Also, it fixes bug 52458 which is that nested classes are not
9016 taken into account when finding the base class member.
9018 Reviewed/Approved by Martin.
9020 2004-03-17 Martin Baulig <martin@ximian.com>
9022 * expression.cs (MemberAccess.DoResolve): Take the parent's number
9023 of type arguments into account; use the `real_num_type_args'
9024 approach like in DoResolveAsTypeStep().
9026 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
9029 2004-03-17 Marek Safar <marek.safar@seznam.cz>
9031 * interface.cs: In all interface classes removed redundant
9032 member initialization.
9034 2004-03-16 Martin Baulig <martin@ximian.com>
9036 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9038 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9040 * decl.cs (DefineTypeAndParents): New helper method to define a
9041 type's containers before the type itself is defined; This is a
9042 bug exposed by the recent changes to Windows.Forms when an
9043 implemented interface was defined inside a class that had not been
9046 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9048 (Check): Loop correctly to report errors modifiers
9049 (UNSAFE was not in the loop, since it was the same as TOP).
9051 * interface.cs: Every interface member now takes a ModFlags,
9052 instead of a "is_new" bool, which we set on the base MemberCore.
9054 Every place where we called "UnsafeOk" in the interface, now we
9055 call the proper member (InterfaceMethod.UnsafeOK) instead to get
9056 the unsafe settings from the member declaration instead of the
9057 container interface.
9059 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
9061 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9062 `set_indexer_name' to the pending bits (one per type).
9064 We fixed a bug today that was picking the wrong method to
9065 override, since for properties the existing InterfaceMethod code
9066 basically ignored the method name. Now we make sure that the
9067 method name is one of the valid indexer names.
9069 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
9071 * support.cs (SeekableStreamReader): Keep track of stream byte
9072 positions and don't mix them with character offsets to the buffer.
9074 Patch from Gustavo Giráldez
9076 2004-03-15 Marek Safar <marek.safar@seznam.cz>
9078 * interface.cs (InterfaceSetGetBase): Removed double member
9079 initialization, base class does it as well.
9081 2004-03-13 Martin Baulig <martin@ximian.com>
9083 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9084 when compiling corlib.
9086 2004-03-13 Miguel de Icaza <miguel@ximian.com>
9088 * convert.cs (ExplicitConversion): We were reporting an error on
9089 certain conversions (object_type source to a value type, when the
9090 expression was `null') before we had a chance to pass it through
9091 the user defined conversions.
9093 * driver.cs: Replace / and \ in resource specifications to dots.
9096 * class.cs: Add check for duplicate operators. Fixes 52477
9098 2004-03-11 Miguel de Icaza <miguel@ximian.com>
9100 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9101 that are in the middle of the statements, not only at the end.
9104 * class.cs (TypeContainer.AddField): No longer set the
9105 `HaveStaticConstructor' flag, now we call it
9106 `UserDefineStaticConstructor' to diferentiate the slightly
9107 semantic difference.
9109 The situation is that we were not adding BeforeFieldInit (from
9110 Modifiers.TypeAttr) to classes that could have it.
9111 BeforeFieldInit should be set to classes that have no static
9116 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9118 And most importantly Zoltan's comment:
9120 http://bugzilla.ximian.com/show_bug.cgi?id=44229
9122 "I think beforefieldinit means 'it's ok to initialize the type sometime
9123 before its static fields are used', i.e. initialization does not need
9124 to be triggered by the first access to the type. Setting this flag
9125 helps the JIT to compile better code, since it can run the static
9126 constructor at JIT time, and does not need to generate code to call it
9127 (possibly lots of times) at runtime. Unfortunately, mcs does not set
9128 this flag for lots of classes like String.
9130 csc sets this flag if the type does not have an explicit static
9131 constructor. The reasoning seems to be that if there are only static
9132 initalizers for a type, and no static constructor, then the programmer
9133 does not care when this initialization happens, so beforefieldinit
9136 This bug prevents the AOT compiler from being usable, since it
9137 generates so many calls to mono_runtime_class_init that the AOT code
9138 is much slower than the JITted code. The JITted code is faster,
9139 because it does not generate these calls if the vtable is type is
9140 already initialized, which is true in the majority of cases. But the
9141 AOT compiler can't do this."
9143 2004-03-10 Miguel de Icaza <miguel@ximian.com>
9145 * class.cs (MethodData.Emit): Refactor the code so symbolic
9146 information is generated for destructors; For some reasons we
9147 were taking a code path that did not generate symbolic information
9150 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
9152 * class.cs: Create a Constructor.CheckBase method that
9153 takes care of all validation type code. The method
9154 contains some code that was moved from Define.
9156 It also includes new code that checks for duplicate ctors.
9157 This fixes bug #55148.
9159 2004-03-09 Joshua Tauberer <tauberer@for.net>
9161 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9162 a { ... }-style array creation invokes EmitStaticInitializers
9163 which is not good for reference-type arrays. String, decimal
9164 and now null constants (NullCast) are not counted toward
9165 static initializers.
9167 2004-03-05 Martin Baulig <martin@ximian.com>
9169 * location.cs (SourceFile.HasLineDirective): New public field;
9170 specifies whether the file contains or is referenced by a "#line"
9172 (Location.DefineSymbolDocuments): Ignore source files which
9173 either contain or are referenced by a "#line" directive.
9175 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
9177 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9178 direct access to our parent, so check the method inline there.
9180 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
9182 * expression.cs (Invocation.EmitCall): Miguel's last commit
9183 caused a regression. If you had:
9188 In Foo the implict this would be null.
9190 2004-02-27 Miguel de Icaza <miguel@ximian.com>
9192 * expression.cs (Invocation.EmitCall): If the method is not
9193 virtual, do not emit a CallVirt to it, use Call.
9195 * typemanager.cs (GetFullNameSignature): Improve the method to
9196 cope with ".ctor" and replace it with the type name.
9198 * class.cs (ConstructorInitializer.Resolve): Now the method takes
9199 as an argument the ConstructorBuilder where it is being defined,
9200 to catch the recursive constructor invocations.
9202 2004-03-16 Martin Baulig <martin@ximian.com>
9204 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
9205 ConstructedType, call ResolveType() on it to get the type rather
9206 than just using `expr.Type'.
9208 2004-03-16 Martin Baulig <martin@ximian.com>
9210 * generics.cs (ConstructedType.GetMemberAccess): Take the
9211 EmitContext instead on the TypeExpr and use
9212 ec.TypeContainer.CurrentType/ec.ContainerType.
9214 2004-03-16 Martin Baulig <martin@ximian.com>
9216 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
9217 parameters before aliases.
9219 2004-03-16 Martin Baulig <martin@ximian.com>
9221 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
9222 New oublic function; checks whether two generic instances may become
9223 equal under some instantiations (26.3.1).
9225 * class.cs (TypeContainer.Define): Call
9226 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
9229 2004-03-16 Martin Baulig <martin@ximian.com>
9231 * class.cs (TypeContainer.GetClassBases): Moved
9232 Error_TypeParameterAsBase() here and also check whether the base
9233 class is not an attribute.
9235 2004-03-16 Martin Baulig <martin@ximian.com>
9237 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9239 2004-03-16 Martin Baulig <martin@ximian.com>
9241 * class.cs (Error_TypeParameterAsBase): Use correct error number
9244 2004-03-16 Martin Baulig <martin@ximian.com>
9246 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
9249 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
9252 2004-03-15 Martin Baulig <martin@ximian.com>
9254 * typemanager.cs (TypeManager.GetFullName): New public method.
9255 (TypeManager.MemberLookup): Added `int_num_type_arguments'
9256 argument; only return members with the correct number of type
9258 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
9259 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
9260 whether the number of type arguments matches.
9262 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
9263 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
9265 * expression.cs (MemberAccess): Added public `NumTypeArguments'
9266 field; it's set by the protected .ctor when we're actually a
9267 GenericMemberAccess.
9268 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
9269 arguments and pass it to MemberLookupFinal ().
9271 * ecore.cs (Expression.MemberLookup): Added `int
9272 num_type_arguments' argument; only return members with the correct
9273 number of type arguments.
9274 (Expression.MemberLookupFailed): Check whether the MemberLookup
9275 failed because we did not have the correct number of type
9276 arguments; report CS0305 in this case.
9278 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
9279 `e.ResolveAsTypeTerminal()' already did so.
9281 2004-03-15 Martin Baulig <martin@ximian.com>
9283 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
9284 we're a ConstructedType; in this case, the caller must report an
9285 error (for instance CS0131).
9287 * generic.cs (TypeArguments): Added Location argument to the .ctor.
9288 (TypeArguments.Resolve): Actually report errors here.
9290 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9292 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9293 `set_indexer_name' to the pending bits (one per type).
9295 We fixed a bug today that was picking the wrong method to
9296 override, since for properties the existing InterfaceMethod code
9297 basically ignored the method name. Now we make sure that the
9298 method name is one of the valid indexer names.
9300 2004-03-15 Martin Baulig <martin@ximian.com>
9302 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
9303 for generic instances.
9305 2004-03-13 Martin Baulig <martin@ximian.com>
9307 * class.cs (TypeContainer.DefineType): Call
9308 TypeManager.AddUserType() immediately after creating the
9309 TypeBuilder; pass all type parameters when creating the
9312 * decl.cs (DeclSpace.FindNestedType): New public method.
9313 (DeclSpace.FindType): Added `int num_type_args' argument; only
9314 return types with the correct number of type parameters.
9315 (DeclSpace.CountTypeParams): New public property.
9317 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
9318 the number of type parameters; defaults to zero.
9320 * generic.cs (TypeArguments.Count): New public property.
9321 (ConstructedType.DoResolveAsTypeStep): First call
9322 ds.FindNestedType() to find out whether we're nested in the
9323 current generic type; in this case, we inherit all type parameters
9324 from the current class.
9326 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
9327 num_type_args' argument.
9328 (RootContext.LookupType): Added overloaded version which takes the
9329 number of type arguments; only return types with the correct
9330 number of type arguments.
9332 * typemanager.cs (TypeManager.CheckGeneric): New public function;
9333 checks whether `Type t' has `int num_type_args'.
9335 2004-03-13 Martin Baulig <martin@ximian.com>
9337 * generic.cs (GenericMethod.DefineType): New method; calls
9338 DefineType() on all the type parameters.
9340 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
9341 (MethodData.Define): If we're a generic method, call
9342 GenericMethod.DefineType() to define the type parameters.
9344 2004-03-10 Martin Baulig <martin@ximian.com>
9346 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
9347 instead of IsAssignableFrom.
9349 2004-03-10 Martin Baulig <martin@ximian.com>
9351 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
9353 * support.cs (ParameterData.HasArrayParameter): New property.
9354 (ReflectionParameters.ctor): Take a MethodBase instead of a
9355 ParameterInfo[]. If we have any type parameters, get the generic
9356 method definition and ask it whether we have variable arguments.
9358 2004-02-26 Miguel de Icaza <miguel@ximian.com>
9360 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9361 routines to check if a type is an enumerable/enumerator allow
9362 classes that implement the IEnumerable or IEnumerator interfaces.
9364 * class.cs (Property, Operator): Implement IIteratorContainer, and
9365 implement SetYields.
9367 (Property.Define): Do the block swapping for get_methods in the
9368 context of iterators. We need to check if Properties also
9369 include indexers or not.
9371 (Operator): Assign the Block before invoking the
9372 OperatorMethod.Define, so we can trigger the Iterator code
9375 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
9376 Property and Operator classes are not created when we parse the
9377 declarator but until we have the block completed, so we use a
9378 singleton SimpleIteratorContainer.Simple to flag whether the
9379 SetYields has been invoked.
9381 We propagate this setting then to the Property or the Operator to
9382 allow the `yield' to function.
9384 2004-02-25 Marek Safar <marek.safar@seznam.cz>
9386 * codegen.cs: Implemented attribute support for modules.
9387 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9388 Assembly/Module functionality.
9390 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9391 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9392 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9394 2004-02-16 Marek Safar <marek.safar@seznam.cz>
9396 * interface.cs (FindMembers): The operation is performed on all base
9397 interfaces and not only on the first. It is required for future CLS Compliance patch.
9399 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
9401 * statement.cs, codegen.cs:
9402 This patch deals with patterns such as:
9404 public class List : IEnumerable {
9406 public MyEnumerator GetEnumerator () {
9407 return new MyEnumerator(this);
9410 IEnumerator IEnumerable.GetEnumerator () {
9414 public struct MyEnumerator : IEnumerator {
9419 Before, there were a few things we did wrong:
9420 1) we would emit callvirt on a struct, which is illegal
9421 2) we emited ldarg when we needed to emit ldarga
9422 3) we would mistakenly call the interface methods on an enumerator
9423 type that derived from IEnumerator and was in another assembly. For example:
9425 public class MyEnumerator : IEnumerator
9427 Would have the interface methods called, even if there were public impls of the
9428 method. In a struct, this lead to invalid IL code.
9430 2004-02-11 Marek Safar <marek.safar@seznam.cz>
9432 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9435 * delegate.cs (Define): Fixed crash when delegate type is undefined.
9437 2004-02-11 Miguel de Icaza <miguel@ximian.com>
9439 * cs-parser.jay: Fix small regression: we were not testing V2
9440 compiler features correctly.
9442 * interface.cs: If the emit context is null, then create one
9444 2004-02-09 Marek Safar <marek.safar@seznam.cz>
9446 * decl.cs (GetSignatureForError): New virtual method to get full name
9449 * attribute.cs (IAttributeSupport): New interface for attribute setting.
9450 Now it is possible to rewrite ApplyAttributes method to be less if/else.
9452 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9453 Duplicated members and code in these classes has been removed.
9454 Better encapsulation in these classes.
9456 2004-02-07 Miguel de Icaza <miguel@ximian.com>
9458 * assign.cs (Assign.DoResolve): When dealing with compound
9459 assignments, there is a new rule in ECMA C# 2.4 (might have been
9460 there before, but it is documented here) that states that in:
9464 If b is of type int, and the `op' is a shift-operator, then the
9465 above is evaluated as:
9469 * expression.cs (Binary.ResolveOperator): Instead of testing for
9470 int/uint/long/ulong, try to implicitly convert to any of those
9471 types and use that in pointer arithmetic.
9473 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9474 method to print information for from the type, not from the
9475 null-method we were given.
9477 2004-02-01 Duncan Mak <duncan@ximian.com>
9479 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9480 parsing for cmd, fixes bug #53694.
9482 2004-02-04 Marek Safar <marek.safar@seznam.cz>
9484 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9485 in the member name duplication tests. Property and operator name duplication
9486 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9488 2004-02-03 Marek Safar <marek.safar@seznam.cz>
9490 * interface.cs (PopulateMethod): Fixed crash when interface method
9491 returns not existing type (error test cs0246-3.cs).
9493 2004-02-02 Ravi Pratap M <ravi@ximian.com>
9495 * cs-parser.jay (interface_accessors): Re-write actions to also
9496 store attributes attached to get and set methods. Fix spelling
9499 (inteface_property_declaration): Modify accordingly.
9501 (InterfaceAccessorInfo): New helper class to store information to pass
9502 around between rules that use interface_accessors.
9504 * interface.cs (Emit): Apply attributes on the get and set
9505 accessors of properties and indexers too.
9507 * attribute.cs (ApplyAttributes): Modify accordingly to use the
9508 right MethodBuilder when applying attributes to the get and set accessors.
9510 2004-01-31 Miguel de Icaza <miguel@ximian.com>
9512 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9514 2004-01-26 Miguel de Icaza <miguel@ximian.com>
9516 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9518 2004-01-25 Miguel de Icaza <miguel@ximian.com>
9520 * cs-parser.jay: Remove YIELD token, instead use the new grammar
9521 changes that treat `yield' specially when present before `break'
9524 * cs-tokenizer.cs: yield is no longer a keyword.
9526 2004-01-23 Marek Safar <marek.safar@seznam.cz>
9528 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9529 setting for default constructors.
9530 For default constructors are almost every time set wrong Modifier. The
9531 generated IL code has been alright. But inside mcs this values was
9532 wrong and this was reason why several of my CLS Compliance tests
9535 2004-02-27 Martin Baulig <martin@ximian.com>
9537 * generics.cs (ConstructedType.ResolveType): Make the nested type
9538 stuff actually work.
9540 2004-02-25 Martin Baulig <martin@ximian.com>
9542 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
9543 property; returns the type parameters just from the current type,
9544 ie. with the ones from outer classes.
9545 (DeclSpace.LookupGeneric): First search in the current class, then
9547 (DeclSpace.initialize_type_params): When hiding a type parameter
9548 from an outer class, put it into the `type_param_list' anyways.
9550 * expression.cs (MemberAccess.expr): Made this field protected.
9552 * class.cs (TypeContainer.Define): The `CurrentType' just contains
9553 the type parameters from the current class.
9555 * generic.cs (ConstructedType.ResolveType): Support nested generic
9556 types by taking the type parameters which we inherit from outer
9557 classes into account.
9558 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
9559 support for nested generic types.
9561 2004-02-23 Martin Baulig <martin@ximian.com>
9563 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
9564 field and check whether we're nested inside a generic type.
9565 (DeclSpace.ResolveType): If we're resolving to a generic type
9566 definition, create a ConstructedType and return its resolved type.
9567 (DeclSpace.initialize_type_params): New private method;
9568 initializes the `type_param_list' field from the type parameters
9569 from this and all enclosing classes.
9570 (DeclSpace.TypeParameters): Call initialize_type_params() unless
9571 we're already initialized.
9573 2004-02-23 Martin Baulig <martin@ximian.com>
9575 * class.cs (Method.Define): Create the generic method before
9577 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
9578 the TypeContainer one); we use this for generic methods.
9580 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
9581 parent's TypeBuilder.
9583 2004-02-18 Martin Baulig <martin@ximian.com>
9585 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
9586 to check for equality.
9588 2004-02-05 Martin Baulig <martin@ximian.com>
9590 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
9591 `ec.TypeContainer.CurrentType', use it instead of
9592 `ec.ContainerType' to check whether we're in the type's ctor.
9594 2004-01-29 Martin Baulig <martin@ximian.com>
9596 * expression.cs (Invocation.DoResolve): If we're a
9597 `ConstructedType', then we're actually a generic method, so
9598 rewrite the expr as a GenericMemberAccess.
9600 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
9601 here; manually parse it into a string.
9603 2004-01-28 Martin Baulig <martin@ximian.com>
9605 * typemanager.cs (TypeManager.IsEqual): New static method.
9606 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
9607 check for equality instead of using `=='.
9609 2004-01-26 Martin Baulig <martin@ximian.com>
9611 * decl.cs (DeclSpace.CurrentType): New public field.
9613 * expression.cs (This.ResolveBase): If we have an
9614 `ec.TypeContainer.CurrentType', use it instead of
9617 * class.cs (TypeContainer.DefineType): If we're a generic type,
9618 create the `CurrentType' (unresolved).
9619 (TypeContainer.GenericType): New private field.
9620 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
9621 it and store it in `GenericType' before creating the MemberCache.
9622 (TypeContainer.GetMembers): If we have a `GenericType', call
9623 TypeManager.FindMembers() on it.
9625 * interface.cs (Interface.GenericType): New private field.
9626 (Interface.DefineType): If we're a generic type, create the
9627 `CurrentType' (unresolved).
9628 (Interface.DefineMembers): If we have a `CurrentType', resolve it
9629 and store it in `GenericType' before creating the MemberCache.
9630 (Interface.GetMembers): If we have a `GenericType', call
9631 TypeManager.FindMembers() on it.
9633 2004-01-22 Martin Baulig <martin@ximian.com>
9635 * cs-parser.jay (namespace_or_type_name): Return an Expression,
9636 not a QualifiedIdentifier. This is what `type_name_expression'
9637 was previously doing.
9638 (type_name_expression): Removed; the code is now in
9639 `namespace_or_type_name'.
9640 (qualified_identifier): Removed, use `namespace_or_type_name'
9642 (QualifiedIdentifier): Removed this class.
9644 2004-01-22 Martin Baulig <martin@ximian.com>
9646 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9647 not a string as alias name.
9649 2004-01-21 Miguel de Icaza <miguel@ximian.com>
9651 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9652 #52730 bug, and instead compute correctly the need to use a
9653 temporary variable when requesting an address based on the
9654 static/instace modified of the field and the constructor.
9656 2004-01-21 Martin Baulig <martin@ximian.com>
9658 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9659 class and namespace before looking up aliases. Fixes #52517.
9661 2004-01-21 Martin Baulig <martin@ximian.com>
9663 * flowanalysis.cs (UsageVector.Merge): Allow variables being
9664 assinged in a 'try'; fixes exception4.cs.
9666 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9667 * class.cs : Implemented parameter-less constructor for TypeContainer
9669 * decl.cs: Attributes are now stored here. New property OptAttributes
9671 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9673 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9675 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9677 * typemanager.cs (CSharpSignature): Now reports also inner class name.
9678 (CSharpSignature): New method for indexer and property signature.
9680 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9682 * pending.cs (IsVirtualFilter): Faster implementation.
9684 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9686 * typemanager.cs: Avoid inclusion of same assembly more than once.
9688 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9690 * cs-parser.jay: Fixed problem where the last assembly attribute
9691 has been applied also to following declaration (class, struct, etc.)
9693 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9695 * class.cs: Added error CS0538, CS0539 reporting.
9696 Fixed crash on Microsoft runtime when field type is void.
9698 * cs-parser.jay: Added error CS0537 reporting.
9700 * pending.cs: Added error CS0535 reporting.
9701 Improved error report for errors CS0536, CS0534.
9703 2004-01-20 Miguel de Icaza <miguel@ximian.com>
9705 Merge a few bits from the Anonymous Method MCS tree.
9707 * statement.cs (ToplevelBlock): New class for toplevel methods,
9708 will hold anonymous methods, lifted variables.
9710 * cs-parser.jay: Create toplevel blocks for delegates and for
9711 regular blocks of code.
9713 2004-01-20 Martin Baulig <martin@ximian.com>
9715 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9716 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9717 and `NeedExplicitReturn'; added `IsLastStatement'.
9718 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9719 have a `ReturnLabel' or we're not unreachable.
9721 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9722 child's reachability; don't just override ours with it. Fixes
9723 #58058 (lluis's example).
9724 (FlowBranching): Added public InTryOrCatch(), InCatch(),
9725 InFinally(), InLoop(), InSwitch() and
9726 BreakCrossesTryCatchBoundary() methods.
9728 * statement.cs (Return): Do all error checking in Resolve().
9729 Unless we are the last statement in a top-level block, always
9730 create a return label and jump to it.
9731 (Break, Continue): Do all error checking in Resolve(); also make
9732 sure we aren't leaving a `finally'.
9733 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9734 statement in a top-level block.
9735 (Block.Flags): Added `IsDestructor'.
9736 (Block.IsDestructor): New public property.
9738 2004-01-20 Martin Baulig <martin@ximian.com>
9740 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9742 2004-01-20 Martin Baulig <martin@ximian.com>
9744 * statement.cs (Statement.ResolveUnreachable): New public method.
9745 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9746 (Block.Resolve): Resolve unreachable statements.
9748 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9750 * expression.cs: We need to fix the case where we do
9751 not have a temp variable here.
9753 * assign.cs: Only expression compound assignments need
9754 temporary variables.
9756 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9758 * flowanalysis.cs: Reduce memory allocation in a few ways:
9759 - A block with no variables should not allocate a bit
9761 - A method with no out parameters does not need any tracking
9762 for assignment of the parameters, so we need not allocate
9765 public readonly Type[] VariableTypes;
9766 public readonly string[] VariableNames;
9767 Are redundant. The data is already stored in the variable
9768 map, so we need not allocate another array for it.
9769 - We need to add alot of checks for if (params | locals) == null
9770 due to the first two changes.
9772 2004-01-18 Miguel de Icaza <miguel@ximian.com>
9774 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9775 implement IMemoryLocation, we store a copy on a local variable and
9776 take the address of it. Patch from Benjamin Jemlich
9778 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9779 to use a special "type_name_expression" rule which reduces the
9780 number of "QualifiedIdentifier" classes created, and instead
9781 directly creates MemberAccess expressions.
9783 2004-01-17 Miguel de Icaza <miguel@ximian.com>
9785 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9786 that fixes #52853. Null literal assignment to ValueType
9788 * class.cs (MethodData.Emit): Instead of checking the name of the
9789 method to determine if its a destructor, create a new derived
9790 class from Method called Destructor, and test for that.
9792 * cs-parser.jay: Create a Destructor object instead of a Method.
9794 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9798 2004-01-16 Miguel de Icaza <miguel@ximian.com>
9800 * expression.cs (Binary.ResolveOperator): Perform an implicit
9801 conversion from MethodGroups to their delegate types on the
9804 * delegate.cs: Introduce a new class DelegateCreation that is the
9805 base class for `NewDelegate' and `ImplicitDelegateCreation',
9806 factor some code in here.
9808 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9809 conversion from MethodGroups to compatible delegate types.
9811 * ecore.cs (Expression.Resolve): Do not flag error 654
9812 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9813 we allow conversions from MethodGroups to delegate types now.
9815 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9816 assignments in v2 either.
9818 2004-01-10 Miguel de Icaza <miguel@ximian.com>
9820 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9821 static read-only fields in ctors.
9823 Applied patch from Benjamin Jemlich
9825 * expression.cs (UnaryMutator): Avoid leaking local variables.
9827 2004-01-09 Miguel de Icaza <miguel@ximian.com>
9829 * cs-tokenizer.cs (IsCastToken): Allow the various native types
9830 here to return true, as they can be used like this:
9834 Fixed 49836 and all the other dups
9836 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
9838 * driver.cs: Implement /win32res and /win32icon.
9840 2004-01-08 Miguel de Icaza <miguel@ximian.com>
9842 * cs-parser.jay: Add a rule to improve error handling for the
9843 common mistake of placing modifiers after the type.
9845 2004-01-07 Miguel de Icaza <miguel@ximian.com>
9847 * cs-parser.jay (interface_event_declaration): Catch
9848 initialization of events on interfaces, and report cs0068
9850 * cs-parser.jay (interface_event_declaration): Catch
9851 initialization of events.
9853 * ecore.cs: Better report missing constructors.
9855 * expression.cs (Binary.ResolveOperator): My previous bug fix had
9856 the error reporting done in the wrong place. Fix.
9858 * expression.cs (Binary.ResolveOperator): Catch the
9859 operator + (E x, E y) error earlier, and later allow for implicit
9860 conversions in operator +/- (E e, U x) from U to the underlying
9863 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9864 52596, if the container class is abstract, the default constructor
9865 is protected otherwise its public (before, we were always public).
9867 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9870 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9871 Jemlich that fixes bug #52597, MCS was generating invalid code for
9872 idisposable structs. Thanks to Ben for following up with this
9875 2004-01-06 Miguel de Icaza <miguel@ximian.com>
9877 * driver.cs: Allow assemblies without code to be generated, fixes
9880 2004-01-07 Nick Drochak <ndrochak@gol.com>
9882 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9884 2004-01-05 Miguel de Icaza <miguel@ximian.com>
9886 * cs-parser.jay: Add rules to improve error reporting if fields or
9887 methods are declared at the namespace level (error 116)
9889 * Add rules to catch event add/remove
9891 2004-01-04 David Sheldon <dave-mono@earth.li>
9893 * expression.cs: Added matching ")" to error message for
9896 2004-01-03 Todd Berman <tberman@gentoo.org>
9898 * ecore.cs, attribute.cs:
9899 Applying fix from #52429.
9901 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9903 * ecore.cs, expression.cs, statement.cs:
9904 Total rewrite of how we handle branching. We
9905 now handle complex boolean expressions with fewer
9906 jumps. As well if (x == 0) no longer emits a ceq.
9908 if (x is Foo) is much faster now, because we generate
9911 Overall, we get a pretty big improvement on our benchmark
9912 tests. The code we generate is smaller and more readable.
9914 I did a full two-stage bootstrap. The patch was reviewed
9915 by Martin and Miguel.
9917 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9919 * cs-parser.jay: Make primary_expression not take a QI.
9920 we dont need this because the member_access rule covers
9921 us here. So we replace the rule with just IDENTIFIER.
9923 This has two good effects. First, we remove a s/r conflict.
9924 Second, we allocate many fewer QualifiedIdentifier objects.
9926 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9928 * attribute.cs: Handle MarshalAs attributes as pseudo, and
9929 set the correct information via SRE. This prevents
9930 hanging on the MS runtime. Fixes #29374.
9932 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9934 * convert.cs: correctly handle conversions to value types
9935 from Enum and ValueType as unboxing conversions.
9937 Fixes bug #52569. Patch by Benjamin Jemlich.
9939 2004-01-02 Ravi Pratap <ravi@ximian.com>
9941 * expression.cs (BetterConversion): Prefer int -> uint
9942 over int -> ulong (csc's behaviour). This fixed bug #52046.
9944 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
9946 * decl.cs (MemberCache.FindMembers): now returns a
9949 * typemanager.cs: In general, go with with ^^.
9950 (CopyNewMethods): take an IList.
9951 (RealMemberLookup): Only allocate an arraylist
9952 if we copy from two sets of methods.
9954 This change basically does two things:
9955 1) Fewer array lists allocated due to CopyNewMethods.
9956 2) the explicit cast in MemberList costed ALOT.
9958 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
9960 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9961 a hashtable to avoid needless string allocations when an identifier is
9962 used more than once (the common case).
9964 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
9966 * pending.cs: MS's TypeBuilder.GetInterfaces ()
9967 is broken, it will not return anything. So, we
9968 have to use the information we have in mcs to
9971 * typemanager.cs: Add a cache for GetInterfaces,
9972 since this will now be used more often (due to ^^)
9974 (GetExplicitInterfaces) New method that gets the
9975 declared, not effective, interfaces on a type
9976 builder (eg, if you have interface IFoo, interface
9977 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9980 This patch makes MCS able to bootstrap itself on
9983 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
9985 * expression.cs: Remove the Nop's that Miguel put
9988 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9990 * report.cs, codegen.cs: Give the real stack trace to
9991 the error when an exception is thrown.
9993 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9995 * decl.cs: only allocate hashtables for ifaces if
9998 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10000 * expression.cs: fix the error from cs0121-2.cs
10001 (a parent interface has two child interfaces that
10002 have a function with the same name and 0 params
10003 and the function is called through the parent).
10005 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
10007 * class.cs, rootcontext.cs, typmanager.cs: do not
10010 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
10012 * codegen.cs: remove stack for the ec flow branching.
10013 It is already a linked list, so no need.
10015 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
10017 * Makefile: Allow custom profiler here.
10019 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10021 * typemanager.cs (LookupType):
10022 - Use a static char [], because split takes
10023 a param array for args, so it was allocating
10025 - Do not store true in a hashtable, it boxes.
10027 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10029 * flowanalysis.cs: bytify common enums.
10031 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10033 * modifiers.cs: Add a new set of flags for the
10034 flags allowed on explicit interface impls.
10035 * cs-parser.jay: catch the use of modifiers in
10036 interfaces correctly.
10037 * class.cs: catch private void IFoo.Blah ().
10039 All related to bug #50572.
10041 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10043 * decl.cs: Rewrite the consistant accessability checking.
10044 Accessability is not linear, it must be implemented in
10045 a tableish way. Fixes #49704.
10047 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10049 * expression.cs: Handle negation in a checked context.
10050 We must use subtraction from zero. Fixes #38674.
10052 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10054 * class.cs: Ignore static void main in DLLs.
10055 * rootcontext.cs: Handle the target type here,
10056 since we are have to access it from class.cs
10057 * driver.cs: account for the above.
10059 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10061 * report.cs: Give line numbers and files if available.
10063 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
10065 * driver.cs: Implement /addmodule.
10067 * typemanager.cs: Change 'modules' field so it now contains Modules not
10070 2003-12-20 Martin Baulig <martin@ximian.com>
10072 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10073 (FieldBase.IsAssigned): Removed this field.
10074 (FieldBase.SetAssigned): New public method.
10075 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10077 2003-12-20 Martin Baulig <martin@ximian.com>
10079 * expression.cs (LocalVariableReference.DoResolve): Don't set
10080 `vi.Used' if we're called from DoResolveLValue().
10082 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10083 returns the usage vector it just merged into the current one -
10084 pass this one to UsageWarning().
10085 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10086 of the `EmitContext', don't call this recursively on our children.
10088 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
10090 * driver.cs: Implement /target:module.
10092 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
10094 * support.cs (CharArrayHashtable): New helper class.
10096 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
10097 char arrays, not strings, so we can avoid creating a string in
10098 consume_identifier if the identifier is a keyword.
10100 2003-12-16 Martin Baulig <martin@ximian.com>
10102 * statement.cs (LocalInfo.Assigned): Removed this property.
10103 (LocalInfo.Flags): Removed `Assigned'.
10104 (LocalInfo.IsAssigned): New public method; takes the EmitContext
10105 and uses flow analysis.
10106 (Block.UsageWarning): Made this method private.
10107 (Block.Resolve): Call UsageWarning() if appropriate.
10109 * expression.cs (LocalVariableReference.DoResolve): Always set
10110 LocalInfo.Used here.
10112 2003-12-13 Martin Baulig <martin@ximian.com>
10114 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10115 any value here; we're now using flow analysis to figure out
10116 whether a statement/block returns a value.
10118 2003-12-13 Martin Baulig <martin@ximian.com>
10120 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10122 (FlowBranching.MergeFinally): Don't call
10123 `branching.CheckOutParameters()' here, this is called in
10125 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10126 when adding the `finally' vector.
10128 2003-12-13 Martin Baulig <martin@ximian.com>
10131 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10132 actually work and also fix #48962.
10134 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
10136 * decl.cs: Do not check System.Object for nested types,
10137 since we know it does not have any. Big bang for buck:
10140 Run 1: 8.35 seconds
10141 Run 2: 8.32 seconds
10142 corlib: 17.99 seconds
10144 Run 1: 8.17 seconds
10145 Run 2: 8.17 seconds
10146 corlib: 17.39 seconds
10148 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
10150 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10151 time we are returning 0 members, so we save alot here.
10153 2003-12-11 Martin Baulig <martin@ximian.com>
10155 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10156 `MergeChild()', also just take the `FlowBranching' as argument;
10157 call Merge() on it and return the result.
10158 (FlowBranching.Merge): We don't need to do anything if we just
10161 2003-12-11 Martin Baulig <martin@ximian.com>
10163 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10164 them in an `ArrayList' to reduce memory usage. Thanks to Ben
10165 Maurer for this idea.
10167 2003-12-11 Martin Baulig <martin@ximian.com>
10169 * flowanalysis.cs (MergeResult): This class is now gone; we now
10170 use the `UsageVector' for this. The reason for this is that if a
10171 branching just has one sibling, we don't need to "merge" them at
10172 all - that's the next step to do.
10173 (FlowBranching.Merge): We now return a `UsageVector' instead of a
10176 2003-12-11 Martin Baulig <martin@ximian.com>
10178 Reworked flow analyis and made it more precise and bug-free. The
10179 most important change is that we're now using a special `Reachability'
10180 class instead of having "magic" meanings of `FlowReturns'. I'll
10181 do some more cleanups and optimizations and also add some more
10182 documentation this week.
10184 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10185 largely reworked this class.
10186 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10187 the new `Reachability' class instead of having "magic" values here.
10188 (FlowBranching): We're now using an instance of `Reachability'
10189 instead of having separate `Returns', `Breaks' etc. fields.
10191 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10192 based on flow analysis; ignore the return value of block.Emit ().
10194 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10196 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10197 if they are private.
10199 2003-12-09 Martin Baulig <martin@ximian.com>
10201 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10202 call them directly on the UsageVector.
10204 2003-12-09 Martin Baulig <martin@ximian.com>
10206 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10207 Changed return type from `FlowReturns' to `Reachability'.
10209 2003-12-09 Martin Baulig <martin@ximian.com>
10211 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10212 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10213 `Reachable' fields with a single `Reachability' one.
10215 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10217 * class.cs (FindMembers): Remove foreach's.
10222 Run 1: 8.74 seconds
10223 Run 2: 8.71 seconds
10226 Run 1: 8.64 seconds
10227 Run 2: 8.58 seconds
10230 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10235 This patch does a few things:
10236 1. EmptyStatement is now a singleton, so it is never reallocated.
10237 2. All blah is EmptyStatement constructs have been changed to
10238 blah == EmptyStatement.Value, which is much faster and valid
10239 now that EmptyStatement is a singleton.
10240 3. When resolving a block, rather than allocating a new array for
10241 the non-empty statements, empty statements are replaced with
10242 EmptyStatement.Value
10243 4. Some recursive functions have been made non-recursive.
10244 Mainly the performance impact is from (3), however (1) and (2) are needed for
10245 this to work. (4) does not make a big difference in normal situations, however
10246 it makes the profile look saner.
10251 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10252 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10253 Total memory allocated: 56397 KB
10256 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10257 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10258 Total memory allocated: 55666 KB
10260 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10262 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10263 than the hashtable in a hashtable version
10265 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10266 we always end up concating a string. This results in a huge perf
10267 loss, because many strings have to be tracked by the GC. In this
10268 patch, we first use a hashtable that works with two keys, so that
10269 the strings do not need to be concat'ed.
10273 Run 1: 8.74 seconds
10274 Run 2: 8.71 seconds
10277 Run 1: 8.65 seconds
10278 Run 2: 8.56 seconds
10280 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10282 * Makefile: Add a new target `do-time' that does a quick and simple
10283 profile, leaving easy to parse output.
10285 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
10287 * codegen.cs (Init): Create the dynamic assembly with
10288 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10290 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
10292 * support.cs: Make the PtrHashtable use only one
10293 instance of its comparer.
10295 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
10297 * typemanager.cs: Fix lookup of GetNamespaces.
10299 2003-11-29 Miguel de Icaza <miguel@ximian.com>
10301 * expression.cs: Removed redundant line.
10303 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10304 ArrayLists, use for loops with bounds.
10306 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10309 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10310 arraylists, use for loop with bounds.
10312 The above three changes give us a 0.071 second performance
10313 improvement out of 3.294 seconds down to 3.223. On my machine
10314 the above changes reduced the memory usage by 1,387 KB during
10315 compiler bootstrap.
10317 * cs-parser.jay (QualifiedIdentifier): New class used to represent
10318 QualifiedIdentifiers. Before we created a new string through
10319 concatenation, and mostly later on, the result would be
10320 manipulated by DecomposeQI through string manipulation.
10322 This reduced the compiler memory usage for bootstrapping from
10323 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10324 compile times in 0.05 seconds.
10326 2003-11-28 Dick Porter <dick@ximian.com>
10328 * support.cs: Do string compares with the Invariant culture.
10336 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10337 the comparison is done with the Invariant culture.
10339 2003-11-27 Miguel de Icaza <miguel@ximian.com>
10341 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10342 GetEnumerator method.
10344 (ProbeCollectionType): Iterate starting at the most specific type
10345 upwards looking for a GetEnumerator
10347 * expression.cs: Shift count can be up to 31 for int/uint and 63
10350 2003-11-26 Miguel de Icaza <miguel@ximian.com>
10352 * statement.cs (Block.LookupLabel): Also look for the label on the
10353 children blocks. Use a hash table to keep track of visited
10356 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10357 we actually did transform the other operand, otherwise fall back
10358 to the common codepath that casts to long.
10360 * cs-tokenizer.cs: Use the same code pattern as the int case.
10361 Maybe I should do the parsing myself, and avoid depending on the
10362 Parse routines to get this done.
10364 2003-11-25 Miguel de Icaza <miguel@ximian.com>
10366 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10367 which fixes bug 51347. This time test it.
10369 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10370 attributes for example can not tell the difference between these.
10371 The difference was only a syntax feature of the language.
10373 * attribute.cs: Apply attributes to delegates.
10375 * delegate.cs: Call the apply attributes method.
10377 2003-11-24 Miguel de Icaza <miguel@ximian.com>
10379 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10380 comparing 0 vs Byte.MinValue, not the value
10382 (ImplicitConversionRequired): When reporting a conversion error,
10383 use error 31 to print out the constant error instead of the
10386 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10387 which fixes bug 51347.
10389 2003-11-22 Miguel de Icaza <miguel@ximian.com>
10391 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
10392 which fixes the -warnaserror command line option.
10394 2003-11-21 Miguel de Icaza <miguel@ximian.com>
10396 * cfold.cs (DoNumericPromotions): During constant folding of
10397 additions on UIntConstant, special case intconstants with
10398 IntConstants like we do on the expression binary operator.
10400 2003-11-12 Miguel de Icaza <miguel@ximian.com>
10402 * convert.cs (ImplicitReferenceConversion): We were missing a case
10403 (System.Enum are not value types or class types, so we need to
10404 classify them separatedly).
10406 * driver.cs: We do not support error 2007.
10408 2003-11-12 Jackson Harper <jackson@ximian.com>
10410 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10411 system directory. Also use the full file name so users can
10412 libraries names mscorlib-o-tron.dll in a non system dir.
10414 2004-01-04 David Sheldon <dave-mono@earth.li>
10416 * expression.cs: Added matching ")" to error message for CS0077.
10418 2003-12-19 Martin Baulig <martin@ximian.com>
10420 * typemanager.cs (TypeManager.IsEqualGenericType): New public
10421 static method; see documentation in the method.
10422 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
10424 * convert.cs (Convert.ImplicitReferenceConversion,
10425 Convert.ImplicitReferenceConversionExists): Add support for
10426 generic type declarations; see gen-36.cs.
10428 2003-12-19 Martin Baulig <martin@ximian.com>
10430 * pending.cs (Pending.InterfaceMethod): Use
10431 `Type.IsAssignableFrom()' instead of `=='.
10433 2003-12-18 Martin Baulig <martin@ximian.com>
10435 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
10438 * convert.cs (Convert.ImplicitStandardConversionExists): Use
10439 `expr_type.Equals (target_type)' instead of `=='.
10441 2003-12-08 Martin Baulig <martin@ximian.com>
10443 * generics.cs (Constraints.Types): Removed.
10444 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
10446 (Constraints.ResolveTypes): New public method; resolves the
10447 TypeExpr's to Type's.
10448 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
10449 longer takes the constraints.
10450 (TypeParameter.DefineMethod): Likewise.
10451 (TypeParameter.DefineType): New public method. Calls
10452 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
10455 2003-12-08 Martin Baulig <martin@ximian.com>
10457 * convert.cs (Convert.ImplicitConversionStandard): Use
10458 `expr_type.Equals (target_type)' instead of `=='.
10460 2003-12-08 Martin Baulig <martin@ximian.com>
10462 * typemanager.cs (TypeManager.GetReferenceType): Call
10463 `Type.MakeByRefType ()'.
10465 2003-12-08 Martin Baulig <martin@ximian.com>
10467 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
10468 just has some special meaning in some situations. For instance,
10469 it is allowed to use `where' as the name of a variable etc.
10471 2003-12-04 Martin Baulig <martin@ximian.com>
10473 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10474 `Type.MakeArrayType()' for array types.
10476 2003-11-18 Miguel de Icaza <miguel@ximian.com>
10478 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
10481 (SizeOf.DoResolve): assign the `type_queried' field. This gets
10484 2003-11-16 Martin Baulig <martin@ximian.com>
10486 * codegen.cs (EmitContext.IsGeneric): Removed.
10488 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
10489 ResolveGeneric() on the DeclSpace.
10491 2003-11-16 Martin Baulig <martin@ximian.com>
10493 * generic.cs (TypeArguments.Resolve):
10494 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
10495 `ResolveType()' on it to get the Type.
10497 2003-11-15 Martin Baulig <martin@ximian.com>
10499 * generic.cs (ConstructedType.GetInterfaces): Override this.
10501 2003-11-14 Martin Baulig <martin@ximian.com>
10503 * interface.cs (Interface.DefineType): Define all type parameters
10504 before adding the interfaces we inherit.
10506 2003-11-11 Martin Baulig <martin@ximian.com>
10508 * generic.cs (ConstructedType.ResolveType): Always call
10509 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
10511 2003-11-10 Martin Baulig <martin@ximian.com>
10513 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10514 (TypeManager.InitCoreTypes): Initialize them here, but instead of
10515 calling `ResolveType()' on them, directly assign their `Type'.
10517 2003-11-08 Martin Baulig <martin@ximian.com>
10519 * generic.cs (ConstructedType): Override `IsClass' etc.
10521 2003-11-08 Martin Baulig <martin@ximian.com>
10523 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10524 return value and the `out parent' parameter.
10525 (TypeContainer.DefineType): Moved the CS0644 check into
10526 GetClassBases(). Don't pass the interface types to the
10527 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10528 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10530 * ecore.cs (TypeExpr.IsAttribute): New property.
10531 (TypeExpr.GetInterfaces): New method.
10533 * interface.cs (Interface.GetInterfaceTypeByName): Return a
10534 TypeExpr instead of a Type.
10535 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10536 (Interface.DefineType): Don't pass the interface types to the
10537 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10538 them later and then call `TypeBulider.AddInterfaceImplementation()'.
10540 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10541 instead of a `Type[]'.
10542 (TypeManager.RegisterBuilder): Likewise.
10543 (TypeManager.AddUserInterface): Likewise.
10544 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10545 `Type[]' and also return a `TypeExpr[]'.
10546 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10548 2003-11-08 Martin Baulig <martin@ximian.com>
10550 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10553 2003-11-08 Martin Baulig <martin@ximian.com>
10555 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10556 TypeManager.ResolveExpressionTypes().
10558 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10559 instead of an Expression.
10560 (TypeExpr): This is now an abstract base class for `TypeExpression'.
10561 (TypeExpression): New public class; formerly known as `TypeExpr'.
10563 * expression.cs (ComposedCast): Derive from TypeExpr.
10565 * typemanager.cs (TypeManager.system_*_expr): These are now
10566 TypExpr's instead of Expression's.
10567 (TypeManager.ResolveExpressionTypes): New public static function;
10568 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10571 2003-11-06 Miguel de Icaza <miguel@ximian.com>
10573 * expression.cs (New.DoResolve): Do not dereference value that
10574 might be a null return.
10576 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10577 sure that the constant value has the right type. Fixes an
10578 unreported bug, similar to 50425.
10580 * const.cs (Const.LookupConstantValue): Call
10581 ImplicitStandardConversionExists before doing a conversion to
10582 avoid havng the TypeManager.ChangeType do conversions.
10584 Reduced the number of casts used
10586 (Const.ChangeType): New routine to enable reuse of the constant
10587 type changing code from statement.
10589 * typemanager.cs (ChangeType): Move common initialization to
10590 static global variables.
10594 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10595 every value type to go through, even if it was void. Fix that.
10597 * cs-tokenizer.cs: Use is_identifier_start_character on the start
10598 character of the define, and the is_identifier_part_character for
10599 the rest of the string.
10601 2003-11-05 Miguel de Icaza <miguel@ximian.com>
10603 * expression.cs (UnaryMutator.EmitCode): When I updated
10604 LocalVariableReference.DoResolve, I overdid it, and dropped an
10605 optimization done on local variable references.
10607 2003-11-04 Miguel de Icaza <miguel@ximian.com>
10609 * ecore.cs: Convert the return from Ldlen into an int.
10611 2003-10-20 Miguel de Icaza <miguel@ximian.com>
10613 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10614 the accessibility, this is a special case for toplevel non-public
10615 classes (internal for instance).
10617 2003-10-20 Nick Drochak <ndrochak@gol.com>
10619 * ecore.cs: Fix typo and build. Needed another right paren.
10621 2003-10-19 Miguel de Icaza <miguel@ximian.com>
10623 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
10624 `internal' case regular and protected, but not allowing protected
10625 to be evaluated later. Bug 49840
10627 2003-10-15 Miguel de Icaza <miguel@ximian.com>
10629 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10630 to kb.Nlast, and not the kb.nFirst to isolate the switch
10633 Extract the underlying type, so enumerations of long/ulong are
10634 treated like long/ulong.
10636 2003-10-14 Miguel de Icaza <miguel@ximian.com>
10638 * expression.cs (New): Overload the meaning of RequestedType to
10639 track the possible creation of the NewDelegate type, since
10640 DoResolve is invoked more than once for new constructors on field
10643 See bugs: #48800 and #37014
10645 * cs-parser.jay (declare_local_constants): Take an arraylist
10646 instead of a single constant.
10648 (local_constant_declaration): It should take a
10649 constant_declarators, not a constant_declarator. Fixes 49487
10651 * convert.cs: Fix error report.
10653 2003-10-13 Jackson Harper <jackson@ximian.com>
10655 * typemanager.cs (TypeToCoreType): Add float and double this fixes
10658 2003-11-03 Martin Baulig <martin@ximian.com>
10660 * expression.cs (ArrayAccess.GetStoreOpcode): Added
10661 `out bool has_type_arg'; if set, we need to pass the type to
10663 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
10664 Stelem_Any/Ldelem_Any for generic parameters.
10666 2003-11-02 Martin Baulig <martin@ximian.com>
10668 * expression.cs (Invocation.EmitCall): Use
10669 `TypeManager.IsValueType()' to check whether it's a value type.
10670 Don't set `struct_call' when calling a method on a type parameter.
10672 2003-11-02 Martin Baulig <martin@ximian.com>
10674 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
10675 and removed the TypeBuilder argument.
10677 * typemanager.cs (TypeManager.IsValueType): Return
10678 `t.IsGenericParameter || t.IsValueType'.
10680 2003-10-25 Martin Baulig <martin@ximian.com>
10682 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
10683 call ConstructedType.Resolve() on it.
10685 * generic.cs (ConstructedType.Resolve): Set `type' on success.
10687 2003-10-25 Martin Baulig <martin@ximian.com>
10689 * class.cs (TypeContainer.GetClassBases): Changed
10690 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
10691 CS8214 reporting here.
10692 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
10693 instead of a `Type' for our parent. In case of a recursive
10694 declaration (see tests/gen-23.cs for an example), our parent is a
10695 ConstructedType and it doesn't have its type set. So, first
10696 create our own TypeBuilder, then call constructed.Resolve() to get
10697 the parent's type and finally TypeBuilder.SetParent() it.
10699 * ecore.cs (TypeExpr.Name): New public virtual property.
10702 (ConstructedType): We're now a TypeExpr and not just an Expression.
10703 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
10704 arguments here; this is done later.
10705 (ConstructedType.Resolve): New public method to resolve the type
10706 arguments and bind them.
10708 2003-10-21 Martin Baulig <martin@ximian.com>
10710 * convert.cs: Use `TypeManager.IsValueType' instead of
10711 'type.IsValueType' everywhere.
10713 * typemanager.cs (TypeManager.IsValueType): Return true for type
10714 parameters. The reason for this is that we need to box a type
10715 parameter when converting it to a reference type.
10717 * cs-parser.jay: Added support for default value expressions.
10719 * generics.cs (DefaultValueExpression): New public class.
10721 2003-10-17 Martin Baulig <martin@ximian.com>
10723 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
10724 TypeContainer so we can also use this for Interfaces.
10725 (TypeParameter.Resolve): Likewise.
10727 * interface.cs (Interface.DefineType): Added support for generic
10730 * cs-parser.jay: Added support for generic structs and interfaces.
10732 2003-10-17 Martin Baulig <martin@ximian.com>
10734 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
10735 call generic methods :-)
10737 2003-10-16 Martin Baulig <martin@ximian.com>
10739 * cs-parser.jay (namespace_or_type_name): Only create a
10740 GenericMemberAccess if we actually have type arguments.
10742 2003-10-13 Martin Baulig <martin@ximian.com>
10744 * class.cs (Method.Define): If we're a generic method, call
10745 TypeBuilder.DefineGenericMethod () before resolving
10747 (MethodData): Added .ctor which takes an additional MethodBuilder
10748 argument; this is used for generic methods.
10749 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
10750 we already have a MethodBuilder.
10752 2003-10-10 Martin Baulig <martin@ximian.com>
10754 * class.cs (Method): Added .ctor which takes a `GenericMethod'
10755 instead of a `DeclSpace'. This is used for generic methods.
10757 * cs-parser.jay (method_header): Added support for generic
10758 methods; create a `GenericMethod' instance and pass it to the
10759 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
10760 parameters and locals.
10762 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
10763 since we already have the location. Check whether we're a generic
10764 type declaration or a generic method and create the correct type
10767 * generic.cs (TypeParameter.DefineMethod): New public method.
10768 (GenericMethod): New public class; derives from DeclSpace and is
10769 used for generic methods.
10771 2003-10-09 Martin Baulig <martin@ximian.com>
10773 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10775 (MethodCore.DoDefineParameters): Removed the TypeContainer
10776 argument; use the DeclSpace which was passed to the .ctor instead.
10777 (MethodCore.CheckParameter): Take a DeclSpace instead of a
10778 TypeContainer; we only need a DeclSpace here.
10780 2003-10-09 Martin Baulig <martin@ximian.com>
10782 * class.cs (MethodData): Added additional `DeclSpace ds' argument
10784 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10785 EmitContext's .ctor.
10787 2003-10-09 Martin Baulig <martin@ximian.com>
10789 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10790 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10791 AsAccessible(), moved them as well.
10793 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10795 2003-10-07 Miguel de Icaza <miguel@ximian.com>
10797 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10798 generation for >=, as spotted by Paolo, bug 48679.
10799 Patch from David Waite.
10801 * cs-tokenizer.cs: Add handling for #pragma.
10803 * cs-parser.jay: Allow for both yield and yield return in the
10804 syntax. The anti-cobolization of C# fight will go on!
10806 * class.cs (TypeBuilder.DefineType): Catch error condition here
10807 (Parent.DefineType erroring out and returning null).
10809 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10810 coping with enumerations variables, we were mistakenly processing
10811 them as a regular value type instead of built-in types. Fixes the
10814 * typemanager.cs (IsBuiltinOrEnum): New method.
10816 2003-09-30 Miguel de Icaza <miguel@ximian.com>
10818 * cs-parser.jay: Upgrade: yield now needs the return clause.
10820 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10822 * cs-parser.jay : Renamed yyName to yyNames related to jay.
10824 2003-09-29 Martin Baulig <martin@ximian.com>
10826 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10827 inflated generic methods.
10829 * generics.cs (ConstructedType): Distinguish between open and
10830 closed constructed types; correctly resolve the arguments.
10832 2003-09-22 Martin Baulig <martin@ximian.com>
10834 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10835 all type arguments meet their constraints.
10837 2003-09-19 Martin Baulig <martin@ximian.com>
10839 * decl.cs (MemberCache.SetupCacheForInterface): Take a
10840 `MemberCache parent' argument. Normally, an interface doesn't
10841 have a parent type except System.Object, but we use this in gmcs
10842 for generic type parameters.
10844 2003-09-18 Martin Baulig <martin@ximian.com>
10846 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10847 on `type.IsInterface'; don't check whether the type has a parent
10848 to determine whether it's an interface.
10850 2003-09-17 Martin Baulig <martin@ximian.com>
10852 * generic.cs (ConstructedType.ToString): Always use `name' as the
10855 2003-09-15 Martin Baulig <martin@ximian.com>
10857 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10859 * generic.cs (Constraints.Resolve): New public method; this is
10860 called to resolve the constraint types and to check whether all
10861 the constraints are correct.
10862 (Constraints.Types): New public property.
10863 (TypeParameter.Resolve): New public method; resolves all the
10864 type's constraints.
10866 * class.cs (TypeContainer.DefineType): Call
10867 TypeParameter.Resolve() before actually defining the type.
10869 2003-09-15 Martin Baulig <martin@ximian.com>
10871 * class.cs (TypeContainer.DefineType): Added an error flag to
10872 avoid reporting duplicate CS0146's ("class definition is
10875 * driver.cs (Driver.MainDriver): Abort if
10876 RootContext.ResolveTree() reported any errors.
10878 2003-09-07 Martin Baulig <martin@ximian.com>
10880 * report.cs (Error, Warning): Added overloaded versions which take
10881 a `params object[] args' and call String.Format().
10883 2003-09-07 Martin Baulig <martin@ximian.com>
10885 * decl.cs (DeclSpace..ctor): Don't call
10886 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10887 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
10888 (DeclSpace.RecordDecl): New method.
10890 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10892 2003-09-02 Ravi Pratap <ravi@ximian.com>
10894 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10895 value attributes to be applied to ParameterBuilders.
10897 * class.cs (MethodCore.LabelParameters): Make static and more
10898 generic so that it can be used from other places - like interface
10899 methods, for instance.
10901 * interface.cs (Interface.Emit): Call LabelParameters before
10902 emitting attributes on the InterfaceMethod.
10904 2003-09-07 Martin Baulig <martin@ximian.com>
10906 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10907 if the number of type parameters doesn't match.
10909 2003-09-04 Martin Baulig <martin@ximian.com>
10911 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10912 for arrays of generic type params (ie. `!0[]').
10914 2003-09-04 Martin Baulig <martin@ximian.com>
10916 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10919 2003-09-04 Martin Baulig <martin@ximian.com>
10921 * decl.cs (DeclSpace.LookupGeneric): New method.
10922 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10925 * generic.cs (TypeParameterExpr): Take a TypeParameter as
10926 argument, not just a string.
10927 (TypeParameter.Define): New public method; this is called to
10928 actually define the generic parameter; after this, you can use the
10929 new `Type' property to get the type.
10931 2003-09-04 Martin Baulig <martin@ximian.com>
10933 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
10934 is now an ArrayList; initialize the result of the `TypeParameters'
10936 (DeclSpace.GetGenericData): Removed.
10937 (DeclSpace.LookupGeneric): Temporarily removed; we need to
10938 implement this in a different way.
10939 (DeclSpace.GetTypeParameters): Removed; there's now a
10940 `TypeParameters' property.
10941 (DeclSpace.TypeParameters): New public property.
10943 * generic.cs (Constraints): Make this class public.
10944 (TypeParameter): New public class.
10946 2003-09-04 Martin Baulig <martin@ximian.com>
10948 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
10949 generic parameters.
10951 * class.cs (TypeContainer.DefineType): Call
10952 TypeBuilder.DefineGenericParameter () on all generic parameters if
10953 this is a generic type.
10955 2003-08-28 Martin Baulig <martin@ximian.com>
10957 * sample-stack.il: Compile this with ilasm: "ilasm /dll
10960 * sample-hello.cs: Compile this with gmcs: "gmcs
10961 /r:sample-stack.dll sample-hello.cs".
10963 2003-08-28 Martin Baulig <martin@ximian.com>
10965 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
10966 the parameters to the generic type.
10968 2003-08-28 Martin Baulig <martin@ximian.com>
10970 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
10972 2003-08-28 Martin Baulig <martin@ximian.com>
10974 * cs-parser.jay (opt_type_argument_list): Use
10975 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
10976 (primary_expression): Replace `qualified_identifier' with `type_name'.
10977 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
10979 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
10980 parser to check whether it is syntactically a type parameter list;
10981 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
10984 2003-08-26 Martin Baulig <martin@ximian.com>
10986 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10987 resolving aliases; fixes #47927.
10989 2003-08-26 Martin Baulig <martin@ximian.com>
10991 * statement.cs (Using.DoResolve): This is internally emitting a
10992 try/finally clause, so we need to set ec.NeedExplicitReturn if we
10993 do not always return. Fixes #47681.
10995 2003-08-26 Martin Baulig <martin@ximian.com>
10997 * decl.cs (MemberCore): Moved WarningNotHiding(),
10998 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11000 (AdditionResult): Make this nested in DeclSpace.
11001 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11002 argument; call NamespaceEntry.Define() unless we're nested in a
11005 * namespace.cs (Namespace.DefineName): New public function. This
11006 is called from DeclSpace's .ctor to add
11007 (Namespace.Lookup): Include DeclSpaces in the lookup.
11009 * class.cs (Operator): Derive from MemberBase, not MemberCore.
11011 * const.cs (Const): Derive from MemberBase, not MemberCore.
11013 2003-08-25 Martin Baulig <martin@ximian.com>
11015 * convert.cs (Convert.ExplicitReferenceConversion): When
11016 converting from an interface type to a class, unbox if the target
11017 type is a struct type. Fixes #47822.
11019 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11021 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11024 2003-08-22 Martin Baulig <martin@ximian.com>
11026 * class.cs (TypeManager.DefineType): When defining a nested type,
11027 call DefineType() on our parent; fixes #47801.
11029 2003-08-22 Martin Baulig <martin@ximian.com>
11031 * class.cs (MethodData.Define): While checking if a method is an
11032 interface implementation, improve the test a bit more to fix #47654.
11034 2003-08-22 Martin Baulig <martin@ximian.com>
11036 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11037 correctly; fixes #47722.
11039 2003-08-22 Martin Baulig <martin@ximian.com>
11041 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11042 LocalVariableReference, ensure it's not read-only. Fixes #47536.
11044 * statement.cs (Fixed.DoResolve): Make all variables read-only.
11046 2003-08-22 Martin Baulig <martin@ximian.com>
11048 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11049 can only be assigned in static constructors. Fixes #47161.
11051 2003-08-22 Martin Baulig <martin@ximian.com>
11053 Rewrote and improved the flow analysis code.
11055 * flowbranching.cs (FlowBranching): Make this class abstract.
11056 (FlowBranching.CreateBranching): New static function to create a
11057 new flow branching.
11058 (FlowBranchingBlock, FlowBranchingException): New classes.
11059 (FlowBranching.UsageVector.Type): New public readonly field.
11060 (FlowBranching.UsageVector.Breaks): Removed the setter.
11061 (FlowBranching.UsageVector.Returns): Removed the setter.
11062 (FlowBranching.UsageVector): Added Break(), Return(),
11063 NeverReachable() and Throw() methods to modify the reachability.
11064 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11065 done by FlowBranching.Merge().
11066 (FlowBranching.UsageVector.MergeChild): New method; merges the
11067 merge result into the current vector.
11068 (FlowBranching.Merge): New abstract method to merge a branching.
11070 2003-08-12 Martin Baulig <martin@ximian.com>
11072 * expression.cs (Indirection.CacheTemporaries): Create the
11073 LocalTemporary with the pointer type, not its element type.
11075 2003-08-10 Miguel de Icaza <miguel@ximian.com>
11077 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11078 token was a keyword or not.
11080 Add `error' options where an IDENTIFIER was expected; Provide
11081 CheckToken and CheckIdentifierToken convenience error reporting
11084 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11086 * decl.cs: Rename `NamespaceEntry Namespace' public field into
11087 NameSpaceEntry NameSpaceEntry.
11089 (LookupInterfaceOrClass): Avoid creating a full qualified name
11090 from namespace and name: avoid doing lookups when we know the
11091 namespace is non-existant. Use new Tree.LookupByNamespace which
11092 looks up DeclSpaces based on their namespace, name pair.
11094 * driver.cs: Provide a new `parser verbose' to display the
11095 exception thrown during parsing. This is turned off by default
11096 now, so the output of a failure from mcs is more graceful.
11098 * namespace.cs: Track all the namespaces defined in a hashtable
11101 (IsNamespace): New method
11103 2003-08-09 Miguel de Icaza <miguel@ximian.com>
11105 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
11106 we know that we need to concatenate (full typename can never be
11111 * statement.cs: Use a bitfield; Do not initialize to null things
11112 which are done by the constructor by default.
11114 * cs-parser.jay: bug fix, parameter was 4, not 3.
11116 * expression.cs: Just use the property;
11118 * statement.cs: No need for GetVariableInfo method.
11120 2003-08-08 Martin Baulig <martin@ximian.com>
11122 * flowanalysis.cs (FlowReturns): This is now nested in the
11123 `FlowBranching' class.
11124 (MyBitVector): Moved this here from statement.cs.
11125 (FlowBranching.SiblingType): New enum type.
11126 (FlowBranching.CreateSibling): Added `SiblingType' argument.
11128 2003-08-07 Martin Baulig <martin@ximian.com>
11130 * flowanalysis.cs (FlowBranchingType): This is now nested in the
11131 `FlowBranching' class and called `BranchingType'.
11133 2003-08-07 Martin Baulig <martin@ximian.com>
11135 * flowanalysis.cs: Moved all the control flow analysis code into
11138 2003-08-07 Martin Baulig <martin@ximian.com>
11140 * assign.cs (Assign.DoResolve): `target' must either be an
11141 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
11144 2003-08-07 Miguel de Icaza <miguel@ximian.com>
11146 * expression.cs (BinaryMethod): This kind of expression is created by the
11147 Binary class if it determines that the operator has to be handled
11150 (BinaryDelegate): This kind of expression is created if we are
11151 dealing with a + or - operator on delegates.
11153 (Binary): remove method, argumetns, and DelegateOperator: when
11154 dealing with methods,
11156 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11158 * statement.cs (Block): use bitfields for the three extra booleans
11159 we had in use. Remove unused topblock parameter.
11161 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11163 * assign.cs: Drop extra unneeded tests.
11165 2003-08-06 Miguel de Icaza <miguel@ximian.com>
11167 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11169 * statement.cs (Foreach): Use VariableStorage instead of
11172 * codegen.cs (VariableStorage): New class used by clients that
11173 require a variable stored: locals or fields for variables that
11174 need to live across yield.
11176 Maybe provide a convenience api for EmitThis+EmitLoad?
11178 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11181 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11183 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11184 RemapParameterLValue): New methods that are used to turn a
11185 precomputed FieldInfo into an expression like this:
11189 The idea is to use this instead of making LocalVariableReference
11190 have more than one meaning.
11192 * cs-parser.jay: Add error production to BASE.
11194 * ecore.cs: Deal with TypeManager.GetField returning null, which
11195 is now a valid return value.
11197 (FieldExprNoAddress): New expression for Fields whose address can
11200 * expression.cs (LocalVariableReference): During the resolve
11201 phases, create new expressions if we are in a remapping context.
11202 Remove code that dealt with remapping here.
11204 (ParameterReference): same.
11206 (ProxyInstance): New expression, like the `This' expression, but
11207 it is born fully resolved. We know what we are doing, so remove
11208 the errors that are targeted to user-provided uses of `this'.
11210 * statement.cs (Foreach): our variable is now stored as an
11211 Expression; During resolution, follow the protocol, dont just
11212 assume it will return this.
11214 2003-08-06 Martin Baulig <martin@ximian.com>
11216 * support.cs (SeekableStreamReader.cs): New public class.
11218 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11219 SeekableStreamReader instead of the normal StreamReader.
11221 2003-08-04 Martin Baulig <martin@ximian.com>
11223 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11224 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11225 deambiguate casts and delegate invocations.
11226 (parenthesized_expression): Use the new tokens to ensure this is
11227 not a cast of method invocation.
11229 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11230 when reading a `)' and Deambiguate_CloseParens () was previously
11233 * expression.cs (ParenthesizedExpression): New class. This is
11234 just used for the CS0075 test.
11235 (Binary.DoResolve): Check for CS0075.
11237 2003-07-29 Ravi Pratap <ravi@ximian.com>
11239 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11240 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11241 reference comparison.
11243 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11244 examine the ReturnType for equality - this is necessary in the
11245 cases of implicit and explicit operators whose signature also
11246 includes the return type.
11248 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11250 * namespace.cs: Cache the result of the namespace computation,
11251 instead of computing it every time.
11253 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11255 * decl.cs: Use a global arraylist that we reuse over invocations
11256 to avoid excesive memory consumption. Reduces memory usage on an
11257 mcs compile by one meg (45 average).
11259 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11260 private, work around that.
11262 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11264 * literal.cs (IntLiteral): Define Zero and One static literals.
11266 * cs-parser.jay (integer_literal): use static literals to reduce
11267 memory usage for the most used literals (0, 1 and -1). 211kb
11268 reduced in memory usage.
11270 Replace all calls to `new ArrayList' with `new
11271 ArrayList(4)' which is a good average number for most allocations,
11272 and also requires only 16 bytes of memory for its buffer by
11275 This reduced MCS memory usage in seven megabytes for the RSS after
11278 2003-07-28 Ravi Pratap <ravi@ximian.com>
11280 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11281 handle params methods the correct way by forming only one
11282 applicable set with params and normal methods in them. Earlier we
11283 were looking at params methods only if we found no normal methods
11284 which was not the correct thing to do.
11286 (Invocation.BetterFunction): Take separate arguments indicating
11287 when candidate and the best method are params methods in their
11290 This fixes bugs #43367 and #46199.
11292 * attribute.cs: Documentation updates.
11294 (CheckAttribute): Rename to CheckAttributeTarget.
11295 (GetValidPlaces): Rename to GetValidTargets.
11297 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11298 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11302 2003-07-28 Miguel de Icaza <miguel@ximian.com>
11304 * codegen.cs: Compute IsGeneric correctly.
11306 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
11309 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
11310 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
11311 regressions, and I was chasing more bugs than I required.
11313 * interface.cs: Use expressions for base type names (like classes
11314 and structs have been doing for a while now), and resolve that.
11315 This patch should probably go into head as well.
11317 This makes it one less user of FindType.
11319 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11321 This compiler can not self host currently. Need to fix that.
11323 * Makefile: compile to `gmcs.exe'
11325 * driver.cs: Turn on v2 by default on gmcs.
11327 * generic.cs (ConstructedType): Does no longer take a container
11328 type argument; That will be taken care of later.
11330 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
11331 Use SimpleName to resolve for now, so we can continue the work on
11332 the parser, until we get Type.GetType that understands generics.
11334 (ConstructedType.ToString): Implement
11336 (TypeArguments.Resolve): Resolve the child expressions as types.
11338 * cs-parser.jay: Rename interface_constraints to
11339 type_parameter_constraints
11341 (namespace_or_type_name): Only use constructed types for the basic
11342 construction, we will deal with identifier<...> later.
11344 (type/type_name): No longer call DecomposeQI, as
11345 namespace_or_type_name is always decoded now.
11347 2003-07-22 Ravi Pratap <ravi@ximian.com>
11349 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11350 closely: we eliminate methods in base types when we have an
11351 applicable method in a top-level type.
11353 Please see section 14.5.5.1 for an exact description of what goes
11356 This fixes bug #45127 and a host of other related to corlib compilation.
11358 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11359 array is the method corresponding to the top-level type (this is
11360 because of the changes made to icall.c) so we change this
11363 (MethodGroupExpr.Name): This too.
11365 * typemanager.cs (GetElementType): New method which does the right
11366 thing when compiling corlib.
11368 * everywhere: Make use of the above in the relevant places.
11370 2003-07-22 Martin Baulig <martin@ximian.com>
11372 * cs-parser.jay (invocation_expression): Moved
11373 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11374 `cast_expression', but create a InvocationOrCast which later
11375 resolves to either an Invocation or a Cast.
11377 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11378 method; call this before EmitStatement() to make sure that this
11379 expression can be used as a statement.
11381 * expression.cs (InvocationOrCast): New class; resolves to either
11382 an Invocation or a Cast.
11384 * statement.cs (StatementExpression): Call ResolveStatement() on
11385 the ExpressionStatement before emitting it.
11387 2003-07-21 Martin Baulig <martin@ximian.com>
11389 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11390 `ref' and `out' attributes match; fixes #46220.
11391 (MemberAccess.ResolveMemberAccess): You can't reference a type
11392 through an expression; fixes #33180.
11393 (Indexers.GetIndexersForType): Don't return the indexers from
11394 interfaces the class implements; fixes #46502.
11396 2003-07-21 Martin Baulig <martin@ximian.com>
11398 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11399 CS0661 checks; fixes bug #30442.
11401 2003-07-21 Martin Baulig <martin@ximian.com>
11403 * decl.cs (AdditionResult): Added `Error'.
11405 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11407 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
11408 cs0031.cs actually work.
11410 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11412 * cs-parser.jay (namespace_name): do not use
11413 namespace_or_type_name, use qualified_identifier, because
11414 namespace_or_type_name will soon return a composed expression
11415 instead of a string.
11417 (namespace_or_type_name): Instead of returning a string, now this
11418 production returns an expression.
11420 * codegen.cs (EmitContext): Setup IsGeneric property based on
11421 whether our DeclSpace is generic, our the method is generic.
11423 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
11424 the method is generic.
11426 * cs-parser.jay (type_arguments, opt_type_argument_list,
11427 type_parameters, type_parameter_list, opt_type_parameter_list,
11428 type_parameter,, opt_type_parameter_constraints_clauses,
11429 type_parameter_constraints_clauses,
11430 type_parameter_constraint_clause, type_parameter_constraint,
11431 interface_constraints): Add new production
11433 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
11434 DeclSpace is generic or not.
11436 (DeclSpace.SetParameterInfo): New routine, used to set the
11437 parameter info for a type.
11439 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
11440 returns a GenericTypeExpr
11442 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
11443 generic, lookup the generic argument.
11445 * attribute.cs: Do not allow TypeParameterExpressions in
11448 * class.cs: Do not allow the Main method to be defined in a
11451 * expression.cs (SizeOf): Do not allow generic types to be used as
11452 arguments to sizeof.
11454 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
11455 it: whether a type is generic or not. Only works for types we are
11456 currently building for now.
11458 2003-07-20 Martin Baulig <martin@ximian.com>
11460 * namespace.cs: Fixed that bug which caused a crash when compiling
11461 the debugger's GUI.
11463 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11465 * typemanager.cs (LookupTypeReflection): Never expose types which
11466 are NotPublic, NestedPrivate, NestedAssembly, or
11467 NestedFamANDAssem. We used to return these, and later do a check
11468 that would report a meaningful error, but the problem is that we
11469 would not get the real match, if there was a name override.
11471 2003-07-18 Miguel de Icaza <miguel@ximian.com>
11473 * namespace.cs (Namespace, Name): Do not compute the namespace
11474 name dynamically, compute it in the constructor. This reduced
11475 memory usage by 1697 KB.
11477 * driver.cs: Use --pause to pause at the end.
11479 2003-07-17 Peter Williams <peter@newton.cx>
11481 * Makefile: Change the name of the test target so that it doesn't
11482 conflict with the recursive test target.
11484 2003-07-17 Miguel de Icaza <miguel@ximian.com>
11486 * expression.cs (LocalVariableReference.Emit, EmitAssign,
11487 AddressOf): Do not use EmitThis, that was wrong, use the actual
11490 2003-07-15 Miguel de Icaza <miguel@ximian.com>
11492 * class.cs (MethodData.Define): While checking if a method is an
11493 interface implementation, improve the test: If we are not public
11494 (use new test here: use the computed MethodAttributes directly,
11495 instead of the parsed modifier flags) check if the `implementing'
11496 method comes from an interface or not.
11498 * pending.cs (VerifyPendingMethods): Slightly better error
11501 * makefile: add test target that does the mcs bootstrap.
11503 2003-07-16 Ravi Pratap <ravi@ximian.com>
11505 * interface.cs (Define): Do nothing here since there are no
11506 members to populate etc. Move the attribute emission out of here
11507 since this was just totally the wrong place to put it. Attribute
11508 application happens during the 'Emit' phase, not in the 'Define'
11511 (Emit): Add this method and move the attribute emission here
11513 * rootcontext.cs (EmitCode): Call the Emit method on interface
11516 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11518 * expression.cs (OverloadResolve): Report error only if Location
11519 is not 'Null' which means that there was a probe going on.
11521 2003-07-14 Martin Baulig <martin@ximian.com>
11523 * expression.cs (ConditionalLogicalOperator): New public class to
11524 implement user defined conditional logical operators.
11525 This is section 14.11.2 in the spec and bug #40505.
11527 2003-07-14 Martin Baulig <martin@ximian.com>
11529 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11531 2003-07-14 Martin Baulig <martin@ximian.com>
11533 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11535 * ecore.cs (IVariable.VerifyFixed): New interface method.
11537 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11538 operator, check whether the variable is actually fixed. Fixes bug
11539 #36055. Set a variable definitely assigned when taking its
11540 address as required by the spec.
11542 * statement.cs (LocalInfo.IsFixed): New field.
11543 (LocalInfo.MakePinned): Set `IsFixed' to true.
11545 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11547 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11548 for .ctors, ensure that we only ask for members declared in the
11549 attribute type (BindingFlags.DeclaredOnly).
11553 * expression.cs (Error_WrongNumArguments): Report error 1501
11554 correctly the way CSC does.
11556 2003-07-13 Martin Baulig <martin@ximian.com>
11558 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11559 lookup on the fully qualified name, to make things like "X.X" work
11560 where "X.X" is a fully qualified type name, but we also have a
11561 namespace "X" in the using list. Fixes #41975.
11563 2003-07-13 Martin Baulig <martin@ximian.com>
11565 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11566 function. If we're a CompoundAssign, we need to create an embedded
11567 CompoundAssign, not an embedded Assign.
11568 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11571 2003-07-13 Martin Baulig <martin@ximian.com>
11573 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11574 work to fix bug #46088.
11576 2003-07-13 Ravi Pratap <ravi@ximian.com>
11578 * class.cs (Operator.Emit): Do not emit attributes here - it is
11579 taken care of by the Method class that we delegate too. This takes
11580 care of bug #45876.
11582 2003-07-10 Martin Baulig <martin@ximian.com>
11584 * expression.cs (TypeOfVoid): New class.
11585 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
11587 2003-07-10 Martin Baulig <martin@ximian.com>
11589 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11592 2003-07-10 Martin Baulig <martin@ximian.com>
11594 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11595 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11597 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11599 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11601 2003-07-10 Martin Baulig <martin@ximian.com>
11603 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11604 of decimal. Fixes #42850.
11606 NOTE: I also fixed the created byte blob, but this doesn't work on
11607 the MS runtime and csc never produces any byte blobs for decimal
11610 2003-07-10 Martin Baulig <martin@ximian.com>
11612 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11613 structs; fixes #32068.
11614 (Block.AddChildVariableNames): Fixed #44302.
11616 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11618 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11620 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11622 * attribute.cs: And this test is onger needed.
11624 2003-07-08 Martin Baulig <martin@ximian.com>
11626 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11627 inaccessible types. Fixes #36313.
11629 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11631 * namespace.cs (NamespaceEntry): Create implicit entries for all
11632 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11633 implicit entries for N1.N2 and N1.
11635 2003-07-08 Martin Baulig <martin@ximian.com>
11637 Rewrote the handling of namespaces to fix a lot of the issues
11638 wrt. `using' aliases etc.
11640 * namespace.cs (Namespace): Splitted this class into a
11641 per-assembly `Namespace' and a per-file `NamespaceEntry'.
11643 * typemanager.cs (TypeManager.IsNamespace): Removed.
11644 (TypeManager.ComputeNamespaces): Only compute namespaces from
11645 loaded assemblies here, not the namespaces from the assembly we're
11646 currently compiling.
11648 2003-07-08 Martin Baulig <martin@ximian.com>
11650 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11652 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11654 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11657 I thought about the memory savings here, but LookupTypeReflection
11658 is used under already very constrained scenarios. Compiling
11659 corlib or mcs only exposes one hit, so it would not really reduce
11660 any memory consumption.
11662 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11664 * typemanager.cs: fixes bug #45889 by only adding public types from
11665 other assemblies to the list of known types.
11667 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11669 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11670 on the type we resolved.
11672 2003-07-05 Martin Baulig <martin@ximian.com>
11674 * pending.cs (PendingImplementation.ParentImplements): Don't
11675 create the proxy if the parent is abstract.
11677 * class.cs (TypeContainer.DefineIndexers): Process explicit
11678 interface implementations first. Fixes #37714.
11680 2003-07-04 Miguel de Icaza <miguel@ximian.com>
11682 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11683 defined recursively; but since we modify the input parameters
11684 (left is set to `this' temporarily), we reset this value if the
11685 left_is_explicit is false, which gives the original semantics to
11688 * literal.cs (NullPointer): new class used to represent a null
11689 literal in a pointer context.
11691 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11692 type is a pointer, use a NullPointer object instead of a
11693 NullLiteral. Closes 43687
11695 (ExplicitConversion): Convert pointer values using
11696 the conv opcode to the proper type.
11698 * ecore.cs (New): change ValueTypeVariable property into a method,
11699 that returns whether the valuetype is suitable for being used.
11701 * expression.cs (Binary.DoNumericPromotions): Only return if we
11702 the int constant was a valid uint, and we can return both left and
11703 right as uints. If not, we continue processing, to trigger the
11704 type conversion. This fixes 39018.
11706 * statement.cs (Block.EmitMeta): During constant resolution, set
11707 the CurrentBlock property on the emitcontext, so that we resolve
11708 constants propertly.
11710 2003-07-02 Martin Baulig <martin@ximian.com>
11712 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11713 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11715 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11716 than emitting it here.
11718 * statement.cs: Fixed some more flow analysis bugs.
11720 2003-07-02 Martin Baulig <martin@ximian.com>
11722 * class.cs (MethodData.Define): When implementing interface
11723 methods, set Final unless we're Virtual.
11725 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11726 check work for interface methods.
11728 2003-07-01 Martin Baulig <martin@ximian.com>
11730 * ecore.cs (EmitContext.This): Replaced this property with a
11731 GetThis() method which takes a Location argument. This ensures
11732 that we get the correct error location for a CS0188.
11734 2003-07-01 Miguel de Icaza <miguel@ximian.com>
11736 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11737 ImplicitStandardConversion.
11739 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11741 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
11743 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11746 2003-06-30 Miguel de Icaza <miguel@ximian.com>
11748 * class.cs (Constructor.Define): Turn off initlocals for unsafe
11751 (MethodData.Define): Turn off initlocals for unsafe methods.
11753 2003-06-29 Miguel de Icaza <miguel@ximian.com>
11755 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11756 complete; Fixes #37521.
11758 * delegate.cs: Use Modifiers.TypeAttr to compute the
11759 TypeAttributes, instead of rolling our own. This makes the flags
11760 correct for the delegates.
11762 2003-06-28 Miguel de Icaza <miguel@ximian.com>
11764 * class.cs (Constructor.Define): Set the private flag for static
11765 constructors as well.
11767 * cs-parser.jay (statement_expression): Set the return value to
11768 null, to avoid a crash when we catch an error.
11770 2003-06-24 Miguel de Icaza <miguel@ximian.com>
11772 * cs-parser.jay: Applied patch from Jackson that adds support for
11773 extern and unsafe modifiers to destructor declarations.
11775 * expression.cs: Report error 21 if the user is trying to index a
11778 * driver.cs: Add an error message, suggested by the bug report.
11780 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11781 if we do not have a ": this ()" constructor initializer. Fixes 45149
11783 2003-06-14 Miguel de Icaza <miguel@ximian.com>
11785 * namespace.cs: Add some information to reduce FAQs.
11787 2003-06-13 Miguel de Icaza <miguel@ximian.com>
11789 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11790 underlying enumeration types. Fixes #43915.
11792 * expression.cs: Treat ushort/short as legal values to be used in
11793 bitwise operations.
11795 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11797 * delegate.cs: transfer custom attributes for paramenters from
11798 the delegate declaration to Invoke and BeginInvoke.
11800 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11802 * attribute.cs: handle custom marshalers and emit marshal info
11805 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
11807 * makefile.gnu: Added anonymous.cs to the compiler sources.
11809 2003-05-28 Miguel de Icaza <miguel@ximian.com>
11811 * iterators.cs: Change the name of the proxy class to include two
11814 * cs-parser.jay: Update grammar to include anonymous methods.
11816 * anonymous.cs: new file.
11818 2003-05-27 Miguel de Icaza <miguel@ximian.com>
11820 * class.cs (Field.Define): Add missing test for pointers and
11823 2003-05-27 Ravi Pratap <ravi@ximian.com>
11825 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11826 we use the stobj opcode.
11828 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11829 since it wasn't the correct fix.
11831 It still is puzzling that we are required to use stobj for IntPtr
11832 which seems to be a ValueType.
11834 2003-05-26 Miguel de Icaza <miguel@ximian.com>
11836 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11837 during regular simple name resolution. Now, the trick is that
11838 instead of returning for processing the simplename, we do a
11839 TypeManager.LookupType (ie, a rooted lookup as opposed to a
11840 contextual lookup type). If a match is found, return that, if
11841 not, return for further composition.
11843 This fixes long-standing 30485.
11845 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11846 using the address to initialize an object, do an Stobj instead of
11847 using the regular Stelem.
11849 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11850 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11851 Because if we are a BaseIndexerAccess that value will be true.
11854 * statement.cs (GotoCase.Resolve): Return after reporting an
11855 error, do not attempt to continue.
11857 * expression.cs (PointerArithmetic.Emit): If our operand is a
11858 long, convert our constants to match the operand before
11859 multiplying. Convert to I type before adding. Fixes 43670.
11861 2003-05-14 Ravi Pratap <ravi@ximian.com>
11863 * enum.cs (ImplicitConversionExists) : Rename to
11864 ImplicitEnumConversionExists to remove ambiguity.
11866 * ecore.cs (NullCast): New type of cast expression class which
11867 basically is very similar to EmptyCast with the difference being
11868 it still is a constant since it is used only to cast a null to
11870 (eg. (string) null)
11872 * convert.cs (ImplicitReferenceConversion): When casting a null
11873 literal, we return a NullCast.
11875 * literal.cs (NullLiteralTyped): Remove - I don't see why this
11876 should be around anymore.
11878 The renaming (reported was slightly wrong). Corrections:
11880 ConvertImplicitStandard -> ImplicitConversionStandard
11881 ConvertExplicitStandard -> ExplicitConversionStandard
11883 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11884 before passing them in !
11886 * convert.cs (ImplicitConversionStandard): When comparing for
11887 equal expr and target types, ensure that expr is not a
11890 In general, we must not be checking (expr_type ==
11891 target_type) in the top level conversion methods
11892 (ImplicitConversion, ExplicitConversion etc). This checking is
11893 done in the methods that they delegate to.
11895 2003-05-20 Miguel de Icaza <miguel@ximian.com>
11897 * convert.cs: Move Error_CannotConvertType,
11898 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11899 ImplicitNumericConversion, ImplicitConversionExists,
11900 ImplicitUserConversionExists, StandardConversionExists,
11901 FindMostEncompassedType, FindMostSpecificSource,
11902 FindMostSpecificTarget, ImplicitUserConversion,
11903 ExplicitUserConversion, GetConversionOperators,
11904 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11905 TryImplicitIntConversion, Error_CannotConvertImplicit,
11906 ConvertImplicitRequired, ConvertNumericExplicit,
11907 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11908 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11911 Perform the following renames:
11913 StandardConversionExists -> ImplicitStandardConversionExists
11914 ConvertImplicit -> ImplicitConversion
11915 ConvertImplicitStandard -> ImplicitStandardConversion
11916 TryImplicitIntConversion -> ImplicitIntConversion
11917 ConvertImplicitRequired -> ImplicitConversionRequired
11918 ConvertNumericExplicit -> ExplicitNumericConversion
11919 ConvertReferenceExplicit -> ExplicitReferenceConversion
11920 ConvertExplicit -> ExplicitConversion
11921 ConvertExplicitStandard -> ExplicitStandardConversion
11923 2003-05-19 Martin Baulig <martin@ximian.com>
11925 * statement.cs (TypeInfo.StructInfo): Made this type protected.
11926 (TypeInfo): Added support for structs having structs as fields.
11928 * ecore.cs (FieldExpr): Implement IVariable.
11929 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11930 VariableInfo for the field.
11932 2003-05-18 Martin Baulig <martin@ximian.com>
11934 * expression.cs (This.DoResolve): Report a CS0027 if we're
11935 emitting a field initializer.
11937 2003-05-18 Martin Baulig <martin@ximian.com>
11939 * expression.cs (This.ResolveBase): New public function.
11940 (This.DoResolve): Check for CS0188.
11942 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11945 * ecore.cs (MethodGroupExpr.DoResolve): Set the
11946 `instance_expression' to null if we don't have any non-static
11949 2003-05-18 Martin Baulig <martin@ximian.com>
11951 Reworked the way how local variables and parameters are handled by
11952 the flow analysis code.
11954 * statement.cs (TypeInfo, VariableMap): New public classes.
11955 (VariableInfo): New public class. This is now responsible for
11956 checking whether a variable has been assigned. It is used for
11957 parameters and local variables.
11958 (Block.EmitMeta): Take the InternalParameters as argument; compute
11959 the layout of the flow vectors here.
11960 (Block.LocalMap, Block.ParameterMap): New public properties.
11961 (FlowBranching): The .ctor doesn't get the InternalParameters
11962 anymore since Block.EmitMeta() now computes the layout of the flow
11964 (MyStructInfo): This class is now known as `StructInfo' and nested
11965 in `TypeInfo'; we don't access this directly anymore.
11967 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11968 property and removed IsAssigned(), IsFieldAssigned(),
11969 SetAssigned() and SetFieldAssigned(); we now call them on the
11970 VariableInfo so we don't need to duplicate this code everywhere.
11972 * expression.cs (ParameterReference): Added `Block block' argument
11974 (LocalVariableReference, ParameterReference, This): The new
11975 VariableInfo class is now responsible for all the definite
11978 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11979 IsParameterAssigned, SetParameterAssigned): Removed.
11981 2003-05-18 Martin Baulig <martin@ximian.com>
11983 * typemanager.cs (InitCoreTypes): Try calling
11984 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11985 the 3-args-version. Corlib now also needs our `void_type'.
11986 (GetMethod): Added overloaded version which takes an optional
11987 `bool report_errors' to allow lookups of optional methods.
11989 2003-05-12 Martin Baulig <martin@ximian.com>
11991 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11992 only used for locals and not for parameters.
11994 2003-05-12 Miguel de Icaza <miguel@ximian.com>
11996 * support.cs (InternalParameters.ParameterType): Return the
11997 ExternalType of the parameter.
11999 * parameter.cs (Parameter.ExternalType): drop the two arguments,
12002 2003-05-11 Miguel de Icaza <miguel@ximian.com>
12004 * class.cs (MethodData.Define): Do not set the `newslot' on
12005 interface members, if they are also flagged as "override".
12007 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12008 better code for ++i and i++. This only works for static fields
12009 and local variables.
12011 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12012 want to pull the DeclSpace out of the builder_to_declspace instead
12013 of the TypeBuilder (like in TypeContainer.FindMembers).
12015 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12016 instead of LookupTypeContainer. Fixes the crash on .NET for
12017 looking up interface members.
12019 * const.cs: Create our own emit context during the Definition
12020 stage, so that constants are evaluated in the proper context, when
12021 a recursive definition happens.
12023 2003-05-11 Martin Baulig <martin@ximian.com>
12025 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
12026 new block for a switch section.
12027 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12028 the adding/lookup in the switch block. Fixes #39828.
12030 2003-05-09 Miguel de Icaza <miguel@ximian.com>
12032 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12033 functionality: I needed to convert the data after I had performed
12034 the add/sub operation into the operands type size.
12036 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12037 pass the type for the box operation, otherwise the resulting
12038 object would have been of type object.
12040 (BoxedCast): Add constructor to specify the type to box as.
12042 2003-05-07 Miguel de Icaza <miguel@ximian.com>
12044 * iterators.cs: I was reusing the `count' variable inadvertently,
12045 take steps to not allow this to happen.
12047 2003-05-06 Miguel de Icaza <miguel@ximian.com>
12049 * attribute.cs (Attribute.Resolve): Params attributes are encoded
12050 by creating an array at the point where the params starts and
12051 putting all those arguments there, then adjusting the size of the
12054 2003-05-05 Miguel de Icaza <miguel@ximian.com>
12056 * expression.cs (New.AddressOf): Implement interface
12057 IMemoryLocation. This is used when the `new' operator is used in
12058 the context of an invocation to a method on a value type.
12060 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12063 * namespace.cs: Also check the using aliases here.
12065 * driver.cs: Move the test for using validity after the types have
12066 been entered, so we do a single pass that also includes the using
12069 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12070 in the regular case. CreateSiblingForFinally is doing extra
12073 * attribute.cs (GetAttributeArgumentExpression): Store the result
12074 on an out value, and use the return value to indicate failure
12075 instead of using null (which is a valid return for Constant.GetValue).
12077 * statement.cs: Perform the analysis flow for the increment
12078 portion after the statement, because this will be the real flow of
12079 execution. Fixes #42385
12081 * codegen.cs (EmitContext.EmitArgument,
12082 EmitContext.EmitStoreArgument): New helper functions when the
12083 RemapToProxy flag is set.
12085 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12088 Add support for remapping parameters.
12090 * iterators.cs: Propagate parameter values; Store parameter
12091 values in the proxy classes.
12093 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12095 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12096 need a proxy reference; I do not know what I was thinking
12098 * cs-parser.jay (constructor_initializer): catch another error,
12099 and display nice message.
12101 (field_declaration): catch void field declaration
12102 to flag a better error.
12104 * class.cs (MemberBase.CheckBase): Report an error instead of a
12105 warning if a new protected member is declared in a struct.
12106 (Field.Define): catch the error of readonly/volatile.
12108 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12110 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12111 volatile variable is taken
12113 2003-05-02 Miguel de Icaza <miguel@ximian.com>
12115 * statement.cs (Fixed.Resolve): Report an error if we are not in
12118 2003-05-01 Miguel de Icaza <miguel@ximian.com>
12120 * typemanager.cs: reuse the code that handles type clashes for
12121 delegates and enumerations.
12123 * class.cs (Report28): Always report.
12125 * expression.cs (EncodeAsAttribute): Allow nulls here.
12127 2003-04-28 Miguel de Icaza <miguel@ximian.com>
12129 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12130 the functionality for testing whether an expression is valid for
12131 an attribute here. Also handle the case of arrays of elements
12134 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12135 encoding a linear array into an array of objects that are suitable
12136 to be passed to an CustomAttributeBuilder.
12138 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12140 * ecore.cs: (FieldExpr): Handle field remapping here.
12142 * iteratators.cs: Pass the instance variable (if the method is an
12143 instance method) to the constructors, so we can access the field
12144 variables on the class.
12146 TODO: Test this with structs. I think the THIS variable on
12147 structs might have to be a pointer, and not a refenrece
12149 2003-04-27 Miguel de Icaza <miguel@ximian.com>
12151 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12152 local variables to fields in a proxy class.
12154 * iterators.cs (PopulateProxy): Rename our internal fields to
12156 Create a <THIS> field if we are an instance method, so we can
12157 reference our parent container variables.
12158 (MapVariable): Called back from the EmitContext code to enter a
12159 new variable to field mapping into the proxy class (we just create
12163 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12164 for using the remapped locals to fields.
12166 I placed the code here, because that gives the same semantics to
12167 local variables, and only changes the Emit code.
12169 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12170 statements inside iterators.
12171 (VariableInfo): Add a FieldBuilder for the cases when we are
12172 remapping local variables to fields in a proxy class
12174 * ecore.cs (SimpleNameResolve): Avoid testing two times for
12175 current_block != null.
12177 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12178 not cope with strings, as it has been moved to the
12179 TableSwitchEmit. Fixed bug in switch generation.
12181 * expression.cs (New.DoResolve): Provide more context for the user
12182 when reporting an error.
12184 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12187 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12188 check the permissions for it. Note than in a type-resolution
12189 context the check was already present in DeclSpace.ResolveType,
12190 but was missing from the MemberAccess.
12192 (ArrayCreation.CheckIndices): warn if the user has
12193 more nested levels of expressions, but there are no more
12194 dimensions specified. Avoids crash on bug 41906.
12196 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12198 * statement.cs (Block): replace Implicit bool, for a generic
12200 New flag: `Unchecked'. This is used during the EmitMeta phase
12201 (which is out-of-line with the regular Resolve/Emit process for a
12202 statement, as this is done ahead of time, but still gets a chance
12203 to call constant resolve).
12205 (Block.Flags): new enum for adding a new flag.
12207 (Block.EmitMeta): track the state of unchecked.
12209 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12210 to enable constant resolution to work there as well.
12212 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12214 * typemanager.cs (ienumerable_type): Also look up
12215 System.Collections.IEnumerable.
12217 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12219 TODO: Test more than one conditional per method.
12221 * class.cs (Indexer.Define): Report the location where the user is
12222 referencing the unsupported feature.
12224 (MethodData): Overload the use of `conditionals' to
12225 minimize the creation of needless ArrayLists. This saves roughly
12226 212kb on my machine.
12228 (Method): Implement the new IIteratorContainer interface.
12229 (Method.SetYields): Implement the method by setting the ModFlags
12230 to contain METHOD_YIELDS.
12232 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12233 which just got set to null.
12235 * iterators.cs: New file.
12237 (Yield, YieldBreak): New statements.
12239 * statement.cs (Return.Resolve): Flag an error if we are used in
12240 an iterator method.
12242 * codegen.cs (InIterator): New flag set if the code is being
12243 compiled in an iterator method.
12245 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12246 internal modifier, and we just use it to avoid adding extra
12247 fields, as this is seldom used.
12249 * cs-parser.jay: Add yield_statement (yield and yield break).
12251 * driver.cs: New flag -v2 to turn on version 2 features.
12253 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12254 hashtable when v2 is enabled.
12256 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12258 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12259 there is already a namespace defined with this name.
12261 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12262 people upgraded their corlibs.
12264 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12265 always use fully qualified types, no need to use the compiler
12268 (TypeManager.IsNamespace): Use binarysearch.
12270 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12271 AddDelegate): I did not quite use the new IsValid API properly: I
12272 have to pass the short-name and the fullname. I was passing only
12273 the basename instead of the fullname sometimes.
12275 (TypeContainer.DefineType): call NamespaceClash.
12277 * interface.cs (Interface.DefineType): use NamespaceClash before
12280 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12283 * enum.cs: (Enum.DefineType): use NamespaceClash before
12286 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12287 speed increase. First, use the negative_hits cache when we get a
12288 negative. Second, add the type with its full original name
12289 instead of the new . and + encoded name (reflection uses + to
12290 separate type from a nested type). Use LookupTypeReflection
12291 directly which bypasses the type->name hashtable (that we already
12292 know does not contain the type.
12294 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12295 location/container type.
12297 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12299 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12301 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12303 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12304 method is being referenced in the method group from a static
12305 context, and report error 120 if so.
12307 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12310 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12311 is created, we create the A namespace).
12313 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12316 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12318 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12319 invocation to ModuleBuilder.GetType with the same values will
12320 return a new type instance, so we need to cache its return
12323 * expression.cs (Binary.ResolveOperator): Only allow the compare
12324 operators on enums if they are of the same type.
12326 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12327 types of ValueType on their own case. Before we were giving them
12328 the same treatment as objects.
12330 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12331 fullname. Short name is used to compare against container name.
12332 Fullname is used to check against defined namespace names.
12334 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12335 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12337 (Method.CheckBase): Call parent.
12338 (MemberBase.CheckBase): Check for protected members on sealed
12340 (PropertyBase.CheckBase): Call parent.
12341 (Field.Define): Call parent.
12343 * report.cs: Negative error codes are now mapped to 8000 - code,
12344 so that the display is render more nicely.
12346 * typemanager.cs: Do not use try/catch, instead report a regular
12349 (GetPointerType, GetReferenceType): These methods provide
12350 mechanisms to obtain the T* and T& from a T. We had the code
12351 previously scattered around the code base, and it also used
12352 TypeManager.LookupType that would go through plenty of caches.
12353 This one goes directly to the type source.
12355 In some places we did the Type.GetType followed by
12356 ModuleBuilder.GetType, but not in others, so this unifies the
12357 processing as well.
12359 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12360 statements now that we have namespace information.
12362 * typemanager.cs (IsNamespace): New method, returns whether the
12363 string presented is a namespace or not.
12365 (ComputeNamespaces): New public entry point, computes the list of
12366 available namespaces, using the GetNamespaces API call in Mono, or
12367 the slower version in MS.NET.
12369 Now before we start the semantic analysis phase, we have a
12370 complete list of namespaces including everything that the user has
12373 Deleted old code to cache namespaces in .nsc files.
12375 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12377 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12378 class/struct location definition Location for the implicit
12379 constructor location.
12381 (Operator.Define): Use the location of the operator for the
12382 implicit Method definition.
12384 (Constructor.Emit): use the constructor location for the implicit
12385 base initializer constructor.
12387 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12388 and the Expression class now contains two new methods:
12390 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12391 isolate type lookup from the rest of the resolution process.
12393 Since we use Expressions to hold type definitions due to the way
12394 we parse the input we have historically overloaded Resolve to
12395 perform the Type lookups if a special flag is passed. Now this is
12396 eliminated and two methods take their place.
12398 The differences in the two methods between xStep and xTerminal is
12399 that xStep is involved in our current lookup system that uses
12400 SimpleNames to compose a name, while xTerminal is used just to
12401 catch the case where the simplename lookup failed.
12403 2003-04-16 Miguel de Icaza <miguel@ximian.com>
12405 * expression.cs (ResolveMemberAccess): Remove redundant code.
12406 TypeExpr expressions are always born fully resolved.
12408 * interface.cs (PopulateMethod): Do not lookup the types twice.
12409 We were doing it once during SemanticAnalysis and once during
12412 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12413 in local variable type definitions, were being returned as a
12414 SimpleName (we decomposed everything into a string), that is
12415 because primary_expression was being used instead of a type in the
12416 grammar (reduce/reduce conflicts).
12418 The part that was wrong is that we converted the expression into a
12419 string (an oversimplification in one hand, compounded with primary
12420 expressions doing string concatenation).
12426 Would return "A.B.C[]" as a SimpleName. This stopped things like
12427 using clauses from working on this particular context. And a type
12428 was being matched directly against "A.B.C[]".
12430 We now use the correct approach, and allow for ComposedCast to be
12431 part of the unary expression. So the "A.B.C []" become a composed
12432 cast of "A.B.C" (as a nested group of MemberAccess with a
12433 SimpleName at the end) plus the rank composition "[]".
12437 2003-04-10 Miguel de Icaza <miguel@ximian.com>
12439 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12440 for the access level checking.
12442 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
12443 `TypeContainer container', because I kept getting confused when I
12444 was debugging this code.
12446 * expression.cs (Indexers): Instead of tracking getters/setters,
12447 we now track them in parallel. We create one arraylist less, but
12448 most importantly it is possible now for the LValue code to find a
12449 matching get for a set.
12451 (IndexerAccess.DoResolveLValue): Update the code.
12452 GetIndexersForType has been modified already to extract all the
12453 indexers from a type. The code assumed it did not.
12455 Also make the code set the correct return type for the indexer.
12456 This was fixed a long time ago for properties, but was missing for
12457 indexers. It used to be void_type.
12459 (Binary.Emit): Test first for doubles instead of
12460 floats, as they are more common.
12462 (Binary.EmitBranchable): Use the .un version of the branch opcodes
12463 when dealing with floats and the <=, >= operators. This fixes bug
12466 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12467 to load the array value by emitting a load on the foreach variable
12468 type. This was incorrect.
12470 We now emit the code to load an element using the the array
12471 variable type, and then we emit the conversion operator.
12475 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
12477 * attribute.cs: Avoid allocation of ArrayLists in the common case.
12479 2003-04-09 Miguel de Icaza <miguel@ximian.com>
12481 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12482 test for protection before we test for signatures.
12484 (MethodSignature.ToString): implement.
12486 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12487 to the case where we reduced into a LongConstant.
12489 * decl.cs (CheckAccessLevel): If the type is an array, we can not
12490 depend on whether the information is acurrate, because the
12491 Microsoft runtime will always claim that the array type is public,
12492 regardless of the real state.
12494 If the type is a pointer, another problem happens: the type is
12495 reported as non-public in Microsoft.
12497 In both cases we have to call CheckAccessLevel recursively with
12498 the underlying type as the argument to be tested.
12500 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12502 * assign.cs (Assign.Emit): If we are dealing with a compound
12503 assignment expression, we should use the code path that stores the
12504 intermediate result in a temporary value. This fixes #40903.
12506 *expression.cs (Indirection.ToString): Provide ToString method for
12509 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12511 * class.cs: Null out fields holding references to Block objects so
12512 they can be garbage collected.
12514 * expression.cs (OverloadResolve): Remove unused local.
12516 2003-04-07 Martin Baulig <martin@ximian.com>
12518 * codegen.cs (EmitContext.CurrentFile): New public field.
12519 (EmitContext.Mark): Use the CurrentFile to check whether the
12520 location is in the correct file.
12521 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12523 2003-04-07 Martin Baulig <martin@ximian.com>
12525 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12527 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12528 location. [FIXME: The location argument which gets passed to this
12529 method is sometimes wrong!]
12531 2003-04-07 Nick Drochak <ndrochak@gol.com>
12533 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12535 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12537 * expression.cs (Indirection.EmitAssign): We were using the
12538 temporary, but returning immediately instead of continuing the
12541 2003-04-06 Martin Baulig <martin@ximian.com>
12543 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12544 if it's a nested child, but also deriving from the outer class.
12547 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12548 nested child, but also deriving from the outer class. See
12550 (FilterWithClosure): We may access private members of the outer
12551 class if we're a nested child and deriving from the outer class.
12552 (RealMemberLookup): Only set `closure_private_ok' if the
12553 `original_bf' contained BindingFlags.NonPublic.
12555 2003-04-05 Martin Baulig <martin@ximian.com>
12557 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
12558 probe if its a type parameter, and if so, flag an error.
12560 * decl.cs: Move here the SetParameterInfo code from class.cs.
12561 Handle IsGeneric here.
12563 Handle a variety of errors in the parameter info definition.
12565 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
12566 type parameters here.
12568 * cs-parser.jay (class_declaration): report errors for parameters
12571 2003-01-21 Miguel de Icaza <miguel@ximian.com>
12573 * generic.cs: New file, contains support code for generics.
12575 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
12576 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
12578 Update parser for the above removals.
12580 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
12581 now taken care of in the parser.
12583 2003-04-02 Miguel de Icaza <miguel@ximian.com>
12585 * class.cs (Event.Define): Do not allow abstract events to have
12588 2003-04-01 Miguel de Icaza <miguel@ximian.com>
12590 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12591 block in event declarations.
12593 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12594 value type, get its address.
12596 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12597 leaving a class on the stack instead of a boolean value (int
12598 0/1). Change the code so we compare against null, and then the
12599 result against zero.
12601 * class.cs (TypeContainer.GetClassBases): We were checking for the
12602 parent class being sealed too late.
12604 * expression.cs (Binary.Emit): For <= and >= when dealing with
12605 floating point values, use cgt.un and clt.un instead of cgt and
12608 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
12610 * statement.cs: Apply the same optimization as MS: skip the
12611 GetEnumerator returning an IEnumerator, and use the one returning a
12612 CharEnumerator instead. This allows us to avoid the try-finally block
12615 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
12617 * cs-parser.jay: Attributes cannot be applied to
12618 namespaces. Fixes #40473
12620 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12623 (Add*): check if the name is valid using the full name for constants,
12624 fields, properties and events.
12626 2003-03-28 Miguel de Icaza <miguel@ximian.com>
12628 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12629 char constants to be part of the enumeration.
12631 * expression.cs (Conditional.DoResolve): Add support for operator
12632 true. Implements the missing functionality from 14.12
12634 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12635 operator true/false as required by the spec.
12637 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12638 implicit conversion to boolean.
12640 * statement.cs (Statement.ResolveBoolean): A boolean expression is
12641 also one where the type implements `operator true'.
12643 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12644 get an expression that will invoke operator true based on an
12647 (GetConversionOperators): Removed the hack that called op_True
12650 (Expression.ResolveBoolean): Move this from Statement.
12652 2003-03-17 Miguel de Icaza <miguel@ximian.com>
12654 * ecore.cs (FieldExpr): do not allow initialization of initonly
12655 fields on derived classes
12657 2003-03-13 Martin Baulig <martin@ximian.com>
12659 * statement.cs (Block.Emit): Call ig.BeginScope() and
12660 ig.EndScope() when compiling with debugging info; call
12661 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12663 2003-03-08 Miguel de Icaza <miguel@ximian.com>
12665 * expression.cs (Indexers): Do not construct immediately, allow
12666 for new members to be appended as we go. Fixes 38143
12668 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12670 * expression.cs: save/restore context when resolving an unchecked
12673 2003-03-05 Miguel de Icaza <miguel@ximian.com>
12675 * cfold.cs: Catch division by zero in modulus operator during
12678 2003-03-03 Miguel de Icaza <miguel@ximian.com>
12680 * interface.cs (Interface.DefineMembers): Avoid defining members
12683 2003-02-27 Miguel de Icaza <miguel@ximian.com>
12685 * driver.cs: handle the +/- options for -noconfig
12687 * statement.cs (Unckeched.Resolve): Also track the state of
12688 unchecked in the Resolve phase.
12690 2003-02-27 Martin Baulig <martin@ximian.com>
12692 * ecore.cs (Expression.MemberLookup): Don't create a
12693 MethodGroupExpr for something which is not a method. Fixes #38291.
12695 2003-02-25 Miguel de Icaza <miguel@ximian.com>
12697 * class.cs (MemberBase.CheckParameters): Also check that the type
12698 is unmanaged if it is a pointer.
12700 * expression.cs (SizeOf.Resolve): Add location information.
12702 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12703 a managed type is declared.
12705 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12706 parameter modifiers as well. Fixes bug 38606
12708 * class.cs: Very sad. Am backing out the speed up changes
12709 introduced by the ArrayList -> Array in the TypeContainer, as they
12710 were not actually that much faster, and introduced a bug (no error
12711 reports on duplicated methods).
12713 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12714 source first, this will guarantee that we have a valid expression
12715 before calling in lower levels functions that will require a
12716 resolved object. Then use this original_source in the
12717 target.ResolveLValue instead of the original source that was
12720 Another change. Use target.Resolve instead of LValueResolve.
12721 Although we are resolving for LValues, we will let the Assign code
12722 take care of that (it will be called again from Resolve). This
12723 basically allows code like this:
12725 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12726 class Y { void A (X x) { x [0] += o; }
12728 The problem was that the indexer was trying to resolve for
12729 set_Item (idx, object o) and never finding one. The real set_Item
12730 was set_Item (idx, X). By delaying the process we get the right
12735 2003-02-23 Martin Baulig <martin@ximian.com>
12737 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12738 while calling DoEmit ().
12740 * codegen.cs (EmitContext.Mark): Don't mark locations in other
12741 source files; if you use the #line directive inside a method, the
12742 compiler stops emitting line numbers for the debugger until it
12743 reaches the end of the method or another #line directive which
12744 restores the original file.
12746 2003-02-23 Martin Baulig <martin@ximian.com>
12748 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12750 2003-02-23 Martin Baulig <martin@ximian.com>
12752 * statement.cs (Block.AddChildVariableNames): We need to call this
12753 recursively, not just for our immediate children.
12755 2003-02-23 Martin Baulig <martin@ximian.com>
12757 * class.cs (Event.Define): Always make the field private, like csc does.
12759 * typemanager.cs (TypeManager.RealMemberLookup): Make events
12760 actually work, fixes bug #37521.
12762 2003-02-23 Miguel de Icaza <miguel@ximian.com>
12764 * delegate.cs: When creating the various temporary "Parameters"
12765 classes, make sure that we call the ComputeAndDefineParameterTypes
12766 on those new parameters (just like we do with the formal ones), to
12767 allow them to be resolved in the context of the DeclSpace.
12769 This fixes the bug that Dick observed in Bugzilla #38530.
12771 2003-02-22 Miguel de Icaza <miguel@ximian.com>
12773 * expression.cs (ResolveMemberAccess): When resolving a constant,
12774 do not attempt to pull a constant if the value was not able to
12775 generate a valid constant.
12777 * const.cs (LookupConstantValue): Do not report more errors than required.
12779 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12781 * expression.cs: fixes bug #38328.
12783 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12785 * class.cs: Changed all the various members that can be part of a
12786 class from being an ArrayList to be an Array of the right type.
12787 During the DefineType type_list, interface_list, delegate_list and
12788 enum_list are turned into types, interfaces, delegates and enums
12791 And during the member population, indexer_list, event_list,
12792 constant_list, field_list, instance_constructor_list, method_list,
12793 operator_list and property_list are turned into their real arrays.
12795 Although we could probably perform this operation earlier, for
12796 good error reporting we need to keep the lists and remove the
12797 lists for longer than required.
12799 This optimization was triggered by Paolo profiling the compiler
12800 speed on the output of `gen-sample-program.pl' perl script.
12802 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12803 not crash in methods like MemberLookupFailed that use this field.
12805 This problem arises when the compiler fails to resolve a type
12806 during interface type definition for example.
12808 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12810 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12811 inherit from System.Object, so we have to stop at null, not only
12812 when reaching System.Object.
12814 2003-02-17 Miguel de Icaza <miguel@ximian.com>
12816 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12817 DeclaredOnly because the parent indexer might have had a different
12818 name, but did not loop until the top of the hierarchy was reached.
12820 The problem this one fixes is 35492: when a class implemented an
12821 indexer from an interface, we were getting the interface method
12822 (which was abstract) and we were flagging an error (can not invoke
12825 This also keeps bug 33089 functioning, and test-148 functioning.
12827 * typemanager.cs (IsSpecialMethod): The correct way of figuring
12828 out if a method is special is to see if it is declared in a
12829 property or event, or whether it is one of the predefined operator
12830 names. This should fix correctly #36804.
12832 2003-02-15 Miguel de Icaza <miguel@ximian.com>
12834 The goal here is to remove the dependency on EmptyCast.Peel ().
12835 Killing it completely.
12837 The problem is that currently in a number of places where
12838 constants are expected, we have to "probe" for an EmptyCast, and
12839 Peel, which is not the correct thing to do, as this will be
12840 repetitive and will likely lead to errors.
12842 The idea is to remove any EmptyCasts that are used in casts that
12843 can be reduced to constants, so we only have to cope with
12846 This bug hunt was triggered by Bug 37363 and the desire to remove
12847 the duplicate pattern where we were "peeling" emptycasts to check
12848 whether they were constants. Now constants will always be
12851 * ecore.cs: Use an enumconstant here instead of wrapping with
12854 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12855 throwing me off. By handling this we can get rid of a few hacks.
12857 * statement.cs (Switch): Removed Peel() code.
12859 2003-02-14 Miguel de Icaza <miguel@ximian.com>
12861 * class.cs: Location information for error 508
12863 * expression.cs (New.DoResolve): Add a guard against double
12864 resolution of an expression.
12866 The New DoResolve might be called twice when initializing field
12867 expressions (see EmitFieldInitializers, the call to
12868 GetInitializerExpression will perform a resolve on the expression,
12869 and later the assign will trigger another resolution
12871 This leads to bugs (#37014)
12873 * delegate.cs: The signature for EndInvoke should contain any ref
12874 or out parameters as well. We were not doing this in the past.
12876 * class.cs (Field.Define): Do not overwrite the type definition
12877 inside the `volatile' group. Turns out that volatile enumerations
12878 were changing the type here to perform a validity test, which
12881 2003-02-12 Miguel de Icaza <miguel@ximian.com>
12883 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12884 and structs, we do not want to load the instance variable
12886 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12887 enum_type has to be handled like an object reference (implicit
12888 conversions exists from this to object), but the regular IsClass
12889 and IsValueType tests will never return true for this one.
12891 Also we use TypeManager.IsValueType instead of type.IsValueType,
12892 just for consistency with the rest of the code (this is only
12893 needed if we ever use the construct exposed by test-180.cs inside
12894 corlib, which we dont today).
12896 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
12898 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12901 2003-02-09 Martin Baulig <martin@ximian.com>
12903 * namespace.cs (Namespace..ctor): Added SourceFile argument.
12904 (Namespace.DefineNamespaces): New static public method; this is
12905 called when we're compiling with debugging to add all namespaces
12906 to the symbol file.
12908 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12909 pass it to the Namespace's .ctor.
12911 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12912 and MethodBase arguments; pass the namespace ID to the symwriter;
12913 pass the MethodBase instead of the token to the symwriter.
12914 (SymbolWriter.DefineNamespace): New method to add a namespace to
12917 2003-02-09 Martin Baulig <martin@ximian.com>
12919 * symbolwriter.cs: New file. This is a wrapper around
12920 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
12921 methods here in near future.
12923 2003-02-09 Martin Baulig <martin@ximian.com>
12925 * codegen.cs (EmitContext.Mark): Just pass the arguments to
12926 ILGenerator.MarkSequencePoint() which are actually used by the
12929 2003-02-09 Martin Baulig <martin@ximian.com>
12931 * location.cs (SourceFile): New public sealed class. This
12932 contains the name and an index which is used in the location's token.
12933 (Location): Reserve an appropriate number of bits in the token for
12934 the source file instead of walking over that list, this gives us a
12935 really huge performance improvement when compiling with debugging.
12937 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12938 `SourceFile' argument instead of a string.
12939 (Driver.ProcessFile): Add all the files via Location.AddFile(),
12940 but don't parse/tokenize here, we need to generate the list of all
12941 source files before we do that.
12942 (Driver.ProcessFiles): New static function. Parses/tokenizes all
12945 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12946 instead of a string.
12948 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12951 2003-02-09 Martin Baulig <martin@ximian.com>
12953 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12954 filename on `#line default'.
12956 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12958 * statement.cs: don't clear the pinned var when the fixed statement
12959 returns from the method (fixes bug#37752).
12961 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12963 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
12966 2003-02-07 Martin Baulig <martin@ximian.com>
12968 * driver.cs: Removed the `--debug-args' command line argument.
12970 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12971 automatically by the AsssemblyBuilder.
12972 (CodeGen.InitializeSymbolWriter): We don't need to call any
12973 initialization function on the symbol writer anymore. This method
12974 doesn't take any arguments.
12976 2003-02-03 Miguel de Icaza <miguel@ximian.com>
12978 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12979 from referenced assemblies as well.
12981 2003-02-02 Martin Baulig <martin@ximian.com>
12983 * class.cs (MethodData.Emit): Generate debugging info for external methods.
12985 2003-02-02 Martin Baulig <martin@ximian.com>
12987 * class.cs (Constructor.Emit): Open the symbol writer before
12988 emitting the constructor initializer.
12989 (ConstructorInitializer.Emit): Call ec.Mark() to allow
12990 single-stepping through constructor initializers.
12992 2003-01-30 Miguel de Icaza <miguel@ximian.com>
12994 * class.cs: Handle error 549: do not allow virtual methods in
12997 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12999 * decl.cs: Check access levels when resolving types
13001 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13003 * statement.cs: Add parameters and locals set in catch blocks that might
13004 return to set vector
13006 2003-01-29 Miguel de Icaza <miguel@ximian.com>
13008 * class.cs (Operator): Set the SpecialName flags for operators.
13010 * expression.cs (Invocation.DoResolve): Only block calls to
13011 accessors and operators on SpecialName methods.
13013 (Cast.TryReduce): Handle conversions from char constants.
13016 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13018 * statement.cs: small memory and time optimization in FlowBranching.
13020 2003-01-28 Pedro Mart <yoros@wanadoo.es>
13022 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13023 problem that the last fix but in the other sid (Set).
13025 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13026 access when there is no indexer in the hierarchy.
13028 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13030 * class.cs: Combine some if statements.
13032 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13034 * driver.cs: fixed bug #37187.
13036 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
13038 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13039 any indexer, it's needed to build a list with all the indexers in the
13040 hierarchy (AllGetters), else we have problems. Fixes #35653.
13042 2003-01-23 Miguel de Icaza <miguel@ximian.com>
13044 * class.cs (MethodData.Define): It is wrong for an interface
13045 implementation to be static in both cases: explicit and implicit.
13046 We were only handling this in one case.
13048 Improve the if situation there to not have negations.
13050 * class.cs (Field.Define): Turns out that we do not need to check
13051 the unsafe bit on field definition, only on usage. Remove the test.
13053 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13055 * driver.cs: use assembly.Location instead of Codebase (the latest
13056 patch made mcs fail when using MS assemblies).
13058 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
13060 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13061 get the path to *corlib.dll.
13063 2003-01-21 Nick Drochak <ndrochak@gol.com>
13067 * typemanager.cs: Remove compiler warnings
13069 2003-01-20 Duncan Mak <duncan@ximian.com>
13071 * AssemblyInfo.cs: Bump the version number to 0.19.
13073 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13075 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13077 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
13079 * class.cs (Constructor::Emit): Emit debugging info for constructors.
13081 2003-01-17 Miguel de Icaza <miguel@ximian.com>
13083 * cs-parser.jay: Small fix: we were not comparing the constructor
13084 name correctly. Thanks to Zoltan for the initial pointer.
13086 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13088 * cs-tokenizer.cs: Set file name when specified with #line
13090 2003-01-15 Miguel de Icaza <miguel@ximian.com>
13092 * cs-parser.jay: Only perform the constructor checks here if we
13093 are named like the class; This will help provider a better
13094 error. The constructor path is taken when a type definition is
13095 not found, but most likely the user forgot to add the type, so
13096 report that rather than the constructor error.
13098 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13100 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13103 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13105 * cs-parser.jay: Add cleanup call.
13107 2003-01-13 Duncan Mak <duncan@ximian.com>
13109 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13110 consistent with other methods.
13112 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13114 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13116 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13118 * attribute.cs: only set GuidAttr to true when we have a
13121 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13125 * typemanager.cs: fixes to allow mcs compile corlib with the new
13126 Type.IsSubclassOf fix.
13128 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13130 * expression.cs (LocalVariableReference.DoResolve): Classify a
13131 constant as a value, not as a variable. Also, set the type for
13134 * cs-parser.jay (fixed_statement): take a type instead of a
13135 pointer_type, so we can produce a better error message later.
13137 * statement.cs (Fixed.Resolve): Flag types that are not pointers
13140 (For.DoEmit): Make inifinite loops have a
13141 non-conditional branch back.
13143 (Fixed.DoEmit): First populate the pinned variables, then emit the
13144 statement, then clear the variables. Before I was emitting the
13145 code once for each fixed piece.
13148 2003-01-08 Martin Baulig <martin@ximian.com>
13150 * statement.cs (FlowBranching.MergeChild): A break in a
13151 SWITCH_SECTION does not leave a loop. Fixes #36155.
13153 2003-01-08 Martin Baulig <martin@ximian.com>
13155 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13156 lives in the same number space than `param_map'. Fixes #36154.
13158 2003-01-07 Miguel de Icaza <miguel@ximian.com>
13160 * cs-parser.jay (constructor_declaration): Set the
13161 Constructor.ModFlags before probing for it. This makes the
13162 compiler report 514, 515 and 132 (the code was there, but got
13165 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13166 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13167 (GotoCase.Resolve): Set `Returns' to ALWAYS.
13169 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13171 * enum.cs: create the enum static fields using the enum type.
13173 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13175 * class.cs: don't try to create the ParamBuilder for the return
13176 type if it's not needed (and handle it breaking for the ms runtime
13179 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13181 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13183 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13185 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13186 the command. This showed up while compiling the JANET source
13187 code, which used \r as its only newline separator.
13189 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13191 * class.cs (Method.Define): If we are an operator (because it
13192 reuses our code), then set the SpecialName and HideBySig. #36128
13194 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13196 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13197 exception, report error 120 `object reference required'.
13199 * driver.cs: Add --pause option, used during to measure the size
13200 of the process as it goes with --timestamp.
13202 * expression.cs (Invocation.DoResolve): Do not allow methods with
13203 SpecialName to be invoked.
13205 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13207 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13208 number before adding it.
13210 2002-12-21 Ravi Pratap <ravi@ximian.com>
13212 * ecore.cs (StandardImplicitConversion): When in an unsafe
13213 context, we allow conversion between void * to any other pointer
13214 type. This fixes bug #35973.
13216 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13218 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13219 is not thrown when extensionless outputs are used
13221 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13223 * rootcontext.cs: fixed compilation of corlib.
13225 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13227 * attribute.cs (Attributes.Contains): Add new method.
13229 * class.cs (MethodCore.LabelParameters): if the parameter is an
13230 `out' parameter, check that no attribute `[In]' has been passed.
13232 * enum.cs: Handle the `value__' name in an enumeration.
13234 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13236 * decl.cs: Added special case to allow overrides on "protected
13239 2002-12-18 Ravi Pratap <ravi@ximian.com>
13241 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13242 since it makes much more sense.
13244 (Attributes.ctor): Don't require a Location parameter.
13246 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13248 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13249 since we already have that information per attribute.
13251 * everywhere : make appropriate changes.
13253 * class.cs (LabelParameters): Write the code which actually
13254 applies attributes to the return type. We can't do this on the MS
13255 .NET runtime so we flag a warning in the case an exception is
13258 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13260 * const.cs: Handle implicit null conversions here too.
13262 2002-12-17 Ravi Pratap <ravi@ximian.com>
13264 * class.cs (MethodCore.LabelParameters): Remove the extra
13265 Type [] parameter since it is completely unnecessary. Instead
13266 pass in the method's attributes so that we can extract
13267 the "return" attribute.
13269 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13271 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13272 of ignoring it and letting the compile continue.
13274 * typemanager.cs (ChangeType): use an extra argument to return an
13275 error condition instead of throwing an exception.
13277 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13279 * expression.cs (Unary.TryReduce): mimic the code for the regular
13280 code path. Perform an implicit cast in the cases where we can
13281 implicitly convert to one of the integral types, and then reduce
13282 based on that constant. This fixes bug #35483.
13284 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13286 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13288 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13290 * namespace.cs: fixed bug #35489.
13292 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13294 * class.cs: Remove some dead code.
13296 * cs-parser.jay: Estimate the number of methods needed
13297 (RootContext.MethodCount);
13299 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13300 numbers instead of StringBuilders.
13302 * support.cs (PtrHashtable): Add constructor with initial size;
13303 We can now reduce reallocations of the method table.
13305 2002-12-10 Ravi Pratap <ravi@ximian.com>
13307 * attribute.cs (ApplyAttributes): Keep track of the emitted
13308 attributes on a per-target basis. This fixes bug #35413.
13310 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13312 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13313 default to the Windows 1252 encoding.
13315 (UnixParseOption): Support version, thanks to Alp for the missing
13318 * AssemblyInfo.cs: Add nice assembly information.
13320 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13323 * cs-parser.jay: Allow a trailing comma before the close bracked
13324 in the attribute_section production.
13326 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13327 address of the instance was being taken, I will take this out,
13328 because we take the address of the object immediately here.
13330 2002-12-09 Ravi Pratap <ravi@ximian.com>
13332 * typemanager.cs (AreMultipleAllowed): Take care of the most
13333 obvious case where attribute type is not in the current assembly -
13336 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13338 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13339 definitions, instead of doing that afterwards.
13341 Also we use a nice little hack, depending on the constructor, we
13342 know if we are a "composed" name or a simple name. Hence, we
13343 avoid the IndexOf test, and we avoid
13345 * codegen.cs: Add code to assist in a bug reporter to track down
13346 the source of a compiler crash.
13348 2002-12-07 Ravi Pratap <ravi@ximian.com>
13350 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13351 types have been emitted for a given element and flag an error
13352 if something which does not have AllowMultiple set is used more
13355 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13356 attribute types and their corresponding AllowMultiple properties
13358 (AreMultipleAllowed): Check the property for a given type.
13360 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13361 property in the case we have a TypeContainer.
13363 (Attributes.AddAttribute): Detect duplicates and just skip on
13364 adding them. This trivial fix catches a pretty gross error in our
13365 attribute emission - global attributes were being emitted twice!
13367 Bugzilla bug #33187 is now fixed.
13369 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13371 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13372 instead of pp_and).
13374 * expression.cs (Binary.ResolveOperator): I can only use the
13375 Concat (string, string, string) and Concat (string, string,
13376 string, string) if the child is actually a concatenation of
13379 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13381 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13382 context where we need a 2-character lookahead.
13384 * pending.cs (PendingImplementation): Rework so we can keep track
13385 of interface types all the time, and flag those which were
13386 implemented by parents as optional.
13388 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13390 * expression.cs (Binary.ResolveOperator): Use
13391 String.Concat(string,string,string) or
13392 String.Concat(string,string,string,string) when possible.
13394 * typemanager: More helper methods.
13397 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13399 * pending.cs: remove the bogus return from GetMissingInterfaces()
13400 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13402 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13404 * namespace.cs: avoid duplicated 'using xxx' being added to
13405 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13406 when we get more than one 'using' statement for the same namespace.
13407 Report a CS0105 warning for it.
13409 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13411 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13412 of calling getChar/putback, uses internal knowledge of it.
13414 (xtoken): Reorder tokenizer so most common patterns are checked
13415 first. This reduces the compilation time in another 5% (from 8.11s
13416 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13418 The parsing time is 22% of the compilation in mcs, and from that
13419 64% is spent on the tokenization process.
13421 I tried using a binary search for keywords, but this is slower
13422 than the hashtable. Another option would be to do a couple of
13425 * Not use a StringBuilder, instead use an array of chars,
13426 with a set value. Notice that this way we could catch
13427 the 645 error without having to do it *afterwards*.
13429 * We could write a hand-parser to avoid the hashtable
13430 compares altogether.
13432 The identifier consumption process takes 37% of the tokenization
13433 time. Another 15% is spent on is_number. 56% of the time spent
13434 on is_number is spent on Int64.Parse:
13436 * We could probably choose based on the string length to
13437 use Int32.Parse or Int64.Parse and avoid all the 64-bit
13440 Another 3% is spend on wrapping `xtoken' in the `token' function.
13442 Handle 0xa0 as whitespace (#34752)
13444 2002-11-26 Miguel de Icaza <miguel@ximian.com>
13446 * typemanager.cs (IsCLRType): New routine to tell whether a type
13447 is one of the builtin types.
13449 Maybe it needs to use TypeCodes to be faster. Maybe we could use
13450 typecode in more places instead of doing pointer comparissions.
13451 We could leverage some knowledge about the way the typecodes are
13454 New code to cache namespaces in assemblies, it is currently not
13455 invoked, to be used soon.
13457 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13459 * expression.cs (Binary.ResolveOperator): specially handle
13460 strings, and do not perform user-defined operator overloading for
13463 2002-11-24 Miguel de Icaza <miguel@ximian.com>
13465 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13466 internalcall as it is a pretty simple operation; Avoid whenever
13467 possible to call Char.IsLetter.
13469 (consume_identifier): Cut by half the number of
13470 hashtable calls by merging the is_keyword and GetKeyword behavior.
13472 Do not short-circuit, because if we do, we
13473 report errors (ie, #if false && true would produce an invalid
13477 2002-11-24 Martin Baulig <martin@ximian.com>
13479 * expression.cs (Cast.TryReduce): If we're in checked syntax,
13480 check constant ranges and report a CS0221. Fixes #33186.
13482 2002-11-24 Martin Baulig <martin@ximian.com>
13484 * cs-parser.jay: Make this work for uninitialized variable
13485 declarations in the `for' initializer. Fixes #32416.
13487 2002-11-24 Martin Baulig <martin@ximian.com>
13489 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13490 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
13492 2002-11-24 Martin Baulig <martin@ximian.com>
13494 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13495 argument; if true, we also check for user-defined conversions.
13496 This is only needed if both arguments are of a user-defined type.
13497 Fixes #30443, added test-175.cs.
13498 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13500 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13502 2002-11-24 Martin Baulig <martin@ximian.com>
13504 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13505 function to get the store opcode.
13506 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13507 only emit the Ldelema if the store opcode is Stobj. You must run
13508 both test-34 and test-167 to test this. Fixes #34529.
13510 2002-11-23 Martin Baulig <martin@ximian.com>
13512 * ecore.cs (Expression.MemberLookup): Added additional
13513 `qualifier_type' argument which is used when we're being called
13514 from MemberAccess.DoResolve() and null if we're called from a
13516 (Expression.MemberLookupFailed): New method to report errors; this
13517 does the CS1540 check and reports the correct error message.
13519 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13520 argument for the CS1540 check and redone the way how we're dealing
13521 with private members. See the comment in the source code for details.
13522 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13523 `closure_start_type' to `closure_qualifier_type' and check whether
13524 it's not null. It was not this filter being broken, it was just
13525 being called with the wrong arguments.
13527 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13528 and pass it the correct `qualifier_type'; this also does the error
13531 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13533 * expression.cs (Invocation.EmitParams): If the we are dealing
13534 with a non-built-in value type, load its address as well.
13536 (ArrayCreation): Use a a pretty constant instead
13537 of the hardcoded value 2. Use 6 instead of 2 for the number of
13538 static initializers.
13540 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13541 because they are not really value types, just glorified integers.
13543 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13545 * ecore.cs: Remove redundant code for enumerations, make them use
13546 the same code path as everything else, fixes the casting issue
13547 with enumerations in Windows.Forms.
13549 * attribute.cs: Do only cast to string if it is a string, the
13550 validation happens later.
13552 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13553 people upgrade their corlibs.
13555 * ecore.cs: Oops, enumerations were not following the entire code path
13557 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13559 * typemanager.cs (FilterWithClosure): Commented out the test for
13560 1540 in typemanager.cs, as it has problems when accessing
13561 protected methods from a parent class (see test-174.cs).
13563 * attribute.cs (Attribute.ValidateGuid): new method.
13564 (Attribute.Resolve): Use above.
13566 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13568 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13570 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13571 handling for enumerations, as we only needed the TypeContainer
13572 functionality to begin with (this is required for the fix below to
13573 work for enums that reference constants in a container class for
13576 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13578 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13579 a valid TypeBuilder to perform lookups on.o
13581 * class.cs (InheritableMemberSignatureCompare): Use true in the
13582 call to GetGetMethod and GetSetMethod, because we are comparing
13583 the signature, and we need to get the methods *even* if they are
13586 (PropertyBase.CheckBase): ditto.
13588 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13589 GotoCase.Resolve): Use Peel on EmpytCasts.
13591 * ecore.cs (EmptyCast): drop child, add Peel method.
13593 2002-11-17 Martin Baulig <martin@ximian.com>
13595 * ecore.cs (EmptyCast.Child): New public property.
13597 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13598 label resolved to an EmptyCast. Fixes #34162.
13599 (GotoCase.Resolve): Likewise.
13600 (Block.EmitMeta): Likewise.
13602 2002-11-17 Martin Baulig <martin@ximian.com>
13604 * expression.cs (Invocation.BetterConversion): Prefer int over
13605 uint; short over ushort; long over ulong for integer literals.
13606 Use ImplicitConversionExists instead of StandardConversionExists
13607 since we also need to check for user-defined implicit conversions.
13608 Fixes #34165. Added test-173.cs.
13610 2002-11-16 Martin Baulig <martin@ximian.com>
13612 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13613 with the `true' and `false' literals. Fixes #33151.
13615 2002-11-16 Martin Baulig <martin@ximian.com>
13617 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13618 October 22nd; don't do the cs1540 check for static members.
13620 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13621 now using our own filter here and doing the cs1540 check again.
13623 2002-11-16 Martin Baulig <martin@ximian.com>
13625 * support.cs (InternalParameters): Don't crash if we don't have
13626 any fixed parameters. Fixes #33532.
13628 2002-11-16 Martin Baulig <martin@ximian.com>
13630 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13631 when looking up static methods to make this work on Windows.
13634 2002-11-16 Martin Baulig <martin@ximian.com>
13636 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13637 a setter rather than using PropertyInfo.CanWrite.
13639 2002-11-15 Nick Drochak <ndrochak@gol.com>
13641 * class.cs: Allow acces to block member by subclasses. Fixes build
13644 2002-11-14 Martin Baulig <martin@ximian.com>
13646 * class.cs (Constructor.Emit): Added the extern/block check.
13649 2002-11-14 Martin Baulig <martin@ximian.com>
13651 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13652 iteration while looking for indexers, this is needed because the
13653 indexer may have a different name in our base classes. Fixed the
13654 error reporting (no indexers at all, not get accessor, no
13655 overloaded match). Fixes bug #33089.
13656 (IndexerAccess.DoResolveLValue): Likewise.
13658 2002-11-14 Martin Baulig <martin@ximian.com>
13660 * class.cs (PropertyBase.CheckBase): Make this work for multiple
13661 indexers. Fixes the first part of bug #33089.
13662 (MethodSignature.InheritableMemberSignatureCompare): Added support
13665 2002-11-13 Ravi Pratap <ravi@ximian.com>
13667 * attribute.cs (Attribute.Resolve): Catch the
13668 NullReferenceException and report it since it isn't supposed to
13671 2002-11-12 Miguel de Icaza <miguel@ximian.com>
13673 * expression.cs (Binary.EmitBranchable): Also handle the cases for
13674 LogicalOr and LogicalAnd that can benefit from recursively
13675 handling EmitBranchable. The code now should be nice for Paolo.
13677 2002-11-08 Miguel de Icaza <miguel@ximian.com>
13679 * typemanager.cs (LookupType): Added a negative-hit hashtable for
13680 the Type lookups, as we perform quite a number of lookups on
13681 non-Types. This can be removed once we can deterministically tell
13682 whether we have a type or a namespace in advance.
13684 But this might require special hacks from our corlib.
13688 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13689 and double which avoids a conversion from an integer to a double.
13691 * expression.cs: tiny optimization, avoid calling IsConstant,
13692 because it effectively performs the lookup twice.
13694 2002-11-06 Miguel de Icaza <miguel@ximian.com>
13696 But a bogus return here to keep the semantics of the old code
13697 until the Mono runtime is fixed.
13699 * pending.cs (GetMissingInterfaces): New method used to remove all
13700 the interfaces that are already implemented by our parent
13701 classes from the list of pending methods.
13703 * interface.cs: Add checks for calls after ResolveTypeExpr.
13705 2002-11-05 Miguel de Icaza <miguel@ximian.com>
13707 * class.cs (Class.Emit): Report warning 67: event not used if the
13708 warning level is beyond 3.
13710 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13711 being a NullLiteral.
13713 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13716 * class.cs (TypeContainer.GetClassBases): Cover a missing code
13717 path that might fail if a type can not be resolved.
13719 * expression.cs (Binary.Emit): Emit unsigned versions of the
13722 * driver.cs: use error 5.
13724 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13726 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13728 2002-11-01 Miguel de Icaza <miguel@ximian.com>
13730 * cs-parser.jay (switch_section): A beautiful patch from Martin
13731 Baulig that fixed 33094.
13733 2002-10-31 Miguel de Icaza <miguel@ximian.com>
13735 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13736 Check whether the base is abstract and report an error if so.
13738 * expression.cs (IndexerAccess.DoResolveLValue,
13739 IndexerAccess.DoResolve): ditto.
13741 (Invocation.DoResolve): ditto.
13743 (Invocation.FullMethodDesc): Improve the report string.
13745 * statement.cs (Block): Eliminate IsVariableDefined as it is
13746 basically just a wrapper for GetVariableInfo.
13748 * ecore.cs (SimpleName): Use new
13750 * support.cs (ReflectionParamter.ParameterType): We unwrap the
13751 type, as we return the actual parameter ref/unref state on a
13754 2002-10-30 Miguel de Icaza <miguel@ximian.com>
13756 * support.cs: Return proper flags REF/OUT fixing the previous
13759 * expression.cs: Reverted last patch, that was wrong. Is_ref is
13760 not used to mean `ref' but `ref or out' in ParameterReference
13762 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13763 full type signature instead of calling TypeManger.CSharpName
13766 * support.cs (InternalParameters.ParameterDesc): Do not compare
13767 directly to the modflags, because REF/OUT will actually be bitsets
13770 * delegate.cs (VerifyMethod): Check also the modifiers.
13772 * cs-tokenizer.cs: Fix bug where floating point values with an
13773 exponent where a sign was missing was ignored.
13775 * driver.cs: Allow multiple assemblies to be specified in a single
13778 2002-10-28 Miguel de Icaza <miguel@ximian.com>
13780 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
13781 because identifiers after a parenthesis would end up in this kind
13782 of production, and we needed to desamiguate it for having casts
13785 (UserDefinedType *) xxx
13787 2002-10-24 Miguel de Icaza <miguel@ximian.com>
13789 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13790 we should set on the Bindingflags.NonPublic, but not turn on
13791 private_ok. private_ok controls whether a Private member is
13792 returned (this is chekced on the filter routine), while the
13793 BindingFlags.NonPublic just controls whether private/protected
13794 will be allowed. This fixes the problem part of the problem of
13795 private properties being allowed to be used in derived classes.
13797 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13798 so we can call the children DoResolveLValue method (this will
13799 properly signal errors on lvalue assignments to base properties)
13801 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13802 getter are null, and we have a property info, we know that this
13803 happened because the lookup failed, so we report an error 122 for
13804 protection level violation.
13806 We also silently return if setter and getter are null in the
13807 resolve functions, this condition only happens if we have flagged
13808 the error before. This is the other half of the problem.
13810 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13811 not have accessibility information, that is why we were returning
13812 true in the filter function in typemanager.cs.
13814 To properly report 122 (property is inaccessible because of its
13815 protection level) correctly, we report this error in ResolveAccess
13816 by failing if both the setter and the getter are lacking (ie, the
13819 DoResolve and DoLResolve have been modified to check for both
13820 setter/getter being null and returning silently, the reason being
13821 that I did not want to put the knowledge about this error in upper
13824 int old = Report.Errors;
13825 x = new PropertyExpr (...);
13826 if (old != Report.Errors)
13831 So the property expr is returned, but it is invalid, so the error
13832 will be flagged during the resolve process.
13834 * class.cs: Remove InheritablePropertySignatureCompare from the
13835 class, as we no longer depend on the property signature to compute
13836 whether it is possible to implement a method or not.
13838 The reason is that calling PropertyInfo.GetGetMethod will return
13839 null (in .NET, in Mono it works, and we should change this), in
13840 cases where the Get Method does not exist in that particular
13845 class X { public virtual int A { get { return 1; } } }
13847 class Z : Y { public override int A { get { return 2; } } }
13849 Would fail in Z because the parent (Y) would not have the property
13850 defined. So we avoid this completely now (because the alternative
13851 fix was ugly and slow), and we now depend exclusively on the
13854 (PropertyBase.CheckBase): Use a method-base mechanism to find our
13855 reference method, instead of using the property.
13857 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13858 routines are gone now.
13860 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13861 names, they were incorrectly named.
13863 * cs-tokenizer.cs: Return are more gentle token on failure.
13865 * pending.cs (PendingImplementation.InterfaceMethod): This routine
13866 had an out-of-sync index variable, which caused it to remove from
13867 the list of pending methods the wrong method sometimes.
13869 2002-10-22 Miguel de Icaza <miguel@ximian.com>
13871 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13872 CanWrite, because those refer to this particular instance of the
13873 property, and do not take into account the fact that we can
13874 override single members of a property.
13876 Constructor requires an EmitContext. The resolution process does
13877 not happen here, but we need to compute the accessors before,
13878 because the resolution does not always happen for properties.
13880 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13881 subclass, before we did not update this flag, but we did update
13884 (GetAccessors): Drop this routine, as it did not work in the
13885 presence of partially overwritten set/get methods.
13887 Notice that this broke the cs1540 detection, but that will require
13890 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13894 * driver.cs: issue a warning instead of an error if we don't support
13895 debugging for the platform. Also ignore a couple of errors that may
13896 arise when trying to write the symbols. Undo my previous patch.
13898 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13900 * driver.cs: ignore /debug switch except for Unix platforms.
13902 2002-10-23 Nick Drochak <ndrochak@gol.com>
13904 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13906 2002-10-21 Miguel de Icaza <miguel@ximian.com>
13908 * driver.cs: Do not make mcs-debug conditional, so we do not break
13909 builds that use it.
13911 * statement.cs (UsageVector.MergeChildren): I would like Martin to
13912 review this patch. But basically after all the children variables
13913 have been merged, the value of "Breaks" was not being set to
13914 new_breaks for Switch blocks. I think that it should be set after
13915 it has executed. Currently I set this to the value of new_breaks,
13916 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13917 conservative, but I do not understand this code very well.
13919 I did not break anything in the build, so that is good ;-)
13921 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13923 2002-10-20 Mark Crichton <crichton@gimp.org>
13925 * cfold.cs: Fixed compile blocker. Really fixed it this time.
13927 2002-10-20 Nick Drochak <ndrochak@gol.com>
13929 * cfold.cs: Fixed compile blocker.
13931 2002-10-20 Miguel de Icaza <miguel@ximian.com>
13933 * driver.cs: I was chekcing the key, not the file.
13935 2002-10-19 Ravi Pratap <ravi@ximian.com>
13937 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13938 message that we were generating - we just need to silently return
13941 2002-10-19 Miguel de Icaza <miguel@ximian.com>
13943 * class.cs (Event.Define): Change my previous commit, as this
13944 breaks the debugger. This is a temporary hack, as it seems like
13945 the compiler is generating events incorrectly to begin with.
13947 * expression.cs (Binary.ResolveOperator): Added support for
13948 "U operator - (E x, E y)"
13950 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13953 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13954 init-only variables, but this path did not take into account that
13955 there might be also instance readonly variables. Correct this
13958 This fixes bug 32253
13960 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13963 * driver.cs: Change the extension for modules to `netmodule'
13965 * cs-parser.jay: Improved slightly the location tracking for
13966 the debugger symbols.
13968 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13969 modifiers that were specified instead of the hardcoded value
13970 (FamAndAssem). This was basically ignoring the static modifier,
13971 and others. Fixes 32429.
13973 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13974 fixed a bug in the process (32476)
13976 * expression.cs (ArrayAccess.EmitAssign): Patch from
13977 hwang_rob@yahoo.ca that fixes bug 31834.3
13979 2002-10-18 Miguel de Icaza <miguel@ximian.com>
13981 * driver.cs: Make the module extension .netmodule.
13983 2002-10-16 Miguel de Icaza <miguel@ximian.com>
13985 * driver.cs: Report an error if the resource file is not found
13986 instead of crashing.
13988 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13989 false, like Emit does.
13991 2002-10-16 Nick Drochak <ndrochak@gol.com>
13993 * typemanager.cs: Remove unused private member. Also reported mcs
13994 bug to report this as a warning like csc.
13996 2002-10-15 Martin Baulig <martin@gnome.org>
13998 * statement.cs (Statement.Emit): Made this a virtual method; emits
13999 the line number info and calls DoEmit().
14000 (Statement.DoEmit): New protected abstract method, formerly knows
14001 as Statement.Emit().
14003 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14005 2002-10-11 Miguel de Icaza <miguel@ximian.com>
14007 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14008 have fixed a remaining problem: not every AddXXXX was adding a
14009 fully qualified name.
14011 Now everyone registers a fully qualified name in the DeclSpace as
14012 being defined instead of the partial name.
14014 Downsides: we are slower than we need to be due to the excess
14015 copies and the names being registered this way.
14017 The reason for this is that we currently depend (on the corlib
14018 bootstrap for instance) that types are fully qualified, because
14019 we dump all the types in the namespace, and we should really have
14020 types inserted into the proper namespace, so we can only store the
14021 basenames in the defined_names array.
14023 2002-10-10 Martin Baulig <martin@gnome.org>
14025 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14026 from bug #31834, see the bug report for a testcase which is
14029 2002-10-10 Martin Baulig <martin@gnome.org>
14031 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14032 flow analysis code for this.
14034 * statement.cs (Do, While, For): Tell the flow analysis code about
14036 (FlowBranching.UsageVector): Added support for infinite loops.
14037 (Block.Resolve): Moved the dead code elimination here and use flow
14040 2002-10-09 Miguel de Icaza <miguel@ximian.com>
14042 * class.cs (Field.Define): Catch cycles on struct type
14045 * typemanager.cs (IsUnmanagedtype): Do not recursively check
14046 fields if the fields are static. We only need to check instance
14049 * expression.cs (As.DoResolve): Test for reference type.
14051 * statement.cs (Using.ResolveExpression): Use
14052 ConvertImplicitRequired, not ConvertImplicit which reports an
14054 (Using.ResolveLocalVariableDecls): ditto.
14056 * expression.cs (Binary.ResolveOperator): Report errors in a few
14057 places where we had to.
14059 * typemanager.cs (IsUnmanagedtype): Finish implementation.
14061 2002-10-08 Miguel de Icaza <miguel@ximian.com>
14063 * expression.cs: Use StoreFromPtr instead of extracting the type
14064 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
14066 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14067 an enumeration value to a System.Enum, but System.Enum is not a
14068 value type, but an class type, so we need to box.
14070 (Expression.ConvertExplicit): One codepath could return
14071 errors but not flag them. Fix this. Fixes #31853
14073 * parameter.cs (Resolve): Do not allow void as a parameter type.
14075 2002-10-06 Martin Baulig <martin@gnome.org>
14077 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14078 if it's a class type and not a struct. Fixes #31815.
14080 2002-10-06 Martin Baulig <martin@gnome.org>
14082 * statement.cs: Reworked the flow analysis code a bit to make it
14083 usable for dead code elimination.
14085 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14087 * cs-parser.jay: allow empty source files. Fixes bug #31781.
14089 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14091 * expression.cs (ComposedCast.DoResolveType): A quick workaround
14092 to fix the test 165, will investigate deeper.
14094 2002-10-04 Martin Baulig <martin@gnome.org>
14096 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14097 finally blocks actually work.
14098 (Try.Resolve): We don't need to create a sibling for `finally' if
14099 there is no finally block.
14101 2002-10-04 Martin Baulig <martin@gnome.org>
14103 * class.cs (Constructor.Define): The default accessibility for a
14104 non-default constructor is private, not public.
14106 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14108 * class.cs (Constructor): Make AllowedModifiers public, add
14111 * cs-parser.jay: Perform the modifiers test here, as the
14112 constructor for the Constructor class usually receives a zero
14113 because of the way we create it (first we create, later we
14114 customize, and we were never checking the modifiers).
14116 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14117 is a version of LookupTypeReflection that includes the type-name
14118 cache. This can be used as a fast path for functions that know
14119 the fully qualified name and are only calling into *.GetType() to
14120 obtain a composed type.
14122 This is also used by TypeManager.LookupType during its type
14125 (LookupType): We now also track the real type name, as sometimes
14126 we can get a quey for the real type name from things like
14127 ComposedCast. This fixes bug 31422.
14129 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14130 complete type fullname, it does not have to go through the type
14131 resolution system to obtain the composed version of the type (for
14132 obtaining arrays or pointers).
14134 (Conditional.Emit): Use the EmitBoolExpression to
14135 generate nicer code, as requested by Paolo.
14137 (ArrayCreation.CheckIndices): Use the patch from
14138 hwang_rob@yahoo.ca to validate the array initializers.
14140 2002-10-03 Miguel de Icaza <miguel@ximian.com>
14142 * class.cs (ConstructorInitializer.Emit): simplify code by using
14143 Invocation.EmitCall, and at the same time, fix the bugs in calling
14144 parent constructors that took variable arguments.
14146 * ecore.cs (Expression.ConvertNumericExplicit,
14147 Expression.ImplicitNumericConversion): Remove the code that
14148 manually wrapped decimal (InternalTypeConstructor call is now gone
14151 * expression.cs (Cast.TryReduce): Also handle decimal types when
14152 trying to perform a constant fold on the type.
14154 * typemanager.cs (IsUnmanagedtype): Partially implemented.
14156 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14157 that only turned off an error report, and did nothing else.
14159 2002-10-02 Miguel de Icaza <miguel@ximian.com>
14161 * driver.cs: Handle and ignore /fullpaths
14163 2002-10-01 Miguel de Icaza <miguel@ximian.com>
14165 * expression.cs (Binary.ResolveOperator): Catch the case where
14166 DoNumericPromotions returns true,
14168 (Binary.DoNumericPromotions): Simplify the code, and the tests.
14170 2002-09-27 Miguel de Icaza <miguel@ximian.com>
14172 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14175 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14177 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14178 conversion exists, but it is also required that the conversion be
14179 performed. This manifested in "(Type64Enum) 2".
14181 * class.cs (TypeManager.AddMethod): The fix is not to change
14182 AddEnum, because that one was using a fully qualified name (every
14183 DeclSpace derivative does), but to change the AddMethod routine
14184 that was using an un-namespaced name. This now correctly reports
14185 the duplicated name.
14187 Revert patch until I can properly fix it. The issue
14188 is that we have a shared Type space across all namespaces
14189 currently, which is wrong.
14191 Options include making the Namespace a DeclSpace, and merge
14192 current_namespace/current_container in the parser.
14194 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14196 * cs-parser.jay: Improve error reporting when we get a different
14197 kind of expression in local_variable_type and
14198 local_variable_pointer_type.
14200 Propagate this to avoid missleading errors being reported.
14202 * ecore.cs (ImplicitReferenceConversion): treat
14203 TypeManager.value_type as a target just like object_type. As
14208 Is valid, and needs to result in the int 1 being boxed before it
14209 is assigned to the value type v.
14211 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14212 to validate the enumeration name.
14214 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14215 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14216 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14218 * ecore.cs (TryImplicitIntConversion): When doing an
14219 implicit-enumeration-conversion, check if the type is 64-bits and
14220 perform a conversion before passing to EnumConstant.
14222 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14224 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14225 report ambiguous type references. Unlike the MS version, we
14226 report what the ambiguity is. Innovation at work ;-)
14228 (DeclSpace.FindType): Require a location argument to
14229 display when we display an ambiguous error.
14231 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14233 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14235 * expression.cs (EmitDynamicInitializers): Apply patch from
14236 hwang_rob@yahoo.ca that fixes the order in which we emit our
14239 2002-09-21 Martin Baulig <martin@gnome.org>
14241 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14242 delegate takes no arguments.
14244 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14246 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14249 * expression.cs: Extract the underlying type.
14251 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14253 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14255 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14257 * class.cs (TypeContainer.DefineType): We can not use the nice
14258 PackingSize with the size set to 1 DefineType method, because it
14259 will not allow us to define the interfaces that the struct
14262 This completes the fixing of bug 27287
14264 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14265 means also structs. This fixes part of the problem.
14266 (Expresion.ImplicitReferenceConversionExists): ditto.
14268 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14269 error if there were no errors reported during the type lookup
14270 process, to avoid duplicates or redundant errors. Without this
14271 you would get an ambiguous errors plus a type not found. We have
14272 beaten the user enough with the first error.
14274 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14277 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14278 during the resolution process, stop the lookup, this avoids
14279 repeated error reports (same error twice).
14281 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14283 * typemanager.cs (LookupType): Redo the type lookup code to match
14284 the needs of System.Reflection.
14286 The issue is that System.Reflection requires references to nested
14287 types to begin with a "+" sign instead of a dot. So toplevel
14288 types look like: "NameSpace.TopLevelClass", and nested ones look
14289 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14292 2002-09-19 Martin Baulig <martin@gnome.org>
14294 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14295 says that a method always returns or always throws an exception,
14296 don't report the CS0161.
14298 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14299 set `Returns = new_returns'.
14301 2002-09-19 Martin Baulig <martin@gnome.org>
14303 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14304 to an enum constant, check for a CS0176.
14306 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14308 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14309 for operators that must be in pairs and report errors.
14311 * ecore.cs (SimpleName.DoResolveType): During the initial type
14312 resolution process, when we define types recursively, we must
14313 check first for types in our current scope before we perform
14314 lookups in the enclosing scopes.
14316 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14318 (Invocation.VerifyArgumentsCompat): Call
14319 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14320 I thought we were supposed to always call this, but there are a
14321 few places in the code where we dont do it.
14323 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14325 * driver.cs: Add support in -linkres and -resource to specify the
14326 name of the identifier.
14328 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14330 * ecore.cs (StandardConversionExists): Sync with the conversion
14331 code: allow anything-* to void* conversions.
14333 (FindMostSpecificSource): Use an Expression argument
14334 instead of a Type, because we might be handed over a Literal which
14335 gets a few more implicit conversions that plain types do not. So
14336 this information was being lost.
14338 Also, we drop the temporary type-holder expression when not
14341 2002-09-17 Martin Baulig <martin@gnome.org>
14343 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14344 this is an explicit interface implementation.
14346 2002-09-17 Martin Baulig <martin@gnome.org>
14348 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14349 different `IndexerName' attributes.
14351 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14352 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14353 virtual CommonResolve().
14355 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14357 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14358 and convert that to the UnderlyingType.
14360 * statement.cs (Foreach.Resolve): Indexers are just like variables
14361 or PropertyAccesses.
14363 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14364 inside quoted strings, we were not doing this before.
14366 2002-09-16 Martin Baulig <martin@gnome.org>
14368 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14369 resolve it. This is needed for the definite assignment check of the
14370 instance expression, fixes bug #29846.
14371 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14373 2002-09-16 Nick Drochak <ndrochak@gol.com>
14375 * parameter.cs: Fix compile error. Cannot reference static member
14376 from an instance object. Is this an mcs bug?
14378 2002-09-14 Martin Baulig <martin@gnome.org>
14380 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14381 multiple times. Fixes bug #30295, added test-166.cs.
14383 2002-09-14 Martin Baulig <martin@gnome.org>
14385 * statement.cs (Block.Emit): Don't emit unreachable code.
14386 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14387 `break' statements.
14388 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14390 2002-09-14 Martin Baulig <martin@gnome.org>
14392 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14395 2002-09-14 Martin Baulig <martin@gnome.org>
14397 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14398 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14399 be false on the ms runtime.
14401 2002-09-13 Martin Baulig <martin@gnome.org>
14403 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14404 the CS0038 error message.
14406 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14408 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14409 constant inside, return it.
14411 2002-09-12 Martin Baulig <martin@gnome.org>
14413 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14414 implicit conversion can be done between enum types.
14416 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14417 check whether an implicit conversion to the current enum's UnderlyingType
14418 exists and report an error if not.
14420 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14421 without debugging support.
14423 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14424 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14426 2002-09-12 Martin Baulig <martin@gnome.org>
14428 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14430 * ecore.cs (IMemberExpr.DeclaringType): New property.
14431 (SimpleName.SimpleNameResolve): Check whether we're accessing a
14432 nonstatic member of an outer type (CS0038).
14434 2002-09-11 Miguel de Icaza <miguel@ximian.com>
14436 * driver.cs: Activate the using-error detector at warning level
14437 4 (at least for MS-compatible APIs).
14439 * namespace.cs (VerifyUsing): Small buglett fix.
14441 * pending.cs (PendingImplementation): pass the container pointer.
14443 * interface.cs (GetMethods): Allow for recursive definition. Long
14444 term, I would like to move every type to support recursive
14445 definitions, not the current ordering mechanism that we have right
14448 The situation is this: Attributes are handled before interfaces,
14449 so we can apply attributes to interfaces. But some attributes
14450 implement interfaces, we will now handle the simple cases
14451 (recursive definitions will just get an error).
14453 * parameter.cs: Only invalidate types at the end if we fail to
14456 2002-09-09 Martin Baulig <martin@gnome.org>
14458 * ecore.cs (PropertyExpr.Emit): Also check for
14459 TypeManager.system_int_array_get_length so this'll also work when
14460 compiling corlib. Fixes #30003.
14462 2002-09-09 Martin Baulig <martin@gnome.org>
14464 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14465 and throw an exception if we can't get the type's size. Fixed #30040,
14468 2002-09-09 Martin Baulig <martin@gnome.org>
14470 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14472 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14473 context. Fixes bug #30027.
14475 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14476 virtual functions. Fixes bug #30043, added test-164.cs.
14478 2002-09-08 Ravi Pratap <ravi@ximian.com>
14480 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14482 2002-09-08 Nick Drochak <ndrochak@gol.com>
14484 * driver.cs: Use an object to get the windows codepage since it's not a
14487 2002-09-08 Miguel de Icaza <miguel@ximian.com>
14489 * statement.cs (For.Emit): for infinite loops (test == null)
14490 return whether there is a break inside, not always "true".
14492 * namespace.cs (UsingEntry): New struct to hold the name of the
14493 using definition, the location where it is defined, and whether it
14494 has been used in a successful type lookup.
14496 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14501 2002-09-06 Ravi Pratap <ravi@ximian.com>
14503 * attribute.cs : Fix incorrect code which relied on catching
14504 a NullReferenceException to detect a null being passed in
14505 where an object was expected.
14507 2002-09-06 Miguel de Icaza <miguel@ximian.com>
14509 * statement.cs (Try): flag the catch variable as assigned
14511 * expression.cs (Cast): Simplified by using ResolveType instead of
14512 manually resolving.
14514 * statement.cs (Catch): Fix bug by using ResolveType.
14516 2002-09-06 Ravi Pratap <ravi@ximian.com>
14518 * expression.cs (BetterConversion): Special case for when we have
14519 a NullLiteral as the argument and we have to choose between string
14520 and object types - we choose string the way csc does.
14522 * attribute.cs (Attribute.Resolve): Catch the
14523 NullReferenceException and report error #182 since the Mono
14524 runtime no more has the bug and having this exception raised means
14525 we tried to select a constructor which takes an object and is
14528 2002-09-05 Ravi Pratap <ravi@ximian.com>
14530 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14531 message (1502, 1503) when we can't locate a method after overload
14532 resolution. This is much more informative and closes the bug
14535 * interface.cs (PopulateMethod): Return if there are no argument
14536 types. Fixes a NullReferenceException bug.
14538 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14539 expressions too. Previously we were checking only in one place for
14540 positional arguments leaving out named arguments.
14542 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14543 type to the enum type is not allowed. Remove code corresponding to
14546 (ConvertNumericExplicit): Allow explicit conversions from
14547 the underlying type to enum type. This precisely follows the spec
14548 and closes a bug filed by Gonzalo.
14550 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14553 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14555 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14557 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14558 it was important that we stored the right value after the
14559 reduction in `converted'.
14561 2002-09-04 Martin Baulig <martin@gnome.org>
14563 * location.cs (Location.SymbolDocument): Use full pathnames for the
14566 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14568 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14569 of the expression resolve mechanism, because that will catch the
14570 SimpleName error failures.
14572 (Conditional): If we can not resolve the
14573 expression, return, do not crash.
14575 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14578 (location): display token name instead of its number.
14580 2002-08-28 Martin Baulig <martin@gnome.org>
14582 * expression.cs (Binary.ResolveOperator): Don't silently return
14583 but return an error if an operator cannot be applied between two
14586 2002-08-28 Martin Baulig <martin@gnome.org>
14588 * class.cs (Constructor.Define): Set the permission attributes
14589 correctly instead of making all constructors public.
14591 2002-08-28 Martin Baulig <martin@gnome.org>
14593 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14594 for private members before reporting a CS0103; if we find anything,
14597 2002-08-28 Martin Baulig <martin@gnome.org>
14599 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14600 to check whether `closure_start_type == closure_invocation_type',
14601 we also need to check whether `m.DeclaringType == closure_invocation_type'
14602 before bypassing the permission checks. We might be accessing
14603 protected/private members from the base class.
14604 (TypeManager.RealMemberLookup): Only set private_ok if private
14605 members were requested via BindingFlags.NonPublic.
14607 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14609 * expression.cs (MemberAccess.ResolveMemberAccess): Set
14610 MethodGroupExpr.IsExplicitImpl if appropriate.
14611 (Invocation.DoResolve): Don't report the CS0120 for explicit
14612 interface implementations.
14614 2002-08-27 Martin Baulig <martin@gnome.org>
14616 * expression.cs (Invocation.DoResolve): If this is a static
14617 method and we don't have an InstanceExpression, we must report
14620 2002-08-25 Martin Baulig <martin@gnome.org>
14622 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14623 `==' between a valuetype and an object.
14625 2002-08-25 Miguel de Icaza <miguel@ximian.com>
14627 * ecore.cs (TypeExpr): Provide a ToString method.
14629 2002-08-24 Martin Baulig <martin@gnome.org>
14631 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14632 now called proggie.dbg and it's a binary file.
14634 2002-08-23 Martin Baulig <martin@gnome.org>
14636 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14638 2002-08-23 Martin Baulig <martin@gnome.org>
14640 * struct.cs (MyStructInfo.ctor): Make this work with empty
14641 structs; it's not allowed to use foreach() on null.
14643 2002-08-23 Martin Baulig <martin@gnome.org>
14645 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14646 writer the full pathname of the generated assembly.
14648 2002-08-23 Martin Baulig <martin@gnome.org>
14650 * statements.cs (FlowBranching.UsageVector.MergeChildren):
14651 A `finally' block never returns or breaks; improved handling of
14654 2002-08-23 Martin Baulig <martin@gnome.org>
14656 * statement.cs (Throw.Resolve): Allow `throw null'.
14658 2002-08-23 Martin Baulig <martin@gnome.org>
14660 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14661 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14662 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
14663 MemberLookup would return a wrong event if this is an explicit
14664 interface implementation and the class has an event with the same
14667 2002-08-23 Martin Baulig <martin@gnome.org>
14669 * statement.cs (Block.AddChildVariableNames): New public method.
14670 (Block.AddChildVariableName): Likewise.
14671 (Block.IsVariableNameUsedInChildBlock): Likewise.
14672 (Block.AddVariable): Check whether a variable name has already
14673 been used in a child block.
14675 * cs-parser.jay (declare_local_variables): Mark all variable names
14676 from the current block as being used in a child block in the
14679 2002-08-23 Martin Baulig <martin@gnome.org>
14681 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14682 find the symbol writer.
14684 * driver.cs: csc also allows the arguments to /define being
14685 separated by commas, not only by semicolons.
14687 2002-08-23 Martin Baulig <martin@gnome.org>
14689 * interface.cs (Interface.GetMembers): Added static check for events.
14691 2002-08-15 Martin Baulig <martin@gnome.org>
14693 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14694 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14696 * ecore.cs (Expression.MemberLookup): Added documentation and explained
14697 why the MethodData.EmitDestructor() change was necessary.
14699 2002-08-20 Martin Baulig <martin@gnome.org>
14701 * class.cs (TypeContainer.FindMembers): Added static check for events.
14703 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14705 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14706 use Type.GetEvents(), not Type.FindMembers().
14708 2002-08-20 Martin Baulig <martin@gnome.org>
14710 * decl.cs (MemberCache): Added a special method cache which will
14711 be used for method-only searched. This ensures that a method
14712 search will return a MethodInfo with the correct ReflectedType for
14715 2002-08-20 Martin Baulig <martin@gnome.org>
14717 * decl.cs (DeclSpace.FindMembers): Made this public.
14719 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14721 * delegate.cs: fixed build on windows.
14722 [FIXME: Filed as bug #29150: MCS must report these errors.]
14724 2002-08-19 Ravi Pratap <ravi@ximian.com>
14726 * ecore.cs (StandardConversionExists): Return a false
14727 if we are trying to convert the void type to anything else
14728 since that is not allowed.
14730 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14731 we flag error 70 in the event an event is trying to be accessed
14732 directly from outside the declaring type.
14734 2002-08-20 Martin Baulig <martin@gnome.org>
14736 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14737 MemberCache from typemanager.cs to decl.cs.
14739 2002-08-19 Martin Baulig <martin@gnome.org>
14741 * class.cs (TypeContainer): Implement IMemberContainer.
14742 (TypeContainer.DefineMembers): Create the MemberCache.
14743 (TypeContainer.FindMembers): Do better BindingFlags checking; only
14744 return public members if BindingFlags.Public was given, check
14745 whether members are static.
14747 2002-08-16 Martin Baulig <martin@gnome.org>
14749 * decl.cs (DeclSpace.Define): Splitted this in Define and
14750 DefineMembers. DefineMembers is called first and initializes the
14753 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
14754 DefineMembers() on all our DeclSpaces.
14756 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14757 but call DefineMembers() on all nested interfaces. We call their
14758 Define() in our new Define() function.
14760 * interface.cs (Interface): Implement IMemberContainer.
14761 (Interface.Define): Moved all code except the attribute stuf to
14763 (Interface.DefineMembers): Initialize the member cache.
14765 * typemanager.cs (IMemberFinder): Removed this interface, we don't
14766 need this anymore since we can use MemberCache.FindMembers directly.
14768 2002-08-19 Martin Baulig <martin@gnome.org>
14770 * typemanager.cs (MemberCache): When creating the cache for an
14771 interface type, add all inherited members.
14772 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14773 to `out bool used_cache' and documented it.
14774 (TypeManager.MemberLookup): If we already used the cache in the first
14775 iteration, we don't need to do the interfaces check.
14777 2002-08-19 Martin Baulig <martin@gnome.org>
14779 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
14780 here from IMemberFinder and don't implement this interface anymore.
14781 (DeclSpace.MemberCache): Moved here from IMemberFinder.
14783 * typemanager.cs (IMemberFinder): This interface is now only used by
14784 classes which actually support the member cache.
14785 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14786 since we only put DeclSpaces into this Hashtable.
14787 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14788 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14790 2002-08-16 Martin Baulig <martin@gnome.org>
14792 * typemanager.cs (ICachingMemberFinder): Removed.
14793 (IMemberFinder.MemberCache): New property.
14794 (TypeManager.FindMembers): Merged this with RealFindMembers().
14795 This function will never be called from TypeManager.MemberLookup()
14796 so we can't use the cache here, just the IMemberFinder.
14797 (TypeManager.MemberLookup_FindMembers): Check whether the
14798 IMemberFinder has a MemberCache and call the cache's FindMembers
14800 (MemberCache): Rewrote larger parts of this yet another time and
14801 cleaned it up a bit.
14803 2002-08-15 Miguel de Icaza <miguel@ximian.com>
14805 * driver.cs (LoadArgs): Support quoting.
14807 (Usage): Show the CSC-like command line arguments.
14809 Improved a few error messages.
14811 2002-08-15 Martin Baulig <martin@gnome.org>
14813 * typemanager.cs (IMemberContainer.Type): New property.
14814 (IMemberContainer.IsInterface): New property.
14816 The following changes are conditional to BROKEN_RUNTIME, which is
14817 defined at the top of the file.
14819 * typemanager.cs (MemberCache.MemberCache): Don't add the base
14820 class'es members, but add all members from TypeHandle.ObjectType
14821 if we're an interface.
14822 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14823 is the current type.
14824 (MemberCache.CacheEntry.Container): Removed this field.
14825 (TypeHandle.GetMembers): Include inherited members.
14827 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14829 * typemanager.cs: fixed compilation and added a comment on a field that
14832 2002-08-15 Martin Baulig <martin@gnome.org>
14834 * class.cs (ConstructorInitializer.Resolve): In the
14835 Expression.MemberLookup call, use the queried_type as
14838 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14839 declared' attribute, it's always true.
14840 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14841 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14842 temporary wrapper for FindMembers which tells MemberLookup whether
14843 members from the base classes are included in the return value.
14844 This will go away soon.
14845 (TypeManager.MemberLookup): Use this temporary hack here; once the
14846 new MemberCache is completed, we don't need to do the DeclaredOnly
14847 looping here anymore since the MemberCache will take care of this.
14848 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14849 (MemberCache): When creating the MemberCache for a class, get
14850 members from the current class and all its base classes.
14851 (MemberCache.CacheEntry.Container): New field. This is a
14852 temporary hack until the Mono runtime is fixed to distinguish
14853 between ReflectedType and DeclaringType. It allows us to use MCS
14854 with both the MS runtime and the unfixed Mono runtime without
14855 problems and without accecting performance.
14856 (MemberCache.SearchMembers): The DeclaredOnly looping from
14857 TypeManager.MemberLookup is now done here.
14859 2002-08-14 Martin Baulig <martin@gnome.org>
14861 * statement.cs (MyStructInfo.MyStructInfo): Don't call
14862 Type.GetFields on dynamic types but get the fields from the
14863 corresponding TypeContainer.
14864 (MyStructInfo.GetStructInfo): Added check for enum types.
14866 * typemanager.cs (MemberList.IsSynchronized): Implemented.
14867 (MemberList.SyncRoot): Implemented.
14868 (TypeManager.FilterWithClosure): No need to check permissions if
14869 closure_start_type == closure_invocation_type, don't crash if
14870 closure_invocation_type is null.
14872 2002-08-13 Martin Baulig <martin@gnome.org>
14874 Rewrote TypeContainer.FindMembers to use a member cache. This
14875 gives us a speed increase of about 35% for the self-hosting MCS
14876 build and of about 15-20% for the class libs (both on GNU/Linux).
14878 * report.cs (Timer): New class to get enhanced profiling. This
14879 whole class is "TIMER" conditional since it remarkably slows down
14882 * class.cs (MemberList): New class. This is an IList wrapper
14883 which we're now using instead of passing MemberInfo[]'s around to
14884 avoid copying this array unnecessarily.
14885 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14886 (ICachingMemberFinder, IMemberContainer): New interface.
14887 (TypeManager.FilterWithClosure): If `criteria' is null, the name
14888 has already been checked, otherwise use it for the name comparision.
14889 (TypeManager.FindMembers): Renamed to RealMemberFinder and
14890 provided wrapper which tries to use ICachingMemberFinder.FindMembers
14891 if possible. Returns a MemberList, not a MemberInfo [].
14892 (TypeHandle): New class, implements IMemberContainer. We create
14893 one instance of this class per type, it contains a MemberCache
14894 which is used to do the member lookups.
14895 (MemberCache): New class. Each instance of this class contains
14896 all members of a type and a name-based hash table.
14897 (MemberCache.FindMembers): This is our new member lookup
14898 function. First, it looks up all members of the requested name in
14899 the hash table. Then, it walks this list and sorts out all
14900 applicable members and returns them.
14902 2002-08-13 Martin Baulig <martin@gnome.org>
14904 In addition to a nice code cleanup, this gives us a performance
14905 increase of about 1.4% on GNU/Linux - not much, but it's already
14906 half a second for the self-hosting MCS compilation.
14908 * typemanager.cs (IMemberFinder): New interface. It is used by
14909 TypeManager.FindMembers to call FindMembers on a TypeContainer,
14910 Enum, Delegate or Interface.
14911 (TypeManager.finder_to_member_finder): New PtrHashtable.
14912 (TypeManager.finder_to_container): Removed.
14913 (TypeManager.finder_to_delegate): Removed.
14914 (TypeManager.finder_to_interface): Removed.
14915 (TypeManager.finder_to_enum): Removed.
14917 * interface.cs (Interface): Implement IMemberFinder.
14919 * delegate.cs (Delegate): Implement IMemberFinder.
14921 * enum.cs (Enum): Implement IMemberFinder.
14923 * class.cs (TypeContainer): Implement IMemberFinder.
14925 2002-08-12 Martin Baulig <martin@gnome.org>
14927 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14929 2002-08-12 Martin Baulig <martin@gnome.org>
14931 * ecore.cs (ITypeExpression): New interface for expressions which
14933 (TypeExpression): Renamed to TypeLookupExpression.
14934 (Expression.DoResolve): If we're doing a types-only lookup, the
14935 expression must implement the ITypeExpression interface and we
14936 call DoResolveType() on it.
14937 (SimpleName): Implement the new ITypeExpression interface.
14938 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14939 hack, the situation that we're only looking up types can't happen
14940 anymore when this method is called. Moved the type lookup code to
14941 DoResolveType() and call it.
14942 (SimpleName.DoResolveType): This ITypeExpression interface method
14943 is now doing the types-only lookup.
14944 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14945 (ResolveFlags): Added MaskExprClass.
14947 * expression.cs (MemberAccess): Implement the ITypeExpression
14949 (MemberAccess.DoResolve): Added support for a types-only lookup
14950 when we're called via ITypeExpression.DoResolveType().
14951 (ComposedCast): Implement the ITypeExpression interface.
14953 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
14954 Expression.Resolve() with ResolveFlags.Type instead.
14956 2002-08-12 Martin Baulig <martin@gnome.org>
14958 * interface.cs (Interface.Define): Apply attributes.
14960 * attribute.cs (Attribute.ApplyAttributes): Added support for
14961 interface attributes.
14963 2002-08-11 Martin Baulig <martin@gnome.org>
14965 * statement.cs (Block.Emit): Only check the "this" variable if we
14966 do not always throw an exception.
14968 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14969 whether the property has a set accessor.
14971 2002-08-11 Martin Baulig <martin@gnome.org>
14973 Added control flow analysis support for structs.
14975 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14976 with control flow analysis turned off.
14977 (IVariable): New interface.
14978 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14979 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14980 (FieldExpr.DoResolve): Resolve the instance expression with flow
14981 analysis turned off and do the definite assignment check after the
14982 resolving when we know what the expression will resolve to.
14984 * expression.cs (LocalVariableReference, ParameterReference):
14985 Implement the new IVariable interface, only call the flow analysis
14986 code if ec.DoFlowAnalysis is true.
14987 (This): Added constructor which takes a Block argument. Implement
14988 the new IVariable interface.
14989 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14990 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14991 This does the definite assignment checks for struct members.
14993 * class.cs (Constructor.Emit): If this is a non-static `struct'
14994 constructor which doesn't have any initializer, call
14995 Block.AddThisVariable() to tell the flow analysis code that all
14996 struct elements must be initialized before control returns from
14999 * statement.cs (MyStructInfo): New public class.
15000 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15001 argument to this indexer. If non-zero, check an individual struct
15002 member, not the whole struct.
15003 (FlowBranching.CheckOutParameters): Check struct members.
15004 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15005 overloaded versions of these methods which take an additional
15006 `int field_idx' argument to check struct members.
15007 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15008 overloaded versions of these methods which take an additional
15009 `string field_name' argument to check struct member.s
15010 (VariableInfo): Implement the IVariable interface.
15011 (VariableInfo.StructInfo): New public property. Returns the
15012 MyStructInfo instance of the variable if it's a struct or null.
15013 (Block.AddThisVariable): New public method. This is called from
15014 Constructor.Emit() for non-static `struct' constructor which do
15015 not have any initializer. It creates a special variable for the
15016 "this" instance variable which will be checked by the flow
15017 analysis code to ensure that all of the struct's fields are
15018 initialized before control returns from the constructor.
15019 (UsageVector): Added support for struct members. If a
15020 variable/parameter is a struct with N members, we reserve a slot
15021 in the usage vector for each member. A struct is considered fully
15022 initialized if either the struct itself (slot 0) or all its
15023 members are initialized.
15025 2002-08-08 Martin Baulig <martin@gnome.org>
15027 * driver.cs (Driver.MainDriver): Only report an error CS5001
15028 if there were no compilation errors.
15030 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15031 `UnsafeContext' property to determine whether the parent is in
15032 unsafe context rather than checking the parent's ModFlags:
15033 classes nested in an unsafe class are unsafe as well.
15035 2002-08-08 Martin Baulig <martin@gnome.org>
15037 * statement.cs (UsageVector.MergeChildren): Distinguish between
15038 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15039 we return. Added test17() and test18() to test-154.cs.
15041 2002-08-08 Martin Baulig <martin@gnome.org>
15043 * typemanager.cs (TypeManager.FilterWithClosure): If we have
15044 Family access, make sure the invoking type isn't a subclass of the
15045 queried type (that'd be a CS1540).
15047 * ecore.cs (Expression.MemberLookup): Added overloaded version of
15048 this method which takes an additional `Type invocation_type'.
15050 * expression.cs (BaseAccess.DoResolve): Use the base type as
15051 invocation and query type.
15052 (MemberAccess.DoResolve): If the lookup failed and we're about to
15053 report a CS0122, try a lookup with the ec.ContainerType - if this
15054 succeeds, we must report a CS1540.
15056 2002-08-08 Martin Baulig <martin@gnome.org>
15058 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15059 (MethodGroupExpr): Implement the IMemberExpr interface.
15061 * expression (MemberAccess.ResolveMemberAccess): No need to have
15062 any special code for MethodGroupExprs anymore, they're now
15065 2002-08-08 Martin Baulig <martin@gnome.org>
15067 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15068 Family, FamANDAssem and FamORAssem permissions.
15069 (TypeManager.IsSubclassOrNestedChildOf): New public method.
15071 2002-08-08 Martin Baulig <martin@gnome.org>
15073 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15074 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15077 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15079 * driver.cs: implemented /resource option to embed managed resources.
15081 2002-08-07 Martin Baulig <martin@gnome.org>
15083 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15084 (FieldBase.HasFieldInitializer): New public property.
15085 (FieldBase.GetInitializerExpression): New public method. Resolves and
15086 returns the field initializer and makes sure it is only resolved once.
15087 (TypeContainer.EmitFieldInitializers): Call
15088 FieldBase.GetInitializerExpression to get the initializer, this ensures
15089 that it isn't resolved multiple times.
15091 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
15092 the resolving process (SimpleName/MemberLookup) that we're currently
15093 emitting a field initializer (which must not access any instance members,
15094 this is an error CS0236).
15096 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15097 argument, if the `IsFieldInitializer' flag is set, we must report and
15098 error CS0236 and not an error CS0120.
15100 2002-08-07 Martin Baulig <martin@gnome.org>
15102 * ecore.cs (IMemberExpr): New public interface.
15103 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15104 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15105 if the expression is an IMemberExpr.
15107 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15108 to be null, implicitly default to `this' if we're non-static in
15109 this case. Simplified the code a lot by using the new IMemberExpr
15110 interface. Also fixed bug #28176 here.
15112 2002-08-06 Martin Baulig <martin@gnome.org>
15114 * cs-parser.jay (SimpleLookup): Removed. We need to create
15115 ParameterReferences during semantic analysis so that we can do a
15116 type-only search when resolving Cast, TypeOf and SizeOf.
15117 (block): Pass the `current_local_parameters' to the Block's
15120 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15121 argument to the constructor.
15122 (ConstructorInitializer.Resolve): Create a temporary implicit
15123 block with the parameters.
15125 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15126 references here if we aren't doing a type-only search.
15128 * statement.cs (Block): Added constructor which takes a
15129 `Parameters parameters' argument.
15130 (Block.Parameters): New public property.
15132 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15133 to `Parameters' and made it public readonly.
15135 2002-08-06 Martin Baulig <martin@gnome.org>
15137 * ecore.cs (Expression.Warning): Made this public as well.
15139 * report.cs (Report.Debug): Print the contents of collections.
15141 2002-08-06 Martin Baulig <martin@gnome.org>
15143 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
15144 used to tell Resolve() which kinds of expressions it may return.
15145 (Expression.Resolve): Added overloaded version of this method which
15146 takes a `ResolveFlags flags' argument. This can be used to tell
15147 Resolve() which kinds of expressions it may return. Reports a
15149 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15150 ResolveFlags.SimpleName.
15151 (Expression.Error118): Added overloaded version of this method which
15152 takes a `ResolveFlags flags' argument. It uses the flags to determine
15153 which kinds of expressions are allowed.
15155 * expression.cs (Argument.ResolveMethodGroup): New public method.
15156 Resolves an argument, but allows a MethodGroup to be returned.
15157 This is used when invoking a delegate.
15159 * TODO: Updated a bit.
15161 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15163 Fixed compilation with csc.
15165 * ecore.cs: Expression.Error made public. Is this correct? Should
15166 Warning be made public too?
15168 * expression.cs: use ea.Location instead of ea.loc.
15169 [FIXME: Filed as bug #28607: MCS must report these errors.]
15171 2002-08-06 Martin Baulig <martin@gnome.org>
15173 * ecore.cs (Expression.loc): Moved the location here instead of
15174 duplicating it in all derived classes.
15175 (Expression.Location): New public property.
15176 (Expression.Error, Expression.Warning): Made them non-static and
15177 removed the location argument.
15178 (Expression.Warning): Added overloaded version which takes an
15179 `int level' argument.
15180 (Expression.Error118): Make this non-static and removed the
15181 expression and location arguments.
15182 (TypeExpr): Added location argument to the constructor.
15184 * expression.cs (StaticCallExpr): Added location argument to
15186 (Indirection, PointerArithmetic): Likewise.
15187 (CheckedExpr, UnCheckedExpr): Likewise.
15188 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15189 (StringPtr): Likewise.
15192 2002-08-05 Martin Baulig <martin@gnome.org>
15194 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15196 * assign.cs (Assign.DoResolve): Check whether the source
15197 expression is a value or variable.
15199 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15200 while resolving the corresponding blocks.
15202 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15203 an error, don't silently return null.
15205 * statement.cs (Block.AddVariable): Do the error reporting here
15206 and distinguish between CS0128 and CS0136.
15207 (Block.DoResolve): Report all unused labels (warning CS0164).
15208 (LabeledStatement): Pass the location to the constructor.
15209 (LabeledStatement.HasBeenReferenced): New property.
15210 (LabeledStatement.Resolve): Set it to true here.
15212 * statement.cs (Return.Emit): Return success even after reporting
15213 a type mismatch error (CS0126 or CS0127), this is what csc does and
15214 it avoids confusing the users with any consecutive errors.
15216 2002-08-05 Martin Baulig <martin@gnome.org>
15218 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15220 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15222 * expression.cs (MemberAccess.DoResolve): Silently return if an
15223 error has already been reported.
15225 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15226 error has already been reported.
15228 2002-08-05 Martin Baulig <martin@gnome.org>
15230 * statement.cs (UsageVector): Only initialize the `parameters'
15231 vector if we actually have any "out" parameters.
15233 2002-08-05 Martin Baulig <martin@gnome.org>
15235 * expression.cs (Binary.ResolveOperator): When combining delegates,
15236 they must have the same type.
15238 2002-08-05 Martin Baulig <martin@gnome.org>
15240 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15241 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15242 work with the ms runtime and we also don't need it: if we're a
15243 PropertyBuilder and not in the `indexer_arguments' hash, then we
15244 are a property and not an indexer.
15246 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15247 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15248 since the latter one doesn't work with the ms runtime.
15250 2002-08-03 Martin Baulig <martin@gnome.org>
15252 Fixed bugs #27998 and #22735.
15254 * class.cs (Method.IsOperator): New public field.
15255 (Method.CheckBase): Report CS0111 if there's already a method
15256 with the same parameters in the current class. Report CS0508 when
15257 attempting to change the return type of an inherited method.
15258 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15259 and it's not marked abstract or extern.
15260 (PropertyBase): New abstract base class for Property and Indexer.
15261 (PropertyBase.CheckBase): Moved here from Property and made it work
15263 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15264 the same so we can reuse it there.
15265 (Property, Indexer): Derive from PropertyBase.
15266 (MethodSignature.inheritable_property_signature_filter): New delegate
15267 to find properties and indexers.
15269 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15270 argument and improved error reporting.
15272 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15273 EmptyReadOnlyParameters and made it a property.
15275 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15276 version of this method which takes a `PropertyInfo indexer'.
15277 (TypeManager.RegisterIndexer): New method.
15279 * class.cs: Added myself as author of this file :-)
15281 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15283 * class.cs: fixed compilation on windoze.
15285 2002-08-03 Martin Baulig <martin@gnome.org>
15287 * interface.cs (Interface.GetInterfaceBases): Check whether all
15288 base interfaces are at least as accessible than the current one.
15290 * class.cs (TypeContainer.GetClassBases): Check whether base types
15291 are at least as accessible than the current type.
15292 (TypeContainer.AsAccessible): Implemented and made non-static.
15293 (MemberBase.CheckParameters): Report errors if the accessibility
15296 * delegate.cs (Delegate.Delegate): The default visibility is
15297 internal for top-level types and private for nested types.
15298 (Delegate.Define): Report errors if the accessibility checks fail.
15300 * enum.cs (Enum.Enum): The default visibility is internal for
15301 top-level types and private for nested types.
15302 (Enum.DefineType): Compute the correct visibility.
15304 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15305 function which takes a `bool is_toplevel' instead of a TypeContainer.
15307 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15310 2002-08-02 Martin Baulig <martin@gnome.org>
15312 * expression.cs (LocalVariableReferenc): Added constructor which
15313 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15314 (LocalVariableReference.IsReadOnly): New property.
15315 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15316 variable is readonly, use our own readonly flag to do this; you can
15317 use the new constructor to get a writable reference to a read-only
15320 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15321 reference to the local variable.
15323 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15325 * rootcontext.cs (ResolveCore): Also include System.Exception
15327 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15328 we reach an EmptyStatement.
15330 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15333 * expression.cs (Binary.ResolveOperator): Check error result in
15336 use brtrue/brfalse directly and avoid compares to null.
15338 2002-08-02 Martin Baulig <martin@gnome.org>
15340 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15341 Fixes bug #28407, added test-155.cs.
15343 2002-08-01 Martin Baulig <martin@gnome.org>
15345 * class.cs (Event.EmitDefaultMethod): Make this work with static
15346 events. Fixes #28311, added verify-3.cs.
15348 2002-08-01 Martin Baulig <martin@gnome.org>
15350 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15351 `is_disposable' fields.
15352 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15353 `hm.is_disposable' if we're using the collection pattern.
15354 (Foreach.EmitCollectionForeach): Use the correct type for the
15355 enumerator's local variable, only emit the try/finally block if
15356 necessary (fixes #27713).
15358 2002-08-01 Martin Baulig <martin@gnome.org>
15360 * ecore.cs (Expression.report118): Renamed to Error118 and made
15363 * statement.cs (Throw.Resolve): Check whether the expression is of
15364 the correct type (CS0118) and whether the type derives from
15365 System.Exception (CS0155).
15366 (Catch.Resolve): New method. Do the type lookup here and check
15367 whether it derives from System.Exception (CS0155).
15368 (Catch.CatchType, Catch.IsGeneral): New public properties.
15370 * typemanager.cs (TypeManager.exception_type): Added.
15372 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15374 * driver.cs: Updated About function.
15376 2002-07-31 Martin Baulig <martin@gnome.org>
15378 Implemented Control Flow Analysis.
15380 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15381 (EmitContext.CurrentBranching): Added.
15382 (EmitContext.StartFlowBranching): Added.
15383 (EmitContext.EndFlowBranching): Added.
15384 (EmitContext.KillFlowBranching): Added.
15385 (EmitContext.IsVariableAssigned): Added.
15386 (EmitContext.SetVariableAssigned): Added.
15387 (EmitContext.IsParameterAssigned): Added.
15388 (EmitContext.SetParameterAssigned): Added.
15389 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15390 Added control flow analysis stuff here.
15392 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15393 resolve the expression as lvalue.
15394 (LocalVariableReference.DoResolve): Check whether the variable has
15395 already been assigned.
15396 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15397 the parameter as assigned here.
15398 (ParameterReference.DoResolve): Check whether the parameter has already
15400 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15401 expression as lvalue.
15403 * statement.cs (FlowBranching): New class for the flow analysis code.
15404 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15405 (LabeledStatement.IsDefined): New public property.
15406 (LabeledStatement.AddUsageVector): New public method to tell flow
15407 analyis that the label may be reached via a forward jump.
15408 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15410 (VariableInfo.Number): New public field. This is used by flow analysis
15411 to number all locals of a block.
15412 (Block.CountVariables): New public property. This is the number of
15413 local variables in this block (including the locals from all parent
15415 (Block.EmitMeta): Number all the variables.
15417 * statement.cs: Added flow analysis support to all classes.
15419 2002-07-31 Martin Baulig <martin@gnome.org>
15421 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15422 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15423 then use this argument.
15425 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15427 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15428 use this to specify /define options.
15430 2002-07-29 Martin Baulig <martin@gnome.org>
15432 * statement.cs (Fixed): Moved all code that does variable lookups
15433 and resolvings from Emit to Resolve.
15435 * statement.cs (For): Moved all code that does variable lookups
15436 and resolvings from Emit to Resolve.
15438 * statement.cs (Using): Moved all code that does variable lookups
15439 and resolvings from Emit to Resolve.
15441 2002-07-29 Martin Baulig <martin@gnome.org>
15443 * attribute.cs (Attribute.Resolve): Explicitly catch a
15444 System.NullReferenceException when creating the
15445 CustromAttributeBuilder and report a different warning message.
15447 2002-07-29 Martin Baulig <martin@gnome.org>
15449 * support.cs (ParameterData.ParameterName): Added method to
15450 get the name of a parameter.
15452 * typemanager.cs (TypeManager.IsValueType): New public method.
15454 2002-07-29 Martin Baulig <martin@gnome.org>
15456 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
15457 is a flag which specifies that it's either ref or out.
15458 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15459 the out parameter to `out Parameter.Modifier mod', also set the
15460 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15462 * support.cs (InternalParameters.ParameterModifier): Distinguish
15463 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15464 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15466 * expression.cs (Argument.GetParameterModifier): Distinguish
15467 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15468 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15470 2002-07-29 Martin Baulig <martin@gnome.org>
15472 * expression.cs (ParameterReference.ParameterReference): Added
15473 `Location loc' argument to the constructor.
15475 * cs-parser.jay: Pass location to ParameterReference.
15477 2002-07-28 Miguel de Icaza <miguel@ximian.com>
15479 * statement.cs (Try): Initialize the location.
15481 * cs-parser.jay: pass location to Try.
15483 * expression.cs (Unary.Reduce): Change the prototype to return
15484 whether a constant fold could be performed or not. The result is
15485 returned in an out parameters. In the case of Indirection and
15486 AddressOf, we want to perform the full tests.
15488 2002-07-26 Miguel de Icaza <miguel@ximian.com>
15490 * statement.cs (Statement.Emit): Flag dead code.
15492 2002-07-27 Andrew Birkett <andy@nobugs.org>
15494 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15496 2002-07-27 Martin Baulig <martin@gnome.org>
15498 * class.cs (MethodData.Define): Put back call to
15499 TypeManager.AddMethod(), accidentally commented this out.
15501 * report.cs (Debug): New public method to print debugging information,
15502 this is `[Conditional ("DEBUG")]'.
15504 2002-07-26 Martin Baulig <martin@gnome.org>
15506 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15507 (switch_statement): Push the current_block to the switch_stack and
15508 pop it again when we're done with the switch.
15509 (switch_section): The new block is a child of the current_block.
15510 Fixes bug #24007, added test-152.cs.
15512 2002-07-27 Martin Baulig <martin@gnome.org>
15514 * expression.cs (Invocation.EmitArguments): When calling a varargs
15515 function with only its fixed arguments, we need to pass an empty
15518 2002-07-27 Martin Baulig <martin@gnome.org>
15520 Mono 0.13 has been released.
15522 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15524 * driver.cs: Rename --resource to --linkres, because that is what
15525 we do currently, we dont support --resource yet.
15527 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15529 2002-07-25 Martin Baulig <martin@gnome.org>
15531 * class.cs (MethodData): New public class. This is a `method builder'
15532 class for a method or one accessor of a Property/Indexer/Event.
15533 (MethodData.GetMethodFlags): Moved here from MemberBase.
15534 (MethodData.ApplyAttributes): Likewise.
15535 (MethodData.ApplyObsoleteAttribute): Likewise.
15536 (MethodData.ApplyConditionalAttribute): Likewise.
15537 (MethodData.ApplyDllImportAttribute): Likewise.
15538 (MethodData.CheckAbstractAndExternal): Likewise.
15539 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15540 (MethodData.Emit): Formerly known as Method.Emit().
15541 (MemberBase): Moved everything which was specific to a single
15542 accessor/method to MethodData.
15543 (Method): Create a new MethodData and call Define() and Emit() on it.
15544 (Property, Indexer, Event): Create a new MethodData objects for each
15545 accessor and call Define() and Emit() on them.
15547 2002-07-25 Martin Baulig <martin@gnome.org>
15549 Made MethodCore derive from MemberBase to reuse the code from there.
15550 MemberBase now also checks for attributes.
15552 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15553 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15555 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15556 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15557 (MemberBase.ApplyAttributes): New virtual method; applies the
15558 attributes to a method or accessor.
15559 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15560 (MemberBase.ApplyConditionalAttribute): Likewise.
15561 (MemberBase.ApplyDllImportAttribute): Likewise.
15562 (MemberBase.CheckAbstractAndExternal): Likewise.
15563 (MethodCore.ParameterTypes): This is now a property instead of a
15564 method, it's initialized from DoDefineParameters().
15565 (MethodCore.ParameterInfo): Removed the set accessor.
15566 (MethodCore.DoDefineParameters): New protected virtual method to
15567 initialize ParameterTypes and ParameterInfo.
15568 (Method.GetReturnType): We can now simply return the MemberType.
15569 (Method.GetMethodFlags): Override the MemberBase version and add
15570 the conditional flags.
15571 (Method.CheckBase): Moved some code from Define() here, call
15572 DoDefineParameters() here.
15573 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15574 here to avoid some larger code duplication.
15575 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15576 ensure that abstract and external accessors don't declare a body.
15578 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15579 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15580 lookup in the attribute's parent classes, so we need to abort as soon
15581 as we found the first match.
15582 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15583 the attribute has no arguments.
15585 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15588 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15590 * cs-parser.jay: reverted previous patch.
15592 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15594 * cs-parser.jay: fixed bug #22119.
15596 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15598 * attribute.cs: fixed compilation. The error was:
15599 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
15600 be assigned to before control leaves the current method."
15601 [FIXME: Filed as bug #28186: MCS must report this error.]
15603 2002-07-25 Martin Baulig <martin@gnome.org>
15605 * attribute.cs (Attribute.Conditional_GetConditionName): New static
15606 method to pull the condition name ouf of a Conditional attribute.
15607 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15608 the obsolete message and error flag out of an Obsolete attribute.
15610 * class.cs (Method.GetMethodFlags): New public method to get the
15611 TypeManager.MethodFlags for this method.
15612 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15614 (Method.Define): Get and apply the Obsolete and Conditional attributes;
15615 if we're overriding a virtual function, set the new private variable
15616 `parent_method'; call the new TypeManager.AddMethod().
15618 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
15619 the MethodBuilder and the Method in a PtrHashtable.
15620 (TypeManager.builder_to_method): Added for this purpose.
15621 (TypeManager.MethodFlags): Added IsObsoleteError.
15622 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
15623 Obsolete and Conditional arguments in MethodBuilders. If we discover
15624 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15625 the message from the attribute.
15627 2002-07-24 Martin Baulig <martin@gnome.org>
15629 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15630 preprocessor directives, ensure that the argument to #define/#undef is
15631 exactly one identifier and that it's actually an identifier.
15633 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15636 2002-07-24 Martin Baulig <martin@gnome.org>
15638 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15639 initialize it to TypeManager.object_type in the constructor.
15640 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15641 of the `hm.get_current' method if we're using the collection pattern.
15642 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15643 for the explicit conversion to make it work when we're using the collection
15644 pattern and the `Current' property has a different return type than `object'.
15647 2002-07-24 Martin Baulig <martin@gnome.org>
15649 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15650 does not match, but don't report any errors. This method is called in
15651 order for all methods in a MethodGroupExpr until a matching method is
15652 found, so we don't want to bail out if the first method doesn't match.
15653 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15654 matches, report the 123. Fixes #28070.
15656 2002-07-24 Martin Baulig <martin@gnome.org>
15658 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15659 TypeManager.TypeToCoreType() to the top of the method so the
15660 following equality checks will work. Fixes #28107.
15662 2002-07-24 Martin Baulig <martin@gnome.org>
15664 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15665 operand is of type uint, and the other operand is of type sbyte,
15666 short or int, the operands are converted to type long." -
15667 Actually do what this comment already told us. Fixes bug #28106,
15670 2002-07-24 Martin Baulig <martin@gnome.org>
15672 * class.cs (MethodBase): New abstract class. This is now a base
15673 class for Property, Indexer and Event to avoid some code duplication
15674 in their Define() and DefineMethods() methods.
15675 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15676 generic methods for Define() and DefineMethods().
15677 (FieldBase): Derive from MemberBase, not MemberCore.
15678 (Property): Derive from MemberBase, not MemberCore.
15679 (Property.DefineMethod): Moved all the code from this method to the
15680 new MethodBase.DefineAccessor(), just call it with appropriate
15682 (Property.Define): Call the new Property.DoDefine(), this does some
15683 sanity checks and we don't need to duplicate the code everywhere.
15684 (Event): Derive from MemberBase, not MemberCore.
15685 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15686 accessors, this will also make them work with interface events.
15687 (Indexer): Derive from MemberBase, not MemberCore.
15688 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15689 (Indexer.Define): Use the new MethodBase functions.
15691 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15692 argument to the constructor.
15693 (Interface.FindMembers): Added support for interface events.
15694 (Interface.PopluateEvent): Implemented.
15696 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
15698 2002-07-22 Miguel de Icaza <miguel@ximian.com>
15700 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15701 but this is required to check for a method name being the same as
15702 the containing class.
15706 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15708 * interface.cs: initialize variable.
15710 2002-07-23 Martin Baulig <martin@gnome.org>
15712 Implemented the IndexerName attribute in interfaces.
15714 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15715 name if this is an explicit interface implementation.
15716 (Indexer.InterfaceIndexerName): New public variable. If we're
15717 implementing an interface indexer, this is the IndexerName in that
15718 interface. Otherwise, it's the IndexerName.
15719 (Indexer.DefineMethod): If we're implementing interface indexer,
15720 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
15721 and Pending.ImplementIndexer methods.
15722 (Indexer.Define): Also define the PropertyBuilder if we're
15723 implementing an interface indexer and this is neither an explicit
15724 interface implementation nor do the IndexerName match the one in
15727 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15728 If a method is defined here, then we always need to create a proxy
15729 for it. This is used when implementing interface indexers.
15730 (Pending.IsInterfaceIndexer): New public method.
15731 (Pending.ImplementIndexer): New public method.
15732 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15733 This is used when implementing interface indexers to define a proxy
15735 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15736 define a proxy if necessary.
15738 * interface.cs (Interface.IndexerName): New public variable.
15739 (Interface.PopulateIndexer): Set the IndexerName.
15740 (Interface.DefineIndexers): New private method. Populate all the
15741 indexers and make sure their IndexerNames match.
15743 * typemanager.cs (IndexerPropertyName): Added support for interface
15746 2002-07-22 Martin Baulig <martin@gnome.org>
15748 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15749 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15750 ret if HasReturnLabel.
15751 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15754 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15755 and set the ec.LoopBeginTryCatchLevel.
15756 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15757 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15758 the current ec.TryCatchLevel, the branch goes out of an exception
15759 block. In this case, we need to use Leave and not Br.
15761 2002-07-22 Martin Baulig <martin@gnome.org>
15763 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15764 block unless the block does not always return or it is contained in
15765 another try { ... } catch { ... } block. Fixes bug #26506.
15766 Added verify-1.cs to the test suite.
15768 2002-07-22 Martin Baulig <martin@gnome.org>
15770 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15771 then we do not always return. Fixes bug #24985.
15773 2002-07-22 Martin Baulig <martin@gnome.org>
15775 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15776 lookup on a per-class level; ie. walk up the class hierarchy until we
15777 found at least one applicable method, then choose the best among them.
15778 Fixes bug #24463 and test-29.cs.
15780 2002-07-22 Martin Baulig <martin@gnome.org>
15782 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15783 return types of the methods. The return type is not part of the
15784 signature and we must not check it to make the `new' modifier work.
15785 Fixes bug #27999, also added test-147.cs.
15786 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15788 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15789 on the method's return type.
15791 2002-07-21 Martin Baulig <martin@gnome.org>
15793 * assign.cs: Make this work if the rightmost source is a constant and
15794 we need to do an implicit type conversion. Also adding a few more tests
15795 to test-38.cs which should have caught this.
15797 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15798 target in the makefile for this. The makefile.gnu is primarily intended
15799 for end-users who don't want to debug the compiler.
15801 2002-07-21 Martin Baulig <martin@gnome.org>
15803 * assign.cs: Improved the Assign class so it can now handle embedded
15804 assignments (X = Y = Z = something). As a side-effect this'll now also
15805 consume less local variables. test-38.cs now passes with MCS, added
15806 a few new test cases to that test.
15808 2002-07-20 Martin Baulig <martin@gnome.org>
15810 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15811 instructions. Fixes bug #27977, also added test-146.cs.
15813 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15815 * cs-tokenizer.cs: fixed getHex ().
15817 2002-07-19 Martin Baulig <martin@gnome.org>
15819 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15820 not Type.GetType() to lookup the array type. This is needed when
15821 we're constructing an array of a user-defined type.
15822 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15823 single-dimensional arrays, but also for single-dimensial arrays of
15826 2002-07-19 Martin Baulig <martin@gnome.org>
15828 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15829 this function is called, it's not allowed to share LocalBuilders
15830 among ILGenerators.
15832 2002-07-19 Martin Baulig <martin@gnome.org>
15834 * expression.cs (Argument.Resolve): Report an error 118 when trying
15835 to pass a type as argument.
15837 2002-07-18 Martin Baulig <martin@gnome.org>
15839 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15840 Conv_R_Un for the signed `long' type.
15842 2002-07-15 Miguel de Icaza <miguel@ximian.com>
15844 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15845 `expr' for the temporary result, as that will fail if we do
15846 multiple resolves on the same expression.
15848 2002-07-05 Miguel de Icaza <miguel@ximian.com>
15850 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15851 ec.TypeContainer for looking up aliases.
15853 * class.cs (TypeContainer): Remove LookupAlias from here.
15855 * decl.cs (DeclSpace); Move here.
15857 2002-07-01 Miguel de Icaza <miguel@ximian.com>
15859 * class.cs (FindMembers): Only call filter if the constructor
15860 bulider is not null.
15862 Also handle delegates in `NestedTypes' now. Now we will perform
15863 type lookups using the standard resolution process. This also
15866 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15867 This uses Expressions (the limited kind that can be parsed by the
15868 tree) instead of strings.
15870 * expression.cs (ComposedCast.ToString): Implement, used to flag
15871 errors since now we have to render expressions.
15873 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
15876 * ecore.cs (SimpleName.ToString): ditto.
15878 * cs-parser.jay: Instead of using strings to assemble types, use
15879 Expressions to assemble the type (using SimpleName, ComposedCast,
15880 MemberAccess). This should fix the type lookups in declarations,
15881 because we were using a different code path for this.
15883 * statement.cs (Block.Resolve): Continue processing statements
15884 even when there is an error.
15886 2002-07-17 Miguel de Icaza <miguel@ximian.com>
15888 * class.cs (Event.Define): Also remove the `remove' method from
15889 the list of pending items.
15891 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15892 generate more compact code.
15894 2002-07-17 Martin Baulig <martin@gnome.org>
15896 * const.cs (Const.LookupConstantValue): Add support for constant
15897 `unchecked' and `checked' expressions.
15898 Also adding test case test-140.cs for this.
15900 2002-07-17 Martin Baulig <martin@gnome.org>
15902 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15903 check whether mi.ReturnType implements the IEnumerator interface; the
15904 `==' and the IsAssignableFrom() will fail in this situation.
15906 2002-07-16 Ravi Pratap <ravi@ximian.com>
15908 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
15911 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15913 * expression.cs: fixed bug #27811.
15915 2002-07-14 Miguel de Icaza <miguel@ximian.com>
15917 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15918 Molaro: when we are a ref, the value already contains a pointer
15919 value, do not take the address of it.
15921 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15922 * removed mb-parser.jay and mb-tokenizer.cs
15924 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15926 * expression.cs: check against the building corlib void type.
15928 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15930 * ecore.cs: fix for valuetype static readonly fields: when
15931 initializing them, we need their address, not the address of a copy.
15933 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15935 * typemanager.cs: register also enum_type in corlib.
15937 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15939 * class.cs: allow calling this (but not base) initializers in structs.
15941 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15943 * ecore.cs: make sure we compare against the building base types
15946 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15948 * typemanager.cs: fix TypeToCoreType() to handle void and object
15949 (corlib gets no more typerefs after this change).
15951 2002-07-12 Miguel de Icaza <miguel@ximian.com>
15953 * expression.cs (ArrayCreation.EmitArrayArguments): use
15954 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15956 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15957 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
15958 array indexes, the runtime actually forbids them.
15960 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15961 for array arguments here.
15963 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15964 instead of the default for ValueTypes.
15966 (New.DoEmit): Use IsValueType instead of
15967 IsSubclassOf (value_type)
15968 (New.DoResolve): ditto.
15969 (Invocation.EmitCall): ditto.
15971 * assign.cs (Assign): ditto.
15973 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15974 Statements *are* currently doing part of their resolution during
15977 Expressions do always resolve during resolve, but statements are
15978 only required to propagate resolution to their children.
15980 2002-07-11 Miguel de Icaza <miguel@ximian.com>
15982 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15984 (LoadAssembly): Do not add the dll if it is already specified
15986 (MainDriver): Add the System directory to the link path at the end,
15987 after all the other -L arguments.
15989 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15990 wrong opcode for loading bytes and bools (ldelem.i1 instead of
15991 ldelem.u1) and using the opposite for sbytes.
15993 This fixes Digger, and we can finally run it.
15995 * driver.cs (UnixParseOption): Move the option parsing here.
15996 (CSCParseOption): Implement CSC-like parsing of options.
15998 We now support both modes of operation, the old Unix way, and the
15999 new CSC-like way. This should help those who wanted to make cross
16000 platform makefiles.
16002 The only thing broken is that /r:, /reference: and /lib: are not
16003 implemented, because I want to make those have the same semantics
16004 as the CSC compiler has, and kill once and for all the confussion
16005 around this. Will be doing this tomorrow.
16007 * statement.cs (Unsafe.Resolve): The state is checked during
16008 resolve, not emit, so we have to set the flags for IsUnsfe here.
16010 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16012 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16013 not catch the Error_ObjectRefRequired in SimpleName (as it is
16014 possible to have a class/instance variable name that later gets
16015 deambiguated), we have to check this here.
16017 2002-07-10 Ravi Pratap <ravi@ximian.com>
16019 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16020 make static and put into Expression.
16022 (Event.Define): Register the private field of the event with the
16023 TypeManager so that GetFieldFromEvent can get at it.
16025 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16026 keep track of the private field associated with an event which
16029 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16032 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16034 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16036 * expression.cs (Binary.EmitBranchable): this routine emits the
16037 Binary expression in a branchable context. This basically means:
16038 we need to branch somewhere, not just get the value on the stack.
16040 This works together with Statement.EmitBoolExpression.
16042 * statement.cs (Statement.EmitBoolExpression): Use
16045 2002-07-09 Miguel de Icaza <miguel@ximian.com>
16047 * statement.cs (For): Reduce the number of jumps in loops.
16049 (For): Implement loop inversion for the For statement.
16051 (Break): We can be breaking out of a Try/Catch controlled section
16052 (foreach might have an implicit try/catch clause), so we need to
16053 use Leave instead of Br.
16055 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16056 now). If the instace expression supports IMemoryLocation, we use
16057 the AddressOf method from the IMemoryLocation to extract the
16058 address instead of emitting the instance.
16060 This showed up with `This', as we were emitting the instance
16061 always (Emit) instead of the Address of This. Particularly
16062 interesting when This is a value type, as we dont want the Emit
16063 effect (which was to load the object).
16065 2002-07-08 Miguel de Icaza <miguel@ximian.com>
16067 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16069 * statement.cs (Checked): Set the CheckedState during the resolve
16070 process too, as the ConvCast operations track the checked state on
16071 the resolve process, and not emit.
16073 * cs-parser.jay (namespace_member_declaration): Flag that we have
16074 found a declaration when we do. This is used to flag error 1529
16076 * driver.cs: Report ok when we display the help only.
16078 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
16080 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16082 2002-07-04 Miguel de Icaza <miguel@ximian.com>
16084 * cs-tokenizer.cs (define): We also have to track locally the
16085 defines. AllDefines is just used for the Conditional Attribute,
16086 but we also need the local defines for the current source code.
16088 2002-07-03 Miguel de Icaza <miguel@ximian.com>
16090 * statement.cs (While, For, Do): These loops can exit through a
16091 Break statement, use this information to tell whether the
16092 statement is the last piece of code.
16094 (Break): Flag that we break.
16096 * codegen.cs (EmitContexts): New `Breaks' state variable.
16098 2002-07-03 Martin Baulig <martin@gnome.org>
16100 * class.cs (TypeContainer.MethodModifiersValid): Allow override
16101 modifiers in method declarations in structs. Otherwise, you won't
16102 be able to override things like Object.Equals().
16104 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16106 * class.cs (Method, Property, Indexer): Do not allow the public
16107 modifier to be used in explicit interface implementations.
16109 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16110 override modifiers in method declarations in structs
16112 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16114 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16115 integer or real overflow, report an error
16117 2002-07-02 Martin Baulig <martin@gnome.org>
16119 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16120 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16121 to tell the runtime about our newly created System.Object and
16122 System.ValueType types.
16124 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16126 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16127 struct instead of Ldarg/Starg.
16129 2002-07-02 Martin Baulig <martin@gnome.org>
16131 * expression.cs (Indirection.Indirection): Call
16132 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16134 2002-07-02 Martin Baulig <martin@gnome.org>
16136 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16137 ValueType, call TypeManager.TypeToCoreType() on it.
16138 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16139 the OpCodes.Newarr argument.
16141 2002-07-02 Martin Baulig <martin@gnome.org>
16143 * expression.cs (Invocation.EmitCall): When compiling corlib,
16144 replace all calls to the system's System.Array type to calls to
16145 the newly created one.
16147 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16148 System.Array methods.
16149 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16150 from the system's System.Array type which must be replaced.
16152 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16154 * typemanager.cs: load unverifiable_code_ctor so we can build
16155 corlib using the correct type. Avoid using GetTypeCode() with
16157 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16158 TypeManager.object_type to allow building corlib.
16160 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16162 * ecore.cs: handle System.Enum separately in LoadFromPtr().
16164 2002-07-01 Martin Baulig <martin@gnome.org>
16166 * class.cs: Make the last change actually work, we need to check
16167 whether `ifaces != null' to avoid a crash.
16169 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16171 * class.cs: when we build structs without fields that implement
16172 interfaces, we need to add the interfaces separately, since there is
16173 no API to both set the size and add the interfaces at type creation
16176 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16178 * expression.cs: the dimension arguments to the array constructors
16179 need to be converted if they are a long.
16181 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16183 * class.cs: don't emit ldarg.0 if there is no parent constructor
16184 (fixes showstopper for corlib).
16186 2002-06-29 Martin Baulig <martin@gnome.org>
16188 MCS now compiles corlib on GNU/Linux :-)
16190 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16191 ie. check for MethodImplOptions.InternalCall.
16193 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16194 and TypeManager.attribute_type are null, so we must explicitly check
16195 whether parent is not null to find out whether it's an attribute type.
16196 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16197 and SetBuilder, not only if the property is neither abstract nor external.
16198 This is necessary to set the MethodImplOptions on the accessor methods.
16199 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16200 SetBuilder, see Property.Emit().
16202 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16203 populate "System.Object", "System.ValueType" and "System.Attribute" since
16204 they've already been populated from BootCorlib_PopulateCoreTypes().
16206 2002-06-29 Martin Baulig <martin@gnome.org>
16208 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16209 is the NullLiteral, we also need to make sure that target_type is not
16212 2002-06-29 Martin Baulig <martin@gnome.org>
16214 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16215 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16216 before calling BootstrapCorlib_ResolveDelegate ().
16218 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16220 * statement.cs: fixed build-breaker. All tests passed ok.
16222 2002-06-27 Martin Baulig <martin@gnome.org>
16224 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16225 for System.Decimal when compiling corlib.
16227 2002-06-27 Martin Baulig <martin@gnome.org>
16229 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16230 switch blocks which contain nothing but a default clause.
16232 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16234 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16236 2002-06-27 Martin Baulig <martin@gnome.org>
16238 * ecore.cs (PropertyExpr.PropertyExpr): Call
16239 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16241 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16242 is already a TypeBuilder.
16244 2002-06-27 Martin Baulig <martin@gnome.org>
16246 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16247 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16248 the "from an array-type to System.Array" case. This makes it work
16249 when compiling corlib.
16251 2002-06-27 Martin Baulig <martin@gnome.org>
16253 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16254 non-static PropertyExpr, set its InstanceExpression. This makes
16255 the `ICollection.Count' property work in System/Array.cs.
16257 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16259 * driver.cs: Made error handling more consistent. Errors now
16260 tracked by Report class, so many methods which used to return int
16261 now return void. Main() now prints success/failure and
16262 errors/warnings message.
16264 Renamed '--probe' compiler argument to '--expect-error'. Removed
16265 the magic number return values (123 and 124). Now, if the
16266 expected error occurs, the compiler exits with success (exit value
16267 0). If the compilation completes without seeing that particular
16268 error, the compiler exits with failure (exit value 1). The
16269 makefile in mcs/errors has been changed to handle the new behaviour.
16271 * report.cs: Made 'expected error' number a property and renamed
16272 it from 'Probe' to 'ExpectedError'.
16274 * genericparser.cs: Removed error handling support, since it is
16275 now all done by Report class.
16277 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16278 class, so parse() no longer returns an int.
16280 * namespace.cs: Use Report.Error instead of GenericParser.error
16282 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16284 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16285 TypeContainer.AddOperator): At the front of the list put the
16286 explicit implementations, so they get resolved/defined first.
16288 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16290 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16291 interface type is implemented by this TypeContainer. Used during
16292 explicit interface implementation.
16294 (Property.Define, Indexer.Define, Method.Define): Validate that
16295 the given interface in the explicit implementation is one of the
16296 base classes for the containing type.
16298 Also if we are explicitly implementing an interface, but there is
16299 no match in the pending implementation table, report an error.
16301 (Property.Define): Only define the property if we are
16302 not explicitly implementing a property from an interface. Use the
16303 correct name also for those properties (the same CSC uses,
16304 although that is really not needed).
16306 (Property.Emit): Do not emit attributes for explicitly implemented
16307 properties, as there is no TypeBuilder.
16309 (Indexer.Emit): ditto.
16311 Hiding then means that we do not really *implement* a pending
16312 implementation, which makes code fail.
16314 2002-06-22 Martin Baulig <martin@gnome.org>
16316 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16317 the return value of Object.GetType(). [FIXME: we need to do this whenever
16318 we get a type back from the reflection library].
16320 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16322 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16324 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16326 * attribute.cs: Return null if we can not look up the type.
16328 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16329 the interface types found.
16331 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16332 interface types found.
16334 * typemanager.cs (GetInterfaces): Make this routine returns alll
16335 the interfaces and work around the lame differences between
16336 System.Type and System.Reflection.Emit.TypeBuilder in the results
16337 result for GetInterfaces.
16339 (ExpandInterfaces): Given an array of interface types, expand and
16340 eliminate repeated ocurrences of an interface. This expands in
16341 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16344 2002-06-21 Martin Baulig <martin@gnome.org>
16346 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16349 2002-06-21 Martin Baulig <martin@gnome.org>
16351 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16352 and called with one of the core types, return the corresponding typebuilder for
16355 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16358 2002-06-21 Martin Baulig <martin@gnome.org>
16360 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16361 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16362 (Expression.ConvertReferenceExplicit): Likewise.
16364 * expression.cs (ElementAccess.DoResolve): Likewise.
16365 (ElementAccess.DoResolveLValue): Likewise.
16367 2002-06-10 Martin Baulig <martin@gnome.org>
16369 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16370 add the "value" parameter to the parameter list.
16372 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16375 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16377 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16378 the argument to an int, uint, long or ulong, per the spec. Also
16379 catch negative constants in array creation.
16381 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16383 * class.cs: do not allow the same interface to appear twice in
16384 the definition list.
16386 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16388 * ecore.cs: don't use ldlen with System.Array.
16390 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16392 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16394 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16396 * modifiers.cs: produce correct field attributes for protected
16397 internal. Easy fix so miguel can work on ther harder stuff:-)
16399 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16401 * pending.cs: New file. Move the code from class.cs here.
16402 Support clearning the pending flag for all methods (when not doing
16403 explicit interface implementation).
16405 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16407 * rootcontext.cs: added a couple more types needed to bootstrap.
16409 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16411 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16412 constructor in the type, instead of any constructor in the type
16413 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16414 a bug in the Mono runtime when applying the params attribute).
16416 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16417 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16419 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16421 * expression.cs (Unary.ResolveOperator): Use TypeManager
16422 to resolve the type.
16424 2002-06-13 Ravi Pratap <ravi@ximian.com>
16426 * cs-parser.jay (enum_member_declaration): Pass in the attributes
16429 * enum.cs (AddEnumMember): Add support to store the attributes associated
16430 with each member too.
16432 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16433 field builders too - this takes care of the enum member case.
16435 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
16437 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16438 address-of operator on both value types and pointers.
16440 2002-06-10 Martin Baulig <martin@gnome.org>
16442 * interface.cs (Interface.PopulateIndexer): Add the indexer's
16443 PropertyBuilder to the `property_builders' list.
16445 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16446 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16447 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
16448 find any indexers which are inherited from an interface.
16450 2002-06-09 Martin Baulig <martin@gnome.org>
16452 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16453 the same type as the constant if necessary. There's also a test-130.cs
16456 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16458 * typemanager.cs (TypeManager.ChangeType): Previously known as
16459 Enum.ChangeEnumType().
16461 2002-06-09 Martin Baulig <martin@gnome.org>
16463 * expression.cs (Cast.TryReduce): Added support for consts.
16465 2002-06-08 Ravi Pratap <ravi@ximian.com>
16467 * class.cs (Accessor): Hold attributes information so we can pass
16470 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16471 Modify to pass in attributes attached to the methods.
16473 (add_accessor_declaration, remove_accessor_declaration): Ditto.
16475 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16476 to handle the Accessor kind :-)
16478 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16480 2002-06-08 Martin Baulig <martin@gnome.org>
16482 * expression.cs (Unary.TryReduceNegative): Added support for
16485 2002-06-08 Martin Baulig <martin@gnome.org>
16487 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16488 name can't be found in the `defined_names' - the caller will do a
16489 MemberLookup in this case and thus find methods in System.Enum
16490 such as Enum.IsDefined().
16492 2002-06-08 Martin Baulig <martin@gnome.org>
16494 * enum.cs (Enum.ChangeEnumType): This is a custom version of
16495 Convert.ChangeType() which works with TypeBuilder created types.
16496 (Enum.LookupEnumValue, Enum.Define): Use it here.
16498 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16499 `TypeBuilder.BaseType != null' check.
16500 (TypeContainer.FindMembers): Only lookup parent members if we
16501 actually have a parent.
16502 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16503 (ConstructorInitializer.Resolve): Likewise.
16505 * interface.cs (Interface.FindMembers): Added
16506 `TypeBuilder.BaseType != null' check.
16508 * rootcontext.cs (RootContext.ResolveCore): Added
16509 "System.Runtime.CompilerServices.IndexerNameAttribute" to
16510 classes_second_stage.
16512 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16513 debug_type and trace_type when compiling with --nostdlib.
16515 2002-06-07 Martin Baulig <martin@gnome.org>
16517 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16518 (AddField): Set it to true when adding a non-static field.
16519 (DefineType): Use `have_nonstatic_fields' to find out whether we
16520 have non-static fields, not `Fields != null'.
16522 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16524 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16525 dereferencing a null on the static-field code path)
16527 2002-05-30 Martin Baulig <martin@gnome.org>
16529 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16530 to take command line arguments. Use reflection to call the new
16531 custom `Initialize' function on the symbol writer and pass it the
16532 command line arguments.
16534 * driver.cs (--debug-args): New command line argument to pass command
16535 line arguments to the symbol writer.
16537 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16539 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16540 the target type for indexers and properties. Thanks to Joe for
16543 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16545 * typemanager.cs (MethodFlags): returns the method flags
16546 (Obsolete/ShouldIgnore) that control warning emission and whether
16547 the invocation should be made, or ignored.
16549 * expression.cs (Invocation.Emit): Remove previous hack, we should
16550 not do this on matching a base type, we should do this based on an attribute
16552 Only emit calls to System.Diagnostics.Debug and
16553 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16554 on the command line.
16556 * rootcontext.cs: Global settings for tracing and debugging.
16558 * cs-tokenizer.cs (define): New utility function to track
16559 defines. Set the global settings for TRACE and DEBUG if found.
16561 2002-05-25 Ravi Pratap <ravi@ximian.com>
16563 * interface.cs (Populate*): Pass in the TypeContainer as well as
16564 the DeclSpace as parameters so that we can create EmitContexts and
16565 then use that to apply attributes etc.
16567 (PopulateMethod, PopulateEvent, PopulateProperty)
16568 (PopulateIndexer): Apply attributes everywhere.
16570 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16573 (ApplyAttributes): Update accordingly.
16575 We now apply interface attributes for all members too.
16577 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16579 * class.cs (Indexer.Define); Correctly check if we are explicit
16580 implementation (instead of checking the Name for a ".", we
16581 directly look up if the InterfaceType was specified).
16583 Delay the creation of the PropertyBuilder.
16585 Only create the PropertyBuilder if we are not an explicit
16586 interface implementation. This means that explicit interface
16587 implementation members do not participate in regular function
16588 lookups, and hence fixes another major ambiguity problem in
16589 overload resolution (that was the visible effect).
16591 (DefineMethod): Return whether we are doing an interface
16594 * typemanager.cs: Temporary hack until we get attributes in
16595 interfaces (Ravi is working on that) and we get IndexerName
16596 support in interfaces.
16598 * interface.cs: Register the indexers as properties.
16600 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16601 warning, I have verified that this is a bug in the .NET runtime
16602 (JavaScript suffers of the same problem).
16604 * typemanager.cs (MemberLookup): When looking up members for
16605 interfaces, the parent of an interface is the implicit
16606 System.Object (so we succeed in searches of Object methods in an
16607 interface method invocation. Example: IEnumerable x; x.ToString
16610 2002-05-25 Miguel de Icaza <miguel@ximian.com>
16612 * class.cs (Event): Events should also register if they do
16613 implement the methods that an interface requires.
16615 * typemanager.cs (MemberLookup); use the new GetInterfaces
16618 (GetInterfaces): The code used to lookup interfaces for a type is
16619 used in more than one place, factor it here.
16621 * driver.cs: Track the errors at the bottom of the file, we kept
16624 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16625 instance if the method we are calling is static!
16627 2002-05-24 Miguel de Icaza <miguel@ximian.com>
16629 * attribute.cs (ApplyAttributes): Make this function filter out
16630 the IndexerName attribute (as that attribute in reality is never
16631 applied) and return the string constant for the IndexerName
16634 * class.cs (TypeContainer.Emit): Validate that all the indexers
16635 have the same IndexerName attribute, and if so, set the
16636 DefaultName attribute on the class.
16638 * typemanager.cs: The return value might contain other stuff (not
16639 only methods). For instance, consider a method with an "Item"
16640 property and an Item method.
16642 * class.cs: If there is a problem with the parameter types,
16645 2002-05-24 Ravi Pratap <ravi@ximian.com>
16647 * ecore.cs (ImplicitConversionExists): Wrapper function which also
16648 looks at user defined conversion after making a call to
16649 StandardConversionExists - we need this for overload resolution.
16651 * expression.cs : Update accordingly the various method calls.
16653 This fixes 2 bugs filed against implicit user defined conversions
16655 2002-05-22 Miguel de Icaza <miguel@ximian.com>
16657 * statement.cs: Track the result of the assignment.
16659 2002-05-21 Miguel de Icaza <miguel@ximian.com>
16661 * expression.cs (MemberAccess): Improved error reporting for
16662 inaccessible members.
16664 2002-05-22 Martin Baulig <martin@gnome.org>
16666 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
16667 itself with debugging support.
16669 2002-05-22 Martin Baulig <martin@gnome.org>
16671 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16672 Removed, this isn't needed anymore.
16674 2002-05-20 Martin Baulig <martin@gnome.org>
16676 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16677 be underlying type for an enum.
16679 2002-05-20 Miguel de Icaza <miguel@ximian.com>
16681 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16682 that splits out the loading of just the core types.
16684 * rootcontext.cs (ResolveCore): Split the struct resolution in
16685 two, so we can load the enumeration underlying types before any
16688 * expression.cs (Is): Bandaid until we fix properly Switch (see
16689 bug #24985 for details).
16691 * typemanager.cs (ImplementsInterface): The hashtable will contain
16692 a null if there are no interfaces implemented.
16694 2002-05-18 Miguel de Icaza <miguel@ximian.com>
16696 * cs-parser.jay (indexer_declarator): It is fine to have array
16699 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16701 * typemanager.cs: (RegisterBuilder): New function used to register
16702 TypeBuilders that implement interfaces. Since
16703 TypeBuilder.GetInterfaces (as usual) does not work with lame
16705 (AddUserType): register interfaces.
16707 (ImplementsInterface): Use the builder_to_ifaces hash if we are
16708 dealing with TypeBuilder. Also, arrays are showing up as
16709 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16710 methods can not be invoked on them!
16712 * ecore.cs (ExplicitReferenceConversionExists): Made public.
16713 (ImplicitReferenceConversionExists): Split out from
16714 StandardConversionExists.
16716 * expression.cs (As): We were only implementing one of the three
16717 cases for the as operator. We now implement them all.
16718 (Is): Implement the various other cases for Is as well.
16720 * typemanager.cs (CACHE): New define used to control if we want or
16721 not the FindMembers cache. Seems to have a negative impact on
16722 performance currently
16724 (MemberLookup): Nested types have full acess to
16725 enclosing type members
16727 Remove code that coped with instance/static returns for events, we
16728 now catch this in RealFindMembers.
16730 (RealFindMembers): only perform static lookup if the instance
16731 lookup did not return a type or an event.
16733 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16735 * assign.cs (CompoundAssign): We pass more semantic information
16736 now to Compound Assignments than we did before: now we have all
16737 the information at hand, and now we resolve the target *before* we
16738 do the expression expansion, which allows the "CacheValue" method
16739 to have the effect we intended (before, a [x] += 1 would generate
16740 two differen ArrayAccess expressions from the ElementAccess,
16741 during the resolution process).
16743 (CompoundAssign.DoResolve): Resolve target and original_source here.
16745 2002-05-16 Miguel de Icaza <miguel@ximian.com>
16747 * expression.cs (ArrayAccess): dropped debugging information.
16749 * typemanager.cs: Small bug fix: I was always returning i_members,
16750 instead of one of i_members or s_members (depending on which had
16753 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
16754 method is invoked before any code generation takes place, and it
16755 is a mechanism to inform that the expression will be invoked more
16756 than once, and that the method should use temporary values to
16757 avoid having side effects
16759 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16761 * ecore.cs (Expression.CacheTemporaries): Provide empty default
16764 * expression.cs (Indirection, ArrayAccess): Add support for
16765 CacheTemporaries in these two bad boys.
16767 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16768 ldobj or ldind_ref.
16769 (StoreFromPtr): Handle stobj as well.
16771 * expression.cs (UnaryMutator): Share more code.
16773 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16774 down: I was not tracking the Filter function as well, which
16775 was affecting the results of the cache.
16777 2002-05-15 Miguel de Icaza <miguel@ximian.com>
16779 * attribute.cs: Remove the hack to handle the CharSet property on
16782 2002-05-14 Miguel de Icaza <miguel@ximian.com>
16784 * attribute.cs (DoResolve): More uglyness, we now only try to
16785 resolve the attribute partially, to extract the CharSet
16786 information (only if we are a StructLayout attribute). Otherwise
16788 (GetExtraTypeInfo): Add some code to conditionally kill in the
16789 future this. I am more and more convinced that the .NET
16790 framework has special code to handle the attribute setting on
16793 * expression.cs (IsParamsMethodApplicable): Revert my previous
16794 foreach change here, it was wrong.
16796 2002-05-13 Miguel de Icaza <miguel@ximian.com>
16798 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16799 (pp_expr): do not abort on unknown input, just return.
16800 (eval): abort if there are pending chars.
16802 * attribute.cs (Attribute.Resolve): Positional parameters are
16803 optional. Deal with that case.
16805 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16806 the Ansi/Unicode/Auto information for the type.
16808 (TypeContainer.DefineType): instantiate the EmitContext here, as
16809 we will be using it during the type definition (to resolve
16810 attributes) and during the emit phase.
16812 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16813 to pull type information out of the attributes
16815 (Attribute.Resolve): track the constructor builder, and allow for
16816 multiple invocations (structs and classes will use this).
16818 * ecore.cs (MemberLookupFinal): new version with all the
16819 parameters customizable.
16821 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16822 constructors. Return if the result value is null (as the error
16823 would have been flagged already by MemberLookupFinal)
16825 Do not allow instances of abstract classes or interfaces to be
16828 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16829 We have to compare the assembly property here when dealing with
16830 FamANDAssem and Assembly access modifiers, because we might be
16831 creating an assembly from *modules* (that means that we are not
16832 getting TypeBuilders for types defined in other modules that are
16833 part of this assembly).
16835 (Method.Emit): If the method is marked abstract and has a body,
16838 (TypeContainer.DefineMembers): If both the defined member and the
16839 parent name match are methods, then do not emit any warnings: let
16840 the Method.Define routine take care of flagging warnings. But if
16841 there is a mismatch (method overrides something else, or method is
16842 overriwritten by something, then emit warning).
16844 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16845 set to null, this means `do not check for the return type on the
16848 (Method.Define): set the return type for the method signature to
16849 null, so that we get methods with the same name and parameters and
16850 different return types. This is used to flag warning 114 (you are
16851 hiding a method, and you probably want to use the new/override
16854 * typemanager.cs (MemberLookup): Implemented proper access
16855 control, closing a long standing set of bug reports. The problem
16856 was that the Framework only has two bits: Public and NonPublic,
16857 and NonPublic includes private and protected methods, but we need
16858 to enforce the FamANDAssem, FamOrAssem and Family.
16860 2002-05-11 Miguel de Icaza <miguel@ximian.com>
16862 * statement.cs (GotoCase): Return true: Ammounts to giving up
16863 knowledge on whether we return or not, and letting the other case
16864 be responsible for it.
16866 2002-05-10 Miguel de Icaza <miguel@ximian.com>
16868 * driver.cs: Do not load directories for each file processed, only
16869 do it if there is a pattern.
16871 * ecore.cs: Report readonly assigns here as well, as we might have
16872 been resolved only by MemberAccess.
16874 (SimpleName.SimpleNameResolve): Also be useful for LValue
16875 resolution. We need this to propagate assign to local readonly variables
16877 * typemanager.cs: Use a ptrhashtable for the criteria, because we
16878 do not want to reuse potential criteria memory.
16880 * class.cs (MyEventBuilder): Set reflected_type;
16882 * ecore.cs (Constantify): Added support for constifying bools.
16884 (RootContext.LookupType): Added a cache for values looked up in
16885 the declaration space.
16887 * typemanager.cs (FindMembers): Now is a front-end to
16888 RealFindMembers, and provides a two-level hashtable-based cache to
16891 15% performance improvement: from 22.5 to 19.2 seconds.
16893 * expression.cs (IsParamsMethodApplicable): use foreach.
16894 (Invocation.DoResolve): ditto.
16895 (New.DoResolve): ditto.
16896 (ArrayCreation.DoResolve): ditto.
16898 * ecore.cs (FindMostEncompassingType): use foreach.
16900 * delegate.cs (NewDelegate.DoResolve): Use foreach
16902 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16903 (RemoveMethods): use foreach.
16905 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16906 nested foreach statements instead of for, and also break out of
16907 the inner loop once a match is found.
16909 (Invocation.OverloadResolve): Use foreach, simplify the code.
16911 2002-05-08 Miguel de Icaza <miguel@ximian.com>
16913 * cfold.cs (BinaryFold): During an enumeration evaluation context,
16914 we actually unwrap the expression to allow for extra information
16917 * expression.cs: Use Shr_Un on unsigned operations.
16919 2002-05-08 Ravi Pratap <ravi@ximian.com>
16921 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
16922 applicable operators was not being considered correctly. This closes
16923 the bug Miguel reported.
16925 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16927 * attribute.cs: check that the type derives from System.Attribute
16928 and report the correct error in that case (moved the duplicate code to
16929 its own method, too).
16931 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16933 * attribute.cs: lookup attribute type name as the spec says: first the
16934 bare attribute name and then name + "Attribute" (nant compiles with
16935 mcs after this fix).
16937 2002-05-07 Miguel de Icaza <miguel@ximian.com>
16939 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
16940 Because of the way we parse things, we should try to see if a
16941 UIntConstant can fit in an integer.
16943 2002-05-07 Ravi Pratap <ravi@ximian.com>
16945 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16946 when we are in an explicit context.
16948 (ConvertReferenceExplicit): When converting from Iface type S to Class
16949 T make sure the rules are implemented as an OR.
16951 * parameter.cs (ParameterType): Make it a property for now although the
16952 purpose really isn't anything immediate.
16954 * expression.cs (Is*Applicable): Do better checking on the parameter type
16955 of a ref/out parameter. The ones from the system assemblies are already
16956 marked with the correct type so we don't need to do any correction.
16958 * ecore.cs (StandardConversionExists): Conversion from Interface types to
16959 the object type is standard too so include that.
16961 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16963 * ecore.cs (StandardConversionExists): Augment with missing code:
16964 deal with IntConstant, LongConstants and Enumerations.
16966 * assign.cs: Report the error, instead of failing silently
16968 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16969 typecontainer that they are declared, because the
16970 typecontainer/namespace will have the list of using clauses that
16971 need to be applied.
16973 Assembly Attributes were escaping the normal registration
16976 (EmitCode): Apply attributes within an EmitContext that represents
16977 the container they were declared on.
16979 * cs-parser.jay: Track bases for structs. How did I get this wrong?
16981 2002-05-06 Ravi Pratap <ravi@ximian.com>
16983 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16984 Revamp completely - make much cleaner as we now operate only
16987 (FindMostSpecificSource, FindMostSpecificTarget): New methods
16988 to implement the logic detailed in the spec more correctly.
16990 (UserDefinedConversion): Update accordingly.
16992 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16994 * statement.cs: Return flow analysis information up.
16996 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16999 (token): Do not consume an extra character before calling
17002 2002-05-06 Piers Haken <piersh@friskit.com>
17004 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17006 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17008 * class.cs (Constructor.Emit): Set the IsStatic flag in the
17009 EmitContext during the instance constructor initializer
17010 resolution, to stop access to instance variables.
17012 This is mandated by the spec, last paragraph of the `constructor
17013 initializers' section.
17015 2002-05-05 Miguel de Icaza <miguel@ximian.com>
17017 * cs-parser.jay, class.cs (Accessor): new class used to represent
17018 an accessor (get or set). In the past we used `null' to represent
17019 a missing accessor. But this is ambiguous because there was no
17020 way to tell in abstract indexers/properties if one of them was
17023 Now there is a way of addressing that.
17025 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17026 instead of FindMembers.
17028 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17029 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17031 * attribute.cs: Treat indexers and properties as the same in terms
17032 of applying attributes
17034 * ecore.cs (FindMostEncompassedType): Use statically initialized
17035 EmptyExpressions()s like we do elsewhere to avoid creating useless
17036 objects (and we take this out of the tight loop).
17038 (GetConversionOperators): Move the code to extract the actual
17039 operators to a separate routine to clean things up.
17041 2002-05-04 Miguel de Icaza <miguel@ximian.com>
17043 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17044 events are always registered FieldBuilders.
17046 * class.cs (FieldBase): New class shared by Fields
17048 * delegate.cs: If we are a toplevel delegate, use our full name.
17049 If we are a nested delegate, then only use our tail name.
17051 2002-05-02 Ravi Pratap <ravi@ximian.com>
17053 * expression.cs (IsApplicable): Ensure that we add the "&" to
17054 ref/out types before comparing it with the type of the argument.
17056 (IsParamsMethodApplicable): Ditto.
17058 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
17061 * delegate.cs : Handle the case when we have more than one applicable
17062 method. Flag an error only when we finish checking all.
17064 2002-05-02 Miguel de Icaza <miguel@ximian.com>
17066 * expression.cs: Add support for boolean static initializers.
17068 2002-05-01 Miguel de Icaza <miguel@ximian.com>
17070 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17072 * parameter.cs (ComputeParameterTypes,
17073 ComputeAndDefineParameterTypes): Better error handling: now we
17074 clear the `types' cache if we fail during any of the type lookups.
17075 We also return the status code correctly to our caller
17077 * delegate.cs: If we fail to define a delegate, abort the extra
17080 * expression.cs (Binary.ResolveOperator): for
17081 operator==(object,object) and operator !=(object, object) we also
17082 have to verify that there is an implicit conversion from one to
17085 (ArrayAccess.DoResolve): Array Access can operate on
17088 2002-04-30 Miguel de Icaza <miguel@ximian.com>
17090 * assign.cs (CompoundAssign): A new class used as a "flag" that
17091 the assignment actually is happening as part of a compound
17092 assignment operator.
17094 During compound assignment, a few new rules exist to enable things
17101 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17102 to the type of x) if y is implicitly convertible to the type of x,
17103 and the operator is a builtin operator and the return type of the
17104 operator is explicitly convertible to the type of x.
17106 * rootcontext.cs: Reset warning level to 2. 4 catches various
17107 "interesting" features in mcs, we must clean this up at some
17108 point, but currently am trying to kill other bugs ;-)
17110 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17111 in container classes as well.
17113 * expression.cs (Binary.ResolveOperator): Handle string case
17114 before anything else (as operator overloading does emit an error
17115 before doing anything else).
17117 This code could go away when we move to a table driven model, but
17118 i could not come up with a good plan last night.
17120 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17122 * typemanager.cs (CSharpName): reimplementation using regex.
17123 * class.cs: added null check for fields in Emit
17124 * rootcontext.cs: set warninglevel to 4
17126 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17128 * typemanager.cs (CSharpName): reimplemented with Lupus
17131 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17133 * statement.cs (If): correclty implement Resolve, because we were
17134 not catching sem errors in there. The same process is needed
17136 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17139 (Statement.Warning_DeadCodeFound): Factorize code.
17140 (While): Report dead code here too.
17142 (Statement): Added Resolve virtual method to allow
17143 for resolution split from the emit code.
17145 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17147 * statement.cs (EmitBoolExpression): No longer try to resolve the
17149 (MakeBoolean): New utility function that resolve, implicitly
17150 converts to boolean and tags the expression.
17153 (If, Do): Implement dead code elimination.
17154 (While): Implement loop inversion
17156 (Do, While, For, If): Resolve the expression prior to calling our
17159 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
17162 - added method Report28 (warning: program has more than one entry point)
17163 - added method IsEntryPoint, implements paragraph 10.1 of the spec
17164 - modified method Method.Define, the part at the end of the method
17166 * rootcontext.cs: added static public Location EntryPointLocation;
17168 * ../errors/cs0028.cs : Add test case for the above warning.
17171 - modified method CSharpName to allow arrays of primitive type to
17172 be printed nicely (e.g. instead of System.Int32[][] it now prints
17174 - added method CSharpSignature: returns the signature of a method
17175 in string format to be used in reporting errors, warnings, etc.
17177 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17180 2002-04-26 Ravi Pratap <ravi@ximian.com>
17182 * delegate.cs (Define): Fix extremely silly bug where I was
17183 setting the type of the 'object' parameter of the BeginInvoke
17184 method to System.IAsyncResult instead of System.Object ;-)
17186 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17188 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17191 (Constructor.Emit): return if we fail to initialize the
17192 constructor. Another door closed!
17194 * expression.cs (New.DoResolve): Improve error message (from -6 to
17195 1501). Use DeclaredOnly lookup to find the exact constructor.
17197 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17198 loop. This is useful.
17200 * cs-parser.jay: Adjust the default parameters so that destructors
17201 have the proper signature.
17203 2002-04-26 Martin Baulig <martin@gnome.org>
17205 * driver.cs (LoadAssembly): If `assembly' contains any characters
17206 which are only valid in path names and not in assembly names
17207 (currently slash, backslash and point), use Assembly.LoadFrom ()
17208 instead of Assembly.Load () on the `assembly' (before iteration
17209 over the link_paths).
17211 2002-04-26 Martin Baulig <martin@gnome.org>
17213 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17215 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17217 * class.cs (Property): use the new typemanager.MemberLookup
17219 (TypeContainer.MemberLookup): Implement using the
17220 TypeManager.MemberLookup now.
17222 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17223 and return MemberInfos, so that these can be used without an
17224 EmitContext (what we had before).
17226 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17228 * expression.cs: Fix the case where the argument to params if the
17229 type of the params. I omitted handling this before. Fixed
17231 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17233 * driver.cs: Call BootCorlib_PopulateCoreType
17235 * class.cs (Property.CheckBase): Check for properties only, not
17238 * interface.cs: Temporary hack: try/catch around the
17239 CustomAttributeBuilder, because I am getting an exception that I
17242 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17243 types whose definitions are required to be there (attributes are
17244 defined before standard types).
17246 Compute definitions as we boot the various types, as they are used
17247 immediately (value_type class will need object_type, but if we do
17248 not initialize object_type, we will pass a null, which will let
17249 the runtime pick the System.Object from the existing corlib, which
17250 is not what we want).
17252 2002-04-22 Patrik Torstensson <totte@labs2.com>
17254 * cs-tokenizer.cs: fixed a number of trim() issues.
17256 2002-04-22 Ravi Pratap <ravi@ximian.com>
17258 * expression.cs (Argument.Type): Ensure that we return the correct
17259 type when we have out or ref parameters [in which case we
17262 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17264 * class.cs (Property, Indexer): Allow extern modifier in there.
17266 * typemanager.cs (InitBaseTypes): Initializes object_type and
17267 value_type, since those will be used early on during the bootstrap
17268 process to compile corlib.
17270 (InitCoreTypes): Move code from here to InitBaseTypes.
17272 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17274 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17275 single-dimension arrays as using the ldlen opcode.
17277 Daniel Lewis discovered this optimization.
17279 * typemanager.cs: Add signature for System.Array::get_Length
17281 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17283 * statement.cs: report the error when the foreach does not apply to an
17284 array nor a collection.
17286 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17288 * expression.cs: Add implicit conversions to the operator ~.
17290 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17292 * typemanager.cs: Locate the decimal constructor.
17294 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17296 * attribute.cs: use the new property of TypeOf.
17297 * expression.cs: added 'get' property around typearg.
17299 These changes fix a build breaker reported by NickD. Is this the
17300 correct way to fix? If not, please, revert my changes and make it
17303 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17305 * attribute.cs: Add support for typeof in attribute invocations.
17306 I am not sure that this is right though.
17308 2002-04-14 Duncan Mak <duncan@ximian.com>
17310 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17311 Binary.Operator.Division case.
17313 2002-04-13 Ravi Pratap <ravi@ximian.com>
17315 * class.cs (DefineType): Ensure that we do a proper check on
17316 attribute types and also register it with the TypeManager.
17318 (TypeContainer.Targets): The default for attribute types is
17319 AttributeTargets.All.
17321 * attribute.cs (ApplyAttributes): Registering the attribute type
17322 is done elsewhere, not when we discover we have a Usage attribute.
17324 2002-04-12 Ravi Pratap <ravi@ximian.com>
17326 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17327 and get rid of is_delegate parameter.
17329 * everywhere : update.
17331 2002-04-12 Ravi Pratap <ravi@ximian.com>
17333 * cs-parser.jay (compilation_unit): Revamp completely to use
17334 some new ideas that I got from Rhys' grammar to solve the problems
17335 with assembly level attributes.
17337 (outer_declaration): New grammar production.
17339 (attribute_sections): Add.
17341 (opt_attributes): Base on attribute_sections
17343 (namespace_declaration): Allow opt_attributes to tackle the case
17344 when we have assembly level attributes - we are clever in this
17347 * attribute.cs (ApplyAttributes): Do not worry about assembly
17348 attributes in the non-global context.
17350 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17351 instead of SetGlobalAttributes.
17353 * class.cs, rootcontext.cs : Ensure we define and generate
17354 attribute types before anything else.
17356 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17357 and flag the new error -20 for the case when the attribute type
17358 does not have valid targets specified. csc does not catch this.
17360 * ../errors/errors.txt : update for error # -20
17362 2002-04-11 Ravi Pratap <ravi@ximian.com>
17364 * support.cs (InternalParameters.ParameterModifier): Do some null
17365 checking and return sane values.
17367 * class.cs (Method.Define): If we are a PInvoke method, ensure
17368 that we are static and extern. Report error # 601
17370 * ../errors/cs0601.cs : Add test case for the above error.
17372 2002-04-07 Ravi Pratap <ravi@ximian.com>
17374 * rootcontext.cs (attribute_types): We need to keep type of
17375 all attribute types separately and emit code for them first.
17377 (RegisterAttribute) : Implement.
17379 * class.cs (DefineType): Check if the current Type is a custom
17380 attribute type and register it accordingly.
17382 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17383 adding the first attribute twice and rename to
17385 (SetGlobalAttributes): this.
17387 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17390 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17391 if we are processing global arguments. Hmm, I am unsure of this.
17393 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17395 * expression.cs: added static array of strings to avoid calling
17396 Enum.ToString () for Operator in Binary. Significant recover of
17399 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17401 * class.cs (FindMembers): Allow the Builders of the various
17402 members to be null. If they are skip them. This only happens
17403 during the PInvoke declaration.
17405 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17407 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17408 failure, so we do not keep going afterwards.
17410 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17411 wanted to pass `false' as the `is_delegate' argument. If this is
17412 the case, why not use delegate_type == null to mean `is_delegate =
17413 false' and anything else as is_delegate = true.
17415 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17417 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17418 code for the section, not the beginning of the tests.
17420 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17422 * cfold.cs: Handle operator + (Enum x, Underlying x)
17424 * expression.cs (Binary): same. Warn about errors where we have
17425 Enum/Enum in operator + as well.
17427 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
17430 - added support for switch(bool)
17431 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17432 - add TableSwitchEmit() to handle table-based switch statements
17434 2002-04-05 Ravi Pratap <ravi@ximian.com>
17436 * expression.cs (Invocation.OverloadResolve): Factor out code which
17437 does parameter compatibility checking with arguments so that we can
17438 re-use the code even from Delegate.VerifyApplicability
17440 (VerifyArgumentsCompat): Move above code here.
17442 * delegate.cs (VerifyApplicability): Get rid of duplicate code
17443 and instead make a call to the above method.
17445 2002-03-31 Ravi Pratap <ravi@ximian.com>
17447 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17448 We use it to keep track of classes which are attribute types.
17450 2002-04-02 Miguel de Icaza <miguel@ximian.com>
17452 * delegate.cs (Delegate.Define): Correctly define the types in the
17453 presence of fixed and array parameters.
17455 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17458 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17459 include NonPublic after the first iteration.
17461 * class.cs (Indexer.CheckBase): Only check if both parents are
17464 * cs-parser.jay (accessor_body): If empty, set to null.
17466 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17467 same code path here to resolve constants names that we did have in
17468 MemberAccess.DoResolve. There is too much code duplicated here.
17470 2002-04-01 Miguel de Icaza <miguel@ximian.com>
17472 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17474 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17477 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17478 tokens, numbers and strings.
17480 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17483 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17484 asyncronous parameters and the regular parameters.
17486 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17487 specify the target directory.
17489 * expression.cs: (This.DoResolve): Simplify
17490 (As.Emit): Optimize, do not generate IsInst if the expression is
17491 always of the given type.
17493 (Is.DoResolve): Bug fix, we were reporting both always/never for
17496 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17497 creating too many unnecessary arrays.
17499 2002-03-31 Miguel de Icaza <miguel@ximian.com>
17501 * class.cs (EmitFieldInitializer): Use Assign expression to assign
17502 fields instead of rolling our own initializer. Takes care of all
17503 implicit conversions, and drops unnecessary static checks/argument.
17505 2002-03-31 Dick Porter <dick@ximian.com>
17507 * driver.cs: use the GetDirectories() return values properly, and
17508 use "/" as path separator.
17510 2002-03-30 Miguel de Icaza <miguel@ximian.com>
17512 * expression.cs (Unary): Optimize - - expr into expr.
17513 (Binary): Optimize a + (-b) into a -b.
17515 * codegen.cs (CodeGen): Made all methods static.
17517 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17521 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17522 TypeBuilder property.
17524 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17527 * tree.cs: Removed the various RecordXXXX, and replaced with a
17528 single RecordDecl. Removed all the accessor methods, and just
17529 left a single access point Type
17531 * enum.cs: Rename DefineEnum to DefineType.
17533 * decl.cs: New abstract method `DefineType' used to unify the
17534 Defines for Enumerations, Interfaces, TypeContainers and
17537 (FindType): Moved LookupInterfaceOrClass here. Moved the
17538 LookupBaseClasses method that used to live in class.cs and
17539 interface.cs here, and renamed to FindType.
17541 * delegate.cs: Implement DefineType. Take advantage of the
17542 refactored pattern for locating the parent builder without taking
17543 the parent_builder argument (which we know does not work if we are
17544 nested, and triggering a toplevel definition).
17546 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17548 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17549 accessibility of a member has changed during override and report
17552 * class.cs (Method.Define, Property.Define): Only complain on
17553 overrides if the method is private, any other accessibility is
17554 fine (and since we just checked the permission is the same, we are
17557 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17558 and elif are processed always. The other pre-processing
17559 directives are only processed if we are "taking" the path
17561 2002-03-29 Martin Baulig <martin@gnome.org>
17563 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17564 current location is not Null.
17566 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17567 a separate method so we can profile it.
17569 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17570 `span.Seconds' are just seconds, but no minutes or hours.
17571 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17573 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17575 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17576 Remove the gratuitous set of Final:
17578 // If an interface implementation, then we can set Final.
17579 if (((flags & MethodAttributes.Abstract) == 0) &&
17580 implementing.DeclaringType.IsInterface)
17581 flags |= MethodAttributes.Final;
17583 I do not know what I was smoking when I used that.
17586 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17587 step into fixing the name resolution issues for delegates and
17588 unifying the toplevel name resolution.
17590 2002-03-28 Martin Baulig <martin@gnome.org>
17592 * class.cs (Method.Emit): If we have a symbol writer, call its
17593 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17594 tell it about the current method.
17596 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17597 writer that we're going to emit the first byte of IL code for a new
17598 statement (a new source line).
17599 (EmitContext.EmitTopBlock): If we have a symbol writer, call
17600 EmitContext.Mark() before emitting any code.
17602 * location.cs (SymbolDocument): Return null when we're Null.
17604 * statement.cs (Statement): Moved the `Location loc' variable here.
17605 (Statement.EmitBoolExpression): If we have a symbol writer, call
17606 ec.Mark() before emitting any code to tell it that we're at the
17607 beginning of a new statement.
17608 (StatementExpression): Added `Location' argument to the constructor.
17609 (Block): Added public readonly variable `StartLocation' and public
17610 variable `EndLocation'. The latter is to be set using SetEndLocation().
17611 (Block): Added constructor which takes a start and end location.
17612 (Block.SetEndLocation): New method. This sets the end location.
17613 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17614 local variables we create.
17615 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17616 each statement and do also mark the begin and end of the block.
17618 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17619 tell it the current lexer.Location, use Location.Null for the end of the
17621 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17622 current block, set its end location using SetEndLocation().
17623 (statement_expression): StatementExpression constructor now takes the
17624 lexer.Location as additional argument.
17625 (for_statement, declare_local_variables): Likewise.
17626 (declare_local_variables): When creating a new implicit block, use the
17627 new Block constructor and pass it the lexer.Location.
17629 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17631 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17632 members also on the parent interfaces recursively.
17634 2002-03-27 Miguel de Icaza <miguel@ximian.com>
17636 * report.cs: Use new formats, since Gonzalo finished the missing
17639 * expression.cs (Binary.ResolveOperator): added missing operator|
17640 operator& and operator^ for bool/bool.
17642 * cs-parser.jay: CheckDef now takes a Location argument that is
17643 used to report errors more precisly (instead of reporting the end
17644 of a definition, we try to track something which is a lot closer
17645 to the source of the problem).
17647 * cs-tokenizer.cs: Track global token use, so we can properly flag
17648 the use of #define/#undef after the first token has been seen.
17650 Also, rename the reportXXXX to Error_DescriptiveName
17652 * decl.cs (DeclSpace.IsTopLevel): Move property here from
17653 TypeContainer, so that Enum and Interface can use this too.
17655 * class.cs (TypeContainer.LookupInterfaceOrClass,
17656 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17657 `builder' argument. Typically this was used to pass the parent
17658 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17661 The problem is that a nested class could trigger the definition of
17662 a toplevel class, and the builder would be obviously wrong in that
17665 So we drop this argument, and we compute dynamically the
17666 TypeBuilder/ModuleBuilder (the correct information was available
17667 to us anyways from DeclSpace.Parent)
17669 * interface.cs (Interface.DefineInterface): Drop builder
17670 parameter cleanup like class.cs
17672 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
17675 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17678 (Try.Emit): Propagate the returns value from the statement.
17680 (Return.Emit): Even if we are leavning
17682 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17684 * modifiers.cs: Fix the computation of MethodAttributes flags.
17686 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17688 * driver.cs: allow compilation of files that start with '/'.
17689 Add a default case when checking the argument of --target.
17691 2002-03-25 Miguel de Icaza <miguel@ximian.com>
17693 * interface.cs: Implement the same search algorithm for types in
17694 the interface code.
17696 * delegate.cs: Do not allow multiple definition.
17698 * Recovered ChangeLog that got accidentally amputated
17700 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17702 * rootcontext.cs: Load manually enum to allow core classes to
17703 contain enumerations.
17705 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17706 Update to new static methods in TypeManager.
17708 * typemanager.cs (GetMethod, GetConstructor): Use our
17709 implementation of FindMembers to find the members, since during
17710 corlib compilation, the types are TypeBuilders and GetMethod and
17711 GetConstructor do not work.
17713 Make all methods in TypeManager static.
17715 (InitCodeHelpers): Split the functionality from
17716 the InitCodeTypes function.
17718 * driver.cs: Call InitCodeHelpers after we have populated the
17721 * cs-parser.jay (delegate_declaration): we did not used to compute
17722 the delegate name correctly for void delegates.
17724 2002-03-24 Miguel de Icaza <miguel@ximian.com>
17726 * rootcontext.cs (RootContext): Init the interface_resolve_order
17727 and type_container_resolve_order always.
17729 (ResolveCore, BootstrapCorlib_ResolveClass,
17730 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17731 compiler when compiling with --nostdlib
17733 * class.cs (TypeContainer.DefineType): Check that our parent is
17734 not null. This test is most important when we are bootstraping
17737 * codegen.cs: Split out the symbol writing code.
17739 2002-03-25 Martin Baulig <martin@gnome.org>
17741 * driver.cs (-g): Made -g an alias for --debug.
17743 2002-03-24 Martin Baulig <martin@gnome.org>
17745 * codegen.cs (SymbolWriter): New public variable. Returns the
17746 current symbol writer.
17747 (CodeGen): Added `bool want_debugging_support' argument to the
17748 constructor. If true, tell the ModuleBuild that we want debugging
17749 support and ask it for the ISymbolWriter.
17750 (Save): If we have a symbol writer, call it's Close() method after
17751 saving the assembly.
17753 * driver.c (--debug): New command line argument to create a
17754 debugger information file.
17756 * location.cs (SymbolDocument): New public property. Returns an
17757 ISymbolDocumentWriter object for the current source file or null
17758 if we don't have a symbol writer.
17760 2002-03-21 Miguel de Icaza <miguel@ximian.com>
17762 * driver.cs (LoadAssembly): Correctly return when all the paths
17763 have been tried and not before.
17765 * statement.cs (Switch.Emit): return the actual coverage for this
17766 statement (returns/not-returns)
17768 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17769 switch of the statement if we are the last switch section. That
17770 kills two problems: try/catch problems (we used to emit an empty
17771 nop at the end) and switch statements where all branches would
17774 2002-03-19 Miguel de Icaza <miguel@ximian.com>
17776 * driver.cs: Add default assemblies (the equivalent to the
17777 Microsoft CSC.RSP file)
17779 * cs-tokenizer.cs: When updating `cols and setting it to zero,
17780 also update tokens_seen and set it to false.
17782 * driver.cs: Implement --recurse for Mike.
17784 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17785 correctly splitting out the paths.
17787 2002-03-18 Miguel de Icaza <miguel@ximian.com>
17789 * interface.cs (Interface.PopulateProperty): Instead of using
17790 `parent' as the declaration space for the set parameters, use
17793 * support.cs (InternalParameters): InternalParameters constructor
17794 takes a DeclSpace instead of a TypeContainer.
17796 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17797 types are being initialized, load the address of it before calling
17800 (New): Provide a mechanism to disable the generation of local
17801 value type temporaries when the caller will be providing us with
17802 an address to store it.
17804 (ArrayCreation.EmitDynamicInitializers): Use it.
17806 2002-03-17 Miguel de Icaza <miguel@ximian.com>
17808 * expression.cs (Invocation.EmitArguments): Only probe for array
17809 property if there is more than one argument. Sorry about that.
17811 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17812 empty param arrays.
17814 * class.cs (Method.LabelParameters): Fix incorrect code path that
17815 prevented the `ParamArrayAttribute' from being applied to the
17818 2002-03-16 Miguel de Icaza <miguel@ximian.com>
17820 * support.cs (ReflectionParameters): Correctly compute whether the
17821 last argument is a params array. Fixes the problem with
17824 * typemanager.cs: Make the assemblies array always be non-null
17825 (empty, but non-null)
17827 * tree.cs (RecordDecl): New function that abstracts the recording
17828 of names. This reports error 101, and provides a pointer to the
17829 previous declaration. Fixes a crash in the compiler.
17831 * cs-parser.jay (constructor_declaration): Update to new grammar,
17832 and provide a constructor_body that can be empty.
17834 2002-03-15 Miguel de Icaza <miguel@ximian.com>
17836 * driver.cs: Add support for --resources.
17838 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17839 Make all types for the various array helper methods be integer.
17841 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17842 CheckState to ConvCast.
17844 (ConvCast): Now it takes a `checked' state argument, to avoid
17845 depending on the emit context for the conversion, and just using
17846 the resolve time setting.
17848 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17849 instead of Invocation.EmitArguments. We do not emit the original
17850 arguments, instead we emit those which have been converted to
17851 unsigned int expressions.
17853 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17855 * codegen.cs: ditto.
17857 * expression.cs (LocalVariableReference): Drop the use of the
17858 Store function that depended on the variable index.
17860 * statement.cs (VariableInfo): Drop the `Idx' property from this
17861 class, as this is not taking into account the indexes for
17862 temporaries tat we generate during the execution, getting the
17865 * class.cs: First emit class initializers, then call the parent
17868 * expression.cs (Binary): Fix opcode emision.
17869 (UnaryMutator.EmitCode): Support checked code generation
17871 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17872 matches for events for both the Static and Instance scans,
17873 pointing to the same element. Fix that.
17875 2002-03-14 Miguel de Icaza <miguel@ximian.com>
17877 * rootcontext.cs (ResolveTree): Always set the
17878 interface_resolve_order, because nested interfaces will be calling
17881 * class.cs (GetInterfaceOrClass): Track the same resolution
17882 process used by TypeManager.LookupType. This fixes the nested
17883 type lookups in class declarations (separate path from
17886 (TypeContainer.DefineType): Also define nested interfaces.
17887 (TypeContainer.RegisterOrder): New public function used to
17888 register the order in which child interfaces need to be closed.
17890 Nested interfaces need to be closed after their parents have been
17893 * interface.cs (InterfaceAttr): Put all the logic for computing
17894 the interface attribute here.
17896 (DefineInterface): Register our interface order with the
17897 RootContext or with the TypeContainer depending on the case.
17899 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17901 * cs-parser.jay: rework foreach statement to work with the new
17902 changes to the policy on SimpleNames.
17904 * report.cs: support Stacktrace on warnings as well.
17906 * makefile: drop --unsafe and /unsafe from the compile.
17908 2002-03-13 Ravi Pratap <ravi@ximian.com>
17910 * ecore.cs (StandardConversionExists): Modify to take an Expression
17911 as the first parameter. Ensure we do null -> reference type conversion
17914 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17915 temporary Expression objects.
17917 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17919 * interface.cs: workaround bug in method overloading resolution
17920 (there is already a bugzilla bug for it).
17922 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17924 We could also solve this problem by having a separate path for
17925 performing type lookups, instead of DoResolve, we could have a
17926 ResolveType entry point, and only participating pieces of the
17927 production (simplename, deref, array) would implement this.
17929 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17930 signal SimpleName to only resolve type names and not attempt to
17931 resolve anything else.
17933 * expression.cs (Cast): Set the flag.
17935 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17937 * class.cs: Only report 108 if there is no `new' modifier.
17939 * cs-parser.jay: rework foreach statement to work with the new
17940 changes to the policy on SimpleNames.
17942 * report.cs: support Stacktrace on warnings as well.
17944 * makefile: drop --unsafe and /unsafe from the compile.
17946 2002-03-11 Miguel de Icaza <miguel@ximian.com>
17948 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17949 lookups here, instead of doing that at parse time. This means
17950 that our grammar will not introduce `LocalVariableReferences' as
17951 expressions at this point. That solves the problem of code like
17955 static void Main ()
17959 This is only half the fix. The full fix requires parameters to
17960 also be handled in this way.
17962 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17963 makes the use more obvious of the DeclSpace. The
17964 ec.TypeContainer.TypeBuilder is now only used to pull the
17965 TypeBuilder for it.
17967 My theory is that I can get rid of the TypeBuilder completely from
17968 the EmitContext, and have typecasts where it is used (from
17969 DeclSpace to where it matters).
17971 The only pending problem is that the code that implements Aliases
17972 is on TypeContainer, and probably should go in DeclSpace.
17974 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17975 lookups here, instead of doing that at parse time. This means
17976 that our grammar will not introduce `LocalVariableReferences' as
17977 expressions at this point. That solves the problem of code like
17981 static void Main ()
17985 This is only half the fix. The full fix requires parameters to
17986 also be handled in this way.
17988 * class.cs (Property.DefineMethod): When implementing an interface
17989 method, set newslot, when implementing an abstract method, do not
17990 set the flag (before we tried never setting it, or always setting
17991 it, which is the difference).
17992 (Indexer.DefineMethod): same.
17993 (Method.DefineMethod): same.
17995 * ecore.cs: Only set the status used flag if we get back a Field.
17997 * attribute.cs: Temporary hack, so Paolo can keep working.
17999 2002-03-08 Ravi Pratap <ravi@ximian.com>
18001 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18002 the unmanaged type in the case we have a MarshalAs attribute.
18004 (Resolve): Handle the case when we are parsing the special MarshalAs
18005 attribute [we need to store the unmanaged type to use later]
18007 * typemanager.cs (marshal_as_attr_type): Built in type for the
18008 MarshalAs Attribute.
18010 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
18011 on parameters and accordingly set the marshalling info.
18013 2002-03-09 Miguel de Icaza <miguel@ximian.com>
18015 * class.cs: Optimizing slightly by removing redundant code after
18016 we switched to the `NoTypes' return value.
18017 (Property.DefineMethod): use NoTypes here too.
18019 This fixes the bug I introduced in my last batch of changes.
18021 2002-03-05 Ravi Pratap <ravi@ximian.com>
18023 * tree.cs (RecordEnum): Add. We now keep track of enums too.
18025 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18026 Enums since those are types too.
18028 * cs-parser.jay (enum_declaration): Record enums as we parse them.
18030 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
18031 thanks to a call during the lookup process.
18033 2002-03-07 Miguel de Icaza <miguel@ximian.com>
18035 * statement.cs (Foreach): Lots of work to accomodate a particular
18036 kind of foreach statement that I had not kept in mind. It is
18037 possible to have foreachs on classes that provide a GetEnumerator
18038 method that return objects that implement the "pattern" for using
18039 a foreach, there is no need to support GetEnumerator
18042 This is needed to compile nant.
18044 * decl.cs: Only report 114 if the member is not `Finalize' and if
18045 the warning level is at least 2.
18047 * class.cs: Moved the compare function from Method to
18050 (MethodSignature.InheritableMemberSignatureCompare): Add new
18051 filter function that is used to extract inheritable methods from a
18054 (Method.Define): Use the new `inheritable_method_signature_filter'
18057 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18060 2002-03-06 Miguel de Icaza <miguel@ximian.com>
18062 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18064 * cs-parser.jay: Add opt_semicolon to the interface declaration.
18066 * expression.cs: Pass location information to
18067 ConvertImplicitStandard.
18069 * class.cs: Added debugging code to track return values from
18072 2002-03-05 Miguel de Icaza <miguel@ximian.com>
18074 * expression.cs (Is.DoResolve): If either side of the `is' is an
18075 interface, do not flag the warning.
18077 * ecore.cs (ImplicitReferenceConversion): We need a separate test
18080 * report.cs: Allow for --fatal to be used with --probe.
18082 * typemanager.cs (NoTypes): Move the definition for the empty Type
18085 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18087 (TypeContainer.DefineProxy): New function used to proxy to parent
18088 implementations when implementing interfaces.
18089 (TypeContainer.ParentImplements): used to lookup if our parent
18090 implements a public function that is required by an interface.
18091 (TypeContainer.VerifyPendingMethods): Hook this up.
18093 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18094 `modules' and `assemblies' arraylists into arrays. We only grow
18095 these are the very early start up of the program, so this improves
18096 the speedof LookupType (nicely measured).
18098 * expression.cs (MakeByteBlob): Replaced unsafe code with
18099 BitConverter, as suggested by Paolo.
18101 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18102 folding of string concatenation, but if either side is a string,
18103 and the other is not, then return null, and let the runtime use
18104 the concatenation on the string plus the object (using
18105 `Object.ToString').
18107 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18109 Constant Folding has been implemented now.
18111 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18112 the error instead on types that are not supported in one's
18115 * constant.cs (Constant and all children): New set of functions to
18116 perform implict and explicit conversions.
18118 * ecore.cs (EnumConstant): Implement the new functions to perform
18119 conversion by proxying to the child expression.
18121 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18122 own separate setting that can not be turned off from the command
18123 line using --unchecked or --checked and is only controlled using
18124 the checked/unchecked statements and expressions. This setting is
18125 used by the constant folder to flag errors.
18127 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18128 ConstantCheckState as well.
18130 During Resolve, they also have to flag the state, because the
18131 constant folder runs completely in the Resolve phase.
18133 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18136 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18138 * cfold.cs: New file, this file contains the constant folder.
18140 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18141 argument to track whether we are using the resulting address to
18142 load or store a value and provide better error messages.
18144 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18145 new AddressOf arguments.
18147 * statement.cs (Foreach.EmitCollectionForeach): Update
18149 * expression.cs (Argument.Emit): Call AddressOf with proper
18150 arguments to track usage.
18152 (New.DoEmit): Call AddressOf with new arguments.
18154 (Unary.Emit): Adjust AddressOf call.
18156 2002-03-01 Ravi Pratap <ravi@ximian.com>
18158 * cs-parser.jay (member_access): Change the case for pre-defined types
18159 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
18162 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18165 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18166 essentially like methods and apply attributes like MethodImplOptions to them too.
18168 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18171 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18172 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18175 * Update code everywhere accordingly.
18177 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18179 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18181 2002-02-28 Ravi Pratap <ravi@ximian.com>
18183 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18184 try performing lookups against those instead of jumping straight into using
18185 the 'using' clauses.
18187 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18189 (LookupType): Perform lookups in implicit parents too.
18191 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18192 sequence as RootContext.LookupType.
18194 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18195 the various cases of namespace lookups into this method.
18197 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18199 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18200 in positional arguments)
18202 * class.cs (Operator): Update the AllowedModifiers to contain
18205 * cs-parser.jay: Update operator declaration to allow for the
18206 operator body to be empty.
18208 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18211 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18213 * class.cs (Method.Emit): Label parameters.
18215 * driver.cs: Return 1 or 0 as the program exit code.
18217 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18219 * expression.cs: Special case the `null' object when trying to
18220 auto-compute the type, as anything can be explicitly converted to
18223 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18224 spotting this Paolo.
18226 (Expression.ImplicitNumericConversion): Perform comparissions of
18227 the type using the underlying type in the case of an enumeration
18228 rather than using the enumeration type for the compare.
18230 Cope with the underlying == type case, which is not possible to
18233 (Expression.ConvertNumericExplicit): Perform comparissions of
18234 the type using the underlying type in the case of an enumeration
18235 rather than using the enumeration type for the compare.
18237 * driver.cs: If the user does not supply an extension, assume .exe
18239 * cs-parser.jay (if_statement): Rewrote so that we can track the
18240 location for the if statement.
18242 * expression.cs (Binary.ConstantFold): Only concat strings when
18243 the operation is "+", not everything ;-)
18245 * statement.cs (Statement.EmitBoolExpression): Take a location
18247 (If, While, Do): Track location.
18249 * expression.cs (Binary.ResolveOperator): In the object + string
18250 case, I was missing a call to ConvertImplicit
18252 2002-02-25 Ravi Pratap <ravi@ximian.com>
18254 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18255 Location arguments. Ensure we use RootContext.LookupType to do our work
18256 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18258 * interface.cs (PopulateMethod): Handle the type of the parameter being
18261 * expression.cs (Invocation.BetterFunction): Handle the case when we
18262 have a params method with no fixed arguments and a call is made with no
18265 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18267 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18268 the verbatim-string-literal
18270 * support.cs (InternalParameters.ParameterModifier): handle null
18272 (InternalParameters.ParameterType): ditto.
18274 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18275 duplicating the name of the variable parameter.
18276 (GetParameterByName): Fix bug where we were not looking up array
18277 paramters if they were the only present (thanks Paolo!).
18278 (GetParameterInfo): We only have an empty set of types if both
18279 fixed and array are set to null.
18280 (GetParameterInfo-idx): Handle FixedParameter == null
18282 * cs-parser.jay: Handle the case where there is no catch
18283 statements (missing null test).
18285 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18287 * driver.cs (MainDriver): Be conservative on our command line
18290 Catch DirectoryNotFoundException when calling GetFiles.
18292 (SplitPathAndPattern): Used to split the input specification into
18293 a path and a pattern that we can feed to Directory.GetFiles.
18295 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18297 * statement.cs (Fixed): Implement the last case of the Fixed
18298 statement (string handling).
18300 * expression.cs (StringPtr): New class used to return a char * to
18301 a string; Used by the Fixed statement.
18303 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18305 * expression.cs (Binary.ResolveOperator): Remove redundant
18306 MemberLookup pn parent type.
18307 Optimize union call, we do not need a union if the types are the same.
18308 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18311 Specialize the use of MemberLookup everywhere, instead of using
18312 the default settings.
18314 (StackAlloc): Implement stackalloc keyword.
18316 * cs-parser.jay: Add rule to parse stackalloc.
18318 * driver.cs: Handle /h, /help, /?
18320 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18321 before we supported unsafe code.
18323 * makefile: add --unsafe to the self compilation of mcs.
18325 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18327 * expression.cs (PointerArithmetic): New class that is used to
18328 perform pointer arithmetic.
18329 (Binary.Resolve): Handle pointer arithmetic
18330 Handle pointer comparission.
18331 (ArrayPtr): Utility expression class that is used to take the
18332 address of an array.
18334 (ElementAccess): Implement array access for pointers
18336 * statement.cs (Fixed): Implement fixed statement for arrays, we
18337 are missing one more case before we are done.
18339 * expression.cs (Indirection): Implement EmitAssign and set the
18340 ExprClass to Variable. This allows pointer dereferences to be
18341 treated as variables, and to have values assigned to them.
18343 * ecore.cs (Expression.StoreFromPtr): New utility function to
18344 store values dereferencing.
18346 2002-02-20 Ravi Pratap <ravi@ximian.com>
18348 * expression.cs (Binary.ResolveOperator): Ensure that we are
18349 not trying to operate on a void type - this fixes the reported
18352 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18353 the parent implementation is sealed.
18355 * ../errors/cs0239.cs : Add.
18357 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18359 * typemanager.cs (unverifiable_code_type): Corresponds to
18360 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18361 which have unsafe code in them.
18363 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18366 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18368 * cs-tokenizer.cs: Add support for @"litreal strings"
18370 Make tokenizer accept pre-processor directives
18371 on any column (remove the old C-like limitation).
18373 * rootcontext.cs (EmitCode): Emit any global attributes.
18374 (AddGlobalAttributes): Used to keep track of assembly attributes.
18376 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18378 * cs-parser.jay: Add support for global attributes.
18380 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18382 * expression.cs (Indirection): New helper class. Unary will
18383 create Indirection classes to be able to implement the
18384 IMemoryLocation interface on it.
18386 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18388 * cs-parser.jay (fixed_statement): reference the right statement.
18390 * statement.cs (Fixed.Emit): Finish implementing the fixed
18391 statement for the &x case.
18393 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18395 * class.cs (Property.Define, Method.Define): Remove newslot when
18398 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18399 wrong. NewSlot should only be used if the `new' keyword is present.
18401 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18402 locating our system dir. Sorry about this.
18404 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18406 * driver.cs (GetSystemDir): Compute correctly the location of our
18407 system assemblies. I was using the compiler directory instead of
18408 the library directory.
18410 2002-02-13 Ravi Pratap <ravi@ximian.com>
18412 * expression.cs (BetterFunction): Put back in what Miguel commented out
18413 since it is the correct fix. The problem is elsewhere ;-)
18415 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18416 parameters of the parms method are themselves compatible or not !
18418 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18419 to check that a class implements an interface before saying that an implicit
18420 conversion was allowed. Use ImplementsInterface to do the checking.
18422 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18424 * class.cs (Method.Define): Track whether we are an explicit
18425 implementation or not. And only call DefineMethodOverride if we
18426 are an explicit implementation.
18428 (Property.DefineMethod): Ditto.
18430 2002-02-11 Ravi Pratap <ravi@ximian.com>
18432 * expression.cs (BetterFunction): Catch hideous bug which was
18433 preventing us from detecting ambiguous calls due to implicit casts i.e
18436 2002-01-29 Miguel de Icaza <miguel@ximian.com>
18438 * support.cs (Pair): Remove un-needed method. I figured why I was
18439 getting the error in cs-parser.jay, the variable in a foreach loop
18440 is readonly, and the compiler does not really treat this as a variable.
18442 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
18443 instead of EQUALS in grammar.
18445 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18447 * expression.cs (Unary.DoResolve): Check whether the argument is
18450 2002-01-28 Miguel de Icaza <miguel@ximian.com>
18452 * support.cs: Api for Pair to set a value. Despite the fact that
18453 the variables are public the MS C# compiler refuses to compile
18454 code that accesses the field if the variable is part of a foreach
18457 * statement.cs (Fixed): Begin implementation of the fixed
18460 (Block.AddVariable): Return the VariableInfo on success and null
18461 on failure instead of true/false.
18463 * cs-parser.jay (foreach): Catch errors on variables already
18464 defined (we were ignoring this value before) and properly unwind
18465 the block hierarchy
18467 (fixed_statement): grammar for the fixed statement.
18469 2002-01-25 Miguel de Icaza <miguel@ximian.com>
18471 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18472 pointer types to be incretemented.
18474 (SizeOf): Implement.
18476 * cs-parser.jay (pointer_member_access): Implement
18477 expr->IDENTIFIER production.
18479 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18480 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18483 (Unary): Implement indirection.
18485 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18486 use in non-unsafe context).
18488 (SimpleName.DoResolve): Check for pointers in field access on safe
18491 (Expression.LoadFromPtr): Factor the load-indirect code in this
18492 function. This was duplicated in UnboxCast and ParameterReference
18494 2002-01-24 Miguel de Icaza <miguel@ximian.com>
18496 * expression.cs (ComposedCast): report an error if a pointer cast
18497 is used in a safe region.
18499 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18500 pointer type casts in unsafe context.
18502 * codegen.cs (EmitContext): Set up IsUnsafe.
18504 * cs-parser.jay (non_expression_type): Add productions for pointer
18507 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18508 code. We should not use force into static mode if the method is
18509 not virtual. Fixes bug in MIS
18511 * statement.cs (Do.Emit, While.Emit, For.Emit,
18512 Statement.EmitBoolExpression): Add support to Do and While to
18513 propagate infinite loop as `I do return' semantics.
18515 Improve the For case to also test for boolean constants.
18517 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18518 to the list of attributes we can add.
18520 Remove `EmitContext' argument.
18522 * class.cs (Method.Define): Apply parameter attributes.
18523 (Constructor.Define): Apply parameter attributes.
18524 (MethodCore.LabelParameters): Move here the core of labeling
18527 * support.cs (ReflectionParameters.ParameterModifier,
18528 InternalParameters.ParameterModifier): Use IsByRef on the type and
18529 only return the OUT bit for these parameters instead of in/out/ref
18532 This is because I miss-understood things. The ParameterInfo.IsIn
18533 and IsOut represent whether the parameter has the [In] and [Out]
18536 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18538 * ecore.cs (FieldExpr.Emit): Release temporaries.
18540 * assign.cs (LocalTemporary.Release): new function.
18542 * codegen.cs (EmitContext.GetTemporaryStorage,
18543 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18544 temporary storage. Now we can "put back" localbuilders when we
18547 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18549 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18550 need to make a copy of the variable to generate verifiable code.
18552 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18554 * driver.cs: Compute dynamically the system directory.
18556 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18557 Slower, but more generally useful. Used by the abstract
18558 registering implementation.
18560 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18561 the rules for the special rule on Type/instances. First check if
18562 we have the same name, and if so, try that special static path
18563 rather than the instance path.
18565 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18567 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18570 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18571 Enum, ValueType, Delegate or Array for non-corlib compiles.
18573 * cs-tokenizer.cs: Catch long identifiers (645)
18575 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18578 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18579 fix, we were returning too early, so we were not registering
18580 pending methods from abstract classes.
18582 Do not register pending methods if the class is abstract.
18584 * expression.cs (Conditional.DoResolve): Report circular implicit
18585 conversions when we neecd to compute it for conditional
18588 (Is.DoResolve): If the expression is always of the provided type,
18589 flag warning 183. If the expression can not ever be of the
18590 provided type flag warning 184.
18592 * class.cs: Catch 169 as well.
18594 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18597 2002-01-18 Nick Drochak <ndrochak@gol.com>
18599 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
18601 2002-01-17 Miguel de Icaza <miguel@ximian.com>
18603 * interface.cs: (PopulateMethod): Check for pointers being defined
18604 only if the unsafe context is active.
18605 (PopulateProperty): ditto.
18606 (PopulateIndexer): ditto.
18608 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18609 specified. If pointers are present, make sure that they are
18610 present in an unsafe context.
18611 (Constructor, Constructor.Define): ditto.
18612 (Field, Field.Define): ditto.
18613 (Property, Property.Define): ditto.
18614 (Event, Event.Define): ditto.
18616 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18617 hashtable if there are classes or structs defined.
18619 * expression.cs (LocalVariableReference.DoResolve): Simplify this
18620 code, as the constant resolution moved.
18622 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18623 the metadata, so we can flag error 133.
18625 * decl.cs (MemberCore.UnsafeOK): New function to test that a
18626 pointer is being declared in an unsafe context.
18628 2002-01-16 Miguel de Icaza <miguel@ximian.com>
18630 * modifiers.cs (Modifiers.Check): Require a Location argument.
18631 Report error 227 for Unsafe use.
18633 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18635 * statement.cs (For.Emit): If the test is null, then report that
18636 we do `return', as we wont reach anything afterwards.
18638 (Switch.SwitchGoverningType): Track the expression that matched
18641 * driver.cs: Allow negative numbers as an error code to flag.
18643 * cs-parser.jay: Handle 1551.
18645 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18647 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18649 * cs-parser.jay: Report 1518 (type declaration can only contain
18650 class, struct, interface, enum or delegate)
18652 (switch_label): Report 1523 (keywords `case' or `default' must
18655 (opt_switch_sections): Report 1522 (empty switch)
18657 * driver.cs: Report 1515 (response file specified multiple times)
18658 Report 1516 (Source file specified multiple times).
18660 * expression.cs (Argument.Resolve): Signal 1510
18662 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18663 access not allowed in static code)
18665 2002-01-11 Ravi Pratap <ravi@ximian.com>
18667 * typemanager.cs (IsPointerType): Utility method which we are going
18670 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18671 the object type, so we take care of that.
18673 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18675 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18676 added to non-params parameters :-)
18678 * typemanager.cs (CSharpName): Include 'void' type too.
18680 (void_ptr_type): Include in the set of core types.
18682 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
18685 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
18688 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
18689 completely forgotten about it.
18691 2002-01-10 Ravi Pratap <ravi@ximian.com>
18693 * cs-parser.jay (pointer_type): Add. This begins our implementation
18694 of parsing rules for unsafe code.
18696 (unsafe_statement): Implement.
18698 (embedded_statement): Modify to include the above.
18700 * statement.cs (Unsafe): Implement new class for unsafe blocks.
18702 * codegen.cs (EmitContext.InUnsafe): Add. This determines
18703 if the current context is an unsafe one.
18705 * cs-parser.jay (local_variable_pointer_type): Since local variable types
18706 are handled differently, we need separate rules for them.
18708 (local_variable_declaration): Update to use local_variable_pointer_type
18709 to allow variable declarations of unmanaged pointer types.
18711 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18712 in unsafe contexts.
18714 * ../errors/cs0214.cs : Add.
18716 2002-01-16 Nick Drochak <ndrochak@gol.com>
18718 * makefile: remove 'response' file when cleaning.
18720 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18722 * cs-parser.jay: Report 1524.
18724 2002-01-14 Miguel de Icaza <miguel@ximian.com>
18726 * typemanager.cs (RegisterMethod): drop checking if we have
18727 registered this from here
18729 2002-01-12 Miguel de Icaza <miguel@ximian.com>
18731 * class.cs (Method.EmitDestructor): Implement calling our base
18734 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18735 value of InFinally.
18737 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18738 this routine and will wrap the call in a try/catch block. Deal
18741 2002-01-11 Miguel de Icaza <miguel@ximian.com>
18743 * ecore.cs (Expression.MemberLookup): instead of taking a
18744 parameter `same_type' that was used to tell whether we could
18745 access private members we compute our containing type from the
18748 (FieldExpr): Added partial support for volatile fields. This does
18749 not work for volatile fields exposed from assemblies, as I can not
18750 figure out how to extract the modreq from it.
18752 Updated all the source files to use this.
18754 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18755 because it is referenced by MemberLookup very often.
18757 2002-01-09 Ravi Pratap <ravi@ximian.com>
18759 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18760 TypeBuilder.GetCustomAttributes to retrieve what we need.
18762 Get rid of redundant default_member_attr_type as this is the same as
18763 default_member_type which already exists.
18765 * interface.cs, attribute.cs : Update accordingly.
18767 2002-01-08 Miguel de Icaza <miguel@ximian.com>
18769 * typemanager.cs: Enable IndexerPropertyName again. It does not
18770 work for TYpeBuilders though. Ravi, can you please fix this?
18772 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18774 * expression.cs (Argument.Emit): Handle the case of ref objects
18775 being passed to ref functions;
18777 (ParameterReference.EmitLoad): Loads the content of the pointer
18778 without dereferencing.
18780 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18782 * cs-tokenizer.cs: Implemented the pre-processing expressions.
18784 2002-01-08 Ravi Pratap <ravi@ximian.com>
18786 * class.cs (Indexer.DefineMethod): Incorporate the interface
18787 type in the name of the method if we are doing explicit interface
18790 * expression.cs (ConversionExists): Remove as it is completely obsolete.
18792 (BetterConversion): Fix extremely trivial bug where we were referring to
18793 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18796 * ../errors/bug16.cs : Add although we have fixed it.
18798 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18800 * expression.cs (BaseIndexer): Begin implementation.
18802 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18804 * cs-parser.jay (indexer_declarator): Use qualified_identifier
18805 production directly to remove a shift/reduce, and implement
18806 explicit interface implementation.
18808 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18809 after a floating point suffix.
18811 * expression.cs (DoNumericPromotions): Improved the conversion for
18812 uint/uint. If we have a constant, we avoid doing a typecast to a
18815 * class.cs (Indexer): Implement explicit interface implementation
18818 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18820 * class.cs: make the default instance constructor public and hidebysig.
18822 2001-01-03 Ravi Pratap <ravi@ximian.com>
18824 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18825 so we can call it from elsewhere.
18827 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18828 we emit it internally if the class has a defined indexer; otherwise the user
18829 emits it by decorating the class definition with the DefaultMemberAttribute.
18831 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18832 attribute is not used on a type which defines an indexer.
18834 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18835 character when we skip whitespace.
18837 * ../errors/cs0646.cs : Add.
18839 2002-01-03 Miguel de Icaza <miguel@ximian.com>
18841 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18844 * makefile: Add practical target `mcs3.exe' which builds the third
18845 generation compiler.
18847 * expression.cs (New): Fix structures constructor calling.
18849 * class.cs (Property, Method, Indexer): Emit Final flag on the
18850 method if we are an interface implementation and we are not
18853 * ecore.cs (PropertyExpr): New public field `IsBase', tells
18854 whether this property is referencing a `base' method.
18856 * expression.cs (Invocation.EmitCall): take an extra argument:
18857 is_base, this is used to determine whether the `call' or
18858 `callvirt' opcode should be used.
18861 * delegate.cs: update EmitCall.
18863 * class.cs (Method.Define): Set NewSlot for the cases where we are
18864 not implementing an interface method.
18866 (Property.Define): ditto.
18868 2002-01-02 Miguel de Icaza <miguel@ximian.com>
18870 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18871 'r'. Allows mcs to parse itself fully.
18873 2002-01-02 Ravi Pratap <ravi@ximian.com>
18875 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18876 of the number of initializers that require the InitializeArray method.
18878 (CheckIndices): Store the Expression in all cases - not the plain value. Also
18879 update the above field where necessary.
18881 (MakeByteBlob): Update accordingly.
18883 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
18886 (EmitDynamicInitializers): Update in accordance with the new optimization.
18888 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18889 same OpCode applies.
18891 * cs-parser.jay : Fix some glaring errors I introduced.
18893 2002-01-01 Ravi Pratap <ravi@ximian.com>
18895 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18896 so that we can check for name clashes there too.
18898 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18899 for interface indexers.
18901 * interfaces.cs (Define): Emit the default member attribute.
18903 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18904 variable was being referred to while setting the value ;-)
18906 2002-01-01 Miguel de Icaza <miguel@ximian.com>
18908 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18909 byte-by-byte information when we know the data is zero.
18911 Make the block always a multiple of 4, because
18912 DefineInitializedData has a bug.
18914 * assign.cs: Fix, we should assign from the temporary, not from
18917 * expression.cs (MakeByteBlob): Fix my incorrect code.
18919 2001-12-31 Miguel de Icaza <miguel@ximian.com>
18921 * typemanager.cs (EnumToUnderlying): This function is used to get
18922 the underlying type from an enumeration, because it does not
18925 * constant.cs: Use the I4_S form for values between -128 and 127.
18927 * statement.cs (Block.LookupLabel): Looks up a label.
18928 (Block): Drop support for labeled blocks.
18930 (LabeledStatement): New kind of statement that represents a label
18933 (Goto): Finally implement this bad boy.
18935 * cs-parser.jay: Update to reflect new mechanism to implement
18938 2001-12-30 Miguel de Icaza <miguel@ximian.com>
18940 * codegen.cs (EmitContext.This): a codegen property that keeps the
18941 a single instance of this instead of creating many different this
18944 * delegate.cs (Delegate.DoResolve): Update to use the property;
18946 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18948 * expression.cs (BaseAccess.DoResolve): Ditto.
18950 2001-12-29 Ravi Pratap <ravi@ximian.com>
18952 * typemanager.cs (methodimpl_attr_type): Add to hold the type
18953 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18955 (InitCoreTypes): Update accordingly.
18957 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18958 so we can quickly store the state.
18960 (ApplyAttributes): Set the correct implementation flags
18961 for InternalCall methods.
18963 2001-12-29 Miguel de Icaza <miguel@ximian.com>
18965 * expression.cs (EmitCall): if a method is not virtual, then do
18966 not use callvirt on it.
18968 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18969 user defined stuff) requires the use of stobj, which takes an
18970 address on the stack instead of an array and an index. So emit
18971 the Ldelema operation for it.
18973 (EmitStoreOpcode): Use stobj for valuetypes.
18975 (UnaryMutator.EmitCode): Use the right 1 value depending on
18976 whether we are dealing with int64/uint64, float or doubles.
18978 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18979 constructors that I implemented last night.
18981 (Constructor.IsDefault): Fix to work properly for static
18984 * cs-parser.jay (CheckDef): report method signature errors.
18985 Update error number 103 to be 132.
18987 * decl.cs: New AdditionResult enumeration value: MethodExists.
18988 Although we do this check for methods later on in the semantic
18989 analysis, catching repeated default constructors is so easy that
18990 we catch these here.
18992 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18995 (ParameterReference.EmitAssign, Emit): handle
18998 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18999 (ArrayAccess.EmitStoreOpcode): ditto.
19001 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19003 * expression.cs (MakeByteBlob): Complete all the missing types
19004 (uint, short, ushort, byte, sbyte)
19006 * class.cs: Only init instance field initializers on instance
19009 Rename `constructors' to instance_constructors.
19011 (TypeContainer.AddConstructor): Only add constructors to the list
19012 if it is not static.
19014 Make sure that we handle default_static_constructor independently
19015 everywhere where we handle instance_constructors
19017 2001-12-28 Miguel de Icaza <miguel@ximian.com>
19019 * class.cs: Do not lookup or create a base initializer for a
19020 static constructor.
19022 (ConstructorInitializer.Resolve): use the proper type to lookup
19025 * cs-parser.jay: Report error 1585 (modifiers between type and name).
19027 * enum.cs, interface.cs: Remove CloseType, this is taken care by
19030 * decl.cs: CloseType is now an virtual method, the default
19031 implementation just closes this type.
19033 2001-12-28 Ravi Pratap <ravi@ximian.com>
19035 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19036 to PreserveSig by default. Also emit HideBySig on such methods.
19038 Basically, set the defaults to standard values.
19040 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19041 argument, if candidate is better, it can't be worse than the best !
19043 (Invocation): Re-write bits to differentiate between methods being
19044 applicable in their expanded form and their normal form - for params
19047 Get rid of use_standard everywhere as only standard conversions are allowed
19048 in overload resolution.
19050 More spec conformance.
19052 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19054 * driver.cs: Add --timestamp, to see where the compiler spends
19057 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19058 `this' in static code.
19060 (SimpleName.DoResolve): Implement in terms of a helper function
19061 that allows static-references to be passed upstream to
19064 (Expression.ResolveWithSimpleName): Resolve specially simple
19065 names when called by MemberAccess to implement the special
19068 (Expression.ImplicitReferenceConversion): Handle conversions from
19069 Null to reference types before others, as Null's type is
19072 * expression.cs (Invocation.EmitCall): Handle the special case of
19073 calling methods declared on a reference type from a ValueType
19074 (Base classes System.Object and System.Enum)
19076 (MemberAccess.Resolve): Only perform lookups on Enumerations if
19077 the left hand side is a TypeExpr, not on every enumeration.
19079 (Binary.Resolve): If types are reference types, then do a cast to
19080 object on operators != and == of both arguments.
19082 * typemanager.cs (FindMembers): Extract instance and static
19083 members if requested.
19085 * interface.cs (PopulateProperty): Use void_type instead of null
19086 as the return type for the setter method.
19088 (PopulateIndexer): ditto.
19090 2001-12-27 Ravi Pratap <ravi@ximian.com>
19092 * support.cs (ReflectionParameters): Fix minor bug where we
19093 were examining the wrong parameter for the ParamArray attribute.
19095 Cope with requests for the type of the parameter at position
19096 greater than the params parameter's. We now return the element
19097 type of the params array as that makes more sense.
19099 * expression.cs (Invocation.IsParamsMethodApplicable): Update
19100 accordingly as we no longer have to extract the element type
19103 (Invocation.OverloadResolve): Update.
19105 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19107 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19108 against IEnumerator, test whether the return value is a descendant
19109 of the IEnumerator interface.
19111 * class.cs (Indexer.Define): Use an auxiliary method to implement
19112 the other bits of the method definition. Begin support for
19113 explicit interface implementation.
19115 (Property.DefineMethod): Use TypeManager.void_type instead of null
19116 for an empty return value.
19118 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19120 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19121 dealing with a FieldExpr which is composed of a FieldBuilder, in
19122 the code path we did extract the constant, but we should have
19123 obtained the underlying value to be able to cast it (otherwise we
19124 end up in an infinite loop, this is what Ravi was running into).
19126 (ArrayCreation.UpdateIndices): Arrays might be empty.
19128 (MemberAccess.ResolveMemberAccess): Add support for section
19129 14.5.4.1 that deals with the special case of E.I when E is a type
19130 and something else, that I can be a reference to a static member.
19132 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19133 handle a particular array type to create byte blobs, it is just
19134 something we dont generate byteblobs for.
19136 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19139 * location.cs (Push): remove the key from the hashtable that we
19140 are about to add. This happens for empty files.
19142 * driver.cs: Dispose files after we have parsed them.
19144 (tokenize): new function that only runs the tokenizer on its
19145 input, for speed testing.
19147 2001-12-26 Ravi Pratap <ravi@ximian.com>
19149 * class.cs (Event.Define): Define the private field only if there
19150 are no accessors defined.
19152 * expression.cs (ResolveMemberAccess): If there is no associated
19153 field with the event, that means we have an event defined with its
19154 own accessors and we should flag error cs0070 since transforming
19155 ourselves into a field is not valid in that case.
19157 * ecore.cs (SimpleName.DoResolve): Same as above.
19159 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19160 and charset to sane values.
19162 2001-12-25 Ravi Pratap <ravi@ximian.com>
19164 * assign.cs (DoResolve): Perform check on events only if they
19165 are being accessed outside the declaring type.
19167 * cs-parser.jay (event_declarations): Update rules to correctly
19168 set the type of the implicit parameter etc.
19170 (add_accessor, remove_accessor): Set current local parameters.
19172 * expression.cs (Binary): For delegate addition and subtraction,
19173 cast the return value from the method into the appropriate delegate
19176 2001-12-24 Ravi Pratap <ravi@ximian.com>
19178 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19179 of these as the workaround is unnecessary.
19181 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19182 delegate data - none of that is needed at all.
19184 Re-write bits to extract the instance expression and the delegate method
19187 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19190 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19191 of attaching attributes instead of duplicating code everywhere.
19193 * everywhere : Update code to do attribute emission using the above method.
19195 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19197 * expression.cs (IsParamsMethodApplicable): if there are not
19198 parameters, return immediately.
19200 * ecore.cs: The 0 literal can be implicity converted to an enum
19203 (SimpleName.DoResolve): First lookup the type, then lookup the
19206 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19207 want to get its address. If the InstanceExpression is not
19208 addressable, store the result in a temporary variable, then get
19211 * codegen.cs: Only display 219 errors on warning level or above.
19213 * expression.cs (ArrayAccess): Make it implement the
19214 IMemoryLocation interface.
19216 (Binary.DoResolve): handle the operator == (object a, object b)
19217 and operator != (object a, object b) without incurring into a
19218 BoxedCast (because 5 != o should never be performed).
19220 Handle binary enumerator operators.
19222 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19223 value type, otherwise use Ldelem_ref.
19225 Use precomputed names;
19227 (AddressOf): Implement address of
19229 * cs-parser.jay (labeled_statement): Fix recursive block
19230 addition by reworking the production.
19232 * expression.cs (New.DoEmit): New has a special case:
19234 If we are dealing with a ValueType, we have a few
19235 situations to deal with:
19237 * The target of New is a ValueType variable, that is
19238 easy, we just pass this as the variable reference
19240 * The target of New is being passed as an argument,
19241 to a boxing operation or a function that takes a
19244 In this case, we need to create a temporary variable
19245 that is the argument of New.
19248 2001-12-23 Ravi Pratap <ravi@ximian.com>
19250 * rootcontext.cs (LookupType): Check that current_type is not null before
19251 going about looking at nested types.
19253 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19254 not implement the IAssignMethod interface any more.
19256 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19257 where we tranform them into FieldExprs if they are being resolved from within
19258 the declaring type.
19260 * ecore.cs (SimpleName.DoResolve): Do the same here.
19262 * assign.cs (DoResolve, Emit): Clean up code considerably.
19264 * ../errors/bug10.cs : Add.
19266 * ../errors/cs0070.cs : Add.
19268 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19270 * assign.cs : Get rid of EventIsLocal everywhere.
19272 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19274 * ecore.cs (ConvertIntLiteral): finished the implementation.
19276 * statement.cs (SwitchLabel): Convert the value we are using as a
19277 key before looking up the table.
19279 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19281 * codegen.cs (EmitTopBlock): Require a Location argument now.
19283 * cs-parser.jay (constructor_declarator): We need to setup
19284 current_local_parameters before we parse the
19285 opt_constructor_initializer, to allow the variables to be bound
19286 to the constructor arguments.
19288 * rootcontext.cs (LookupType): First lookup nested classes in our
19289 class and our parents before we go looking outside our class.
19291 * expression.cs (ConstantFold): Extract/debox the values at the
19294 * rootcontext.cs (EmitCode): Resolve the constants first before we
19295 resolve the types. This is not really needed, but it helps debugging.
19297 * statement.cs: report location.
19299 * cs-parser.jay: pass location to throw statement.
19301 * driver.cs: Small bug fix.
19303 * report.cs: Updated format to be 4-zero filled digits.
19305 2001-12-22 Ravi Pratap <ravi@ximian.com>
19307 * expression.cs (CheckIndices): Fix minor bug where the wrong
19308 variable was being referred to ;-)
19310 (DoEmit): Do not call EmitStaticInitializers when the
19311 underlying type is System.Object.
19313 2001-12-21 Ravi Pratap <ravi@ximian.com>
19315 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19316 and do the usual workaround for SRE.
19318 * class.cs (MyEventBuilder.EventType): New member to get at the type
19319 of the event, quickly.
19321 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19323 * assign.cs (Assign.DoResolve): Handle the case when the target
19324 is an EventExpr and perform the necessary checks.
19326 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19329 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19331 (EventExpr): Set the type in the constructor itself since we
19332 are meant to be born fully resolved.
19334 (EventExpr.Define): Revert code I wrote earlier.
19336 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19337 instance expression is null. The instance expression is a This in that case
19338 or a null, depending on whether it is a static method or not.
19340 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19341 refers to more than one method.
19343 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19344 and accordingly flag errors.
19346 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19348 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19350 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19352 * location.cs (ToString): Provide useful rutine.
19354 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19356 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19357 objects, return the actual integral boxed.
19359 * statement.cs (SwitchLabel): define an ILLabel for each
19362 (Switch.CheckSwitch): If the value is a Literal, extract
19363 the underlying literal.
19365 Also in the unused hashtable we had, add the SwitchLabel so we can
19366 quickly look this value up.
19368 * constant.cs: Implement a bunch of new constants. Rewrite
19369 Literal based on this. Made changes everywhere to adapt to this.
19371 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19372 dereferencing array only once, and also copes with enumrations.
19374 bytes are two bytes wide, not one.
19376 (Cast): Perform constant conversions.
19378 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19379 wrappers to the literals here.
19381 * expression.cs (DoNumericPromotions): long literals can converted
19382 to ulong implicity (this is taken care of elsewhere, but I was
19383 missing this spot).
19385 * ecore.cs (Expression.Literalize): Make the return type Literal,
19386 to improve type checking.
19388 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19390 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19392 * literal.cs: Revert code from ravi that checked the bounds. The
19393 bounds are sane by the definition of the type itself.
19395 * typemanager.cs: Fix implementation of ImplementsInterface. We
19396 need to actually look up in our parent hierarchy for interfaces
19399 * const.cs: Use the underlying type for enumerations
19401 * delegate.cs: Compute the basename for the delegate creation,
19402 that should fix the delegate test case, and restore the correct
19403 Type Lookup semantics in rootcontext
19405 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19406 referencing a nested type with the Reflection API is using the "+"
19409 * cs-parser.jay: Do not require EOF token at the end.
19411 2001-12-20 Ravi Pratap <ravi@ximian.com>
19413 * rootcontext.cs (LookupType): Concatenate type names with
19414 a '.' instead of a '+' The test suite passes again.
19416 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19417 field of the enumeration.
19419 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19420 the case when the member is an EventExpr.
19422 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19423 static has an associated instance expression.
19425 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19427 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19429 * class.cs (Event.Define): Register event and perform appropriate checks
19432 We define the Add and Remove methods even if the use provides none because
19433 in that case, we provide default implementations ourselves.
19435 Define a private field of the type of the event. This is done by the CSC compiler
19436 and we should be doing it too ;-)
19438 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19439 More methods we use in code we generate.
19441 (multicast_delegate_type, delegate_type): Two separate types since the distinction
19444 (InitCoreTypes): Update accordingly for the above.
19446 * class.cs (Event.Emit): Generate code for default accessors that we provide
19448 (EmitDefaultMethod): Do the job in the above.
19450 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
19453 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19455 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19456 builders even if we were missing one.
19458 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19459 pass the Basename as our class name instead of the Name. The
19460 basename will be correctly composed for us.
19462 * parameter.cs (Paramters): Now takes a Location argument.
19464 * decl.cs (DeclSpace.LookupType): Removed convenience function and
19465 make all the code call directly LookupType in RootContext and take
19466 this chance to pass the Location information everywhere.
19468 * Everywhere: pass Location information.
19470 2001-12-19 Miguel de Icaza <miguel@ximian.com>
19472 * class.cs (Constructor.Define): Updated way of detecting the
19473 length of the parameters.
19475 (TypeContainer.DefineType): Use basename as the type name for
19478 (TypeContainer.Define): Do not recursively define types here, as
19479 definition is taken care in order by the RootContext.
19481 * tree.cs: Keep track of namespaces in a per-file basis.
19483 * parameter.cs (Parameter.ComputeSignature): Update to use
19486 (Parameters.GetSignature): ditto.
19488 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19489 instead of a TypeContainer.
19491 (Interface.SemanticAnalysis): Use `this' instead of our parent to
19492 resolve names. Because we need to be resolve in our context, not
19495 * driver.cs: Implement response files.
19497 * class.cs (TypeContainer.DefineType): If we are defined, do not
19498 redefine ourselves.
19500 (Event.Emit): Emit the code for add/remove handlers.
19501 (Event.Define): Save the MethodBuilders for add/remove.
19503 * typemanager.cs: Use pair here too.
19505 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19506 DictionaryEntry requires the first argument to be non-null.
19508 (enum_declaration): Compute full name for registering the
19511 (delegate_declaration): Instead of using
19512 formal_parameter_list, use opt_formal_parameter_list as the list
19515 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19516 (EventParsing): New property that controls whether `add' and
19517 `remove' are returned as tokens or identifiers (for events);
19519 2001-12-19 Ravi Pratap <ravi@ximian.com>
19521 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19522 use MyEventBuilder only and let it wrap the real builder for us.
19524 (MyEventBuilder): Revamp constructor etc.
19526 Implement all operations that we perform on EventBuilder in precisely the same
19529 (FindMembers): Update to use the EventBuilder member.
19531 (Event.Emit): Update accordingly.
19533 2001-12-18 Ravi Pratap <ravi@ximian.com>
19535 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19536 by calling the appropriate methods.
19538 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19541 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19543 2001-12-17 Ravi Pratap <ravi@ximian.com>
19545 * delegate.cs (Delegate.Populate): Check that the return type
19546 and various parameters types are indeed accessible.
19548 * class.cs (Constructor.Define): Same here.
19550 (Field.Define): Ditto.
19552 (Event.Define): Ditto.
19554 (Operator.Define): Check that the underlying Method defined itself
19555 correctly - so it's MethodBuilder should not be null.
19557 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19558 expression happens to be null.
19560 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19561 members but as of now we don't seem to be able to do anything really useful with it.
19563 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19564 not the EventBuilder.
19566 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19568 * cs-tokenizer.cs: Add support for defines.
19569 Add support for #if, #elif, #else, #endif
19571 (eval_var): evaluates a variable.
19572 (eval): stubbed for evaluating functions.
19574 * cs-parser.jay: Pass the defines information
19576 * driver.cs: Add --define command line option.
19578 * decl.cs: Move MemberCore here.
19580 Make it the base class for DeclSpace. This allows us to catch and
19581 report 108 and 109 for everything now.
19583 * class.cs (TypeContainer.Define): Extract all the members
19584 before populating and emit the warning 108 (new keyword required
19585 to override) instead of having each member implement this.
19587 (MemberCore.Define): New abstract method, we will be using this in
19588 the warning reporting engine in Populate.
19590 (Operator.Define): Adjust to new MemberCore protocol.
19592 * const.cs (Const): This does not derive from Expression, it is a
19593 temporary object we use to create fields, it is a MemberCore.
19595 * class.cs (Method.Define): Allow the entry point to be in a
19598 * driver.cs: Rewrite the argument handler to clean it up a bit.
19600 * rootcontext.cs: Made it just an auxiliary namespace feature by
19601 making everything static.
19603 * driver.cs: Adapt code to use RootContext type name instead of
19606 * delegate.cs: Remove RootContext argument.
19608 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19611 * class.cs (Event.Define): The lookup can fail.
19613 * cs-tokenizer.cs: Begin implementation of pre-procesor.
19615 * expression.cs: Resolve the this instance before invoking the code.
19617 2001-12-17 Miguel de Icaza <miguel@ximian.com>
19619 * cs-parser.jay: Add a production in element_access that allows
19620 the thing to become a "type" reference. This way we can parse
19621 things like "(string [])" as a type.
19623 Note that this still does not handle the more complex rules of
19627 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
19629 * ecore.cs: (CopyNewMethods): new utility function used to
19630 assemble the list of methods from running FindMembers.
19632 (MemberLookup): Rework FindMembers so that
19634 2001-12-16 Miguel de Icaza <miguel@ximian.com>
19636 * class.cs (TypeContainer): Remove Delegates who fail to be
19639 * delegate.cs (Populate): Verify that we dont get null return
19640 values. TODO: Check for AsAccessible.
19642 * cs-parser.jay: Use basename to emit error 574 (destructor should
19643 have the same name as container class), not the full name.
19645 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19646 possible representation.
19648 Also implements integer type suffixes U and L.
19650 2001-12-15 Miguel de Icaza <miguel@ximian.com>
19652 * expression.cs (ArrayCreation.DoResolve): We need to do the
19653 argument resolution *always*.
19655 * decl.cs: Make this hold the namespace. Hold the root context as
19657 (LookupType): Move here.
19659 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19661 * location.cs (Row, Name): Fixed the code, it was always returning
19662 references to the first file.
19664 * interface.cs: Register properties defined through interfaces.
19666 * driver.cs: Add support for globbing on the command line
19668 * class.cs (Field): Make it derive from MemberCore as well.
19671 2001-12-15 Ravi Pratap <ravi@ximian.com>
19673 * class.cs (Event::Define): Check that the type of the event is a delegate
19674 type else flag error #66.
19676 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19679 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19680 values of EntryPoint, CharSet etc etc.
19682 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19684 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19685 be null and we should ignore this. I am not sure if this is really clean. Apparently,
19686 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19687 which needs this to do its work.
19689 * ../errors/cs0066.cs : Add.
19691 2001-12-14 Miguel de Icaza <miguel@ximian.com>
19693 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19696 * class.cs: (MethodSignature.MethodSignature): Removed hack that
19697 clears out the parameters field.
19698 (MemberSignatureCompare): Cleanup
19700 (MemberCore): New base class used to share code between MethodCore
19703 (RegisterRequiredImplementations) BindingFlags.Public requires
19704 either BindingFlags.Instace or Static. Use instance here.
19706 (Property): Refactored code to cope better with the full spec.
19708 * parameter.cs (GetParameterInfo): Return an empty array instead
19711 * class.cs (Property): Abstract or extern properties have no bodies.
19713 * parameter.cs (GetParameterInfo): return a zero-sized array.
19715 * class.cs (TypeContainer.MethodModifiersValid): Move all the
19716 method modifier validation to the typecontainer so we can reuse
19717 this on properties.
19719 (MethodCore.ParameterTypes): return an empty sized array of types.
19721 (Property.Define): Test property modifier validity.
19723 Add tests for sealed/override too.
19725 (Method.Emit): abstract or extern methods have no bodies.
19727 2001-12-14 Ravi Pratap <ravi@ximian.com>
19729 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19732 (Method::Define, ::Emit): Modify accordingly.
19734 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19736 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19738 * makefile: Pass in /unsafe.
19740 2001-12-13 Miguel de Icaza <miguel@ximian.com>
19742 * class.cs (MakeKey): Kill routine.
19744 * class.cs (TypeContainer.Define): Correctly define explicit
19745 method implementations (they require the full interface name plus
19748 * typemanager.cs: Deply the PtrHashtable here and stop using the
19749 lame keys. Things work so much better.
19751 This of course broke everyone who depended on `RegisterMethod' to
19752 do the `test for existance' test. This has to be done elsewhere.
19754 * support.cs (PtrHashtable): A hashtable that avoid comparing with
19755 the object stupid Equals method (because, that like fails all over
19756 the place). We still do not use it.
19758 * class.cs (TypeContainer.SetRequiredInterface,
19759 TypeContainer.RequireMethods): Killed these two routines and moved
19760 all the functionality to RegisterRequiredImplementations.
19762 (TypeContainer.RegisterRequiredImplementations): This routine now
19763 registers all the implementations required in an array for the
19764 interfaces and abstract methods. We use an array of structures
19765 which can be computed ahead of time to reduce memory usage and we
19766 also assume that lookups are cheap as most classes will not
19767 implement too many interfaces.
19769 We also avoid creating too many MethodSignatures.
19771 (TypeContainer.IsInterfaceMethod): Update and optionally does not
19772 clear the "pending" bit if we find that there are problems with
19775 (TypeContainer.VerifyPendingMethods): Update to report errors of
19776 methods that look like implementations but are not.
19778 (TypeContainer.Define): Add support for explicit interface method
19781 2001-12-12 Miguel de Icaza <miguel@ximian.com>
19783 * typemanager.cs: Keep track of the parameters here instead of
19784 being a feature of the TypeContainer.
19786 * class.cs: Drop the registration of parameters here, as
19787 InterfaceMethods are also interface declarations.
19789 * delegate.cs: Register methods with the TypeManager not only with
19790 the TypeContainer. This code was buggy.
19792 * interface.cs: Full registation here.
19794 2001-12-11 Miguel de Icaza <miguel@ximian.com>
19796 * expression.cs: Remove reducer for binary expressions, it can not
19799 * const.cs: Put here the code that used to go into constant.cs
19801 * constant.cs: Put here the code for constants, this is a new base
19802 class for Literals.
19804 * literal.cs: Make Literal derive from Constant.
19806 2001-12-09 Miguel de Icaza <miguel@ximian.com>
19808 * statement.cs (Return.Emit): Report error 157 if the user
19809 attempts to return from a finally block.
19811 (Return.Emit): Instead of emitting a return, jump to the end of
19814 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19815 LocalBuilder to store the result of the function. ReturnLabel is
19816 the target where we jump.
19819 2001-12-09 Radek Doulik <rodo@ximian.com>
19821 * cs-parser.jay: remember alias in current namespace
19823 * ecore.cs (SimpleName::DoResolve): use aliases for types or
19826 * class.cs (LookupAlias): lookup alias in my_namespace
19828 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19830 (LookupAlias): lookup alias in this and if needed in parent
19833 2001-12-08 Miguel de Icaza <miguel@ximian.com>
19837 * rootcontext.cs: (ModuleBuilder) Made static, first step into
19838 making things static. I need this to avoid passing the
19839 TypeContainer when calling ParameterType.
19841 * support.cs (InternalParameters.ParameterType): Remove ugly hack
19842 that did string manipulation to compute the type and then call
19843 GetType. Use Parameter.ParameterType instead.
19845 * cs-tokenizer.cs: Consume the suffix for floating values.
19847 * expression.cs (ParameterReference): figure out whether this is a
19848 reference parameter or not. Kill an extra variable by computing
19849 the arg_idx during emission.
19851 * parameter.cs (Parameters.GetParameterInfo): New overloaded
19852 function that returns whether a parameter is an out/ref value or not.
19854 (Parameter.ParameterType): The type of the parameter (base,
19855 without ref/out applied).
19857 (Parameter.Resolve): Perform resolution here.
19858 (Parameter.ExternalType): The full type (with ref/out applied).
19860 * statement.cs (Using.Emit, Using.EmitExpression): Implement
19861 support for expressions on the using statement.
19863 2001-12-07 Miguel de Icaza <miguel@ximian.com>
19865 * statement.cs (Using.EmitLocalVariableDecls): Split the
19866 localvariable handling of the using statement.
19868 (Block.EmitMeta): Keep track of variable count across blocks. We
19869 were reusing slots on separate branches of blocks.
19871 (Try.Emit): Emit the general code block, we were not emitting it.
19873 Check the type of the declaration to be an IDisposable or
19874 something that can be implicity converted to it.
19876 Emit conversions if required.
19878 * ecore.cs (EmptyExpression): New utility class.
19879 (Expression.ImplicitConversionExists): New utility function.
19881 2001-12-06 Miguel de Icaza <miguel@ximian.com>
19883 * statement.cs (Using): Implement.
19885 * expression.cs (LocalVariableReference): Support read only variables.
19887 * statement.cs: Remove the explicit emit for the Leave opcode.
19888 (VariableInfo): Add a readonly field.
19890 2001-12-05 Miguel de Icaza <miguel@ximian.com>
19892 * ecore.cs (ConvCast): new class used to encapsulate the various
19893 explicit integer conversions that works in both checked and
19894 unchecked contexts.
19896 (Expression.ConvertNumericExplicit): Use new ConvCast class to
19897 properly generate the overflow opcodes.
19899 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19901 * statement.cs: The correct type for the EmptyExpression is the
19902 element_type, not the variable type. Ravi pointed this out.
19904 2001-12-04 Ravi Pratap <ravi@ximian.com>
19906 * class.cs (Method::Define): Handle PInvoke methods specially
19907 by using DefinePInvokeMethod instead of the usual one.
19909 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19910 above to do the task of extracting information and defining the method.
19912 2001-12-04 Ravi Pratap <ravi@ximian.com>
19914 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19915 of the condition for string type.
19917 (Emit): Move that here.
19919 (ArrayCreation::CheckIndices): Keep string literals in their expression
19922 (EmitDynamicInitializers): Handle strings appropriately.
19924 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19926 * codegen.cs (EmitContext): Replace multiple variables with a
19927 single pointer to the current Switch statement.
19929 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19932 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19936 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19939 (Foreach.Emit): Foreach on arrays was not setting
19940 up the loop variables (for break/continue).
19942 (GotoCase): Semi-implented.
19944 2001-12-03 Ravi Pratap <ravi@ximian.com>
19946 * attribute.cs (CheckAttribute): Handle system attributes by using
19947 Attribute.GetAttributes to examine information we need.
19949 (GetValidPlaces): Same here.
19951 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19953 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19955 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19957 (Method::Define): Set appropriate flags if we have a DllImport attribute.
19959 (Method::Emit): Handle the case when we are a PInvoke method.
19961 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19963 * expression.cs: Use ResolveWithSimpleName on compound names.
19965 2001-12-02 Ravi Pratap <ravi@ximian.com>
19967 * constant.cs (EmitConstant): Make sure we resolve the associated expression
19968 before trying to reduce it.
19970 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19972 * constant.cs (LookupConstantValue): Implement.
19974 (EmitConstant): Use the above in emitting the constant.
19976 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19977 that are user-defined by doing a LookupConstantValue on them.
19979 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19982 2001-11-29 Miguel de Icaza <miguel@ximian.com>
19984 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19986 (BaseAccess.DoResolve): Implement.
19988 (MemberAccess.DoResolve): Split this routine into a
19989 ResolveMemberAccess routine that can be used independently
19991 2001-11-28 Miguel de Icaza <miguel@ximian.com>
19993 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19994 As that share bits of the implementation. Is returns a boolean,
19995 while As returns the Type that is being probed.
19997 2001-12-01 Ravi Pratap <ravi@ximian.com>
19999 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20000 instead of a Literal - much easier.
20002 (EnumInTransit): Remove - utterly useless :-)
20004 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20006 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20008 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20009 chain when we have no associated expression.
20011 2001-11-30 Ravi Pratap <ravi@ximian.com>
20013 * constant.cs (Define): Use Location while reporting the errror.
20015 Also emit a warning when 'new' is used and there is no inherited
20018 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
20021 (LookupEnumValue): Implement to lookup an enum member's value and define it
20024 (Populate): Re-write accordingly to use the above routine.
20026 2001-11-27 Miguel de Icaza <miguel@ximian.com>
20028 * expression.cs (This): Fix prototype for DoResolveLValue to
20029 override the base class DoResolveLValue.
20031 * cs-parser.cs: Report errors cs574 and cs575 (destructor
20034 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20035 (we need to load the address of the field here). This fixes
20038 (FieldExpr.DoResolveLValue): Call the DoResolve
20039 function to initialize the Instance expression.
20041 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20042 correctly the GetEnumerator operation on a value type.
20044 * cs-parser.jay: Add more simple parsing error catches.
20046 * statement.cs (Switch): Add support for string switches.
20047 Handle null specially.
20049 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
20051 2001-11-28 Ravi Pratap <ravi@ximian.com>
20053 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20055 (declare_local_constant): New helper function.
20057 * statement.cs (AddConstant): Keep a separate record of constants
20059 (IsConstant): Implement to determine if a variable is a constant.
20061 (GetConstantExpression): Implement.
20063 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20065 * statement.cs (IsVariableDefined): Re-write.
20067 2001-11-27 Ravi Pratap <ravi@ximian.com>
20069 * class.cs (TypeContainer::FindMembers): Look for constants
20070 in the case when we are looking for MemberTypes.Field
20072 * expression.cs (MemberAccess::DoResolve): Check that in the
20073 case we are a FieldExpr and a Literal, we are not being accessed
20074 by an instance reference.
20076 * cs-parser.jay (local_constant_declaration): Implement.
20078 (declaration_statement): Implement for constant declarations.
20080 2001-11-26 Miguel de Icaza <miguel@ximian.com>
20082 * statement.cs (Switch): Catch double defaults.
20084 (Switch): More work on the switch() statement
20085 implementation. It works for integral values now, need to finish
20089 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20091 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20092 integer literals into other integer literals. To be used by
20095 2001-11-24 Ravi Pratap <ravi@ximian.com>
20097 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20100 (EmitDynamicInitializers): Cope with the above since we extract data
20101 directly from ArrayData now.
20103 (ExpectInitializers): Keep track of whether initializers are mandatory
20106 (Bounds): Make it a hashtable to prevent the same dimension being
20107 recorded for every element in that dimension.
20109 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20112 Also fix bug which was causing the indices to be emitted in the reverse
20115 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20117 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20118 unfinished. They do not work, because the underlying code is
20121 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20123 * cs-parser.jay: Remove bogus fixme.
20125 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20126 on Switch statement.
20128 2001-11-23 Ravi Pratap <ravi@ximian.com>
20130 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20133 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20134 parameter. Apparently, any expression is allowed.
20136 (ValidateInitializers): Update accordingly.
20138 (CheckIndices): Fix some tricky bugs thanks to recursion.
20140 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
20141 I was being completely brain-dead.
20143 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20144 and re-write acordingly.
20146 (DelegateInvocation): Re-write accordingly.
20148 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20150 (MakeByteBlob): Handle types more correctly.
20152 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20153 initialization from expressions but it is incomplete because I am a complete
20156 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20158 * statement.cs (If.Emit): Fix a bug that generated incorrect code
20159 on If. Basically, we have to return `true' (ie, we do return to
20160 our caller) only if both branches of the if return.
20162 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20163 short-circuit operators, handle them as short circuit operators.
20165 (Cast.DoResolve): Resolve type.
20166 (Cast.Cast): Take an expression as the target type.
20168 * cs-parser.jay (cast_expression): Remove old hack that only
20169 allowed a limited set of types to be handled. Now we take a
20170 unary_expression and we resolve to a type during semantic
20173 Use the grammar productions from Rhys to handle casts (this is
20174 not complete like Rhys syntax yet, we fail to handle that corner
20175 case that C# has regarding (-x), but we will get there.
20177 2001-11-22 Ravi Pratap <ravi@ximian.com>
20179 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20180 field which is an array type.
20182 * cs-parser.jay (declare_local_variables): Support array initialization too.
20184 * typemanager.cs (MakeKey): Implement.
20186 (everywhere): Use the above appropriately.
20188 * cs-parser.jay (for_statement): Update for array initialization while
20189 declaring variables.
20191 * ecore.cs : The error message was correct, it's the variable's names that
20192 were misleading ;-) Make the code more readable.
20194 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20195 the correct type etc.
20197 (ConvertExplicit): Handle Enum types by examining the underlying type.
20199 2001-11-21 Ravi Pratap <ravi@ximian.com>
20201 * parameter.cs (GetCallingConvention): Always return
20202 CallingConventions.Standard for now.
20204 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20206 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20207 and `r' after calling DoNumericPromotions.
20209 * ecore.cs: Fix error message (the types were in the wrong order).
20211 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20212 BindingFlags.Instance as well
20214 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20215 implicit int literal conversion in an empty cast so that we
20216 propagate the right type upstream.
20218 (UnboxCast): new class used to unbox value types.
20219 (Expression.ConvertExplicit): Add explicit type conversions done
20222 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20223 the target type before applying the implicit LongLiterals to ULong
20226 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20228 * cs-parser.jay (for_statement): Reworked the way For works: now
20229 we declare manually any variables that are introduced in
20230 for_initializer to solve the problem of having out-of-band code
20231 emition (that is what got for broken).
20233 (declaration_statement): Perform the actual variable declaration
20234 that used to be done in local_variable_declaration here.
20236 (local_variable_declaration): Do not declare anything, just pass
20237 the information on a DictionaryEntry
20239 2001-11-20 Ravi Pratap <ravi@ximian.com>
20241 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20242 re-write of the logic to now make it recursive.
20244 (UpdateIndices): Re-write accordingly.
20246 Store element data in a separate ArrayData list in the above methods.
20248 (MakeByteBlob): Implement to dump the array data into a byte array.
20250 2001-11-19 Ravi Pratap <ravi@ximian.com>
20252 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20255 * constant.cs (Define): Implement.
20257 (EmitConstant): Re-write fully.
20259 Pass in location info.
20261 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20264 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20265 DictionaryEntry since we need location info too.
20267 (constant_declaration): Update accordingly.
20269 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20270 code into another method : UpdateIndices.
20272 2001-11-18 Ravi Pratap <ravi@ximian.com>
20274 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20275 some type checking etc.
20277 2001-11-17 Ravi Pratap <ravi@ximian.com>
20279 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20280 bits to provide dimension info if the user skips doing that.
20282 Update second constructor to store the rank correctly.
20284 2001-11-16 Ravi Pratap <ravi@ximian.com>
20286 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20287 and try to implement.
20289 * ../errors/cs0150.cs : Add.
20291 * ../errors/cs0178.cs : Add.
20293 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20295 * statement.cs: Implement foreach on multi-dimensional arrays.
20297 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20298 name of the params argument.
20300 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20301 initializing the array.
20303 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20304 we can use this elsewhere.
20306 * statement.cs: Finish implementation of foreach for single
20309 * cs-parser.jay: Use an out-of-band stack to pass information
20310 around, I wonder why I need this.
20312 foreach_block: Make the new foreach_block the current_block.
20314 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20315 function used to return a static Parameters structure. Used for
20316 empty parameters, as those are created very frequently.
20318 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20320 2001-11-15 Ravi Pratap <ravi@ximian.com>
20322 * interface.cs : Default modifier is private, not public. The
20323 make verify test passes again.
20325 2001-11-15 Ravi Pratap <ravi@ximian.com>
20327 * support.cs (ReflectionParameters): Fix logic to determine
20328 whether the last parameter is a params one. Test 9 passes again.
20330 * delegate.cs (Populate): Register the builders we define with
20331 RegisterParameterForBuilder. Test 19 passes again.
20333 * cs-parser.jay (property_declaration): Reference $6 instead
20334 of $$ to get at the location.
20336 (indexer_declaration): Similar stuff.
20338 (attribute): Ditto.
20340 * class.cs (Property): Register parameters for the Get and Set methods
20341 if they exist. Test 23 passes again.
20343 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20344 call to EmitArguments as we are sure there aren't any params arguments.
20345 Test 32 passes again.
20347 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20348 IndexOutOfRangeException.
20350 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20351 Test 33 now passes again.
20353 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20355 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20356 broke a bunch of things. Will have to come up with a better way
20357 of tracking locations.
20359 * statement.cs: Implemented foreach for single dimension arrays.
20361 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20363 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20364 an error. This removes the lookup from the critical path.
20366 * cs-parser.jay: Removed use of temporary_loc, which is completely
20369 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20371 * support.cs (ReflectionParameters.ParameterModifier): Report
20372 whether the argument is a PARAMS argument or not.
20374 * class.cs: Set the attribute `ParamArrayAttribute' on the
20375 parameter argument.
20377 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20378 and cons_param_array_attribute (ConstructorInfo for
20379 ParamArrayAttribute).,
20381 * codegen.cs: Emit the return using the `Return' statement, that
20382 way we can report the error correctly for missing return values.
20384 * class.cs (Method.Emit): Clean up.
20386 * expression.cs (Argument.Resolve): Take another argument: the
20387 location where this argument is used. Notice that this is not
20388 part of the "Argument" class as to reduce the size of the
20389 structure (we know the approximate location anyways).
20391 Test if the argument is a variable-reference, if not, then
20392 complain with a 206.
20394 (Argument.Emit): Emit addresses of variables.
20396 (Argument.FullDesc): Simplify.
20398 (Invocation.DoResolve): Update for Argument.Resolve.
20400 (ElementAccess.DoResolve): ditto.
20402 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20403 method should be virtual, as this method is always virtual.
20405 (NewDelegate.DoResolve): Update for Argument.Resolve.
20407 * class.cs (ConstructorInitializer.DoResolve): ditto.
20409 * attribute.cs (Attribute.Resolve): ditto.
20411 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20413 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20415 * expression.cs (ParameterReference): Drop IStackStorage and implement
20416 IAssignMethod instead.
20418 (LocalVariableReference): ditto.
20420 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20421 IAssignMethod instead.
20423 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20425 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20426 enumerations that are used in heavily used structures derive from
20427 byte in a laughable and pathetic attempt to reduce memory usage.
20428 This is the kind of pre-optimzations that you should not do at
20429 home without adult supervision.
20431 * expression.cs (UnaryMutator): New class, used to handle ++ and
20432 -- separatedly from the other unary operators. Cleans up the
20433 code, and kills the ExpressionStatement dependency in Unary.
20435 (Unary): Removed `method' and `Arguments' from this class, making
20436 it smaller, and moving it all to SimpleCall, so I can reuse this
20437 code in other locations and avoid creating a lot of transient data
20438 strucutres when not required.
20440 * cs-parser.jay: Adjust for new changes.
20442 2001-11-11 Miguel de Icaza <miguel@ximian.com>
20444 * enum.cs (Enum.Populate): If there is a failure during
20447 * cs-parser.jay (opt_enum_base): we used to catch type errors
20448 here, but this is really incorrect. The type error should be
20449 catched during semantic analysis.
20451 2001-12-11 Ravi Pratap <ravi@ximian.com>
20453 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20454 current_local_parameters as expected since I, in my stupidity, had forgotten
20457 * attribute.cs (GetValidPlaces): Fix stupid bug.
20459 * class.cs (Method::Emit): Perform check on applicability of attributes.
20461 (Constructor::Emit): Ditto.
20463 (Field::Emit): Ditto.
20465 (Field.Location): Store location information.
20467 (Property, Event, Indexer, Operator): Ditto.
20469 * cs-parser.jay (field_declaration): Pass in location for each field.
20471 * ../errors/cs0592.cs : Add.
20473 2001-11-12 Ravi Pratap <ravi@ximian.com>
20475 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20477 (InitCoreTypes): Update accordingly.
20479 (RegisterAttrType, LookupAttr): Implement.
20481 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20482 info about the same.
20484 (Resolve): Update to populate the above as necessary.
20486 (Error592): Helper.
20488 (GetValidPlaces): Helper to the above.
20490 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20492 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20494 2001-11-12 Ravi Pratap <ravi@ximian.com>
20496 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20498 * ../errors/cs0617.cs : Add.
20500 2001-11-11 Ravi Pratap <ravi@ximian.com>
20502 * enum.cs (Emit): Rename to Populate to be more consistent with what
20503 we expect it to do and when exactly it is called.
20505 * class.cs, rootcontext.cs : Update accordingly.
20507 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20508 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20510 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20512 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20513 of a fieldinfo using the above, when dealing with a FieldBuilder.
20515 2001-11-10 Ravi Pratap <ravi@ximian.com>
20517 * ../errors/cs0031.cs : Add.
20519 * ../errors/cs1008.cs : Add.
20521 * ../errrors/cs0543.cs : Add.
20523 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20526 (FindMembers): Implement.
20528 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20529 enums and delegates too.
20531 (enum_types): Rename to builder_to_enum.
20533 (delegate_types): Rename to builder_to_delegate.
20535 * delegate.cs (FindMembers): Implement.
20537 2001-11-09 Ravi Pratap <ravi@ximian.com>
20539 * typemanager.cs (IsEnumType): Implement.
20541 * enum.cs (Emit): Re-write parts to account for the underlying type
20542 better and perform checking etc.
20544 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20545 of the underlying type.
20547 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20550 * enum.cs (error31): Helper to report error #31.
20552 * cs-parser.jay (enum_declaration): Store location of each member too.
20554 * enum.cs (member_to_location): New hashtable.
20556 (AddEnumMember): Update location hashtable.
20558 (Emit): Use the location of each member while reporting errors.
20560 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20562 * cs-parser.jay: A for_initializer if is a
20563 local_variable_declaration really ammount to have an implicit
20564 block with the variable declaration and no initializer for for.
20566 * statement.cs (For.Emit): Cope with null initializers.
20568 This fixes the infinite loop on for initializers.
20570 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20572 * enum.cs: More cleanup.
20574 * ecore.cs: Remove dead code.
20576 * class.cs (Property.Emit): More simplification.
20577 (Event.Emit): ditto.
20579 Reworked to have less levels of indentation.
20581 2001-11-08 Ravi Pratap <ravi@ximian.com>
20583 * class.cs (Property): Emit attributes.
20593 * enum.cs (Emit): Ditto.
20595 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20598 * class.cs (Field, Event, etc.): Move attribute generation into the
20599 Emit method everywhere.
20601 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20602 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20603 as we had no way of defining nested enums !
20605 * rootcontext.cs : Adjust code accordingly.
20607 * typemanager.cs (AddEnumType): To keep track of enum types separately.
20609 2001-11-07 Ravi Pratap <ravi@ximian.com>
20611 * expression.cs (EvalConstantExpression): Move into ecore.cs
20613 * enum.cs (Enum): Rename some members and make them public and readonly
20614 according to our convention.
20616 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20619 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20621 (Enum::Emit): Write a simple version for now which doesn't try to compute
20622 expressions. I shall modify this to be more robust in just a while.
20624 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20626 (TypeContainer::CloseType): Create the Enum types too.
20628 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20630 * expression.cs (EvalConstantExpression): Get rid of completely.
20632 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20633 user-defined values and other cases.
20635 (IsValidEnumLiteral): Helper function.
20637 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
20638 out there in the case we had a literal FieldExpr.
20640 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20642 (Literalize): Revamp a bit to take two arguments.
20644 (EnumLiteral): New class which derives from Literal to wrap enum literals.
20646 2001-11-06 Ravi Pratap <ravi@ximian.com>
20648 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20650 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20652 (Resolve): Use the above to ensure we have proper initializers.
20654 2001-11-05 Ravi Pratap <ravi@ximian.com>
20656 * expression.cs (Expression::EvalConstantExpression): New method to
20657 evaluate constant expressions.
20659 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20661 2001-11-07 Miguel de Icaza <miguel@ximian.com>
20663 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20666 (Binary.ResolveOperator): Handle operator != (object a, object b)
20667 and operator == (object a, object b);
20669 (Binary.DoNumericPromotions): Indicate whether the numeric
20670 promotion was possible.
20672 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20675 Made the ArrayAccess implement interface IAssignMethod instead of
20676 IStackStore as the order in which arguments are passed reflects
20679 * assign.cs: Instead of using expr.ExprClass to select the way of
20680 assinging, probe for the IStackStore/IAssignMethod interfaces.
20682 * typemanager.cs: Load InitializeArray definition.
20684 * rootcontext.cs (RootContext.MakeStaticData): Used to define
20685 static data that can be used to initialize arrays.
20687 2001-11-05 Miguel de Icaza <miguel@ximian.com>
20689 * expression.cs: Handle operator== and operator!= for booleans.
20691 (Conditioal.Reduce): Implement reducer for the ?: operator.
20693 (Conditional.Resolve): Implement dead code elimination.
20695 (Binary.Resolve): Catch string literals and return a new
20696 concatenated string.
20698 (Unary.Reduce): Implement reduction of unary expressions.
20700 * ecore.cs: Split out the expression core handling here.
20702 (Expression.Reduce): New method used to perform constant folding
20703 and CSE. This is needed to support constant-expressions.
20705 * statement.cs (Statement.EmitBoolExpression): Pass true and false
20706 targets, and optimize for !x.
20708 2001-11-04 Ravi Pratap <ravi@ximian.com>
20710 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20711 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20712 set custom atttributes.
20714 * literal.cs (Literal::GetValue): New abstract method to return the actual
20715 value of the literal, cast as an object.
20717 (*Literal): Implement GetValue method.
20719 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20720 expressions to the arraylist but objects of type Argument.
20722 * class.cs (TypeContainer::Emit): Emit our attributes too.
20724 (Method::Emit, Constructor::Emit): Ditto.
20726 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20727 to be ignoring earlier.
20729 2001-11-03 Ravi Pratap <ravi@ximian.com>
20731 * attribute.cs (AttributeSection::Define): Implement to do the business
20732 of constructing a CustomAttributeBuilder.
20734 (Attribute): New trivial class. Increases readability of code.
20736 * cs-parser.jay : Update accordingly.
20738 (positional_argument_list, named_argument_list, named_argument): New rules
20740 (attribute_arguments): Use the above so that we are more correct.
20742 2001-11-02 Ravi Pratap <ravi@ximian.com>
20744 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20745 to perform all checks for a method with a params parameter.
20747 (Invocation::OverloadResolve): Update to use the above method and therefore
20748 cope correctly with params method invocations.
20750 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
20753 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20754 constructors in our parent too because we can't afford to miss out on
20757 * attribute.cs (AttributeSection): New name for the class Attribute
20759 Other trivial changes to improve readability.
20761 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20762 use the new class names.
20764 2001-11-01 Ravi Pratap <ravi@ximian.com>
20766 * class.cs (Method::Define): Complete definition for params types too
20768 (Indexer::Define): Ditto.
20770 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20771 Cope everywhere with a request for info about the array parameter.
20773 2001-11-01 Ravi Pratap <ravi@ximian.com>
20775 * tree.cs (RecordNamespace): Fix up to check for the correct key.
20777 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
20778 local_variable_type to extract the string corresponding to the type.
20780 (local_variable_type): Fixup the action to use the new helper method.
20782 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
20785 * expression.cs : Clean out code which uses the above.
20787 2001-10-31 Ravi Pratap <ravi@ximian.com>
20789 * typemanager.cs (RegisterMethod): Check if we already have an existing key
20790 and bale out if necessary by returning a false.
20792 (RegisterProperty): Ditto.
20794 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20795 and print out appropriate error messages.
20797 * interface.cs (everywhere): Ditto.
20799 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20800 location to constructor.
20802 * class.cs (Property, Event, Indexer): Update accordingly.
20804 * ../errors/cs111.cs : Added.
20806 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20807 of a method, as laid down by the spec.
20809 (Invocation::OverloadResolve): Use the above method.
20811 2001-10-31 Ravi Pratap <ravi@ximian.com>
20813 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20814 now take a TypeContainer and a Parameters object.
20816 (ParameterData): Modify return type of ParameterModifier method to be
20817 Parameter.Modifier and not a string.
20819 (ReflectionParameters, InternalParameters): Update accordingly.
20821 * expression.cs (Argument::GetParameterModifier): Same here.
20823 * support.cs (InternalParameters::ParameterType): Find a better way of determining
20824 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20825 symbol in it at all so maybe this is only for now.
20827 2001-10-30 Ravi Pratap <ravi@ximian.com>
20829 * support.cs (InternalParameters): Constructor now takes an extra argument
20830 which is the actual Parameters class.
20832 (ParameterDesc): Update to provide info on ref/out modifiers.
20834 * class.cs (everywhere): Update call to InternalParameters to pass in
20835 the second argument too.
20837 * support.cs (ParameterData): Add ParameterModifier, which is a method
20838 to return the modifier info [ref/out etc]
20840 (InternalParameters, ReflectionParameters): Implement the above.
20842 * expression.cs (Argument::ParameterModifier): Similar function to return
20843 info about the argument's modifiers.
20845 (Invocation::OverloadResolve): Update to take into account matching modifiers
20848 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20849 a new SetFormalParameters object which we pass to InternalParameters.
20851 2001-10-30 Ravi Pratap <ravi@ximian.com>
20853 * expression.cs (NewArray): Merge into the ArrayCreation class.
20855 2001-10-29 Ravi Pratap <ravi@ximian.com>
20857 * expression.cs (NewArray): Merge classes NewBuiltinArray and
20858 NewUserdefinedArray into one as there wasn't much of a use in having
20861 * expression.cs (Argument): Change field's name to ArgType from Type.
20863 (Type): New readonly property which returns the proper type, taking into
20864 account ref/out modifiers.
20866 (everywhere): Adjust code accordingly for the above.
20868 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20869 whether we are emitting for a ref or out parameter.
20871 * expression.cs (Argument::Emit): Use the above field to set the state.
20873 (LocalVariableReference::Emit): Update to honour the flag and emit the
20876 * parameter.cs (Attributes): Set the correct flags for ref parameters.
20878 * expression.cs (Argument::FullDesc): New function to provide a full desc.
20880 * support.cs (ParameterData): Add method ParameterDesc to the interface.
20882 (ReflectionParameters, InternalParameters): Implement the above method.
20884 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20887 (Invocation::FullMethodDesc): Ditto.
20889 2001-10-29 Miguel de Icaza <miguel@ximian.com>
20891 * cs-parser.jay: Add extra production for the second form of array
20894 * expression.cs (ArrayCreation): Update to reflect the above
20897 * Small changes to prepare for Array initialization.
20899 2001-10-28 Miguel de Icaza <miguel@ximian.com>
20901 * typemanager.cs (ImplementsInterface): interface might be null;
20902 Deal with this problem;
20904 Also, we do store negative hits on the cache (null values), so use
20905 this instead of calling t.GetInterfaces on the type everytime.
20907 2001-10-28 Ravi Pratap <ravi@ximian.com>
20909 * typemanager.cs (IsBuiltinType): New method to help determine the same.
20911 * expression.cs (New::DoResolve): Get rid of array creation code and instead
20912 split functionality out into different classes.
20914 (New::FormArrayType): Move into NewBuiltinArray.
20916 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20919 (NewBuiltinArray): New class to handle creation of built-in arrays.
20921 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20922 account creation of one-dimensional arrays.
20924 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20926 (NewUserdefinedArray::DoResolve): Implement.
20928 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20930 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20931 we maintain inside the TypeManager. This is necessary to perform lookups on the
20934 (LookupType): Update to perform GetType on the module builders too.
20936 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20938 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20940 2001-10-23 Ravi Pratap <ravi@ximian.com>
20942 * expression.cs (New::DoResolve): Implement guts of array creation.
20944 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20946 2001-10-27 Miguel de Icaza <miguel@ximian.com>
20948 * expression.cs: Fix bug I introduced lsat night that broke
20951 (Expression.Resolve): Report a 246 error (can not resolve name)
20952 if we find a SimpleName in the stream.
20954 (Expression.ResolveLValue): Ditto.
20956 (Expression.ResolveWithSimpleName): This function is a variant of
20957 ResolveName, this one allows SimpleNames to be returned without a
20958 warning. The only consumer of SimpleNames is MemberAccess
20960 2001-10-26 Miguel de Icaza <miguel@ximian.com>
20962 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20963 might arrive here. I have my doubts that this is correct.
20965 * statement.cs (Lock): Implement lock statement.
20967 * cs-parser.jay: Small fixes to support `lock' and `using'
20969 * cs-tokenizer.cs: Remove extra space
20971 * driver.cs: New flag --checked, allows to turn on integer math
20974 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20975 Threading.Monitor.Exit
20977 2001-10-23 Miguel de Icaza <miguel@ximian.com>
20979 * expression.cs (IndexerAccess::DoResolveLValue): Set the
20980 Expression Class to be IndexerAccess.
20982 Notice that Indexer::DoResolve sets the eclass to Value.
20984 2001-10-22 Miguel de Icaza <miguel@ximian.com>
20986 * class.cs (TypeContainer::Emit): Emit code for indexers.
20988 * assign.cs (IAssignMethod): New interface implemented by Indexers
20989 and Properties for handling assignment.
20991 (Assign::Emit): Simplify and reuse code.
20993 * expression.cs (IndexerAccess, PropertyExpr): Implement
20994 IAssignMethod, clean up old code.
20996 2001-10-22 Ravi Pratap <ravi@ximian.com>
20998 * typemanager.cs (ImplementsInterface): New method to determine if a type
20999 implements a given interface. Provides a nice cache too.
21001 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21004 (ConvertReferenceExplicit): Ditto.
21006 * delegate.cs (Delegate::Populate): Update to define the parameters on the
21007 various methods, with correct names etc.
21009 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
21010 Operator.UnaryNegation.
21012 * cs-parser.jay (operator_declarator): Be a little clever in the case where
21013 we have a unary plus or minus operator.
21015 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
21018 * everywhere : update accordingly.
21020 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21023 * class.cs (Method::Define): For the case where we are implementing a method
21024 inherited from an interface, we need to set the MethodAttributes.Final flag too.
21025 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21027 2001-10-21 Ravi Pratap <ravi@ximian.com>
21029 * interface.cs (FindMembers): Implement to work around S.R.E
21032 * typemanager.cs (IsInterfaceType): Implement.
21034 (FindMembers): Update to handle interface types too.
21036 * expression.cs (ImplicitReferenceConversion): Re-write bits which
21037 use IsAssignableFrom as that is not correct - it doesn't work.
21039 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21040 and accordingly override EmitStatement.
21042 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21043 using the correct logic :-)
21045 2001-10-19 Ravi Pratap <ravi@ximian.com>
21047 * ../errors/cs-11.cs : Add to demonstrate error -11
21049 2001-10-17 Miguel de Icaza <miguel@ximian.com>
21051 * assign.cs (Assign::Resolve): Resolve right hand side first, and
21052 then pass this as a hint to ResolveLValue.
21054 * expression.cs (FieldExpr): Add Location information
21056 (FieldExpr::LValueResolve): Report assignment to readonly
21059 (Expression::ExprClassFromMemberInfo): Pass location information.
21061 (Expression::ResolveLValue): Add new method that resolves an
21064 (Expression::DoResolveLValue): Default invocation calls
21067 (Indexers): New class used to keep track of indexers in a given
21070 (IStackStore): Renamed from LValue, as it did not really describe
21071 what this did. Also ResolveLValue is gone from this interface and
21072 now is part of Expression.
21074 (ElementAccess): Depending on the element access type
21076 * typemanager.cs: Add `indexer_name_type' as a Core type
21077 (System.Runtime.CompilerServices.IndexerNameAttribute)
21079 * statement.cs (Goto): Take a location.
21081 2001-10-18 Ravi Pratap <ravi@ximian.com>
21083 * delegate.cs (Delegate::VerifyDelegate): New method to verify
21084 if two delegates are compatible.
21086 (NewDelegate::DoResolve): Update to take care of the case when
21087 we instantiate a delegate from another delegate.
21089 * typemanager.cs (FindMembers): Don't even try to look up members
21090 of Delegate types for now.
21092 2001-10-18 Ravi Pratap <ravi@ximian.com>
21094 * delegate.cs (NewDelegate): New class to take care of delegate
21097 * expression.cs (New): Split the delegate related code out into
21098 the NewDelegate class.
21100 * delegate.cs (DelegateInvocation): New class to handle delegate
21103 * expression.cs (Invocation): Split out delegate related code into
21104 the DelegateInvocation class.
21106 2001-10-17 Ravi Pratap <ravi@ximian.com>
21108 * expression.cs (New::DoResolve): Implement delegate creation fully
21109 and according to the spec.
21111 (New::DoEmit): Update to handle delegates differently.
21113 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21114 because of which we were printing out arguments in reverse order !
21116 * delegate.cs (VerifyMethod): Implement to check if the given method
21117 matches the delegate.
21119 (FullDelegateDesc): Implement.
21121 (VerifyApplicability): Implement.
21123 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21124 delegate invocations too.
21126 (Invocation::Emit): Ditto.
21128 * ../errors/cs1593.cs : Added.
21130 * ../errors/cs1594.cs : Added.
21132 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21134 2001-10-16 Ravi Pratap <ravi@ximian.com>
21136 * typemanager.cs (intptr_type): Core type for System.IntPtr
21138 (InitCoreTypes): Update for the same.
21140 (iasyncresult_type, asynccallback_type): Ditto.
21142 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21145 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21148 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21149 the builders for the 4 members of a delegate type :-)
21151 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21154 * expression.cs (New::DoResolve): Implement guts for delegate creation.
21156 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21158 2001-10-15 Miguel de Icaza <miguel@ximian.com>
21160 * statement.cs (Break::Emit): Implement.
21161 (Continue::Emit): Implement.
21163 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
21164 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
21165 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
21166 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
21169 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21170 properties that track the label for the current loop (begin of the
21171 loop and end of the loop).
21173 2001-10-15 Ravi Pratap <ravi@ximian.com>
21175 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21176 use of emitting anything at all.
21178 * class.cs, rootcontext.cs : Get rid of calls to the same.
21180 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21182 (Populate): Define the constructor correctly and set the implementation
21185 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21188 (AddDelegateType): Implement.
21190 (IsDelegateType): Implement helper method.
21192 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21194 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21195 and accordingly handle it.
21197 * delegate.cs (Populate): Take TypeContainer argument.
21198 Implement bits to define the Invoke method. However, I still haven't figured out
21199 how to take care of the native int bit :-(
21201 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21202 Qualify the name of the delegate, not its return type !
21204 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21207 (StandardConversionExists): Checking for array types turns out to be recursive.
21209 (ConvertReferenceExplicit): Implement array conversion.
21211 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21213 2001-10-12 Ravi Pratap <ravi@ximian.com>
21215 * cs-parser.jay (delegate_declaration): Store the fully qualified
21216 name as it is a type declaration.
21218 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21221 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21222 as TypeContainer::DefineType.
21224 (Populate): Method in which all the definition of the various methods (Invoke)
21227 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21230 (CloseDelegate): Finally creates the delegate.
21232 * class.cs (TypeContainer::DefineType): Update to define delegates.
21233 (Populate, Emit and CloseType): Do the same thing here too.
21235 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21236 delegates in all these operations.
21238 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21240 * expression.cs: LocalTemporary: a new expression used to
21241 reference a temporary that has been created.
21243 * assign.cs: Handle PropertyAccess back here, so that we can
21244 provide the proper semantic access to properties.
21246 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21247 a few more explicit conversions.
21249 * modifiers.cs: `NEW' modifier maps to HideBySig.
21251 * expression.cs (PropertyExpr): Make this into an
21252 ExpressionStatement, and support the EmitStatement code path.
21254 Perform get/set error checking, clean up the interface.
21256 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21257 them into toplevel access objects.
21259 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21261 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21264 * typemanager.cs: Keep track here of our PropertyBuilders again to
21265 work around lameness in SRE.
21267 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21269 * expression.cs (LValue::LValueResolve): New method in the
21270 interface, used to perform a second resolution pass for LValues.
21272 (This::DoResolve): Catch the use of this in static methods.
21274 (This::LValueResolve): Implement.
21276 (This::Store): Remove warning, assigning to `this' in structures
21279 (Invocation::Emit): Deal with invocation of
21280 methods on value types. We need to pass the address to structure
21281 methods rather than the object itself. (The equivalent code to
21282 emit "this" for structures leaves the entire structure on the
21283 stack instead of a pointer to it).
21285 (ParameterReference::DoResolve): Compute the real index for the
21286 argument based on whether the method takes or not a `this' pointer
21287 (ie, the method is static).
21289 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21290 value types returned from functions when we need to invoke a
21291 method on the sturcture.
21294 2001-10-11 Ravi Pratap <ravi@ximian.com>
21296 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21297 defining the type in the Modulebuilder or Typebuilder. This is to take
21298 care of nested types which need to be defined on the TypeBuilder using
21299 DefineNestedMethod.
21301 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21302 methods in RootContext, only ported to be part of TypeContainer.
21304 (TypeContainer::GetInterfaceOrClass): Ditto.
21306 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21308 * interface.cs (Interface::DefineInterface): New method. Does exactly
21309 what RootContext.CreateInterface did earlier, only it takes care of nested types
21312 (Interface::GetInterfaces): Move from RootContext here and port.
21314 (Interface::GetInterfaceByName): Same here.
21316 * rootcontext.cs (ResolveTree): Re-write.
21318 (PopulateTypes): Re-write.
21320 * class.cs (TypeContainer::Populate): Populate nested types too.
21321 (TypeContainer::Emit): Emit nested members too.
21323 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21324 instead just use the name argument passed in as it is already fully
21327 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21328 to TypeContainer mapping to see if a type is user-defined.
21330 * class.cs (TypeContainer::CloseType): Implement.
21332 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21333 the default constructor.
21335 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21338 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21340 * interface.cs (CloseType): Create the type here.
21342 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21345 Remove all the methods which are now in TypeContainer.
21347 2001-10-10 Ravi Pratap <ravi@ximian.com>
21349 * delegate.cs (Define): Re-write bits to define the delegate
21352 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21354 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21356 * expression.cs (ImplicitReferenceConversion): handle null as well
21357 as a source to convert to any reference type.
21359 * statement.cs (Return): Perform any implicit conversions to
21360 expected return type.
21362 Validate use of return statement.
21364 * codegen.cs (EmitContext): Pass the expected return type here.
21366 * class.cs (Method, Constructor, Property): Pass expected return
21367 type to EmitContext.
21369 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21371 * expression.cs: Make DoResolve take an EmitContext instead of a
21374 Replaced `l' and `location' for `loc', for consistency.
21376 (Error, Warning): Remove unneeded Tc argument.
21378 * assign.cs, literal.cs, constant.cs: Update to new calling
21381 * codegen.cs: EmitContext now contains a flag indicating whether
21382 code is being generated in a static method or not.
21384 * cs-parser.jay: DecomposeQI, new function that replaces the old
21385 QualifiedIdentifier. Now we always decompose the assembled
21386 strings from qualified_identifier productions into a group of
21389 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21391 * rootcontext.cs: Deal with field-less struct types correctly now
21392 by passing the size option to Define Type.
21394 * class.cs: Removed hack that created one static field.
21396 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21398 * statement.cs: Moved most of the code generation here.
21400 2001-10-09 Ravi Pratap <ravi@ximian.com>
21402 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21405 (ElementAccess): Remove useless bits for now - keep checks as the spec
21408 2001-10-08 Ravi Pratap <ravi@ximian.com>
21410 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21411 and start performing checks according to the spec.
21413 2001-10-07 Ravi Pratap <ravi@ximian.com>
21415 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21416 rank_specifiers instead.
21418 (rank_specifiers): Change the order in which the rank specifiers are stored
21420 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21422 * expression.cs (ElementAccess): Implement the LValue interface too.
21424 2001-10-06 Ravi Pratap <ravi@ximian.com>
21426 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21427 except that user defined conversions are not included.
21429 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
21430 perform the conversion of the return type, if necessary.
21432 (New::DoResolve): Check whether we are creating an array or an object
21433 and accordingly do the needful.
21435 (New::Emit): Same here.
21437 (New::DoResolve): Implement guts of array creation.
21439 (New::FormLookupType): Helper function.
21441 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21443 * codegen.cs: Removed most of the code generation here, and move the
21444 corresponding code generation bits to the statement classes.
21446 Added support for try/catch/finalize and throw.
21448 * cs-parser.jay: Added support for try/catch/finalize.
21450 * class.cs: Catch static methods having the flags override,
21451 virtual or abstract.
21453 * expression.cs (UserCast): This user cast was not really doing
21454 what it was supposed to do. Which is to be born in fully resolved
21455 state. Parts of the resolution were being performed at Emit time!
21459 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21461 * expression.cs: Implicity convert the result from UserCast.
21463 2001-10-05 Ravi Pratap <ravi@ximian.com>
21465 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21466 prevented it from working correctly.
21468 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21469 merely ConvertImplicit.
21471 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21473 * typemanager.cs: Make the LookupTypeContainer function static,
21474 and not per-instance.
21476 * class.cs: Make static FindMembers (the one that takes a Type
21479 * codegen.cs: Add EmitForeach here.
21481 * cs-parser.jay: Make foreach a toplevel object instead of the
21482 inline expansion, as we need to perform semantic analysis on it.
21484 2001-10-05 Ravi Pratap <ravi@ximian.com>
21486 * expression.cs (Expression::ImplicitUserConversion): Rename to
21487 UserDefinedConversion.
21489 (Expression::UserDefinedConversion): Take an extra argument specifying
21490 whether we look for explicit user conversions too.
21492 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21494 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21496 (ExplicitUserConversion): Make it a call to UserDefinedConversion
21497 with the appropriate arguments.
21499 * cs-parser.jay (cast_expression): Record location too.
21501 * expression.cs (Cast): Record location info.
21503 (Expression::ConvertExplicit): Take location argument.
21505 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21506 to determine if we are doing explicit conversions.
21508 (UserCast::Emit): Update accordingly.
21510 (Expression::ConvertExplicit): Report an error if everything fails.
21512 * ../errors/cs0030.cs : Add.
21514 2001-10-04 Miguel de Icaza <miguel@ximian.com>
21516 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21517 virtual and newslot bits.
21519 * class.cs (TypeContainer::RegisterRequiredImplementations):
21520 Record methods we need.
21522 (TypeContainer::MakeKey): Helper function to make keys for
21523 MethodBases, since the Methodbase key is useless.
21525 (TypeContainer::Populate): Call RegisterRequiredImplementations
21526 before defining the methods.
21528 Create a mapping for method_builders_to_methods ahead of time
21529 instead of inside a tight loop.
21531 (::RequireMethods): Accept an object as the data to set into the
21532 hashtable so we can report interface vs abstract method mismatch.
21534 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21536 * report.cs: Make all of it static.
21538 * rootcontext.cs: Drop object_type and value_type computations, as
21539 we have those in the TypeManager anyways.
21541 Drop report instance variable too, now it is a global.
21543 * driver.cs: Use try/catch on command line handling.
21545 Add --probe option to debug the error reporting system with a test
21548 * report.cs: Add support for exiting program when a probe
21549 condition is reached.
21551 2001-10-03 Ravi Pratap <ravi@ximian.com>
21553 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21554 we do a forcible conversion regardless of type, to check if
21555 ForceConversion returns a null.
21557 (Binary::error19): Use location to report error.
21559 (Unary::error23): Use location here too.
21561 * ../errors/cs0019.cs : Check in.
21563 * ../errors/cs0023.cs : Check in.
21565 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21566 case of a non-null MethodInfo object with a length of 0 !
21568 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21569 an applicable member - according to the spec :-)
21570 Also fix logic to find members in base types.
21572 (Unary::ResolveOperator): Same here.
21574 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21575 as I was getting thoroughly confused between this and error19 :-)
21577 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21578 (::FindMostEncompassedType): Implement.
21579 (::FindMostEncompassingType): Implement.
21580 (::StandardConversionExists): Implement.
21582 (UserImplicitCast): Re-vamp. We now need info about most specific
21583 source and target types so that we can do the necessary conversions.
21585 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21586 mathematical union with no duplicates.
21588 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21590 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21591 in order from base classes to child classes, so that we can in
21592 child classes look up in our parent for method names and
21593 attributes (required for handling abstract, virtual, new, override
21594 constructs: we need to instrospect our base class, and if we dont
21595 populate the classes in order, the introspection might be
21596 incorrect. For example, a method could query its parent before
21597 the parent has any methods and would determine that the parent has
21598 no abstract methods (while it could have had them)).
21600 (RootContext::CreateType): Record the order in which we define the
21603 2001-10-02 Miguel de Icaza <miguel@ximian.com>
21605 * class.cs (TypeContainer::Populate): Also method definitions can
21606 fail now, keep track of this.
21608 (TypeContainer::FindMembers): Implement support for
21609 DeclaredOnly/noDeclaredOnly flag.
21611 (Constructor::Emit) Return the ConstructorBuilder.
21613 (Method::Emit) Return the MethodBuilder.
21614 Check for abstract or virtual methods to be public.
21616 * rootcontext.cs (RootContext::CreateType): Register all the
21617 abstract methods required for the class to be complete and the
21618 interface methods that must be implemented.
21620 * cs-parser.jay: Report error 501 (method requires body if it is
21621 not marked abstract or extern).
21623 * expression.cs (TypeOf::Emit): Implement.
21625 * typemanager.cs: runtime_handle_type, new global type.
21627 * class.cs (Property::Emit): Generate code for properties.
21629 2001-10-02 Ravi Pratap <ravi@ximian.com>
21631 * expression.cs (Unary::ResolveOperator): Find operators on base type
21632 too - we now conform exactly to the spec.
21634 (Binary::ResolveOperator): Same here.
21636 * class.cs (Operator::Define): Fix minor quirk in the tests.
21638 * ../errors/cs0215.cs : Added.
21640 * ../errors/cs0556.cs : Added.
21642 * ../errors/cs0555.cs : Added.
21644 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21646 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21647 single integer which is really efficient
21649 2001-10-01 Ravi Pratap <ravi@ximian.com>
21651 * expression.cs (Expression::ImplicitUserConversion): Use location
21652 even in the case when we are examining True operators.
21654 * class.cs (Operator::Define): Perform extensive checks to conform
21655 with the rules for operator overloading in the spec.
21657 * expression.cs (Expression::ImplicitReferenceConversion): Implement
21658 some of the other conversions mentioned in the spec.
21660 * typemanager.cs (array_type): New static member for the System.Array built-in
21663 (cloneable_interface): For System.ICloneable interface.
21665 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21666 we start resolving the tree and populating types.
21668 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21670 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21672 * expression.cs (Expression::ExprClassFromMemberInfo,
21673 Expression::Literalize): Create literal expressions from
21674 FieldInfos which are literals.
21676 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21677 type casts, because they were wrong. The test suite in tests
21680 (ImplicitNumericConversion): ushort to ulong requires a widening
21683 Int32 constant to long requires widening cast as well.
21685 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21686 for integers because the type on the stack is not i4.
21688 2001-09-30 Miguel de Icaza <miguel@ximian.com>
21690 * expression.cs (report118): require location argument.
21692 * parameter.cs: Do not dereference potential null value.
21694 * class.cs: Catch methods that lack the `new' keyword when
21695 overriding a name. Report warnings when `new' is used without
21696 anything being there to override.
21698 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21700 * class.cs: Only add constructor to hashtable if it is non-null
21701 (as now constructors can fail on define).
21703 (TypeManager, Class, Struct): Take location arguments.
21705 Catch field instance initialization in structs as errors.
21707 accepting_filter: a new filter for FindMembers that is static so
21708 that we dont create an instance per invocation.
21710 (Constructor::Define): Catch errors where a struct constructor is
21713 * cs-parser.jay: Pass location information for various new
21716 * delegate.cs (Delegate): take a location argument.
21718 * driver.cs: Do not call EmitCode if there were problesm in the
21719 Definition of the types, as many Builders wont be there.
21721 * decl.cs (Decl::Decl): Require a location argument.
21723 * cs-tokenizer.cs: Handle properly hex constants that can not fit
21724 into integers, and find the most appropiate integer for it.
21726 * literal.cs: Implement ULongLiteral.
21728 * rootcontext.cs: Provide better information about the location of
21729 failure when CreateType fails.
21731 2001-09-29 Miguel de Icaza <miguel@ximian.com>
21733 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21736 * expression.cs (Binary::CheckShiftArguments): Add missing type
21738 (Binary::ResolveOperator): Add type to the logical and and logical
21739 or, Bitwise And/Or and Exclusive Or code paths, it was missing
21742 (Binary::DoNumericPromotions): In the case where either argument
21743 is ulong (and most signed types combined with ulong cause an
21744 error) perform implicit integer constant conversions as well.
21746 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21748 * expression.cs (UserImplicitCast): Method should always be
21750 (Invocation::BetterConversion): Simplified test for IntLiteral.
21752 (Expression::ImplicitNumericConversion): Split this routine out.
21753 Put the code that performs implicit constant integer conversions
21756 (Expression::Resolve): Become a wrapper around DoResolve so we can
21757 check eclass and type being set after resolve.
21759 (Invocation::Badness): Remove this dead function
21761 (Binary::ResolveOperator): Do not compute the expensive argumnets
21762 unless we have a union for it.
21764 (Probe::Emit): Is needs to do an isinst and then
21765 compare against null.
21767 (::CanConvert): Added Location argument. If the Location argument
21768 is null (Location.Null), then we do not report errors. This is
21769 used by the `probe' mechanism of the Explicit conversion. We do
21770 not want to generate an error for something that the user
21771 explicitly requested to be casted. But the pipeline for an
21772 explicit cast first tests for potential implicit casts.
21774 So for now, if the Location is null, it means `Probe only' to
21775 avoid adding another argument. Might have to revise this
21778 (ClassCast): New class used to type cast objects into arbitrary
21779 classes (used in Explicit Reference Conversions).
21781 Implement `as' as well.
21783 Reverted all the patches from Ravi below: they were broken:
21785 * The use of `level' as a mechanism to stop recursive
21786 invocations is wrong. That was there just to catch the
21787 bug with a strack trace but not as a way of addressing
21790 To fix the problem we have to *understand* what is going
21791 on and the interactions and come up with a plan, not
21792 just get things going.
21794 * The use of the type conversion cache that I proposed
21795 last night had an open topic: How does this work across
21796 protection domains. A user defined conversion might not
21797 be public in the location where we are applying the
21798 conversion, a different conversion might be selected
21799 (ie, private A->B (better) but public B->A (worse),
21800 inside A, A->B applies, but outside it, B->A will
21803 * On top of that (ie, even if the above is solved),
21804 conversions in a cache need to be abstract. Ie, `To
21805 convert from an Int to a Short use an OpcodeCast', not
21806 `To convert from an Int to a Short use the OpcodeCast on
21807 the variable 5' (which is what this patch was doing).
21809 2001-09-28 Ravi Pratap <ravi@ximian.com>
21811 * expression.cs (Invocation::ConversionExists): Re-write to use
21812 the conversion cache
21814 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21815 cache all conversions done, not just user-defined ones.
21817 (Invocation::BetterConversion): The real culprit. Use ConversionExists
21818 to determine if a conversion exists instead of acutually trying to
21819 perform the conversion. It's faster too.
21821 (Expression::ConvertExplicit): Modify to use ConversionExists to check
21822 and only then attempt the implicit conversion.
21824 2001-09-28 Ravi Pratap <ravi@ximian.com>
21826 * expression.cs (ConvertImplicit): Use a cache for conversions
21827 already found. Check level of recursion and bail out if necessary.
21829 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21831 * typemanager.cs (string_concat_string_string, string_concat_object_object):
21832 Export standard methods that we expect for string operations.
21834 * statement.cs (Block::UsageWarning): Track usage of variables and
21835 report the errors for not used variables.
21837 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21840 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21842 * codegen.cs: remove unnneded code
21844 * expression.cs: Removed BuiltinTypeAccess class
21846 Fix the order in which implicit conversions are
21849 The previous fixed dropped support for boxed conversions (adding a
21850 test to the test suite now)
21852 (UserImplicitCast::CanConvert): Remove test for source being null,
21853 that code is broken. We should not feed a null to begin with, if
21854 we do, then we should track the bug where the problem originates
21855 and not try to cover it up here.
21857 Return a resolved expression of type UserImplicitCast on success
21858 rather than true/false. Ravi: this is what I was talking about,
21859 the pattern is to use a static method as a "constructor" for
21862 Also, do not create arguments until the very last minute,
21863 otherwise we always create the arguments even for lookups that
21864 will never be performed.
21866 (UserImplicitCast::Resolve): Eliminate, objects of type
21867 UserImplicitCast are born in a fully resolved state.
21869 * typemanager.cs (InitCoreTypes): Init also value_type
21870 (System.ValueType).
21872 * expression.cs (Cast::Resolve): First resolve the child expression.
21874 (LValue): Add new method AddressOf to be used by
21877 Change the argument of Store to take an EmitContext instead of an
21878 ILGenerator, because things like FieldExpr need to be able to call
21879 their children expression to generate the instance code.
21881 (Expression::Error, Expression::Warning): Sugar functions for
21884 (Expression::MemberLookup): Accept a TypeContainer instead of a
21885 Report as the first argument.
21887 (Expression::ResolvePrimary): Killed. I still want to improve
21888 this as currently the code is just not right.
21890 (Expression::ResolveMemberAccess): Simplify, but it is still
21893 (Unary::Resolve): Catch errors in AddressOf operators.
21895 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21896 index to a byte for the short-version, or the compiler will choose
21897 the wrong Emit call, which generates the wrong data.
21899 (ParameterReference::Emit, ::Store): same.
21901 (FieldExpr::AddressOf): Implement.
21903 * typemanager.cs: TypeManager: made public variable instead of
21906 * driver.cs: document --fatal.
21908 * report.cs (ErrorMessage, WarningMessage): new names for the old
21909 Error and Warning classes.
21911 * cs-parser.jay (member_access): Turn built-in access to types
21912 into a normal simplename
21914 2001-09-27 Ravi Pratap <ravi@ximian.com>
21916 * expression.cs (Invocation::BetterConversion): Fix to cope
21917 with q being null, since this was introducing a bug.
21919 * expression.cs (ConvertImplicit): Do built-in conversions first.
21921 2001-09-27 Ravi Pratap <ravi@ximian.com>
21923 * expression.cs (UserImplicitCast::Resolve): Fix bug.
21925 2001-09-27 Ravi Pratap <ravi@ximian.com>
21927 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21928 I had introduced long ago (what's new ?).
21930 * expression.cs (UserImplicitCast::CanConvert): Static method to do
21931 the work of all the checking.
21932 (ConvertImplicit): Call CanConvert and only then create object if necessary.
21933 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21935 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21936 that is the right way.
21938 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
21939 overloading resolution. Use everywhere instead of cutting and pasting code.
21941 (Binary::ResolveOperator): Use MakeUnionSet.
21943 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
21944 we have to convert to bool types. Not complete yet.
21946 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21948 * typemanager.cs (TypeManager::CSharpName): support ushort.
21950 * expression.cs (Expression::TryImplicitIntConversion): Attempts
21951 to provide an expression that performsn an implicit constant int
21952 conversion (section 6.1.6).
21953 (Expression::ConvertImplicitRequired): Reworked to include
21954 implicit constant expression conversions.
21956 (Expression::ConvertNumericExplicit): Finished.
21958 (Invocation::Emit): If InstanceExpression is null, then it means
21959 that we perform a call on this.
21961 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21963 * expression.cs (Unary::Emit): Remove some dead code.
21964 (Probe): Implement Resolve and Emit for `is'.
21965 (Expression::ConvertImplicitRequired): Attempt to do constant
21966 expression conversions here. Maybe should be moved to
21967 ConvertImplicit, but I am not sure.
21968 (Expression::ImplicitLongConstantConversionPossible,
21969 Expression::ImplicitIntConstantConversionPossible): New functions
21970 that tell whether is it possible to apply an implicit constant
21971 expression conversion.
21973 (ConvertNumericExplicit): Started work on explicit numeric
21976 * cs-parser.jay: Update operator constants.
21978 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21979 (Parameters::GetSignature): Hook up VerifyArgs here.
21980 (Parameters::VerifyArgs): Verifies that no two arguments have the
21983 * class.cs (Operator): Update the operator names to reflect the
21984 ones that the spec expects (as we are just stringizing the
21987 * expression.cs (Unary::ResolveOperator): Fix bug: Use
21988 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21989 previous usage did only work for our methods.
21990 (Expression::ConvertImplicit): Handle decimal implicit numeric
21991 conversions as well.
21992 (Expression::InternalTypeConstructor): Used to invoke constructors
21993 on internal types for default promotions.
21995 (Unary::Emit): Implement special handling for the pre/post
21996 increment/decrement for overloaded operators, as they need to have
21997 the same semantics as the other operators.
21999 (Binary::ResolveOperator): ditto.
22000 (Invocation::ConversionExists): ditto.
22001 (UserImplicitCast::Resolve): ditto.
22003 2001-09-26 Ravi Pratap <ravi@ximian.com>
22005 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22006 operator, return after emitting body. Regression tests pass again !
22008 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22009 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22010 (Invocation::OverloadResolve): Ditto.
22011 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22013 * everywhere : update calls to the above methods accordingly.
22015 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22017 * assign.cs (Assign): Make it inherit from ExpressionStatement.
22019 * expression.cs (ExpressionStatement): New base class used for
22020 expressions that can appear in statements, so that we can provide
22021 an alternate path to generate expression that do not leave a value
22024 (Expression::Emit, and all the derivatives): We no longer return
22025 whether a value is left on the stack or not. Every expression
22026 after being emitted leaves a single value on the stack.
22028 * codegen.cs (EmitContext::EmitStatementExpression): Use the
22029 facilties of ExpressionStatement if possible.
22031 * cs-parser.jay: Update statement_expression.
22033 2001-09-25 Miguel de Icaza <miguel@ximian.com>
22035 * driver.cs: Change the wording of message
22037 2001-09-25 Ravi Pratap <ravi@ximian.com>
22039 * expression.cs (Binary::ResolveOperator): Had forgottten to set
22040 the type of the expression to the return type of the method if
22041 we have an overloaded operator match ! The regression tests pass again !
22042 (Unary::ResolveOperator): Ditto.
22044 * expression.cs (Invocation::ConversionExists): Correct the member lookup
22045 to find "op_Implicit", not "implicit" ;-)
22046 (UserImplicitCast): New class to take care of user-defined implicit conversions.
22047 (ConvertImplicit, ForceConversion): Take TypeContainer argument
22049 * everywhere : Correct calls to the above accordingly.
22051 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22052 (ConvertImplicit): Do user-defined conversion if it exists.
22054 2001-09-24 Miguel de Icaza <miguel@ximian.com>
22056 * assign.cs: track location.
22057 (Resolve): Use implicit conversions on assignment.
22059 * literal.cs: Oops. Not good, Emit of short access values should
22060 pass (Bytes) or the wrong argument will be selected.
22062 * expression.cs (Unary::Emit): Emit code for -expr.
22064 (Unary::ResolveOperator): Handle `Substract' for non-constants
22065 (substract from zero from the non-constants).
22066 Deal with Doubles as well.
22068 (Expression::ConvertImplicitRequired): New routine that reports an
22069 error if no implicit conversion exists.
22071 (Invocation::OverloadResolve): Store the converted implicit
22072 expressions if we make them
22074 2001-09-24 Ravi Pratap <ravi@ximian.com>
22076 * class.cs (ConstructorInitializer): Take a Location argument.
22077 (ConstructorBaseInitializer): Same here.
22078 (ConstructorThisInitializer): Same here.
22080 * cs-parser.jay : Update all calls accordingly.
22082 * expression.cs (Unary, Binary, New): Take location argument.
22083 Update accordingly everywhere.
22085 * cs-parser.jay : Update all calls to the above to take a location
22088 * class.cs : Ditto.
22090 2001-09-24 Ravi Pratap <ravi@ximian.com>
22092 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22093 (Invocation::BetterConversion): Same here
22094 (Invocation::ConversionExists): Ditto.
22096 (Invocation::ConversionExists): Implement.
22098 2001-09-22 Ravi Pratap <ravi@ximian.com>
22100 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22101 Also take an additional TypeContainer argument.
22103 * All over : Pass in TypeContainer as argument to OverloadResolve.
22105 * typemanager.cs (CSharpName): Update to check for the string type and return
22108 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22111 2001-09-21 Ravi Pratap <ravi@ximian.com>
22113 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22114 (Invocation::BetterFunction): Implement.
22115 (Invocation::BetterConversion): Implement.
22116 (Invocation::ConversionExists): Skeleton, no implementation yet.
22118 Okay, things work fine !
22120 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22122 * typemanager.cs: declare and load enum_type, delegate_type and
22125 * expression.cs (Expression::Emit): Now emit returns a value that
22126 tells whether a value is left on the stack or not. This strategy
22127 might be reveted tomorrow with a mechanism that would address
22128 multiple assignments.
22129 (Expression::report118): Utility routine to report mismatches on
22132 (Unary::Report23): Report impossible type/operator combination
22135 (Unary::IsIncrementableNumber): Whether the type can be
22136 incremented or decremented with add.
22137 (Unary::ResolveOperator): Also allow enumerations to be bitwise
22139 (Unary::ResolveOperator): Implement ++, !, ~,
22141 (Invocation::Emit): Deal with new Emit convetion.
22143 * All Expression derivatives: Updated their Emit method to return
22144 whether they leave values on the stack or not.
22146 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22147 stack for expressions that are statements.
22149 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22151 * expression.cs (LValue): New interface. Must be implemented by
22153 (LocalVariableReference, ParameterReference, FieldExpr): Implement
22156 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22157 interface for generating code, simplifies the code.
22159 2001-09-20 Ravi Pratap <ravi@ximian.com>
22161 * expression.cs (everywhere): Comment out return statements in ::Resolve
22162 methods to avoid the warnings.
22164 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22166 * driver.cs (parse): Report error 2001 if we can not open the
22169 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22172 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22175 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22176 otherwise nested blocks end up with the same index.
22178 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22180 * expression.cs: Instead of having FIXMEs in the Resolve
22181 functions, throw exceptions so it is obvious that we are facing a
22184 * cs-parser.jay (invocation_expression): Pass Location information.
22186 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22187 Use a basename for those routines because .NET does not like paths
22190 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22193 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22195 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22196 are loading the correct data types (throws an exception if not).
22197 (TypeManager::InitCoreTypes): Use CoreLookupType
22199 * expression.cs (Unary::ResolveOperator): return the child
22200 expression for expressions which are just +expr.
22201 (Unary::ResolveOperator): Return negative literals for -LITERAL
22202 expressions (otherwise they are Unary {Literal}).
22203 (Invocation::Badness): Take into account `Implicit constant
22204 expression conversions'.
22206 * literal.cs (LongLiteral): Implement long literal class.
22207 (IntLiteral): export the `Value' of the intliteral.
22209 2001-09-19 Ravi Pratap <ravi@ximian.com>
22211 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22213 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22214 instead of 'Operator'
22216 * expression.cs (Binary::ResolveOperator): Update accordingly.
22217 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22220 * cs-parser.jay (unary_expression): Update to use the new names.
22222 * gen-treedump.cs (GetUnary): Same here.
22224 * expression.cs (Unary::Resolve): Implement.
22225 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22226 operators are found instead of making noise ;-)
22227 (Unary::ResolveOperator): New method to do precisely the same thing which
22228 Binary::ResolveOperator does for Binary expressions.
22229 (Unary.method, .Arguments): Add.
22230 (Unary::OperName): Implement.
22231 (Unary::ForceConversion): Copy and Paste !
22233 * class.cs (Operator::Define): Fix a small bug for the case when we have
22236 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22237 for the inbuilt operators. Only overloading works for now ;-)
22239 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22241 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22242 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22244 * expression.cs (This::Emit): Implement.
22245 (This::Resolve): Implement.
22246 (TypeOf:Resolve): Implement.
22247 (Expression::ResolveSimpleName): Add an implicit this to instance
22249 (MemberAccess::Resolve): Deal with Parameters and Fields.
22250 Bind instance variable to Field expressions.
22251 (FieldExpr::Instance): New field used to track the expression that
22252 represents the object instance.
22253 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22255 (FieldExpr::Emit): Implement.
22257 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22258 the last instruction contains a return opcode to avoid generating
22259 the last `ret' instruction (this generates correct code, and it is
22260 nice to pass the peverify output).
22262 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22263 initializer for static and instance variables.
22264 (Constructor::Emit): Allow initializer to be null in the case of
22265 static constructors. Only emit initializer for instance
22268 (TypeContainer::FindMembers): Return a null array if there are no
22271 Also fix the code for the MemberTypes.Method branch, as it was not
22272 scanning that for operators (or tried to access null variables before).
22274 * assign.cs (Assign::Emit): Handle instance and static fields.
22278 * driver.cs: Stop compilation if there are parse errors.
22280 * cs-parser.jay (constructor_declaration): Provide default base
22281 initializer for non-static constructors.
22282 (constructor_declarator): Do not provide a default base
22283 initializers if none was specified.
22284 Catch the fact that constructors should not have parameters.
22286 * class.cs: Do not emit parent class initializers for static
22287 constructors, that should be flagged as an error.
22289 2001-09-18 Ravi Pratap <ravi@ximian.com>
22291 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22292 Move back code into TypeContainer::Populate.
22294 2001-09-18 Ravi Pratap <ravi@ximian.com>
22296 * class.cs (TypeContainer::AddConstructor): Fix the check to
22297 compare against Name, not Basename.
22298 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22300 * cs-parser.jay : Update accordingly.
22302 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22303 for methods, don't forget to look into the operators too.
22304 (RegisterMethodBuilder): Helper method to take care of this for
22305 methods, constructors and operators.
22306 (Operator::Define): Completely revamp.
22307 (Operator.OperatorMethod, MethodName): New fields.
22308 (TypeContainer::Populate): Move the registering of builders into
22309 RegisterMethodBuilder.
22310 (Operator::Emit): Re-write.
22312 * expression.cs (Binary::Emit): Comment out code path to emit method
22313 invocation stuff for the case when we have a user defined operator. I am
22314 just not able to get it right !
22316 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22318 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22321 (Expression::MemberLookup): Provide a version that allows to
22322 specify the MemberTypes and BindingFlags.
22324 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22325 so it was not fetching variable information from outer blocks.
22327 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22328 Beforefieldinit as it was buggy.
22330 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22331 that Ravi put here.
22333 * class.cs (Constructor::Emit): Only emit if block is not null.
22334 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22335 deal with this by semantically definining it as if the user had
22338 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22339 constructors as we now "emit" them at a higher level.
22341 (TypeContainer::DefineDefaultConstructor): Used to define the
22342 default constructors if none was provided.
22344 (ConstructorInitializer): Add methods Resolve and Emit.
22346 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22348 2001-09-17 Ravi Pratap <ravi@ximian.com>
22350 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22351 the default constructor builder with our hashtable for methodbuilders
22354 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22355 and argument_count is 0 in which case we have a match.
22356 (Binary::ResolveOperator): More null checking and miscellaneous coding
22359 2001-09-17 Ravi Pratap <ravi@ximian.com>
22361 * rootcontext.cs (IsNameSpace): Compare against null.
22363 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22365 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22366 and Unary::Operator.
22368 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22371 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22372 we have overloaded operators.
22373 (Binary::ResolveOperator): Implement the part which does the operator overload
22376 * class.cs (Operator::Emit): Implement.
22377 (TypeContainer::Emit): Emit the operators we have too.
22379 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22380 the case when we have a user-defined operator.
22382 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22384 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22386 2001-09-16 Ravi Pratap <ravi@ximian.com>
22388 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22389 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22390 (Constructor::Emit): Implement.
22391 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22392 if we have no work to do.
22393 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22396 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22397 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22399 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22402 2001-09-15 Ravi Pratap <ravi@ximian.com>
22404 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22406 (Tree::RecordNamespace): Method to do what the name says ;-)
22407 (Tree::Namespaces): Property to get at the namespaces hashtable.
22409 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22412 * rootcontext.cs (IsNamespace): Fixed it :-)
22414 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22416 * class.cs (TypeContainer::FindMembers): Add support for
22418 (MethodCore): New class that encapsulates both the shared aspects
22419 of a Constructor and a Method.
22420 (Method, Constructor): Factored pieces into MethodCore.
22422 * driver.cs: Added --fatal which makes errors throw exceptions.
22423 Load System assembly as well as part of the standard library.
22425 * report.cs: Allow throwing exceptions on errors for debugging.
22427 * modifiers.cs: Do not use `parent', instead use the real type
22428 container to evaluate permission settings.
22430 * class.cs: Put Ravi's patch back in. He is right, and we will
22431 have to cope with the
22433 2001-09-14 Ravi Pratap <ravi@ximian.com>
22435 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22436 FamORAssem, not FamANDAssem.
22438 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22440 * driver.cs: Added --parse option that only parses its input files
22443 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
22444 incorrect. IsTopLevel is not used to tell whether an object is
22445 root_types or not (that can be achieved by testing this ==
22446 root_types). But to see if this is a top-level *class* (not
22447 necessarly our "toplevel" container).
22449 2001-09-14 Ravi Pratap <ravi@ximian.com>
22451 * enum.cs (Enum::Define): Modify to call the Lookup method on the
22452 parent instead of a direct call to GetType.
22454 2001-09-14 Ravi Pratap <ravi@ximian.com>
22456 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22457 Modifiers.TypeAttr. This should just be a call to that method.
22459 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22460 object so that we can determine if we are top-level or not.
22462 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
22465 * enum.cs (Enum::Define): Ditto.
22467 * modifiers.cs (FieldAttr): Re-write.
22469 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22470 (TypeContainer::HaveStaticConstructor): New property to provide access
22471 to precisely that info.
22473 * modifiers.cs (MethodAttr): Re-write.
22474 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22476 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22477 of top-level types as claimed.
22479 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22481 * expression.cs (MemberLookup): Fruitless attempt to lookup
22482 constructors. Maybe I need to emit default constructors? That
22483 might be it (currently .NET emits this for me automatically).
22484 (Invocation::OverloadResolve): Cope with Arguments == null.
22485 (Invocation::EmitArguments): new function, shared by the new
22486 constructor and us.
22487 (Invocation::Emit): Handle static and instance methods. Emit
22488 proper call instruction for virtual or non-virtual invocations.
22489 (New::Emit): Implement.
22490 (New::Resolve): Implement.
22491 (MemberAccess:Resolve): Implement.
22492 (MethodGroupExpr::InstanceExpression): used conforming to the spec
22493 to track instances.
22494 (FieldExpr::Resolve): Set type.
22496 * support.cs: Handle empty arguments.
22498 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22499 SimpleLookup): Auxiliary routines to help parse a qualifier
22502 Update qualifier_identifier rule.
22504 * codegen.cs: Removed debugging messages.
22506 * class.cs: Make this a global thing, this acts just as a "key" to
22507 objects that we might have around.
22509 (Populate): Only initialize method_builders_to_methods once.
22511 * expression.cs (PropertyExpr): Initialize type from the
22514 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22515 Resolve pattern. Attempt to implicitly convert value to boolean.
22518 * expression.cs: Set the type for the int32/int32 argument case.
22519 (Binary::ResolveOperator): Set the return type to boolean for
22520 comparission operators
22522 * typemanager.cs: Remove debugging print code.
22524 (Invocation::Resolve): resolve type.
22526 * class.cs: Allocate a MemberInfo of the correct size, as the code
22527 elsewhere depends on the test to reflect the correct contents.
22529 (Method::) Keep track of parameters, due to System.Reflection holes
22531 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22534 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22535 of the exact size and return that.
22537 (Class::LookupMethodByBuilder): New function that maps
22538 MethodBuilders to its methods. Required to locate the information
22539 on methods because System.Reflection bit us again.
22541 * support.cs: New file, contains an interface ParameterData and
22542 two implementations: ReflectionParameters and InternalParameters
22543 used to access Parameter information. We will need to grow this
22546 * expression.cs (Invocation::GetParameterData): implement a cache
22547 and a wrapper around the ParameterData creation for methods.
22548 (Invocation::OverloadResolve): Use new code.
22550 2001-09-13 Ravi Pratap <ravi@ximian.com>
22552 * class.cs (TypeContainer::EmitField): Remove and move into
22553 (Field::Define): here and modify accordingly.
22554 (Field.FieldBuilder): New member.
22555 (TypeContainer::Populate): Update accordingly.
22556 (TypeContainer::FindMembers): Implement.
22558 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22560 * statement.cs: (VariableInfo::VariableType): New field to be
22561 initialized with the full type once it is resolved.
22563 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22565 * parameter.cs (GetParameterInfo): Use a type cache to compute
22566 things only once, and to reuse this information
22568 * expression.cs (LocalVariableReference::Emit): Implement.
22569 (OpcodeCast::Emit): fix.
22571 (ParameterReference::Resolve): Implement.
22572 (ParameterReference::Emit): Implement.
22574 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22575 that are expressions need to stay as Expressions.
22577 * typemanager.cs (CSharpName): Returns the C# name of a type if
22580 * expression.cs (Expression::ConvertImplicit): New function that
22581 implements implicit type conversions.
22583 (Expression::ImplicitReferenceConversion): Implements implicit
22584 reference conversions.
22586 (EmptyCast): New type for transparent casts.
22588 (OpcodeCast): New type for casts of types that are performed with
22589 a sequence of bytecodes.
22591 (BoxedCast): New type used for casting value types into reference
22592 types. Emits a box opcode.
22594 (Binary::DoNumericPromotions): Implements numeric promotions of
22595 and computation of the Binary::Type.
22597 (Binary::EmitBranchable): Optimization.
22599 (Binary::Emit): Implement code emission for expressions.
22601 * typemanager.cs (TypeManager): Added two new core types: sbyte
22604 2001-09-12 Ravi Pratap <ravi@ximian.com>
22606 * class.cs (TypeContainer::FindMembers): Method which does exactly
22607 what Type.FindMembers does, only we don't have to use reflection. No
22608 implementation yet.
22610 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22611 typecontainer objects as we need to get at them.
22612 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22614 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22615 typecontainer object.
22617 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22618 of just a Report object.
22620 2001-09-11 Ravi Pratap <ravi@ximian.com>
22622 * class.cs (Event::Define): Go back to using the prefixes "add_" and
22624 (TypeContainer::Populate): Now define the delegates of the type too.
22625 (TypeContainer.Delegates): Property to access the list of delegates defined
22628 * delegates.cs (Delegate::Define): Implement partially.
22630 * modifiers.cs (TypeAttr): Handle more flags.
22632 2001-09-11 Ravi Pratap <ravi@ximian.com>
22634 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22636 (Operator::Define): Re-write logic to get types by using the LookupType method
22637 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22638 (Indexer::Define): Ditto.
22639 (Event::Define): Ditto.
22640 (Property::Define): Ditto.
22642 2001-09-10 Ravi Pratap <ravi@ximian.com>
22644 * class.cs (TypeContainer::Populate): Now define operators too.
22645 (TypeContainer.Operators): New property to access the list of operators
22647 (Operator.OperatorMethodBuilder): New member to hold the method builder
22648 for the operator we are defining.
22649 (Operator::Define): Implement.
22651 2001-09-10 Ravi Pratap <ravi@ximian.com>
22653 * class.cs (Event::Define): Make the prefixes of the accessor methods
22654 addOn_ and removeOn_
22656 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22657 of the location being passed in too. Ideally, this should go later since all
22658 error reporting should be done through the Report object.
22660 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22661 (Populate): Iterate thru the indexers we have and define them too.
22662 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22663 for the get and set accessors.
22664 (Indexer::Define): Implement.
22666 2001-09-09 Miguel de Icaza <miguel@ximian.com>
22668 * expression.cs (Binary::Resolve): Beginning of it. I scratched
22669 my previous implementation, did not work.
22671 * typemanager.cs: Add a couple of missing types (the longs).
22673 * literal.cs: Use TypeManager.bool_type instead of getting it.
22675 * expression.cs (EventExpr): New kind of expressions.
22676 (Expressio::ExprClassFromMemberInfo): finish
22678 2001-09-08 Miguel de Icaza <miguel@ximian.com>
22680 * assign.cs: Emit stores to static fields differently.
22682 2001-09-08 Ravi Pratap <ravi@ximian.com>
22684 * Merge in changes and adjust code to tackle conflicts. Backed out my
22685 code in Assign::Resolve ;-)
22687 2001-09-08 Ravi Pratap <ravi@ximian.com>
22689 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22690 instead Report.Error and also pass in the location.
22691 (CSharpParser::Lexer): New readonly property to return the reference
22692 to the Tokenizer object.
22693 (declare_local_variables): Use Report.Error with location instead of plain
22697 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22698 (Operator.CheckBinaryOperator): Ditto.
22700 * cs-parser.jay (operator_declarator): Update accordingly.
22702 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22703 (CheckBinaryOperator): Same here.
22705 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22706 on the name without any prefixes of namespace names etc. This is because we
22707 already might have something already fully qualified like
22708 'System.Console.WriteLine'
22710 * assign.cs (Resolve): Begin implementation. Stuck ;-)
22712 2001-09-07 Ravi Pratap <ravi@ximian.com>
22714 * cs-tokenizer.cs (location): Return a string which also contains
22717 * expression.cs (ElementAccess): New class for expressions of the
22718 type 'element access.'
22719 (BaseAccess): New class for expressions of the type 'base access.'
22720 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22723 * cs-parser.jay (element_access): Implement action.
22724 (base_access): Implement actions.
22725 (checked_expression, unchecked_expression): Implement.
22727 * cs-parser.jay (local_variable_type): Correct and implement.
22728 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22730 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22732 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22733 name and the specifiers.
22735 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22737 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
22738 making them all public ;-)
22740 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22743 2001-09-07 Miguel de Icaza <miguel@ximian.com>
22745 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22747 (FieldExpr, PropertyExprs): New resolved expressions.
22748 (SimpleName::MemberStaticCheck): Perform static checks for access
22749 to non-static fields on static methods. Maybe this should be
22750 generalized for MemberAccesses.
22751 (SimpleName::ResolveSimpleName): More work on simple name
22754 * cs-parser.jay (primary_expression/qualified_identifier): track
22755 the parameter index.
22757 * codegen.cs (CodeGen::Save): Catch save exception, report error.
22758 (EmitContext::EmitBoolExpression): Chain to expression generation
22759 instead of temporary hack.
22760 (::EmitStatementExpression): Put generic expression code generation.
22762 * assign.cs (Assign::Emit): Implement variable assignments to
22763 local variables, parameters and fields.
22765 2001-09-06 Miguel de Icaza <miguel@ximian.com>
22767 * statement.cs (Block::GetVariableInfo): New method, returns the
22768 VariableInfo for a variable name in a block.
22769 (Block::GetVariableType): Implement in terms of GetVariableInfo
22771 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22772 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22774 2001-09-06 Ravi Pratap <ravi@ximian.com>
22776 * cs-parser.jay (operator_declaration): Continue on my quest : update
22777 to take attributes argument.
22778 (event_declaration): Ditto.
22779 (enum_declaration): Ditto.
22780 (indexer_declaration): Ditto.
22782 * class.cs (Operator::Operator): Update constructor accordingly.
22783 (Event::Event): Ditto.
22785 * delegate.cs (Delegate::Delegate): Same here.
22787 * enum.cs (Enum::Enum): Same here.
22789 2001-09-05 Ravi Pratap <ravi@ximian.com>
22791 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22793 * ../tests/cs0658.cs : New file to demonstrate error 0658.
22795 * attribute.cs (Attributes): New class to encapsulate all attributes which were
22796 being passed around as an arraylist.
22797 (Attributes::AddAttribute): Method to add attribute sections.
22799 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22800 (struct_declaration): Update accordingly.
22801 (constant_declaration): Update.
22802 (field_declaration): Update.
22803 (method_header): Update.
22804 (fixed_parameter): Update.
22805 (parameter_array): Ditto.
22806 (property_declaration): Ditto.
22807 (destructor_declaration): Ditto.
22809 * class.cs (Struct::Struct): Update constructors accordingly.
22810 (Class::Class): Ditto.
22811 (Field::Field): Ditto.
22812 (Method::Method): Ditto.
22813 (Property::Property): Ditto.
22814 (TypeContainer::OptAttribute): update property's return type.
22816 * interface.cs (Interface.opt_attributes): New member.
22817 (Interface::Interface): Update to take the extra Attributes argument.
22819 * parameter.cs (Parameter::Parameter): Ditto.
22821 * constant.cs (Constant::Constant): Ditto.
22823 * interface.cs (InterfaceMemberBase): New OptAttributes field.
22824 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
22825 the attributes as a parameter.
22826 (InterfaceProperty): Update constructor call.
22827 (InterfaceEvent): Ditto.
22828 (InterfaceMethod): Ditto.
22829 (InterfaceIndexer): Ditto.
22831 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
22832 pass the attributes too.
22833 (interface_event_declaration): Ditto.
22834 (interface_property_declaration): Ditto.
22835 (interface_method_declaration): Ditto.
22836 (interface_declaration): Ditto.
22838 2001-09-05 Miguel de Icaza <miguel@ximian.com>
22840 * class.cs (Method::Define): Track the "static Main" definition to
22841 create an entry point.
22843 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22844 EntryPoint if we find it.
22846 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22847 (EmitContext::ig): Make this variable public.
22849 * driver.cs: Make the default output file be the first file name
22850 with the .exe extension.
22852 Detect empty compilations
22854 Handle various kinds of output targets. Handle --target and
22855 rename -t to --dumper.
22857 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22858 methods inherited from Expression return now an Expression. This
22859 will is used during the tree rewriting as we resolve them during
22862 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22863 the spec. Missing entirely is the information about
22864 accessability of elements of it.
22866 (Expression::ExprClassFromMemberInfo): New constructor for
22867 Expressions that creates a fully initialized Expression based on
22868 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22871 (Invocation::Resolve): Begin implementing resolution of invocations.
22873 * literal.cs (StringLiteral): Implement Emit.
22875 2001-09-05 Ravi Pratap <ravi@ximian.com>
22877 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22880 2001-09-04 Ravi Pratap <ravi@ximian.com>
22882 * cs-parser.jay (attribute_arguments): Implement actions.
22883 (attribute): Fix bug in production. Implement action.
22884 (attribute_list): Implement.
22885 (attribute_target): Implement.
22886 (attribute_target_specifier, opt_target_specifier): Implement
22887 (CheckAttributeTarget): New method to check if the attribute target
22889 (attribute_section): Implement.
22890 (opt_attributes): Implement.
22892 * attribute.cs : New file to handle attributes.
22893 (Attribute): Class to hold attribute info.
22895 * cs-parser.jay (opt_attribute_target_specifier): Remove production
22896 (attribute_section): Modify production to use 2 different rules to
22897 achieve the same thing. 1 s/r conflict down !
22898 Clean out commented, useless, non-reducing dimension_separator rules.
22900 * class.cs (TypeContainer.attributes): New member to hold list
22901 of attributes for a type.
22902 (Struct::Struct): Modify to take one more argument, the attribute list.
22903 (Class::Class): Ditto.
22904 (Field::Field): Ditto.
22905 (Method::Method): Ditto.
22906 (Property::Property): Ditto.
22908 * cs-parser.jay (struct_declaration): Update constructor call to
22909 pass in the attributes too.
22910 (class_declaration): Ditto.
22911 (constant_declaration): Ditto.
22912 (field_declaration): Ditto.
22913 (method_header): Ditto.
22914 (fixed_parameter): Ditto.
22915 (parameter_array): Ditto.
22916 (property_declaration): Ditto.
22918 * constant.cs (Constant::Constant): Update constructor similarly.
22919 Use System.Collections.
22921 * parameter.cs (Parameter::Parameter): Update as above.
22923 2001-09-02 Ravi Pratap <ravi@ximian.com>
22925 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22926 (TypeContainer.delegates): New member to hold list of delegates.
22928 * cs-parser.jay (delegate_declaration): Implement the action correctly
22929 this time as I seem to be on crack ;-)
22931 2001-09-02 Miguel de Icaza <miguel@ximian.com>
22933 * rootcontext.cs (RootContext::IsNamespace): new function, used to
22934 tell whether an identifier represents a namespace.
22936 * expression.cs (NamespaceExpr): A namespace expression, used only
22937 temporarly during expression resolution.
22938 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22939 utility functions to resolve names on expressions.
22941 2001-09-01 Miguel de Icaza <miguel@ximian.com>
22943 * codegen.cs: Add hook for StatementExpressions.
22945 * class.cs: Fix inverted test for static flag in methods.
22947 2001-09-02 Ravi Pratap <ravi@ximian.com>
22949 * class.cs (Operator::CheckUnaryOperator): Correct error number used
22950 to make it coincide with MS' number.
22951 (Operator::CheckBinaryOperator): Ditto.
22953 * ../errors/errors.txt : Remove error numbers added earlier.
22955 * ../errors/cs1019.cs : Test case for error # 1019
22957 * ../errros/cs1020.cs : Test case for error # 1020
22959 * cs-parser.jay : Clean out commented cruft.
22960 (dimension_separators, dimension_separator): Comment out. Ostensibly not
22961 used anywhere - non-reducing rule.
22962 (namespace_declarations): Non-reducing rule - comment out.
22964 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22965 with TypeContainer::AddEnum.
22967 * delegate.cs : New file for delegate handling classes.
22968 (Delegate): Class for declaring delegates.
22970 * makefile : Update.
22972 * cs-parser.jay (delegate_declaration): Implement.
22974 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
22976 * class.cs (Event::Define): Implement.
22977 (Event.EventBuilder): New member.
22979 * class.cs (TypeContainer::Populate): Update to define all enums and events
22981 (Events): New property for the events arraylist we hold. Shouldn't we move to using
22982 readonly fields for all these cases ?
22984 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22986 * class.cs (Property): Revamp to use the convention of making fields readonly.
22987 Accordingly modify code elsewhere.
22989 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22990 the Define method of the Property class.
22992 * class.cs : Clean up applied patch and update references to variables etc. Fix
22994 (TypeContainer::Populate): Update to define all the properties we have. Also
22995 define all enumerations.
22997 * enum.cs (Define): Implement.
22999 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23001 * cs-parser.jay (overloadable_operator): The semantic value is an
23002 enum of the Operator class.
23003 (operator_declarator): Implement actions.
23004 (operator_declaration): Implement.
23006 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23007 validity of definitions.
23008 (Operator::CheckBinaryOperator): Static method to check for binary operators
23009 (TypeContainer::AddOperator): New method to add an operator to a type.
23011 * cs-parser.jay (indexer_declaration): Added line to actually call the
23012 AddIndexer method so it gets added ;-)
23014 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
23015 already taken care of by the MS compiler ?
23017 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23019 * class.cs (Operator): New class for operator declarations.
23020 (Operator::OpType): Enum for the various operators.
23022 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23024 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23025 ostensibly handle this in semantic analysis.
23027 * cs-parser.jay (general_catch_clause): Comment out
23028 (specific_catch_clauses, specific_catch_clause): Ditto.
23029 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23030 (catch_args, opt_catch_args): New productions.
23031 (catch_clause): Rewrite to use the new productions above
23032 (catch_clauses): Modify accordingly.
23033 (opt_catch_clauses): New production to use in try_statement
23034 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23035 and re-write the code in the actions to extract the specific and
23036 general catch clauses by being a little smart ;-)
23038 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23039 Hooray, try and catch statements parse fine !
23041 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23043 * statement.cs (Block::GetVariableType): Fix logic to extract the type
23044 string from the hashtable of variables.
23046 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23047 I end up making that mistake ;-)
23048 (catch_clauses): Fixed gross error which made Key and Value of the
23049 DictionaryEntry the same : $1 !!
23051 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23053 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23055 * cs-parser.jay (event_declaration): Correct to remove the semicolon
23056 when the add and remove accessors are specified.
23058 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23060 * cs-parser.jay (IndexerDeclaration): New helper class to hold
23061 information about indexer_declarator.
23062 (indexer_declarator): Implement actions.
23063 (parsing_indexer): New local boolean used to keep track of whether
23064 we are parsing indexers or properties. This is necessary because
23065 implicit_parameters come into picture even for the get accessor in the
23066 case of an indexer.
23067 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23069 * class.cs (Indexer): New class for indexer declarations.
23070 (TypeContainer::AddIndexer): New method to add an indexer to a type.
23071 (TypeContainer::indexers): New member to hold list of indexers for the
23074 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23076 * cs-parser.jay (add_accessor_declaration): Implement action.
23077 (remove_accessor_declaration): Implement action.
23078 (event_accessors_declaration): Implement
23079 (variable_declarators): swap statements for first rule - trivial.
23081 * class.cs (Event): New class to hold information about event
23083 (TypeContainer::AddEvent): New method to add an event to a type
23084 (TypeContainer::events): New member to hold list of events.
23086 * cs-parser.jay (event_declaration): Implement actions.
23088 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23090 * cs-parser.jay (dim_separators): Implement. Make it a string
23091 concatenating all the commas together, just as they appear.
23092 (opt_dim_separators): Modify accordingly
23093 (rank_specifiers): Update accordingly. Basically do the same
23094 thing - instead, collect the brackets here.
23095 (opt_rank_sepcifiers): Modify accordingly.
23096 (array_type): Modify to actually return the complete type string
23097 instead of ignoring the rank_specifiers.
23098 (expression_list): Implement to collect the expressions
23099 (variable_initializer): Implement. We make it a list of expressions
23100 essentially so that we can handle the array_initializer case neatly too.
23101 (variable_initializer_list): Implement.
23102 (array_initializer): Make it a list of variable_initializers
23103 (opt_array_initializer): Modify accordingly.
23105 * expression.cs (New::NType): Add enumeration to help us
23106 keep track of whether we have an object/delegate creation
23107 or an array creation.
23108 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23109 members to hold data about array creation.
23110 (New:New): Modify to update NewType
23111 (New:New): New Overloaded contructor for the array creation
23114 * cs-parser.jay (array_creation_expression): Implement to call
23115 the overloaded New constructor.
23117 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23119 * class.cs (TypeContainer::Constructors): Return member
23120 constructors instead of returning null.
23122 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23124 * typemanager.cs (InitCoreTypes): Initialize the various core
23125 types after we have populated the type manager with the user
23126 defined types (this distinction will be important later while
23127 compiling corlib.dll)
23129 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23130 on Expression Classification. Now all expressions have a method
23131 `Resolve' and a method `Emit'.
23133 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23134 generation from working. Also add some temporary debugging
23137 2001-08-24 Miguel de Icaza <miguel@ximian.com>
23139 * codegen.cs: Lots of code generation pieces. This is only the
23140 beginning, will continue tomorrow with more touches of polish. We
23141 handle the fundamentals of if, while, do, for, return. Others are
23142 trickier and I need to start working on invocations soon.
23144 * gen-treedump.cs: Bug fix, use s.Increment here instead of
23147 * codegen.cs (EmitContext): New struct, used during code
23148 emission to keep a context. Most of the code generation will be
23151 * cs-parser.jay: Add embedded blocks to the list of statements of
23152 this block. So code generation proceeds in a top down fashion.
23154 2001-08-23 Miguel de Icaza <miguel@ximian.com>
23156 * statement.cs: Add support for multiple child blocks.
23158 2001-08-22 Miguel de Icaza <miguel@ximian.com>
23160 * codegen.cs (EmitCode): New function, will emit the code for a
23161 Block of code given a TypeContainer and its ILGenerator.
23163 * statement.cs (Block): Standard public readonly optimization.
23164 (Block::Block constructors): Link children.
23165 (Block::Child): Child Linker.
23166 (Block::EmitVariables): Emits IL variable declarations.
23168 * class.cs: Drop support for MethodGroups here, delay until
23170 (Method::): Applied the same simplification that I did before, and
23171 move from Properties to public readonly fields.
23172 (Method::ParameterTypes): Returns the parameter types for the
23173 function, and implements a cache that will be useful later when I
23174 do error checking and the semantic analysis on the methods is
23176 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23177 and made a method, optional argument tells whether this is a class
23178 or a structure to apply the `has-this' bit.
23179 (Method::GetCallingConvention): Implement, returns the calling
23181 (Method::Define): Defines the type, a second pass is performed
23182 later to populate the methods.
23184 (Constructor::ParameterTypes): implement a cache similar to the
23185 one on Method::ParameterTypes, useful later when we do semantic
23188 (TypeContainer::EmitMethod): New method. Emits methods.
23190 * expression.cs: Removed MethodGroup class from here.
23192 * parameter.cs (Parameters::GetCallingConvention): new method.
23194 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23196 * class.cs (TypeContainer::Populate): Drop RootContext from the
23199 (Constructor::CallingConvention): Returns the calling convention.
23200 (Constructor::ParameterTypes): Returns the constructor parameter
23203 (TypeContainer::AddConstructor): Keep track of default constructor
23204 and the default static constructor.
23206 (Constructor::) Another class that starts using `public readonly'
23207 instead of properties.
23209 (Constructor::IsDefault): Whether this is a default constructor.
23211 (Field::) use readonly public fields instead of properties also.
23213 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23214 track of static constructors; If none is used, turn on
23215 BeforeFieldInit in the TypeAttributes.
23217 * cs-parser.jay (opt_argument_list): now the return can be null
23218 for the cases where there are no arguments.
23220 (constructor_declarator): If there is no implicit `base' or
23221 `this', then invoke the default parent constructor.
23223 * modifiers.cs (MethodAttr): New static function maps a set of
23224 modifiers flags into a MethodAttributes enum
23225 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23226 MethodAttr, TypeAttr to represent the various mappings where the
23227 modifiers are used.
23228 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23230 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23232 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23235 * interface.cs (PopulateIndexer): Implemented the code generator
23236 for interface indexers.
23238 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23240 * interface.cs (InterfaceMemberBase): Now we track the new status
23243 (PopulateProperty): Implement property population. Woohoo! Got
23244 Methods and Properties going today.
23246 Removed all the properties for interfaces, and replaced them with
23247 `public readonly' fields.
23249 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23251 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23252 initialize their hashtables/arraylists only when they are needed
23253 instead of doing this always.
23255 * parameter.cs: Handle refs and out parameters.
23257 * cs-parser.jay: Use an ArrayList to construct the arguments
23258 instead of the ParameterCollection, and then cast that to a
23261 * parameter.cs: Drop the use of ParameterCollection and use
23262 instead arrays of Parameters.
23264 (GetParameterInfo): Use the Type, not the Name when resolving
23267 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23269 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23270 and instead use public readonly fields.
23272 * class.cs: Put back walking code for type containers.
23274 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23276 * class.cs (MakeConstant): Code to define constants.
23278 * rootcontext.cs (LookupType): New function. Used to locate types
23281 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23283 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23284 this System.Reflection code is. Kudos to Microsoft
23286 * typemanager.cs: Implement a type cache and avoid loading all
23287 types at boot time. Wrap in LookupType the internals. This made
23288 the compiler so much faster. Wow. I rule!
23290 * driver.cs: Make sure we always load mscorlib first (for
23291 debugging purposes, nothing really important).
23293 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23294 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23296 * rootcontext.cs: Lookup types on their namespace; Lookup types
23297 on namespaces that have been imported using the `using' keyword.
23299 * class.cs (TypeContainer::TypeAttr): Virtualize.
23300 (Class::TypeAttr): Return attributes suitable for this bad boy.
23301 (Struct::TypeAttr): ditto.
23302 Handle nested classes.
23303 (TypeContainer::) Remove all the type visiting code, it is now
23304 replaced with the rootcontext.cs code
23306 * rootcontext.cs (GetClassBases): Added support for structs.
23308 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23310 * interface.cs, statement.cs, class.cs, parameter.cs,
23311 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23312 Drop use of TypeRefs, and use strings instead.
23314 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23318 * class.cs (Struct::Struct): set the SEALED flags after
23319 checking the modifiers.
23320 (TypeContainer::TypeAttr): new property, returns the
23321 TypeAttributes for a class.
23323 * cs-parser.jay (type_list): Oops, list production was creating a
23324 new list of base types.
23326 * rootcontext.cs (StdLib): New property.
23327 (GetInterfaceTypeByName): returns an interface by type name, and
23328 encapsulates error handling here.
23329 (GetInterfaces): simplified.
23330 (ResolveTree): Encapsulated all the tree resolution here.
23331 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23334 * driver.cs: Add support for --nostdlib, to avoid loading the
23335 default assemblies.
23336 (Main): Do not put tree resolution here.
23338 * rootcontext.cs: Beginning of the class resolution.
23340 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23342 * rootcontext.cs: Provide better error reporting.
23344 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23346 * rootcontext.cs (CreateInterface): Handle the case where there
23347 are no parent interfaces.
23349 (CloseTypes): Routine to flush types at the end.
23350 (CreateInterface): Track types.
23351 (GetInterfaces): Returns an array of Types from the list of
23352 defined interfaces.
23354 * typemanager.c (AddUserType): Mechanism to track user types (puts
23355 the type on the global type hash, and allows us to close it at the
23358 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23360 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23361 RecordInterface instead.
23363 * cs-parser.jay: Updated to reflect changes above.
23365 * decl.cs (Definition): Keep track of the TypeBuilder type that
23366 represents this type here. Not sure we will use it in the long
23367 run, but wont hurt for now.
23369 * driver.cs: Smaller changes to accomodate the new code.
23371 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23374 * rootcontext.cs (CreateInterface): New method, used to create
23375 the System.TypeBuilder type for interfaces.
23376 (ResolveInterfaces): new entry point to resolve the interface
23378 (CodeGen): Property, used to keep track of the code generator.
23380 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23382 * cs-parser.jay: Add a second production for delegate_declaration
23385 (enum_body): Put an opt_comma here instead of putting it on
23386 enum_body or enum_member_declarations so we can handle trailing
23387 commas on enumeration members. Gets rid of a shift/reduce.
23389 (type_list): Need a COMMA in the middle.
23391 (indexer_declaration): Tell tokenizer to recognize get/set
23393 * Remove old targets.
23395 * Re-add the parser target.
23397 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23399 * cs-parser.jay: Add precendence rules for a number of operators
23400 ot reduce the number of shift/reduce conflicts in the grammar.
23402 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23404 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23407 Get rid of old crufty code.
23409 * rootcontext.cs: Use this to keep track of the parsed
23410 representation and the defined types available to the program.
23412 * gen-treedump.cs: adjust for new convention.
23414 * type.cs: Split out the type manager, and the assembly builder
23417 * typemanager.cs: the type manager will live here now.
23419 * cil-codegen.cs: And the code generator here.
23421 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23423 * makefile: Fixed up for easy making.
23425 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23427 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23430 (unary_expression): Expand pre_increment_expression and
23431 post_decrement_expression to reduce a shift/reduce.
23433 2001-07-11 Simon Cozens
23435 * cs-tokenizer.cs: Hex numbers should begin with a 0.
23437 Improve allow_keyword_as_indent name.
23439 2001-06-19 Miguel de Icaza <miguel@ximian.com>
23441 * Adjustments for Beta2.
23443 2001-06-13 Miguel de Icaza <miguel@ximian.com>
23445 * decl.cs: Added `Define' abstract method.
23446 (InTransit): new property, used to catch recursive definitions.
23448 * interface.cs: Implement `Define'.
23450 * modifiers.cs: Map Modifiers.constants to
23451 System.Reflection.TypeAttribute flags.
23453 * class.cs: Keep track of types and user-defined types.
23454 (BuilderInit): New method for creating an assembly
23455 (ResolveType): New function to launch the resolution process, only
23456 used by interfaces for now.
23458 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23459 that are inserted into the name space.
23461 2001-06-08 Miguel de Icaza <miguel@ximian.com>
23463 * ARGH. I have screwed up my tree so many times due to the use of
23464 rsync rather than using CVS. Going to fix this at once.
23466 * driver.cs: Objetify driver. Load assemblies, use assemblies to
23469 2001-06-07 Miguel de Icaza <miguel@ximian.com>
23471 * Experiment successful: Use System.Type rather that our own
23474 2001-05-25 Miguel de Icaza <miguel@ximian.com>
23476 * cs-parser.jay: Removed nsAliases from here.
23478 Use new namespaces, handle `using XXX;'
23480 * namespace.cs: Reimplemented namespace handling, use a recursive
23481 definition of the class. Now we can keep track of using clauses
23482 and catch invalid using clauses.
23484 2001-05-24 Miguel de Icaza <miguel@ximian.com>
23486 * gen-treedump.cs: Adapted for all the renaming.
23488 * expression.cs (Expression): this class now has a Type property
23489 which returns an expression Type.
23491 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23492 `Type', as this has a different meaning now in the base
23494 2001-05-22 Miguel de Icaza <miguel@ximian.com>
23496 * interface.cs, class.cs: Removed from all the sources the
23497 references to signature computation, as we can not do method
23498 signature computation during the parsing time, as we are not
23499 trying to solve at that point distinguishing:
23503 void a (NS.Blah x) {}
23506 Which depending on the context might be valid or not, as we do not
23507 know if Blah is the same thing as NS.Blah at that point.
23509 * Redid everything so the code uses TypeRefs now instead of
23510 Types. TypeRefs are just temporary type placeholders, that need
23511 to be resolved. They initially have a pointer to a string and the
23512 current scope in which they are used. This is used later by the
23513 compiler to resolve the reference to an actual Type.
23515 * DeclSpace is no longer a CIR.Type, and neither are
23516 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23517 are all DeclSpaces, but no Types.
23519 * type.cs (TypeRefManager): This implements the TypeRef manager,
23520 which keeps track of all the types that need to be resolved after
23521 the parsing has finished.
23523 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23525 * ARGH. We are going to have to store `foreach' as a class rather
23526 than resolving it, as we need to verify error 1579 after name
23527 resolution. *OR* we could keep a flag that says `This request to
23528 IEnumerator comes from a foreach statement' which we can then use
23529 to generate the error.
23531 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23533 * class.cs (TypeContainer.AddMethod): we now add methods to the
23534 MethodGroup instead of the method hashtable.
23536 * expression.cs: Add MethodGroup abstraction, which gets us one
23537 step closer to the specification in the way we handle method
23540 * cs-parser.jay (primary_expression): qualified_identifier now
23541 tried to match up an identifier to a local variable reference or
23542 to a parameter reference.
23544 current_local_parameters is now a parser global variable that
23545 points to the current parameters for the block, used during name
23548 (property_declaration): Now creates an implicit `value' argument to
23551 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23553 * parameter.cs: Do not use `param' arguments as part of the
23554 signature, per the spec.
23556 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23558 * decl.cs: Base class for classes, structs and interfaces. This
23559 is the "Declaration Space"
23561 * cs-parser.jay: Use CheckDef for checking declaration errors
23562 instead of having one on each function.
23564 * class.cs: Factor out some code for handling error handling in
23565 accordance to the "Declarations" section in the "Basic Concepts"
23566 chapter in the ECMA C# spec.
23568 * interface.cs: Make all interface member classes derive from
23569 InterfaceMemberBase.
23571 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23573 * Many things: all interfaces are parsed and generated in
23574 gen-treedump. Support for member variables, constructors,
23575 destructors, properties, constants is there.
23577 Beginning of the IL backend, but very little done, just there for
23580 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23582 * cs-parser.jay: Fix labeled statement.
23584 * cs-tokenizer.cs (escape): Escape " and ' always.
23585 ref_line, ref_name: keep track of the line/filename as instructed
23586 by #line by the compiler.
23589 2001-04-27 Miguel de Icaza <miguel@ximian.com>
23591 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23592 to match the values in System.CodeDOM.
23594 Divid renamed to Divide.
23596 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23598 (Statements.set): remove.
23600 * System.CodeDOM/CodeCatchClause.cs: always have a valid
23603 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23604 falseStatements always have valid values.
23606 * cs-parser.jay: Use System.CodeDOM now.