1 2005-10-10 Raja R Harinath <rharinath@novell.com>
3 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
5 (PropertyExpr.EmitCall): Likewise.
6 * expression.cs (Invocation.EmitArguments): Handle case where
8 (Invocation.EmitCall): Avoid allocating temporary variable if
9 there are no arguments.
11 2005-10-11 Marek Safar <marek.safar@seznam.cz>
14 * convert.cs (ExplicitConversionCore): Fixed object->enum
17 2005-10-07 Raja R Harinath <rharinath@novell.com>
20 * convert.cs (ImplicitConversionStandard): Move conversion of
21 void* to arbitrary pointer types ...
22 (ExplicitConversionStandard): .. here.
23 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
24 error to always print typenames.
26 2005-10-07 Raja R Harinath <rharinath@novell.com>
28 * convert.cs (GetConversionOperator): Rename from
29 GetConversionOperators. Move operator selection code from ...
30 (UserDefinedConversion): ... here.
32 2005-10-06 Marek Safar <marek.safar@seznam.cz>
34 * convert.cs (ExplicitConversionCore): Removed duplicate enum
37 2005-10-05 Marek Safar <marek.safar@seznam.cz>
39 * assign.cs (Assign.DoResolve): Error method changed.
41 * cfold.cs (DoConstantNumericPromotions): Error method changed.
43 * const.cs (ResolveValue): Reset in_transit immediately.
45 * constant.cs: Error method changed.
47 * convert.cs: Removed useless location parameter.
48 (ExplicitNumericConversion): Don't do double enum check.
49 (ExplicitConversionCore): Renamed from ExplicitConversion.
50 (ExplicitUnsafe): Extracted from ExplicitConversion.
51 (ExplicitConversion): Uses for error reporting.
53 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
55 (ResolveBoolean): Uses common error method.
56 (CastToDecimal): Get rid of ec.
57 (CastFromDecimal): Optimized.
58 (ConvCast): Get rid of ec.
60 * enum.cs (ResolveValue): Reset in_transit immediately.
61 (Emit): Return after first error.
63 * expression.cs: Convert changes.
65 * literal.cs: Error method changed.
67 * statement.cs: Error method changed.
69 2005-10-06 Raja R Harinath <rharinath@novell.com>
71 Fix gtest-131.cs and gtest-211.cs.
72 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
73 Only emit code for a label if it is used. Unreachable code can
74 violate ECMA evaluation stack invariants.
76 2005-09-27 Marek Safar <marek.safar@seznam.cz>
78 * anonymous.cs: Implemented ExprClassName.
80 * assign.cs (Assign.DoResolve): Don't chrash when type is not
83 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
86 * class.cs (StaticClass.DefineContainerMembers): Report protected
89 * codegen.cs: if(ed) PRODUCTION.
91 * convert.cs (Error_CannotImplicitConversion): Better error
94 * cs-parser.jay: More error checks.
96 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
98 * driver.cs (CSCParseOption): Enabled wrong option check.
100 * ecore.cs (Expression.ExprClassName): Turned to property.
101 (MemberExpr.CheckIntermediateModification): For checking boxed
102 value types modification.
104 * statement.cs (Fixed.Resolve): Expression type must be
105 convertible to fixed type.
106 (CollectionForeach.GetEnumeratorFilter,TryType):
107 Small refactoring for easier error checking.
109 2005-09-26 Marek Safar <marek.safar@seznam.cz>
111 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
114 * class.cs (GeneratedBaseInitializer): New class for customization
115 compiler generated initializers.
116 (MemberBase.DoDefine): Check Obsolete attribute here.
117 (FieldMember.DoDefine): Ditto.
119 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
122 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
123 (MemberCore.GetObsoleteAttribute): Removed argument.
124 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
125 (MemberCore.CheckObsoleteType): New helper.
129 * statement.cs: Updates after MemberCore changes.
131 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
132 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
134 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
135 obsolete attribute for compiler construct.
136 (As.DoResolve): Cache result.
138 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
140 2005-10-01 Miguel de Icaza <miguel@novell.com>
142 * expression.cs (Probe): instead of having a "Type probe_type"
143 keep the extra information as a TypeExpr probe_type_expr since the
144 "As" operator needs to perform some type checks.
146 * (As.DoResolve): If the type is a type parameter, ensure that it
147 is constrained by a class.
149 2005-09-22 Miguel de Icaza <miguel@novell.com>
151 * statement.cs (Lock): Use the TemporaryVariable class instead of
152 manually using local variables as those do not work when variables
155 * ecore.cs: Moved the TemporaryVariable class from being a nested
156 class inside Foreach to be a public class that can be employed in
159 2005-09-19 Marek Safar <marek.safar@seznam.cz>
161 * cs-parser.jay: interface_accessors replaced by
162 accessor_declarations.
164 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
167 * statement.cs (GotoCase.Resolve): Convert null constant to
169 (SwitchLabel.ResolveAndReduce): Ditto.
170 (SwitchLabel.NullStringCase): Custom null stamp.
171 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
173 typemanager.cs (CSharpSignature): Don't skip first argument
176 2005-09-16 Marek Safar <marek.safar@seznam.cz>
178 * cfold.cs, constant.cs, convert.cs, ecore.cs,
179 expression.cs, iterators.cs, literal.cs: Store constants and
182 * class.cs (MemberBase.ShortName): Pass location.
184 * cs-parser.jay: Some location fixes.
186 * ecore.cs (Expression.Location): Made virtual.
188 2005-09-27 Marek Safar <marek.safar@seznam.cz>
191 * const.cs (Const.ResolveValue): Check for assigning non-null
192 value to reference type.
194 2005-09-26 Raja R Harinath <rharinath@novell.com>
197 * expression.cs (This.VerifyFixed): In a value type T, the type of
198 'this' is T&, iow, 'this' is either an out or ref parameter. In a
199 value type R, 'this' is treated as a value parameter.
201 2005-09-05 Miguel de Icaza <miguel@novell.com>
203 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
204 if the underlying types are the same, otherwise we need to produce
205 code that will do the proper cast.
207 This was exposed by Marek's constant rewrite which produced
208 invalid code for the call site:
215 This fixes test-49.cs
217 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
219 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
220 Type/Object should be allowed as well. Fixed bug #75968.
222 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
224 * expression.cs : (Binary.DoResolve): when one is enum constant and
225 another is constant 0, then return enum one *as enum type*.
228 2005-10-04 Martin Baulig <martin@ximian.com>
230 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
231 `SetMemberIsUsed()' work for generics, too.
233 2005-10-04 Martin Baulig <martin@ximian.com>
235 * expression.cs (DelegateInvocation.EmitStatement): Make this work
236 for corlib. Fixes #75691.
238 2005-09-28 Marek Safar <marek.safar@seznam.cz>
241 * driver.cs: Fix compilation files with full root path.
243 2005-09-25 Miguel de Icaza <miguel@novell.com>
245 * report.cs (SymbolRelatedToPreviousError): Format the output so
246 it does not use an open parenthesis that is never closed.
248 * driver.cs: Follow coding guidelines
250 2005-09-18 Miguel de Icaza <miguel@novell.com>
252 * driver.cs: Set InEmacs based on the environment variable EMACS.
254 * location.cs (InEmacs): in this mode, do not report column
255 location as it confuses Emacs.
257 2005-10-03 Raja R Harinath <rharinath@novell.com>
259 * support.cs (SeekableStreamReader.Position): Don't error out when
260 the requested position is just beyond the end of the current
263 2005-09-28 Raja R Harinath <rharinath@novell.com>
265 * support.cs (SeekableStreamReader): Simplify drastically. Don't
266 try to keep in sync with the byte count of the underlying Stream.
267 However, this limits us to a window size of 2048 characters: i.e.,
268 the maximum lookahead of our lexer/parser can be 2048 characters.
270 2005-09-22 Martin Baulig <martin@ximian.com>
272 * driver.cs: Removed a debugging FIXME.
274 2005-09-21 Raja R Harinath <rharinath@novell.com>
276 * cs-parser.jay (type_arguments): Add CS1644 check.
277 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
279 2005-09-15 Raja R Harinath <rharinath@novell.com>
281 * Makefile (PROGRAM): Make profile specific.
282 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
283 the current directory.
286 * expression.cs (Invocation.EmitCall): Remove optimization on
287 this_call since it doesn't handle 'this' being a value type.
289 2005-09-05 Geoff Norton <gnorton@customerdna.com>
291 * driver.cs: Ensure file handles are closed after parsing
293 2005-09-05 Miguel de Icaza <miguel@novell.com>
295 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
296 if the underlying types are the same, otherwise we need to produce
297 code that will do the proper cast.
299 This was exposed by Marek's constant rewrite which produced
300 invalid code for the call site:
307 This fixes test-49.cs
309 2005-09-05 Martin Baulig <martin@ximian.com>
311 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
312 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
314 * cs-parser.jay (delegate_declaration): Small fix for #75852.
316 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
318 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
319 to be a pointer type due to the spec 25.2, so check if declaring
320 type is generic type definition. Fixed bug #75772.
322 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
325 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
326 both types are not defined by methods.
327 * expression.cs : (Invocation.IsApplicable): it should work when
328 the argument type is equal to the parameter type, not only when
329 ImplicitConversionExists() returns true.
331 2005-09-02 Raja R Harinath <rharinath@novell.com>
333 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
337 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
338 flow-branching for LocalVariableReferences in case we were invoked
340 * expression.cs (LocalVariableReference.VerifyAssigned): New.
342 (LocalVariableReference.DoResolveBase): ... this.
343 (MemberAccess.Resolve): Do the check that was disabled during
346 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
349 (PartialContainer.Create): check abstract/sealed/static strictly
350 but abstract/sealed can exist only at one side. Fixed bug #75883.
352 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
355 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
356 specified, don't default to UnmanagedType.I4.
358 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
360 * expression.cs : conditional operator should check possibly
361 incorrect assign expression. Fixed bug #75946.
363 2005-08-30 Raja R Harinath <rharinath@novell.com>
366 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
367 (ScopeInfo.EmitScopeType): Use it to construct field names from
368 names of captured locals.
371 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
372 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
373 Pass 'target_type' to BoxedCast. Don't default to 'object'.
374 (ExplicitConversion): Remove enum cases already handled by
375 implicit conversion. Move implicit conversion check to the beginning.
376 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
377 * expression.cs (ArrayCreation.EmitDynamicInitializers):
378 Don't treat System.Enum as a struct.
380 2005-08-30 Jb Evain <jbevain@gmail.com>
382 * attribute.cs: handles as expression in parameters.
384 2005-08-30 Raja R Harinath <rharinath@novell.com>
387 * class.cs (TypeContainer.VerifyClsName): Don't use a
388 PartialContainer when verifying CLS compliance.
389 (AbstractPropertyEventMethod): Set Parent here, ...
390 (PropertyMethod): ... not here.
392 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
394 * attribute.cs : escaped attribute name should not be allowed to be
395 resolved (e.g. @class as classAttribute). Fixed bug #75930.
397 2005-08-29 Raja R Harinath <rharinath@novell.com>
400 * convert.cs (ImplicitStandardConversionExists): Allow zero also
401 when converting a long constant to unsigned long.
402 * expression.cs (Invocation.OverloadResolve): Add sanity check to
403 detect where IsApplicable and VerifyArgumentsCompat disagree.
405 2005-08-29 Raja R Harinath <rharinath@novell.com>
406 and Carlos Alberto Cortez <carlos@unixmexico.org>
409 * class.cs (TypeContainer.CanElideInitializer): New helper.
410 (TypeContainer.EmitFieldInitializers): Use it to determine if we
411 can safely emitting the initializer of a field.
413 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
415 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
416 allowed inside a switch (without loop). Fixed bug #75433.
418 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
420 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
421 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
423 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
425 * driver.cs : kinda reverting the default encoding changes (not exact
426 revert since I noticed that "codepage:reset" might not work fine).
428 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
430 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
431 Location. Now getter and setter store location correctly.
432 (errors/cs0111-12.cs now reports the expected location.)
434 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
436 * driver.cs : Use default encoding on the environment.
437 Removed (now that) extra parameter for SeekableStreamReader.
438 * support.cs : (SeekableStreamReader) third .ctor() argument for
439 StreamReader is not required (always true). preamble size could
440 be acquired in simpler and safe way.
442 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
444 * cs-parser.jay: report CS0642 at warning level 3
445 and report CS0642 for an if else statement also
446 fixes bug #74745. Patch by John Luke (and a bit
448 Removed extra CS0642 warning check for "while",
450 * statement.cs: In Block.Resolve(), CS0642 check
451 is reimplemented to check a sequence of an empty
452 statement and a block.
456 2005-08-24 Marek Safar <marek.safar@seznam.cz>
458 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
459 detection until I fix it.
461 * cs-tokenizer.cs: Changed error message.
463 * cs-parser.jay: Fixed 2 error locations.
465 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
466 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
469 * enum.cs (GetSignatureForError): Fixed.
471 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
475 * typemanager.cs (RegisterProperty): Removed.
477 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
479 2005-08-24 Raja R Harinath <rharinath@novell.com>
482 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
483 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
485 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
487 * expression.cs : tiny fix is required for not warning positive ulong.
490 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
492 * expression.cs : add CS0652 check for constant and integral
493 expression. Fixed bug #53974.
495 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
497 * expression.cs : in DoNumericPromotions(), check if there is implicit
498 conversion overload for string (to check CS0034). Fixed bug #52492.
500 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
502 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
504 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
506 * ecore.cs : report location when it is *not* Null.
508 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
514 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
515 correctly. Fixed bug #75721.
517 2005-08-23 Raja R Harinath <rharinath@novell.com>
519 * support.cs (SeekableStreamReader.Position): Avoid an expensive
520 loop that performs 'min (pos, char_count)'.
523 * expression.cs (Unary.ResolveOperator): Don't discard implicit
524 converted value in Operator.OnesComplement.
526 2005-08-22 Ben Maurer <bmaurer@ximian.com>
528 * anonymous.cs: If the anon method is pulled into a helper class,
529 it needs to be `internal' not `private'. Fixes runtime behavior on
532 2005-08-17 Marek Safar <marek.safar@seznam.cz>
535 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
538 2005-08-16 Marek Safar <marek.safar@seznam.cz>
540 The big constants rewrite
541 Fix #75746, #75685 and more
542 As a side effect saved 1MB for MWF ;-)
544 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
545 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
546 enum based for corlib compilation.
548 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
551 * class.cs (FixedField.Define): Use ResolveAsConstant.
553 * const.cs (IConstant): Interface constants and enums.
554 (Const.ResolveValue): New method for constant resolvning.
555 (ExternalConstant): Constants from imported assemblies.
557 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
558 conversion; like enums.
559 (Constant.ToType): Converts this constant to different type.
560 (Constant.Increment): Adds 1.
562 * convert.cs (ImplicitConversionRequired): Simplified.
564 * cs-parser.jay: Create EnumMember directly.
566 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
568 * doc.cs (GenerateEnumDocComment): Removed.
570 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
571 (ConvertIntLiteral): Removed.
572 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
574 * enum.cs (EnumMember): Implement IConstant.
575 (Enum.IsValidEnumConstant): Removed.
576 (Enum.GetNextDefaultValue): Removed.
577 (Enum.FindMembers): Updated.
578 (Enum.GenerateDocComment): Iterate enum members.
580 * expression.cs (Cast.TryReduce): Handle enums correctly.
581 (New.Constantify): Made public.
582 (MemberAccess.DoResolve): Removed contant specific if(s).
584 * literal.cs (NullLiteral): Implement new abstract methods.
586 * statement.cs (GotoCase.Resolve): Use new constant methods.
587 (SwitchLabel.ResolveAndReduce): Use new constant methods.
589 * typemanager.cs (LookupEnum): Removed.
590 (IsEnumType): Fixed to work with corlib.
591 (RegisterConstant): Removed.
592 (LookupConstant): Removed.
593 (GetConstant): Changed to work with IConstant.
595 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
597 * location.cs : Fixed overflown (>255) column number.
599 2005-08-03 Raja R Harinath <rharinath@novell.com>
601 First cut of the qualified-alias-member feature.
602 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
604 * cs-parser.jay (DOUBLE_COLON): New token.
605 (namespace_or_type_name): Add rule for recognizing
606 qualified-alias-members.
607 (primary_expression): Likewise.
608 (element_access): Allow QualifiedAliasMember as a possible
609 type-bearing expression.
610 (local_variable_type, local_variable_pointer_type): Likewise.
611 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
612 aliases in the current and enclosing namespace declarations.
613 (NamespaceEntry.UsingAlias): Add CS0440 warning.
614 * decl.cs (MemberName.is_double_colon): New.
615 (MemberName.MemberName): Add new constructor for alias-member.
616 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
617 * expression.cs (QualifiedAliasMember): New expression type.
619 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
621 * location.cs : it borked when no argument was specified.
623 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
625 * location.cs : tiny ToString() format fix.
627 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
629 * statement.cs : oops, it was missing.
631 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
633 A set of fixes for precise line/column location.
636 "token" field now holds a file/line "delta", a line number offset
637 from the segment, and a column number. See also:
638 http://lists.ximian.com/pipermail/mono-devel-list/2004-
640 Removed static IsNull. Use instance IsNull property instead.
642 For some tokens it stores Location. For Identifier it stores
643 LocatedToken which is a pair of string name and location.
644 Column numbers are adjusted only at getChar().
646 Use Location.ToString() for reporting (it now contains column).
648 Largely modified to use LocatedToken instead of
649 string (IDENTIFIER), and to acquire Location from some tokens.
650 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
651 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
653 Now MemberName holds Location. DeclSpace.ctor() receives Location
654 as a parameter. Removed extra parameters to all derived classes.
655 Replaced Location.IsNull() with instance property.
656 * assign.cs, expression.cs :
657 Added .ctor() overload that omits Location.
659 Added "nameEscaped" flag that indicates the identifier was escaped
660 in the source file. This fixes bug #57047.
662 2005-09-02 Martin Baulig <martin@ximian.com>
664 * class.cs: Make CS3005 a warning, not an error.
666 2005-08-02 Marek Safar <marek.safar@seznam.cz>
668 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
669 New method, looking for lo-case imported cls type.
671 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
674 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
676 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
678 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
680 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
682 Optimized to save 3.5 MB for SWF compilation.
684 2005-08-01 Marek Safar <marek.safar@seznam.cz>
686 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
687 (PartialContainer.Create): Moved logic AddToContainer.
688 (PartialContainer.MarkForDuplicationCheck): Shares name.
690 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
693 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
695 (Namespace.GetSignatureForError): New method.
697 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
698 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
700 2005-08-01 Raja R Harinath <rharinath@novell.com>
703 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
704 member lookup rather than qualifier_type, since qualifier_type can
707 2005-08-01 Marek Safar <marek.safar@seznam.cz>
709 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
712 2005-07-31 Miguel de Icaza <miguel@novell.com>
714 * statement.cs: Copy the local exception into the exception
715 captured local. Fixes 75674
717 2005-07-31 Raja R Harinath <harinath@gmail.com>
720 * expression.cs (Invocation.OverloadResolve): Don't report error
721 CS1501 if error CS1502 has been reported.
722 (New.DoResolve): Delegate CS1501 reporting to
723 Invocation.OverloadResolve.
726 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
727 invariant-meaning-in-block property in an enclosing block if
730 2005-07-29 Marek Safar <marek.safar@seznam.cz>
732 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
733 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
734 (Switch.CheckSwitch): Just save 50kb for SWF.
736 2005-07-27 Martin Baulig <martin@ximian.com>
738 * anonymous.cs (CaptureContext.AddField): Added
739 `AnonymousContainer am' argument; compute its toplevel scope if
740 it's not already computed. Fixes #75649.
742 2005-07-26 Raja R Harinath <rharinath@novell.com>
745 * class.cs (Constructor.Emit): Reset block to null if the block
748 2005-07-25 Marek Safar <marek.safar@seznam.cz>
750 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
752 2005-07-25 Marek Safar <marek.safar@seznam.cz>
754 * class.cs (MethodData.Define): Check whether accessor implementing
757 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
759 2005-07-22 Marek Safar <marek.safar@seznam.cz>
762 * namespace.cs (LookupType): Moved same type check to...
764 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
767 2005-07-21 Raja R Harinath <rharinath@novell.com>
769 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
770 already found a typebuilder.
771 * class.cs (MethodCore.IsDuplicateImplementation): Compare
772 MemberNames, not strings.
774 * const.cs (Error_ExpressionMustBeConst):
775 Rename from Error_EpressionMustBeConst.
776 * const.cs, class.cs, statement.cd: Update.
778 2005-07-21 Marek Safar <marek.safar@seznam.cz>
782 * const.cs (Const.LookupConstantValue): Report missing contant expression
784 (Error_EpressionMustBeConstant): Only one error method.
786 * class.cs, statement.c: Updated.
788 2005-07-20 Raja R Harinath <rharinath@novell.com>
790 * statement.cs (Block.Flags): Add back HasVarargs.
791 (Block.flags): Make protected.
792 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
794 * typemanager.cs (types, typecontainers, user_types): Remove.
795 (UserTypes, TypeContainers): Likewise.
796 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
797 (CleanUp, Reset): Update.
798 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
799 (GetNestedType): Use Type.GetNestedType.
800 (CoreLookupType): Take two arguments, the namespace and the
801 basename of the type. Update to use the Namespace.Lookup
803 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
804 (RealMemberLookup): Use IsNestedChildOf instead of playing with
805 string concatenation and substring matches.
806 * class.cs, enum.cs, delegate.cs: Update to changes.
808 2005-07-20 Marek Safar <marek.safar@seznam.cz>
810 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
811 Expression and made virtual.
813 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
814 (ImplicitStandardConversionExists): Fixed `byte' typo ?
816 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
818 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
821 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
824 2005-07-18 Marek Safar <marek.safar@seznam.cz>
827 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
828 AssemblyCultureAttribute is not used on executable.
831 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
833 2005-07-16 Raja R Harinath <rharinath@novell.com>
836 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
837 New. Reports CS0252/CS0253.
838 Mostly taken from preliminary patch by Duncak Mak.
839 (Binary.DoResolveOperator): Store results of operator lookup.
840 Use them to detect if we need to warn about unintended reference
843 2005-07-15 Raja R Harinath <rharinath@novell.com>
846 * namespace.cs (Namespace.Lookup): Add back location parameter.
847 (Namespace.LookupType): Add CS0436 report. Add location parameter.
848 * delegate.cs, ecore.cs, expression.cs: Update to changes.
850 * codegen.cs (EmitContext.DeclSpace): Make readonly.
851 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
852 (Namespace.LookupType): ... this.
853 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
855 * typemanager.cs (LookupTypeReflection): Remove buggy code that
856 purported to handle pointers.
857 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
860 2005-07-15 Marek Safar <marek.safar@seznam.cz>
862 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
865 2005-07-15 Raja R Harinath <rharinath@novell.com>
867 * namespace.cs (Namespace.Lookup): Drop location parameter.
868 (NamespaceEntry.LookupAlias): Remove. Merge into ...
869 (NamespaceEntry.Lookup): ... this.
870 (NamespaceEntry.Error_AmbiguousTypeReference):
871 Move here from DeclSpace.
872 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
874 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
875 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
876 Move to NamespaceEntry.
877 * delegate.cs, expression.cs: Update to changes.
879 2005-08-31 Martin Baulig <martin@ximian.com>
881 Committing a patch from Atsushi Enomoto for #75850.
883 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
884 Prefer a generic enumerator over a non-generic one.
886 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
888 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
889 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
891 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
893 * driver.cs : reverting default encoding change as well as mcs.
895 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
897 * driver.cs, support.cs : merged r48826.
899 > could you integrate your mcs changes to gmcs otherwise
900 > gmcs cannot compile some files.
902 2005-08-20 Martin Baulig <martin@ximian.com>
904 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
905 scope if we don't already have it.
907 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
908 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
911 2005-07-31 Miguel de Icaza <miguel@novell.com>
913 * statement.cs: Copy the local exception into the exception
914 captured local. Fixes 75674
916 2005-07-15 Marek Safar <marek.safar@seznam.cz>
918 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
921 2005-08-12 Martin Baulig <martin@ximian.com>
923 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
924 for nested types here to avoid hitting the cache too early.
926 2005-08-09 Miguel de Icaza <miguel@novell.com>
928 * enum.cs: On the new compiler CLS error 3005 is now a warning not
931 2005-08-03 Martin Baulig <martin@ximian.com>
933 Make iterators in generic methods work; see gtest-191.cs.
936 (Constraints.Resolve): Protect against being called twice.
939 (TypeContainer.GetClassBases): Make this `protected virtual'.
941 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
942 (Iterator.GetClassBases): Override this and compute the base
944 (Iterator.DefineNestedTypes): If we're a generic method, all our
945 method type parameters become class type parameters on the proxy
949 (ToplevelBlock.Parameters): Make this a property, not a field.
950 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
952 2005-08-03 Martin Baulig <martin@ximian.com>
954 * typemanager.cs (TypeManager.IsSubclassOf): Use
955 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
956 (TypeManager.GetFullName_recursed): Improved.
958 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
961 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
962 Private accessor case, using TypeManager.IsPrivateAccessible instead of
963 invocation_type == mi.DeclaringType, since the first one also checks
964 other condition used by generic instances.
966 2005-07-27 Martin Baulig <martin@ximian.com>
968 * anonymous.cs (CaptureContext.AddField): Added
969 `AnonymousContainer am' argument; compute its toplevel scope if
970 it's not already computed. Fixes #75649.
972 2005-07-14 Marek Safar <marek.safar@seznam.cz>
974 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
975 CheckAttributeType and refactored.
976 (Attribute.ResolvePossibleAttributeType): Changed to reuse
977 ResolveAsTypeTerminal error handling.
978 (ResolveAsTypeTerminal): Introduced because of global attributes extra
980 (GetSignatureForError): Print errors in same way.
983 * codegen.cs: Reflect attribute GetSignatureForError change.
986 * expression.cs: Add silent parameter to ResolveAsTypeStep.
988 * namespace.cs (UsingEntry): Refactored to make fields private.
991 statement.cs: Error_UnexpectedKind has extra parameter.
993 2005-07-14 Raja R Harinath <rharinath@novell.com>
995 * ecore.cs (IAlias): Remove.
996 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
997 that implement the interface.
998 * namespace.cs (Namespace): Likewise.
999 (Namespace.declspaces): Renamed from 'defined_names'.
1000 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
1001 DeclSpace instead of an IAlias.
1002 * tree.cs (Tree.AddDecl): Update.
1004 2005-07-12 Raja R Harinath <rharinath@novell.com>
1006 * statement.cs (Block.Flags); Remove HasVarargs.
1007 (Block.HasVarargs): Move to ToplevelBlock.
1008 (Block.ThisVariable, Block.AddThisVariable): Likewise.
1009 (Block.Variables): Make protected. Initialize variable hashtable
1011 (Block.AddVariable): Update.
1012 (Block.Resolve): Update to changes.
1013 (ToplevelBlock.HasVarargs): New boolean.
1014 (ToplevelBlock.ThisVariable): Move here from Block.
1015 (ToplevelBlock.AddThisVariable): Likewise.
1016 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
1017 * expression.cs (This.ResolveBase): Update to changes.
1018 (ArglistAccess.DoResolve): Likewise.
1020 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1023 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1025 * class.cs (TypeContainer.VerifyMembers): Distinguish between
1026 not used and not used & assigned.
1027 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1029 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1032 * expression.cs (Is.DoResolve): null is never provided type.
1034 2005-07-08 Marek Safar <marek.safar@seznam.cz>
1037 * cs-parser.jay: Less strict event error rule to catch more errors.
1039 2005-07-11 Martin Baulig <martin@ximian.com>
1041 * generic.cs (ConstructedType.CheckConstraints): Improve the check
1042 for the constructor constraint: we do not only have to check
1043 whether the class has a public constructor, but also ensure that
1044 it's parameterless. Fixes #75492.
1046 2005-07-11 Martin Baulig <martin@ximian.com>
1048 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
1049 between type parameters if they either have the reference type
1050 constraint or the class constraint.
1052 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
1054 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
1056 2005-07-07 Marek Safar <marek.safar@seznam.cz>
1059 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1060 (ExtractSecurityPermissionSet): Cope with self referencing security
1061 attributes properly.
1063 * driver.cs (SetOutputFile): Made public property OutputFile.
1065 2005-07-07 Raja R Harinath <rharinath@novell.com>
1068 * class.cs (TypeContainer.first_nonstatic_field): Rename from
1069 has_nonstatic_fields. Make into a FieldBase pointer.
1070 (TypeContainer.AddField): Add CS0282 check.
1071 (TypeContainer.EmitType): Update.
1073 2005-07-06 Miguel de Icaza <miguel@novell.com>
1075 * cs-tokenizer.cs (consume_identifier): Do not create strings to
1076 compare if they start with __.
1078 2005-07-06 Raja R Harinath <rharinath@novell.com>
1080 * statement.cs (Switch.SwitchGoverningType): Only look at
1081 UserCasts that don't need implicit standard conversions to one of
1082 the allowed switch types (Fixes test-322.cs).
1083 (LocalInfo.Resolve): Re-enable sanity-test.
1085 2005-07-06 Marek Safar <marek.safar@seznam.cz>
1087 * cs-tokenizer.cs (consume_identifier): Detect double undescores
1089 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1091 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1093 2005-07-06 Raja R Harinath <rharinath@novell.com>
1096 * ecore.cs (SimpleName.GetSignatureForError): Add.
1097 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1098 (MemberAccess.GetSignatureForError): Add.
1100 2005-07-05 Marek Safar <marek.safar@seznam.cz>
1102 The big error and warning messages review.
1132 * typemanager.cs: Updated.
1134 * class.cs: (MethodCore.SetYields): Moved here to share.
1135 (PropertyMethod.Define): Moved iterator setup here.
1137 * iterators.cs: Add orig_method to have full access to parent
1140 2005-07-05 Raja R Harinath <rharinath@novell.com>
1142 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1143 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1144 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1145 variable of struct type.
1146 * expression.cs (Unary.ResolveOperator): Update to change.
1147 (Indirection.VerifyFixed): Likewise.
1148 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1149 (ParameterReference.VerifyFixed): Value parameters are fixed.
1150 (This.VerifyFixed): Treat 'this' as a value parameter.
1151 * statement.cs (LocalInfo.IsFixed): Remove.
1153 2005-07-01 Martin Baulig <martin@ximian.com>
1155 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1156 `ec.EmitThis ()' to get the correct scope.
1158 2005-07-01 Martin Baulig <martin@ximian.com>
1160 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1161 instance is a ParameterReference; fixes #75299.
1163 2005-06-30 Raja R Harinath <rharinath@novell.com>
1166 * expression.cs (Indexers.map): Remove.
1167 (Indexers.Append): Filter out inaccessible setters and getters.
1168 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1171 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
1173 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1174 (FieldExpr.Emit, PropertyExpr.Emit): Update.
1175 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1176 * expression.cs (Invocation.EmitCall): Add CS0120 check.
1178 2005-06-30 Marek Safar <marek.safar@seznam.cz>
1181 * class.cs (FieldBase.GetInitializerExpression): One more field
1184 2005-06-28 Miguel de Icaza <miguel@novell.com>
1186 * pending.cs: Do not define a proxy if the base method is virtual,
1187 it will be picked up by the runtime (bug 75270).
1189 2005-07-08 Martin Baulig <martin@ximian.com>
1191 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1192 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1194 2005-07-07 Martin Baulig <martin@ximian.com>
1196 * generic.cs (ConstructedType.CheckConstraint): Use
1197 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
1198 called recursively; fixes #75329.
1200 2005-07-06 Martin Baulig <martin@ximian.com>
1202 * generic.cs (TypeManager.InferTypeArguments): Added support for
1203 anonymous methods; fixes #75461.
1205 2005-07-01 Martin Baulig <martin@ximian.com>
1207 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1208 `ec.EmitThis ()' to get the correct scope.
1210 2005-07-01 Martin Baulig <martin@ximian.com>
1212 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
1213 instance is `This'; fixes #75299.
1215 2005-06-30 Martin Baulig <martin@ximian.com>
1217 * class.cs (Indexer): Implement IIteratorContainer; added support
1218 for iterators in indexers.
1221 (EmitContext.CurrentIterator): Make this a property, not a field.
1223 * anonymous.cs (AnonymousContainer.Iterator): New public property.
1225 2005-06-28 Miguel de Icaza <miguel@novell.com>
1227 * pending.cs: Do not define a proxy if the base method is virtual,
1228 it will be picked up by the runtime (bug 75270).
1230 2005-06-28 Martin Baulig <martin@ximian.com>
1232 * cs-parser.jay (interface_method_declaration): Avoid a
1233 reduce/reduce conflict by moving some of the code into a separate
1234 `interface_method_declaration_body' rule; fixes #75368.
1236 2005-06-28 Martin Baulig <martin@ximian.com>
1238 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
1239 array check after the check for TypeBuilder's.
1241 2005-06-21 Raja R Harinath <rharinath@novell.com>
1243 * convert.cs (FindMostEncompassedType): Add two trivial special
1244 cases (number_of_types == 0 || number_of_types == 1).
1245 (FindMostEncompasingType): Likewise.
1247 2005-06-17 Raja R Harinath <rharinath@novell.com>
1249 Some cleanups preparing for the fix of #75283.
1250 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1252 (EventExpr.InstanceResolve): Likewise.
1253 (EventExpr.DoResolve): Remove redundant checks.
1255 2005-06-08 Miguel de Icaza <miguel@novell.com>
1257 * class.cs: Small fix.
1259 2005-06-08 Raja R Harinath <rharinath@novell.com>
1262 * class.cs (GetPartialBases): Fix return value check of
1265 2005-06-07 Raja R Harinath <rharinath@novell.com>
1267 Ensure that partial classes are registered in their enclosing
1268 namespace. Initial part of fix of #75160.
1269 * tree.cs (Tree.RecordDecl): Add new namespace argument.
1270 Register declspace with namespace here, not in
1271 DeclSpace.RecordDecl.
1272 * cs-parser.jay: Pass namespace to RecordDecl.
1273 * class.cs (PartialContainer.Create): Likewise.
1274 (ClassPart.DefineType): New sanity-check. Throws an exception if
1276 * decl.cs (Declspace.RecordDecl): Remove.
1277 * namespace.cs (NamespaceEntry.DefineName): Remove.
1279 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1281 * rootcontext.cs: Reset TargetExt as well.
1283 2005-06-03 Raja R Harinath <rharinath@novell.com>
1285 * ecore.cs (Expression.Resolve): Emit CS0654 error when
1288 2005-06-02 Raja R Harinath <rharinath@novell.com>
1290 Fix #75080, cs0119.cs.
1291 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
1293 (Expression.Resolve): ... this. Use it. Remove bogus code
1294 allowing ExprClass.Type and ExprClass.Namespace for
1295 ResolveFlags.VariableOrValue.
1296 (Expression.Resolve) [1-argument variant]: Change default resolve
1297 flags based on language version.
1298 (Expression.Error_UnexpectedKind): Use a simple string array
1299 rather than an ArrayList.
1300 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1302 (TypeOfVoid.DoResolve): Likewise.
1303 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
1304 flags argument -- it always has the same value.
1306 2005-05-31 Raja R Harinath <rharinath@novell.com>
1309 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1310 Use it in the error message.
1311 * assign.cs, expression.cs, statement.cs: Update.
1313 2005-05-30 Raja R Harinath <rharinath@novell.com>
1316 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1317 the "almostMatchedMember" case too.
1318 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1319 that failed the accessibility checks to 'almost_match'.
1321 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
1323 * attribute.cs: Use internal MethodBuilder methods to set
1324 ExactSpelling and SetLastError on PInvoke methods, instead
1325 of passing them via charset. Fixes #75060.
1327 2005-05-27 Raja R Harinath <rharinath@novell.com>
1329 * parameter.cs (Parameter): Remove TODO comment.
1330 (Parameter.DefineParameter): Remove Location parameter.
1331 (Parameters.LabelParameters): Likewise.
1332 * class.cs (Constructor.Emit): Update to change.
1333 (MethodData.Emit): Likewise.
1334 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
1335 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1337 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
1340 Removed Parameters.Location and added Parameter.Location instead.
1341 Removed Location parameter from Emit() and GetSignature().
1348 Modified all related calls.
1350 2005-06-21 Martin Baulig <martin@ximian.com>
1352 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
1353 left-hand side is not a nullable type; fixes #75328.
1355 2005-06-21 Martin Baulig <martin@ximian.com>
1358 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
1359 (TypeManager.GetFullNameSignature): Likewise.
1361 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
1362 `source.FullName' and `target.FullName' to check whether there are
1363 two conflicting definitions.
1365 2005-06-21 Martin Baulig <martin@ximian.com>
1367 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
1368 a BoxedCast - also for reference types - to be compatible with csc.
1370 2005-06-21 Martin Baulig <martin@ximian.com>
1372 * expression.cs (MemberAccess.DoResolve): Add support for nested
1373 types in a generic instance; fixes #75320.
1375 2005-06-20 Martin Baulig <martin@ximian.com>
1377 * generic.cs (TypeManager.InferType): Also walk the class
1378 hierarchy for generic instances; fixes #75261.
1380 2005-06-17 Martin Baulig <martin@ximian.com>
1382 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
1383 to make things work for corlib.
1385 2005-06-15 Martin Baulig <martin@ximian.com>
1387 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
1388 obsolete `SecurityAction' values.
1390 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1392 * rootcontext.cs: Reset TargetExt as well.
1394 2005-06-09 Martin Baulig <martin@ximian.com>
1396 * delegate.cs (Delegate.VerifyMethod): Added
1397 `MethodGroupExpr old_mg' argument; inherit its
1398 `HasTypeParameters'; fix #75085.
1400 2005-06-09 Martin Baulig <martin@ximian.com>
1402 * expression.cs (Invocation.OverloadResolve): Correctly handle
1403 generic methods for the SetMemberIsUsed(); fix #75064.
1405 2005-06-09 Martin Baulig <martin@ximian.com>
1407 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
1410 2005-06-08 Martin Baulig <martin@ximian.com>
1412 * cs-parser.jay (nullable_type_or_conditional): If we put the
1413 nullable back and our `type' is a `ComposedCast', remove the
1414 nullable from it. Fixes #75156.
1416 * expression.cs (ComposedCast.RemoveNullable): New public method.
1418 2005-06-08 Martin Baulig <martin@ximian.com>
1420 The big Iterators rewrite :-)
1422 * iterators.cs: Rewrite this to use the anonymous methods framework.
1424 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1425 before the TypeContainers; see 2test-21.cs.
1428 (TypeContainer.DefineType): Don't create a new EmitContext if we
1429 already have one (this only happens if we're an Iterator).
1430 (TypeContainer.Define): Also call Define() on all our iterators.
1431 (Method.CreateEmitContext): Added support for iterators.
1434 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1435 (AnonymousContainer.CreateMethodHost): Moved here from
1436 AnonymousMethod and made abstract.
1437 (AnonymousContainer.CreateScopeType): New abstract method.
1438 (AnonymousContainer.IsIterator): New public property.
1439 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1440 get the ScopeTypeBuilder rather than manually defining it here.
1441 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1444 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1445 before RootContext.DefineTypes().
1447 * codegen.cs (EmitContext.RemapToProxy): Removed.
1448 (EmitContext.CurrentAnonymousMethod): Changed type from
1449 AnonymousMethod -> AnonymousContainer.
1450 (EmitContext.ResolveTopBlock): Protect from being called twice.
1451 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1452 (EmitContext.EmitThis): Removed the iterators hacks; use the
1453 anonymous methods framework for that.
1456 (ToplevelBlock.Container): Make this a property, not a field.
1457 (ToplevelBlock.ReParent): New public method; move the
1458 ToplevelBlock into a new container.
1459 (Foreach.TemporaryVariable): Simplify.
1461 2005-06-05 Martin Baulig <martin@ximian.com>
1463 * statement.cs (LocalInfo.CompilerGenerated): New flag.
1464 (Block.AddTemporaryVariable): New public method; creates a new
1465 `LocalInfo' for a temporary variable.
1466 (Block.EmitMeta): Create the LocalBuilders for all the temporary
1468 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1469 non-iterator variables.
1471 2005-06-05 Martin Baulig <martin@ximian.com>
1473 * statement.cs (Foreach.TemporaryVariable): Create the
1474 LocalBuilder in the Emit phase and not in Resolve since in some
1475 situations, we don't have an ILGenerator during Resolve; see
1476 2test-19.cs for an example.
1478 2005-06-04 Martin Baulig <martin@ximian.com>
1480 The big Foreach rewrite - Part II.
1482 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1483 with `PropertyInfo ienumerator_getcurrent'.
1485 * codegen.cs (VariableStorage): Removed.
1488 (Foreach): Derive from Statement, not ExceptionStatement.
1489 (Foreach.CollectionForeach): New nested class. Moved all the code
1490 dealing with collection foreach here.
1491 (Foreach.ForeachHelperMethods): Removed.
1492 (Foreach.TemporaryVariable): Implement IMemoryLocation.
1494 2005-05-23 Martin Baulig <martin@ximian.com>
1496 * statement.cs (Try.DoResolve): Don't create a `finally' if we
1497 don't need to. Fix #75014.
1499 2005-05-26 Raja R Harinath <rharinath@novell.com>
1501 Improve user-defined conversion handling.
1502 * convert.cs (GetConversionOperators): Rewrite. Return only the
1503 applicable operators.
1504 (AddConversionOperators): New. Helper for GetConversionOperators.
1505 (FindMostEncompassedType, FindMostEncompassingType): Verify that
1506 there is only one most encompassed/encompassing type.
1507 (FindMostSpecificSource, FindMostSpecificTarget): Remove
1508 "applicable operator" handling.
1509 (UserConversion): Move cache here from GetConversionOperators.
1510 Directly cache the chosen operator, rather than the whole
1512 (ExplicitNumericConversion): Fix buggy implementation of Decimal
1513 case. Allow conversion of decimal to sbyte and byte too.
1514 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1515 New static methods. Used to avoid allocating EmptyExpressions in
1518 2005-05-24 Duncan Mak <duncan@novell.com>
1520 * ecore.cs (CastFromDecimal): New class for casting a decimal to
1521 another class, used in Convert.ExplicitNumericConversion.
1522 (CastToDecimal): New class, similar to above, but casts to
1523 System.Decimal, used in Convert.ImplicitNumericConversion and also
1524 in explicit convesion from double/float to decimal.
1526 * convert.cs (ImplicitNumericConversion): Handle implicit
1527 conversions to System.Decimal.
1528 (ExplicitNumericConversion): handle explicit conversions to
1533 2005-05-20 Miguel de Icaza <miguel@novell.com>
1535 * typemanager.cs: Do not throw an exception in the TypeBuilder
1536 case, we take care of it on the TypeCode.
1538 2005-05-17 Marek Safar <marek.safar@seznam.cz>
1540 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1543 * cs-parser.jay: Catch more lexical errors.
1545 * report.cs: Add one more Error method.
1548 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1550 2005-05-20 Martin Baulig <martin@ximian.com>
1552 * class.cs (TypeContainer.CircularDepException): Removed.
1553 (TypeContainer.DefineType): Removed the `InTransit' stuff.
1554 (TypeContainer.CheckRecursiveDefinition): Check for circular class
1555 (CS0146) and interface (CS0529) dependencies here.
1557 2005-05-20 Martin Baulig <martin@ximian.com>
1559 * expression.cs (New.DoResolve): Move the CS0712 check above the
1560 CS0144 check; otherwise it can never be reached.
1562 2005-05-20 Martin Baulig <martin@ximian.com>
1564 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
1566 2005-05-20 Martin Baulig <martin@ximian.com>
1568 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
1570 * typemanager.cs (TypeManager.IsAttributeType): New public method.
1572 2005-05-19 Martin Baulig <martin@ximian.com>
1575 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1576 to disable error reporting.
1578 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1579 here since we don't want to report an error; see the new test-336.cs.
1581 2005-05-19 Raja R Harinath <rharinath@novell.com>
1583 * statement.cs (ToplevelBlock.GetParameterReference)
1584 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1585 Move here from class Block.
1586 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1587 * expression.cs (ParameterReference.DoResolveBase): Likewise.
1589 2005-05-18 Martin Baulig <martin@ximian.com>
1594 (FlowBranching.Reachability): Add non-static public And() and Or()
1596 (FlowBranchingSwitch): New class; do the `break_origins' thing
1597 like in FlowBranchingLoop.
1598 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1599 reachability, not just locals and parameters.
1600 (FlowBranching.MergeChild): Remove some of the hacks for loop and
1601 switch; MergeBreakOrigins() now takes care of that.
1603 2005-05-18 Martin Baulig <martin@ximian.com>
1605 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1606 a loop and may leave it, reset the barrier; fixes #74974.
1608 2005-05-16 Raja R Harinath <rharinath@novell.com>
1610 Fix test-382.cs. Emit values of decimal constants.
1611 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1613 (TypeContainer.AddField): ... this.
1614 (TypeContainer.EmitFieldInitializers): Allow the list of fields
1615 with initializers to include 'Const's.
1616 (ClassPart.RegisterFieldForInitialization): Forward to
1618 * const.cs (Const.Const): Pass initializer to base class.
1619 (Const.Define): In case of decimal constants, register them for
1620 initialization in a static constructor.
1622 2005-05-14 Martin Baulig <martin@ximian.com>
1624 * statement.cs (Block.Resolve): Correctly handle unreachable code;
1625 do not call ResolveUnreachable() on unreachable statements in
1626 here, see the comment in the source code.
1628 2005-05-13 Raja R Harinath <rharinath@novell.com>
1631 * expression.cs (BinaryResolveOperator): If one of the operands of
1632 an equality comparison is 'null' and the other is a pointer type,
1633 convert the null to a NullPointer.
1634 * convert.cs (ImplicitReferenceConversion): If the expression is a
1635 NullLiteral and the target type is a pointer type, return a
1636 NullPointer instead.
1637 (ImplicitConversionStandard): Likewise.
1639 2005-05-13 Marek Safar <marek.safar@seznam.cz>
1641 * cs-parser.jay: Set readonly context based on special constructs.
1643 * expression.cs (LocalVariableReference.DoResolveBase): Improved
1644 readonly variable error handling.
1646 * rootcontext.cs (EmitCode): Don't verify members when error
1649 * statement.cs (LocalInfo): Add reaodnly context information.
1650 (SetReadOnlyContext, GetReadOnlyContext): New methods.
1652 2005-05-17 Martin Baulig <martin@ximian.com>
1654 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1657 2005-05-13 Martin Baulig <martin@ximian.com>
1659 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
1660 handle unreachable blocks.
1662 2005-05-13 Martin Baulig <martin@ximian.com>
1665 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1666 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1669 2005-05-13 Martin Baulig <martin@ximian.com>
1671 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1672 instance variable, not a local. Fix #74873.
1673 (Block.ResolveUnreachable): Set it to true here.
1675 2005-05-12 Martin Baulig <martin@ximian.com>
1677 * cs-parser.jay (property_declaration): Pass the `current_class',
1678 not the `current_container' to Property's .ctor. Fixes #74912.
1680 2005-05-11 Martin Baulig <martin@ximian.com>
1682 * typemanager.cs (Closure): Copy this from MCS and merge all the
1683 GMCS-specific changes into it.
1685 2005-05-12 Raja R Harinath <harinath@gmail.com>
1688 * typemanager.cs (unmanaged_enclosing_types): New.
1689 (IsUnmanagedType): Avoid infloops by using
1690 'unmanaged_enclosing_types' to talk with recursive invocations.
1692 2005-05-11 Duncan Mak <duncan@novell.com>
1694 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1695 continuing to process for 'arg'.
1696 (handle_preprocessing_directive): Check the argument of the #endif
1697 directive and report error CS1025 if there are any trailing
1700 According to the C# spec, having even whitespace after the #endif
1701 directive is illegal; however, because we call arg.TrimEnd ()
1702 beforehand, we have the same behavior as csc, allowing whitespace
1703 after the directive.
1707 2005-05-11 Marek Safar <marek.safar@seznam.cz>
1711 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1712 (Constructor.GetObsoleteAttribute): Implemented correctly.
1714 2005-05-10 Martin Baulig <martin@ximian.com>
1716 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1717 resolve the type; fixes #74864.
1718 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1719 in DoResolve(); fixes #74862.
1721 2005-05-10 Martin Baulig <martin@ximian.com>
1723 * support.cs (ReflectionParameters.ParameterModifier): Use
1724 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1725 and `ParameterAttributes.In'. Fixes #74884.
1727 2005-05-10 Martin Baulig <martin@ximian.com>
1729 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1730 the cache if we're just looking for `MemberTypes.NestedType' in a
1733 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1734 constraints if we're still resolving the type tree.
1735 (Expression.MemberLookup): If we're resolving the type tree, only
1736 look for `MemberTypes.NestedType' since we're only interested in
1739 * class.cs (TypeContainer.DefineType): Don't resolve the type
1740 parameters here; do this later in ResolveType() after the type
1741 tree has been resolved.
1742 (TypeContainer.ResolveType): New public method; this is called
1743 after the type tree is resolved and before the types are being
1744 populated. We resolve the generic constraints here.
1745 (TypeContainer.DoDefineMember): Check the constraints on our base
1746 class and interfaces.
1748 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1749 set the `ResolvingTypeTree' flag on the EmitContext.
1751 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1753 2005-05-10 Marek Safar <marek.safar@seznam.cz>
1755 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1757 * expression.cs (Argument.GetParameterModifier): Turned to property.
1758 (Invocation.Error_InvalidArguments): Add more descriptive errors.
1760 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1763 2005-05-09 Raja R Harinath <rharinath@novell.com>
1766 * decl.cs (MemberCache.AddMethods): Register override methods,
1767 rather than non-override methods.
1768 * typemanager.cs (RegisterOverride): New.
1769 (IsOverride): Update.
1771 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1773 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1775 2005-05-06 Martin Baulig <martin@ximian.com>
1778 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1779 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1781 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1785 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1786 recursive declaration.
1788 * statement.cs (Block.ResolveMeta): Report any error in resolving.
1790 2005-05-06 Marek Safar <marek.safar@seznam.cz>
1792 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1794 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1796 2005-05-05 Raja R Harinath <rharinath@novell.com>
1799 * decl.cs (DeclSpace.FamilyAccessible):
1800 Use TypeManager.IsNestedFamilyAccessible.
1802 Fix reopened #64812.
1803 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1806 2005-05-04 Raja R Harinath <rharinath@novell.com>
1807 Abin Thomas <projectmonokochi@rediffmail.com>
1808 Anoob V E <projectmonokochi@rediffmail.com>
1809 Harilal P R <projectmonokochi@rediffmail.com>
1812 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1813 allow access to all static members.
1815 2005-05-04 Martin Baulig <martin@ximian.com>
1817 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1819 2005-05-04 Martin Baulig <martin@ximian.com>
1823 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1824 section at the end; make things work if `default' is not the last
1827 2005-05-04 Martin Baulig <martin@ximian.com>
1831 * statement.cs (Switch): Replaced the `got_default' field with a
1832 `default_section' one.
1833 (Switch.CheckSwitch): Set `default_section' here.
1834 (Switch.Resolve): If we're a constant switch and the constant is
1835 not found, use the default section.
1837 2005-05-03 Martin Baulig <martin@ximian.com>
1839 * expression.cs (ArrayAccess.EmitGetLength): New public method.
1841 * statement.cs (Foreach.ArrayForeach): New nested class.
1842 (Foreach.TemporaryVariable): New nested class.
1843 (Foreach.EmitArrayForeach): Removed; this is now in the new
1846 2005-05-03 Raja R Harinath <rharinath@novell.com>
1848 * pending.cs (BaseImplements): Move the #74773 fix here. This is
1850 (VerifyPendingMethods): Revert change below.
1852 * typemanager.cs (IsOverride, RegisterNonOverride): New.
1853 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1854 that used to trigger warning -28. Remove warning -28.
1855 * expression.cs (Invocation.OverloadResolve): Use
1856 TypeManager.IsOverride to distinguish override methods.
1859 * pending.cs (VerifyPendingMethods): If a base type implements the
1860 requested interface, don't bother checking individual methods of
1861 the base type. As a side-effect, this prevents the creation of
1862 unnecessary proxies.
1864 2005-05-02 Martin Baulig <martin@ximian.com>
1868 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1869 Also `And' the locals if the old vector is null.
1870 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1871 null; in this case we basically reset all the variables.
1873 2005-05-02 Martin Baulig <martin@ximian.com>
1877 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1878 Added `FlowBranching branching' argument; always `and' the
1879 variables instead of `or'ing them unless we're an infinite loop.
1881 * statement.cs (While.Resolve): Create a new sibling unless we're
1884 2005-05-02 Martin Baulig <martin@ximian.com>
1888 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1889 arguments; use it instead of creating a new TopLevelBlock.
1890 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1891 our ConstructorInitializer.
1894 (TopLevelBlock.TopLevelBranching): New public property.
1895 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1896 and create our `TopLevelBranching'.
1898 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1899 anonymous method host, use `block.TopLevelBranching' rather than
1900 creating a new branching.
1902 2005-04-20 Miguel de Icaza <miguel@novell.com>
1904 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1905 a ScopeInfo, if any of the current children is a child of the new
1906 entry, move those children there.
1908 2005-04-30 Martin Baulig <martin@ximian.com>
1910 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1911 at the beginning of a SwitchSection. Fix #73335.
1913 2005-04-27 Marek Safar <marek.safar@seznam.cz>
1916 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1918 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1919 (FieldExpr.DoResolve): Obsolete members are ignored for field
1922 2005-04-26 Marek Safar <marek.safar@seznam.cz>
1924 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1925 of arrays detection.
1927 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1929 (Field.VerifyClsCompliance): Volatile fields are not compliant.
1931 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1934 2005-04-25 Ben Maurer <bmaurer@ximian.com>
1936 * cs-parser.jay: Use the prefered version of -unsafe in error
1939 2005-04-22 Marek Safar <marek.safar@seznam.cz>
1941 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1944 2005-04-20 John Luke <john.luke@gmail.com>
1946 * driver.cs: fix typo in error message, --outout to --output
1948 2005-04-30 Martin Baulig <martin@ximian.com>
1950 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1951 handle the .NET 2.x security attributes.
1953 2005-04-30 Martin Baulig <martin@ximian.com>
1956 (TypeManager.ExpandInterfaces): Don't add things twice.
1959 (TypeContainer.VerifyClsCompliance): Allow generic instances.
1961 2005-04-29 Martin Baulig <martin@ximian.com>
1963 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1965 * anonymous.cs: Added support for anonymous generic methods.
1967 2005-04-29 Martin Baulig <martin@ximian.com>
1969 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1972 2005-04-29 Martin Baulig <martin@ximian.com>
1974 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1976 * expression.cs (New.DoResolve): Fix the CS0304 check.
1978 2005-04-29 Martin Baulig <martin@ximian.com>
1980 * typemanager.cs (TypeManager.GetFullName): Updated to the new
1983 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1984 explicit interface implementation, compare the interface types.
1985 (MethodData.Define): Use the new naming scheme from the latest
1987 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1989 * decl.cs (MemberName.GetMemberName): Removed.
1990 (MemberName.MethodName, FullName): New properties.
1992 2005-04-25 Raja R Harinath <rharinath@novell.com>
1994 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
1996 2005-04-22 Martin Baulig <martin@ximian.com>
1998 * generic.cs (GenericMethod): Create the EmitContext in the
1999 `Define()'; in `Define(MethodBuilder)', create the type parameters
2000 before calling `Define()'. Fixes #73933.
2002 2005-04-22 Martin Baulig <martin@ximian.com>
2005 (Constraints.Resolve): Make things work wrt. the new type lookup system.
2006 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
2008 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
2009 ConstructedType, check its constraints.
2011 2005-04-20 Marek Safar <marek.safar@seznam.cz>
2013 * codegen.cs (InRefOutArgumentResolving): New field.
2015 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2016 fields outside contructor.
2018 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2020 2005-04-19 Miguel de Icaza <miguel@novell.com>
2022 * anonymous.cs (CaptureContext.EmitParameterInstance): The
2023 parameter code was not completed ever, so it was not as up-to-date
2024 as local variables. Must finish it.
2026 The bug fix was to compare the Toplevel of the block, not the
2027 current block. Thanks for Ben for pointing this out.
2029 2005-04-19 Raja R Harinath <rharinath@novell.com>
2031 * decl.cs (AddMethods): Use the declaring type of the problem
2032 method to determine if we want to squash a warning.
2034 2005-04-19 Marek Safar <marek.safar@seznam.cz>
2036 * attribute.cs: Removed debug output.
2038 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2040 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2043 2005-04-18 Raja R Harinath <rharinath@novell.com>
2046 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2047 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2048 all null comparisons against reference types.
2050 2005-04-18 Marek Safar <marek.safar@seznam.cz>
2053 * class.cs (TypeContainer.CircularDepException) New nested
2055 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2056 (TypeContainer.DefineType): Removed error, reset InTransit before
2058 (Class.DefineType): Throw exception when is in Transit.
2059 Catch exception and report error.
2060 (Struct.DefineType): Throw exception when is in Transit.
2061 Catch exception and report error.
2062 (Interface.DefineType): Throw exception when is in Transit.
2063 Catch exception and report error.
2065 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2066 handle nested exception handlers.
2068 * flowanalysis.cs (InTryWithCatch): New method, search for try with
2071 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2072 InFinally and InCatch storage.
2074 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2075 (Catch.Resolve): Set and Restore ec.InCatch.
2076 (Try.Resolve): Set and Restore ec.InFinally.
2077 (Try.HasCatch): True when try has catch.
2079 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
2081 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2082 for the same event member, so exclude such cases from warning 419.
2085 2005-04-16 Miguel de Icaza <miguel@novell.com>
2087 * expression.cs (Binary.ResolveOperator): Apply patch from John
2088 Luke to fix bug 59864: operators &, | and ^ on enumerations
2089 require that the same enum type on both sides.
2091 * driver.cs: Add warnings to old flag usage, this is to assist
2092 people who produce Makefiles and hope that the Makefiles will be
2095 * class.cs (TypeContainer.EmitType): Moved the definition of the
2096 special $PRIVATE$ field from the resolve phase to the Emit phase.
2097 During resolve we do not know if we are a struct with
2098 HasExplicitLayout, we know this only after the attributes for the
2101 Set the FieldOffset to zero on the dummy field that we create for
2102 the class. Fixes 74590.
2104 2005-04-16 Raja R Harinath <rharinath@novell.com>
2107 * ecore.cs (PropertyExpr.resolved): New.
2108 (DoResolve): Use it to handle a case of double resolution here.
2109 Handle a case of identical-name-and-type-name.
2110 * expression.cs (ArrayCreation.CheckIndices): Avoid double
2111 resolution by storing the results of expression resolution back
2112 into the "probes" array.
2114 2005-04-15 Raja R Harinath <rharinath@novell.com>
2116 Fix cs0208-7.cs and cs0208-8.cs.
2117 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2118 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
2119 error reporting to point out the reason a struct is not unmanaged.
2121 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2123 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
2124 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2126 2005-04-13 Raja R Harinath <rharinath@novell.com>
2129 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2130 IdenticalNameAndTypeName here.
2131 (EventExpr.InstanceResolve): Likewise.
2133 2005-04-13 Marek Safar <marek.safar@seznam.cz>
2135 C# 2.0 DefaultCharSetAttribute implementation
2137 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2138 which allows us to set GlobalNamespace for every resolve.
2139 (Attribute.ResolveArguments): Cut from Resolve.
2140 (Attribute.GetCharSetValue): Returns CharSet named argument.
2141 (Attribute.DefinePInvokeMethod): Gets default charset from
2143 (GlobalAttribute.ResolveAsTypeStep): Override.
2144 (GlobalAttribute.ResolveArguments): Override.
2146 * class.cs (TypeAttr): Is protected.
2148 * codegen.cs (ModuleClass.DefaultCharSet): New member.
2149 (ModuleClass.DefaultCharSetType): New memeber.
2150 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2152 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2153 charset from module.
2155 * delegate.cs (TypeAttr): Override.
2156 (Delegate.DefineType): Use this TypeAttr.
2158 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2159 at very early stage (before types are defined) to resolve model
2160 module attributes. It will probably not work with corlib but it
2163 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2164 charset from module.
2166 * typemanager.cs (default_charset_type): New type.
2168 2005-04-13 Raja R Harinath <rharinath@novell.com>
2170 * decl.cs (MemberCache.AddMethods): Don't warn if
2171 System.Object.Finalize has buggy MethodAttributes.
2173 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2176 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2178 * doc.cs : detect ambiguous reference to overloaded members.
2179 Fixed bug #71603. MS 1.1 csc does not detect it.
2181 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2183 * doc.cs : delegates must not be referenced with parameters.
2186 2005-04-12 Miguel de Icaza <miguel@novell.com>
2188 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2190 2005-04-10 Miguel de Icaza <miguel@novell.com>
2192 * driver.cs (MainDriver): Stop processing if the CLS stage found
2195 (CompilerCallableEntryPoint.InvokeCompiler): Always
2196 reset after execution; Take a TextWriter argument for the
2199 * report.cs: Use the error stream instead of hardcoding stderr.
2201 2005-04-09 Miguel de Icaza <miguel@novell.com>
2203 * class.cs: Reduce code paths to test, too small of an
2204 optimization to make it worth the extra testing. Always perform
2207 2005-04-08 Raja R Harinath <rharinath@novell.com>
2210 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2211 operators that had errors reported on them.
2213 2005-04-08 Marek Safar <marek.safar@seznam.cz>
2215 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2217 (Attribute.Resolve): Add named argument type checking.
2219 * class.cs (FixedField.Define): Use IsPrimitiveType
2221 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2223 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2224 unsafe parameter types.
2226 * statement.cs (Using.ResolveExpression): Add better error description.
2228 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2230 2005-04-08 Raja R Harinath <rharinath@novell.com>
2233 * attribute.cs (Attribute.GetAttributeUsage): Resolve
2234 AttributeUsageAttribute in the emitcontext of the attribute class,
2235 not in the emitcontext of the attributable entity it was attached to.
2236 * cs-parser.jay: Use 'current_class', not 'current_container',
2237 when creating a GlobalAttribute.
2239 2005-04-08 Alp Toker <alp@atoker.com>
2241 * pending.cs: The fix to #58413 failed to compile methods implementing
2242 interfaces with/without params modifiers and vice versa, even though
2243 params modifiers aren't part of the signature. Make the modifier check
2244 less strict as in csc.
2246 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
2247 Anoob V E <projectmonokochi@rediffmail.com>
2248 Harilal P R <projectmonokochi@rediffmail.com>
2251 * pending.cs (TypeAndMethods.mods): New. Store the parameter
2252 modifiers of pending methods.
2253 (PendingImplementation.PendingImplementation): Initialize it.
2254 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2255 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2256 with ParameterData. Add check for modifiers.
2257 * class.cs (MethodData.Define): Update to changes.
2259 2005-04-07 Raja R Harinath <rharinath@novell.com>
2261 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2263 2005-04-07 Marek Safar <marek.safar@seznam.cz>
2265 * class.cs (PropertyMethod.Define): Check private accessor in abstract
2268 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2271 * typemanager.cs: Registered RequiredAttributeAttribute.
2273 2005-04-06 Marek Safar <marek.safar@seznam.cz>
2275 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2276 Warning CS0169 is back at level 3.
2277 (IMethodData.SetMemberIsUsed): New method.
2279 * decl.cs (IsUsed): New value; moved from FieldBase.Status
2280 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2282 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2284 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2286 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2289 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2292 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2293 to avoid the problems with nested types.
2295 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
2296 Anoob V.E <projectmonokochi@rediffmail.com>
2297 Harilal P.R <projectmonokochi@rediffmail.com>
2298 Raja R Harinath <rharinath@novell.com>
2301 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2303 * typemanager (GetConstructor): Make public.
2305 2005-04-05 John Luke <john.luke@gmail.com>
2306 Raja R Harinath <rharinath@novell.com>
2309 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2310 struct too. Return false quicker in a few cases.
2311 (VerifyUnManaged): Use it.
2313 2005-04-05 Raja R Harinath <rharinath@novell.com>
2316 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2317 not 'unreachable_seen'.
2319 2005-04-04 Marek Safar <marek.safar@seznam.cz>
2321 * attribute.cs (Attribute.GetValue): Removed unused.
2323 * codegen.cs (CodeGen.TrimExt): Removed unused.
2325 * cs-parser.jay (output): Removed unused.
2327 * cs-tokenizer.cs (hex_digits): Removed unused.
2329 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2331 * expression.cs (Indirection.LoadExprValue): Removed unused.
2332 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2334 * iterators.cs (Iterator.param_types): Removed unused.
2336 * statement.cs (Goto.block): Removed unused.
2337 (ToplevelBlock.did): Removed unused.
2338 (Switch.ResolveConstantSwitch): Removed unused.
2340 2005-04-01 Ben Maurer <bmaurer@ximian.com>
2342 * rootcontext.cs: Allow mcs to bootstrap with the compilation
2345 2005-04-19 Martin Baulig <martin@ximian.com>
2347 Merged r42462 from MCS and made it work for GMCS.
2349 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
2351 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
2353 2005-04-01 Raja R Harinath <rharinath@novell.com>
2355 Fix #74232 and cs0208-3.cs.
2356 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2357 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2358 unmanaged type. Don't use FieldBuilders when 't' is a
2359 TypeBuilder. Use ModFlags and MemberType fields.
2360 * class.cs (MemberBase.member_type): Rename from MemberType.
2361 (MemberBase.MemberType): New property. Determines member_type on
2363 (MemberBase.DoDefine): Don't initialize MemberType here.
2364 (FieldMember.Define): Likewise.
2366 2005-04-01 Marek Safar <marek.safar@seznam.cz>
2369 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2370 Attributes are emitted there.
2372 2005-04-01 Raja R Harinath <rharinath@novell.com>
2374 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2375 keyword in 'partial enum' too.
2376 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2378 Report from Kamil Skalski <nazgul@omega.pl>.
2381 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2382 have partial containers too.
2384 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2385 in block' checks to Block.CheckInvariantMeaningInBlock.
2386 * statement.cs (Block.GetKnownVariableInfo): Make private.
2387 (Block.IsVariableUsedInChildBlock): Remove.
2388 (Block.IsVariableUsedInBlock): Likewise.
2389 (Block.CheckInvariantMeaningInBlock): New. Show location of
2390 conflicting declaration.
2391 (Block.AddVariable): Make error messages less long-winded and more
2392 specific. Show location of conflicting declaration.
2393 * parameter.cs (Parameters.Location): New readonly property.
2395 2005-03-31 Raja R Harinath <rharinath@novell.com>
2397 Clean up semantics of invoking ResolveMemberAccess.
2398 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2399 can have an instance, ensure that we pass in a non-TypeExpression
2400 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
2401 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2402 argument. Update to changes and simplify.
2403 (FieldExpr.Emitinstance): Remove CS0120 check.
2404 (PropertyExpr.EmitInstance): Likewise.
2405 * expression.cs (Argument.Resolve): Likewise.
2406 (Invocation.DoResolve): Update to changes in semantics of
2409 2005-03-31 Marek Safar <marek.safar@seznam.cz>
2412 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2415 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2417 2005-03-31 Raja R Harinath <rharinath@novell.com>
2419 Fix difference in behaviour with commandline invocation.
2420 * driver.cs (Driver.Reset): New.
2421 (CompilerCallableEntryPoint): Call it.
2423 * statement.cs (If.Resolve): Avoid spurious "uninitialized
2424 variable" warnings if the boolean expression failed to resolve.
2426 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
2428 * attribute.cs: Fix the union of several permissions when some of them
2429 are unrestricted (so the result isn't an unrestricted permission set).
2432 2005-03-30 Raja R Harinath <rharinath@novell.com>
2434 * ecore.cs (MemberExpr): New class. Convert from interface
2436 (MemberExpr.ResolveMemberAccess): Refactor and move here from
2437 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
2439 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2440 (MethodGroupExpr.IsExplicitImpl): Remove.
2441 (Expression.GetFieldFromEvent): Remove.
2442 (SimpleName.MemberStaticCheck): Remove.
2443 (SimpleName.DoSimpleNameResolve): Update to changes.
2444 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2445 (MemberAccess.IdenticalNameAndTypeName): Remove.
2446 (MemberAccess.error176): Move to MemberExpr.
2447 (MemberAccess.DoResolve): Update to changes.
2448 (BaseAccess.DoResolve): Likewise.
2450 2005-03-30 Marek Safar <marek.safar@seznam.cz>
2452 C# 2.0 Conditional attribute class implementation
2454 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2455 Analyzes class whether it has attribute which has ConditionalAttribute
2456 and its condition is not defined.
2458 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2459 (Class.IsExcluded): New method. Search for at least one defined
2460 condition in ConditionalAttribute of attribute class.
2462 2005-03-30 Raja R Harinath <rharinath@novell.com>
2464 * ecore.cs (PropertyExpr): Derive from Expression, not
2465 ExpressionStatement.
2466 (PropertyExpr.EmitStatement): Remove.
2468 2005-03-29 Raja R Harinath <rharinath@novell.com>
2471 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2472 internal field "value__" of an enum be private. The examples for
2473 "value__" that I found on MSDN all used FieldAttributes.Private.
2475 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2476 Don't mention IL method attribute names.
2478 Fix #47991. Remove a TODO.
2479 * statement.cs (Block.Toplevel): Make into a field.
2480 (Block.Parameters): Move into ToplevelBlock.
2481 (Block.known_variables): Rename from child_variable_names.
2482 (Block.Block): Remove variants that take Parameters. Initialize
2483 'Toplevel' with the immediately surrounding toplevel block.
2484 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
2485 LocalInfo parameter.
2486 (Block.GetKnownVariableInfo): New.
2487 (Block.IsVariableNameUsedInChildBlock): Update.
2488 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
2489 the block, even though it may not be in scope.
2490 (Block.AddVariable): Remove Parameters parameter. Use
2491 Toplevel.Parameters instead.
2492 (Block.AddConstant): Remove Parameters parameter.
2493 (Block.GetParameterReference): Update to use Toplevel.Parameters.
2494 (Block.IsParamaterReference): Likewise.
2495 (Block.IsLocalParameter): Likewise. Simplify a lot.
2496 (ToplevelBlock.Parameters): New. Moved from Block.
2497 (ToplevelBlock.ToplevelBlock): Update to changes. Always
2498 initialize Parameters to a non-null value.
2499 * cs-parser.jay: Update to changes.
2500 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2501 simple names that mean different things in the same block. Use
2502 Block.IsVariableNameUsedInBlock.
2504 2005-03-28 Raja R Harinath <rharinath@novell.com>
2506 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2508 2005-03-26 Raja R Harinath <harinath@acm.org>
2511 * assign.cs (Assign.DoResolve): When the RHS of an assignment
2512 fails to resolve, ensure that the LHS is still resolved as an
2515 2005-03-25 Raja R Harinath <harinath@acm.org>
2517 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2519 (Enum.current_ec): Remove.
2520 (Enum.LookupEnumValue): Remove EmitContext argument.
2521 Just uses the one created during DefineType.
2522 (Enum.FindMembers): Update.
2523 * expression.cs (MemberAccess.DoResolve): Update.
2525 2005-03-22 Marek Safar <marek.safar@seznam.cz>
2527 * assign.cs (Assign.DoResolve): Check for CS1717 when
2528 source and target are same (uses Equals).
2530 * expression.cs (LocalVariableReference, ParameterReference,
2531 This): Implemented Equals, GetHashCode.
2533 * statement.cs (Block.GetParameterReference): Removed useless
2536 2005-03-22 Raja R Harinath <rharinath@novell.com>
2539 * statement.cs (Block.AddVariable): Ensure that we skip implicit
2540 blocks before deciding whether the error is cs0136 or cs0128.
2542 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2543 (using_alias_directive, using_namespace_directive): Pass
2544 MemberName, not an expression to Namespace.UsingAlias and
2546 (MakeName): Use the MemberName of the namespace.
2547 * namespace.cs (Namespace.MemberName): New.
2548 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2549 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2551 * decl.cs (MemberName.Name): Make readonly.
2552 (MemberName.FromDotted): New "constructor".
2553 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2554 (MemberCore.Name): Compute from MemberName on demand.
2555 (MemberCore.SetMemberName): Provide a way to change the
2557 (MemberCore.AddToContainer): Don't take a fullname parameter.
2558 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2559 fully qualified name of the container to the member name.
2560 (TypeContainer.AddToTypeContainer): Use a fully qualified name
2561 only if the type is a member of the root container.
2562 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2563 MemberName.Left rather than searching for an embedded ".".
2564 (PartialContainer.CreatePart): Update to changes in RootContext.
2565 (MemberBase.ShortName): Turn into a property. Use
2566 MemberCore.SetMemberName.
2567 (MemberBase.ExplicitInterfaceName): Remove.
2568 (MemberBase.UpdateMemberName): Remove.
2569 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2570 (PropertyBase.SetMemberName): New override.
2571 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2572 (Tree.GetDecl): New.
2573 (Tree.AllDecls): Rename from Decls.
2574 * attribute.cs, enum.cs, report.cs: Update to changes.
2575 * driver.cs (MainDriver): Use MemberName.FromDotted on
2576 RootContext.MainClass.
2578 2005-03-21 Marek Safar <marek.safar@seznam.cz>
2580 * class.cs (FixedField.Define): Check for CS1664 and more sanity
2583 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2585 2005-03-18 Marek Safar <marek.safar@seznam.cz>
2587 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2588 property accessor modifiers.
2590 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2591 fixed buffer attribute (CS1716).
2592 (PropertyMethod.HasCustomAccessModifier): When property accessor
2593 has custom modifier.
2595 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2597 (PropertyExpr.DoResolveLValue): Add CS0272.
2599 2005-03-17 Miguel de Icaza <miguel@novell.com>
2601 * convert.cs: When converting to a pointer, use the proper Conv.U
2602 or Conv.I depending on the source data type.
2604 * cs-tokenizer.cs: Make the size for large decimal constants,
2607 2005-03-17 Martin Baulig <martin@ximian.com>
2609 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2610 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
2612 2005-03-17 Martin Baulig <martin@ximian.com>
2614 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2615 to bool so we can return an error condition.
2616 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2619 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
2621 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2624 2005-03-16 Raja R Harinath <rharinath@novell.com>
2626 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2627 Refactor to avoid traversing the list of assemblies, and to avoid
2628 string concatenation.
2629 * typemanager.cs (guid_attr_type): Remove.
2630 (negative_hits, pointers, references): Remove hashes.
2632 (GetConstructedType): New. Uses type_hash to handle constructed
2633 types (arrays, references, pointers).
2634 (GetReferenceType, GetPointerType): Use it.
2635 (GetNestedType): New. Uses type_hash to handle nested types of
2637 (LookupType, LookupTypeDirect): Remove.
2638 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
2639 'types' hash and LookupTypeReflection directly.
2640 (params_string, params_object): Use GetConstructedType.
2641 * namespace.cs (Namespace.cached_types): New. Cache of reflected
2643 (Namespace.Lookup): Use cached_types.
2644 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2645 provided by old TypeManager.LookupType.
2646 * rootcontext.cs (MakeFQN): Remove.
2647 * decl.cs (DeclSpace.MakeFQN): Likewise.
2648 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2649 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2650 TypeManager.GetConstructedType.
2651 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2653 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
2655 * cs-parser.jay: Fix build.
2657 2005-03-15 Marek Safar <marek.safar@seznam.cz>
2659 * class.cs (TypeContainer.CircularDepException) New nested
2660 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
2662 * cs-parser.jay: Reports CS1527 for any namespace element.
2664 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2667 * expression.cs (ParameterReference.IsAssigned): Changed error to
2669 (Error_WrongNumArguments): Moved CS0245 detection here.
2671 * statement.cs (Return.Resolve): Add CS1622 report.
2673 2005-03-11 Marek Safar <marek.safar@seznam.cz>
2675 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2677 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
2679 * attribute.cs expression.cs: Get rid of some allocations.
2681 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
2683 * doc.cs : just eliminate the latest change.
2685 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2687 * doc.cs : commented out the latest change. It breaks xml-030.cs
2689 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2691 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2692 fail. So invoke CreateType() in FindDocumentedType().
2694 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2696 * cs-tokenizer.cs : added IsKeyword().
2697 * doc.cs : Detect keyword incorrectly used as identifier.
2698 Allow identifiers prefixed by @.
2700 2005-03-10 Marek Safar <marek.safar@seznam.cz>
2702 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2703 It caused exception in namespace resolving (again!).
2705 * class.cs (Class.ctor): Removed exit.
2706 (PropertyMethod.ctor): ditto.
2708 * codegen.cs (Codegen.Reset): Reset static data.
2709 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2711 * cs-tokenizer.cs (Cleanup): Removed.
2713 * driver.cs (GetSystemDir): Rewrote to one line command.
2714 It caused problem with unloaded dynamic modules.
2715 (UnixParseOption): Removed Exit.
2716 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2717 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2718 Now can be mcs used as library.
2720 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2723 * location.cs (Reset): Reset static data.
2725 * namespace.cs (Reset): Reset static data.
2727 * report.cs (Report.Reset): Reset static data.
2729 * rootcontext.cs (RootContext.Reset): Reset static data.
2731 * tree.cs (RootTypes.ctor): Use Location.Null
2733 * typemanager.cs (TypeManager.Reset): Reset static data.
2734 (CoreLookupType): Removed Exit.
2735 (TypeHandle.Reset): Reset static data.
2737 2005-03-10 Raja R Harinath <rharinath@novell.com>
2740 * typemanager.cs (ComputeNamespaces): Import namespaces from
2741 referenced modules too.
2743 2005-03-09 Raja R Harinath <rharinath@novell.com>
2745 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2748 2005-03-09 Raja R Harinath <rharinath@novell.com>
2750 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2751 enclosing DeclSpace. This ensures that a name-lookup populates
2752 more caches and there are fewer 'TypeExpression's. Carve out
2753 nested type lookup into ...
2754 (LookupNestedTypeInHierarchy): ... this.
2756 2005-04-15 Martin Baulig <martin@ximian.com>
2758 Merged r41590 from MCS and make it work in the generics land.
2760 * generic.cs (TypeParameter.UpdateConstraints): Removed the
2763 * class.cs (PartialContainer.UpdateConstraints): Removed.
2764 (PartialContainer.CheckConstraints): Removed.
2765 (PartialContainer.SetParameterInfo): Store the constraints here.
2766 (PartialContainer.DefineTypeParameters): New public method;
2767 resolve the type parameter's constraints here. Note that the
2768 PartialContainer doesn't have an EmitContext anymore, so we must
2769 do this in the ClassPart.
2771 2005-03-09 Raja R Harinath <rharinath@novell.com>
2773 Clean up a few partial-class semantics.
2774 Fixes test-357.cs and cs1618-2.cs.
2775 * cs-parser.jay (struct_declaration): Use 'current_class' as
2776 parent of newly-created struct. Remove call to Register ().
2777 Use 'pop_current_class' to complete handing the current struct.
2778 (interface_declaration): Likewise.
2779 (class_declaration): Likewise.
2780 (enum_declaration): Use 'current_class' as parent of newly created
2782 (delegate_declaration): Likewise.
2783 (pop_current_class): New function. This is used to handle closing
2784 up the 'current_class' and 'current_container', and pointing them
2785 to the enclosing class/container.
2786 (CSharpParser): Initialize 'current_class' too.
2787 * decl.cs (MemberCore): Add check for invariant: a partial
2788 container is not a parsed entity, and thus does not enclose any
2790 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2791 (DeclSpace.BaseTypeExpr): Use it.
2792 (DeclSpace.LookupType): Add check for invariant.
2793 * class.cs (TypeContainer): Add check for invariant: a nested
2794 class should have the same NamespaceEntry as its enclosing class.
2795 (TypeContainer.EmitFieldInitializers): Make virtual.
2796 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2798 (TypeContainer.Register): Remove.
2799 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2800 null. Use TypeResolveEmitContext for resolving base types and
2801 interfaces. Move initialization of Parts.TypeBuilder here from
2803 (TypeContainer.DefineNestedTypes): ... here.
2804 (PartialContainer): Take a Namespace not a NamespaceEntry.
2805 (PartialContainer.Create): Don't use Register. Call the
2806 appropriate Add... function directly.
2807 (ClassPart): Take both the PartialContainer and the enclosing
2808 class as constructor arguments.
2809 (ClassPart.EmitFieldInitializers): Override.
2810 (ClassPart.PartFindNestedTypes): Remove.
2811 (FieldBase.GetInitializerExpression): Resolve the initializer
2812 expression in the emit context of the enclosing class.
2813 * tree.cs (RootTypes): Remove Register ().
2815 2005-03-08 Marek Safar <marek.safar@seznam.cz>
2817 * cs-parser.jay: Removed CS0134.
2819 * driver.cs: Removed CS1901.
2821 * expression.cs (SizeOf.DoResolve): Don't report CS0233
2822 for predefined types.
2824 2005-03-07 Duncan Mak <duncan@novell.com>
2826 * codegen.cs (Save): Catch UnauthorizedAccessException as
2827 well. Fixes bug #73454.
2829 2005-03-07 Marek Safar <marek.safar@seznam.cz>
2831 * cs-tokenizer.cs (xtoken): Add CS1035.
2833 * class.cs (MethodData.Define): Add CS0683.
2834 (FieldMember.ctor): Add CS0681.
2836 2005-03-07 Raja R Harinath <rharinath@novell.com>
2838 * ecore.cs (SimpleName.DoResolve): Rename from
2839 SimpleName.DoResolveAllowStatic.
2840 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2841 Pass 'intermediate' flag to MemberStaticCheck.
2842 (SimpleName.MemberStaticCheck): Skip "static check" only in case
2843 of "intermediate" lookups via MemberAccess.
2844 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
2845 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2847 2005-03-07 Raja R Harinath <rharinath@novell.com>
2850 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2851 slipped in because of variable names that are identical to a
2852 builtin type's BCL equivalent ('string String;', 'int Int32;').
2853 (PropertyExpr.EmitInstance): Likewise.
2855 2005-03-04 Marek Safar <marek.safar@seznam.cz>
2857 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2859 * report.cs (warning_ignore_table): Made public.
2861 2005-03-04 Raja R Harinath <rharinath@novell.com>
2864 * class.cs (MethodData.Emit): Pass 'container' to
2865 container.GetObsoleteAttribute instead of 'container.Parent'.
2867 2005-03-03 Marek Safar <marek.safar@seznam.cz>
2869 * cs-parser.jay: Add 1534 error test.
2871 * iterators.cs (Yield.CheckContext): Add error 1629.
2872 (Iterator.ctor): Save unsafe modifier.
2873 (MoveNextMethod.DoEmit): Restore unsafe context.
2875 * namespace.cs (UsingAlias): Better error message.
2877 2005-03-03 Dan Winship <danw@novell.com>
2879 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2880 the warning message [#73219]
2882 2005-03-03 Raja R Harinath <rharinath@novell.com>
2884 Fix compile with MCS 1.0.0.0.
2885 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2886 w_restore to not depend on string constant folding.
2888 2005-03-03 Raja R Harinath <rharinath@novell.com>
2890 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
2891 CS0246 check to users who passed 'silent = false'.
2892 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2894 (SimpleName.SimpleNameResolve): Update.
2895 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2896 (MemberAccess.IdenticalNameAndTypeName): Update.
2897 * doc.cs (FindDocumentedTypeNonArray): Update.
2899 2005-03-03 Raja R Harinath <rharinath@novell.com>
2901 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2902 * parameters.cs (ComputeAndDefineParameters): Remove.
2903 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2904 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2905 Use GetParameterInfo.
2907 2005-03-02 Marek Safar <marek.safar@seznam.cz>
2909 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2911 2005-03-02 Raja R Harinath <rharinath@novell.com>
2913 Unify DeclSpace.LookupType and DeclSpace.FindType.
2914 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
2915 is in charge of defining nested types on demand.
2916 (DeclSpace.LookupType): Use it when the current_type is a
2917 TypeBuilder. Use LookupTypeDirect for reflected types.
2918 (DeclSpace.FindType): Remove.
2919 (DeclSpace.LookupInterfaceOrClass): Likewise.
2920 (DeclSpace.DefineTypeAndParents): Likewise.
2921 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2922 DeclSpace.LookupType.
2923 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2924 * typemanager.cs (LookupType): Simplify.
2925 (AddUserType): Remove type from negative_hits.
2926 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2927 * class.cs (TypeContainer.FindMembers): Move handling of nested
2929 (TypeContainer.FindMembers_NestedTypes): ... here.
2930 (TypeContainer.FindNestedType): Implement override.
2931 (ClassPart.FindNestedType): Delegate to PartialContainer.
2932 (ClassPart.PartFindNestedType): Looks up the nested types of the
2935 2005-04-14 Martin Baulig <martin@ximian.com>
2937 * generic.cs (ConstructedType): Moved all the type lookup and
2938 nested class logic into SimpleName.
2939 (ConstructedType.ResolveConstructedType): Our underlying type is
2940 already fully resolved; all the type lookup stuff is in
2943 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2944 constructed types here instead of in ConstructedType.
2946 * decl.cs (MemberName.GetTypeExpression): Always create a
2947 SimpleName, not a ConstructedType.
2948 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2950 2005-03-02 Martin Baulig <martin@ximian.com>
2952 * class.cs (TypeContainer.DoDefineMembers): We also need a default
2953 static constructor in static classes.
2955 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
2957 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2958 sizeParamIndex is not specified.
2960 2005-03-01 Marek Safar <marek.safar@seznam.cz>
2963 * report.cs (WarningMessage.IsEnabled): Missing null check.
2965 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2967 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2968 in the fields and not in the properties.
2970 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
2972 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
2975 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2977 * attribute.cs: Small refactoring (improved robustness).
2978 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2979 (ValidateGuid): Removed.
2980 (Resolve): Removed referenced to above mentioned.
2981 (GetAttributeUsage): Made private and changed to work without
2983 (GetIndexerAttributeValue): Don't crash.
2984 (GetConditionalAttributeValue): Ditto.
2985 (GetClsCompliantAttributeValue): Ditto.
2986 (ExtractSecurityPermissionSet): All attributes exceptions are
2988 (GetPropertyValue): New helper.
2989 (GetMethodImplOptions): New method.
2990 (DefinePInvokeMethod): Reuse common code. Implemented handling of
2991 some missing properties.
2993 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2994 (Method.ApplyAttributeBuilder): Updated.
2996 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2999 2005-02-28 Raja R Harinath <rharinath@novell.com>
3002 * report.cs (Report.SymbolRelatedToPreviousError): Handle
3003 non-simple types (array, pointer, reference).
3005 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3007 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3009 * class.cs (MethodCore.IsDuplicateImplementation): Special error
3011 (Method.CheckBase): Catch wrong destructor here.
3012 (MethodData.Define): Add errors 550, 668.
3014 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3016 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3018 * pending.cs (VerifyPendingMethods): Add error 551.
3020 * typemanager.cs (CSharpName): Next error report helper.
3022 2005-02-25 Marek Safar <marek.safar@seznam.cz>
3024 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3025 attributes. Removed useless attribute double check.
3026 It saves almost 2MBs for corlib.
3028 2005-02-25 Raja R Harinath <rharinath@novell.com>
3031 * statement.cs (ExpressionStatement.Resolve): Make robust to being
3032 called twice in case of error.
3034 2005-02-23 Chris Toshok <toshok@ximian.com>
3036 Fix compiler portions of #72827.
3037 * statement.cs (Block.Emit): call Begin/EndScope on the
3038 EmitContext instead of the ILGenerator.
3040 * codegen.cs (EmitContext.BeginScope): new method, call
3041 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3043 (EmitContext.BeginScope): same, but EndScope and CloseScope
3045 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3046 offset and call the superclass's OpenScope(int) with it.
3047 (SymbolWriter.CloseScope): get the current il
3048 offset and call superclass's CloseScope(int) with it.
3050 2005-02-23 Marek Safar <marek.safar@seznam.cz>
3052 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3053 CS1677 for out and ref as well.
3055 * class.cs (Method.Define): Add error CS1599 detection.
3057 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3059 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3061 * delegate.cs (Delegate.Define): Add error CS1599 detection.
3063 * support.cs.cs (ModifierDesc): New helper method.
3065 2005-02-23 Raja R Harinath <rharinath@novell.com>
3066 Abin Thomas <projectmonokochi@rediffmail.com>
3067 Anoob V E <projectmonokochi@rediffmail.com>
3068 Harilal P R <projectmonokochi@rediffmail.com>
3071 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3072 MemberLookup (used for error reporting) actually returns a result.
3073 Fix error report number (122, not 112).
3075 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
3076 Anoob V E <projectmonokochi@rediffmail.com>
3077 Harilal P R <projectmonokochi@rediffmail.com>
3080 * pending.cs (PendingImplementation.GetAbstractMethods):
3081 Find NonPublic members too.
3083 2005-02-22 Marek Safar <marek.safar@seznam.cz>
3085 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3088 * class.cs (MethodCore.CheckMethodAgainstBase):
3089 Add error 239 report.
3091 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3093 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3095 * class.cs (Operator.Define): Add error 217 report.
3097 2005-02-21 Raja R Harinath <rharinath@novell.com>
3100 * expression.cs (Invocation.IsApplicable): Make public.
3101 (Invocation.IsParamsMethodApplicable): Likewise.
3102 * delegate.cs (Delegate.VerifyApplicability): Don't use
3103 Invocation.VerifyArgumentCompat for parameter applicability
3104 testing. Use Invocation.IsApplicable and
3105 Invocation.IsParamsMethodApplicable.
3107 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3109 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3111 * class.cs (Operator.Define): Add error 217 report.
3113 2005-02-21 Raja R Harinath <rharinath@novell.com>
3115 * namespace.cs (UsingEntry.Resolve): Undo change below.
3117 2005-02-21 Raja R Harinath <rharinath@novell.com>
3120 * ecore.cs (Expression.MemberLookupFailed): Add argument to
3121 disable the error message when the extended MemberLookup also
3123 (Expression.MemberLookupFinal): Update.
3124 (SimpleName.DoSimpleNameResolve): Update.
3125 * expression.cs (MemberAccess.ResolveNamespaceOrType):
3126 Don't use MemberLookupFinal.
3127 (New.DoResolve): Update.
3128 (BaseAccess.CommonResolve): Update.
3130 2005-02-21 Raja R Harinath <rharinath@novell.com>
3133 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3134 occured previously, don't resolve again.
3136 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3139 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3140 argument. Call ResolveAttributeUsage for unresolved.
3141 when types doesn't match ctor arguments.
3143 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3144 for nested attribute classes.
3145 (Class.attribute_usage): Removed.
3146 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3147 for attribute class.
3149 * ecore.cs (IsAttribute): Removed.
3151 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3153 * rootcontext.cs (RegisterAttribute): Removed, attributes are
3155 (attribute_types): Removed.
3156 (EmitCode): Global attributes are emited as the latest.
3158 2005-02-18 Marek Safar <marek.safar@seznam.cz>
3160 * class.cs (EmitFieldInitializers): Don't emit field initializer
3161 for default values when optimilization is on.
3163 * constant.cs (Constant.IsDefaultValue): New property.
3165 * driver.cs: Add /optimize handling.
3169 * literal.cs: Implement new IsDefaultValue property.
3171 * rootcontext.cs (Optimize): New field, holds /optimize option.
3173 2005-02-18 Raja R Harinath <rharinath@novell.com>
3175 Fix crasher in re-opened #72347.
3176 * namespace.cs (Namespace.Lookup): Return null if
3177 DeclSpace.DefineType returns null.
3180 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3182 2005-02-18 Raja R Harinath <rharinath@novell.com>
3184 Fix remainder of #63202. Change semantics of DoResolveLValue: it
3185 now returns null if it cannot resolve to an lvalue.
3186 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3187 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3188 returned null. Remove check for SimpleName.
3189 (EventExpr.DoResolveLValue): New.
3190 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3191 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
3193 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
3195 (Unary.ResolveOperator): Move CS0211 check ...
3196 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
3198 (Unary.DoResolveLValue): Simplify.
3199 (AddressOf.DoResolveLValue): New.
3200 (ArrayAccess.DoResolveLValue): New.
3202 2005-02-16 Marek Safar <marek.safar@seznam.cz>
3204 * attribute.cs (Attribute.Resolve): Add arguments casting for
3205 when types doesn't match ctor arguments.
3207 2005-02-16 Raja R Harinath <rharinath@novell.com>
3209 Fix parts of #63202.
3210 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3211 lookup of operator in base type. Ensure that all checks happen
3212 when the operator resolves to an "op_..." method.
3214 2005-02-15 Raja R Harinath <rharinath@novell.com>
3217 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3218 'ignore_cs0104' parameter. Pass it to ...
3219 (NamespaceEntry.Lookup): ... this.
3220 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3221 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3222 (TypeLookupExpression.DoResolveAsTypeStep): Update.
3223 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3224 Update. Request that cs0104 errors be ignored.
3225 (ComposedCast.ResolveAsTypeStep): Update.
3227 2005-02-14 Raja R Harinath <rharinath@novell.com>
3230 * expression.cs (Invocation.BetterFunction): Remove support for
3231 comparing virtual functions and their overrides.
3232 (Invocation.IsOverride): New.
3233 (Invocation.OverloadResolve): Don't consider 'override' functions
3234 during candidate selection. Store them in a lookaside list.
3235 If the selected method is a 'virtual' function, use the list to
3236 find any overrides that are closer to the LHS type.
3238 2005-02-14 Marek Safar <marek.safar@seznam.cz>
3240 * expression.cs (New.DoResolve): Add complex core type reduction.
3241 (New.Constantify): Converts complex core type syntax like 'new int ()'
3244 2005-02-14 Raja R Harinath <rharinath@novell.com>
3246 * decl.cs (EntryType.EntryType): New constructor to create an
3247 updated copy of a cache entry.
3248 (MemberCache.AddMethods): Use it.
3249 (MemberCache.ClearDeclaredOnly): Remove.
3250 (MemberCache.MemberCache): Update.
3252 2005-02-11 Miguel de Icaza <miguel@novell.com>
3254 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3255 variable. This one is represents the actual low-level declaration
3256 of the method, as opposed to the semantic level `IsStatic'.
3258 An anonymous method which is hosted into a static method might be
3259 actually an instance method. IsStatic would reflect the
3260 container, while MethodIsStatic represents the actual code
3263 * expression.cs (ParameterReference): Use the new MethodIsStatic
3264 instead of IsStatic.
3266 * anonymous.cs (AnonymousMethod.Compatible): Pass the
3267 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3268 set on the current EmitContext.
3270 * expression.cs (Cast): Overload DoResolveLValue so we can pass
3271 resolve our casted expression as an LValue. This triggers the
3272 proper LValue processing that is later required by Assign.
3276 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3278 2005-02-11 Marek Safar <marek.safar@seznam.cz>
3280 C# 2.0 Fixed buffer implementation
3282 * anonymous.cs: Update after RegisterHelperClass renaming.
3284 * attribute.cs (AttributeTester.fixed_buffer_cache):
3285 Cache of external fixed buffers.
3286 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3287 implementation if field is fixed buffer else null.
3290 (TypeContainer.AddField): Accept FieldMember instead of Field.
3291 (FieldBase.IsFieldClsCompliant): Extracted code from
3292 VerifyClsCompliance descendant customization.
3293 (FixedField): New class handles fixed buffer fields.
3294 (FixedFieldExternal): Keeps information about imported fixed
3296 (IFixedField): Make access to internal or external fixed buffer
3299 * cs-parser.jay: Add fixed buffer parsing.
3301 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3304 * expression.cs (Indirection): Extended implementation to accept
3306 (PointerArithmetic.Emit): Get element from fixed buffer as well.
3307 (ElementAccess.MakePointerAccess): Get type as parameter.
3308 (DoResolve): Add fixed buffer field expression conversion.
3309 (DoResolveLValue): Ditto.
3310 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3311 (ArrayPtr): Derives from FixedBufferPtr.
3312 (ArrayPtr.Emit): Add extra emit for array elements.
3314 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3316 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3317 for compiler generated types.
3318 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3320 * statement.cs (Fixed): Refactored to be easier add fixed buffer
3321 and consume less memory.
3322 (Fixed.Resolve): Add fixed buffer case.
3324 * typemanager.cs (compiler_generated_attr_ctor,
3325 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3326 (HasElementType): Add our own implementation to work on every
3329 2005-02-11 Miguel de Icaza <miguel@novell.com>
3331 * anonymous.cs (CaptureContext): Track whether `this' has been
3334 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
3335 only captured `this' if it was implicitly done (instance
3336 methods/variables were used).
3338 * codegen.cs (EmitContext.CaptureThis): New method to flag that
3339 `this' must be captured.
3341 2005-01-30 Miguel de Icaza <miguel@novell.com>
3343 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3344 is null it means that there has been no need to capture anything,
3345 so we just create a sibling.
3347 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3349 Just a partial fix. The other half is fairly elusive.
3351 2005-02-10 Raja R Harinath <rharinath@novell.com>
3353 Fix #52586, cs0121-4.cs.
3354 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
3355 and return a hashtable.
3356 (MemberCache.ClearDeclaredOnly): New.
3357 (MemberCache.MemberCache): Update to change. Make a deep copy of
3358 the method_hash of a base type too.
3359 (MemberCache.AddMethods): Adapt to having a deep copy of the base
3360 type methods. Overwrite entries with the same MethodHandle so
3361 that the ReflectedType is correct. The process leaves in base
3362 virtual functions and their overrides as distinct entries.
3363 (CacheEntry): Now a class instead of a struct. It shouldn't alter
3364 matters since it was boxed in a ArrayList before.
3365 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3367 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
3368 case of a virtual function and its override (choose the overload
3370 (Invocation.OverloadResolve): Avoid 'override' members during
3371 'applicable_type' calculation.
3373 2005-03-28 Raja R Harinath <rharinath@novell.com>
3375 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3376 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3377 GetTypeHandle. It is possible for a reflected type to derive from
3378 a TypeBuilder (e.g., int[] derives from the TypeBuilder
3379 System.Array during mscorlib compilation).
3380 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3381 contain a method_hash, don't create one either. Don't create a
3382 deep copy of the base cache's method_hash.
3383 (MemberCache.SetupCache): Rename back from DeepCopy.
3384 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3385 already initialized. If we see an override function, add its
3386 underlying base virtual function to the member_hash too.
3388 2005-02-09 Raja R Harinath <rharinath@novell.com>
3390 Combine two near-redundant caches.
3391 * typemanager.cs (method_params): Rename from method_internal_params.
3392 (TypeManager.GetParameterData): New. Replace
3393 Invocation.GetParameterData.
3394 (TypeManager.LookupParametersByBuilder): Remove.
3395 * expression.cs (Invocation.method_parameter_cache): Remove.
3396 (Invocation.GetParameterData): Remove.
3398 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3401 2005-02-08 Raja R Harinath <rharinath@novell.com>
3404 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3405 TypeManager.multicast_delegate_type is null, resolve it by looking
3406 up "System.MulticastDelegate".
3407 * rootcontext.cs (RootContext.ResolveCore): Simplify.
3409 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
3410 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
3411 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
3414 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3415 (LabeledStatement.AddReference): New. Set 'referenced'.
3416 (Goto.Resolve): Use it.
3418 2005-02-05 John Luke <john.luke@gmail.com>
3420 * driver.cs: remove duplicate -doc line in Usage ()
3422 2005-02-04 Raja R Harinath <rharinath@novell.com>
3424 * location.cs (Location.AddFile): Fix CS2002 error report.
3426 2005-02-02 Martin Baulig <martin@ximian.com>
3428 * delegate.cs (Delegate.DefineType): Report an internal error if
3429 TypeManager.multicast_delegate_type is null. See bug #72015 for
3432 2005-02-02 Raja R Harinath <rharinath@novell.com>
3434 Fix a crasher in a variant of #31984.
3435 * const.cs (Constant.CheckBase): New override that defers the
3436 new-or-override check in case the base type hasn't been populated
3438 (Constant.Define): Ensure the new-or-override check is performed.
3440 2005-02-01 Duncan Mak <duncan@ximian.com>
3442 * const.cs (LookupConstantValue): Check that `ce' is not null
3443 before calling GetValue ().
3445 2005-02-01 Raja R Harinath <rharinath@novell.com>
3447 Fix test-334.cs (#69519).
3448 * cs-parser.jay (using_alias_directive): Pass in an expression to
3449 NamespaceEntry.UsingAlias.
3450 (using_namespace_directive): Pass in an expression to
3451 NamespaceEntry.Using.
3452 (namespace_name): Don't flatten to a string.
3453 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3454 (NamespaceEntry.AliasEntry.Resolve): Lookup using
3456 (NamespaceEntry.UsingEntry): Likewise.
3457 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3459 (NamespaceEntry.LookupForUsing): Remove.
3460 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3462 (NamespaceEntry.Lookup): Remove support for dotted names.
3464 2005-02-01 Raja R Harinath <rharinath@novell.com>
3466 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3468 (NamespaceEntry.ImplicitParent): Compute on demand.
3469 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3470 parallels the current.
3471 (NamespaceEntry.LookupForUsing): Use it.
3472 (NamespaceEntry.Lookup): If the current namespace-entry is
3473 implicit, don't search aliases and using tables.
3475 2005-02-01 Raja R Harinath <rharinath@novell.com>
3478 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3480 (TypeContainer.BaseCache): Compute on demand.
3481 (TypeContainer.FindMembers): Define constants and types if they're
3482 not already created.
3483 (FieldMember.Define): Move resetting of ec.InUnsafe before error
3485 * const.cs (Constant.Define): Make idempotent.
3487 2005-01-29 Miguel de Icaza <miguel@novell.com>
3489 * pending.cs: Produce better code (no nops produced by using Ldarg
3492 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3493 i - 1' it should be arg + 1.
3497 2005-01-28 Raja R Harinath <rharinath@novell.com>
3499 * attribute.cs (Attribute.CheckAttributeType): Make private
3501 (Attribute.ResolveType): Make virtual.
3502 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3503 handling of RootContext.Tree.Types.
3505 2005-01-27 Raja R Harinath <rharinath@novell.com>
3507 Update attribute-handling to use the SimpleName/MemberAccess
3509 * cs-parser.jay (attribute): Pass in an expression to the
3510 constructors of Attribute and GlobalAttribute.
3511 * attribute.cs (Attribute): Take an expression for the name.
3512 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
3513 passed in attribute name expression.
3514 (Attribute.CheckAttributeType): Use it.
3515 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3516 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3517 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
3518 argument to prevent error messages if the lookup fails.
3520 2005-01-27 Marek Safar <marek.safar@seznam.cz>
3522 * expression.cs (Indirection): Implemented IVariable interface
3523 to support indirection in AddressOf operator.
3524 (PointerArithmetic.Emit): Add optimalization for case where
3525 result can be precomputed.
3527 2005-01-26 Martin Baulig <martin@ximian.com>
3529 * class.cs (TypeContainer.AttributeTargets): Return the correct
3530 AttributeTargets depending on our `Kind' instead of throwing an
3531 exception; fixes #71632.
3533 2005-01-26 Marek Safar <marek.safar@seznam.cz>
3536 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3539 2005-03-17 Martin Baulig <martin@ximian.com>
3541 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3542 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
3544 2005-03-17 Martin Baulig <martin@ximian.com>
3546 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3547 to bool so we can return an error condition.
3548 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3551 2005-03-17 Martin Baulig <martin@ximian.com>
3553 * generic.cs (TypeMananager.IsIEnumerable): New public method.
3555 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
3556 converting from an array-type of T to `IEnumerable<T>'.
3558 2005-03-16 Martin Baulig <martin@ximian.com>
3560 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
3561 (Nullable.LiftedUnaryMutator): New public class.
3563 * expression.cs (UnaryMutator.DoResolve): Added support for
3566 2005-03-14 Martin Baulig <martin@ximian.com>
3568 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
3570 2005-03-14 Martin Baulig <martin@ximian.com>
3572 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
3573 the comparision operators `<', `>', `<=' and `>='.
3575 2005-03-13 Martin Baulig <martin@ximian.com>
3578 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
3579 avoid confusion with the `NullLiteral'.
3580 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
3582 2005-03-13 Martin Baulig <martin@ximian.com>
3584 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
3585 comparing arbitrary types with the null literal.
3587 2005-03-13 Martin Baulig <martin@ximian.com>
3589 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
3590 boolean operators '&&', '||', '&' and '|'.
3591 (Nullable.OperatorTrueOrFalse): New public class.
3593 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
3594 instead of a `StaticCallExpr'; added support for nullables.
3596 2005-03-10 Martin Baulig <martin@ximian.com>
3599 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
3600 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
3602 2005-03-07 Martin Baulig <martin@ximian.com>
3604 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
3605 it work if `expr' is not an IMemoryLocation.
3606 (Nullable.Lifted): Implement IMemoryLocation.
3607 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
3610 2005-03-05 Martin Baulig <martin@ximian.com>
3612 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
3613 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
3614 (Nullable): Added support for lifted unary and binary operators.
3616 * expression.cs (Unary.DoResolve): Added support for nullable types.
3617 (Binary.DoResolve): Likewise.
3618 (Conditional.DoResolve): Likewise.
3620 2005-03-02 Martin Baulig <martin@ximian.com>
3622 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
3624 * class.cs (ClassPart.SetParameterInfo): Override this.
3625 (PartialContainer.SetParameterInfo): Override this.
3626 (TypeContainer.CheckConstraints): New protected method.
3627 (PartialContainer.CheckConstraints): Override this and check
3628 whether the same contraints were specified in all parts of a
3629 partial generic type definition.
3630 (PartialContainer.UpdateConstraints): New public method.
3632 * generic.cs (TypeParameter.UpdateConstraints): New public method.
3634 2005-03-02 Martin Baulig <martin@ximian.com>
3636 Committing a patch from Carlos Alberto Cortez to fix #72887.
3638 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
3639 casts from `T []' to `int []'.
3641 2005-03-02 Martin Baulig <martin@ximian.com>
3643 * generic.cs (TypeManager.IsEqual): Make this symmetric.
3645 * expression.cs (Binary.ResolveOperator): When resolving a
3646 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
3647 `=='. Fixes #71866. See gen-127.cs.
3649 2005-03-02 Martin Baulig <martin@ximian.com>
3651 * class.cs (TypeContainer.DoDefineMembers): We also need a default
3652 static constructor in static classes.
3654 2005-03-02 Martin Baulig <martin@ximian.com>
3657 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
3658 (Nullable.LiftedConversion): Added support for user-defined
3661 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
3663 * cs-parser.jay: Use ComposedCast everywhere instead of
3664 NullableType, so we don't need to check for NullableType
3666 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3667 case where we'll be resolved into a `parenthesized_expression_0'
3671 (Convert.UserDefinedConversion): Added nullable conversions.
3673 2005-02-28 Martin Baulig <martin@ximian.com>
3675 * generic.cs (TypeManager.IsNullableType): New static method.
3676 (Nullable): New abstract class.
3677 (Nullable.NullLiteral): New public class.
3678 (Nullable.LiftedConversion): New public class.
3680 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3681 `builtin_types opt_nullable'.
3684 (Convert.ImplicitConversionStandard): Added nullable conversions.
3685 (Convert.ExplicitConversionStandard): Likewise.
3686 (Convert.ExplicitConversion): Likewise.
3688 2005-02-26 Martin Baulig <martin@ximian.com>
3690 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3691 begin with a "?", for instance "?[]". Don't do a type lookup if
3694 2005-02-25 Martin Baulig <martin@ximian.com>
3696 The first part of Nullable Types :-)
3698 * generic.cs (NullableType): New public class.
3699 (NullCoalescingOperator): New public class.
3700 (TypeArguments.Resolve): Add a CS0306 check.
3702 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3703 (opt_nullable): New rule.
3704 (type): Added `opt_nullable' to `namespace_or_type_name',
3705 `builtin_types' and `pointer_type'.
3706 (array_type): Added `opt_nullable'.
3707 (opt_rank_specifier_or_nullable): New rule; this is the
3708 combination of `opt_rank_specifier' and `opt_nullable'.
3709 (opt_error): New rule; catch errors here.
3710 (nullable_type_or_conditional): New rule; we use this to check for
3711 nullable and still detect the conditional operator.
3712 (local_variable_type): Use `opt_rank_specifier_or_nullable'
3713 instead `opt_rank_specifier'.
3715 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3718 2005-02-24 Martin Baulig <martin@ximian.com>
3720 * README, README.Changes: Removed; they're old and obsolete.
3722 2005-02-22 Martin Baulig <martin@ximian.com>
3724 * generic.cs (TypeParameter.Resolve): If resolving the constraints
3725 returned an error, set `constraints' to null to avoid a crash
3727 (TypeParameter.ResolveType): Likewise.
3729 2005-02-22 Martin Baulig <martin@ximian.com>
3732 (Constraints.ResolveTypes): Protect against being called twice.
3733 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3734 (TypeParameter.ResolveType): New public method; calls
3735 constraints.ResolveTypes().
3736 (TypeParameter.DefineType): Moved constraints.ResolveType() out
3737 into the new ResolveType().
3738 (GenericMethod.Define): Call ResolveType() on all our
3741 2005-02-21 Martin Baulig <martin@ximian.com>
3744 (TypeManager.generic_nullable_type): New static public field.
3745 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3748 (RootContext.ResolveCore): Resolve "System.Nullable`1".
3750 2005-02-15 Martin Baulig <martin@ximian.com>
3752 * generic.cs (ConstructedType.Constraints): Correctly check
3753 constraints if the argument type is a type parameter; fixes
3756 2005-02-02 Martin Baulig <martin@ximian.com>
3758 * delegate.cs (Delegate.DefineType): Report an internal error if
3759 TypeManager.multicast_delegate_type is null. See bug #72015 for
3762 2005-01-29 Miguel de Icaza <miguel@novell.com>
3764 * pending.cs: Produce better code (no nops produced by using Ldarg
3767 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3768 i - 1' it should be arg + 1.
3772 2005-01-26 Martin Baulig <martin@ximian.com>
3774 * cs-parser.jay (indexer_declarator): Don't report an error if we
3775 have type parameters since we can be an explicit interface
3776 implementation; fixes #71449.
3778 2005-01-26 Martin Baulig <martin@ximian.com>
3780 * class.cs (TypeContainer.AttributeTargets): Return the correct
3781 AttributeTargets depending on our `Kind' instead of throwing an
3782 exception; fixes #71632.
3784 2005-01-26 Martin Baulig <martin@ximian.com>
3786 * delegate.cs (Delegate.DefineType): Correctly define our type
3787 parameters. Fixes #71483.
3789 2005-01-25 Raja R Harinath <rharinath@novell.com>
3792 * expression.cs (MemberAccess.DoResolve): Don't complain with
3793 cs0572 when the LHS of a member access has identical name and type
3796 2005-01-25 Marek Safar <marek.safar@seznam.cz>
3799 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3801 Create custom PermissionSet only for PermissionSetAttribute.
3803 2005-01-24 Marek Safar <marek.safar@seznam.cz>
3806 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3807 delegates in static class.
3809 2005-01-24 Martin Baulig <martin@ximian.com>
3811 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3812 merging an implicit block, just use its reachability.
3814 * statement.cs (Block.Resolve): Make the unreachable code check
3815 work wrt. implicit blocks; see test-337 from #63842.
3817 2005-01-21 Alp Toker <alp@atoker.com>
3819 * cs-parser.jay: destructor_declaration's container is PartialContainer
3820 not Class when partial types are used, so use Kind prop instead of
3823 2005-01-22 Miguel de Icaza <miguel@ximian.com>
3825 * cs-parser.jay: Improve error reporting when an interface
3828 2005-01-20 Dick Porter <dick@ximian.com>
3830 * support.cs: SeekableStreamReader fix from Sandor Dobos
3831 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3832 chars are read. Fixes bug 70369.
3834 2005-01-20 Raja R Harinath <rharinath@novell.com>
3836 * cs-parser.jay (catch_clause): Simplify current_block handling
3839 2005-01-17 Miguel de Icaza <miguel@ximian.com>
3841 * convert.cs (ImplicitStandardConversionExists): Synchronize the
3842 code with ImplicitStandardConversion to handle the implicit
3843 conversion of method groups into valid delegate invocations.
3845 The problem is that in parameter handling we were using this code
3846 path. Fixes bug #64698
3848 2005-01-19 Raja R Harinath <rharinath@novell.com>
3850 * cs-parser.jay: Fix several infelicities.
3851 - Avoid assigning to the parser value stack. Code like
3852 '$3 = null' is unclean. Synthesize a value for the code block
3854 - Avoid using oob_stack for storing location information. Use ...
3855 (_mark_): ... this. New (empty) rule. Saves the current location
3857 (foreach_statement): Avoid using oob_stack for current_block
3858 handling. Use technique used in for_statement and
3859 using_statement. Synthesize a value for the code block to store
3860 additional intermediate information.
3862 2005-01-13 Miguel de Icaza <miguel@ximian.com>
3864 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3865 of a different type is only allowed to private fields of a
3866 containing type, not on fields of a base class.
3868 See test-174.cs and error cs0122-9.cs
3870 2005-01-13 Raja R Harinath <rharinath@novell.com>
3872 Fix test-335.cs (bug #58126).
3873 * cs-parser.jay (argument): Split out non-expression parts of the
3874 rule into 'non_simple_argument'.
3875 (invocation_expression): Support parenthesized invocations with
3876 multiple arguments, and with single non-simple arguments.
3878 2005-01-13 Raja R Harinath <rharinath@novell.com>
3880 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3883 2005-01-12 Raja R Harinath <rharinath@novell.com>
3885 Fix cs0038-1.cs, cs1640-6.cs.
3886 * ecore.cs (Expression.Resolve): Remove special-case for
3887 SimpleName in error-handling.
3888 (Expression.almostMatchedMembers): Relax access permission to
3890 (Expression.MemberLookupFailed): Handle duplicates in
3891 almostMatchedMembers list.
3892 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3893 * expression.cs (New.DoResolve): Report CS1540 for more cases.
3894 * typemanager.cs (GetFullNameSignature): Use the MethodBase
3895 overload if the passed in MemberInfo is a MethodBase.
3897 2005-01-25 Martin Baulig <martin@ximian.com>
3900 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
3902 2005-01-12 Marek Safar <marek.safar@seznam.cz>
3905 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3906 for non-CAS & merge permission sets properly.
3908 2005-01-11 Raja R Harinath <rharinath@novell.com>
3910 Improve standard-compliance of simple name and member access
3911 resolution. Fixes bugs #52697, #57200, #67520, #69519.
3912 * ecore.cs (FullNamedExpression): New abstract base class
3913 for Namespaces and TypeExpressions.
3914 (ResolveFlags.SimpleName): Remove.
3915 (SimpleName): Remove support for dotted names.
3916 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
3917 DeclSpace.FindType and DeclSpace.LookupType.
3918 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3919 (Expression.ExprClassName): Make member function.
3920 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3921 a namespace. Remove creation of dotted "SimpleName"s.
3922 (MemberAccess.DoResolve): Likewise.
3923 * decl.cs (DeclSpace.Cache): Make private.
3924 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3925 (DeclSpace.FindType): Update.
3926 (DeclSpace.LookupType): Move here from RootContext. Return a
3927 FullNamedExpression.
3928 * namespace.cs (Namespace): Derive from FullNamedExpression
3929 so that it can be part of expression resolution.
3930 (Namespace.Lookup): Return an FullNamedExpression.
3931 (NamespaceEntry.LookupAlias): Lookup aliases only in current
3933 * rootcontext.cs (NamespaceLookup): Remove.
3934 (LookupType): Move to DeclSpace.
3935 * attribute.cs (CheckAttributeType): Update.
3936 * doc.cs (FindDocumentedType): Remove allowAlias argument.
3937 (FindDocumentedTypeNonArray): Likewise.
3939 2005-01-11 Raja R Harinath <rharinath@novell.com>
3941 Fix cs0509.cs, cs1632.cs.
3942 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3943 is the same as IsInterface.
3944 (TypeContainer.GetClassBases): Likewise.
3945 * statement.cs (LabeledStatement.ig): New field.
3946 (LabeledStatement.LabelTarget): Save ILGenerator which created the
3948 (LabeledStatement.DoEmit): Check that the label was created with
3949 the same ILGenerator.
3951 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3954 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3955 accessors to its properties.
3957 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3958 from accessors to property.
3960 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3963 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3966 2005-01-08 Miguel de Icaza <miguel@ximian.com>
3968 * attribute.cs: Check for null and empty strings.
3970 I have lost another battle to Paolo.
3972 2005-01-07 Marek Safar <marek.safar@seznam.cz>
3975 * class.cs (PropertyMethod): Set Parent field in ctors.
3976 (SetMethod.InternalParameters): Add unsafe switch hack.
3977 Override MarkForDuplicationCheck where it is appropriate.
3979 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3980 It says whether container allows members with the same name.
3982 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3983 Removed is_method parameter.
3985 2005-01-06 Duncan Mak <duncan@ximian.com>
3987 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3988 because the previous change led to incorrect reporting of CS1032
3989 ("Cannot define/undefine preprocessor symbols after first token in
3990 file"). Instead of using `tokens_seen' as the only flag that
3991 triggers CS1040, introduce `comments_seen'. This new flag is used
3992 to signify having seen comments on the current line, so it is
3993 unset after a newline.
3995 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
3997 * doc.cs : When searching for a type, find nested type too.
3998 This fixes bug #71040.
4000 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
4003 - Warn missing member comment on those classes which also does not
4004 have doc comments. Fixed bug #71041.
4005 - Don't warn missing doc comment on default constructor.
4008 2005-01-06 Duncan Mak <duncan@ximian.com>
4010 * cs-tokenizer.cs (xtoken): After handling traditional C-style
4011 comments, set `tokens_seen' to true. This allows us to detect
4012 misplaced preprocessor directives (i.e. not at the beginning of
4013 the a line, nor after whitespaces). In that case, report error
4014 CS1040. This fixes bug #56460.
4016 * cs-parser.jay (interface_member_declaration): Add checks for
4017 IsExplicitImpl, and report CS0541 error if an interface member is
4018 defined as an explicit interface declaration.
4020 2005-01-06 Marek Safar <marek.safar@seznam.cz>
4023 * class.cs (PropertyMethod): Set Parent field in ctors.
4024 (SetMethod.InternalParameters): Add unsafe switch hack.
4026 * decl.cs (MemberCore.Parent): Cannot be readonly.
4028 2005-01-06 Raja R Harinath <rharinath@novell.com>
4030 * decl.cs (DeclSpace.ResolveType): Remove.
4031 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4032 Merge in code from ...
4033 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
4034 * class.cs, enum.cs: Update to changes.
4036 2005-01-06 Miguel de Icaza <miguel@ximian.com>
4038 * anonymous.cs: Ensure that we init the scope of our parent if it
4039 has not been initialized yet.
4041 2004-12-30 Duncan Mak <duncan@ximian.com>
4043 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
4044 if field.FieldBuilder is null. Fixes #70758.
4046 * convert.cs: Fixed some typos and updated some of the comments.
4047 (ImplicitStandardConversionExists):
4048 (TryImplicitIntConversion): If `target_type' is an interface and
4049 the type of `ic' implements this interface, return true or a new
4050 BoxedCast instead of null. This fixes #70468.
4052 2004-12-29 Duncan Mak <duncan@ximian.com>
4054 * expression.cs (Argument.Emit): Check that Expr is
4055 IMemoryLocation before casting to it, and report CS1510 otherwise.
4059 2004-12-21 Ben Maurer <bmaurer@ximian.com>
4061 * statement.cs (Block.ThisVariable): remove the recursion here, to
4062 make the --profile more sane.
4064 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
4066 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4067 assembly, by JB Evain.
4069 2004-12-17 Raja R Harinath <rharinath@novell.com>
4071 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
4072 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4073 "parent" refers to enclosing type/class. "base" refers to superclass.
4075 2004-12-17 Raja R Harinath <rharinath@novell.com>
4077 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4078 Ensure that we only have GlobalAttributes.
4079 * attribute.cs (Attribute.Emit): Make non-virtual.
4080 (GlobalAttribute.Emit): Remove.
4081 (Attribute.Resolve): Make virtual.
4082 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
4083 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4084 the argument. Don't create one.
4085 (Attribute.GetObsoleteAttribute): Likewise.
4086 (Attribute.GetClsCompliantAttributeValue): Likewise.
4087 * class.cs, decl.cs: Update to changes.
4089 2004-12-17 Marek Safar <marek.safar@seznam.cz>
4091 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4093 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4095 * statement.cs (Foreach.Resolve): Add error 186 report.
4097 2004-12-16 Marek Safar <marek.safar@seznam.cz>
4099 * expression.cs (Conditional.DoResolve): Add warning 429.
4101 * statement.cs (If.Resolve): Add warning 665.
4103 2004-12-16 Raja R Harinath <rharinath@novell.com>
4105 New invariant: RootContext.Tree.Types.NamespaceEntry == null
4106 except when in the parser, and in GlobalAttribute.
4107 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4108 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4109 RootContext.Tree.Types.NamespaceEntry once work is done.
4110 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
4111 and resets RootContext.Tree.Types.NamespaceEntry.
4113 2004-12-15 Marek Safar <marek.safar@seznam.cz>
4115 * cs-parser.jay: Don't create a block for every variable.
4117 2004-12-14 Miguel de Icaza <miguel@ximian.com>
4119 * location.cs: Provide extra information.
4121 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4122 variables from the captured environment, it is the ldarg_0.
4124 2004-12-14 Marek Safar <marek.safar@seznam.cz>
4126 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4129 * class.cs: Changed warning level for 169 to avoid developer
4130 displeasure from warning flooding. It will be changed back when they
4131 fix most of current BCL warnings.
4133 * RootContext.cs: Pushed default WarningLevel to 3.
4135 * statement.cs: Removed unused variable.
4137 2004-12-14 Marek Safar <marek.safar@seznam.cz>
4139 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4140 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4141 Add error 502 report.
4142 (StaticClass.DefineType): Add error 441 report.
4143 (Class.AllowedModifiersProp): New virtual property as temporary
4144 extension to AllowedModifiers.
4145 (Class.DefineType): Add error 418 report. Moved ModFlags check here
4146 to share implementation with StaticClass and don't call virtual
4149 * driver.cs (MainDriver): Add error 1558 test.
4151 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4152 report. Moved error 36 test here.
4154 * statement.cs (Throw.Resolve): Add error 724 report.
4156 * typemanager.cs: Add out_attribute_type core type.
4158 2004-12-13 Marek Safar <marek.safar@seznam.cz>
4160 * class.cs (TypeContainer.VerifyClsCompliance): Add error
4162 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4164 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4167 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4169 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
4170 Add error 3023 report.
4171 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4173 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4176 2004-12-12 John Luke <john.luke@gmail.com>
4178 * driver.cs (AddArgs): take -- into account when
4179 adding arguments, fixes bug 65710
4181 2004-12-12 Martin Baulig <martin@ximian.com>
4183 * expression.cs (Unary.TryReduceNegative): Added support for
4184 SByteConstant and ByteConstant.
4185 (Unary.Reduce): Check error values from TryReduceNegative().
4187 2004-12-10 Marek Safar <marek.safar@seznam.cz>
4189 * attributes.cs (Attribute.Resolve): Avoid multiple error report
4190 and report exception as error 182.
4192 2004-12-10 Raja R Harinath <rharinath@novell.com>
4194 * driver.cs (Main): Fix message when there are warnings.
4196 2004-12-09 Miguel de Icaza <miguel@ximian.com>
4198 * delegate.cs: Fixed my fix from yesterday, sorry about that.
4200 2004-12-09 Marek Safar <marek.safar@seznam.cz>
4202 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
4203 Reduced number of warnings.
4205 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4207 2004-12-08 Miguel de Icaza <miguel@ximian.com>
4209 * driver.cs: Removed message.
4211 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4213 2004-12-08 <vargaz@freemail.hu>
4215 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4217 2004-12-08 Martin Baulig <martin@ximian.com>
4219 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4220 instead of a CS3002 for properties and indexer.
4222 2004-12-08 Martin Baulig <martin@ximian.com>
4224 * decl.cs (MemberName.ToString): Make this work again.
4226 2004-12-08 Marek Safar <marek.safar@seznam.cz>
4228 * attribute.cs (Resolve): Add error 591 detection.
4230 * class.cs (FieldMember.Define): Add error 1547 detection.
4231 (Indexer.Define): Add error 620 detection.
4232 (Operator.Define): Add error 590 detection.
4234 * ecore.cs: Missing argument for error 79.
4236 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4239 2004-12-07 Marek Safar <marek.safar@seznam.cz>
4242 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4245 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4247 * cs-parser.jay : handle doc comments on implicit/explicit operators.
4248 Some operator comments were suppressed.
4249 * doc.cs : Implicit/explicit operator name in doc comments are like
4250 "op_Explicit(type)~returnType", so added suffix handling.
4252 2005-01-21 Alp Toker <alp@atoker.com>
4254 * cs-parser.jay: destructor_declaration's container is PartialContainer
4255 not Class when partial types are used, so use Kind prop instead of 'is'.
4257 2004-12-12 Martin Baulig <martin@ximian.com>
4259 * expression.cs (Unary.TryReduceNegative): Added support for
4260 SByteConstant and ByteConstant.
4261 (Unary.Reduce): Check error values from TryReduceNegative().
4263 2004-12-11 Martin Baulig <martin@ximian.com>
4265 * support.cs (ReflectionParameters.ParameterName): If we have a
4266 `gpd', call `ParameterName' on it.
4268 * parameter.cs (Parameter.GetParameterAttributes): New static method.
4270 * pending.cs (PendingImplementation.DefineProxy): Call
4271 DefineParameter() for all of the MethodBuilder's arguments.
4273 2004-12-09 Martin Baulig <martin@ximian.com>
4275 * doc.cs (DocUtil): Make this a static class.
4277 2004-12-09 Martin Baulig <martin@ximian.com>
4279 * expression.cs (Invocation.InferType): Moved the type inference
4280 implementation into TypeManager.
4282 * generics.cs (TypeManager): Moved the type inference
4283 implementation here.
4285 2004-12-09 Martin Baulig <martin@ximian.com>
4287 * typemanager.cs (TypeManager): Make this a partial class.
4290 (TypeManager): Move the generics part of `TypeManager' here.
4292 2004-12-08 Martin Baulig <martin@ximian.com>
4294 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4295 instead of a CS3002 for properties and indexer. Added CS3024
4296 check for generic interfaces.
4298 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
4299 instances are not CLS-compliant.
4301 2004-12-08 Martin Baulig <martin@ximian.com>
4304 (void_pointer_expression): New rule for `void*', `void**' etc.
4305 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
4307 2004-12-08 Martin Baulig <martin@ximian.com>
4309 * expression.cs (Invocation.InferType): Removed the hack for
4310 MethodCore.MayUnify().
4312 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4315 * class.cs (MethodCore.MayUnify): Use
4316 TypeManager.MayBecomeEqualGenericTypes().
4318 2004-12-08 Martin Baulig <martin@ximian.com>
4320 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
4321 parameter, box it. Fixes #69233.
4323 2004-12-08 Martin Baulig <martin@ximian.com>
4325 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
4326 have the ctor constraint. Fixes #68326.
4328 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4330 * cs-parser.jay : interface comment was not consumed because of
4331 extra opt_semicolon before doc handling.
4333 2004-12-03 Raja R Harinath <rharinath@novell.com>
4335 Fix test-327.cs, test-328.cs, and put in early infrastructure
4336 for eventually fixing #52697.
4337 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4338 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4340 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4341 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4342 (VerifyUsing, error246): Update.
4343 * rootcontext.cs (RootContext.NamespaceLookup): Just use
4344 'NamespaceEntry.LookupNamespaceOrType'.
4346 2004-12-07 Martin Baulig <martin@ximian.com>
4348 * driver.cs: Call it "BETA SOFTWARE" :-)
4350 2004-12-06 Raja R Harinath <rharinath@novell.com>
4352 Fix crash on cs0657-17.cs.
4353 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4354 Use RootContext.Tree.Types, not 'new RootTypes ()'.
4355 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4356 the case where the NamespaceEntry gets overwritten.
4358 2004-12-06 Marek Safar <marek.safar@seznam.cz>
4360 Fixed #69195, #56821
4361 * ecore.cs (ResolveBoolean): Tiny refactoring.
4363 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4364 of right expression resolving when left is false constant and
4365 operator is LogicalAnd OR true constant and operator is LogicalOr.
4367 * statement.cs (ResolveUnreachable): Always reports warning.
4369 2004-12-05 Miguel de Icaza <miguel@ximian.com>
4371 * class.cs: Distinguish between 1721 and 1722 (just a little help
4372 for the programmer).
4374 2004-12-03 Miguel de Icaza <miguel@ximian.com>
4376 * delegate.cs: Only allow this on new versions of the language.
4378 2004-12-02 Duncan Mak <duncan@ximian.com>
4380 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4382 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4383 here as a static method. Take an additional bool out parameter
4384 `must_do_cs1540_check' for signaling to InstanceResolve.
4385 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4386 member field from PropertyExpr class and made it an argument of
4388 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4389 check for MarshalByRefObject, and report CS0122 instead of CS1540.
4390 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4391 and `remove_accessor' as well as InstanceResolve: report CS0122
4396 2004-12-07 Martin Baulig <martin@ximian.com>
4398 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
4399 and CS0692 where appropriate.
4401 2004-12-06 Martin Baulig <martin@ximian.com>
4403 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
4404 IsDuplicateImplementation() and improved it.
4406 * expression.cs (Invocation.InferTypeArguments): Added
4407 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
4408 and removed the "ref" modifier from `infered_types'.
4410 * decl.cs (MemberName.ToString): Removed the exception.
4412 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
4414 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4415 comments are allowed.
4417 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4419 * delegate.cs: Add checks for subtypes in paramaters and return values
4420 in VerifyMethod () to add support for Covariance/Contravariance
4423 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4425 * report.cs: Remove extra closing parenthesis.
4427 * convert.cs (Error_CannotImplicitConversion): If the name of the
4428 types are the same, provide some extra information.
4430 2004-12-02 Marek Safar <marek.safar@seznam.cz>
4433 * attribute.cs (Resolve): Improved implementation of params
4434 attribute arguments.
4436 * support.cs (ParameterData): Add HasParams to be faster.
4438 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
4440 all things are for /doc support:
4442 * doc.cs: new file that supports XML documentation generation.
4443 * mcs.exe.sources: added doc.cs.
4445 Handle /doc command line option.
4446 Report error 2006 instead of 5 for missing file name for /doc.
4447 Generate XML documentation when required, after type resolution.
4449 Added support for picking up documentation (/// and /** ... */),
4450 including a new XmlCommentState enumeration.
4452 Added lines to fill Documentation element for field, constant,
4453 property, indexer, method, constructor, destructor, operator, event
4454 and class, struct, interface, delegate, enum.
4455 Added lines to warn incorrect comment.
4457 Added Documentation field (passed only when /doc was specified).
4459 Added DocComment, DocCommentHeader, GenerateDocComment() and
4460 OnGenerateDocComment() and some supporting private members for
4461 /doc feature to MemberCore.
4463 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4465 Added overriden DocCommentHeader.
4467 Added overriden DocCommentHeader and GenerateDocComment().
4469 2004-12-01 Miguel de Icaza <miguel@ximian.com>
4471 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4472 unwrapping the enumeration values, chain to
4473 DoConstantNumericPromotions again, so we can promote things to the
4474 fundamental types (takes care of enums that are bytes, sbytes).
4478 2004-12-01 Raja R Harinath <rharinath@novell.com>
4480 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4481 Fix long-standing bug in type-lookup. Use FindType instead of
4482 LookupType when ec.ResolvingTypeTree.
4483 (Attribute.ResolveType, Attribute.Resolve)
4484 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4486 (Attributes.Search): Remove internal version. Update.
4487 (Attributes.SearchMulti): Update.
4488 (Attributes.GetClsCompliantAttribute): Remove.
4489 (Attributes.GetIndexerNameAttribute): Remove.
4490 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4491 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4492 * class.cs (Indexer.Define): Likewise.
4494 2004-12-01 Marek Safar <marek.safar@seznam.cz>
4497 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4498 MarshallByReference members access.
4500 * expression.cs: Use CheckMarshallByRefAccess;
4501 Better error CS0197 message.
4503 * report.cs: Print whole related error message.
4505 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4507 * class (GetClassBases): Better error 60 report.
4508 (EventProperty): Disabled warning 67 detection.
4510 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4513 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4515 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4518 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4521 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4523 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4525 2004-11-26 Miguel de Icaza <miguel@ximian.com>
4527 * attribute.cs (Attribute.Resolve): Refine error reporting and
4528 report a cs0117 if the identifier does not exist, to distinguish
4529 from 0617 which is a miss-use of the actual identifier.
4531 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4532 between cs0070 and cs0079.
4534 * class.cs (MemberBase.DoDefine): When reporting a wrong
4535 accessibility level, we use MethodCore to compare instead of
4536 Method (this was a regression in some refactoring effort).
4538 So now we correctly report cs0056 again.
4540 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4541 testing the target_type (which was known to be object_type) and
4542 not the source type (which is anonymous_method).
4544 Fixed reporting of error cs1660.
4546 * expression.cs (UserCast.Source): Expose the underlying cast.
4548 * statement.cs (Switch.SwitchGoverningType): Sort the list of
4549 allowed types to find a match to int32 first (most common).
4551 In addition, it ignores any ImplicitUserConversions that did an
4552 internal implicit conversion (as the switch statement allows only
4553 one integral conversion to exist).
4555 * class.cs (PartialContainer.Create): rename `name' to
4556 `member_name' for clarity. Then replace the string calls with a
4557 call to MemberName.GetPartialName, as now using
4558 MemberName.ToString is an error (this is due to the side effects
4559 it had, that were fixed in the past).
4561 This will restore the error reporting on a number of partial class
4562 errors that were missusing this (and getting an exception as a
4563 results, which is now just a plain textual warning, because
4564 yyparse debug output would crash otherwise).
4566 2004-11-26 Raja R Harinath <rharinath@novell.com>
4568 * Makefile (PROGRAM_INSTALL_DIR): Remove.
4570 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4572 * rootcontext.cs (LookupType): Make sure to cache lookups that
4573 don't give us a negative result. This saves about 5% of corlib
4576 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4578 * report.cs (AbstractMessage.Print): messages are sent to stderr
4580 * class.cs (TypeContainer.GetClassBases): It is an error to have a
4581 non-interface in the list of interfaces (at this point, either
4582 parent was properly set, or a base class is being listed in the
4583 interfaces section).
4585 This flags error 1722, and resolves the crash from bug 69259.
4587 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4589 * statement.cs (Using.EmitExpressionFinally): make this work right
4590 for valuetypes. Fixes 69926.
4592 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4594 * const.cs (Const.ChangeType): Cope with the "0 literal can be
4595 converted to an enum" here, before we try to change the underlying
4596 type. This code exists, but it is a different code path than the
4597 one used while encoding constants.
4599 (ImplicitReferenceConversionExists): In addition, resynchronized
4600 the code here, so it matches the same code in
4601 ImplicitReferenceConversionExists for the `from any class-type S
4602 to any interface-type T'.
4604 2004-11-25 Marek Safar <marek.safar@seznam.cz>
4606 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4608 2004-11-24 Miguel de Icaza <miguel@ximian.com>
4610 * cs-parser.jay: Use verbosity accordingly.
4612 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4614 * expression.cs (Unary.ResolveOperator): Do not report warning;
4615 AddressOf reads from variable.
4617 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4619 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4623 * attribute.cs (Attributable): Removed CheckTargets.
4624 (Attributes.Emit): Explicit attribute targets are tested here.
4626 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4627 not enabled for interfaces.
4629 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4630 (GetAssemblyName): Ouch next bug there.
4632 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4634 * expression.cs: Error 275 added.
4636 2004-11-23 Marek Safar <marek.safar@seznam.cz>
4638 Fix bug #69177 (Implemented decimal constant support)
4640 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4641 (BinaryFold): Add DecimalConstant.
4643 * const.cs (Define): Decimal constant
4645 (ChangeType): Add decimal type handling.
4646 (LookupConstantValue): Don't set value for decimal type but
4647 emit DecimalConstantAttribute. Needed for constant optimization.
4649 * constant.cs (ToDecimal): New method.
4650 (ConvertToDecimal): New method.
4651 (IntConstant): Implemented ConvertToDecimal.
4652 (DecimalConstant.Emit): Emit optimized version for decimals in
4655 * expression.cs (ResolveOperator): Changed order of constant
4656 reduction to work correctly with native types which have
4657 overloaded operators.
4658 (ResolveMemberAccess): Extract constant value from attribute
4661 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4663 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4664 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4665 (ChangeType): Decimal is special.
4666 (TypeToCoreType): Add decimal type.
4668 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4670 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4673 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4675 * class.cs (EventField.ApplyAttributeBuilder): Fix error
4678 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4680 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4682 * pending.cs (PendingImplementation): Grab only interfaces.
4684 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4686 * statement.cs (ForeachHelperMethods): Add location member and
4687 error 202 detection.
4689 2004-11-18 Marek Safar <marek.safar@seznam.cz>
4691 * expression.cs (DoResolveBase): Fixed wrong warning for out
4694 2004-12-04 Martin Baulig <martin@ximian.com>
4696 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4697 to check whether the conversion is ok.
4699 * typemanager.cs (TypeManager.GetTypeArguments): Just return
4700 `Type.EmptyTypes' if we're not a generic TypeContainer.
4702 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4704 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4705 old bug: when converting from the null literal to a pointer,
4706 return an EmptyCast, not the NullLiteral.
4708 This fixes #69921, the recent null_type changes probably made this
4711 2004-12-03 Martin Baulig <martin@ximian.com>
4713 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4714 method as our child, call AnonymousMethod.Compatible() on it.
4716 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4718 * class.cs (FieldBase): Use an unused bit field from the field to
4719 encode the `has_offset' property from the FieldMember. This saves
4720 a couple of Ks on bootstrap compilation.
4722 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4723 method as our child, return the AnonymousMethod resolved
4726 * expression.cs (New.DoResolve): Allow return values from
4727 NewDelegate to also include AnonymousMethods.
4731 2004-11-29 Raja R Harinath <rharinath@novell.com>
4733 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4735 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4736 System.Runtime.InteropServices._Exception, since it's a base
4737 interface of the core type System.Exception in the net_2_0 profile.
4739 2004-11-27 Martin Baulig <martin@ximian.com>
4741 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4743 2004-11-26 Raja R Harinath <rharinath@novell.com>
4745 * Makefile: Convert to use executable.make.
4746 * gmcs.exe.sources: New.
4748 2004-11-25 Martin Baulig <martin@ximian.com>
4750 * expression.cs (Invocation.InferType): Added support for byref types.
4752 2004-11-25 Martin Baulig <martin@ximian.com>
4754 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4755 in TypeManager.TypeToCoreType().
4757 2004-11-25 Martin Baulig <martin@ximian.com>
4759 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4760 "Dispose" method from the `current_type'.
4761 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4762 DoDefineMembers() instead of using the MethodBuilder; this is
4763 required for generic iterators.
4765 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4767 2004-11-24 Martin Baulig <martin@ximian.com>
4769 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4771 2004-11-20 Martin Baulig <martin@ximian.com>
4773 * expression.cs (Invocation.InferType): Correctly infer generic
4774 instances; see gen-103.cs.
4775 (Invocation.InferTypeArguments): If a generic method doesn't have
4776 any unbound type parameters, we don't need to infer anything.
4778 2004-11-19 Raja R Harinath <rharinath@novell.com>
4780 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4782 2004-11-17 Raja R Harinath <rharinath@novell.com>
4784 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4785 (TypeHandle.GetMemberCache): New.
4786 (TypeHandle.TypeHandle): Update.
4787 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4788 (TypeManager.LookupParentInterfacesCache):
4789 Rename from LookupInterfaceCache. Optimize slightly.
4790 (TypeManager.MemberLookup_FindMembers): Update.
4791 * decl.cs (MemberCache.MemberCache): Set Container to null in the
4793 (AddCacheContents): Rename from AddHashtable.
4794 * class.cs (TypeContainer.parent_container): Remove.
4795 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4796 (TypeContainer.DoDefineMembers): Don't initialize it.
4797 Update to name changes.
4799 2004-11-17 Miguel de Icaza <miguel@ximian.com>
4801 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4802 that factors the code to check access modifiers on override.
4804 (PropertyBase): Use the code here.
4806 Patch from Lluis S'anchez, fixes bug #69361.
4808 2004-11-15 Miguel de Icaza <miguel@ximian.com>
4810 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4811 routine that is used to report the use of a captured variable
4812 whose address has been taken.
4814 There are two checks: one when variables are being captured and
4815 the other check is when the address of a variable is taken.
4817 (because an anonymous methods might be resolved before *or* after
4818 the address has been taken) and
4820 * expression.cs (Conditional.DoResolve): Remove the special
4821 casing that Martin added to trueExpr and falseExpr being both
4822 NullLiteral. We get the right behavior now just by introducing
4823 the null_type into the compiler.
4825 * convert.cs (ExplicitConversion): Change the code to use
4826 null_type instead of testing `expr is NullLiteral'.
4827 (ImplicitConversionStandard): use null_type too.
4828 (ImplicitReferenceConversionExists): use null_type too.
4829 (ImplicitReferenceConversion): use null_type too.
4831 * literal.cs: The type of `NullLiteral' is now null_type instead
4833 (Resolve): Set the type here.
4835 * typemanager.cs: Introduce null_type.
4837 2004-11-18 Martin Baulig <martin@ximian.com>
4840 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
4842 2004-11-18 Martin Baulig <martin@ximian.com>
4844 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
4846 2004-11-18 Martin Baulig <martin@ximian.com>
4848 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
4849 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
4850 call ResolveConstructedType() on it to resolve it without checking
4852 (Constraints.ResolveTypes): Check them here.
4853 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
4854 but don't check constraints.
4855 (ConstructedType.ResolveAsTypeTerminal): Override this and also
4856 check constraints here.
4857 (ConstructedType.ResolveConstructedType): New public method. This
4858 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
4859 resolve ourselves without checking constraints.
4861 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
4863 2004-11-18 Martin Baulig <martin@ximian.com>
4866 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
4868 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
4870 2004-11-18 Martin Baulig <martin@ximian.com>
4872 * ecore.cs (TypeExpr.ResolveType): Removed.
4873 (Expression.ResolveAsTypeTerminal): We always return a fully
4874 resolved `TypeExpr', so we can just access its `Type'.
4876 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
4878 2004-11-17 Martin Baulig <martin@ximian.com>
4880 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
4881 sure we don't return any unresolved TypeExpr's.
4882 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
4884 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
4886 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
4887 unresolved `ConstructedType's.
4889 2004-11-17 Martin Baulig <martin@ximian.com>
4891 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
4893 2004-11-17 Martin Baulig <martin@ximian.com>
4896 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
4898 * decl.cs (DeclSpace.ResolveType): Removed.
4899 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
4901 2004-11-17 Martin Baulig <martin@ximian.com>
4903 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4904 direction, like FindMembers() does. Fixes #69546, testcase is in
4907 2004-11-16 Martin Baulig <martin@ximian.com>
4909 This is based on a patch from Marek Safar, see bug #69082.
4910 Fixes bugs #63705 and #67130.
4912 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4913 method; create a MemberCache for an interface type and cache the
4916 * decl.cs (IMemberContainer.ParentContainer): Removed.
4917 (IMemberContainer.ParentCache): New property.
4918 (MemberCache.SetupCacheForInterface): Removed.
4919 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4920 to create a cache for an interface's "parent".
4922 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4925 2004-11-14 Ben Maurer <bmaurer@ximian.com>
4927 * statement.cs: Avoid adding bools to a hashtable.
4929 2004-11-15 Martin Baulig <martin@ximian.com>
4931 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
4933 2004-11-11 Martin Baulig <martin@ximian.com>
4935 * typemanager.cs (TypeManager.GetMethodName): New method.
4937 * class.cs (MethodData.Define): Include the generic arity in the
4938 name of an explicit interface; also add it to the method name.
4940 * pending.cs (PendingImplementation.InterfaceMethod): The method
4941 name now includes the generic arity.
4943 2004-11-07 Miguel de Icaza <miguel@ximian.com>
4945 * expression.cs (Invocation.OverloadResolve): Flag error if we are
4946 calling an unsafe method from a safe location.
4948 2004-11-06 Marek Safar <marek.safar@seznam.cz>
4951 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4953 2004-11-06 Miguel de Icaza <miguel@ximian.com>
4955 * namespace.cs (VerifyUsing): use GetPartialName instead of
4958 2004-11-05 Miguel de Icaza <miguel@ximian.com>
4960 * statement.cs (Return.Resolve): Fix regression in typo: if
4961 `in_exc', we have to request a NeedReturnLabel, this was a typo
4962 introduced in the anonymous method check-in. Fixes #69131.
4964 * Indexers were using the ShortName when defining themselves,
4965 causing a regression in the compiler bootstrap when applying the
4966 patch from 2004-11-02 (first part), now they use their full name
4967 and the bug is gone.
4969 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
4971 * driver.cs: Strip the path from the names of embedded resources. Fixes
4974 2004-11-04 Raja R Harinath <rharinath@novell.com>
4976 Fix error message regression: cs0104-2.cs.
4977 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4978 (AliasEntry.Resolve): Update.
4979 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
4981 (RootContext.LookupType): Update.
4983 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
4985 * cs-parser.jay: Add support for handling accessor modifiers
4986 * class: Add support port accessor modifiers and error checking,
4987 define PropertyMethod.Define as virtual (not abstract anymore)
4988 * ecore.cs: Add checking for proeprties access with access modifiers
4989 * iterators.cs: Modify Accessor constructor call based in the modified
4991 2004-11-02 Ben Maurer <bmaurer@ximian.com>
4993 * expression.cs (StringConcat): Handle being called twice,
4994 as when we have a concat in a field init with more than two
4997 2004-11-02 Miguel de Icaza <miguel@ximian.com>
4999 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5000 special case explicit implementations, we should always produce
5001 the .property or .event declaration.
5003 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5004 since it will not return correct data if people use this
5005 unresolved in the presence of using statements (see test-313).
5007 * class.cs (MethodData.Define): If we are an explicit interface
5008 implementation, set the method name to the full name of the
5009 interface plus the name of the method.
5011 Notice that using the method.MethodName.GetFullName() does not
5012 work, as it will only contain the name as declared on the source
5013 file (it can be a shorthand in the presence of using statements)
5014 and not the fully qualifed type name, for example:
5018 class D : ICloneable {
5019 object ICloneable.Clone () {
5023 Would produce a method called `ICloneable.Clone' instead of
5024 `System.ICloneable.Clone'.
5026 * namespace.cs (Alias.Resolve): Use GetPartialName.
5028 2004-11-01 Marek Safar <marek.safar@seznam.cz>
5030 * cs-parser.jay: Add error 1055 report.
5032 2004-11-01 Miguel de Icaza <miguel@ximian.com>
5034 * assign.cs (Assign.DoResolve): Only do the transform of
5035 assignment into a New if the types are compatible, if not, fall
5036 through and let the implicit code deal with the errors and with
5037 the necessary conversions.
5039 2004-11-01 Marek Safar <marek.safar@seznam.cz>
5041 * cs-parser.jay: Add error 1031 report.
5043 * cs-tokenizer.cs: Add location for error 1038.
5045 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5047 * cs-parser.jay: Add error 1016 report.
5049 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5051 * cs-parser.jay: Add errors 1575,1611 report.
5053 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5055 * cs-parser.jay: Add error 1001 report.
5057 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5060 * attribute.cs (GetMarshal): Add method argument for
5061 caller identification.
5063 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5064 agument for GetMarshal and RuntimeMissingSupport.
5066 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5068 * attribute.cs (ExtractSecurityPermissionSet): Removed
5069 TypeManager.code_access_permission_type.
5071 * typemanager.cs: Removed TypeManager.code_access_permission_type.
5073 2004-10-27 Miguel de Icaza <miguel@ximian.com>
5075 * expression.cs (LocalVariableReference.DoResolveLValue): Check
5076 for obsolete use of a variable here. Fixes regression on errors
5077 cs0619-25 and cs0619-26.
5079 2004-10-27 Marek Safar <marek.safar@seznam.cz>
5081 Fix #62358, implemented security attribute encoding.
5083 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5084 Tests permitted SecurityAction for assembly or other types.
5085 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5086 data from SecurityPermissionAttribute to PermisionSet class.
5088 * class.cs (ApplyAttributeBuilder): Added special handling
5089 for System.Security.Permissions.SecurityAttribute based types.
5091 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5092 special handling for System.Security.Permissions.SecurityAttribute
5095 * enum.cs (ApplyAttributeBuilder): Added special handling
5096 for System.Security.Permissions.SecurityAttribute based types.
5098 * parameter.cs (ApplyAttributeBuilder): Added special handling
5099 for System.Security.Permissions.SecurityAttribute based types.
5101 * rootcontext.cs: Next 2 core types.
5103 * typemanager.cs (TypeManager.security_permission_attr_type):
5104 Built in type for the SecurityPermission Attribute.
5105 (code_access_permission_type): Build in type.
5107 2004-10-17 Miguel de Icaza <miguel@ximian.com>
5109 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5110 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5111 all of this information into
5112 EmitContext.EmitCapturedVariableInstance.
5114 * codegen.cs (EmitCapturedVariableInstance): move here the
5115 funcionality of emitting an ldarg.0 in the presence of a
5116 remapping. This centralizes the instance emit code.
5118 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5119 then emit a load of this: it means that we have reached the
5120 topmost ScopeInfo: the one that contains the pointer to the
5121 instance of the class hosting the anonymous method.
5123 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5124 captures to the topmost CaptureContext.
5126 2004-10-12 Miguel de Icaza <miguel@ximian.com>
5128 * expression.cs (LocalVariableReference): Move the knowledge about
5129 the iterators into codegen's EmitCapturedVariableInstance.
5131 2004-10-11 Miguel de Icaza <miguel@ximian.com>
5133 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5134 all code paths return a value from an anonymous method (it is the
5135 same as the 161 error, but for anonymous methods).
5137 2004-10-08 Miguel de Icaza <miguel@ximian.com>
5139 The introduction of anonymous methods in the compiler changed
5140 various ways of doing things in the compiler. The most
5141 significant one is the hard split between the resolution phase
5142 and the emission phases of the compiler.
5144 For instance, routines that referenced local variables no
5145 longer can safely create temporary variables during the
5146 resolution phase: they must do so from the emission phase,
5147 since the variable might have been "captured", hence access to
5148 it can not be done with the local-variable operations from the runtime.
5152 (Block.Flags): New flag `IsTopLevel' to indicate that this block
5153 is a toplevel block.
5155 (ToplevelBlock): A new kind of Block, these are the blocks that
5156 are created by the parser for all toplevel method bodies. These
5157 include methods, accessors and anonymous methods.
5159 These contain some extra information not found in regular blocks:
5160 A pointer to an optional CaptureContext (for tracking captured
5161 local variables and parameters). A pointer to the parent
5164 (Return.Resolve): Catch missmatches when returning a value from an
5165 anonymous method (error 1662).
5166 Invoke NeedReturnLabel from the Resolve phase instead of the emit
5169 (Break.Resolve): ditto.
5171 (SwitchLabel): instead of defining the labels during the
5172 resolution phase, we now turned the public ILLabel and ILLabelCode
5173 labels into methods called GetILLabelCode() and GetILLabel() that
5174 only define the label during the Emit phase.
5176 (GotoCase): Track the SwitchLabel instead of the computed label
5177 (its contained therein). Emit the code by using
5178 SwitchLabel.GetILLabelCode ().
5180 (LocalInfo.Flags.Captured): A new flag has been introduce to track
5181 whether the Local has been captured or not.
5183 (LocalInfo.IsCaptured): New property, used to tell whether the
5184 local has been captured.
5186 * anonymous.cs: Vastly updated to contain the anonymous method
5189 The main classes here are: CaptureContext which tracks any
5190 captured information for a toplevel block and ScopeInfo used to
5191 track the activation frames for various local variables.
5193 Each toplevel block has an optional capture context associated
5194 with it. When a method contains an anonymous method both the
5195 toplevel method and the anonymous method will create a capture
5196 context. When variables or parameters are captured, they are
5197 recorded on the CaptureContext that owns them, for example:
5201 MyDelegate d = delegate {
5206 Here `a' will be recorded as captured on the toplevel
5207 CapturedContext, the inner captured context will not have anything
5208 (it will only have data if local variables or parameters from it
5209 are captured in a nested anonymous method.
5211 The ScopeInfo is used to track the activation frames for local
5212 variables, for example:
5214 for (int i = 0; i < 10; i++)
5215 for (int j = 0; j < 10; j++){
5216 MyDelegate d = delegate {
5221 At runtime this captures a single captured variable `i', but it
5222 captures 10 different versions of the variable `j'. The variable
5223 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5224 recorded on a child.
5226 The toplevel ScopeInfo will also track information like the `this'
5227 pointer if instance variables were referenced (this is necessary
5228 as the anonymous method lives inside a nested class in the host
5229 type of the method).
5231 (AnonymousMethod): Expanded to track the Toplevel, implement
5232 `AnonymousMethod.Compatible' to tell whether an anonymous method
5233 can be converted to a target delegate type.
5235 The routine now also produces the anonymous method content
5237 (AnonymousDelegate): A helper class that derives from
5238 DelegateCreation, this is used to generate the code necessary to
5239 produce the delegate for the anonymous method that was created.
5241 * assign.cs: API adjustments for new changes in
5242 Convert.ImplicitStandardConversionExists.
5244 * class.cs: Adjustments to cope with the fact that now toplevel
5245 blocks are of type `ToplevelBlock'.
5247 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5248 insteda of standard blocks.
5250 Flag errors if params arguments are passed to anonymous methods.
5252 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5253 `CurrentAnonymousMethod' which points to the current Anonymous
5254 Method. The variable points to the AnonymousMethod class that
5255 holds the code being compiled. It is set in the new EmitContext
5256 created for the anonymous method.
5258 (EmitContext.Phase): Introduce a variable and an enumeration to
5259 assist in enforcing some rules about when and where we are allowed
5260 to invoke certain methods (EmitContext.NeedsReturnLabel is the
5261 only one that enfonces this right now).
5263 (EmitContext.HaveCaptureInfo): new helper method that returns
5264 whether we have a CapturedContext initialized.
5266 (EmitContext.CaptureVariable): New method used to register that a
5267 LocalInfo must be flagged for capturing.
5269 (EmitContext.CapturedParameter): New method used to register that a
5270 parameters must be flagged for capturing.
5272 (EmitContext.CapturedField): New method used to register that a
5273 field must be flagged for capturing.
5275 (EmitContext.HaveCapturedVariables,
5276 EmitContext.HaveCapturedFields): Return whether there are captured
5277 variables or fields.
5279 (EmitContext.EmitMethodHostInstance): This is used to emit the
5280 instance for the anonymous method. The instance might be null
5281 (static methods), this (for anonymous methods that capture nothing
5282 and happen to live side-by-side with the current method body) or a
5283 more complicated expression if the method has a CaptureContext.
5285 (EmitContext.EmitTopBlock): Routine that drives the emission of
5286 code: it will first resolve the top block, then emit any metadata
5287 and then emit the code. The split is done so that we can extract
5288 any anonymous methods and flag any captured variables/parameters.
5290 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5291 during this phase, the ILGenerator should not be used as labels
5292 and local variables declared here might not be accessible to any
5293 code that is part of an anonymous method.
5295 Exceptions to this include the temporary variables that are
5296 created by some statements internally for holding temporary
5299 (EmitContext.EmitMeta): New routine, in charge of emitting all the
5302 (EmitContext.TemporaryReturn): This method is typically called
5303 from the Emit phase, and its the only place where we allow the
5304 ReturnLabel to be defined other than the EmitMeta. The reason is
5305 that otherwise we would have to duplicate a lot of logic in the
5306 Resolve phases of various methods that today is on the Emit
5309 (EmitContext.NeedReturnLabel): This no longer creates the label,
5310 as the ILGenerator is not valid during the resolve phase.
5312 (EmitContext.EmitThis): Extended the knowledge in this class to
5313 work in anonymous methods in addition to iterators.
5315 (EmitContext.EmitCapturedVariableInstance): This emits whatever
5316 code is necessary on the stack to access the instance to a local
5317 variable (the variable will be accessed as a field).
5319 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5320 EmitContext.EmitAddressOfParameter): Routines to support
5321 parameters (not completed at this point).
5323 Removals: Removed RemapLocal and RemapLocalLValue. We probably
5324 will also remove the parameters.
5326 * convert.cs (Convert): Define a `ConstantEC' which points to a
5327 null. This is just to prefity some code that uses
5328 ImplicitStandardConversion code and do not have an EmitContext
5331 The idea is to flag explicitly that at that point in time, it is
5332 known that the conversion will not trigger the delegate checking
5333 code in implicit conversions (which requires a valid
5336 Everywhere: pass new EmitContext parameter since
5337 ImplicitStandardConversionExists now requires it to check for
5338 anonymous method conversions.
5340 (Convert.ImplicitStandardConversionExists): If the type of an
5341 expression is the anonymous_method_type, and the type is a
5342 delegate, we invoke the AnonymousMethod.Compatible method to check
5343 whether an implicit conversion is possible.
5345 (Convert.ImplicitConversionStandard): Only do implicit method
5346 group conversions if the language level is not ISO_1.
5348 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5349 MethodInfo for the Invoke method. used by Delegate and
5352 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5353 method conversions if the target type is a delegate.
5355 Removed extra debugging nops.
5357 (LocalVariableReference): Turn the `local_info' into a public
5360 Add `prepared' field, the same hack used for FieldExprs to cope
5361 with composed assignments, as Local variables do not necessarily
5362 operate purely on the stack as they used to: they can be captured
5365 Add `temp' for a temporary result, like fields.
5367 Refactor DoResolve and DoResolveLValue into DoResolveBase.
5369 It now copes with Local variables that are captured and emits the
5370 proper instance variable to load it from a field in the captured
5373 (ParameterReference.DoResolveBase): During the resolve phase,
5374 capture parameters if we are in an anonymous method.
5376 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5377 anonymous method, use the EmitContext helper routines to emit the
5378 parameter reference.
5380 * iterators.cs: Set RemapToProxy to true/false during the
5383 * parameters.cs (GetParameterByName): New helper method.
5385 * typemanager.cs (anonymous_method_type) a new type that
5386 represents an anonyous method. This is always an internal type,
5387 used as a fencepost to test against the anonymous-methodness of an
5390 2004-10-20 Marek Safar <marek.safar@seznam.cz>
5392 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5394 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5396 2004-11-10 Martin Baulig <martin@ximian.com>
5398 * expression.cs (Invocation.BetterFunction): If two methods have
5399 equal parameter types, but only one of them is generic, the
5400 non-generic one wins.
5401 (New.DoResolve): Don't set `is_struct' to false if we're a generic
5402 instance; just use `Type.IsValueType' to determine whether
5403 something is a struct or not.
5404 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
5405 so we can be called multiple times.
5407 2004-11-10 Martin Baulig <martin@ximian.com>
5409 * generic.cs (TypeParameter.DefineConstraints): New public method.
5410 (TypeParameter.CheckAccessLevel): Override this and return true.
5411 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
5412 override ResolveType() anymore.
5413 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
5415 2004-11-10 Martin Baulig <martin@ximian.com>
5417 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
5418 call DeclSpace.ResolveNestedType() on it.
5420 2004-11-10 Martin Baulig <martin@ximian.com>
5422 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
5423 non-null, call ParameterModifier() on it.
5425 2004-11-10 Martin Baulig <martin@ximian.com>
5428 (Iterators): Added `current_type' and `this_type' fields.
5429 (Iterators.DefineIterator): Create a new EmitContext and store it
5430 in `ec'; compute `this_type'.
5432 2004-11-10 Martin Baulig <martin@ximian.com>
5435 (TypeManager.IsPrivateAccessible): New public method.
5436 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
5438 2004-11-10 Martin Baulig <martin@ximian.com>
5440 * class.cs (TypeContainer.DefineType): Call
5441 TypeBuilder.DefineGenericParameters() before resolving the type
5443 (MethodData.parent_method): New protected field.
5444 (MethodData..ctor): Added `MethodInfo parent_method' argument.
5445 (MethodData.Define): Compute `parent_method'.
5448 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5449 (MemberCore.GetClsCompliantAttributeValue): Likewise.
5450 (DeclSpace.ec): New protected field; store the EmitContext here.
5451 (DeclSpace.EmitContext): New public property.
5452 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
5453 (DeclSpace.ResolveNestedType): New public method.
5454 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
5455 (DeclSpace.NestedAccessible): Added `Type tb' argument.
5456 (DeclSpace.FamilyAccessible): Likewise.
5457 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
5458 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5461 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
5464 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5465 (Enum.Emit): Don't create a new EmitContext.
5467 2004-10-18 Martin Baulig <martin@ximian.com>
5469 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5470 `Type' directly, but call ResolveType() on it.
5471 (Catch.Resolve): Likewise.
5472 (Foreach.Resolve): Likewise.
5474 2004-10-18 Martin Baulig <martin@ximian.com>
5476 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5477 `Type' directly, but call ResolveType() on it.
5478 (Probe.DoResolve): Likewise.
5479 (ArrayCreation.LookupType): Likewise.
5480 (TypeOf.DoResolve): Likewise.
5481 (SizeOf.DoResolve): Likewise.
5483 2004-10-18 Raja R Harinath <rharinath@novell.com>
5485 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5488 2004-10-17 John Luke <john.luke@gmail.com>
5490 * class.cs (Operator.GetSignatureForError): use CSharpName
5492 * parameter.cs (Parameter.GetSignatureForError): Returns
5493 correct name even if was not defined.
5495 2004-10-13 Raja R Harinath <rharinath@novell.com>
5498 * class.cs (TypeContainer.EmitContext): New property.
5499 (DefineNestedTypes): Create an emitcontext for each part.
5500 (MethodCore.DoDefineParameters): Use container's emitcontext.
5501 Pass type array to InternalParameters.
5502 (MemberBase.DoDefine): Use container's emitcontext.
5503 (FieldMember.Define): Likewise.
5504 (Event.Define): Likewise.
5505 (SetMethod.GetParameterInfo): Change argument to EmitContext.
5506 Pass type array to InternalParameters.
5507 (SetIndexerMethod.GetParameterInfo): Likewise.
5508 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5509 * delegate.cs (Define): Pass emitcontext to
5510 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
5511 array to InternalParameters.
5512 * expression.cs (ParameterReference.DoResolveBase): Pass
5513 emitcontext to GetParameterInfo.
5514 (ComposedCast.DoResolveAsTypeStep): Remove check on
5515 ec.ResolvingTypeTree.
5516 * parameter.cs (Parameter.Resolve): Change argument to
5517 EmitContext. Use ResolveAsTypeTerminal.
5518 (Parameter.GetSignature): Change argument to EmitContext.
5519 (Parameters.ComputeSignature): Likewise.
5520 (Parameters.ComputeParameterTypes): Likewise.
5521 (Parameters.GetParameterInfo): Likewise.
5522 (Parameters.ComputeAndDefineParameterTypes): Likewise.
5523 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
5524 * support.cs (InternalParameters..ctor): Remove variant that takes
5526 * typemanager.cs (system_intptr_expr): New.
5527 (InitExpressionTypes): Initialize it.
5529 2004-10-12 Chris Toshok <toshok@ximian.com>
5531 * cs-parser.jay: fix location for try_statement and catch_clause.
5533 2004-10-18 Martin Baulig <martin@ximian.com>
5535 * class.cs (FieldMember.Define): Don't access the TypeExpr's
5536 `Type' directly, but call ResolveType() on it.
5537 (MemberBase.DoDefine): Likewise.
5539 * expression.cs (New.DoResolve): Don't access the TypeExpr's
5540 `Type' directly, but call ResolveType() on it.
5541 (ComposedCast.DoResolveAsTypeStep): Likewise.
5543 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5544 `Type' directly, but call ResolveType() on it.
5546 2004-10-17 John Luke <john.luke@gmail.com>
5548 * class.cs (Operator.GetSignatureForError): use CSharpName
5550 * parameter.cs (Parameter.GetSignatureForError): Returns
5551 correct name even if was not defined.
5553 2004-10-13 Raja R Harinath <rharinath@novell.com>
5556 * class.cs (TypeContainer.EmitContext): New property.
5557 (DefineNestedTypes): Create an emitcontext for each part.
5558 (MethodCore.DoDefineParameters): Use container's emitcontext.
5559 Pass type array to InternalParameters.
5560 (MemberBase.DoDefine): Use container's emitcontext.
5561 (FieldMember.Define): Likewise.
5562 (Event.Define): Likewise.
5563 (SetMethod.GetParameterInfo): Change argument to EmitContext.
5564 Pass type array to InternalParameters.
5565 (SetIndexerMethod.GetParameterInfo): Likewise.
5566 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5567 * delegate.cs (Define): Pass emitcontext to
5568 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
5569 array to InternalParameters.
5570 * expression.cs (ParameterReference.DoResolveBase): Pass
5571 emitcontext to GetParameterInfo.
5572 (ComposedCast.DoResolveAsTypeStep): Remove check on
5573 ec.ResolvingTypeTree.
5574 * parameter.cs (Parameter.Resolve): Change argument to
5575 EmitContext. Use ResolveAsTypeTerminal.
5576 (Parameter.GetSignature): Change argument to EmitContext.
5577 (Parameters.ComputeSignature): Likewise.
5578 (Parameters.ComputeParameterTypes): Likewise.
5579 (Parameters.GetParameterInfo): Likewise.
5580 (Parameters.ComputeAndDefineParameterTypes): Likewise.
5581 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
5582 * support.cs (InternalParameters..ctor): Remove variant that takes
5584 * typemanager.cs (system_intptr_expr): New.
5585 (InitExpressionTypes): Initialize it.
5587 2004-10-12 Chris Toshok <toshok@ximian.com>
5589 * cs-parser.jay: fix location for try_statement and catch_clause.
5591 2004-10-07 Raja R Harinath <rharinath@novell.com>
5593 More DeclSpace.ResolveType avoidance.
5594 * decl.cs (MemberCore.InUnsafe): New property.
5595 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
5596 with newly created EmitContext.
5597 (FieldMember.Define): Likewise.
5598 * delegate.cs (Delegate.Define): Likewise.
5599 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5600 only if normal name-lookup fails.
5601 (TypeExpr.DoResolve): Enable error-checking.
5602 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5603 (SizeOf.DoResolve): Likewise.
5604 (ComposedCast.DoResolveAsTypeStep): Likewise.
5605 (StackAlloc.DoResolve): Likewise.
5606 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5607 (Block.Unsafe): New property.
5608 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5609 (Unsafe): Set 'unsafe' flag of contained block.
5610 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5611 (Fixed.Resolve): Likewise.
5612 (Catch.Resolve): Likewise.
5613 (Using.ResolveLocalVariableDecls): Likewise.
5614 (Foreach.Resolve): Likewise.
5616 2004-10-05 John Luke <john.luke@gmail.com>
5618 * cs-parser.jay: add location to error CS0175
5620 2004-10-04 Miguel de Icaza <miguel@ximian.com>
5622 * ecore.cs (Expression.Constantity): Add support for turning null
5625 * const.cs (Const.Define): Allow constants to be reference types
5626 as long as the value is Null.
5628 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
5630 * namespace.cs (NamespaceEntry.Using): No matter which warning
5631 level is set, check if this namespace name has already been added.
5633 2004-10-03 Ben Maurer <bmaurer@ximian.com>
5635 * expression.cs: reftype [!=]= null should always use br[true,false].
5638 2004-10-03 Marek Safar <marek.safar@seznam.cz>
5641 * attribute.cs: Enum conversion moved to
5642 GetAttributeArgumentExpression to be applied to the all
5645 2004-10-01 Raja R Harinath <rharinath@novell.com>
5647 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5648 * class.c (TypeContainer.DefineType): Flag error if
5649 base types aren't accessible due to access permissions.
5650 * decl.cs (DeclSpace.ResolveType): Move logic to
5651 Expression.ResolveAsTypeTerminal.
5652 (DeclSpace.ResolveTypeExpr): Thin layer over
5653 Expression.ResolveAsTypeTerminal.
5654 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5655 Refactor code into NestedAccess. Use it.
5656 (DeclSpace.NestedAccess): New.
5657 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5658 argument to silence errors. Check access permissions.
5659 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5660 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5661 (Cast.DoResolve): Likewise.
5662 (New.DoResolve): Likewise.
5663 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5664 (TypeOf.DoResolve): Likewise.
5666 * expression.cs (Invocation.BetterConversion): Return the Type of
5667 the better conversion. Implement section 14.4.2.3 more faithfully.
5668 (Invocation.BetterFunction): Make boolean. Make correspondence to
5669 section 14.4.2.2 explicit.
5670 (Invocation.OverloadResolve): Update.
5671 (Invocation): Remove is_base field.
5672 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
5673 (Invocation.Emit): Likewise.
5675 2004-09-24 Marek Safar <marek.safar@seznam.cz>
5677 * cs-parser.jay: Reverted 642 warning fix.
5679 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5682 * decl.cs (FindMemberWithSameName): Indexer can have more than
5685 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5687 * expression.cs (LocalVariableReference.DoResolveLValue):
5688 Do not report warning 219 for out values.
5689 (EmptyExpression.Null): New member to avoid extra allocations.
5691 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5693 * cs-parser.jay: Fix wrong warning 642 report.
5695 * cs-tokenizer.cs (CheckNextToken): New helper;
5696 Inspect next character if is same as expected.
5698 2004-09-23 Martin Baulig <martin@ximian.com>
5700 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5701 (Convert.ImplicitReferenceConversionExists): Likewise.
5703 2004-11-09 Raja R Harinath <rharinath@novell.com>
5705 * Makefile (DISTFILES): Comment out a few missing files.
5707 2004-10-29 Raja R Harinath <rharinath@novell.com>
5709 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5710 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
5711 (gmcs.exe): Invoke bootstrap-libs.
5712 (clean-local): Clean the net_2_0_bootstrap profile too.
5713 (PROGRAM_INSTALL_DIR): New.
5714 (install-local): Use it.
5716 2004-10-13 Martin Baulig <martin@ximian.com>
5718 * generic.cs (TypeManager.InflatedConstraints): New nested class.
5719 (TypeParameter.DefineType): If we're a method type parameter and
5720 that method is overriding something, "inflate" its constraints.
5722 2004-10-12 Martin Baulig <martin@ximian.com>
5724 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5725 and have type arguments, create and resolve a ConstructedType.
5727 2004-10-12 Martin Baulig <martin@ximian.com>
5729 * decl.cs (MemberCache.FindMemberToOverride): Use
5730 TypeManager.IsEqual() to compare the parameters and Type.Equals()
5731 to compare the invocationType.
5733 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5734 When comparing two type parameters, only do the signature-only
5735 comparision for method type parameters.
5737 2004-10-11 Martin Baulig <martin@ximian.com>
5739 * report.cs: Don't make --fatal abort on warnings, we have
5740 -warnaserror for that.
5742 2004-10-11 Martin Baulig <martin@ximian.com>
5745 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5746 (TypeManager.IsEqual): Call ourself recursively instead of using
5749 2004-10-11 Martin Baulig <martin@ximian.com>
5751 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5752 on our own type parameters, not on the ones we inherit from a containing
5755 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5758 * generic.cs (TypeParameter.Define): We may only be called once.
5760 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5761 instead of TypeManager.IsEqual().
5763 2004-09-28 Martin Baulig <martin@ximian.com>
5766 (GenericConstraints.EffectiveBaseClass): New public property.
5767 (TypeParameter.GenericConstraints): New public property.
5768 (ConstructedType.CheckConstraints): Improved.
5770 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5771 (Convert.TypeParameterConversion): New private method; use this in
5772 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5773 for all conversions related to type parameters.
5775 2004-09-24 Martin Baulig <martin@ximian.com>
5777 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5778 type parameter conversions for type parameters which are known to
5781 2004-09-24 Martin Baulig <martin@ximian.com>
5783 * generic.cs (GenericConstraints): Added `IsReferenceType' and
5784 `IsValueType' properties.
5786 * support.cs (ReflectionConstraints): Use
5787 Type.GetGenericParameterConstraints() instead of the old hack.
5789 2004-09-24 Martin Baulig <martin@ximian.com>
5791 * generic.cs (GenericConstraints): Moved here and made it an
5794 * support.cs (GenericConstraints): Moved to generic.cs.
5796 2004-09-24 Martin Baulig <martin@ximian.com>
5799 (ReflectionConstraints): Un-nested this class and made it public.
5802 (TypeManager.GetTypeParameterConstraints): New public method.
5803 (TypeManager.HasConstructorConstraint): Use the attributes.
5805 2004-09-24 Martin Baulig <martin@ximian.com>
5807 * support.cs (GenericConstraints): Replaced `HasConstructor',
5808 `IsReferenceType' and `IsValueType' with `Attributes'.
5809 (ReflectionParameters.ReflectionConstraints): Removed the Create()
5810 method and made the .ctor public.
5812 * generic.cs (Constraints.Attributes): New public property.
5813 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5814 `IsReferenceType' -> `HasReferenceTypeConstraint' and
5815 `IsValueType' -> `HasValueTypeConstraint'.
5817 2004-09-23 Martin Baulig <martin@ximian.com>
5819 * generic.cs (Constraints): Reflect latest runtime changes.
5821 2004-09-23 Martin Baulig <martin@ximian.com>
5823 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5824 (Convert.ImplicitReferenceConversionExists): Likewise.
5826 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5828 * class.cs (Operator.Define): Add error 448 and 559 report.
5830 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5832 * class.cs (MemberBase.IsTypePermitted): New protected
5833 method for checking error CS0610.
5835 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5837 * class.cs (TypeContainer.HasExplicitLayout): New property
5838 Returns whether container has StructLayout attribute set Explicit.
5839 (FieldMember): New abstract class for consts and fields.
5840 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5841 (Field): Reuse FieldMember.
5843 * const.cs (Const): Reuse FieldMember.
5845 * rootcontext.cs: EmitConstants call moved to class.
5847 2004-09-22 Martin Baulig <martin@ximian.com>
5849 Marek and me just fixed one of our oldest bugs: #28562 :-)
5851 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5853 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5854 we're an EnumConstant, just return that.
5855 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5856 an EnumConstant. In this case, we need to use GetValueAsEnumType()
5857 to get the value which'll actually be written into the attribute.
5858 However, we have to use GetValue() to access the attribute's value
5861 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5863 * constant.cs (Constant.IsNegative): New abstract property
5866 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5867 (StackAlloc.DoResolve): Reused IsNegative.
5869 2004-09-22 Martin Baulig <martin@ximian.com>
5871 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
5872 public method; like LookupTypeContainer, but also works for
5875 * report.cs (Report.SymbolRelatedToPreviousError): Use
5876 TypeManager.LookupGenericTypeContainer().
5878 2004-09-22 Martin Baulig <martin@ximian.com>
5880 Thanks to Peter Sestoft for this bug report.
5882 * expression.cs (Conditional): If both the `trueExpr' and the
5883 `falseExpr' is a NullLiteral, return a NullLiteral.
5885 2004-09-22 Martin Baulig <martin@ximian.com>
5887 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5888 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5889 for the "get_Current" call.
5891 2004-09-21 Martin Baulig <martin@ximian.com>
5893 * convert.cs (Convert.ImplicitReferenceConversion): When
5894 converting to an interface type, first check whether we're
5895 converting from a reference type.
5897 2004-09-14 Martin Baulig <martin@ximian.com>
5899 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5901 2004-09-14 Marek Safar <marek.safar@seznam.cz>
5904 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5905 called and is obsolete then this member suppress message
5906 when call is inside next [Obsolete] method or type.
5908 * expression.cs: Use TestObsoleteMethodUsage member.
5910 2004-09-14 Martin Baulig <martin@ximian.com>
5912 * genericparser.cs: Removed.
5914 2004-09-13 Marek Safar <marek.safar@seznam.cz>
5916 * class.cs (MethodCore.CheckBase): Fix bug #65757.
5918 2004-09-12 Marek Safar <marek.safar@seznam.cz>
5920 * attribute.cs (Attribute.Resolve): Add error 653 report.
5922 * class.cs (Class.ApplyAttributeBuilder): Add error 641
5924 (Method.ApplyAttributeBuilder): Add error 685 report.
5925 (Operator.Define): Add error 564 report.
5927 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5929 * expression.cs (Invocation.DoResolve): Add error
5932 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5935 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5937 * class.cs (ConstructorInitializer.Resolve):
5938 Wrong error number (515->516).
5940 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5942 * class.cs (Indexer.Define): Add error 631 report.
5944 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5946 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5948 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5950 * expression.cs (Probe.DoResolve): Add error CS0241 report.
5952 2004-09-10 Marek Safar <marek.safar@seznam.cz>
5954 * cs-parser.jay: Added error CS0241 report.
5956 2004-09-10 Raja R Harinath <rharinath@novell.com>
5958 * cs-parser.jay (fixed_statement): Introduce a scope for the
5959 declaration in the 'fixed' statement.
5961 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5963 * cs-parser.jay: Added CS0230 error report.
5965 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5967 * cs-parser.jay: Added errors CS0231 and CS0257 report.
5969 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5971 * expression.cs (Argument.Resolve): Added error CS0192 and
5974 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5976 C# 2.0 #pragma warning feature
5978 * cs-tokenizer.cs (PreProcessPragma): New method;
5979 Handles #pragma directive.
5981 * report.cs (WarningRegions): New class; Support
5982 class for #pragma warning directive. It tests whether
5983 warning is enabled for a given line.
5985 2004-09-08 Miguel de Icaza <miguel@ximian.com>
5987 * const.cs: Add more descriptive error report, tahnks to
5990 2004-09-08 Marek Safar <marek.safar@seznam.cz>
5992 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5994 2004-09-07 Miguel de Icaza <miguel@ximian.com>
5996 * expression.cs: Apply patch from Ben: Remove dead code from
5997 ArrayCreation, and remove the TurnintoConstant call in const.cs,
5998 as that code just threw an exception anwyays.
6000 * const.cs: Remove the call to the turnintoconstant, for details
6003 * literal.cs: The type of the null-literal is the null type; So
6004 we use a placeholder type (literal.cs:System.Null, defined here)
6007 * expression.cs (Conditional.DoResolve): Remove some old code that
6008 is no longer needed, conversions have been fixed.
6010 (ArrayCreationExpression.DoResolve): Return false if we fail to
6011 resolve the inner expression.
6013 2004-09-07 Raja R Harinath <rharinath@novell.com>
6016 * cs-parser.jay (delegate_declaration): Record a delegate
6017 declaration as a type declaration.
6018 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
6020 2004-09-06 Miguel de Icaza <miguel@ximian.com>
6022 * parameter.cs: Do not crash if the type can not be resolved.
6024 * expression.cs: Report errors with unsafe pointers, fixes #64896
6026 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
6028 * expression.cs: Pointer arith always needs to do a conv.i
6029 if the operand is a long. fix 65320
6031 2004-09-04 Marek Safar <marek.safar@seznam.cz>
6033 Fixed cs0619-37.cs, cs0619-38.cs
6035 * enum.cs (GetObsoleteAttribute): Removed.
6037 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
6038 on Enum member is double staged. The first is tested member
6041 2004-09-04 Marek Safar <marek.safar@seznam.cz>
6043 Fixed #56986, #63631, #65231
6045 * class.cs: (TypeContainer.AddToMemberContainer): New method,
6046 adds member to name container.
6047 (TypeContainer.AddToTypeContainer): New method, adds type to
6049 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6050 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6051 AddOperator): Simplified by reusing AddToMemberContainer.
6052 (TypeContainer.UserDefinedStaticConstructor): Changed to property
6054 (Method.CheckForDuplications): Fixed implementation to test all
6056 (MemberBase): Detection whether member is explicit interface
6057 implementation is now in constructor.
6058 (MemberBase.UpdateMemberName): Handles IndexerName.
6059 (Accessor): Changed to keep also location information.
6060 (AbstractPropertyEventMethod): Is derived from MemberCore.
6061 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6062 will be emited or not.
6063 (PropertyBase.AreAccessorsDuplicateImplementation):
6064 Tests whether accessors are not in collision with some method.
6065 (Operator): Is derived from MethodCore to simplify common
6068 * decl.cs (Flags.TestMethodDuplication): Test for duplication
6070 (DeclSpace.AddToContainer): Adds the member to defined_names
6071 table. It tests for duplications and enclosing name conflicts.
6073 * enum.cs (EnumMember): Clean up to reuse the base structures
6075 2004-09-03 Martin Baulig <martin@ximian.com>
6077 Merged latest changes into gmcs. Please keep this comment in
6078 here, it makes it easier for me to see what changed in MCS since
6079 the last time I merged.
6081 2004-09-03 Martin Baulig <martin@ximian.com>
6083 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6084 into TypeContainer, to make partial classes work again.
6086 2004-09-03 Martin Baulig <martin@ximian.com>
6088 * rootcontext.cs (RootContext.V2): Removed.
6090 2004-03-23 Martin Baulig <martin@ximian.com>
6092 * expression.cs (Invocation.OverloadResolve): Added `bool
6093 may_fail' argument and use it instead of the Location.IsNull() hack.
6095 2004-09-09 Martin Baulig <martin@ximian.com>
6097 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
6099 2004-09-09 Martin Baulig <martin@ximian.com>
6101 * generic.cs (TypeParameter.DefineType): Added support for
6102 explicit interface methods.
6104 2004-09-09 Martin Baulig <martin@ximian.com>
6106 * README.Changes: New document. Started to list important changes
6107 between MCS and GMCS here.
6109 2004-09-08 Martin Baulig <martin@ximian.com>
6112 (TypeContainer.CheckRecursiveDefinition): New protected method.
6113 (TypeContainer.DefineType): Move the CS0146 check into
6114 CheckRecursiveDefinition().
6116 2004-09-06 Martin Baulig <martin@ximian.com>
6118 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
6119 types for the constructor constraint.
6121 2004-09-03 Martin Baulig <martin@ximian.com>
6123 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6124 into TypeContainer, to make partial classes work again.
6126 2004-09-03 Martin Baulig <martin@ximian.com>
6128 * rootcontext.cs (RootContext.V2): Removed.
6130 2004-03-23 Martin Baulig <martin@ximian.com>
6132 * expression.cs (Invocation.OverloadResolve): Added `bool
6133 may_fail' argument and use it instead of the Location.IsNull() hack.
6135 2004-09-03 Martin Baulig <martin@ximian.com>
6137 Merged latest changes into gmcs. Please keep this comment in
6138 here, it makes it easier for me to see what changed in MCS since
6139 the last time I merged.
6141 2004-09-03 Raja R Harinath <rharinath@novell.com>
6144 * expression.cs (BetterConversion): Don't allow either conversion
6145 to be null. Remove redundant implicit conversion test when 'q ==
6146 null' -- when this function is invoked, we already know that the
6147 implicit conversion exists.
6148 (BetterFunction): Assume that 'best' is non-null. Remove
6149 redundant reimplementation of IsApplicable when 'best' is null.
6150 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6151 number of arguments.
6152 (IsAncestralType): Extract from OverloadResolve.
6153 (OverloadResolve): Make robust to the MethodGroupExpr being
6154 unsorted. Implement all the logic of Section 14.5.5.1, and
6155 support overloading of methods from multiple applicable types.
6156 Clean up logic somewhat. Don't pass null methods to BetterFunction.
6158 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6159 (RealError, Warning): Append type of report to related symbol.
6161 2004-09-03 Marek Safar <marek.safar@seznam.cz>
6163 * enum.cs: Fixed CLS-Compliance checks for enum members.
6164 Error tests cs3008-8.cs, cs3014-8.cs
6166 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6168 Fixed bug #62342, #63102
6169 * class.cs: ImplementIndexer uses member.IsExplicitImpl
6170 like ImplementMethod.
6172 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6174 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6177 2004-09-02 Martin Baulig <martin@ximian.com>
6179 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6180 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6183 2004-09-01 Marek Safar <marek.safar@seznam.cz>
6185 C# 2.0 Static classes implemented
6187 * class.cs (TypeContainer): instance_constructors,
6188 initialized_fields, initialized_static_fields,
6189 default_constructor, base_inteface_types are protected to be
6190 accessible from StaticClass.
6191 (TypeContainer.DefineDefaultConstructor): New virtual method
6192 for custom default constructor generating
6193 (StaticClass): New class to handle "Static classes" feature.
6195 * cs-parser.jay: Handle static keyword on class like instance
6198 * driver.cs: Added "/langversion" command line switch with two
6199 options (iso-1, default).
6201 2004-08-31 Marek Safar <marek.safar@seznam.cz>
6203 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6205 2004-08-31 Miguel de Icaza <miguel@ximian.com>
6207 * delegate.cs: Style.
6209 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
6211 * delegate.cs: Add seperate instance expr field for miguel.
6213 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6215 * PointerArithmetic (Resolve): make sure we are not doing
6216 pointer arith on void*. Also, make sure we are resolved
6217 by not setting eclass until resolve.
6219 All callers: Make sure that PointerArithmetic gets resolved.
6221 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6223 * ArrayCreation (LookupType): If the type does not resolve
6224 to an array, give an error.
6226 2004-08-27 Marek Safar <marek.safar@seznam.cz>
6228 * statement.cs (Try.Resolve): Fixed bug #64222
6230 2004-08-27 Martin Baulig <martin@ximian.com>
6233 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6236 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6238 * ecore.cs (Constantify): Get underlying type via
6239 System.Enum.GetUnderlyingType to avoid StackOverflow on the
6240 Windows in special cases.
6242 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6244 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6245 for obtaining also private methods.
6246 (GetRemoveMethod): Used GetRemoveMethod (true)
6247 for obtaining also private methods.
6249 2004-09-02 Martin Baulig <martin@ximian.com>
6251 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6252 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6255 2004-08-27 Martin Baulig <martin@ximian.com>
6258 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6261 2004-08-25 Martin Baulig <martin@ximian.com>
6263 * support.cs (ReflectionParameters..ctor): If this is a generic
6264 method, retrieve and store its type parameters.
6265 (InternalParameters..ctor): Added `TypeParameter[]' argument.
6266 (ReflectionParameters.GenericConstraints): The argument specifies
6267 the type parameter, not the method parameter.
6268 (InternalParameters.GenericConstraints): Likewise.
6270 * generic.cs (TypeParameter.DefineType): Correctly handle
6271 constraints wrt. generic methods in interfaces and their
6274 2004-08-24 Martin Baulig <martin@ximian.com>
6276 * generic.cs (TypeParameter.IsSubclassOf): New public method.
6277 (Constraints.IsSubclassOf): New internal method.
6279 * typemanager.cs (TypeManager.FindMembers): Added special support
6280 for GenericTypeParameterBuilder's.
6281 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
6284 2004-08-24 Martin Baulig <martin@ximian.com>
6287 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6288 this for accessibility checks.
6289 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6290 IsNestedFamilyAccessible.
6291 (TypeManager.IsSubclassOf): New method, do what the name actually
6294 2004-08-24 Martin Baulig <martin@ximian.com>
6296 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
6297 as a SimpleName, include the generic arity.
6299 2004-08-24 Martin Baulig <martin@ximian.com>
6301 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6302 MethodAttributes.HideBySig for operators.
6304 2004-08-23 Martin Baulig <martin@ximian.com>
6306 Back to the old error reporting system :-)
6308 * report.cs (Message): Removed.
6309 (Report.MessageData, ErrorData, WarningData): Removed.
6310 (Report.Error, Warning): Back to the old system.
6312 2004-08-23 Martin Baulig <martin@ximian.com>
6314 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6316 * class.cs (TypeContainer.ParentContainer): New public virtual
6317 method; replaces the explicit interface implementation.
6318 (ClassPart.ParentContainer): Override.
6320 2004-08-23 Martin Baulig <martin@ximian.com>
6322 * statement.cs (Switch): Added support for constant switches; see
6323 #59428 or test-285.cs.
6325 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6328 * statement.cs (GetEnumeratorFilter): Removed useless
6329 logic because C# specs is strict. GetEnumerator must be
6332 2004-08-22 Martin Baulig <martin@ximian.com>
6334 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6335 a switch and may break, reset the barrier. Fixes #59867.
6337 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6339 CLS-Compliance speed up (~5% for corlib)
6341 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6342 New method. Tests container for CLS-Compliant names
6344 * class.cs (TypeContainer.VerifyClsName): New method.
6345 Checks whether container name is CLS Compliant.
6346 (Constructor): Implements IMethodData.
6348 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6349 low-case table for CLS Compliance test.
6350 (MemberCache.VerifyClsParameterConflict): New method.
6351 Checks method parameters for CS3006 error.
6353 * enum.cs (EnumMember): Is derived from MemberCore.
6354 (Enum.VerifyClsName): Optimized for better performance.
6356 2004-08-06 Marek Safar <marek.safar@seznam.cz>
6358 * report.cs: Renamed Error_T to Error and changed all
6361 2004-08-06 Marek Safar <marek.safar@seznam.cz>
6363 * class.cs (TypeContainer.IndexerArrayList): New inner class
6364 container for indexers.
6365 (TypeContainer.DefaultIndexerName): New constant for default
6366 indexer name. Replaced all "Item" with this constant.
6367 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6369 * typemanager.cs (TypeManager.default_member_ctor): Cache here
6370 DefaultMemberAttribute constructor.
6372 2004-08-05 Martin Baulig <martin@ximian.com>
6374 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6377 2004-08-05 Marek Safar <marek.safar@seznam.cz>
6379 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6380 multi platforms problem.
6382 * compiler.csproj: Included shared files.
6384 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6386 Fix bug 60333, 55971 in the more general way
6387 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6388 Added arg_type argument for constant conversion.
6389 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6391 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6394 * class.cs (TypeContainer ): New inner classes MethodArrayList,
6395 OperatorArrayList, MethodCoreArrayList for typecontainer
6396 containers. Changed class member types to these new types.
6397 (MethodArrayList.DefineMembers): Added test for CS0659.
6399 2004-08-04 Miguel de Icaza <miguel@ximian.com>
6401 * cfold.cs: Synchronize the folding with the code in expression.cs
6402 Binary.DoNumericPromotions for uint operands.
6404 * attribute.cs: Revert patch from Raja, it introduced a regression
6405 while building Blam-1.2.1 (hard to isolate a test case).
6407 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6411 (TypeContainer.Define): Renamed to DefineContainerMembers because of
6413 (MethodCore.parent_method): New member. The method we're overriding
6414 if this is an override method.
6415 (MethodCore.CheckBase): Moved from Method class and made common.
6416 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6418 (MethodCore.CheckForDuplications): New abstract method. For custom
6419 member duplication search in a container
6420 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6421 method and its return type.
6422 (Event.conflict_symbol): New member. Symbol with same name in the
6426 (MemberCache.FindMemberWithSameName): New method. The method
6427 is looking for conflict with inherited symbols.
6429 2004-08-04 Martin Baulig <martin@ximian.com>
6431 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6433 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6435 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6437 * report.cs (Message): New enum for better error, warning reference in
6439 (MessageData): New inner abstract class. It generally handles printing of
6440 error and warning messages.
6441 Removed unused Error, Warning, Message methods.
6443 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6445 Fix for cs0592-8.cs test
6447 (Attributable.ValidAttributeTargets): Made public.
6448 (Attribute.ExplicitTarget): New member for explicit target value.
6449 (Attribute.CheckTargets): Now we translate explicit attribute
6450 target to Target here.
6452 2004-08-03 Ben Maurer <bmaurer@ximian.com>
6454 * ecore.cs (MethodGroupExpr): new IsBase property.
6456 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6458 * delegate.cs (DelegateCreation): store a MethodGroupExpr
6459 rather than an instance expr.
6461 (DelegateCreation.Emit): Use the method group rather than
6462 the instance expression. Also, if you have base.Foo as the
6463 method for a delegate, make sure to emit ldftn, not ldftnvirt.
6465 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
6467 (NewDelegate.DoResolve): Only check for the existance of Invoke
6468 if the method is going to be needed. Use MethodGroupExpr.
6470 (NewDelegate.Emit): Remove, DelegateCreation implements this.
6472 * expression.cs: For pointer arith., make sure to use
6473 the size of the type, not the size of the pointer to
6476 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6479 * class.cs (Class): Added error CS0502 test.
6481 2004-08-03 John Luke <jluke@cfl.rr.com>
6482 Raja R Harinath <rharinath@novell.com>
6485 * attribute.cs (Attribute.complained_before): New flag.
6486 (Attribute.ResolveType, Attribute.Resolve),
6487 (Attribute.DefinePInvokeMethod): Set it.
6488 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6490 2004-08-03 Martin Baulig <martin@ximian.com>
6492 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6493 use a user-defined operator; we still need to do numeric
6494 promotions in case one argument is a builtin type and the other
6495 one has an implicit conversion to that type. Fixes #62322.
6497 2004-08-18 Martin Baulig <martin@ximian.com>
6499 * class.cs (Method.Define): Use the correct method name when
6500 creating the MethodBuilder for a generic method.
6502 2004-08-17 Martin Baulig <martin@ximian.com>
6504 * generic.cs (Constraints): Support type parameter constraints.
6506 2004-08-16 Martin Baulig <martin@ximian.com>
6508 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
6509 (Token.GENERIC_DIMENSION): New token; this is returned if we
6510 encounter an unbound generic type in a typeof() expression.
6512 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
6513 this token is only generated while parsing a typeof() expression.
6514 (typeof_expression): Removed the old unbound_type hack.
6516 * generic.cs (TypeArguments.IsUnbound): New public property.
6518 * decl.cs (MemberName): Added support for unbound types.
6520 2004-08-14 Martin Baulig <martin@ximian.com>
6523 (TypeManager.IsEqualGenericInstance): New static method.
6524 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
6525 just used to check accessibility, so follow the rules of 26.1.6.
6527 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
6528 ConstructedType instead of a TypeExpression if we have type arguments.
6530 * cs-parser.jay (typeof_expression): Support unbound generic types.
6532 * ecore.cs (UnboundTypeExpression): New public class.
6534 2004-08-12 Martin Baulig <martin@ximian.com>
6536 * typemanager.cs (TypeManager.IsNestedChildOf): Use
6537 TypeManager.IsEqual() rather than `=='.
6539 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
6540 generic instances as well.
6542 2004-08-12 Martin Baulig <martin@ximian.com>
6544 * expression.cs (Invocation.InferType): We can only infer method
6545 type parameters. Fixes #62647.
6547 2004-08-11 Martin Baulig <martin@ximian.com>
6549 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
6550 before resolving the base classes.
6552 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6554 * Makefile: install .mdb file too.
6556 2004-08-05 Martin Baulig <martin@ximian.com>
6558 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
6559 initializer, the current type is just the TypeBuilder, not the
6560 instantiated generic type.
6561 (FieldExpr.IsFieldInitializer): New public property.
6563 2004-08-04 Martin Baulig <martin@ximian.com>
6565 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6567 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6569 2004-08-03 Martin Baulig <martin@ximian.com>
6571 * class.cs (MethodData.Define): If we're an explicit
6572 implementation, remove the generic arity from the type name.
6574 2004-08-03 Martin Baulig <martin@ximian.com>
6576 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6577 use a user-defined operator; we still need to do numeric
6578 promotions in case one argument is a builtin type and the other
6579 one has an implicit conversion to that type. Fixes #62322.
6581 2004-08-02 Martin Baulig <martin@ximian.com>
6583 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
6585 (TypeContainer.GetClassBases): Return the unexpanded list of
6586 interfaces; we expand them later.
6587 (TypeContainer.DefineType): After creating the TypeBuilder, call
6588 TypeManager.ExpandInterfaces() to get an expanded and resolved
6591 * ecore.cs (TypeExpr.GetInterfaces): Removed
6593 * generics.cs (Constraints.InterfaceConstraints): Remove.
6594 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
6595 register the interface constraints.
6598 (TypeManager.AddUserType): Removed the `ifaces' argument.
6599 (TypeManager.AddTypeParameter): Likewise.
6600 (TypeManager.AddUserInterface): Removed, was unused.
6601 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
6602 `TypeExpr[]' array for the interfaces.
6603 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
6604 has been defined, returns a list of the resolved interfaces types.
6605 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
6606 (TypeManager.GetExplicitInterfaces): Likewise.
6608 2004-08-02 Martin Baulig <martin@ximian.com>
6610 * expression.cs (Invocation.EmitCall): If we're invoking a method
6611 on a type parameter, use the new `Constrained' prefix opcode.
6613 2004-08-02 Martin Baulig <martin@ximian.com>
6615 * statement.cs (LocalInfo.Flags): Added `IsThis'.
6616 (LocalInfo.IsThis): New public property.
6617 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6619 2004-08-01 Martin Baulig <martin@ximian.com>
6621 * class.cs (TypeContainer.GetClassBases): Don't set the default
6622 here since we may get called from GetPartialBases().
6623 (TypeContainer.DefineType): If GetClassBases() didn't return a
6624 parent, use the default one.
6626 2004-07-30 Martin Baulig <martin@ximian.com>
6628 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6630 * class.cs (SourceMethod): New public class, derive from the
6631 symbol writer's ISourceMethod.
6632 (Method): Use the new symbol writer API.
6634 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6635 as argument and use the new symbol writer.
6638 (SourceFile): Implement the symbol writer's ISourceFile.
6639 (Location.SymbolDocument): Removed.
6640 (Location.SourceFile): New public property.
6642 * symbolwriter.cs: Use the new symbol writer API.
6644 2004-07-30 Raja R Harinath <rharinath@novell.com>
6646 * Makefile (install-local): Remove. Functionality moved to
6649 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
6651 * Makefile: Install mcs.exe.config file together with mcs.exe.
6652 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6653 correct runtime version.
6655 2004-07-25 Martin Baulig <martin@ximian.com>
6658 (TypeContainer.RegisterOrder): Removed, this was unused.
6659 (TypeContainer, interface_order): Removed.
6660 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6661 TypeContainer as argument since we can also be called with a
6662 `PartialContainer' for a partial class/struct/interface.
6663 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6664 of checking whether we're an `Interface' - we could be a
6666 (PartialContainer.Register): Override; call
6667 AddClass()/AddStruct()/AddInterface() on our parent.
6669 * cs-parser.jay (interface_member_declaration): Add things to the
6670 `current_container', not the `current_class'.
6672 * rootcontext.cs (RegisterOrder): The overloaded version which
6673 takes an `Interface' was unused, removed.
6675 * typemanager.cs (TypeManager.LookupInterface): Return a
6676 `TypeContainer', not an `Interface'.
6677 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6678 contain a `PartialContainer' for an interface, so check it's
6679 `Kind' to figure out what it is.
6681 2004-07-25 Martin Baulig <martin@ximian.com>
6683 * class.cs (Class.DefaultTypeAttributes): New public constant.
6684 (Struct.DefaultTypeAttributes): Likewise.
6685 (Interface.DefaultTypeAttributes): Likewise.
6686 (PartialContainer.TypeAttr): Override this and add the
6687 DefaultTypeAttributes.
6689 2004-07-25 Martin Baulig <martin@ximian.com>
6691 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6692 we can just use the `Parent' field instead.
6694 2004-07-25 Martin Baulig <martin@ximian.com>
6696 * class.cs (TypeContainer.Emit): Renamed to EmitType().
6698 2004-07-25 Martin Baulig <martin@ximian.com>
6700 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6701 our parts before defining any methods.
6702 (TypeContainer.VerifyImplements): Make this virtual.
6703 (ClassPart.VerifyImplements): Override and call VerifyImplements()
6704 on our PartialContainer.
6706 2004-07-25 Martin Baulig <martin@ximian.com>
6708 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6710 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6711 argument, we can just use the `Parent' field instead.
6714 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
6715 (MemberBase.DoDefine): Likewise.
6717 2004-07-24 Martin Baulig <martin@ximian.com>
6719 * decl.cs (MemberCore.Parent): New public field.
6720 (DeclSpace.Parent): Moved to MemberCore.
6722 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6723 (MemberBase.ctor): Added TypeContainer argument, pass it to our
6725 (FieldBase, Field, Operator): Likewise.
6726 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6727 (EventField, Event): Likewise.
6729 2004-07-23 Martin Baulig <martin@ximian.com>
6731 * class.cs (PartialContainer): New public class.
6732 (ClassPart): New public class.
6733 (TypeContainer): Added support for partial classes.
6734 (TypeContainer.GetClassBases): Splitted some of the functionality
6735 out into GetNormalBases() and GetPartialBases().
6737 * cs-tokenizer.cs (Token.PARTIAL): New token.
6738 (Tokenizer.consume_identifier): Added some hacks to recognize
6739 `partial', but only if it's immediately followed by `class',
6740 `struct' or `interface'.
6742 * cs-parser.jay: Added support for partial clases.
6744 2004-07-23 Martin Baulig <martin@ximian.com>
6746 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6747 a `DeclSpace' and also made it readonly.
6748 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6749 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6750 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6752 * cs-parser.jay: Pass the `current_class', not the
6753 `current_container' (at the moment, this is still the same thing)
6754 to a new Method, Property, Event, Indexer or Constructor.
6756 2004-07-23 Martin Baulig <martin@ximian.com>
6758 * cs-parser.jay (CSharpParser): Added a new `current_class' field
6759 and removed the `current_interface' one.
6760 (struct_declaration, class_declaration, interface_declaration):
6761 Set `current_class' to the newly created class/struct/interface;
6762 set their `Bases' and call Register() before parsing their body.
6764 2004-07-23 Martin Baulig <martin@ximian.com>
6766 * class.cs (Kind): New public enum.
6767 (TypeContainer): Made this class abstract.
6768 (TypeContainer.Kind): New public readonly field.
6769 (TypeContainer.CheckDef): New public method; moved here from
6771 (TypeContainer.Register): New public abstract method.
6772 (TypeContainer.GetPendingImplementations): New public abstract
6774 (TypeContainer.GetClassBases): Removed the `is_class' and
6775 `is_iface' parameters.
6776 (TypeContainer.DefineNestedTypes): Formerly known as
6778 (ClassOrStruct): Made this class abstract.
6780 * tree.cs (RootTypes): New public type.
6782 2004-07-20 Martin Baulig <martin@ximian.com>
6784 * tree.cs (Tree.RecordNamespace): Removed.
6785 (Tree.Namespaces): Removed.
6787 * rootcontext.cs (RootContext.IsNamespace): Removed.
6789 * cs-parser.jay (namespace_declaration): Just create a new
6790 NamespaceEntry here.
6792 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
6794 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6795 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6796 entry to make sure it runs in the correct runtime version.
6798 2004-07-18 Martin Baulig <martin@ximian.com>
6800 * generic.cs (ConstructedType.CheckConstraints): Improved
6801 constraints checking.
6803 2004-07-18 Martin Baulig <martin@ximian.com>
6805 * expression.cs (Invocation.BetterMethod): Call
6806 TypeManager.TypeToCoreType() on all types and removed my previous
6807 hack; we're already doig the right thing here.
6809 2004-07-17 Martin Baulig <martin@ximian.com>
6811 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6813 2004-07-16 Martin Baulig <martin@ximian.com>
6815 * iterators.cs: Added generics support.
6817 2004-07-16 Martin Baulig <martin@ximian.com>
6819 * iterators.cs: Rewrote this. We're now using one single Proxy
6820 class for both the IEnumerable and the IEnumerator interface and
6821 `Iterator' derives from Class so we can use the high-level API.
6823 * class.cs (TypeContainer.AddIterator): New method.
6824 (TypeContainer.DoDefineType): New protected virtual method, which
6825 is called from DefineType().
6826 (TypeContainer.DoDefineMembers): Call DefineType() and
6827 DefineMembers() on all our iterators.
6828 (TypeContainer.Emit): Call Emit() on all our iterators.
6829 (TypeContainer.CloseType): Call CloseType() on all our iterators.
6831 * codegen.cs (EmitContext.CurrentIterator): New public field.
6833 2004-07-15 Martin Baulig <martin@ximian.com>
6836 (TypeManager.not_supported_exception_type): New type.
6838 2004-07-14 Martin Baulig <martin@ximian.com>
6841 (TypeManager.generic_ienumerable_type): New type.
6842 (TypeManager.generic_ienumerator_type): New type.
6845 (RootContext.interfaces_first_stage): Added
6846 "System.Collections.Generic.IEnumerator`1" and
6847 "System.Collections.Generic.IEnumerable`1".
6849 2004-07-14 Martin Baulig <martin@ximian.com>
6851 * iterators.cs: Use real error numbers.
6853 2004-07-14 Martin Baulig <martin@ximian.com>
6855 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6856 requires this to be a System.Collection.IEnumerable and not a
6857 class implementing that interface.
6858 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
6860 2004-07-13 Marek Safar <marek.safar@seznam.cz>
6862 * class.cs: Fixed previous fix, it broke some error tests.
6864 2004-07-12 Martin Baulig <martin@ximian.com>
6866 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6869 2004-07-14 Martin Baulig <martin@ximian.com>
6871 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
6872 an exclamation mark (!) for the generic arity to reflect the
6873 latest spec changes; ie. use "System.Collections.Generic.IList`1".
6875 2004-07-13 Martin Baulig <martin@ximian.com>
6877 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
6878 specifiers being part of a type argument.
6880 2004-07-13 Martin Baulig <martin@ximian.com>
6882 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
6883 name for generic types.
6885 2004-07-13 Martin Baulig <martin@ximian.com>
6887 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
6890 2004-07-09 Miguel de Icaza <miguel@ximian.com>
6892 * assign.cs (LocalTemporary): Add new argument: is_address,If
6893 `is_address' is true, then the value that we store is the address
6894 to the real value, and not the value itself.
6896 * ecore.cs (PropertyExpr): use the new local temporary
6897 stuff to allow us to handle X.Y += z (where X is a struct)
6899 2004-07-08 Martin Baulig <martin@ximian.com>
6901 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6902 not always return, just like we're doing in Using.Resolve().
6904 2004-07-07 Miguel de Icaza <miguel@ximian.com>
6906 * cs-parser.jay (fixed_statement): flag this as Pinned.
6908 2004-07-06 Miguel de Icaza <miguel@ximian.com>
6910 * typemanager.cs (TypeManager): Removed MakePinned method, this
6911 mechanism is replaced with the .NET 2.x compatible mechanism of
6912 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6914 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
6915 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6916 `IsFixed' property which has a different meaning.
6918 2004-07-02 Raja R Harinath <rharinath@novell.com>
6920 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6921 visible from inside a nested class, not just the names of the
6922 immediately enclosing class.
6925 2004-06-24 Raja R Harinath <rharinath@novell.com>
6927 * expression.cs (BetterConversion): Remove buggy special-case
6928 handling of "implicit constant expression conversions". At this
6929 point, we already know that the conversion is possible -- we're
6930 only checking to see which is better.
6932 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6934 * cs-parser.jay: Added error CS0210 test.
6936 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6938 * cs-parser.jay: Added error CS0134 test.
6940 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6943 * cs-parser.jay: Added error CS0145 test.
6945 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6947 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6949 2004-06-23 Ben Maurer <bmaurer@ximian.com>
6951 * expression.cs (StackAlloc.Resolve): The argument may not
6952 be a constant; deal with this case.
6954 2004-06-23 Marek Safar <marek.safar@seznam.cz>
6956 * attribute.cs (IndexerName_GetIndexerName): Renamed to
6957 GetIndexerAttributeValue.
6958 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6960 * class.cs (Indexer.Define): Added error tests for CS0415,
6963 2004-06-23 Miguel de Icaza <miguel@ximian.com>
6965 * attribute.cs (Attribute.Resolve): Keep field code in sync with
6968 2004-06-23 Martin Baulig <martin@ximian.com>
6970 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6971 neither return nor throw, reset the barrier as well. Fixes #60457.
6973 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
6975 * class.cs : EventAttributes is now set to None by default.
6976 This fixes bug #60459.
6978 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6981 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6982 Don't throw exception but return null (it's sufficient now).
6984 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6986 * typemanager.cs (GetArgumentTypes): Faster implementation.
6988 2004-06-18 Martin Baulig <martin@ximian.com>
6990 * attribute.cs (Attribute.Resolve): Check whether we're an
6991 EmptyCast which a Constant child. Fixes #60333.
6993 2004-06-17 Ben Maurer <bmaurer@ximian.com>
6995 * statement.cs (EmitCollectionForeach): Account for the fact that
6996 not all valuetypes are in areas which we can take the address of.
6997 For these variables, we store to a temporary variable. Also, make
6998 sure that we dont emit a `callvirt' on a valuetype method.
7000 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7002 * expression.cs (StackAlloc.DoReSolve): Added test for
7003 negative parameter (CS0247).
7005 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7008 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7010 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7013 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7016 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7018 Fix bug #58254 & cs1555.cs, cs1556.cs
7019 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7021 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7023 * cs-parser.jay: Added error CS1669 test for indexers.
7025 2004-06-18 Martin Baulig <martin@ximian.com>
7027 * generics.cs (GenericMethod.ctor): Don't take an Attributes
7028 argument. Fixes #60441.
7030 2004-06-16 Ben Maurer <bmaurer@ximian.com>
7031 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
7032 The name needs to have the actual name of the method in order
7033 for other tests (such as the one in OverloadResolve for Invoke
7034 on a delegate) to work. As well, it does not really help
7035 error reporting because the method group had multiple methods.
7036 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
7037 Make profiling work.
7039 2004-06-13 Martin Baulig <martin@ximian.com>
7041 * cs-parser.jay: Don't allow generic attributes.
7043 2004-06-13 Martin Baulig <martin@ximian.com>
7045 * class.cs (MemberBase.DoDefineBase): New protected method.
7046 (MemberBase.DoDefine): Compute the `flags' in the new
7047 DoDefineBase() which must be called first.
7048 (Method.Define): Call DoDefineBase() first so we have the flags
7049 when defining the generic method.
7051 * cs-parser.jay (interface_method_declaration): Support generic methods.
7053 2004-06-13 Martin Baulig <martin@ximian.com>
7055 * decl.cs (TypeName): Removed.
7056 (MemberName): Removed TypeName and MemberNow; now we just have
7059 * cs-parser.jay: Don't distinguish between type arguments and type
7060 parameters in the grammar and simplified the rules a bit. The
7061 reduce/reduce conflicts are now gone (except the one we inherited
7064 2004-06-11 Martin Baulig <martin@ximian.com>
7066 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7067 call this twice: for params and varargs methods.
7069 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7072 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7074 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7076 * attribute.cs (Attribute.GetValidTargets): Made public.
7079 (AbstractPropertyEventMethod): New class for better code sharing.
7080 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7082 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7084 2004-06-09 Martin Baulig <martin@ximian.com>
7086 * cs-parser.jay: Removed a reduce/reduce conflict.
7088 2004-06-03 Martin Baulig <martin@ximian.com>
7090 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
7091 GetSimpleName() and return a SimpleName.
7093 * ecore.cs (SimpleName.Arguments): New public field.
7094 (SimpleName): Added overloaded ctor which takes an additional
7095 TypeArguments argument.
7096 (SimpleName.SimpleNameResolve): Added support for generic methods.
7097 (MethodGroupExpr.ResolveGeneric): New public method. The code was
7098 formerly in MemberAccess.DoResolve(), but we also need it in
7099 SimpleNameResolve().
7101 * expression.cs (MemberAccess.DoResolve): Use the new
7102 MethodGroupExpr.ResolveGeneric().
7104 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7106 * decl.cs: If possible, use lookuptypedirect here. We can only do
7107 this if there is no `.' after the namespace. Avoids using
7108 LookupType, which does lots of slow processing.
7109 (FindNestedType) New method, does what it says :-).
7110 * namespace.cs: use LookupTypeDirect.
7111 * rootcontext.cs: use membercache, if possible.
7112 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7114 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7117 According to the spec,
7119 In a member access of the form E.I, if E is a single identifier,
7120 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7121 field, property, localvariable, or parameter with the same type as
7122 the meaning of E as a type-name (§3.8), then both possible
7123 meanings of E are permitted.
7125 We did not check that E as a simple-name had the same type as E as
7128 This trivial check gives us 5-7% on bootstrap time.
7130 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7132 * expression.cs (Invocation.OverloadResolve): Avoid the
7133 use of hashtables and boxing here by allocating on demand.
7135 2004-05-30 Martin Baulig <martin@ximian.com>
7137 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7138 we're doing a silent lookup. Don't try to lookup nested types in
7139 TypeManager.object_type (thanks to Ben Maurer).
7141 2004-05-30 Martin Baulig <martin@ximian.com>
7143 Committing a patch from Ben Maurer.
7145 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7147 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7149 * convert.cs: add a trivial cache for overload operator resolution.
7151 2004-05-31 Marek Safar <marek.safar@seznam.cz>
7154 (AttributeTester.GetObsoleteAttribute): Returns instance of
7155 ObsoleteAttribute when type is obsolete.
7158 (TypeContainer.VerifyObsoleteAttribute): Override.
7159 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7160 (MethodCode.VerifyObsoleteAttribute): Override.
7161 (MemberBase.VerifyObsoleteAttribute): Override.
7164 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7165 and report proper error.
7168 (Delegate.VerifyObsoleteAttribute): Override.
7171 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7172 and report proper error.
7173 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7176 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7180 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7181 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7182 Added test for ObsoleteAttribute.
7185 (Catch): Derived from Statement.
7187 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7189 * decl.cs: If possible, use lookuptypedirect here. We can only do
7190 this if there is no `.' after the namespace. Avoids using
7191 LookupType, which does lots of slow processing.
7192 (FindNestedType) New method, does what it says :-).
7193 * namespace.cs: use LookupTypeDirect.
7194 * rootcontext.cs: use membercache, if possible.
7195 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7197 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7200 According to the spec,
7202 In a member access of the form E.I, if E is a single identifier,
7203 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7204 field, property, localvariable, or parameter with the same type as
7205 the meaning of E as a type-name (§3.8), then both possible
7206 meanings of E are permitted.
7208 We did not check that E as a simple-name had the same type as E as
7211 This trivial check gives us 5-7% on bootstrap time.
7213 2004-05-30 Marek Safar <marek.safar@seznam.cz>
7215 Fixed bug #59071 & cs0160.cs
7216 * statement.cs (Try.Resolve): Check here whether order of catch
7217 clauses matches their dependencies.
7219 2004-05-30 Marek Safar <marek.safar@seznam.cz>
7222 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
7225 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7227 * expression.cs (Invocation.OverloadResolve): Avoid the
7228 use of hashtables and boxing here by allocating on demand.
7230 2004-05-30 Martin Baulig <martin@ximian.com>
7232 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7233 we're doing a silent lookup. Don't try to lookup nested types in
7234 TypeManager.object_type (thanks to Ben Maurer).
7236 2004-05-30 Martin Baulig <martin@ximian.com>
7238 Committing a patch from Ben Maurer.
7240 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7242 2004-05-29 Martin Baulig <martin@ximian.com>
7244 * class.cs (IMethodData.ShouldIgnore): New method.
7246 * typemanager.cs (TypeManager.MethodFlags): Don't take a
7247 `Location' argument, we don't need it anywhere. Use
7248 `IMethodData.ShouldIgnore ()' instead of
7249 `MethodData.GetMethodFlags ()'.
7250 (TypeManager.AddMethod): Removed.
7251 (TypeManager.AddMethod2): Renamed to AddMethod.
7253 2004-05-29 Martin Baulig <martin@ximian.com>
7255 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7257 * convert.cs (Convert.ImplicitReferenceConversion): If we're
7258 converting from a class type S to an interface type and we already
7259 have an object on the stack, don't box it again. Fixes #52578.
7261 2004-05-29 Martin Baulig <martin@ximian.com>
7263 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7264 Added support for `params' parameters. Fixes #59267.
7266 2004-05-29 Martin Baulig <martin@ximian.com>
7268 * literal.cs (NullPointer): Provide a private .ctor which sets
7269 `type' to TypeManager.object_type. Fixes #59048.
7271 2004-05-29 Martin Baulig <martin@ximian.com>
7273 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7274 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
7276 * ecore.cs (EventExpr.instance_expr): Make the field private.
7278 2004-05-26 Marek Safar <marek.safar@seznam.cz>
7280 Fixed bug #50080 & cs0214-2.cs
7281 * expression.cs (Cast.DoResolve): Check unsafe context here.
7283 * statement.cs (Resolve.DoResolve): Likewise.
7285 2004-05-26 Martin Baulig <martin@ximian.com>
7287 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7289 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7290 (RootContext.LookupType): Pass down the `silent' flag.
7292 2004-05-25 Martin Baulig <martin@ximian.com>
7295 (MethodGroupExpr.IdenticalTypeName): New public property.
7296 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7297 expression actually refers to a type.
7299 2004-05-25 Martin Baulig <martin@ximian.com>
7301 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7302 for #56176 and made it actually work.
7304 2004-05-25 Martin Baulig <martin@ximian.com>
7306 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7307 (FieldExpr, PropertyExpr): Override and implement
7308 CacheTemporaries. Fixes #52279.
7310 2004-05-25 Miguel de Icaza <miguel@ximian.com>
7312 * location.cs: In the new compiler listing a file twice is a
7313 warning, not an error.
7315 2004-05-24 Martin Baulig <martin@ximian.com>
7317 * enum.cs (Enum.DefineType): For the `BaseType' to be a
7318 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
7320 2004-05-24 Martin Baulig <martin@ximian.com>
7322 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7323 walking the `using' list. Fixes #53921.
7325 2004-05-24 Martin Baulig <martin@ximian.com>
7327 * const.cs (Const.LookupConstantValue): Added support for
7328 EmptyCast's; fixes #55251.
7330 2004-05-24 Martin Baulig <martin@ximian.com>
7332 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7333 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7334 which does the CS0135 check. The reason is that we first need to
7335 check whether the variable actually exists.
7337 2004-05-24 Martin Baulig <martin@ximian.com>
7339 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7340 than RootContext.LookupType() to find the explicit interface
7343 2004-05-24 Raja R Harinath <rharinath@novell.com>
7345 * Makefile: Simplify. Use executable.make.
7346 * mcs.exe.sources: New file. List of sources of mcs.exe.
7348 2004-05-24 Anders Carlsson <andersca@gnome.org>
7352 Use the invariant culture when doing String.Compare for CLS case
7355 2004-05-23 Martin Baulig <martin@ximian.com>
7357 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7358 don't have any dots. Fixes #52622, added cs0246-8.cs.
7360 * namespace.cs (NamespaceEntry.Lookup): Likewise.
7362 2004-05-23 Marek Safar <marek.safar@seznam.cz>
7364 * class.cs (MemberBase.Define): Reuse MemberType member for
7365 resolved type. Other methods can use it too.
7367 2004-05-23 Martin Baulig <martin@ximian.com>
7369 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7370 the variable also exists in the current block (otherwise, we need
7371 to report a CS0103). Fixes #58670.
7373 2004-05-23 Martin Baulig <martin@ximian.com>
7375 * flowanalysis.cs (Reachability.Reachable): Compute this
7376 on-the-fly rather than storing it as a field.
7378 2004-05-23 Martin Baulig <martin@ximian.com>
7380 * flowanalysis.cs (Reachability.And): Manually compute the
7381 resulting `barrier' from the reachability.
7383 2004-05-23 Marek Safar <marek.safar@seznam.cz>
7386 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7387 instance of ObsoleteAttribute when symbol is obsolete.
7390 (IMethodData): Extended interface for ObsoleteAttribute support.
7392 2004-05-22 Marek Safar <marek.safar@seznam.cz>
7394 * attribute.cs: Fix bug #55970
7396 2004-05-22 Marek Safar <marek.safar@seznam.cz>
7400 (GetObsoleteAttribute): New method. Creates the instance of
7402 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7403 ObsoleteAttribute when member is obsolete.
7404 (AttributeTester.Report_ObsoleteMessage): Common method for
7405 Obsolete error/warning reporting.
7408 (TypeContainer.base_classs_type): New member for storing parent type.
7411 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7412 for this MemberCore.
7414 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7416 * attribute.cs, const.cs: Fix bug #58590
7418 2004-05-21 Martin Baulig <martin@ximian.com>
7420 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7421 out parameters if the end of the method is unreachable. Fixes
7424 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7426 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7427 Hari was right, why extra method.
7429 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7431 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7433 2004-05-20 Martin Baulig <martin@ximian.com>
7435 * delegate.cs: Convert this file to Unix mode - like the original
7438 2004-05-20 Martin Baulig <martin@ximian.com>
7440 * attribute.cs: Convert this file to Unix mode - like the original
7443 2004-05-19 Marek Safar <marek.safar@seznam.cz>
7445 Fix bug #58688 (MCS does not report error when the same attribute
7448 * attribute.cs (Attribute.Emit): Distinction between null and default.
7450 2004-05-19 Raja R Harinath <rharinath@novell.com>
7452 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7453 of a top-level attribute without an attribute target.
7454 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
7456 (Attribute.Conditional_GetConditionName),
7457 (Attribute.Obsolete_GetObsoleteMessage): Update.
7458 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
7459 part of ScanForIndexerName.
7460 (Attribute.CanIgnoreInvalidAttribute): New function.
7461 (Attribute.ScanForIndexerName): Move to ...
7462 (Attributes.ScanForIndexerName): ... here.
7463 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7464 (Attributes.Search): New internal variant that can choose not to
7465 complain if types aren't resolved. The original signature now
7467 (Attributes.GetClsCompliantAttribute): Use internal variant, with
7468 complaints suppressed.
7469 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7470 only if it not useful.
7471 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7472 top-level for attributes that are shared between the assembly
7473 and a top-level class.
7474 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7475 * class.cs: Update to reflect changes.
7476 (DefineIndexers): Fuse loops.
7477 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
7478 a couple more variants of attribute names.
7480 2004-05-18 Marek Safar <marek.safar@seznam.cz>
7482 Fix bug #52585 (Implemented explicit attribute declaration)
7485 (Attributable.ValidAttributeTargets): New abstract method. It gets
7486 list of valid attribute targets for explicit target declaration.
7487 (Attribute.Target): It holds target itself.
7488 (AttributeSection): Removed.
7489 (Attribute.CheckTargets): New method. It checks whether attribute
7490 target is valid for the current element.
7493 (EventProperty): New class. For events that are declared like
7494 property (with add and remove accessors).
7495 (EventField): New class. For events that are declared like field.
7498 * cs-parser.jay: Implemented explicit attribute target declaration.
7500 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
7501 Override ValidAttributeTargets.
7504 (ReturnParameter): Class for applying custom attributes on
7506 (ParameterAtribute): New class. Class for applying custom
7507 attributes on the parameter type.
7509 2004-05-17 Miguel de Icaza <miguel@ximian.com>
7511 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7514 (Method): Allow UNSAFE here.
7516 * modifiers.cs: Support unsafe reporting.
7518 2004-05-17 Marek Safar <marek.safar@seznam.cz>
7520 * decl.cs: Fix bug #58478.
7522 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7524 * statement.cs: When checking for unreachable code on an EmptyStatement,
7525 set the location. Fixes bug #58488.
7527 2004-05-13 Miguel de Icaza <miguel@ximian.com>
7529 * driver.cs: Add -pkg handling.
7531 From Gonzalo: UseShelLExecute=false
7533 2004-05-12 Marek Safar <marek.safar@seznam.cz>
7536 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7538 (Attribute.IsClsCompliaceRequired): Moved to base for better
7540 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7541 when attribute is AttributeUsageAttribute.
7542 (Attribute.GetValidTargets): Simplified.
7543 (Attribute.GetAttributeUsage): New method returns AttributeUsage
7544 attribute for this type.
7545 (Attribute.ApplyAttributes): Method renamed to Emit and make
7547 (GlobalAttributeSection): New class for special handling of global
7548 attributes (assembly, module).
7549 (AttributeSection.Emit): New method.
7551 * class.cs: Implemented Attributable abstract methods.
7552 (MethodCore.LabelParameters): Moved to Parameter class.
7553 (Accessor): Is back simple class.
7554 (PropertyMethod): Implemented Attributable abstract class.
7555 (DelegateMethod): Implemented Attributable abstract class.
7556 (Event): New constructor for disctintion between normal Event
7557 and Event with accessors.
7559 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7561 * codegen.cs, const.cs, decl.cs, delegate.cs:
7562 (CommonAssemblyModulClass): Implemented Attributable abstract class
7565 * enum.cs: Implement IAttributeSupport interface.
7566 (EnumMember): New class for emum members. Implemented Attributable
7570 (ParameterBase): Is abstract.
7571 (ReturnParameter): New class for easier [return:] attribute handling.
7573 * typemanager.cs: Removed builder_to_attr.
7575 2004-05-11 Raja R Harinath <rharinath@novell.com>
7578 * attribute.cs (Attribute.GetPositionalValue): New function.
7579 * class.cs (TypeContainer.VerifyMembers): New function.
7580 (TypeContainer.Emit): Use it.
7581 (ClassOrStruct): New base class for Class and Struct.
7582 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
7583 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7585 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7586 then each non-static field should have a FieldOffset attribute.
7587 Otherwise, none of the fields should have a FieldOffset attribute.
7588 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
7589 and FieldOffset attributes.
7590 * typemanager.cs (TypeManager.struct_layout_attribute_type)
7591 (TypeManager.field_offset_attribute_type): New core types.
7592 (TypeManager.InitCoreTypes): Initialize them.
7594 2004-05-11 Michal Moskal <malekith@pld-linux.org>
7596 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7597 Return correct type.
7600 2004-05-09 Miguel de Icaza <miguel@ximian.com>
7602 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7603 be implicitly converted to ulong.
7605 * expression.cs: The logic for allowing operator &, | and ^ worked
7606 was wrong, it worked before because we did not report an error in
7607 an else branch. Fixes 57895.
7609 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7610 allow volatile fields to be reference types.
7612 2004-05-07 Miguel de Icaza <miguel@ximian.com>
7614 * driver.cs: Add support for /debug-
7616 2004-05-07 Raja R Harinath <rharinath@novell.com>
7618 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
7619 Add a 'complain' parameter to silence errors.
7620 (Attribute.Resolve): Update to changes. Put in sanity check to catch
7621 silently overlooked type-resolutions.
7622 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7624 (Attributes.Search): New function.
7625 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7626 (Attributes.GetAttributeFullName): Remove hack.
7627 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
7628 Update to reflect changes.
7629 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7630 Use Attributes.Search instead of nested loops.
7632 2004-05-07 Marek Safar <marek.safar@seznam.cz>
7635 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7636 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7637 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7639 * report.cs: (Report.Warning): Renamed to Warning_T because of
7640 parameter collision.
7642 2004-05-05 Raja R Harinath <rharinath@novell.com>
7644 * expression.cs (MemberAccess.ResolveMemberAccess):
7645 Exit with non-zero status after Report.Error.
7646 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7648 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7650 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7652 * support.cs: Don't hang when the file is empty.
7654 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7656 * support.cs: In SeekableStreamReader, compute the preamble size of the
7657 underlying stream. Position changes should take into account that initial
7660 2004-05-03 Todd Berman <tberman@sevenl.net>
7662 * driver.cs: remove unused GetSysVersion function.
7664 2004-05-03 Todd Berman <tberman@sevenl.net>
7666 * driver.cs: Remove the hack from saturday, as well as the hack
7667 from jackson (LoadAssemblyFromGac), also adds the CWD to the
7668 link_paths to get that bit proper.
7670 2004-05-01 Todd Berman <tberman@sevenl.net>
7672 * driver.cs: Try a LoadFrom before a Load, this checks the current
7673 path. This is currently a bug in mono that is be fixed, however, this
7674 provides a workaround for now. This will be removed when the bug
7677 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
7679 * CryptoConvert.cs: Updated to latest version. Fix issue with
7680 incomplete key pairs (#57941).
7682 2004-05-01 Todd Berman <tberman@sevenl.net>
7684 * driver.cs: Remove '.' from path_chars, now System.* loads properly
7687 2004-04-30 Jackson Harper <jackson@ximian.com>
7689 * codegen.cs: Open keys readonly.
7691 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7693 * typemanager.cs: don't report cyclic struct layout when a struct
7694 contains 2 or more fields of the same type. Failed for Pango.AttrShape
7695 which has 2 Pango.Rectangle fields.
7697 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
7699 * expression.cs: Handle IntPtr comparisons with IL code
7700 rather than a method call.
7702 2004-04-29 Martin Baulig <martin@ximian.com>
7704 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
7705 the list of PropertyInfo's in class hierarchy and find the
7706 accessor. Fixes #56013.
7708 2004-04-29 Martin Baulig <martin@ximian.com>
7710 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7712 2004-04-29 Martin Baulig <martin@ximian.com>
7714 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7716 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7718 2004-04-29 Martin Baulig <martin@ximian.com>
7720 * class.cs (ConstructorInitializer.Resolve): Check whether the
7721 parent .ctor is accessible. Fixes #52146.
7723 2004-04-29 Martin Baulig <martin@ximian.com>
7725 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7727 * statement.cs (Using.EmitLocalVariableDecls): Use
7728 TypeManager.idisposable_type, not typeof (IDisposable).
7729 (Foreach.EmitCollectionForeach): Added support for valuetypes.
7731 2004-04-29 Martin Baulig <martin@ximian.com>
7733 * class.cs (Event.Define): Don't emit the field and don't set
7734 RTSpecialName and SpecialName for events on interfaces. Fixes
7737 2004-04-29 Raja R Harinath <rharinath@novell.com>
7739 Refactor Attribute.ApplyAttributes.
7740 * attribute.cs (Attributable): New base class for objects that can
7741 have Attributes applied on them.
7742 (Attribute): Make AttributeUsage fields public.
7743 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7744 (Attribute.IsInternalCall): New property.
7745 (Attribute.UsageAttr): Convert to a public read-only property.
7746 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7747 (Attribute.ResolveType, Attribute.Resolve)
7748 (Attribute.ScanForIndexerName): Update to reflect changes.
7749 (Attribute.CheckAttributeTarget): Re-format.
7750 (Attribute.ApplyAttributes): Refactor, to various
7751 Attributable.ApplyAttributeBuilder methods.
7752 * decl.cs (MemberCore): Make Attributable.
7753 * class.cs (Accessor): Make Attributable.
7754 (MethodData.ApplyAttributes): Use proper attribute types, not
7756 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7757 (TypeContainer.ApplyAttributeBuilder)
7758 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7759 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
7760 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7761 (Operator.ApplyAttributeBuilder): New factored-out methods.
7762 * const.cs (Const.ApplyAttributeBuilder): Likewise.
7763 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7764 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7765 * parameter.cs (ParameterBase): New Attributable base class
7766 that can also represent Return types.
7767 (Parameter): Update to the changes.
7769 2004-04-29 Jackson Harper <jackson@ximian.com>
7771 * driver.cs: Prefer the corlib system version when looking for
7772 assemblies in the GAC. This is still a hack, but its a better hack
7775 2004-04-29 Marek Safar <marek.safar@seznam.cz>
7777 * decl.cs, enum.cs: Improved error 3005 reporting.
7779 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7780 (related_symbols): New private member for list of symbols
7781 related to reported error/warning.
7783 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7785 2004-04-29 Martin Baulig <martin@ximian.com>
7787 * ecore.cs (Expression.Constantify): If we're an enum and
7788 TypeManager.TypeToCoreType() doesn't give us another type, use
7789 t.UnderlyingSystemType. Fixes #56178.
7791 2004-04-29 Martin Baulig <martin@ximian.com>
7793 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7794 interfaces and for each interface, only add members directly
7795 declared in that interface. Fixes #53255.
7797 2004-04-28 Martin Baulig <martin@ximian.com>
7799 * expression.cs (ConditionalLogicalOperator): Use a temporary
7800 variable for `left' to avoid that we evaluate it more than once;
7803 2004-04-28 Martin Baulig <martin@ximian.com>
7805 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7808 2004-04-28 Martin Baulig <martin@ximian.com>
7810 * statement.cs (LocalInfo.Resolve): Check whether the type is not
7813 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7814 whether the type is not void (CS1547).
7816 2004-04-28 Martin Baulig <martin@ximian.com>
7818 * expression.cs (Unary.DoResolveLValue): Override this and report
7819 CS0131 for anything but Operator.Indirection.
7821 2004-04-28 Martin Baulig <martin@ximian.com>
7823 Committing a patch from Ben Maurer; see bug #50820.
7825 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7828 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7831 2004-04-28 Martin Baulig <martin@ximian.com>
7833 Committing a patch from Ben Maurer; see bug #50820.
7835 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7838 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7841 2004-04-28 Martin Baulig <martin@ximian.com>
7843 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7844 (Block.AddLabel): Call DoLookupLabel() to only search in the
7847 2004-04-28 Martin Baulig <martin@ximian.com>
7849 * cfold.cs (ConstantFold.BinaryFold): Added special support for
7850 comparing StringConstants and NullLiterals in Equality and Inequality.
7852 2004-04-28 Jackson Harper <jackson@ximian.com>
7854 * driver.cs: Attempt to load referenced assemblies from the
7855 GAC. This is the quick and dirty version of this method that
7856 doesnt take into account versions and just takes the first
7857 canidate found. Will be good enough for now as we will not have more
7858 then one version installed into the GAC until I update this method.
7860 2004-04-28 Martin Baulig <martin@ximian.com>
7862 * typemanager.cs (TypeManager.CheckStructCycles): New public
7863 static method to check for cycles in the struct layout.
7865 * rootcontext.cs (RootContext.PopulateTypes): Call
7866 TypeManager.CheckStructCycles() for each TypeContainer.
7867 [Note: We only need to visit each type once.]
7869 2004-04-28 Martin Baulig <martin@ximian.com>
7871 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7873 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7874 success and added `out object value'. Use a `bool resolved' field
7875 to check whether we've already been called rather than
7876 `ConstantValue != null' since this breaks for NullLiterals.
7878 2004-04-28 Raja R Harinath <rharinath@novell.com>
7880 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7881 setting of this flag, since the 'set' method may be non-public.
7883 2004-04-28 Raja R Harinath <rharinath@novell.com>
7885 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7886 check on current_vector.Block.
7888 2004-04-27 Martin Baulig <martin@ximian.com>
7890 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7891 a field initializer. Fixes #56459.
7893 2004-04-27 Martin Baulig <martin@ximian.com>
7895 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7896 we're not attempting to use an indexer. Fixes #52154.
7898 2004-04-27 Martin Baulig <martin@ximian.com>
7900 * statement.cs (Return): Don't create a return label if we don't
7901 need it; reverts my change from January 20th. Thanks to Ben
7904 2004-04-27 Martin Baulig <martin@ximian.com>
7906 According to the spec, `goto' can only leave a nested scope, but
7909 * statement.cs (Block.LookupLabel): Only lookup in the current
7910 block, don't recurse into parent or child blocks.
7911 (Block.AddLabel): Check in parent and child blocks, report
7912 CS0140/CS0158 if we find a duplicate.
7913 (Block): Removed this indexer for label lookups.
7914 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7915 this already does the error reporting for us.
7918 (FlowBranching.UsageVector.Block): New public variable; may be null.
7919 (FlowBranching.CreateSibling): Added `Block' argument.
7920 (FlowBranching.LookupLabel): New public virtual method. Lookup a
7921 label for the target of a `goto' and check whether we're not
7922 leaving a `finally'.
7924 2004-04-27 Martin Baulig <martin@ximian.com>
7926 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7927 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7930 2004-04-27 Martin Baulig <martin@ximian.com>
7932 * statement.cs (Block.AddLabel): Also check for implicit blocks
7933 and added a CS0158 check.
7935 2004-04-27 Martin Baulig <martin@ximian.com>
7937 * flowanalysis.cs (FlowBranchingLoop): New class.
7938 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7939 UsageVector's instead of an ArrayList.
7940 (FlowBranching.Label): Likewise.
7941 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7942 (FlowBranching.AddBreakVector): New method.
7944 2004-04-27 Miguel de Icaza <miguel@ximian.com>
7946 * attribute.cs: Small regression fix: only convert the type if we
7947 the type is different, fixes System.Drawing build.
7949 2004-04-27 Martin Baulig <martin@ximian.com>
7951 * attribute.cs (Attribute.Resolve): If we have a constant value
7952 for a named field or property, implicity convert it to the correct
7955 2004-04-27 Raja R Harinath <rharinath@novell.com>
7957 * statement.cs (Block.Block): Implicit blocks share
7958 'child_variable_names' fields with parent blocks.
7959 (Block.AddChildVariableNames): Remove.
7960 (Block.AddVariable): Mark variable as "used by a child block" in
7961 every surrounding block.
7962 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7963 been used in a child block, complain about violation of "Invariant
7964 meaning in blocks" rule.
7965 * cs-parser.jay (declare_local_variables): Don't use
7966 AddChildVariableNames.
7967 (foreach_statement): Don't create an implicit block: 'foreach'
7970 2004-04-23 Miguel de Icaza <miguel@ximian.com>
7972 * convert.cs (ImplicitNumericConversion): 0 is also positive when
7973 converting from 0L to ulong. Fixes 57522.
7975 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7977 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7978 derived class hides via 'new' keyword field from base class (test-242.cs).
7979 TODO: Handle this in the more general way.
7981 * class.cs (CheckBase): Ditto.
7983 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7985 * decl.cs (caching_flags): New member for storing cached values
7987 (MemberCore.Flags): New enum where bit flags for caching_flags
7989 (MemberCore.cls_compliance): Moved to caching_flags.
7990 (DeclSpace.Created): Moved to caching_flags.
7992 * class.cs: Use caching_flags instead of DeclSpace.Created
7994 2004-04-21 Miguel de Icaza <miguel@ximian.com>
7996 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7997 if we are only a derived class, not a nested class.
7999 * typemanager.cs: Same as above, but do this at the MemberLookup
8000 level (used by field and methods, properties are handled in
8001 PropertyExpr). Allow for the qualified access if we are a nested
8004 2004-04-21 Marek Safar <marek.safar@seznam.cz>
8006 * class.cs: Refactoring.
8007 (IMethodData): New inteface; Holds links to parent members
8008 to avoid member duplication (reduced memory allocation).
8009 (Method): Implemented IMethodData interface.
8010 (PropertyBase): New inner classes for get/set methods.
8011 (PropertyBase.PropertyMethod): Implemented IMethodData interface
8012 (Event): New inner classes for add/remove methods.
8013 (Event.DelegateMethod): Implemented IMethodData interface.
8015 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8016 EmitContext (related to class.cs refactoring).
8018 2004-04-21 Raja R Harinath <rharinath@novell.com>
8020 * delegate.cs (Delegate.VerifyApplicability): If the number of
8021 arguments are the same as the number of parameters, first try to
8022 verify applicability ignoring any 'params' modifier on the last
8026 2004-04-08 Martin Baulig <martin@ximian.com>
8028 Merged latest changes into gmcs. Please keep this comment in
8029 here, it makes it easier for me to see what changed in MCS since
8030 the last time I merged.
8032 2004-04-16 Raja R Harinath <rharinath@novell.com>
8034 * class.cs (TypeContainer.AddIndexer): Use
8035 'ExplicitInterfaceName' to determine if interface name was
8036 explicitly specified. 'InterfaceType' is not initialized at this time.
8037 (TypeContainer.DefineIndexers): Remove use of temporary list. The
8038 Indexers array is already in the required order. Initialize
8039 'IndexerName' only if there are normal indexers.
8040 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8041 (TypeContainer.Emit): Emit DefaultMember attribute only if
8042 IndexerName is initialized.
8045 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
8047 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8050 2004-04-15 Raja R Harinath <rharinath@novell.com>
8052 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
8056 * attribute.cs (Attribute.Resolve): Check for duplicate named
8060 2004-04-15 Miguel de Icaza <miguel@ximian.com>
8062 * iterators.cs (MarkYield): track whether we are in an exception,
8063 and generate code accordingly. Use a temporary value to store the
8064 result for our state.
8066 I had ignored a bit the interaction of try/catch with iterators
8067 since their behavior was not entirely obvious, but now it is
8068 possible to verify that our behavior is the same as MS .NET 2.0
8072 2004-04-14 Miguel de Icaza <miguel@ximian.com>
8074 * iterators.cs: Avoid creating temporaries if there is no work to
8077 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8078 Enumerations, use TypeManager.EnumToUnderlying and call
8081 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8084 (This.Emit): Use EmitContext.EmitThis to emit our
8087 (This.EmitAssign): Ditto.
8089 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8090 codepaths, we will move all the functionality into
8093 (FieldExpr.EmitAssign): Ditto.
8095 This fixes several hidden bugs that I uncovered while doing a code
8096 review of this today.
8098 * codegen.cs (EmitThis): reworked so the semantics are more clear
8099 and also support value types "this" instances.
8101 * iterators.cs: Changed so that for iterators in value types, we
8102 do not pass the value type as a parameter.
8104 Initialization of the enumerator helpers is now done in the caller
8105 instead of passing the parameters to the constructors and having
8106 the constructor set the fields.
8108 The fields have now `assembly' visibility instead of private.
8110 2004-04-11 Miguel de Icaza <miguel@ximian.com>
8112 * expression.cs (Argument.Resolve): Check if fields passed as ref
8113 or out are contained in a MarshalByRefObject.
8115 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8116 another compiler type.
8118 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
8120 * class.cs (Indexer.Define): use the new name checking method.
8121 Also, return false on an error.
8122 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8123 (is_identifier_[start/part]_character): make static.
8125 2004-04-10 Miguel de Icaza <miguel@ximian.com>
8127 * expression.cs (Binary.ResolveOperator): Do no append strings
8128 twice: since we can be invoked more than once (array evaluation)
8129 on the same concatenation, take care of this here. Based on a fix
8130 from Ben (bug #56454)
8132 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8134 * codegen.cs: Fix another case where CS1548 must be reported (when
8135 delay-sign isn't specified and no private is available #56564). Fix
8136 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8137 error when MCS is used on the MS runtime and we need to delay-sign
8138 (which seems unsupported by AssemblyBuilder - see #56621).
8140 2004-04-08 Marek Safar <marek.safar@seznam.cz>
8142 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8143 (TypeManager.ComputeNamespaces): Faster implementation for
8146 * compiler.csproj: Updated AssemblyName to mcs.
8148 2004-05-11 Jackson Harper <jackson@ximian.com>
8150 * Makefile: Preserve MONO_PATH
8152 2004-05-11 Jackson Harper <jackson@ximian.com>
8154 * Makefile: Use mono and mcs to build gmcs
8156 2004-05-03 Miguel de Icaza <miguel@ximian.com>
8158 * codegen.cs: Add patch from Robert Shade
8159 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
8162 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
8164 * CryptoConvert.cs: Updated to latest version. Fix issue with
8165 incomplete key pairs (#57941).
8167 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8169 * codegen.cs: Fix another case where CS1548 must be reported (when
8170 delay-sign isn't specified and no private is available #56564). Fix
8171 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8172 error when MCS is used on the MS runtime and we need to delay-sign
8173 (which seems unsupported by AssemblyBuilder - see #56621).
8175 2004-04-29 Jackson Harper <jackson@ximian.com>
8177 * Makefile: Set MONO_PATH to use the bootstrap corlib
8178 * driver.cs: Check the GAC for referenced assemblies.
8180 2004-04-29 Martin Baulig <martin@ximian.com>
8182 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
8184 2004-04-07 Martin Baulig <martin@ximian.com>
8186 * expression.cs (Binary.ResolveOperator): Added special case for
8187 Equality/Inequality between a type parameter and a null literal.
8189 2004-04-07 Martin Baulig <martin@ximian.com>
8191 * convert.cs: Check null literal -> type parameter conversions.
8193 2004-04-07 Martin Baulig <martin@ximian.com>
8195 * generic.cs (ConstructedType.CheckConstraints): Enforce the
8196 `class' and `struct' constraints.
8198 2004-04-07 Martin Baulig <martin@ximian.com>
8200 * generic.cs (SpecialConstraint): New public enum.
8201 (Constraints.Resolve): Added support for the `class' and `struct'
8204 * cs-parser.jay (type_parameter_constraint): Added support for the
8205 `class' and `struct' constraints.
8207 2004-04-07 Martin Baulig <martin@ximian.com>
8209 * support.cs (GenericConstraints): Replaced `Types' by
8210 `ClassConstraint' and `InterfaceConstraints'; added
8211 `HasClassConstraint'.
8213 2004-04-07 Martin Baulig <martin@ximian.com>
8216 (Constraints.InterfaceConstraints): New public property.
8217 (Constraints.Types): Make this property public
8218 (TypeParameter): Implement IMemberContainer.
8219 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
8220 instead of a TypeBuilder/MethodBuilder; pass the interface
8221 constraints to TypeManager.AddTypeParameter().
8222 (TypeParameter.DefineType): Just take an EmitContext and no
8223 TypeBuilder/MethodBuilder. Use the new public API.
8225 * typemanager.cs (TypeManager.AddTypeParameter): Added
8226 `TypeExpr[]' argument; add the interfaces to the
8227 `builder_to_ifaces' hash.
8228 (TypeManager.LookupMemberContainer): For
8229 GenericTypeParameterBuilders, get the TypeParameter from the
8230 `builder_to_type_param'.
8231 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
8232 the TypeParameter and call FindMembers on it.
8234 2004-04-07 Martin Baulig <martin@ximian.com>
8237 (MethodCore.GenericMethod): Moved this field here from Method.
8238 (MethodCore.IsDuplicateImplementation): Take the number of type
8239 parameters into account if we're a generic method.
8241 * expression.cs (Invocation.InferTypeArguments): Don't return true
8242 if `arguments' is null; we still need to check whether we actually
8243 don't need to infer anything in this case.
8244 (MemberAccess): Merged the functionality from GenericMemberAccess
8247 * generic.cs (GenericMemberAccess): Removed.
8249 2004-04-05 Martin Baulig <martin@ximian.com>
8251 * decl.cs (MemberCore): For generic classes, interfaces and
8252 structs, `Name' now includes the number of type parameters
8254 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
8255 encode the number of type arguments in the type name.
8257 * expression.cs (Expression.MemberLookup): Removed the
8258 `num_type_args' argument; we now encode the number of type
8259 arguments in the type name.
8261 * ecore.cs (SimpleName): Encode the number of type arguments in
8262 the type name itself.
8264 * generic.cs (ConstructedType): Likewise.
8266 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
8267 `MemberName'; we now include the number of type parameters in the
8270 * typemanager.cs (TypeManager.CheckGeneric): Removed.
8271 (TypeManager.MemberLookup): Removed the
8272 `num_type_args' argument; we now encode the number of type
8273 arguments in the type name.
8275 2004-04-03 Martin Baulig <martin@ximian.com>
8277 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
8278 (MemberCore.MemberName): Moved here from MemberBase.
8279 (DeclSpace.SetParameterInfo): Just take the constraints as an
8280 ArrayList; we already have the type parameters in our
8281 `MemberName'; also do the CS0080 reporting here.
8283 * cs-parser.jay (struct_declaration): Use `member_name' instead of
8284 `IDENTIFIER opt_type_parameter_list'; when constructing our
8285 `MemberName', it'll already include our type parameters.
8286 (class_declaration, interface_declaration): Likewise.
8287 (delegate_declaration): Likewise.
8288 (MakeName): Take a MemberName and return a MemberName.
8289 The following two changes are required to avoid shift/reduce conflicts:
8290 (member_name): Don't include a TypeName anymore; ie. this is now
8291 just 'IDENTIFIER opt_type_parameter_list'.
8292 (property_declaration, event_declaration): Use a
8293 `namespace_or_type_name' instead of a `member_name'.
8295 2004-04-03 Martin Baulig <martin@ximian.com>
8297 * decl.cs (MemberName): Renamed to `TypeName' and created a new
8299 (TypeName): Formerly known as MemberName.
8301 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
8302 instead of a `MemberName'.
8304 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
8305 (member_name): New rule; create a MemberName.
8307 2004-04-02 Martin Baulig <martin@ximian.com>
8309 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
8310 (CS0305 and CS0308).
8312 2004-04-02 Martin Baulig <martin@ximian.com>
8314 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
8315 support for nested types.
8317 2004-04-02 Martin Baulig <martin@ximian.com>
8319 * ecore.cs (IAlias): New public interface.
8320 (TypeExpr, TypeExpression): Implement IAlias.
8321 (TypeAliasExpression): New public class.
8323 * namespace.cs (Namespace): Implement IAlias.
8324 (Namespace.Lookup): Return an IAlias instead on an object.
8325 (Namespace.DefineName): Take an IAlias instead of an object.
8326 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
8328 (NamespaceEntry.UsingAlias): Take a Membername instead of an
8330 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
8332 (NamespaceEntry.Lookup): Likewise.
8334 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
8337 * decl.cs (DeclSpace): Implement IAlias.
8338 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
8340 * generic.cs (ConstructedType): Improved error checking.
8342 2004-04-02 Martin Baulig <martin@ximian.com>
8344 * convert.cs: Added type parameter conversions.
8347 (UnboxCast.Emit): Emit an `unbox.any' for type params.
8348 (ClassCast.Emit): If the source type is a type parameter, box it.
8349 If the target type is a type parameter, emit an `unbox.any'
8350 instead of a `classcast'.1
8352 2004-04-01 Martin Baulig <martin@ximian.com>
8354 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
8356 2004-04-01 Martin Baulig <martin@ximian.com>
8358 * generic.cs (ConstructedType.CheckConstraints): Use
8359 Convert.ImplicitStandardConversionExists(); user-defined implicit
8360 conversions are not allowed according to the spec.
8362 2004-03-30 Martin Baulig <martin@ximian.com>
8364 * expression.cs (New): Added support for type parameters.
8367 (TypeManager.activator_type): New public static field.
8368 (TypeManager.activator_create_instance): Likewise.
8370 2004-03-30 Martin Baulig <martin@ximian.com>
8372 * typemanager.cs (TypeManager.HasConstructorConstraint): New
8375 2004-03-30 Martin Baulig <martin@ximian.com>
8377 * generic.cs (ConstructedType.CheckConstraints): Actually follow
8378 the spec here: the argument type must be convertible to the
8381 2004-03-30 Martin Baulig <martin@ximian.com>
8384 (TypeParameter.Define, TypeParameter.DefineMethod): Call
8385 TypeManager.AddTypeParameter().
8386 (ConstructedType.CheckConstraints): Re-enable this and actually
8387 check whether we have a constructor constraint.
8390 (TypeManager.builder_to_type_param): New static field.
8391 (TypeManager.AddTypeParameter): New static method.
8392 (TypeManager.LookupTypeParameter): New public method.
8394 2004-03-30 Martin Baulig <martin@ximian.com>
8396 * generic.cs (TypeParameter.DefineType): Return a boolean and use
8397 the new API to actually define the constructor constraint.
8400 (TypeManager.new_constraint_attr_type): New static field.
8401 (TypeManager.InitCoreTypes): Initialize it.
8403 2004-03-30 Martin Baulig <martin@ximian.com>
8405 * generic.cs (Constraints): Completed error checking, use correct
8408 2004-03-29 Martin Baulig <martin@ximian.com>
8410 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
8412 * expression.cs (Invocation.InferTypeArguments): Added overloaded
8413 public version which takes a `ParameterData pd' instead of an
8416 2004-03-29 Martin Baulig <martin@ximian.com>
8418 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
8421 2004-03-29 Martin Baulig <martin@ximian.com>
8423 * expression.cs (Argument.ResolveMethodGroup): If we're a
8424 ConstructedType, call GetMemberAccess() on it.
8426 2004-03-29 Martin Baulig <martin@ximian.com>
8428 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
8429 (MethodCore.CheckGenericOverride): When overriding a generic
8430 method, check whether the constraints match.
8432 * support.cs (GenericConstraints): New public interface.
8433 (ParameterData.GenericConstraints): New public method.
8435 * parameter.cs (Parameter.Resolve): Check whether we're a generic
8436 method parameter and compute our constraints if appropriate.
8437 (Parameter.GenericConstraints): New public property.
8439 * generic.cs (Constraints): Implement GenericConstraints.
8441 2004-03-29 Martin Baulig <martin@ximian.com>
8443 * decl.cs (MemberCache.FindMemberToOverride): Use
8444 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
8446 2004-03-29 Martin Baulig <martin@ximian.com>
8448 * generic.cs (GenericMethod.Define): Resolve our type parameters.
8450 2004-03-29 Martin Baulig <martin@ximian.com>
8452 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
8453 not allowed on non-generic declarations").
8455 2004-03-29 Martin Baulig <martin@ximian.com>
8457 * expression.cs (Invocation.InferTypeArguments): Added overloaded
8458 public version of this method.
8460 * class.cs (MethodCore.IsDuplicateImplementation): Use
8461 Invocation.InferTypeArguments() to check this.
8463 2004-03-29 Martin Baulig <martin@ximian.com>
8465 * convert.cs: Use TypeManager.IsDelegateType() instead of
8466 comparing types correctly.
8468 2004-03-29 Martin Baulig <martin@ximian.com>
8470 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
8471 types directly to make it work for generic instances.
8473 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
8475 2004-03-29 Martin Baulig <martin@ximian.com>
8477 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
8480 2004-03-24 Martin Baulig <martin@ximian.com>
8482 * decl.cs (DeclSpace.FindType): Also use
8483 TypeManager.CheckGeneric() for types from the using clauses.
8485 2004-03-23 Martin Baulig <martin@ximian.com>
8487 * expression.cs (Invocation.OverloadResolve): Added `bool
8488 may_fail' argument and use it instead of the Location.IsNull() hack.
8490 2004-03-23 Martin Baulig <martin@ximian.com>
8492 * expression.cs (Invocation.InferType): Use correct type inference
8495 2004-03-23 Martin Baulig <martin@ximian.com>
8497 * ecore.cs (MethodGroupExpr.Name): Use
8498 TypeManager.CSharpSignature() instead of just the name.
8500 * expression.cs (Invocation.OverloadResolve): Provide better error
8502 (Invocation.DoResolve): OverloadResolve() never returns null
8503 without reporting an error, so removed the error -6 reporting here.
8505 2004-03-23 Martin Baulig <martin@ximian.com>
8507 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
8510 * cs-parser.jay (delegate_declaration): Support generic delegates.
8512 * delegate.cs: Support generic delegates.
8514 2004-03-22 Martin Baulig <martin@ximian.com>
8516 * expression.cs (Invocation.InferParamsTypeArguments): New static
8517 method; does type inference for params arguments.
8519 2004-03-21 Martin Baulig <martin@ximian.com>
8521 * typemanager.cs (TypeManager.IsGenericMethod): New public static
8522 method; checks whether a method is a generic method.
8524 * expression.cs (Invocation.InferTypeArguments): New static method;
8525 infer type arguments for generic method invocation.
8527 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
8528 property; we set this to true if we're resolving a generic method
8529 invocation and the user specified type arguments, ie. we're not
8530 doing type inference.
8532 2004-03-20 Martin Baulig <martin@ximian.com>
8534 * class.cs (MethodData.DeclaringType): New public property.
8535 (MethodData.Define): Set DeclaringType here.
8536 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
8537 instead of OperatorMethodBuilder.DeclaringType.
8539 2004-03-20 Martin Baulig <martin@ximian.com>
8541 * cs-tokenizer.cs (xtoken): Return a special
8542 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
8544 * cs-parser.jay (default_value_expression): Switch to the new
8547 2004-03-19 Martin Baulig <martin@ximian.com>
8549 * decl.cs (MemberName): New class. We use this to "construct"
8550 namespace_or_type_name's.
8552 * generics.cs (TypeArguments.GetDeclarations): New public method;
8553 returns the type arguments as a string[] and reports a CS0081 if
8554 one of them is not an identifier.
8556 * class.cs (MemberBase): The .ctor now takes the name as a
8557 MemberName instead of a string.
8558 (MemberBase.ExplicitInterfaceName): Changed type from string to
8560 (MemberBase.DoDefine): If we're an explicit implementation, the
8561 InterfaceType may be a generic instance.
8563 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
8564 (namespace_name): Call MemberName.GetName () to transform the
8565 MemberName into a string and ensure we don't have any type
8567 (type_name): Call MemberName.GetTypeExpression() to transfrom the
8568 MemberName into an expression.
8569 (method_header): Use namespace_or_type_name instead of member_name.
8571 2004-04-07 Miguel de Icaza <miguel@ximian.com>
8573 * rootcontext.cs: Add new types to the boot resolution.
8575 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8576 MulticastDelegate is not allowed.
8578 * typemanager.cs: Add new types to lookup: System.TypedReference
8581 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8582 check for TypedReference or ArgIterator, they are not allowed.
8584 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8585 makes us properly catch 1510 in some conditions (see bug 56016 for
8588 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
8590 * CryptoConvert.cs: update from corlib version
8593 2004-04-05 Miguel de Icaza <miguel@ximian.com>
8595 * class.cs (Indexer.Define): Check indexername declaration
8597 2004-04-05 Marek Safar <marek.safar@seznam.cz>
8599 * attribute.cs (IsClsCompliant): Fixed problem with handling
8600 all three states (compliant, not-compliant, undetected).
8602 2004-03-30 Marek Safar <marek.safar@seznam.cz>
8604 * attribute.cs (Attribute): Location is now public.
8605 (Resolve): Store resolved arguments (pos_values) in attribute class.
8606 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8607 (GetClsCompliantAttributeValue): New method that gets
8608 CLSCompliantAttribute value.
8609 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8610 if exists else null.
8611 (AttributeTester): New class for CLS-Compliant verification routines.
8613 * class.cs (Emit): Add CLS-Compliant verification.
8614 (Method.GetSignatureForError): Implemented.
8615 (Constructor.GetSignatureForError): Implemented
8616 (Constructor.HasCompliantArgs): Returns if constructor has
8617 CLS-Compliant arguments.
8618 (Constructor.Emit): Override.
8619 (Construcor.IsIdentifierClsCompliant): New method; For constructors
8620 is needed to test only parameters.
8621 (FieldBase.GetSignatureForError): Implemented.
8622 (TypeContainer): New member for storing base interfaces.
8623 (TypeContainer.FindMembers): Search in base interfaces too.
8625 * codegen.cs (GetClsComplianceAttribute): New method that gets
8626 assembly or module CLSCompliantAttribute value.
8627 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8629 (ModuleClass.Emit): Add error 3012 test.
8631 * const.cs (Emit): Override and call base for CLS-Compliant tests.
8633 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8634 state for all decl types.
8635 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8636 if CLS-Compliant tests are required.
8637 (IsClsCompliaceRequired): New method. Analyze whether code
8638 must be CLS-Compliant.
8639 (IsExposedFromAssembly): New method. Returns true when MemberCore
8640 is exposed from assembly.
8641 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8642 value or gets cached value.
8643 (HasClsCompliantAttribute): New method. Returns true if MemberCore
8644 is explicitly marked with CLSCompliantAttribute.
8645 (IsIdentifierClsCompliant): New abstract method. This method is
8646 used to testing error 3005.
8647 (IsIdentifierAndParamClsCompliant): New method. Common helper method
8648 for identifier and parameters CLS-Compliant testing.
8649 (VerifyClsCompliance): New method. The main virtual method for
8650 CLS-Compliant verifications.
8651 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8652 null. I don't know why is null (too many public members !).
8653 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8654 and get value of first CLSCompliantAttribute that found.
8656 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8657 (VerifyClsCompliance): Override and add extra tests.
8659 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8660 clscheck- disable CLS-Compliant verification event if assembly is has
8661 CLSCompliantAttribute(true).
8663 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8664 ApllyAttribute is now called in emit section as in the other cases.
8665 Possible future Emit integration.
8666 (IsIdentifierClsCompliant): New override.
8667 (VerifyClsCompliance): New override.
8668 (GetEnumeratorName): Returns full enum name.
8670 * parameter.cs (GetSignatureForError): Implemented.
8672 * report.cs (WarningData): New struct for Warning message information.
8673 (LocationOfPreviousError): New method.
8674 (Warning): New method. Reports warning based on the warning table.
8675 (Error_T): New method. Reports error based on the error table.
8677 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8678 verifications are done here.
8680 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8682 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8683 CLSCompliantAttribute.
8684 (all_imported_types): New member holds all imported types from other
8686 (LoadAllImportedTypes): New method fills static table with exported types
8687 from all referenced assemblies.
8688 (Modules): New property returns all assembly modules.
8690 2004-03-30 Miguel de Icaza <miguel@ximian.com>
8692 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8693 throwing a parser error.
8695 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8696 which removes the hardcoded get_/set_ prefixes for properties, as
8697 IL allows for the properties to be named something else.
8701 * expression.cs: Do not override operand before we know if it is
8704 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8706 * typemanager.cs: support for pinned variables.
8708 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8710 * decl.cs, typemanager.cs: Avoid using an arraylist
8711 as a buffer if there is only one result set.
8713 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8715 * expression.cs: Make sure you cant call a static method
8716 with an instance expression, bug #56174.
8718 2004-03-29 Miguel de Icaza <miguel@ximian.com>
8720 * class.cs (IsDuplicateImplementation): Improve error reporting to
8721 flag 663 (method only differs in parameter modifier).
8723 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8724 in preprocessor directives.
8726 * location.cs (LookupFile): Allow for the empty path.
8728 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
8729 better approach for some of that patch, but its failing with the
8730 CharSet enumeration. For now try/catch will do.
8732 * typemanager.cs: Do not crash if a struct does not have fields.
8735 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8737 * expression.cs: cs0213, cant fix a fixed expression.
8740 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8742 * cs-parser.jay: detect invalid embeded statements gracefully.
8745 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8747 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8750 the invocation type may not be a subclass of the tye of the item/
8751 The type of the item must be a subclass of the invocation item.
8756 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
8758 * attribute.cs: Added methods to get a string and a bool from an
8759 attribute. Required to information from AssemblyKeyFileAttribute,
8760 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8761 * codegen.cs: Modified AssemblyName creation to include support for
8762 strongnames. Catch additional exceptions to report them as CS1548.
8763 * compiler.csproj: Updated include CryptoConvert.cs.
8764 * compiler.csproj.user: Removed file - user specific configuration.
8765 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
8766 Mono.Security assembly. The original class is maintained and tested in
8767 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8768 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8769 like CSC 8.0 (C# v2) supports.
8770 * Makefile: Added CryptoConvert.cs to mcs sources.
8771 * rootcontext.cs: Added new options for strongnames.
8773 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
8775 * driver.cs: For --expect-error, report error code `2'
8776 if the program compiled with no errors, error code `1' if
8777 it compiled with an error other than the one expected.
8779 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
8781 * compiler.csproj: Updated for Visual Studio .NET 2003.
8782 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8783 * compiler.sln: Updated for Visual Studio .NET 2003.
8785 2004-03-24 Ravi Pratap M <ravi@ximian.com>
8787 * expression.cs: Fix bug #47234. We basically need to apply the
8788 rule that we prefer the conversion of null to a reference type
8789 when faced with a conversion to 'object' (csc behaviour).
8791 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8793 * statement.cs: Shorter form for foreach, eliminates
8794 a local variable. r=Martin.
8796 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8798 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8799 checks if we can use brtrue/brfalse to test for 0.
8800 * expression.cs: use the above in the test for using brtrue/brfalse.
8803 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8805 * expression.cs: Rewrite string concat stuff. Benefits:
8807 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8808 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8809 rather than a concat chain.
8811 * typemanager.cs: Add lookups for more concat overloads.
8813 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8815 * expression.cs: Emit shorter il code for array init.
8832 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
8834 * statement.cs: Before, two switch blocks would be merged if the
8835 total size of the blocks (end_item - begin_item + 1) was less than
8836 two times the combined sizes of the blocks.
8838 Now, it will only merge if after the merge at least half of the
8843 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
8845 * class.cs : csc build fix for GetMethods(). See bug #52503.
8847 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
8849 * expression.cs: Make sure fp comparisons work with NaN.
8850 This fixes bug #54303. Mig approved this patch a long
8851 time ago, but we were not able to test b/c the runtime
8854 2004-03-19 Miguel de Icaza <miguel@ximian.com>
8856 * ecore.cs (TypExpr.GetHashCode): implement this overload.
8858 2004-03-19 Martin Baulig <martin@ximian.com>
8860 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
8861 two overloads may unify for some type parameter substitutions and
8862 report a CS0408 if appropriate.
8864 2004-03-19 Martin Baulig <martin@ximian.com>
8866 * class.cs (MemberCore.IsDuplicateImplementation): Report the
8867 error here and not in our caller.
8869 2004-03-19 Martin Baulig <martin@ximian.com>
8871 * interface.cs: Completely killed this file.
8872 (Interface): We're now a TypeContainer and live in class.cs.
8874 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8875 argument; we're now also called for interfaces.
8876 (TypeContainer.DefineMembers): Allow this method being called
8878 (TypeContainer.GetMethods): New public method; formerly known as
8879 Interface.GetMethod(). This is used by PendingImplementation.
8880 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8881 it's now private and non-static.
8882 (Interface): Moved this here; it's now implemented similar to
8884 (Method, Property, Event, Indexer): Added `bool is_interface'
8885 argument to their .ctor's.
8886 (MemberBase.IsInterface): New public field.
8888 * cs-parser.jay: Create normal Method, Property, Event, Indexer
8889 instances instead of InterfaceMethod, InterfaceProperty, etc.
8890 (opt_interface_base): Removed; we now use `opt_class_base' instead.
8891 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8893 2004-03-19 Martin Baulig <martin@ximian.com>
8895 * class.cs (MethodCore.IsDuplicateImplementation): New private
8896 method which does the CS0111 checking.
8897 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8898 Use IsDuplicateImplementation().
8900 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
8902 * decl.cs (FindMemberToOverride): New method to find the correct
8903 method or property to override in the base class.
8905 - Make Method/Property use the above method to find the
8906 version in the base class.
8907 - Remove the InheritableMemberSignatureCompare as it is now
8910 This patch makes large code bases much faster to compile, as it is
8911 O(n) rather than O(n^2) to do this validation.
8913 Also, it fixes bug 52458 which is that nested classes are not
8914 taken into account when finding the base class member.
8916 Reviewed/Approved by Martin.
8918 2004-03-17 Martin Baulig <martin@ximian.com>
8920 * expression.cs (MemberAccess.DoResolve): Take the parent's number
8921 of type arguments into account; use the `real_num_type_args'
8922 approach like in DoResolveAsTypeStep().
8924 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
8927 2004-03-17 Marek Safar <marek.safar@seznam.cz>
8929 * interface.cs: In all interface classes removed redundant
8930 member initialization.
8932 2004-03-16 Martin Baulig <martin@ximian.com>
8934 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8936 2004-03-15 Miguel de Icaza <miguel@ximian.com>
8938 * decl.cs (DefineTypeAndParents): New helper method to define a
8939 type's containers before the type itself is defined; This is a
8940 bug exposed by the recent changes to Windows.Forms when an
8941 implemented interface was defined inside a class that had not been
8944 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8946 (Check): Loop correctly to report errors modifiers
8947 (UNSAFE was not in the loop, since it was the same as TOP).
8949 * interface.cs: Every interface member now takes a ModFlags,
8950 instead of a "is_new" bool, which we set on the base MemberCore.
8952 Every place where we called "UnsafeOk" in the interface, now we
8953 call the proper member (InterfaceMethod.UnsafeOK) instead to get
8954 the unsafe settings from the member declaration instead of the
8955 container interface.
8957 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
8959 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8960 `set_indexer_name' to the pending bits (one per type).
8962 We fixed a bug today that was picking the wrong method to
8963 override, since for properties the existing InterfaceMethod code
8964 basically ignored the method name. Now we make sure that the
8965 method name is one of the valid indexer names.
8967 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
8969 * support.cs (SeekableStreamReader): Keep track of stream byte
8970 positions and don't mix them with character offsets to the buffer.
8972 Patch from Gustavo Giráldez
8974 2004-03-15 Marek Safar <marek.safar@seznam.cz>
8976 * interface.cs (InterfaceSetGetBase): Removed double member
8977 initialization, base class does it as well.
8979 2004-03-13 Martin Baulig <martin@ximian.com>
8981 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8982 when compiling corlib.
8984 2004-03-13 Miguel de Icaza <miguel@ximian.com>
8986 * convert.cs (ExplicitConversion): We were reporting an error on
8987 certain conversions (object_type source to a value type, when the
8988 expression was `null') before we had a chance to pass it through
8989 the user defined conversions.
8991 * driver.cs: Replace / and \ in resource specifications to dots.
8994 * class.cs: Add check for duplicate operators. Fixes 52477
8996 2004-03-11 Miguel de Icaza <miguel@ximian.com>
8998 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8999 that are in the middle of the statements, not only at the end.
9002 * class.cs (TypeContainer.AddField): No longer set the
9003 `HaveStaticConstructor' flag, now we call it
9004 `UserDefineStaticConstructor' to diferentiate the slightly
9005 semantic difference.
9007 The situation is that we were not adding BeforeFieldInit (from
9008 Modifiers.TypeAttr) to classes that could have it.
9009 BeforeFieldInit should be set to classes that have no static
9014 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9016 And most importantly Zoltan's comment:
9018 http://bugzilla.ximian.com/show_bug.cgi?id=44229
9020 "I think beforefieldinit means 'it's ok to initialize the type sometime
9021 before its static fields are used', i.e. initialization does not need
9022 to be triggered by the first access to the type. Setting this flag
9023 helps the JIT to compile better code, since it can run the static
9024 constructor at JIT time, and does not need to generate code to call it
9025 (possibly lots of times) at runtime. Unfortunately, mcs does not set
9026 this flag for lots of classes like String.
9028 csc sets this flag if the type does not have an explicit static
9029 constructor. The reasoning seems to be that if there are only static
9030 initalizers for a type, and no static constructor, then the programmer
9031 does not care when this initialization happens, so beforefieldinit
9034 This bug prevents the AOT compiler from being usable, since it
9035 generates so many calls to mono_runtime_class_init that the AOT code
9036 is much slower than the JITted code. The JITted code is faster,
9037 because it does not generate these calls if the vtable is type is
9038 already initialized, which is true in the majority of cases. But the
9039 AOT compiler can't do this."
9041 2004-03-10 Miguel de Icaza <miguel@ximian.com>
9043 * class.cs (MethodData.Emit): Refactor the code so symbolic
9044 information is generated for destructors; For some reasons we
9045 were taking a code path that did not generate symbolic information
9048 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
9050 * class.cs: Create a Constructor.CheckBase method that
9051 takes care of all validation type code. The method
9052 contains some code that was moved from Define.
9054 It also includes new code that checks for duplicate ctors.
9055 This fixes bug #55148.
9057 2004-03-09 Joshua Tauberer <tauberer@for.net>
9059 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9060 a { ... }-style array creation invokes EmitStaticInitializers
9061 which is not good for reference-type arrays. String, decimal
9062 and now null constants (NullCast) are not counted toward
9063 static initializers.
9065 2004-03-05 Martin Baulig <martin@ximian.com>
9067 * location.cs (SourceFile.HasLineDirective): New public field;
9068 specifies whether the file contains or is referenced by a "#line"
9070 (Location.DefineSymbolDocuments): Ignore source files which
9071 either contain or are referenced by a "#line" directive.
9073 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
9075 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9076 direct access to our parent, so check the method inline there.
9078 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
9080 * expression.cs (Invocation.EmitCall): Miguel's last commit
9081 caused a regression. If you had:
9086 In Foo the implict this would be null.
9088 2004-02-27 Miguel de Icaza <miguel@ximian.com>
9090 * expression.cs (Invocation.EmitCall): If the method is not
9091 virtual, do not emit a CallVirt to it, use Call.
9093 * typemanager.cs (GetFullNameSignature): Improve the method to
9094 cope with ".ctor" and replace it with the type name.
9096 * class.cs (ConstructorInitializer.Resolve): Now the method takes
9097 as an argument the ConstructorBuilder where it is being defined,
9098 to catch the recursive constructor invocations.
9100 2004-03-16 Martin Baulig <martin@ximian.com>
9102 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
9103 ConstructedType, call ResolveType() on it to get the type rather
9104 than just using `expr.Type'.
9106 2004-03-16 Martin Baulig <martin@ximian.com>
9108 * generics.cs (ConstructedType.GetMemberAccess): Take the
9109 EmitContext instead on the TypeExpr and use
9110 ec.TypeContainer.CurrentType/ec.ContainerType.
9112 2004-03-16 Martin Baulig <martin@ximian.com>
9114 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
9115 parameters before aliases.
9117 2004-03-16 Martin Baulig <martin@ximian.com>
9119 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
9120 New oublic function; checks whether two generic instances may become
9121 equal under some instantiations (26.3.1).
9123 * class.cs (TypeContainer.Define): Call
9124 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
9127 2004-03-16 Martin Baulig <martin@ximian.com>
9129 * class.cs (TypeContainer.GetClassBases): Moved
9130 Error_TypeParameterAsBase() here and also check whether the base
9131 class is not an attribute.
9133 2004-03-16 Martin Baulig <martin@ximian.com>
9135 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9137 2004-03-16 Martin Baulig <martin@ximian.com>
9139 * class.cs (Error_TypeParameterAsBase): Use correct error number
9142 2004-03-16 Martin Baulig <martin@ximian.com>
9144 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
9147 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
9150 2004-03-15 Martin Baulig <martin@ximian.com>
9152 * typemanager.cs (TypeManager.GetFullName): New public method.
9153 (TypeManager.MemberLookup): Added `int_num_type_arguments'
9154 argument; only return members with the correct number of type
9156 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
9157 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
9158 whether the number of type arguments matches.
9160 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
9161 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
9163 * expression.cs (MemberAccess): Added public `NumTypeArguments'
9164 field; it's set by the protected .ctor when we're actually a
9165 GenericMemberAccess.
9166 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
9167 arguments and pass it to MemberLookupFinal ().
9169 * ecore.cs (Expression.MemberLookup): Added `int
9170 num_type_arguments' argument; only return members with the correct
9171 number of type arguments.
9172 (Expression.MemberLookupFailed): Check whether the MemberLookup
9173 failed because we did not have the correct number of type
9174 arguments; report CS0305 in this case.
9176 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
9177 `e.ResolveAsTypeTerminal()' already did so.
9179 2004-03-15 Martin Baulig <martin@ximian.com>
9181 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
9182 we're a ConstructedType; in this case, the caller must report an
9183 error (for instance CS0131).
9185 * generic.cs (TypeArguments): Added Location argument to the .ctor.
9186 (TypeArguments.Resolve): Actually report errors here.
9188 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9190 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9191 `set_indexer_name' to the pending bits (one per type).
9193 We fixed a bug today that was picking the wrong method to
9194 override, since for properties the existing InterfaceMethod code
9195 basically ignored the method name. Now we make sure that the
9196 method name is one of the valid indexer names.
9198 2004-03-15 Martin Baulig <martin@ximian.com>
9200 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
9201 for generic instances.
9203 2004-03-13 Martin Baulig <martin@ximian.com>
9205 * class.cs (TypeContainer.DefineType): Call
9206 TypeManager.AddUserType() immediately after creating the
9207 TypeBuilder; pass all type parameters when creating the
9210 * decl.cs (DeclSpace.FindNestedType): New public method.
9211 (DeclSpace.FindType): Added `int num_type_args' argument; only
9212 return types with the correct number of type parameters.
9213 (DeclSpace.CountTypeParams): New public property.
9215 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
9216 the number of type parameters; defaults to zero.
9218 * generic.cs (TypeArguments.Count): New public property.
9219 (ConstructedType.DoResolveAsTypeStep): First call
9220 ds.FindNestedType() to find out whether we're nested in the
9221 current generic type; in this case, we inherit all type parameters
9222 from the current class.
9224 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
9225 num_type_args' argument.
9226 (RootContext.LookupType): Added overloaded version which takes the
9227 number of type arguments; only return types with the correct
9228 number of type arguments.
9230 * typemanager.cs (TypeManager.CheckGeneric): New public function;
9231 checks whether `Type t' has `int num_type_args'.
9233 2004-03-13 Martin Baulig <martin@ximian.com>
9235 * generic.cs (GenericMethod.DefineType): New method; calls
9236 DefineType() on all the type parameters.
9238 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
9239 (MethodData.Define): If we're a generic method, call
9240 GenericMethod.DefineType() to define the type parameters.
9242 2004-03-10 Martin Baulig <martin@ximian.com>
9244 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
9245 instead of IsAssignableFrom.
9247 2004-03-10 Martin Baulig <martin@ximian.com>
9249 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
9251 * support.cs (ParameterData.HasArrayParameter): New property.
9252 (ReflectionParameters.ctor): Take a MethodBase instead of a
9253 ParameterInfo[]. If we have any type parameters, get the generic
9254 method definition and ask it whether we have variable arguments.
9256 2004-02-26 Miguel de Icaza <miguel@ximian.com>
9258 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9259 routines to check if a type is an enumerable/enumerator allow
9260 classes that implement the IEnumerable or IEnumerator interfaces.
9262 * class.cs (Property, Operator): Implement IIteratorContainer, and
9263 implement SetYields.
9265 (Property.Define): Do the block swapping for get_methods in the
9266 context of iterators. We need to check if Properties also
9267 include indexers or not.
9269 (Operator): Assign the Block before invoking the
9270 OperatorMethod.Define, so we can trigger the Iterator code
9273 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
9274 Property and Operator classes are not created when we parse the
9275 declarator but until we have the block completed, so we use a
9276 singleton SimpleIteratorContainer.Simple to flag whether the
9277 SetYields has been invoked.
9279 We propagate this setting then to the Property or the Operator to
9280 allow the `yield' to function.
9282 2004-02-25 Marek Safar <marek.safar@seznam.cz>
9284 * codegen.cs: Implemented attribute support for modules.
9285 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9286 Assembly/Module functionality.
9288 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9289 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9290 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9292 2004-02-16 Marek Safar <marek.safar@seznam.cz>
9294 * interface.cs (FindMembers): The operation is performed on all base
9295 interfaces and not only on the first. It is required for future CLS Compliance patch.
9297 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
9299 * statement.cs, codegen.cs:
9300 This patch deals with patterns such as:
9302 public class List : IEnumerable {
9304 public MyEnumerator GetEnumerator () {
9305 return new MyEnumerator(this);
9308 IEnumerator IEnumerable.GetEnumerator () {
9312 public struct MyEnumerator : IEnumerator {
9317 Before, there were a few things we did wrong:
9318 1) we would emit callvirt on a struct, which is illegal
9319 2) we emited ldarg when we needed to emit ldarga
9320 3) we would mistakenly call the interface methods on an enumerator
9321 type that derived from IEnumerator and was in another assembly. For example:
9323 public class MyEnumerator : IEnumerator
9325 Would have the interface methods called, even if there were public impls of the
9326 method. In a struct, this lead to invalid IL code.
9328 2004-02-11 Marek Safar <marek.safar@seznam.cz>
9330 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9333 * delegate.cs (Define): Fixed crash when delegate type is undefined.
9335 2004-02-11 Miguel de Icaza <miguel@ximian.com>
9337 * cs-parser.jay: Fix small regression: we were not testing V2
9338 compiler features correctly.
9340 * interface.cs: If the emit context is null, then create one
9342 2004-02-09 Marek Safar <marek.safar@seznam.cz>
9344 * decl.cs (GetSignatureForError): New virtual method to get full name
9347 * attribute.cs (IAttributeSupport): New interface for attribute setting.
9348 Now it is possible to rewrite ApplyAttributes method to be less if/else.
9350 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9351 Duplicated members and code in these classes has been removed.
9352 Better encapsulation in these classes.
9354 2004-02-07 Miguel de Icaza <miguel@ximian.com>
9356 * assign.cs (Assign.DoResolve): When dealing with compound
9357 assignments, there is a new rule in ECMA C# 2.4 (might have been
9358 there before, but it is documented here) that states that in:
9362 If b is of type int, and the `op' is a shift-operator, then the
9363 above is evaluated as:
9367 * expression.cs (Binary.ResolveOperator): Instead of testing for
9368 int/uint/long/ulong, try to implicitly convert to any of those
9369 types and use that in pointer arithmetic.
9371 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9372 method to print information for from the type, not from the
9373 null-method we were given.
9375 2004-02-01 Duncan Mak <duncan@ximian.com>
9377 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9378 parsing for cmd, fixes bug #53694.
9380 2004-02-04 Marek Safar <marek.safar@seznam.cz>
9382 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9383 in the member name duplication tests. Property and operator name duplication
9384 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9386 2004-02-03 Marek Safar <marek.safar@seznam.cz>
9388 * interface.cs (PopulateMethod): Fixed crash when interface method
9389 returns not existing type (error test cs0246-3.cs).
9391 2004-02-02 Ravi Pratap M <ravi@ximian.com>
9393 * cs-parser.jay (interface_accessors): Re-write actions to also
9394 store attributes attached to get and set methods. Fix spelling
9397 (inteface_property_declaration): Modify accordingly.
9399 (InterfaceAccessorInfo): New helper class to store information to pass
9400 around between rules that use interface_accessors.
9402 * interface.cs (Emit): Apply attributes on the get and set
9403 accessors of properties and indexers too.
9405 * attribute.cs (ApplyAttributes): Modify accordingly to use the
9406 right MethodBuilder when applying attributes to the get and set accessors.
9408 2004-01-31 Miguel de Icaza <miguel@ximian.com>
9410 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9412 2004-01-26 Miguel de Icaza <miguel@ximian.com>
9414 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9416 2004-01-25 Miguel de Icaza <miguel@ximian.com>
9418 * cs-parser.jay: Remove YIELD token, instead use the new grammar
9419 changes that treat `yield' specially when present before `break'
9422 * cs-tokenizer.cs: yield is no longer a keyword.
9424 2004-01-23 Marek Safar <marek.safar@seznam.cz>
9426 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9427 setting for default constructors.
9428 For default constructors are almost every time set wrong Modifier. The
9429 generated IL code has been alright. But inside mcs this values was
9430 wrong and this was reason why several of my CLS Compliance tests
9433 2004-02-27 Martin Baulig <martin@ximian.com>
9435 * generics.cs (ConstructedType.ResolveType): Make the nested type
9436 stuff actually work.
9438 2004-02-25 Martin Baulig <martin@ximian.com>
9440 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
9441 property; returns the type parameters just from the current type,
9442 ie. with the ones from outer classes.
9443 (DeclSpace.LookupGeneric): First search in the current class, then
9445 (DeclSpace.initialize_type_params): When hiding a type parameter
9446 from an outer class, put it into the `type_param_list' anyways.
9448 * expression.cs (MemberAccess.expr): Made this field protected.
9450 * class.cs (TypeContainer.Define): The `CurrentType' just contains
9451 the type parameters from the current class.
9453 * generic.cs (ConstructedType.ResolveType): Support nested generic
9454 types by taking the type parameters which we inherit from outer
9455 classes into account.
9456 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
9457 support for nested generic types.
9459 2004-02-23 Martin Baulig <martin@ximian.com>
9461 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
9462 field and check whether we're nested inside a generic type.
9463 (DeclSpace.ResolveType): If we're resolving to a generic type
9464 definition, create a ConstructedType and return its resolved type.
9465 (DeclSpace.initialize_type_params): New private method;
9466 initializes the `type_param_list' field from the type parameters
9467 from this and all enclosing classes.
9468 (DeclSpace.TypeParameters): Call initialize_type_params() unless
9469 we're already initialized.
9471 2004-02-23 Martin Baulig <martin@ximian.com>
9473 * class.cs (Method.Define): Create the generic method before
9475 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
9476 the TypeContainer one); we use this for generic methods.
9478 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
9479 parent's TypeBuilder.
9481 2004-02-18 Martin Baulig <martin@ximian.com>
9483 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
9484 to check for equality.
9486 2004-02-05 Martin Baulig <martin@ximian.com>
9488 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
9489 `ec.TypeContainer.CurrentType', use it instead of
9490 `ec.ContainerType' to check whether we're in the type's ctor.
9492 2004-01-29 Martin Baulig <martin@ximian.com>
9494 * expression.cs (Invocation.DoResolve): If we're a
9495 `ConstructedType', then we're actually a generic method, so
9496 rewrite the expr as a GenericMemberAccess.
9498 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
9499 here; manually parse it into a string.
9501 2004-01-28 Martin Baulig <martin@ximian.com>
9503 * typemanager.cs (TypeManager.IsEqual): New static method.
9504 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
9505 check for equality instead of using `=='.
9507 2004-01-26 Martin Baulig <martin@ximian.com>
9509 * decl.cs (DeclSpace.CurrentType): New public field.
9511 * expression.cs (This.ResolveBase): If we have an
9512 `ec.TypeContainer.CurrentType', use it instead of
9515 * class.cs (TypeContainer.DefineType): If we're a generic type,
9516 create the `CurrentType' (unresolved).
9517 (TypeContainer.GenericType): New private field.
9518 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
9519 it and store it in `GenericType' before creating the MemberCache.
9520 (TypeContainer.GetMembers): If we have a `GenericType', call
9521 TypeManager.FindMembers() on it.
9523 * interface.cs (Interface.GenericType): New private field.
9524 (Interface.DefineType): If we're a generic type, create the
9525 `CurrentType' (unresolved).
9526 (Interface.DefineMembers): If we have a `CurrentType', resolve it
9527 and store it in `GenericType' before creating the MemberCache.
9528 (Interface.GetMembers): If we have a `GenericType', call
9529 TypeManager.FindMembers() on it.
9531 2004-01-22 Martin Baulig <martin@ximian.com>
9533 * cs-parser.jay (namespace_or_type_name): Return an Expression,
9534 not a QualifiedIdentifier. This is what `type_name_expression'
9535 was previously doing.
9536 (type_name_expression): Removed; the code is now in
9537 `namespace_or_type_name'.
9538 (qualified_identifier): Removed, use `namespace_or_type_name'
9540 (QualifiedIdentifier): Removed this class.
9542 2004-01-22 Martin Baulig <martin@ximian.com>
9544 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9545 not a string as alias name.
9547 2004-01-21 Miguel de Icaza <miguel@ximian.com>
9549 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9550 #52730 bug, and instead compute correctly the need to use a
9551 temporary variable when requesting an address based on the
9552 static/instace modified of the field and the constructor.
9554 2004-01-21 Martin Baulig <martin@ximian.com>
9556 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9557 class and namespace before looking up aliases. Fixes #52517.
9559 2004-01-21 Martin Baulig <martin@ximian.com>
9561 * flowanalysis.cs (UsageVector.Merge): Allow variables being
9562 assinged in a 'try'; fixes exception4.cs.
9564 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9565 * class.cs : Implemented parameter-less constructor for TypeContainer
9567 * decl.cs: Attributes are now stored here. New property OptAttributes
9569 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9571 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9573 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9575 * typemanager.cs (CSharpSignature): Now reports also inner class name.
9576 (CSharpSignature): New method for indexer and property signature.
9578 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9580 * pending.cs (IsVirtualFilter): Faster implementation.
9582 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9584 * typemanager.cs: Avoid inclusion of same assembly more than once.
9586 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9588 * cs-parser.jay: Fixed problem where the last assembly attribute
9589 has been applied also to following declaration (class, struct, etc.)
9591 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9593 * class.cs: Added error CS0538, CS0539 reporting.
9594 Fixed crash on Microsoft runtime when field type is void.
9596 * cs-parser.jay: Added error CS0537 reporting.
9598 * pending.cs: Added error CS0535 reporting.
9599 Improved error report for errors CS0536, CS0534.
9601 2004-01-20 Miguel de Icaza <miguel@ximian.com>
9603 Merge a few bits from the Anonymous Method MCS tree.
9605 * statement.cs (ToplevelBlock): New class for toplevel methods,
9606 will hold anonymous methods, lifted variables.
9608 * cs-parser.jay: Create toplevel blocks for delegates and for
9609 regular blocks of code.
9611 2004-01-20 Martin Baulig <martin@ximian.com>
9613 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9614 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9615 and `NeedExplicitReturn'; added `IsLastStatement'.
9616 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9617 have a `ReturnLabel' or we're not unreachable.
9619 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9620 child's reachability; don't just override ours with it. Fixes
9621 #58058 (lluis's example).
9622 (FlowBranching): Added public InTryOrCatch(), InCatch(),
9623 InFinally(), InLoop(), InSwitch() and
9624 BreakCrossesTryCatchBoundary() methods.
9626 * statement.cs (Return): Do all error checking in Resolve().
9627 Unless we are the last statement in a top-level block, always
9628 create a return label and jump to it.
9629 (Break, Continue): Do all error checking in Resolve(); also make
9630 sure we aren't leaving a `finally'.
9631 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9632 statement in a top-level block.
9633 (Block.Flags): Added `IsDestructor'.
9634 (Block.IsDestructor): New public property.
9636 2004-01-20 Martin Baulig <martin@ximian.com>
9638 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9640 2004-01-20 Martin Baulig <martin@ximian.com>
9642 * statement.cs (Statement.ResolveUnreachable): New public method.
9643 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9644 (Block.Resolve): Resolve unreachable statements.
9646 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9648 * expression.cs: We need to fix the case where we do
9649 not have a temp variable here.
9651 * assign.cs: Only expression compound assignments need
9652 temporary variables.
9654 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9656 * flowanalysis.cs: Reduce memory allocation in a few ways:
9657 - A block with no variables should not allocate a bit
9659 - A method with no out parameters does not need any tracking
9660 for assignment of the parameters, so we need not allocate
9663 public readonly Type[] VariableTypes;
9664 public readonly string[] VariableNames;
9665 Are redundant. The data is already stored in the variable
9666 map, so we need not allocate another array for it.
9667 - We need to add alot of checks for if (params | locals) == null
9668 due to the first two changes.
9670 2004-01-18 Miguel de Icaza <miguel@ximian.com>
9672 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9673 implement IMemoryLocation, we store a copy on a local variable and
9674 take the address of it. Patch from Benjamin Jemlich
9676 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9677 to use a special "type_name_expression" rule which reduces the
9678 number of "QualifiedIdentifier" classes created, and instead
9679 directly creates MemberAccess expressions.
9681 2004-01-17 Miguel de Icaza <miguel@ximian.com>
9683 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9684 that fixes #52853. Null literal assignment to ValueType
9686 * class.cs (MethodData.Emit): Instead of checking the name of the
9687 method to determine if its a destructor, create a new derived
9688 class from Method called Destructor, and test for that.
9690 * cs-parser.jay: Create a Destructor object instead of a Method.
9692 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9696 2004-01-16 Miguel de Icaza <miguel@ximian.com>
9698 * expression.cs (Binary.ResolveOperator): Perform an implicit
9699 conversion from MethodGroups to their delegate types on the
9702 * delegate.cs: Introduce a new class DelegateCreation that is the
9703 base class for `NewDelegate' and `ImplicitDelegateCreation',
9704 factor some code in here.
9706 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9707 conversion from MethodGroups to compatible delegate types.
9709 * ecore.cs (Expression.Resolve): Do not flag error 654
9710 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9711 we allow conversions from MethodGroups to delegate types now.
9713 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9714 assignments in v2 either.
9716 2004-01-10 Miguel de Icaza <miguel@ximian.com>
9718 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9719 static read-only fields in ctors.
9721 Applied patch from Benjamin Jemlich
9723 * expression.cs (UnaryMutator): Avoid leaking local variables.
9725 2004-01-09 Miguel de Icaza <miguel@ximian.com>
9727 * cs-tokenizer.cs (IsCastToken): Allow the various native types
9728 here to return true, as they can be used like this:
9732 Fixed 49836 and all the other dups
9734 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
9736 * driver.cs: Implement /win32res and /win32icon.
9738 2004-01-08 Miguel de Icaza <miguel@ximian.com>
9740 * cs-parser.jay: Add a rule to improve error handling for the
9741 common mistake of placing modifiers after the type.
9743 2004-01-07 Miguel de Icaza <miguel@ximian.com>
9745 * cs-parser.jay (interface_event_declaration): Catch
9746 initialization of events on interfaces, and report cs0068
9748 * cs-parser.jay (interface_event_declaration): Catch
9749 initialization of events.
9751 * ecore.cs: Better report missing constructors.
9753 * expression.cs (Binary.ResolveOperator): My previous bug fix had
9754 the error reporting done in the wrong place. Fix.
9756 * expression.cs (Binary.ResolveOperator): Catch the
9757 operator + (E x, E y) error earlier, and later allow for implicit
9758 conversions in operator +/- (E e, U x) from U to the underlying
9761 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9762 52596, if the container class is abstract, the default constructor
9763 is protected otherwise its public (before, we were always public).
9765 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9768 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9769 Jemlich that fixes bug #52597, MCS was generating invalid code for
9770 idisposable structs. Thanks to Ben for following up with this
9773 2004-01-06 Miguel de Icaza <miguel@ximian.com>
9775 * driver.cs: Allow assemblies without code to be generated, fixes
9778 2004-01-07 Nick Drochak <ndrochak@gol.com>
9780 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9782 2004-01-05 Miguel de Icaza <miguel@ximian.com>
9784 * cs-parser.jay: Add rules to improve error reporting if fields or
9785 methods are declared at the namespace level (error 116)
9787 * Add rules to catch event add/remove
9789 2004-01-04 David Sheldon <dave-mono@earth.li>
9791 * expression.cs: Added matching ")" to error message for
9794 2004-01-03 Todd Berman <tberman@gentoo.org>
9796 * ecore.cs, attribute.cs:
9797 Applying fix from #52429.
9799 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9801 * ecore.cs, expression.cs, statement.cs:
9802 Total rewrite of how we handle branching. We
9803 now handle complex boolean expressions with fewer
9804 jumps. As well if (x == 0) no longer emits a ceq.
9806 if (x is Foo) is much faster now, because we generate
9809 Overall, we get a pretty big improvement on our benchmark
9810 tests. The code we generate is smaller and more readable.
9812 I did a full two-stage bootstrap. The patch was reviewed
9813 by Martin and Miguel.
9815 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9817 * cs-parser.jay: Make primary_expression not take a QI.
9818 we dont need this because the member_access rule covers
9819 us here. So we replace the rule with just IDENTIFIER.
9821 This has two good effects. First, we remove a s/r conflict.
9822 Second, we allocate many fewer QualifiedIdentifier objects.
9824 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9826 * attribute.cs: Handle MarshalAs attributes as pseudo, and
9827 set the correct information via SRE. This prevents
9828 hanging on the MS runtime. Fixes #29374.
9830 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9832 * convert.cs: correctly handle conversions to value types
9833 from Enum and ValueType as unboxing conversions.
9835 Fixes bug #52569. Patch by Benjamin Jemlich.
9837 2004-01-02 Ravi Pratap <ravi@ximian.com>
9839 * expression.cs (BetterConversion): Prefer int -> uint
9840 over int -> ulong (csc's behaviour). This fixed bug #52046.
9842 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
9844 * decl.cs (MemberCache.FindMembers): now returns a
9847 * typemanager.cs: In general, go with with ^^.
9848 (CopyNewMethods): take an IList.
9849 (RealMemberLookup): Only allocate an arraylist
9850 if we copy from two sets of methods.
9852 This change basically does two things:
9853 1) Fewer array lists allocated due to CopyNewMethods.
9854 2) the explicit cast in MemberList costed ALOT.
9856 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
9858 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9859 a hashtable to avoid needless string allocations when an identifier is
9860 used more than once (the common case).
9862 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
9864 * pending.cs: MS's TypeBuilder.GetInterfaces ()
9865 is broken, it will not return anything. So, we
9866 have to use the information we have in mcs to
9869 * typemanager.cs: Add a cache for GetInterfaces,
9870 since this will now be used more often (due to ^^)
9872 (GetExplicitInterfaces) New method that gets the
9873 declared, not effective, interfaces on a type
9874 builder (eg, if you have interface IFoo, interface
9875 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9878 This patch makes MCS able to bootstrap itself on
9881 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
9883 * expression.cs: Remove the Nop's that Miguel put
9886 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9888 * report.cs, codegen.cs: Give the real stack trace to
9889 the error when an exception is thrown.
9891 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9893 * decl.cs: only allocate hashtables for ifaces if
9896 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9898 * expression.cs: fix the error from cs0121-2.cs
9899 (a parent interface has two child interfaces that
9900 have a function with the same name and 0 params
9901 and the function is called through the parent).
9903 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
9905 * class.cs, rootcontext.cs, typmanager.cs: do not
9908 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
9910 * codegen.cs: remove stack for the ec flow branching.
9911 It is already a linked list, so no need.
9913 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
9915 * Makefile: Allow custom profiler here.
9917 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
9919 * typemanager.cs (LookupType):
9920 - Use a static char [], because split takes
9921 a param array for args, so it was allocating
9923 - Do not store true in a hashtable, it boxes.
9925 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
9927 * flowanalysis.cs: bytify common enums.
9929 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9931 * modifiers.cs: Add a new set of flags for the
9932 flags allowed on explicit interface impls.
9933 * cs-parser.jay: catch the use of modifiers in
9934 interfaces correctly.
9935 * class.cs: catch private void IFoo.Blah ().
9937 All related to bug #50572.
9939 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9941 * decl.cs: Rewrite the consistant accessability checking.
9942 Accessability is not linear, it must be implemented in
9943 a tableish way. Fixes #49704.
9945 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9947 * expression.cs: Handle negation in a checked context.
9948 We must use subtraction from zero. Fixes #38674.
9950 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
9952 * class.cs: Ignore static void main in DLLs.
9953 * rootcontext.cs: Handle the target type here,
9954 since we are have to access it from class.cs
9955 * driver.cs: account for the above.
9957 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
9959 * report.cs: Give line numbers and files if available.
9961 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
9963 * driver.cs: Implement /addmodule.
9965 * typemanager.cs: Change 'modules' field so it now contains Modules not
9968 2003-12-20 Martin Baulig <martin@ximian.com>
9970 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9971 (FieldBase.IsAssigned): Removed this field.
9972 (FieldBase.SetAssigned): New public method.
9973 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9975 2003-12-20 Martin Baulig <martin@ximian.com>
9977 * expression.cs (LocalVariableReference.DoResolve): Don't set
9978 `vi.Used' if we're called from DoResolveLValue().
9980 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9981 returns the usage vector it just merged into the current one -
9982 pass this one to UsageWarning().
9983 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9984 of the `EmitContext', don't call this recursively on our children.
9986 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
9988 * driver.cs: Implement /target:module.
9990 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
9992 * support.cs (CharArrayHashtable): New helper class.
9994 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
9995 char arrays, not strings, so we can avoid creating a string in
9996 consume_identifier if the identifier is a keyword.
9998 2003-12-16 Martin Baulig <martin@ximian.com>
10000 * statement.cs (LocalInfo.Assigned): Removed this property.
10001 (LocalInfo.Flags): Removed `Assigned'.
10002 (LocalInfo.IsAssigned): New public method; takes the EmitContext
10003 and uses flow analysis.
10004 (Block.UsageWarning): Made this method private.
10005 (Block.Resolve): Call UsageWarning() if appropriate.
10007 * expression.cs (LocalVariableReference.DoResolve): Always set
10008 LocalInfo.Used here.
10010 2003-12-13 Martin Baulig <martin@ximian.com>
10012 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10013 any value here; we're now using flow analysis to figure out
10014 whether a statement/block returns a value.
10016 2003-12-13 Martin Baulig <martin@ximian.com>
10018 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10020 (FlowBranching.MergeFinally): Don't call
10021 `branching.CheckOutParameters()' here, this is called in
10023 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10024 when adding the `finally' vector.
10026 2003-12-13 Martin Baulig <martin@ximian.com>
10029 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10030 actually work and also fix #48962.
10032 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
10034 * decl.cs: Do not check System.Object for nested types,
10035 since we know it does not have any. Big bang for buck:
10038 Run 1: 8.35 seconds
10039 Run 2: 8.32 seconds
10040 corlib: 17.99 seconds
10042 Run 1: 8.17 seconds
10043 Run 2: 8.17 seconds
10044 corlib: 17.39 seconds
10046 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
10048 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10049 time we are returning 0 members, so we save alot here.
10051 2003-12-11 Martin Baulig <martin@ximian.com>
10053 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10054 `MergeChild()', also just take the `FlowBranching' as argument;
10055 call Merge() on it and return the result.
10056 (FlowBranching.Merge): We don't need to do anything if we just
10059 2003-12-11 Martin Baulig <martin@ximian.com>
10061 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10062 them in an `ArrayList' to reduce memory usage. Thanks to Ben
10063 Maurer for this idea.
10065 2003-12-11 Martin Baulig <martin@ximian.com>
10067 * flowanalysis.cs (MergeResult): This class is now gone; we now
10068 use the `UsageVector' for this. The reason for this is that if a
10069 branching just has one sibling, we don't need to "merge" them at
10070 all - that's the next step to do.
10071 (FlowBranching.Merge): We now return a `UsageVector' instead of a
10074 2003-12-11 Martin Baulig <martin@ximian.com>
10076 Reworked flow analyis and made it more precise and bug-free. The
10077 most important change is that we're now using a special `Reachability'
10078 class instead of having "magic" meanings of `FlowReturns'. I'll
10079 do some more cleanups and optimizations and also add some more
10080 documentation this week.
10082 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10083 largely reworked this class.
10084 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10085 the new `Reachability' class instead of having "magic" values here.
10086 (FlowBranching): We're now using an instance of `Reachability'
10087 instead of having separate `Returns', `Breaks' etc. fields.
10089 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10090 based on flow analysis; ignore the return value of block.Emit ().
10092 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10094 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10095 if they are private.
10097 2003-12-09 Martin Baulig <martin@ximian.com>
10099 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10100 call them directly on the UsageVector.
10102 2003-12-09 Martin Baulig <martin@ximian.com>
10104 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10105 Changed return type from `FlowReturns' to `Reachability'.
10107 2003-12-09 Martin Baulig <martin@ximian.com>
10109 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10110 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10111 `Reachable' fields with a single `Reachability' one.
10113 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10115 * class.cs (FindMembers): Remove foreach's.
10120 Run 1: 8.74 seconds
10121 Run 2: 8.71 seconds
10124 Run 1: 8.64 seconds
10125 Run 2: 8.58 seconds
10128 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10133 This patch does a few things:
10134 1. EmptyStatement is now a singleton, so it is never reallocated.
10135 2. All blah is EmptyStatement constructs have been changed to
10136 blah == EmptyStatement.Value, which is much faster and valid
10137 now that EmptyStatement is a singleton.
10138 3. When resolving a block, rather than allocating a new array for
10139 the non-empty statements, empty statements are replaced with
10140 EmptyStatement.Value
10141 4. Some recursive functions have been made non-recursive.
10142 Mainly the performance impact is from (3), however (1) and (2) are needed for
10143 this to work. (4) does not make a big difference in normal situations, however
10144 it makes the profile look saner.
10149 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10150 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10151 Total memory allocated: 56397 KB
10154 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10155 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10156 Total memory allocated: 55666 KB
10158 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10160 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10161 than the hashtable in a hashtable version
10163 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10164 we always end up concating a string. This results in a huge perf
10165 loss, because many strings have to be tracked by the GC. In this
10166 patch, we first use a hashtable that works with two keys, so that
10167 the strings do not need to be concat'ed.
10171 Run 1: 8.74 seconds
10172 Run 2: 8.71 seconds
10175 Run 1: 8.65 seconds
10176 Run 2: 8.56 seconds
10178 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10180 * Makefile: Add a new target `do-time' that does a quick and simple
10181 profile, leaving easy to parse output.
10183 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
10185 * codegen.cs (Init): Create the dynamic assembly with
10186 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10188 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
10190 * support.cs: Make the PtrHashtable use only one
10191 instance of its comparer.
10193 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
10195 * typemanager.cs: Fix lookup of GetNamespaces.
10197 2003-11-29 Miguel de Icaza <miguel@ximian.com>
10199 * expression.cs: Removed redundant line.
10201 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10202 ArrayLists, use for loops with bounds.
10204 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10207 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10208 arraylists, use for loop with bounds.
10210 The above three changes give us a 0.071 second performance
10211 improvement out of 3.294 seconds down to 3.223. On my machine
10212 the above changes reduced the memory usage by 1,387 KB during
10213 compiler bootstrap.
10215 * cs-parser.jay (QualifiedIdentifier): New class used to represent
10216 QualifiedIdentifiers. Before we created a new string through
10217 concatenation, and mostly later on, the result would be
10218 manipulated by DecomposeQI through string manipulation.
10220 This reduced the compiler memory usage for bootstrapping from
10221 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10222 compile times in 0.05 seconds.
10224 2003-11-28 Dick Porter <dick@ximian.com>
10226 * support.cs: Do string compares with the Invariant culture.
10234 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10235 the comparison is done with the Invariant culture.
10237 2003-11-27 Miguel de Icaza <miguel@ximian.com>
10239 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10240 GetEnumerator method.
10242 (ProbeCollectionType): Iterate starting at the most specific type
10243 upwards looking for a GetEnumerator
10245 * expression.cs: Shift count can be up to 31 for int/uint and 63
10248 2003-11-26 Miguel de Icaza <miguel@ximian.com>
10250 * statement.cs (Block.LookupLabel): Also look for the label on the
10251 children blocks. Use a hash table to keep track of visited
10254 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10255 we actually did transform the other operand, otherwise fall back
10256 to the common codepath that casts to long.
10258 * cs-tokenizer.cs: Use the same code pattern as the int case.
10259 Maybe I should do the parsing myself, and avoid depending on the
10260 Parse routines to get this done.
10262 2003-11-25 Miguel de Icaza <miguel@ximian.com>
10264 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10265 which fixes bug 51347. This time test it.
10267 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10268 attributes for example can not tell the difference between these.
10269 The difference was only a syntax feature of the language.
10271 * attribute.cs: Apply attributes to delegates.
10273 * delegate.cs: Call the apply attributes method.
10275 2003-11-24 Miguel de Icaza <miguel@ximian.com>
10277 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10278 comparing 0 vs Byte.MinValue, not the value
10280 (ImplicitConversionRequired): When reporting a conversion error,
10281 use error 31 to print out the constant error instead of the
10284 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10285 which fixes bug 51347.
10287 2003-11-22 Miguel de Icaza <miguel@ximian.com>
10289 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
10290 which fixes the -warnaserror command line option.
10292 2003-11-21 Miguel de Icaza <miguel@ximian.com>
10294 * cfold.cs (DoNumericPromotions): During constant folding of
10295 additions on UIntConstant, special case intconstants with
10296 IntConstants like we do on the expression binary operator.
10298 2003-11-12 Miguel de Icaza <miguel@ximian.com>
10300 * convert.cs (ImplicitReferenceConversion): We were missing a case
10301 (System.Enum are not value types or class types, so we need to
10302 classify them separatedly).
10304 * driver.cs: We do not support error 2007.
10306 2003-11-12 Jackson Harper <jackson@ximian.com>
10308 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10309 system directory. Also use the full file name so users can
10310 libraries names mscorlib-o-tron.dll in a non system dir.
10312 2004-01-04 David Sheldon <dave-mono@earth.li>
10314 * expression.cs: Added matching ")" to error message for CS0077.
10316 2003-12-19 Martin Baulig <martin@ximian.com>
10318 * typemanager.cs (TypeManager.IsEqualGenericType): New public
10319 static method; see documentation in the method.
10320 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
10322 * convert.cs (Convert.ImplicitReferenceConversion,
10323 Convert.ImplicitReferenceConversionExists): Add support for
10324 generic type declarations; see gen-36.cs.
10326 2003-12-19 Martin Baulig <martin@ximian.com>
10328 * pending.cs (Pending.InterfaceMethod): Use
10329 `Type.IsAssignableFrom()' instead of `=='.
10331 2003-12-18 Martin Baulig <martin@ximian.com>
10333 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
10336 * convert.cs (Convert.ImplicitStandardConversionExists): Use
10337 `expr_type.Equals (target_type)' instead of `=='.
10339 2003-12-08 Martin Baulig <martin@ximian.com>
10341 * generics.cs (Constraints.Types): Removed.
10342 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
10344 (Constraints.ResolveTypes): New public method; resolves the
10345 TypeExpr's to Type's.
10346 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
10347 longer takes the constraints.
10348 (TypeParameter.DefineMethod): Likewise.
10349 (TypeParameter.DefineType): New public method. Calls
10350 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
10353 2003-12-08 Martin Baulig <martin@ximian.com>
10355 * convert.cs (Convert.ImplicitConversionStandard): Use
10356 `expr_type.Equals (target_type)' instead of `=='.
10358 2003-12-08 Martin Baulig <martin@ximian.com>
10360 * typemanager.cs (TypeManager.GetReferenceType): Call
10361 `Type.MakeByRefType ()'.
10363 2003-12-08 Martin Baulig <martin@ximian.com>
10365 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
10366 just has some special meaning in some situations. For instance,
10367 it is allowed to use `where' as the name of a variable etc.
10369 2003-12-04 Martin Baulig <martin@ximian.com>
10371 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10372 `Type.MakeArrayType()' for array types.
10374 2003-11-18 Miguel de Icaza <miguel@ximian.com>
10376 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
10379 (SizeOf.DoResolve): assign the `type_queried' field. This gets
10382 2003-11-16 Martin Baulig <martin@ximian.com>
10384 * codegen.cs (EmitContext.IsGeneric): Removed.
10386 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
10387 ResolveGeneric() on the DeclSpace.
10389 2003-11-16 Martin Baulig <martin@ximian.com>
10391 * generic.cs (TypeArguments.Resolve):
10392 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
10393 `ResolveType()' on it to get the Type.
10395 2003-11-15 Martin Baulig <martin@ximian.com>
10397 * generic.cs (ConstructedType.GetInterfaces): Override this.
10399 2003-11-14 Martin Baulig <martin@ximian.com>
10401 * interface.cs (Interface.DefineType): Define all type parameters
10402 before adding the interfaces we inherit.
10404 2003-11-11 Martin Baulig <martin@ximian.com>
10406 * generic.cs (ConstructedType.ResolveType): Always call
10407 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
10409 2003-11-10 Martin Baulig <martin@ximian.com>
10411 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10412 (TypeManager.InitCoreTypes): Initialize them here, but instead of
10413 calling `ResolveType()' on them, directly assign their `Type'.
10415 2003-11-08 Martin Baulig <martin@ximian.com>
10417 * generic.cs (ConstructedType): Override `IsClass' etc.
10419 2003-11-08 Martin Baulig <martin@ximian.com>
10421 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10422 return value and the `out parent' parameter.
10423 (TypeContainer.DefineType): Moved the CS0644 check into
10424 GetClassBases(). Don't pass the interface types to the
10425 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10426 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10428 * ecore.cs (TypeExpr.IsAttribute): New property.
10429 (TypeExpr.GetInterfaces): New method.
10431 * interface.cs (Interface.GetInterfaceTypeByName): Return a
10432 TypeExpr instead of a Type.
10433 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10434 (Interface.DefineType): Don't pass the interface types to the
10435 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10436 them later and then call `TypeBulider.AddInterfaceImplementation()'.
10438 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10439 instead of a `Type[]'.
10440 (TypeManager.RegisterBuilder): Likewise.
10441 (TypeManager.AddUserInterface): Likewise.
10442 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10443 `Type[]' and also return a `TypeExpr[]'.
10444 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10446 2003-11-08 Martin Baulig <martin@ximian.com>
10448 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10451 2003-11-08 Martin Baulig <martin@ximian.com>
10453 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10454 TypeManager.ResolveExpressionTypes().
10456 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10457 instead of an Expression.
10458 (TypeExpr): This is now an abstract base class for `TypeExpression'.
10459 (TypeExpression): New public class; formerly known as `TypeExpr'.
10461 * expression.cs (ComposedCast): Derive from TypeExpr.
10463 * typemanager.cs (TypeManager.system_*_expr): These are now
10464 TypExpr's instead of Expression's.
10465 (TypeManager.ResolveExpressionTypes): New public static function;
10466 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10469 2003-11-06 Miguel de Icaza <miguel@ximian.com>
10471 * expression.cs (New.DoResolve): Do not dereference value that
10472 might be a null return.
10474 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10475 sure that the constant value has the right type. Fixes an
10476 unreported bug, similar to 50425.
10478 * const.cs (Const.LookupConstantValue): Call
10479 ImplicitStandardConversionExists before doing a conversion to
10480 avoid havng the TypeManager.ChangeType do conversions.
10482 Reduced the number of casts used
10484 (Const.ChangeType): New routine to enable reuse of the constant
10485 type changing code from statement.
10487 * typemanager.cs (ChangeType): Move common initialization to
10488 static global variables.
10492 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10493 every value type to go through, even if it was void. Fix that.
10495 * cs-tokenizer.cs: Use is_identifier_start_character on the start
10496 character of the define, and the is_identifier_part_character for
10497 the rest of the string.
10499 2003-11-05 Miguel de Icaza <miguel@ximian.com>
10501 * expression.cs (UnaryMutator.EmitCode): When I updated
10502 LocalVariableReference.DoResolve, I overdid it, and dropped an
10503 optimization done on local variable references.
10505 2003-11-04 Miguel de Icaza <miguel@ximian.com>
10507 * ecore.cs: Convert the return from Ldlen into an int.
10509 2003-10-20 Miguel de Icaza <miguel@ximian.com>
10511 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10512 the accessibility, this is a special case for toplevel non-public
10513 classes (internal for instance).
10515 2003-10-20 Nick Drochak <ndrochak@gol.com>
10517 * ecore.cs: Fix typo and build. Needed another right paren.
10519 2003-10-19 Miguel de Icaza <miguel@ximian.com>
10521 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
10522 `internal' case regular and protected, but not allowing protected
10523 to be evaluated later. Bug 49840
10525 2003-10-15 Miguel de Icaza <miguel@ximian.com>
10527 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10528 to kb.Nlast, and not the kb.nFirst to isolate the switch
10531 Extract the underlying type, so enumerations of long/ulong are
10532 treated like long/ulong.
10534 2003-10-14 Miguel de Icaza <miguel@ximian.com>
10536 * expression.cs (New): Overload the meaning of RequestedType to
10537 track the possible creation of the NewDelegate type, since
10538 DoResolve is invoked more than once for new constructors on field
10541 See bugs: #48800 and #37014
10543 * cs-parser.jay (declare_local_constants): Take an arraylist
10544 instead of a single constant.
10546 (local_constant_declaration): It should take a
10547 constant_declarators, not a constant_declarator. Fixes 49487
10549 * convert.cs: Fix error report.
10551 2003-10-13 Jackson Harper <jackson@ximian.com>
10553 * typemanager.cs (TypeToCoreType): Add float and double this fixes
10556 2003-11-03 Martin Baulig <martin@ximian.com>
10558 * expression.cs (ArrayAccess.GetStoreOpcode): Added
10559 `out bool has_type_arg'; if set, we need to pass the type to
10561 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
10562 Stelem_Any/Ldelem_Any for generic parameters.
10564 2003-11-02 Martin Baulig <martin@ximian.com>
10566 * expression.cs (Invocation.EmitCall): Use
10567 `TypeManager.IsValueType()' to check whether it's a value type.
10568 Don't set `struct_call' when calling a method on a type parameter.
10570 2003-11-02 Martin Baulig <martin@ximian.com>
10572 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
10573 and removed the TypeBuilder argument.
10575 * typemanager.cs (TypeManager.IsValueType): Return
10576 `t.IsGenericParameter || t.IsValueType'.
10578 2003-10-25 Martin Baulig <martin@ximian.com>
10580 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
10581 call ConstructedType.Resolve() on it.
10583 * generic.cs (ConstructedType.Resolve): Set `type' on success.
10585 2003-10-25 Martin Baulig <martin@ximian.com>
10587 * class.cs (TypeContainer.GetClassBases): Changed
10588 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
10589 CS8214 reporting here.
10590 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
10591 instead of a `Type' for our parent. In case of a recursive
10592 declaration (see tests/gen-23.cs for an example), our parent is a
10593 ConstructedType and it doesn't have its type set. So, first
10594 create our own TypeBuilder, then call constructed.Resolve() to get
10595 the parent's type and finally TypeBuilder.SetParent() it.
10597 * ecore.cs (TypeExpr.Name): New public virtual property.
10600 (ConstructedType): We're now a TypeExpr and not just an Expression.
10601 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
10602 arguments here; this is done later.
10603 (ConstructedType.Resolve): New public method to resolve the type
10604 arguments and bind them.
10606 2003-10-21 Martin Baulig <martin@ximian.com>
10608 * convert.cs: Use `TypeManager.IsValueType' instead of
10609 'type.IsValueType' everywhere.
10611 * typemanager.cs (TypeManager.IsValueType): Return true for type
10612 parameters. The reason for this is that we need to box a type
10613 parameter when converting it to a reference type.
10615 * cs-parser.jay: Added support for default value expressions.
10617 * generics.cs (DefaultValueExpression): New public class.
10619 2003-10-17 Martin Baulig <martin@ximian.com>
10621 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
10622 TypeContainer so we can also use this for Interfaces.
10623 (TypeParameter.Resolve): Likewise.
10625 * interface.cs (Interface.DefineType): Added support for generic
10628 * cs-parser.jay: Added support for generic structs and interfaces.
10630 2003-10-17 Martin Baulig <martin@ximian.com>
10632 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
10633 call generic methods :-)
10635 2003-10-16 Martin Baulig <martin@ximian.com>
10637 * cs-parser.jay (namespace_or_type_name): Only create a
10638 GenericMemberAccess if we actually have type arguments.
10640 2003-10-13 Martin Baulig <martin@ximian.com>
10642 * class.cs (Method.Define): If we're a generic method, call
10643 TypeBuilder.DefineGenericMethod () before resolving
10645 (MethodData): Added .ctor which takes an additional MethodBuilder
10646 argument; this is used for generic methods.
10647 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
10648 we already have a MethodBuilder.
10650 2003-10-10 Martin Baulig <martin@ximian.com>
10652 * class.cs (Method): Added .ctor which takes a `GenericMethod'
10653 instead of a `DeclSpace'. This is used for generic methods.
10655 * cs-parser.jay (method_header): Added support for generic
10656 methods; create a `GenericMethod' instance and pass it to the
10657 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
10658 parameters and locals.
10660 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
10661 since we already have the location. Check whether we're a generic
10662 type declaration or a generic method and create the correct type
10665 * generic.cs (TypeParameter.DefineMethod): New public method.
10666 (GenericMethod): New public class; derives from DeclSpace and is
10667 used for generic methods.
10669 2003-10-09 Martin Baulig <martin@ximian.com>
10671 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10673 (MethodCore.DoDefineParameters): Removed the TypeContainer
10674 argument; use the DeclSpace which was passed to the .ctor instead.
10675 (MethodCore.CheckParameter): Take a DeclSpace instead of a
10676 TypeContainer; we only need a DeclSpace here.
10678 2003-10-09 Martin Baulig <martin@ximian.com>
10680 * class.cs (MethodData): Added additional `DeclSpace ds' argument
10682 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10683 EmitContext's .ctor.
10685 2003-10-09 Martin Baulig <martin@ximian.com>
10687 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10688 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10689 AsAccessible(), moved them as well.
10691 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10693 2003-10-07 Miguel de Icaza <miguel@ximian.com>
10695 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10696 generation for >=, as spotted by Paolo, bug 48679.
10697 Patch from David Waite.
10699 * cs-tokenizer.cs: Add handling for #pragma.
10701 * cs-parser.jay: Allow for both yield and yield return in the
10702 syntax. The anti-cobolization of C# fight will go on!
10704 * class.cs (TypeBuilder.DefineType): Catch error condition here
10705 (Parent.DefineType erroring out and returning null).
10707 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10708 coping with enumerations variables, we were mistakenly processing
10709 them as a regular value type instead of built-in types. Fixes the
10712 * typemanager.cs (IsBuiltinOrEnum): New method.
10714 2003-09-30 Miguel de Icaza <miguel@ximian.com>
10716 * cs-parser.jay: Upgrade: yield now needs the return clause.
10718 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10720 * cs-parser.jay : Renamed yyName to yyNames related to jay.
10722 2003-09-29 Martin Baulig <martin@ximian.com>
10724 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10725 inflated generic methods.
10727 * generics.cs (ConstructedType): Distinguish between open and
10728 closed constructed types; correctly resolve the arguments.
10730 2003-09-22 Martin Baulig <martin@ximian.com>
10732 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10733 all type arguments meet their constraints.
10735 2003-09-19 Martin Baulig <martin@ximian.com>
10737 * decl.cs (MemberCache.SetupCacheForInterface): Take a
10738 `MemberCache parent' argument. Normally, an interface doesn't
10739 have a parent type except System.Object, but we use this in gmcs
10740 for generic type parameters.
10742 2003-09-18 Martin Baulig <martin@ximian.com>
10744 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10745 on `type.IsInterface'; don't check whether the type has a parent
10746 to determine whether it's an interface.
10748 2003-09-17 Martin Baulig <martin@ximian.com>
10750 * generic.cs (ConstructedType.ToString): Always use `name' as the
10753 2003-09-15 Martin Baulig <martin@ximian.com>
10755 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10757 * generic.cs (Constraints.Resolve): New public method; this is
10758 called to resolve the constraint types and to check whether all
10759 the constraints are correct.
10760 (Constraints.Types): New public property.
10761 (TypeParameter.Resolve): New public method; resolves all the
10762 type's constraints.
10764 * class.cs (TypeContainer.DefineType): Call
10765 TypeParameter.Resolve() before actually defining the type.
10767 2003-09-15 Martin Baulig <martin@ximian.com>
10769 * class.cs (TypeContainer.DefineType): Added an error flag to
10770 avoid reporting duplicate CS0146's ("class definition is
10773 * driver.cs (Driver.MainDriver): Abort if
10774 RootContext.ResolveTree() reported any errors.
10776 2003-09-07 Martin Baulig <martin@ximian.com>
10778 * report.cs (Error, Warning): Added overloaded versions which take
10779 a `params object[] args' and call String.Format().
10781 2003-09-07 Martin Baulig <martin@ximian.com>
10783 * decl.cs (DeclSpace..ctor): Don't call
10784 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10785 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
10786 (DeclSpace.RecordDecl): New method.
10788 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10790 2003-09-02 Ravi Pratap <ravi@ximian.com>
10792 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10793 value attributes to be applied to ParameterBuilders.
10795 * class.cs (MethodCore.LabelParameters): Make static and more
10796 generic so that it can be used from other places - like interface
10797 methods, for instance.
10799 * interface.cs (Interface.Emit): Call LabelParameters before
10800 emitting attributes on the InterfaceMethod.
10802 2003-09-07 Martin Baulig <martin@ximian.com>
10804 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10805 if the number of type parameters doesn't match.
10807 2003-09-04 Martin Baulig <martin@ximian.com>
10809 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10810 for arrays of generic type params (ie. `!0[]').
10812 2003-09-04 Martin Baulig <martin@ximian.com>
10814 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10817 2003-09-04 Martin Baulig <martin@ximian.com>
10819 * decl.cs (DeclSpace.LookupGeneric): New method.
10820 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10823 * generic.cs (TypeParameterExpr): Take a TypeParameter as
10824 argument, not just a string.
10825 (TypeParameter.Define): New public method; this is called to
10826 actually define the generic parameter; after this, you can use the
10827 new `Type' property to get the type.
10829 2003-09-04 Martin Baulig <martin@ximian.com>
10831 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
10832 is now an ArrayList; initialize the result of the `TypeParameters'
10834 (DeclSpace.GetGenericData): Removed.
10835 (DeclSpace.LookupGeneric): Temporarily removed; we need to
10836 implement this in a different way.
10837 (DeclSpace.GetTypeParameters): Removed; there's now a
10838 `TypeParameters' property.
10839 (DeclSpace.TypeParameters): New public property.
10841 * generic.cs (Constraints): Make this class public.
10842 (TypeParameter): New public class.
10844 2003-09-04 Martin Baulig <martin@ximian.com>
10846 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
10847 generic parameters.
10849 * class.cs (TypeContainer.DefineType): Call
10850 TypeBuilder.DefineGenericParameter () on all generic parameters if
10851 this is a generic type.
10853 2003-08-28 Martin Baulig <martin@ximian.com>
10855 * sample-stack.il: Compile this with ilasm: "ilasm /dll
10858 * sample-hello.cs: Compile this with gmcs: "gmcs
10859 /r:sample-stack.dll sample-hello.cs".
10861 2003-08-28 Martin Baulig <martin@ximian.com>
10863 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
10864 the parameters to the generic type.
10866 2003-08-28 Martin Baulig <martin@ximian.com>
10868 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
10870 2003-08-28 Martin Baulig <martin@ximian.com>
10872 * cs-parser.jay (opt_type_argument_list): Use
10873 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
10874 (primary_expression): Replace `qualified_identifier' with `type_name'.
10875 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
10877 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
10878 parser to check whether it is syntactically a type parameter list;
10879 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
10882 2003-08-26 Martin Baulig <martin@ximian.com>
10884 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10885 resolving aliases; fixes #47927.
10887 2003-08-26 Martin Baulig <martin@ximian.com>
10889 * statement.cs (Using.DoResolve): This is internally emitting a
10890 try/finally clause, so we need to set ec.NeedExplicitReturn if we
10891 do not always return. Fixes #47681.
10893 2003-08-26 Martin Baulig <martin@ximian.com>
10895 * decl.cs (MemberCore): Moved WarningNotHiding(),
10896 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10898 (AdditionResult): Make this nested in DeclSpace.
10899 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10900 argument; call NamespaceEntry.Define() unless we're nested in a
10903 * namespace.cs (Namespace.DefineName): New public function. This
10904 is called from DeclSpace's .ctor to add
10905 (Namespace.Lookup): Include DeclSpaces in the lookup.
10907 * class.cs (Operator): Derive from MemberBase, not MemberCore.
10909 * const.cs (Const): Derive from MemberBase, not MemberCore.
10911 2003-08-25 Martin Baulig <martin@ximian.com>
10913 * convert.cs (Convert.ExplicitReferenceConversion): When
10914 converting from an interface type to a class, unbox if the target
10915 type is a struct type. Fixes #47822.
10917 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10919 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10922 2003-08-22 Martin Baulig <martin@ximian.com>
10924 * class.cs (TypeManager.DefineType): When defining a nested type,
10925 call DefineType() on our parent; fixes #47801.
10927 2003-08-22 Martin Baulig <martin@ximian.com>
10929 * class.cs (MethodData.Define): While checking if a method is an
10930 interface implementation, improve the test a bit more to fix #47654.
10932 2003-08-22 Martin Baulig <martin@ximian.com>
10934 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10935 correctly; fixes #47722.
10937 2003-08-22 Martin Baulig <martin@ximian.com>
10939 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10940 LocalVariableReference, ensure it's not read-only. Fixes #47536.
10942 * statement.cs (Fixed.DoResolve): Make all variables read-only.
10944 2003-08-22 Martin Baulig <martin@ximian.com>
10946 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10947 can only be assigned in static constructors. Fixes #47161.
10949 2003-08-22 Martin Baulig <martin@ximian.com>
10951 Rewrote and improved the flow analysis code.
10953 * flowbranching.cs (FlowBranching): Make this class abstract.
10954 (FlowBranching.CreateBranching): New static function to create a
10955 new flow branching.
10956 (FlowBranchingBlock, FlowBranchingException): New classes.
10957 (FlowBranching.UsageVector.Type): New public readonly field.
10958 (FlowBranching.UsageVector.Breaks): Removed the setter.
10959 (FlowBranching.UsageVector.Returns): Removed the setter.
10960 (FlowBranching.UsageVector): Added Break(), Return(),
10961 NeverReachable() and Throw() methods to modify the reachability.
10962 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10963 done by FlowBranching.Merge().
10964 (FlowBranching.UsageVector.MergeChild): New method; merges the
10965 merge result into the current vector.
10966 (FlowBranching.Merge): New abstract method to merge a branching.
10968 2003-08-12 Martin Baulig <martin@ximian.com>
10970 * expression.cs (Indirection.CacheTemporaries): Create the
10971 LocalTemporary with the pointer type, not its element type.
10973 2003-08-10 Miguel de Icaza <miguel@ximian.com>
10975 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10976 token was a keyword or not.
10978 Add `error' options where an IDENTIFIER was expected; Provide
10979 CheckToken and CheckIdentifierToken convenience error reporting
10982 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10984 * decl.cs: Rename `NamespaceEntry Namespace' public field into
10985 NameSpaceEntry NameSpaceEntry.
10987 (LookupInterfaceOrClass): Avoid creating a full qualified name
10988 from namespace and name: avoid doing lookups when we know the
10989 namespace is non-existant. Use new Tree.LookupByNamespace which
10990 looks up DeclSpaces based on their namespace, name pair.
10992 * driver.cs: Provide a new `parser verbose' to display the
10993 exception thrown during parsing. This is turned off by default
10994 now, so the output of a failure from mcs is more graceful.
10996 * namespace.cs: Track all the namespaces defined in a hashtable
10999 (IsNamespace): New method
11001 2003-08-09 Miguel de Icaza <miguel@ximian.com>
11003 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
11004 we know that we need to concatenate (full typename can never be
11009 * statement.cs: Use a bitfield; Do not initialize to null things
11010 which are done by the constructor by default.
11012 * cs-parser.jay: bug fix, parameter was 4, not 3.
11014 * expression.cs: Just use the property;
11016 * statement.cs: No need for GetVariableInfo method.
11018 2003-08-08 Martin Baulig <martin@ximian.com>
11020 * flowanalysis.cs (FlowReturns): This is now nested in the
11021 `FlowBranching' class.
11022 (MyBitVector): Moved this here from statement.cs.
11023 (FlowBranching.SiblingType): New enum type.
11024 (FlowBranching.CreateSibling): Added `SiblingType' argument.
11026 2003-08-07 Martin Baulig <martin@ximian.com>
11028 * flowanalysis.cs (FlowBranchingType): This is now nested in the
11029 `FlowBranching' class and called `BranchingType'.
11031 2003-08-07 Martin Baulig <martin@ximian.com>
11033 * flowanalysis.cs: Moved all the control flow analysis code into
11036 2003-08-07 Martin Baulig <martin@ximian.com>
11038 * assign.cs (Assign.DoResolve): `target' must either be an
11039 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
11042 2003-08-07 Miguel de Icaza <miguel@ximian.com>
11044 * expression.cs (BinaryMethod): This kind of expression is created by the
11045 Binary class if it determines that the operator has to be handled
11048 (BinaryDelegate): This kind of expression is created if we are
11049 dealing with a + or - operator on delegates.
11051 (Binary): remove method, argumetns, and DelegateOperator: when
11052 dealing with methods,
11054 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11056 * statement.cs (Block): use bitfields for the three extra booleans
11057 we had in use. Remove unused topblock parameter.
11059 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11061 * assign.cs: Drop extra unneeded tests.
11063 2003-08-06 Miguel de Icaza <miguel@ximian.com>
11065 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11067 * statement.cs (Foreach): Use VariableStorage instead of
11070 * codegen.cs (VariableStorage): New class used by clients that
11071 require a variable stored: locals or fields for variables that
11072 need to live across yield.
11074 Maybe provide a convenience api for EmitThis+EmitLoad?
11076 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11079 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11081 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11082 RemapParameterLValue): New methods that are used to turn a
11083 precomputed FieldInfo into an expression like this:
11087 The idea is to use this instead of making LocalVariableReference
11088 have more than one meaning.
11090 * cs-parser.jay: Add error production to BASE.
11092 * ecore.cs: Deal with TypeManager.GetField returning null, which
11093 is now a valid return value.
11095 (FieldExprNoAddress): New expression for Fields whose address can
11098 * expression.cs (LocalVariableReference): During the resolve
11099 phases, create new expressions if we are in a remapping context.
11100 Remove code that dealt with remapping here.
11102 (ParameterReference): same.
11104 (ProxyInstance): New expression, like the `This' expression, but
11105 it is born fully resolved. We know what we are doing, so remove
11106 the errors that are targeted to user-provided uses of `this'.
11108 * statement.cs (Foreach): our variable is now stored as an
11109 Expression; During resolution, follow the protocol, dont just
11110 assume it will return this.
11112 2003-08-06 Martin Baulig <martin@ximian.com>
11114 * support.cs (SeekableStreamReader.cs): New public class.
11116 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11117 SeekableStreamReader instead of the normal StreamReader.
11119 2003-08-04 Martin Baulig <martin@ximian.com>
11121 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11122 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11123 deambiguate casts and delegate invocations.
11124 (parenthesized_expression): Use the new tokens to ensure this is
11125 not a cast of method invocation.
11127 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11128 when reading a `)' and Deambiguate_CloseParens () was previously
11131 * expression.cs (ParenthesizedExpression): New class. This is
11132 just used for the CS0075 test.
11133 (Binary.DoResolve): Check for CS0075.
11135 2003-07-29 Ravi Pratap <ravi@ximian.com>
11137 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11138 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11139 reference comparison.
11141 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11142 examine the ReturnType for equality - this is necessary in the
11143 cases of implicit and explicit operators whose signature also
11144 includes the return type.
11146 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11148 * namespace.cs: Cache the result of the namespace computation,
11149 instead of computing it every time.
11151 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11153 * decl.cs: Use a global arraylist that we reuse over invocations
11154 to avoid excesive memory consumption. Reduces memory usage on an
11155 mcs compile by one meg (45 average).
11157 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11158 private, work around that.
11160 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11162 * literal.cs (IntLiteral): Define Zero and One static literals.
11164 * cs-parser.jay (integer_literal): use static literals to reduce
11165 memory usage for the most used literals (0, 1 and -1). 211kb
11166 reduced in memory usage.
11168 Replace all calls to `new ArrayList' with `new
11169 ArrayList(4)' which is a good average number for most allocations,
11170 and also requires only 16 bytes of memory for its buffer by
11173 This reduced MCS memory usage in seven megabytes for the RSS after
11176 2003-07-28 Ravi Pratap <ravi@ximian.com>
11178 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11179 handle params methods the correct way by forming only one
11180 applicable set with params and normal methods in them. Earlier we
11181 were looking at params methods only if we found no normal methods
11182 which was not the correct thing to do.
11184 (Invocation.BetterFunction): Take separate arguments indicating
11185 when candidate and the best method are params methods in their
11188 This fixes bugs #43367 and #46199.
11190 * attribute.cs: Documentation updates.
11192 (CheckAttribute): Rename to CheckAttributeTarget.
11193 (GetValidPlaces): Rename to GetValidTargets.
11195 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11196 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11200 2003-07-28 Miguel de Icaza <miguel@ximian.com>
11202 * codegen.cs: Compute IsGeneric correctly.
11204 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
11207 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
11208 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
11209 regressions, and I was chasing more bugs than I required.
11211 * interface.cs: Use expressions for base type names (like classes
11212 and structs have been doing for a while now), and resolve that.
11213 This patch should probably go into head as well.
11215 This makes it one less user of FindType.
11217 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11219 This compiler can not self host currently. Need to fix that.
11221 * Makefile: compile to `gmcs.exe'
11223 * driver.cs: Turn on v2 by default on gmcs.
11225 * generic.cs (ConstructedType): Does no longer take a container
11226 type argument; That will be taken care of later.
11228 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
11229 Use SimpleName to resolve for now, so we can continue the work on
11230 the parser, until we get Type.GetType that understands generics.
11232 (ConstructedType.ToString): Implement
11234 (TypeArguments.Resolve): Resolve the child expressions as types.
11236 * cs-parser.jay: Rename interface_constraints to
11237 type_parameter_constraints
11239 (namespace_or_type_name): Only use constructed types for the basic
11240 construction, we will deal with identifier<...> later.
11242 (type/type_name): No longer call DecomposeQI, as
11243 namespace_or_type_name is always decoded now.
11245 2003-07-22 Ravi Pratap <ravi@ximian.com>
11247 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11248 closely: we eliminate methods in base types when we have an
11249 applicable method in a top-level type.
11251 Please see section 14.5.5.1 for an exact description of what goes
11254 This fixes bug #45127 and a host of other related to corlib compilation.
11256 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11257 array is the method corresponding to the top-level type (this is
11258 because of the changes made to icall.c) so we change this
11261 (MethodGroupExpr.Name): This too.
11263 * typemanager.cs (GetElementType): New method which does the right
11264 thing when compiling corlib.
11266 * everywhere: Make use of the above in the relevant places.
11268 2003-07-22 Martin Baulig <martin@ximian.com>
11270 * cs-parser.jay (invocation_expression): Moved
11271 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11272 `cast_expression', but create a InvocationOrCast which later
11273 resolves to either an Invocation or a Cast.
11275 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11276 method; call this before EmitStatement() to make sure that this
11277 expression can be used as a statement.
11279 * expression.cs (InvocationOrCast): New class; resolves to either
11280 an Invocation or a Cast.
11282 * statement.cs (StatementExpression): Call ResolveStatement() on
11283 the ExpressionStatement before emitting it.
11285 2003-07-21 Martin Baulig <martin@ximian.com>
11287 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11288 `ref' and `out' attributes match; fixes #46220.
11289 (MemberAccess.ResolveMemberAccess): You can't reference a type
11290 through an expression; fixes #33180.
11291 (Indexers.GetIndexersForType): Don't return the indexers from
11292 interfaces the class implements; fixes #46502.
11294 2003-07-21 Martin Baulig <martin@ximian.com>
11296 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11297 CS0661 checks; fixes bug #30442.
11299 2003-07-21 Martin Baulig <martin@ximian.com>
11301 * decl.cs (AdditionResult): Added `Error'.
11303 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11305 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
11306 cs0031.cs actually work.
11308 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11310 * cs-parser.jay (namespace_name): do not use
11311 namespace_or_type_name, use qualified_identifier, because
11312 namespace_or_type_name will soon return a composed expression
11313 instead of a string.
11315 (namespace_or_type_name): Instead of returning a string, now this
11316 production returns an expression.
11318 * codegen.cs (EmitContext): Setup IsGeneric property based on
11319 whether our DeclSpace is generic, our the method is generic.
11321 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
11322 the method is generic.
11324 * cs-parser.jay (type_arguments, opt_type_argument_list,
11325 type_parameters, type_parameter_list, opt_type_parameter_list,
11326 type_parameter,, opt_type_parameter_constraints_clauses,
11327 type_parameter_constraints_clauses,
11328 type_parameter_constraint_clause, type_parameter_constraint,
11329 interface_constraints): Add new production
11331 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
11332 DeclSpace is generic or not.
11334 (DeclSpace.SetParameterInfo): New routine, used to set the
11335 parameter info for a type.
11337 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
11338 returns a GenericTypeExpr
11340 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
11341 generic, lookup the generic argument.
11343 * attribute.cs: Do not allow TypeParameterExpressions in
11346 * class.cs: Do not allow the Main method to be defined in a
11349 * expression.cs (SizeOf): Do not allow generic types to be used as
11350 arguments to sizeof.
11352 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
11353 it: whether a type is generic or not. Only works for types we are
11354 currently building for now.
11356 2003-07-20 Martin Baulig <martin@ximian.com>
11358 * namespace.cs: Fixed that bug which caused a crash when compiling
11359 the debugger's GUI.
11361 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11363 * typemanager.cs (LookupTypeReflection): Never expose types which
11364 are NotPublic, NestedPrivate, NestedAssembly, or
11365 NestedFamANDAssem. We used to return these, and later do a check
11366 that would report a meaningful error, but the problem is that we
11367 would not get the real match, if there was a name override.
11369 2003-07-18 Miguel de Icaza <miguel@ximian.com>
11371 * namespace.cs (Namespace, Name): Do not compute the namespace
11372 name dynamically, compute it in the constructor. This reduced
11373 memory usage by 1697 KB.
11375 * driver.cs: Use --pause to pause at the end.
11377 2003-07-17 Peter Williams <peter@newton.cx>
11379 * Makefile: Change the name of the test target so that it doesn't
11380 conflict with the recursive test target.
11382 2003-07-17 Miguel de Icaza <miguel@ximian.com>
11384 * expression.cs (LocalVariableReference.Emit, EmitAssign,
11385 AddressOf): Do not use EmitThis, that was wrong, use the actual
11388 2003-07-15 Miguel de Icaza <miguel@ximian.com>
11390 * class.cs (MethodData.Define): While checking if a method is an
11391 interface implementation, improve the test: If we are not public
11392 (use new test here: use the computed MethodAttributes directly,
11393 instead of the parsed modifier flags) check if the `implementing'
11394 method comes from an interface or not.
11396 * pending.cs (VerifyPendingMethods): Slightly better error
11399 * makefile: add test target that does the mcs bootstrap.
11401 2003-07-16 Ravi Pratap <ravi@ximian.com>
11403 * interface.cs (Define): Do nothing here since there are no
11404 members to populate etc. Move the attribute emission out of here
11405 since this was just totally the wrong place to put it. Attribute
11406 application happens during the 'Emit' phase, not in the 'Define'
11409 (Emit): Add this method and move the attribute emission here
11411 * rootcontext.cs (EmitCode): Call the Emit method on interface
11414 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11416 * expression.cs (OverloadResolve): Report error only if Location
11417 is not 'Null' which means that there was a probe going on.
11419 2003-07-14 Martin Baulig <martin@ximian.com>
11421 * expression.cs (ConditionalLogicalOperator): New public class to
11422 implement user defined conditional logical operators.
11423 This is section 14.11.2 in the spec and bug #40505.
11425 2003-07-14 Martin Baulig <martin@ximian.com>
11427 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11429 2003-07-14 Martin Baulig <martin@ximian.com>
11431 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11433 * ecore.cs (IVariable.VerifyFixed): New interface method.
11435 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11436 operator, check whether the variable is actually fixed. Fixes bug
11437 #36055. Set a variable definitely assigned when taking its
11438 address as required by the spec.
11440 * statement.cs (LocalInfo.IsFixed): New field.
11441 (LocalInfo.MakePinned): Set `IsFixed' to true.
11443 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11445 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11446 for .ctors, ensure that we only ask for members declared in the
11447 attribute type (BindingFlags.DeclaredOnly).
11451 * expression.cs (Error_WrongNumArguments): Report error 1501
11452 correctly the way CSC does.
11454 2003-07-13 Martin Baulig <martin@ximian.com>
11456 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11457 lookup on the fully qualified name, to make things like "X.X" work
11458 where "X.X" is a fully qualified type name, but we also have a
11459 namespace "X" in the using list. Fixes #41975.
11461 2003-07-13 Martin Baulig <martin@ximian.com>
11463 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11464 function. If we're a CompoundAssign, we need to create an embedded
11465 CompoundAssign, not an embedded Assign.
11466 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11469 2003-07-13 Martin Baulig <martin@ximian.com>
11471 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11472 work to fix bug #46088.
11474 2003-07-13 Ravi Pratap <ravi@ximian.com>
11476 * class.cs (Operator.Emit): Do not emit attributes here - it is
11477 taken care of by the Method class that we delegate too. This takes
11478 care of bug #45876.
11480 2003-07-10 Martin Baulig <martin@ximian.com>
11482 * expression.cs (TypeOfVoid): New class.
11483 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
11485 2003-07-10 Martin Baulig <martin@ximian.com>
11487 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11490 2003-07-10 Martin Baulig <martin@ximian.com>
11492 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11493 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11495 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11497 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11499 2003-07-10 Martin Baulig <martin@ximian.com>
11501 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11502 of decimal. Fixes #42850.
11504 NOTE: I also fixed the created byte blob, but this doesn't work on
11505 the MS runtime and csc never produces any byte blobs for decimal
11508 2003-07-10 Martin Baulig <martin@ximian.com>
11510 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11511 structs; fixes #32068.
11512 (Block.AddChildVariableNames): Fixed #44302.
11514 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11516 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11518 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11520 * attribute.cs: And this test is onger needed.
11522 2003-07-08 Martin Baulig <martin@ximian.com>
11524 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11525 inaccessible types. Fixes #36313.
11527 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11529 * namespace.cs (NamespaceEntry): Create implicit entries for all
11530 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11531 implicit entries for N1.N2 and N1.
11533 2003-07-08 Martin Baulig <martin@ximian.com>
11535 Rewrote the handling of namespaces to fix a lot of the issues
11536 wrt. `using' aliases etc.
11538 * namespace.cs (Namespace): Splitted this class into a
11539 per-assembly `Namespace' and a per-file `NamespaceEntry'.
11541 * typemanager.cs (TypeManager.IsNamespace): Removed.
11542 (TypeManager.ComputeNamespaces): Only compute namespaces from
11543 loaded assemblies here, not the namespaces from the assembly we're
11544 currently compiling.
11546 2003-07-08 Martin Baulig <martin@ximian.com>
11548 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11550 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11552 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11555 I thought about the memory savings here, but LookupTypeReflection
11556 is used under already very constrained scenarios. Compiling
11557 corlib or mcs only exposes one hit, so it would not really reduce
11558 any memory consumption.
11560 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11562 * typemanager.cs: fixes bug #45889 by only adding public types from
11563 other assemblies to the list of known types.
11565 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11567 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11568 on the type we resolved.
11570 2003-07-05 Martin Baulig <martin@ximian.com>
11572 * pending.cs (PendingImplementation.ParentImplements): Don't
11573 create the proxy if the parent is abstract.
11575 * class.cs (TypeContainer.DefineIndexers): Process explicit
11576 interface implementations first. Fixes #37714.
11578 2003-07-04 Miguel de Icaza <miguel@ximian.com>
11580 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11581 defined recursively; but since we modify the input parameters
11582 (left is set to `this' temporarily), we reset this value if the
11583 left_is_explicit is false, which gives the original semantics to
11586 * literal.cs (NullPointer): new class used to represent a null
11587 literal in a pointer context.
11589 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11590 type is a pointer, use a NullPointer object instead of a
11591 NullLiteral. Closes 43687
11593 (ExplicitConversion): Convert pointer values using
11594 the conv opcode to the proper type.
11596 * ecore.cs (New): change ValueTypeVariable property into a method,
11597 that returns whether the valuetype is suitable for being used.
11599 * expression.cs (Binary.DoNumericPromotions): Only return if we
11600 the int constant was a valid uint, and we can return both left and
11601 right as uints. If not, we continue processing, to trigger the
11602 type conversion. This fixes 39018.
11604 * statement.cs (Block.EmitMeta): During constant resolution, set
11605 the CurrentBlock property on the emitcontext, so that we resolve
11606 constants propertly.
11608 2003-07-02 Martin Baulig <martin@ximian.com>
11610 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11611 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11613 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11614 than emitting it here.
11616 * statement.cs: Fixed some more flow analysis bugs.
11618 2003-07-02 Martin Baulig <martin@ximian.com>
11620 * class.cs (MethodData.Define): When implementing interface
11621 methods, set Final unless we're Virtual.
11623 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11624 check work for interface methods.
11626 2003-07-01 Martin Baulig <martin@ximian.com>
11628 * ecore.cs (EmitContext.This): Replaced this property with a
11629 GetThis() method which takes a Location argument. This ensures
11630 that we get the correct error location for a CS0188.
11632 2003-07-01 Miguel de Icaza <miguel@ximian.com>
11634 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11635 ImplicitStandardConversion.
11637 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11639 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
11641 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11644 2003-06-30 Miguel de Icaza <miguel@ximian.com>
11646 * class.cs (Constructor.Define): Turn off initlocals for unsafe
11649 (MethodData.Define): Turn off initlocals for unsafe methods.
11651 2003-06-29 Miguel de Icaza <miguel@ximian.com>
11653 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11654 complete; Fixes #37521.
11656 * delegate.cs: Use Modifiers.TypeAttr to compute the
11657 TypeAttributes, instead of rolling our own. This makes the flags
11658 correct for the delegates.
11660 2003-06-28 Miguel de Icaza <miguel@ximian.com>
11662 * class.cs (Constructor.Define): Set the private flag for static
11663 constructors as well.
11665 * cs-parser.jay (statement_expression): Set the return value to
11666 null, to avoid a crash when we catch an error.
11668 2003-06-24 Miguel de Icaza <miguel@ximian.com>
11670 * cs-parser.jay: Applied patch from Jackson that adds support for
11671 extern and unsafe modifiers to destructor declarations.
11673 * expression.cs: Report error 21 if the user is trying to index a
11676 * driver.cs: Add an error message, suggested by the bug report.
11678 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11679 if we do not have a ": this ()" constructor initializer. Fixes 45149
11681 2003-06-14 Miguel de Icaza <miguel@ximian.com>
11683 * namespace.cs: Add some information to reduce FAQs.
11685 2003-06-13 Miguel de Icaza <miguel@ximian.com>
11687 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11688 underlying enumeration types. Fixes #43915.
11690 * expression.cs: Treat ushort/short as legal values to be used in
11691 bitwise operations.
11693 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11695 * delegate.cs: transfer custom attributes for paramenters from
11696 the delegate declaration to Invoke and BeginInvoke.
11698 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11700 * attribute.cs: handle custom marshalers and emit marshal info
11703 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
11705 * makefile.gnu: Added anonymous.cs to the compiler sources.
11707 2003-05-28 Miguel de Icaza <miguel@ximian.com>
11709 * iterators.cs: Change the name of the proxy class to include two
11712 * cs-parser.jay: Update grammar to include anonymous methods.
11714 * anonymous.cs: new file.
11716 2003-05-27 Miguel de Icaza <miguel@ximian.com>
11718 * class.cs (Field.Define): Add missing test for pointers and
11721 2003-05-27 Ravi Pratap <ravi@ximian.com>
11723 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11724 we use the stobj opcode.
11726 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11727 since it wasn't the correct fix.
11729 It still is puzzling that we are required to use stobj for IntPtr
11730 which seems to be a ValueType.
11732 2003-05-26 Miguel de Icaza <miguel@ximian.com>
11734 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11735 during regular simple name resolution. Now, the trick is that
11736 instead of returning for processing the simplename, we do a
11737 TypeManager.LookupType (ie, a rooted lookup as opposed to a
11738 contextual lookup type). If a match is found, return that, if
11739 not, return for further composition.
11741 This fixes long-standing 30485.
11743 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11744 using the address to initialize an object, do an Stobj instead of
11745 using the regular Stelem.
11747 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11748 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11749 Because if we are a BaseIndexerAccess that value will be true.
11752 * statement.cs (GotoCase.Resolve): Return after reporting an
11753 error, do not attempt to continue.
11755 * expression.cs (PointerArithmetic.Emit): If our operand is a
11756 long, convert our constants to match the operand before
11757 multiplying. Convert to I type before adding. Fixes 43670.
11759 2003-05-14 Ravi Pratap <ravi@ximian.com>
11761 * enum.cs (ImplicitConversionExists) : Rename to
11762 ImplicitEnumConversionExists to remove ambiguity.
11764 * ecore.cs (NullCast): New type of cast expression class which
11765 basically is very similar to EmptyCast with the difference being
11766 it still is a constant since it is used only to cast a null to
11768 (eg. (string) null)
11770 * convert.cs (ImplicitReferenceConversion): When casting a null
11771 literal, we return a NullCast.
11773 * literal.cs (NullLiteralTyped): Remove - I don't see why this
11774 should be around anymore.
11776 The renaming (reported was slightly wrong). Corrections:
11778 ConvertImplicitStandard -> ImplicitConversionStandard
11779 ConvertExplicitStandard -> ExplicitConversionStandard
11781 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11782 before passing them in !
11784 * convert.cs (ImplicitConversionStandard): When comparing for
11785 equal expr and target types, ensure that expr is not a
11788 In general, we must not be checking (expr_type ==
11789 target_type) in the top level conversion methods
11790 (ImplicitConversion, ExplicitConversion etc). This checking is
11791 done in the methods that they delegate to.
11793 2003-05-20 Miguel de Icaza <miguel@ximian.com>
11795 * convert.cs: Move Error_CannotConvertType,
11796 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11797 ImplicitNumericConversion, ImplicitConversionExists,
11798 ImplicitUserConversionExists, StandardConversionExists,
11799 FindMostEncompassedType, FindMostSpecificSource,
11800 FindMostSpecificTarget, ImplicitUserConversion,
11801 ExplicitUserConversion, GetConversionOperators,
11802 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11803 TryImplicitIntConversion, Error_CannotConvertImplicit,
11804 ConvertImplicitRequired, ConvertNumericExplicit,
11805 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11806 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11809 Perform the following renames:
11811 StandardConversionExists -> ImplicitStandardConversionExists
11812 ConvertImplicit -> ImplicitConversion
11813 ConvertImplicitStandard -> ImplicitStandardConversion
11814 TryImplicitIntConversion -> ImplicitIntConversion
11815 ConvertImplicitRequired -> ImplicitConversionRequired
11816 ConvertNumericExplicit -> ExplicitNumericConversion
11817 ConvertReferenceExplicit -> ExplicitReferenceConversion
11818 ConvertExplicit -> ExplicitConversion
11819 ConvertExplicitStandard -> ExplicitStandardConversion
11821 2003-05-19 Martin Baulig <martin@ximian.com>
11823 * statement.cs (TypeInfo.StructInfo): Made this type protected.
11824 (TypeInfo): Added support for structs having structs as fields.
11826 * ecore.cs (FieldExpr): Implement IVariable.
11827 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11828 VariableInfo for the field.
11830 2003-05-18 Martin Baulig <martin@ximian.com>
11832 * expression.cs (This.DoResolve): Report a CS0027 if we're
11833 emitting a field initializer.
11835 2003-05-18 Martin Baulig <martin@ximian.com>
11837 * expression.cs (This.ResolveBase): New public function.
11838 (This.DoResolve): Check for CS0188.
11840 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11843 * ecore.cs (MethodGroupExpr.DoResolve): Set the
11844 `instance_expression' to null if we don't have any non-static
11847 2003-05-18 Martin Baulig <martin@ximian.com>
11849 Reworked the way how local variables and parameters are handled by
11850 the flow analysis code.
11852 * statement.cs (TypeInfo, VariableMap): New public classes.
11853 (VariableInfo): New public class. This is now responsible for
11854 checking whether a variable has been assigned. It is used for
11855 parameters and local variables.
11856 (Block.EmitMeta): Take the InternalParameters as argument; compute
11857 the layout of the flow vectors here.
11858 (Block.LocalMap, Block.ParameterMap): New public properties.
11859 (FlowBranching): The .ctor doesn't get the InternalParameters
11860 anymore since Block.EmitMeta() now computes the layout of the flow
11862 (MyStructInfo): This class is now known as `StructInfo' and nested
11863 in `TypeInfo'; we don't access this directly anymore.
11865 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11866 property and removed IsAssigned(), IsFieldAssigned(),
11867 SetAssigned() and SetFieldAssigned(); we now call them on the
11868 VariableInfo so we don't need to duplicate this code everywhere.
11870 * expression.cs (ParameterReference): Added `Block block' argument
11872 (LocalVariableReference, ParameterReference, This): The new
11873 VariableInfo class is now responsible for all the definite
11876 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11877 IsParameterAssigned, SetParameterAssigned): Removed.
11879 2003-05-18 Martin Baulig <martin@ximian.com>
11881 * typemanager.cs (InitCoreTypes): Try calling
11882 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11883 the 3-args-version. Corlib now also needs our `void_type'.
11884 (GetMethod): Added overloaded version which takes an optional
11885 `bool report_errors' to allow lookups of optional methods.
11887 2003-05-12 Martin Baulig <martin@ximian.com>
11889 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11890 only used for locals and not for parameters.
11892 2003-05-12 Miguel de Icaza <miguel@ximian.com>
11894 * support.cs (InternalParameters.ParameterType): Return the
11895 ExternalType of the parameter.
11897 * parameter.cs (Parameter.ExternalType): drop the two arguments,
11900 2003-05-11 Miguel de Icaza <miguel@ximian.com>
11902 * class.cs (MethodData.Define): Do not set the `newslot' on
11903 interface members, if they are also flagged as "override".
11905 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11906 better code for ++i and i++. This only works for static fields
11907 and local variables.
11909 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11910 want to pull the DeclSpace out of the builder_to_declspace instead
11911 of the TypeBuilder (like in TypeContainer.FindMembers).
11913 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11914 instead of LookupTypeContainer. Fixes the crash on .NET for
11915 looking up interface members.
11917 * const.cs: Create our own emit context during the Definition
11918 stage, so that constants are evaluated in the proper context, when
11919 a recursive definition happens.
11921 2003-05-11 Martin Baulig <martin@ximian.com>
11923 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
11924 new block for a switch section.
11925 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11926 the adding/lookup in the switch block. Fixes #39828.
11928 2003-05-09 Miguel de Icaza <miguel@ximian.com>
11930 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11931 functionality: I needed to convert the data after I had performed
11932 the add/sub operation into the operands type size.
11934 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11935 pass the type for the box operation, otherwise the resulting
11936 object would have been of type object.
11938 (BoxedCast): Add constructor to specify the type to box as.
11940 2003-05-07 Miguel de Icaza <miguel@ximian.com>
11942 * iterators.cs: I was reusing the `count' variable inadvertently,
11943 take steps to not allow this to happen.
11945 2003-05-06 Miguel de Icaza <miguel@ximian.com>
11947 * attribute.cs (Attribute.Resolve): Params attributes are encoded
11948 by creating an array at the point where the params starts and
11949 putting all those arguments there, then adjusting the size of the
11952 2003-05-05 Miguel de Icaza <miguel@ximian.com>
11954 * expression.cs (New.AddressOf): Implement interface
11955 IMemoryLocation. This is used when the `new' operator is used in
11956 the context of an invocation to a method on a value type.
11958 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11961 * namespace.cs: Also check the using aliases here.
11963 * driver.cs: Move the test for using validity after the types have
11964 been entered, so we do a single pass that also includes the using
11967 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11968 in the regular case. CreateSiblingForFinally is doing extra
11971 * attribute.cs (GetAttributeArgumentExpression): Store the result
11972 on an out value, and use the return value to indicate failure
11973 instead of using null (which is a valid return for Constant.GetValue).
11975 * statement.cs: Perform the analysis flow for the increment
11976 portion after the statement, because this will be the real flow of
11977 execution. Fixes #42385
11979 * codegen.cs (EmitContext.EmitArgument,
11980 EmitContext.EmitStoreArgument): New helper functions when the
11981 RemapToProxy flag is set.
11983 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11986 Add support for remapping parameters.
11988 * iterators.cs: Propagate parameter values; Store parameter
11989 values in the proxy classes.
11991 2003-05-04 Miguel de Icaza <miguel@ximian.com>
11993 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
11994 need a proxy reference; I do not know what I was thinking
11996 * cs-parser.jay (constructor_initializer): catch another error,
11997 and display nice message.
11999 (field_declaration): catch void field declaration
12000 to flag a better error.
12002 * class.cs (MemberBase.CheckBase): Report an error instead of a
12003 warning if a new protected member is declared in a struct.
12004 (Field.Define): catch the error of readonly/volatile.
12006 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12008 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12009 volatile variable is taken
12011 2003-05-02 Miguel de Icaza <miguel@ximian.com>
12013 * statement.cs (Fixed.Resolve): Report an error if we are not in
12016 2003-05-01 Miguel de Icaza <miguel@ximian.com>
12018 * typemanager.cs: reuse the code that handles type clashes for
12019 delegates and enumerations.
12021 * class.cs (Report28): Always report.
12023 * expression.cs (EncodeAsAttribute): Allow nulls here.
12025 2003-04-28 Miguel de Icaza <miguel@ximian.com>
12027 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12028 the functionality for testing whether an expression is valid for
12029 an attribute here. Also handle the case of arrays of elements
12032 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12033 encoding a linear array into an array of objects that are suitable
12034 to be passed to an CustomAttributeBuilder.
12036 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12038 * ecore.cs: (FieldExpr): Handle field remapping here.
12040 * iteratators.cs: Pass the instance variable (if the method is an
12041 instance method) to the constructors, so we can access the field
12042 variables on the class.
12044 TODO: Test this with structs. I think the THIS variable on
12045 structs might have to be a pointer, and not a refenrece
12047 2003-04-27 Miguel de Icaza <miguel@ximian.com>
12049 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12050 local variables to fields in a proxy class.
12052 * iterators.cs (PopulateProxy): Rename our internal fields to
12054 Create a <THIS> field if we are an instance method, so we can
12055 reference our parent container variables.
12056 (MapVariable): Called back from the EmitContext code to enter a
12057 new variable to field mapping into the proxy class (we just create
12061 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12062 for using the remapped locals to fields.
12064 I placed the code here, because that gives the same semantics to
12065 local variables, and only changes the Emit code.
12067 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12068 statements inside iterators.
12069 (VariableInfo): Add a FieldBuilder for the cases when we are
12070 remapping local variables to fields in a proxy class
12072 * ecore.cs (SimpleNameResolve): Avoid testing two times for
12073 current_block != null.
12075 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12076 not cope with strings, as it has been moved to the
12077 TableSwitchEmit. Fixed bug in switch generation.
12079 * expression.cs (New.DoResolve): Provide more context for the user
12080 when reporting an error.
12082 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12085 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12086 check the permissions for it. Note than in a type-resolution
12087 context the check was already present in DeclSpace.ResolveType,
12088 but was missing from the MemberAccess.
12090 (ArrayCreation.CheckIndices): warn if the user has
12091 more nested levels of expressions, but there are no more
12092 dimensions specified. Avoids crash on bug 41906.
12094 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12096 * statement.cs (Block): replace Implicit bool, for a generic
12098 New flag: `Unchecked'. This is used during the EmitMeta phase
12099 (which is out-of-line with the regular Resolve/Emit process for a
12100 statement, as this is done ahead of time, but still gets a chance
12101 to call constant resolve).
12103 (Block.Flags): new enum for adding a new flag.
12105 (Block.EmitMeta): track the state of unchecked.
12107 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12108 to enable constant resolution to work there as well.
12110 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12112 * typemanager.cs (ienumerable_type): Also look up
12113 System.Collections.IEnumerable.
12115 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12117 TODO: Test more than one conditional per method.
12119 * class.cs (Indexer.Define): Report the location where the user is
12120 referencing the unsupported feature.
12122 (MethodData): Overload the use of `conditionals' to
12123 minimize the creation of needless ArrayLists. This saves roughly
12124 212kb on my machine.
12126 (Method): Implement the new IIteratorContainer interface.
12127 (Method.SetYields): Implement the method by setting the ModFlags
12128 to contain METHOD_YIELDS.
12130 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12131 which just got set to null.
12133 * iterators.cs: New file.
12135 (Yield, YieldBreak): New statements.
12137 * statement.cs (Return.Resolve): Flag an error if we are used in
12138 an iterator method.
12140 * codegen.cs (InIterator): New flag set if the code is being
12141 compiled in an iterator method.
12143 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12144 internal modifier, and we just use it to avoid adding extra
12145 fields, as this is seldom used.
12147 * cs-parser.jay: Add yield_statement (yield and yield break).
12149 * driver.cs: New flag -v2 to turn on version 2 features.
12151 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12152 hashtable when v2 is enabled.
12154 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12156 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12157 there is already a namespace defined with this name.
12159 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12160 people upgraded their corlibs.
12162 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12163 always use fully qualified types, no need to use the compiler
12166 (TypeManager.IsNamespace): Use binarysearch.
12168 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12169 AddDelegate): I did not quite use the new IsValid API properly: I
12170 have to pass the short-name and the fullname. I was passing only
12171 the basename instead of the fullname sometimes.
12173 (TypeContainer.DefineType): call NamespaceClash.
12175 * interface.cs (Interface.DefineType): use NamespaceClash before
12178 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12181 * enum.cs: (Enum.DefineType): use NamespaceClash before
12184 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12185 speed increase. First, use the negative_hits cache when we get a
12186 negative. Second, add the type with its full original name
12187 instead of the new . and + encoded name (reflection uses + to
12188 separate type from a nested type). Use LookupTypeReflection
12189 directly which bypasses the type->name hashtable (that we already
12190 know does not contain the type.
12192 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12193 location/container type.
12195 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12197 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12199 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12201 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12202 method is being referenced in the method group from a static
12203 context, and report error 120 if so.
12205 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12208 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12209 is created, we create the A namespace).
12211 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12214 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12216 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12217 invocation to ModuleBuilder.GetType with the same values will
12218 return a new type instance, so we need to cache its return
12221 * expression.cs (Binary.ResolveOperator): Only allow the compare
12222 operators on enums if they are of the same type.
12224 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12225 types of ValueType on their own case. Before we were giving them
12226 the same treatment as objects.
12228 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12229 fullname. Short name is used to compare against container name.
12230 Fullname is used to check against defined namespace names.
12232 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12233 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12235 (Method.CheckBase): Call parent.
12236 (MemberBase.CheckBase): Check for protected members on sealed
12238 (PropertyBase.CheckBase): Call parent.
12239 (Field.Define): Call parent.
12241 * report.cs: Negative error codes are now mapped to 8000 - code,
12242 so that the display is render more nicely.
12244 * typemanager.cs: Do not use try/catch, instead report a regular
12247 (GetPointerType, GetReferenceType): These methods provide
12248 mechanisms to obtain the T* and T& from a T. We had the code
12249 previously scattered around the code base, and it also used
12250 TypeManager.LookupType that would go through plenty of caches.
12251 This one goes directly to the type source.
12253 In some places we did the Type.GetType followed by
12254 ModuleBuilder.GetType, but not in others, so this unifies the
12255 processing as well.
12257 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12258 statements now that we have namespace information.
12260 * typemanager.cs (IsNamespace): New method, returns whether the
12261 string presented is a namespace or not.
12263 (ComputeNamespaces): New public entry point, computes the list of
12264 available namespaces, using the GetNamespaces API call in Mono, or
12265 the slower version in MS.NET.
12267 Now before we start the semantic analysis phase, we have a
12268 complete list of namespaces including everything that the user has
12271 Deleted old code to cache namespaces in .nsc files.
12273 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12275 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12276 class/struct location definition Location for the implicit
12277 constructor location.
12279 (Operator.Define): Use the location of the operator for the
12280 implicit Method definition.
12282 (Constructor.Emit): use the constructor location for the implicit
12283 base initializer constructor.
12285 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12286 and the Expression class now contains two new methods:
12288 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12289 isolate type lookup from the rest of the resolution process.
12291 Since we use Expressions to hold type definitions due to the way
12292 we parse the input we have historically overloaded Resolve to
12293 perform the Type lookups if a special flag is passed. Now this is
12294 eliminated and two methods take their place.
12296 The differences in the two methods between xStep and xTerminal is
12297 that xStep is involved in our current lookup system that uses
12298 SimpleNames to compose a name, while xTerminal is used just to
12299 catch the case where the simplename lookup failed.
12301 2003-04-16 Miguel de Icaza <miguel@ximian.com>
12303 * expression.cs (ResolveMemberAccess): Remove redundant code.
12304 TypeExpr expressions are always born fully resolved.
12306 * interface.cs (PopulateMethod): Do not lookup the types twice.
12307 We were doing it once during SemanticAnalysis and once during
12310 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12311 in local variable type definitions, were being returned as a
12312 SimpleName (we decomposed everything into a string), that is
12313 because primary_expression was being used instead of a type in the
12314 grammar (reduce/reduce conflicts).
12316 The part that was wrong is that we converted the expression into a
12317 string (an oversimplification in one hand, compounded with primary
12318 expressions doing string concatenation).
12324 Would return "A.B.C[]" as a SimpleName. This stopped things like
12325 using clauses from working on this particular context. And a type
12326 was being matched directly against "A.B.C[]".
12328 We now use the correct approach, and allow for ComposedCast to be
12329 part of the unary expression. So the "A.B.C []" become a composed
12330 cast of "A.B.C" (as a nested group of MemberAccess with a
12331 SimpleName at the end) plus the rank composition "[]".
12335 2003-04-10 Miguel de Icaza <miguel@ximian.com>
12337 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12338 for the access level checking.
12340 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
12341 `TypeContainer container', because I kept getting confused when I
12342 was debugging this code.
12344 * expression.cs (Indexers): Instead of tracking getters/setters,
12345 we now track them in parallel. We create one arraylist less, but
12346 most importantly it is possible now for the LValue code to find a
12347 matching get for a set.
12349 (IndexerAccess.DoResolveLValue): Update the code.
12350 GetIndexersForType has been modified already to extract all the
12351 indexers from a type. The code assumed it did not.
12353 Also make the code set the correct return type for the indexer.
12354 This was fixed a long time ago for properties, but was missing for
12355 indexers. It used to be void_type.
12357 (Binary.Emit): Test first for doubles instead of
12358 floats, as they are more common.
12360 (Binary.EmitBranchable): Use the .un version of the branch opcodes
12361 when dealing with floats and the <=, >= operators. This fixes bug
12364 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12365 to load the array value by emitting a load on the foreach variable
12366 type. This was incorrect.
12368 We now emit the code to load an element using the the array
12369 variable type, and then we emit the conversion operator.
12373 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
12375 * attribute.cs: Avoid allocation of ArrayLists in the common case.
12377 2003-04-09 Miguel de Icaza <miguel@ximian.com>
12379 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12380 test for protection before we test for signatures.
12382 (MethodSignature.ToString): implement.
12384 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12385 to the case where we reduced into a LongConstant.
12387 * decl.cs (CheckAccessLevel): If the type is an array, we can not
12388 depend on whether the information is acurrate, because the
12389 Microsoft runtime will always claim that the array type is public,
12390 regardless of the real state.
12392 If the type is a pointer, another problem happens: the type is
12393 reported as non-public in Microsoft.
12395 In both cases we have to call CheckAccessLevel recursively with
12396 the underlying type as the argument to be tested.
12398 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12400 * assign.cs (Assign.Emit): If we are dealing with a compound
12401 assignment expression, we should use the code path that stores the
12402 intermediate result in a temporary value. This fixes #40903.
12404 *expression.cs (Indirection.ToString): Provide ToString method for
12407 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12409 * class.cs: Null out fields holding references to Block objects so
12410 they can be garbage collected.
12412 * expression.cs (OverloadResolve): Remove unused local.
12414 2003-04-07 Martin Baulig <martin@ximian.com>
12416 * codegen.cs (EmitContext.CurrentFile): New public field.
12417 (EmitContext.Mark): Use the CurrentFile to check whether the
12418 location is in the correct file.
12419 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12421 2003-04-07 Martin Baulig <martin@ximian.com>
12423 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12425 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12426 location. [FIXME: The location argument which gets passed to this
12427 method is sometimes wrong!]
12429 2003-04-07 Nick Drochak <ndrochak@gol.com>
12431 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12433 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12435 * expression.cs (Indirection.EmitAssign): We were using the
12436 temporary, but returning immediately instead of continuing the
12439 2003-04-06 Martin Baulig <martin@ximian.com>
12441 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12442 if it's a nested child, but also deriving from the outer class.
12445 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12446 nested child, but also deriving from the outer class. See
12448 (FilterWithClosure): We may access private members of the outer
12449 class if we're a nested child and deriving from the outer class.
12450 (RealMemberLookup): Only set `closure_private_ok' if the
12451 `original_bf' contained BindingFlags.NonPublic.
12453 2003-04-05 Martin Baulig <martin@ximian.com>
12455 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
12456 probe if its a type parameter, and if so, flag an error.
12458 * decl.cs: Move here the SetParameterInfo code from class.cs.
12459 Handle IsGeneric here.
12461 Handle a variety of errors in the parameter info definition.
12463 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
12464 type parameters here.
12466 * cs-parser.jay (class_declaration): report errors for parameters
12469 2003-01-21 Miguel de Icaza <miguel@ximian.com>
12471 * generic.cs: New file, contains support code for generics.
12473 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
12474 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
12476 Update parser for the above removals.
12478 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
12479 now taken care of in the parser.
12481 2003-04-02 Miguel de Icaza <miguel@ximian.com>
12483 * class.cs (Event.Define): Do not allow abstract events to have
12486 2003-04-01 Miguel de Icaza <miguel@ximian.com>
12488 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12489 block in event declarations.
12491 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12492 value type, get its address.
12494 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12495 leaving a class on the stack instead of a boolean value (int
12496 0/1). Change the code so we compare against null, and then the
12497 result against zero.
12499 * class.cs (TypeContainer.GetClassBases): We were checking for the
12500 parent class being sealed too late.
12502 * expression.cs (Binary.Emit): For <= and >= when dealing with
12503 floating point values, use cgt.un and clt.un instead of cgt and
12506 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
12508 * statement.cs: Apply the same optimization as MS: skip the
12509 GetEnumerator returning an IEnumerator, and use the one returning a
12510 CharEnumerator instead. This allows us to avoid the try-finally block
12513 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
12515 * cs-parser.jay: Attributes cannot be applied to
12516 namespaces. Fixes #40473
12518 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12521 (Add*): check if the name is valid using the full name for constants,
12522 fields, properties and events.
12524 2003-03-28 Miguel de Icaza <miguel@ximian.com>
12526 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12527 char constants to be part of the enumeration.
12529 * expression.cs (Conditional.DoResolve): Add support for operator
12530 true. Implements the missing functionality from 14.12
12532 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12533 operator true/false as required by the spec.
12535 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12536 implicit conversion to boolean.
12538 * statement.cs (Statement.ResolveBoolean): A boolean expression is
12539 also one where the type implements `operator true'.
12541 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12542 get an expression that will invoke operator true based on an
12545 (GetConversionOperators): Removed the hack that called op_True
12548 (Expression.ResolveBoolean): Move this from Statement.
12550 2003-03-17 Miguel de Icaza <miguel@ximian.com>
12552 * ecore.cs (FieldExpr): do not allow initialization of initonly
12553 fields on derived classes
12555 2003-03-13 Martin Baulig <martin@ximian.com>
12557 * statement.cs (Block.Emit): Call ig.BeginScope() and
12558 ig.EndScope() when compiling with debugging info; call
12559 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12561 2003-03-08 Miguel de Icaza <miguel@ximian.com>
12563 * expression.cs (Indexers): Do not construct immediately, allow
12564 for new members to be appended as we go. Fixes 38143
12566 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12568 * expression.cs: save/restore context when resolving an unchecked
12571 2003-03-05 Miguel de Icaza <miguel@ximian.com>
12573 * cfold.cs: Catch division by zero in modulus operator during
12576 2003-03-03 Miguel de Icaza <miguel@ximian.com>
12578 * interface.cs (Interface.DefineMembers): Avoid defining members
12581 2003-02-27 Miguel de Icaza <miguel@ximian.com>
12583 * driver.cs: handle the +/- options for -noconfig
12585 * statement.cs (Unckeched.Resolve): Also track the state of
12586 unchecked in the Resolve phase.
12588 2003-02-27 Martin Baulig <martin@ximian.com>
12590 * ecore.cs (Expression.MemberLookup): Don't create a
12591 MethodGroupExpr for something which is not a method. Fixes #38291.
12593 2003-02-25 Miguel de Icaza <miguel@ximian.com>
12595 * class.cs (MemberBase.CheckParameters): Also check that the type
12596 is unmanaged if it is a pointer.
12598 * expression.cs (SizeOf.Resolve): Add location information.
12600 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12601 a managed type is declared.
12603 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12604 parameter modifiers as well. Fixes bug 38606
12606 * class.cs: Very sad. Am backing out the speed up changes
12607 introduced by the ArrayList -> Array in the TypeContainer, as they
12608 were not actually that much faster, and introduced a bug (no error
12609 reports on duplicated methods).
12611 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12612 source first, this will guarantee that we have a valid expression
12613 before calling in lower levels functions that will require a
12614 resolved object. Then use this original_source in the
12615 target.ResolveLValue instead of the original source that was
12618 Another change. Use target.Resolve instead of LValueResolve.
12619 Although we are resolving for LValues, we will let the Assign code
12620 take care of that (it will be called again from Resolve). This
12621 basically allows code like this:
12623 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12624 class Y { void A (X x) { x [0] += o; }
12626 The problem was that the indexer was trying to resolve for
12627 set_Item (idx, object o) and never finding one. The real set_Item
12628 was set_Item (idx, X). By delaying the process we get the right
12633 2003-02-23 Martin Baulig <martin@ximian.com>
12635 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12636 while calling DoEmit ().
12638 * codegen.cs (EmitContext.Mark): Don't mark locations in other
12639 source files; if you use the #line directive inside a method, the
12640 compiler stops emitting line numbers for the debugger until it
12641 reaches the end of the method or another #line directive which
12642 restores the original file.
12644 2003-02-23 Martin Baulig <martin@ximian.com>
12646 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12648 2003-02-23 Martin Baulig <martin@ximian.com>
12650 * statement.cs (Block.AddChildVariableNames): We need to call this
12651 recursively, not just for our immediate children.
12653 2003-02-23 Martin Baulig <martin@ximian.com>
12655 * class.cs (Event.Define): Always make the field private, like csc does.
12657 * typemanager.cs (TypeManager.RealMemberLookup): Make events
12658 actually work, fixes bug #37521.
12660 2003-02-23 Miguel de Icaza <miguel@ximian.com>
12662 * delegate.cs: When creating the various temporary "Parameters"
12663 classes, make sure that we call the ComputeAndDefineParameterTypes
12664 on those new parameters (just like we do with the formal ones), to
12665 allow them to be resolved in the context of the DeclSpace.
12667 This fixes the bug that Dick observed in Bugzilla #38530.
12669 2003-02-22 Miguel de Icaza <miguel@ximian.com>
12671 * expression.cs (ResolveMemberAccess): When resolving a constant,
12672 do not attempt to pull a constant if the value was not able to
12673 generate a valid constant.
12675 * const.cs (LookupConstantValue): Do not report more errors than required.
12677 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12679 * expression.cs: fixes bug #38328.
12681 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12683 * class.cs: Changed all the various members that can be part of a
12684 class from being an ArrayList to be an Array of the right type.
12685 During the DefineType type_list, interface_list, delegate_list and
12686 enum_list are turned into types, interfaces, delegates and enums
12689 And during the member population, indexer_list, event_list,
12690 constant_list, field_list, instance_constructor_list, method_list,
12691 operator_list and property_list are turned into their real arrays.
12693 Although we could probably perform this operation earlier, for
12694 good error reporting we need to keep the lists and remove the
12695 lists for longer than required.
12697 This optimization was triggered by Paolo profiling the compiler
12698 speed on the output of `gen-sample-program.pl' perl script.
12700 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12701 not crash in methods like MemberLookupFailed that use this field.
12703 This problem arises when the compiler fails to resolve a type
12704 during interface type definition for example.
12706 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12708 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12709 inherit from System.Object, so we have to stop at null, not only
12710 when reaching System.Object.
12712 2003-02-17 Miguel de Icaza <miguel@ximian.com>
12714 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12715 DeclaredOnly because the parent indexer might have had a different
12716 name, but did not loop until the top of the hierarchy was reached.
12718 The problem this one fixes is 35492: when a class implemented an
12719 indexer from an interface, we were getting the interface method
12720 (which was abstract) and we were flagging an error (can not invoke
12723 This also keeps bug 33089 functioning, and test-148 functioning.
12725 * typemanager.cs (IsSpecialMethod): The correct way of figuring
12726 out if a method is special is to see if it is declared in a
12727 property or event, or whether it is one of the predefined operator
12728 names. This should fix correctly #36804.
12730 2003-02-15 Miguel de Icaza <miguel@ximian.com>
12732 The goal here is to remove the dependency on EmptyCast.Peel ().
12733 Killing it completely.
12735 The problem is that currently in a number of places where
12736 constants are expected, we have to "probe" for an EmptyCast, and
12737 Peel, which is not the correct thing to do, as this will be
12738 repetitive and will likely lead to errors.
12740 The idea is to remove any EmptyCasts that are used in casts that
12741 can be reduced to constants, so we only have to cope with
12744 This bug hunt was triggered by Bug 37363 and the desire to remove
12745 the duplicate pattern where we were "peeling" emptycasts to check
12746 whether they were constants. Now constants will always be
12749 * ecore.cs: Use an enumconstant here instead of wrapping with
12752 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12753 throwing me off. By handling this we can get rid of a few hacks.
12755 * statement.cs (Switch): Removed Peel() code.
12757 2003-02-14 Miguel de Icaza <miguel@ximian.com>
12759 * class.cs: Location information for error 508
12761 * expression.cs (New.DoResolve): Add a guard against double
12762 resolution of an expression.
12764 The New DoResolve might be called twice when initializing field
12765 expressions (see EmitFieldInitializers, the call to
12766 GetInitializerExpression will perform a resolve on the expression,
12767 and later the assign will trigger another resolution
12769 This leads to bugs (#37014)
12771 * delegate.cs: The signature for EndInvoke should contain any ref
12772 or out parameters as well. We were not doing this in the past.
12774 * class.cs (Field.Define): Do not overwrite the type definition
12775 inside the `volatile' group. Turns out that volatile enumerations
12776 were changing the type here to perform a validity test, which
12779 2003-02-12 Miguel de Icaza <miguel@ximian.com>
12781 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12782 and structs, we do not want to load the instance variable
12784 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12785 enum_type has to be handled like an object reference (implicit
12786 conversions exists from this to object), but the regular IsClass
12787 and IsValueType tests will never return true for this one.
12789 Also we use TypeManager.IsValueType instead of type.IsValueType,
12790 just for consistency with the rest of the code (this is only
12791 needed if we ever use the construct exposed by test-180.cs inside
12792 corlib, which we dont today).
12794 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
12796 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12799 2003-02-09 Martin Baulig <martin@ximian.com>
12801 * namespace.cs (Namespace..ctor): Added SourceFile argument.
12802 (Namespace.DefineNamespaces): New static public method; this is
12803 called when we're compiling with debugging to add all namespaces
12804 to the symbol file.
12806 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12807 pass it to the Namespace's .ctor.
12809 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12810 and MethodBase arguments; pass the namespace ID to the symwriter;
12811 pass the MethodBase instead of the token to the symwriter.
12812 (SymbolWriter.DefineNamespace): New method to add a namespace to
12815 2003-02-09 Martin Baulig <martin@ximian.com>
12817 * symbolwriter.cs: New file. This is a wrapper around
12818 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
12819 methods here in near future.
12821 2003-02-09 Martin Baulig <martin@ximian.com>
12823 * codegen.cs (EmitContext.Mark): Just pass the arguments to
12824 ILGenerator.MarkSequencePoint() which are actually used by the
12827 2003-02-09 Martin Baulig <martin@ximian.com>
12829 * location.cs (SourceFile): New public sealed class. This
12830 contains the name and an index which is used in the location's token.
12831 (Location): Reserve an appropriate number of bits in the token for
12832 the source file instead of walking over that list, this gives us a
12833 really huge performance improvement when compiling with debugging.
12835 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12836 `SourceFile' argument instead of a string.
12837 (Driver.ProcessFile): Add all the files via Location.AddFile(),
12838 but don't parse/tokenize here, we need to generate the list of all
12839 source files before we do that.
12840 (Driver.ProcessFiles): New static function. Parses/tokenizes all
12843 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12844 instead of a string.
12846 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12849 2003-02-09 Martin Baulig <martin@ximian.com>
12851 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12852 filename on `#line default'.
12854 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12856 * statement.cs: don't clear the pinned var when the fixed statement
12857 returns from the method (fixes bug#37752).
12859 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12861 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
12864 2003-02-07 Martin Baulig <martin@ximian.com>
12866 * driver.cs: Removed the `--debug-args' command line argument.
12868 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12869 automatically by the AsssemblyBuilder.
12870 (CodeGen.InitializeSymbolWriter): We don't need to call any
12871 initialization function on the symbol writer anymore. This method
12872 doesn't take any arguments.
12874 2003-02-03 Miguel de Icaza <miguel@ximian.com>
12876 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12877 from referenced assemblies as well.
12879 2003-02-02 Martin Baulig <martin@ximian.com>
12881 * class.cs (MethodData.Emit): Generate debugging info for external methods.
12883 2003-02-02 Martin Baulig <martin@ximian.com>
12885 * class.cs (Constructor.Emit): Open the symbol writer before
12886 emitting the constructor initializer.
12887 (ConstructorInitializer.Emit): Call ec.Mark() to allow
12888 single-stepping through constructor initializers.
12890 2003-01-30 Miguel de Icaza <miguel@ximian.com>
12892 * class.cs: Handle error 549: do not allow virtual methods in
12895 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12897 * decl.cs: Check access levels when resolving types
12899 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12901 * statement.cs: Add parameters and locals set in catch blocks that might
12902 return to set vector
12904 2003-01-29 Miguel de Icaza <miguel@ximian.com>
12906 * class.cs (Operator): Set the SpecialName flags for operators.
12908 * expression.cs (Invocation.DoResolve): Only block calls to
12909 accessors and operators on SpecialName methods.
12911 (Cast.TryReduce): Handle conversions from char constants.
12914 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12916 * statement.cs: small memory and time optimization in FlowBranching.
12918 2003-01-28 Pedro Mart <yoros@wanadoo.es>
12920 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12921 problem that the last fix but in the other sid (Set).
12923 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12924 access when there is no indexer in the hierarchy.
12926 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12928 * class.cs: Combine some if statements.
12930 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12932 * driver.cs: fixed bug #37187.
12934 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
12936 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12937 any indexer, it's needed to build a list with all the indexers in the
12938 hierarchy (AllGetters), else we have problems. Fixes #35653.
12940 2003-01-23 Miguel de Icaza <miguel@ximian.com>
12942 * class.cs (MethodData.Define): It is wrong for an interface
12943 implementation to be static in both cases: explicit and implicit.
12944 We were only handling this in one case.
12946 Improve the if situation there to not have negations.
12948 * class.cs (Field.Define): Turns out that we do not need to check
12949 the unsafe bit on field definition, only on usage. Remove the test.
12951 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12953 * driver.cs: use assembly.Location instead of Codebase (the latest
12954 patch made mcs fail when using MS assemblies).
12956 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
12958 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12959 get the path to *corlib.dll.
12961 2003-01-21 Nick Drochak <ndrochak@gol.com>
12965 * typemanager.cs: Remove compiler warnings
12967 2003-01-20 Duncan Mak <duncan@ximian.com>
12969 * AssemblyInfo.cs: Bump the version number to 0.19.
12971 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12973 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12975 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
12977 * class.cs (Constructor::Emit): Emit debugging info for constructors.
12979 2003-01-17 Miguel de Icaza <miguel@ximian.com>
12981 * cs-parser.jay: Small fix: we were not comparing the constructor
12982 name correctly. Thanks to Zoltan for the initial pointer.
12984 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12986 * cs-tokenizer.cs: Set file name when specified with #line
12988 2003-01-15 Miguel de Icaza <miguel@ximian.com>
12990 * cs-parser.jay: Only perform the constructor checks here if we
12991 are named like the class; This will help provider a better
12992 error. The constructor path is taken when a type definition is
12993 not found, but most likely the user forgot to add the type, so
12994 report that rather than the constructor error.
12996 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12998 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13001 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13003 * cs-parser.jay: Add cleanup call.
13005 2003-01-13 Duncan Mak <duncan@ximian.com>
13007 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13008 consistent with other methods.
13010 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13012 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13014 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13016 * attribute.cs: only set GuidAttr to true when we have a
13019 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13023 * typemanager.cs: fixes to allow mcs compile corlib with the new
13024 Type.IsSubclassOf fix.
13026 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13028 * expression.cs (LocalVariableReference.DoResolve): Classify a
13029 constant as a value, not as a variable. Also, set the type for
13032 * cs-parser.jay (fixed_statement): take a type instead of a
13033 pointer_type, so we can produce a better error message later.
13035 * statement.cs (Fixed.Resolve): Flag types that are not pointers
13038 (For.DoEmit): Make inifinite loops have a
13039 non-conditional branch back.
13041 (Fixed.DoEmit): First populate the pinned variables, then emit the
13042 statement, then clear the variables. Before I was emitting the
13043 code once for each fixed piece.
13046 2003-01-08 Martin Baulig <martin@ximian.com>
13048 * statement.cs (FlowBranching.MergeChild): A break in a
13049 SWITCH_SECTION does not leave a loop. Fixes #36155.
13051 2003-01-08 Martin Baulig <martin@ximian.com>
13053 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13054 lives in the same number space than `param_map'. Fixes #36154.
13056 2003-01-07 Miguel de Icaza <miguel@ximian.com>
13058 * cs-parser.jay (constructor_declaration): Set the
13059 Constructor.ModFlags before probing for it. This makes the
13060 compiler report 514, 515 and 132 (the code was there, but got
13063 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13064 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13065 (GotoCase.Resolve): Set `Returns' to ALWAYS.
13067 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13069 * enum.cs: create the enum static fields using the enum type.
13071 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13073 * class.cs: don't try to create the ParamBuilder for the return
13074 type if it's not needed (and handle it breaking for the ms runtime
13077 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13079 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13081 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13083 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13084 the command. This showed up while compiling the JANET source
13085 code, which used \r as its only newline separator.
13087 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13089 * class.cs (Method.Define): If we are an operator (because it
13090 reuses our code), then set the SpecialName and HideBySig. #36128
13092 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13094 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13095 exception, report error 120 `object reference required'.
13097 * driver.cs: Add --pause option, used during to measure the size
13098 of the process as it goes with --timestamp.
13100 * expression.cs (Invocation.DoResolve): Do not allow methods with
13101 SpecialName to be invoked.
13103 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13105 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13106 number before adding it.
13108 2002-12-21 Ravi Pratap <ravi@ximian.com>
13110 * ecore.cs (StandardImplicitConversion): When in an unsafe
13111 context, we allow conversion between void * to any other pointer
13112 type. This fixes bug #35973.
13114 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13116 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13117 is not thrown when extensionless outputs are used
13119 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13121 * rootcontext.cs: fixed compilation of corlib.
13123 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13125 * attribute.cs (Attributes.Contains): Add new method.
13127 * class.cs (MethodCore.LabelParameters): if the parameter is an
13128 `out' parameter, check that no attribute `[In]' has been passed.
13130 * enum.cs: Handle the `value__' name in an enumeration.
13132 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13134 * decl.cs: Added special case to allow overrides on "protected
13137 2002-12-18 Ravi Pratap <ravi@ximian.com>
13139 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13140 since it makes much more sense.
13142 (Attributes.ctor): Don't require a Location parameter.
13144 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13146 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13147 since we already have that information per attribute.
13149 * everywhere : make appropriate changes.
13151 * class.cs (LabelParameters): Write the code which actually
13152 applies attributes to the return type. We can't do this on the MS
13153 .NET runtime so we flag a warning in the case an exception is
13156 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13158 * const.cs: Handle implicit null conversions here too.
13160 2002-12-17 Ravi Pratap <ravi@ximian.com>
13162 * class.cs (MethodCore.LabelParameters): Remove the extra
13163 Type [] parameter since it is completely unnecessary. Instead
13164 pass in the method's attributes so that we can extract
13165 the "return" attribute.
13167 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13169 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13170 of ignoring it and letting the compile continue.
13172 * typemanager.cs (ChangeType): use an extra argument to return an
13173 error condition instead of throwing an exception.
13175 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13177 * expression.cs (Unary.TryReduce): mimic the code for the regular
13178 code path. Perform an implicit cast in the cases where we can
13179 implicitly convert to one of the integral types, and then reduce
13180 based on that constant. This fixes bug #35483.
13182 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13184 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13186 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13188 * namespace.cs: fixed bug #35489.
13190 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13192 * class.cs: Remove some dead code.
13194 * cs-parser.jay: Estimate the number of methods needed
13195 (RootContext.MethodCount);
13197 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13198 numbers instead of StringBuilders.
13200 * support.cs (PtrHashtable): Add constructor with initial size;
13201 We can now reduce reallocations of the method table.
13203 2002-12-10 Ravi Pratap <ravi@ximian.com>
13205 * attribute.cs (ApplyAttributes): Keep track of the emitted
13206 attributes on a per-target basis. This fixes bug #35413.
13208 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13210 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13211 default to the Windows 1252 encoding.
13213 (UnixParseOption): Support version, thanks to Alp for the missing
13216 * AssemblyInfo.cs: Add nice assembly information.
13218 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13221 * cs-parser.jay: Allow a trailing comma before the close bracked
13222 in the attribute_section production.
13224 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13225 address of the instance was being taken, I will take this out,
13226 because we take the address of the object immediately here.
13228 2002-12-09 Ravi Pratap <ravi@ximian.com>
13230 * typemanager.cs (AreMultipleAllowed): Take care of the most
13231 obvious case where attribute type is not in the current assembly -
13234 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13236 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13237 definitions, instead of doing that afterwards.
13239 Also we use a nice little hack, depending on the constructor, we
13240 know if we are a "composed" name or a simple name. Hence, we
13241 avoid the IndexOf test, and we avoid
13243 * codegen.cs: Add code to assist in a bug reporter to track down
13244 the source of a compiler crash.
13246 2002-12-07 Ravi Pratap <ravi@ximian.com>
13248 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13249 types have been emitted for a given element and flag an error
13250 if something which does not have AllowMultiple set is used more
13253 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13254 attribute types and their corresponding AllowMultiple properties
13256 (AreMultipleAllowed): Check the property for a given type.
13258 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13259 property in the case we have a TypeContainer.
13261 (Attributes.AddAttribute): Detect duplicates and just skip on
13262 adding them. This trivial fix catches a pretty gross error in our
13263 attribute emission - global attributes were being emitted twice!
13265 Bugzilla bug #33187 is now fixed.
13267 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13269 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13270 instead of pp_and).
13272 * expression.cs (Binary.ResolveOperator): I can only use the
13273 Concat (string, string, string) and Concat (string, string,
13274 string, string) if the child is actually a concatenation of
13277 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13279 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13280 context where we need a 2-character lookahead.
13282 * pending.cs (PendingImplementation): Rework so we can keep track
13283 of interface types all the time, and flag those which were
13284 implemented by parents as optional.
13286 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13288 * expression.cs (Binary.ResolveOperator): Use
13289 String.Concat(string,string,string) or
13290 String.Concat(string,string,string,string) when possible.
13292 * typemanager: More helper methods.
13295 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13297 * pending.cs: remove the bogus return from GetMissingInterfaces()
13298 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13300 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13302 * namespace.cs: avoid duplicated 'using xxx' being added to
13303 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13304 when we get more than one 'using' statement for the same namespace.
13305 Report a CS0105 warning for it.
13307 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13309 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13310 of calling getChar/putback, uses internal knowledge of it.
13312 (xtoken): Reorder tokenizer so most common patterns are checked
13313 first. This reduces the compilation time in another 5% (from 8.11s
13314 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13316 The parsing time is 22% of the compilation in mcs, and from that
13317 64% is spent on the tokenization process.
13319 I tried using a binary search for keywords, but this is slower
13320 than the hashtable. Another option would be to do a couple of
13323 * Not use a StringBuilder, instead use an array of chars,
13324 with a set value. Notice that this way we could catch
13325 the 645 error without having to do it *afterwards*.
13327 * We could write a hand-parser to avoid the hashtable
13328 compares altogether.
13330 The identifier consumption process takes 37% of the tokenization
13331 time. Another 15% is spent on is_number. 56% of the time spent
13332 on is_number is spent on Int64.Parse:
13334 * We could probably choose based on the string length to
13335 use Int32.Parse or Int64.Parse and avoid all the 64-bit
13338 Another 3% is spend on wrapping `xtoken' in the `token' function.
13340 Handle 0xa0 as whitespace (#34752)
13342 2002-11-26 Miguel de Icaza <miguel@ximian.com>
13344 * typemanager.cs (IsCLRType): New routine to tell whether a type
13345 is one of the builtin types.
13347 Maybe it needs to use TypeCodes to be faster. Maybe we could use
13348 typecode in more places instead of doing pointer comparissions.
13349 We could leverage some knowledge about the way the typecodes are
13352 New code to cache namespaces in assemblies, it is currently not
13353 invoked, to be used soon.
13355 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13357 * expression.cs (Binary.ResolveOperator): specially handle
13358 strings, and do not perform user-defined operator overloading for
13361 2002-11-24 Miguel de Icaza <miguel@ximian.com>
13363 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13364 internalcall as it is a pretty simple operation; Avoid whenever
13365 possible to call Char.IsLetter.
13367 (consume_identifier): Cut by half the number of
13368 hashtable calls by merging the is_keyword and GetKeyword behavior.
13370 Do not short-circuit, because if we do, we
13371 report errors (ie, #if false && true would produce an invalid
13375 2002-11-24 Martin Baulig <martin@ximian.com>
13377 * expression.cs (Cast.TryReduce): If we're in checked syntax,
13378 check constant ranges and report a CS0221. Fixes #33186.
13380 2002-11-24 Martin Baulig <martin@ximian.com>
13382 * cs-parser.jay: Make this work for uninitialized variable
13383 declarations in the `for' initializer. Fixes #32416.
13385 2002-11-24 Martin Baulig <martin@ximian.com>
13387 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13388 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
13390 2002-11-24 Martin Baulig <martin@ximian.com>
13392 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13393 argument; if true, we also check for user-defined conversions.
13394 This is only needed if both arguments are of a user-defined type.
13395 Fixes #30443, added test-175.cs.
13396 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13398 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13400 2002-11-24 Martin Baulig <martin@ximian.com>
13402 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13403 function to get the store opcode.
13404 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13405 only emit the Ldelema if the store opcode is Stobj. You must run
13406 both test-34 and test-167 to test this. Fixes #34529.
13408 2002-11-23 Martin Baulig <martin@ximian.com>
13410 * ecore.cs (Expression.MemberLookup): Added additional
13411 `qualifier_type' argument which is used when we're being called
13412 from MemberAccess.DoResolve() and null if we're called from a
13414 (Expression.MemberLookupFailed): New method to report errors; this
13415 does the CS1540 check and reports the correct error message.
13417 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13418 argument for the CS1540 check and redone the way how we're dealing
13419 with private members. See the comment in the source code for details.
13420 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13421 `closure_start_type' to `closure_qualifier_type' and check whether
13422 it's not null. It was not this filter being broken, it was just
13423 being called with the wrong arguments.
13425 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13426 and pass it the correct `qualifier_type'; this also does the error
13429 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13431 * expression.cs (Invocation.EmitParams): If the we are dealing
13432 with a non-built-in value type, load its address as well.
13434 (ArrayCreation): Use a a pretty constant instead
13435 of the hardcoded value 2. Use 6 instead of 2 for the number of
13436 static initializers.
13438 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13439 because they are not really value types, just glorified integers.
13441 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13443 * ecore.cs: Remove redundant code for enumerations, make them use
13444 the same code path as everything else, fixes the casting issue
13445 with enumerations in Windows.Forms.
13447 * attribute.cs: Do only cast to string if it is a string, the
13448 validation happens later.
13450 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13451 people upgrade their corlibs.
13453 * ecore.cs: Oops, enumerations were not following the entire code path
13455 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13457 * typemanager.cs (FilterWithClosure): Commented out the test for
13458 1540 in typemanager.cs, as it has problems when accessing
13459 protected methods from a parent class (see test-174.cs).
13461 * attribute.cs (Attribute.ValidateGuid): new method.
13462 (Attribute.Resolve): Use above.
13464 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13466 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13468 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13469 handling for enumerations, as we only needed the TypeContainer
13470 functionality to begin with (this is required for the fix below to
13471 work for enums that reference constants in a container class for
13474 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13476 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13477 a valid TypeBuilder to perform lookups on.o
13479 * class.cs (InheritableMemberSignatureCompare): Use true in the
13480 call to GetGetMethod and GetSetMethod, because we are comparing
13481 the signature, and we need to get the methods *even* if they are
13484 (PropertyBase.CheckBase): ditto.
13486 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13487 GotoCase.Resolve): Use Peel on EmpytCasts.
13489 * ecore.cs (EmptyCast): drop child, add Peel method.
13491 2002-11-17 Martin Baulig <martin@ximian.com>
13493 * ecore.cs (EmptyCast.Child): New public property.
13495 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13496 label resolved to an EmptyCast. Fixes #34162.
13497 (GotoCase.Resolve): Likewise.
13498 (Block.EmitMeta): Likewise.
13500 2002-11-17 Martin Baulig <martin@ximian.com>
13502 * expression.cs (Invocation.BetterConversion): Prefer int over
13503 uint; short over ushort; long over ulong for integer literals.
13504 Use ImplicitConversionExists instead of StandardConversionExists
13505 since we also need to check for user-defined implicit conversions.
13506 Fixes #34165. Added test-173.cs.
13508 2002-11-16 Martin Baulig <martin@ximian.com>
13510 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13511 with the `true' and `false' literals. Fixes #33151.
13513 2002-11-16 Martin Baulig <martin@ximian.com>
13515 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13516 October 22nd; don't do the cs1540 check for static members.
13518 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13519 now using our own filter here and doing the cs1540 check again.
13521 2002-11-16 Martin Baulig <martin@ximian.com>
13523 * support.cs (InternalParameters): Don't crash if we don't have
13524 any fixed parameters. Fixes #33532.
13526 2002-11-16 Martin Baulig <martin@ximian.com>
13528 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13529 when looking up static methods to make this work on Windows.
13532 2002-11-16 Martin Baulig <martin@ximian.com>
13534 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13535 a setter rather than using PropertyInfo.CanWrite.
13537 2002-11-15 Nick Drochak <ndrochak@gol.com>
13539 * class.cs: Allow acces to block member by subclasses. Fixes build
13542 2002-11-14 Martin Baulig <martin@ximian.com>
13544 * class.cs (Constructor.Emit): Added the extern/block check.
13547 2002-11-14 Martin Baulig <martin@ximian.com>
13549 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13550 iteration while looking for indexers, this is needed because the
13551 indexer may have a different name in our base classes. Fixed the
13552 error reporting (no indexers at all, not get accessor, no
13553 overloaded match). Fixes bug #33089.
13554 (IndexerAccess.DoResolveLValue): Likewise.
13556 2002-11-14 Martin Baulig <martin@ximian.com>
13558 * class.cs (PropertyBase.CheckBase): Make this work for multiple
13559 indexers. Fixes the first part of bug #33089.
13560 (MethodSignature.InheritableMemberSignatureCompare): Added support
13563 2002-11-13 Ravi Pratap <ravi@ximian.com>
13565 * attribute.cs (Attribute.Resolve): Catch the
13566 NullReferenceException and report it since it isn't supposed to
13569 2002-11-12 Miguel de Icaza <miguel@ximian.com>
13571 * expression.cs (Binary.EmitBranchable): Also handle the cases for
13572 LogicalOr and LogicalAnd that can benefit from recursively
13573 handling EmitBranchable. The code now should be nice for Paolo.
13575 2002-11-08 Miguel de Icaza <miguel@ximian.com>
13577 * typemanager.cs (LookupType): Added a negative-hit hashtable for
13578 the Type lookups, as we perform quite a number of lookups on
13579 non-Types. This can be removed once we can deterministically tell
13580 whether we have a type or a namespace in advance.
13582 But this might require special hacks from our corlib.
13586 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13587 and double which avoids a conversion from an integer to a double.
13589 * expression.cs: tiny optimization, avoid calling IsConstant,
13590 because it effectively performs the lookup twice.
13592 2002-11-06 Miguel de Icaza <miguel@ximian.com>
13594 But a bogus return here to keep the semantics of the old code
13595 until the Mono runtime is fixed.
13597 * pending.cs (GetMissingInterfaces): New method used to remove all
13598 the interfaces that are already implemented by our parent
13599 classes from the list of pending methods.
13601 * interface.cs: Add checks for calls after ResolveTypeExpr.
13603 2002-11-05 Miguel de Icaza <miguel@ximian.com>
13605 * class.cs (Class.Emit): Report warning 67: event not used if the
13606 warning level is beyond 3.
13608 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13609 being a NullLiteral.
13611 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13614 * class.cs (TypeContainer.GetClassBases): Cover a missing code
13615 path that might fail if a type can not be resolved.
13617 * expression.cs (Binary.Emit): Emit unsigned versions of the
13620 * driver.cs: use error 5.
13622 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13624 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13626 2002-11-01 Miguel de Icaza <miguel@ximian.com>
13628 * cs-parser.jay (switch_section): A beautiful patch from Martin
13629 Baulig that fixed 33094.
13631 2002-10-31 Miguel de Icaza <miguel@ximian.com>
13633 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13634 Check whether the base is abstract and report an error if so.
13636 * expression.cs (IndexerAccess.DoResolveLValue,
13637 IndexerAccess.DoResolve): ditto.
13639 (Invocation.DoResolve): ditto.
13641 (Invocation.FullMethodDesc): Improve the report string.
13643 * statement.cs (Block): Eliminate IsVariableDefined as it is
13644 basically just a wrapper for GetVariableInfo.
13646 * ecore.cs (SimpleName): Use new
13648 * support.cs (ReflectionParamter.ParameterType): We unwrap the
13649 type, as we return the actual parameter ref/unref state on a
13652 2002-10-30 Miguel de Icaza <miguel@ximian.com>
13654 * support.cs: Return proper flags REF/OUT fixing the previous
13657 * expression.cs: Reverted last patch, that was wrong. Is_ref is
13658 not used to mean `ref' but `ref or out' in ParameterReference
13660 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13661 full type signature instead of calling TypeManger.CSharpName
13664 * support.cs (InternalParameters.ParameterDesc): Do not compare
13665 directly to the modflags, because REF/OUT will actually be bitsets
13668 * delegate.cs (VerifyMethod): Check also the modifiers.
13670 * cs-tokenizer.cs: Fix bug where floating point values with an
13671 exponent where a sign was missing was ignored.
13673 * driver.cs: Allow multiple assemblies to be specified in a single
13676 2002-10-28 Miguel de Icaza <miguel@ximian.com>
13678 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
13679 because identifiers after a parenthesis would end up in this kind
13680 of production, and we needed to desamiguate it for having casts
13683 (UserDefinedType *) xxx
13685 2002-10-24 Miguel de Icaza <miguel@ximian.com>
13687 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13688 we should set on the Bindingflags.NonPublic, but not turn on
13689 private_ok. private_ok controls whether a Private member is
13690 returned (this is chekced on the filter routine), while the
13691 BindingFlags.NonPublic just controls whether private/protected
13692 will be allowed. This fixes the problem part of the problem of
13693 private properties being allowed to be used in derived classes.
13695 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13696 so we can call the children DoResolveLValue method (this will
13697 properly signal errors on lvalue assignments to base properties)
13699 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13700 getter are null, and we have a property info, we know that this
13701 happened because the lookup failed, so we report an error 122 for
13702 protection level violation.
13704 We also silently return if setter and getter are null in the
13705 resolve functions, this condition only happens if we have flagged
13706 the error before. This is the other half of the problem.
13708 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13709 not have accessibility information, that is why we were returning
13710 true in the filter function in typemanager.cs.
13712 To properly report 122 (property is inaccessible because of its
13713 protection level) correctly, we report this error in ResolveAccess
13714 by failing if both the setter and the getter are lacking (ie, the
13717 DoResolve and DoLResolve have been modified to check for both
13718 setter/getter being null and returning silently, the reason being
13719 that I did not want to put the knowledge about this error in upper
13722 int old = Report.Errors;
13723 x = new PropertyExpr (...);
13724 if (old != Report.Errors)
13729 So the property expr is returned, but it is invalid, so the error
13730 will be flagged during the resolve process.
13732 * class.cs: Remove InheritablePropertySignatureCompare from the
13733 class, as we no longer depend on the property signature to compute
13734 whether it is possible to implement a method or not.
13736 The reason is that calling PropertyInfo.GetGetMethod will return
13737 null (in .NET, in Mono it works, and we should change this), in
13738 cases where the Get Method does not exist in that particular
13743 class X { public virtual int A { get { return 1; } } }
13745 class Z : Y { public override int A { get { return 2; } } }
13747 Would fail in Z because the parent (Y) would not have the property
13748 defined. So we avoid this completely now (because the alternative
13749 fix was ugly and slow), and we now depend exclusively on the
13752 (PropertyBase.CheckBase): Use a method-base mechanism to find our
13753 reference method, instead of using the property.
13755 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13756 routines are gone now.
13758 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13759 names, they were incorrectly named.
13761 * cs-tokenizer.cs: Return are more gentle token on failure.
13763 * pending.cs (PendingImplementation.InterfaceMethod): This routine
13764 had an out-of-sync index variable, which caused it to remove from
13765 the list of pending methods the wrong method sometimes.
13767 2002-10-22 Miguel de Icaza <miguel@ximian.com>
13769 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13770 CanWrite, because those refer to this particular instance of the
13771 property, and do not take into account the fact that we can
13772 override single members of a property.
13774 Constructor requires an EmitContext. The resolution process does
13775 not happen here, but we need to compute the accessors before,
13776 because the resolution does not always happen for properties.
13778 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13779 subclass, before we did not update this flag, but we did update
13782 (GetAccessors): Drop this routine, as it did not work in the
13783 presence of partially overwritten set/get methods.
13785 Notice that this broke the cs1540 detection, but that will require
13788 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13792 * driver.cs: issue a warning instead of an error if we don't support
13793 debugging for the platform. Also ignore a couple of errors that may
13794 arise when trying to write the symbols. Undo my previous patch.
13796 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13798 * driver.cs: ignore /debug switch except for Unix platforms.
13800 2002-10-23 Nick Drochak <ndrochak@gol.com>
13802 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13804 2002-10-21 Miguel de Icaza <miguel@ximian.com>
13806 * driver.cs: Do not make mcs-debug conditional, so we do not break
13807 builds that use it.
13809 * statement.cs (UsageVector.MergeChildren): I would like Martin to
13810 review this patch. But basically after all the children variables
13811 have been merged, the value of "Breaks" was not being set to
13812 new_breaks for Switch blocks. I think that it should be set after
13813 it has executed. Currently I set this to the value of new_breaks,
13814 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13815 conservative, but I do not understand this code very well.
13817 I did not break anything in the build, so that is good ;-)
13819 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13821 2002-10-20 Mark Crichton <crichton@gimp.org>
13823 * cfold.cs: Fixed compile blocker. Really fixed it this time.
13825 2002-10-20 Nick Drochak <ndrochak@gol.com>
13827 * cfold.cs: Fixed compile blocker.
13829 2002-10-20 Miguel de Icaza <miguel@ximian.com>
13831 * driver.cs: I was chekcing the key, not the file.
13833 2002-10-19 Ravi Pratap <ravi@ximian.com>
13835 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13836 message that we were generating - we just need to silently return
13839 2002-10-19 Miguel de Icaza <miguel@ximian.com>
13841 * class.cs (Event.Define): Change my previous commit, as this
13842 breaks the debugger. This is a temporary hack, as it seems like
13843 the compiler is generating events incorrectly to begin with.
13845 * expression.cs (Binary.ResolveOperator): Added support for
13846 "U operator - (E x, E y)"
13848 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13851 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13852 init-only variables, but this path did not take into account that
13853 there might be also instance readonly variables. Correct this
13856 This fixes bug 32253
13858 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13861 * driver.cs: Change the extension for modules to `netmodule'
13863 * cs-parser.jay: Improved slightly the location tracking for
13864 the debugger symbols.
13866 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13867 modifiers that were specified instead of the hardcoded value
13868 (FamAndAssem). This was basically ignoring the static modifier,
13869 and others. Fixes 32429.
13871 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13872 fixed a bug in the process (32476)
13874 * expression.cs (ArrayAccess.EmitAssign): Patch from
13875 hwang_rob@yahoo.ca that fixes bug 31834.3
13877 2002-10-18 Miguel de Icaza <miguel@ximian.com>
13879 * driver.cs: Make the module extension .netmodule.
13881 2002-10-16 Miguel de Icaza <miguel@ximian.com>
13883 * driver.cs: Report an error if the resource file is not found
13884 instead of crashing.
13886 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13887 false, like Emit does.
13889 2002-10-16 Nick Drochak <ndrochak@gol.com>
13891 * typemanager.cs: Remove unused private member. Also reported mcs
13892 bug to report this as a warning like csc.
13894 2002-10-15 Martin Baulig <martin@gnome.org>
13896 * statement.cs (Statement.Emit): Made this a virtual method; emits
13897 the line number info and calls DoEmit().
13898 (Statement.DoEmit): New protected abstract method, formerly knows
13899 as Statement.Emit().
13901 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13903 2002-10-11 Miguel de Icaza <miguel@ximian.com>
13905 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13906 have fixed a remaining problem: not every AddXXXX was adding a
13907 fully qualified name.
13909 Now everyone registers a fully qualified name in the DeclSpace as
13910 being defined instead of the partial name.
13912 Downsides: we are slower than we need to be due to the excess
13913 copies and the names being registered this way.
13915 The reason for this is that we currently depend (on the corlib
13916 bootstrap for instance) that types are fully qualified, because
13917 we dump all the types in the namespace, and we should really have
13918 types inserted into the proper namespace, so we can only store the
13919 basenames in the defined_names array.
13921 2002-10-10 Martin Baulig <martin@gnome.org>
13923 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13924 from bug #31834, see the bug report for a testcase which is
13927 2002-10-10 Martin Baulig <martin@gnome.org>
13929 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13930 flow analysis code for this.
13932 * statement.cs (Do, While, For): Tell the flow analysis code about
13934 (FlowBranching.UsageVector): Added support for infinite loops.
13935 (Block.Resolve): Moved the dead code elimination here and use flow
13938 2002-10-09 Miguel de Icaza <miguel@ximian.com>
13940 * class.cs (Field.Define): Catch cycles on struct type
13943 * typemanager.cs (IsUnmanagedtype): Do not recursively check
13944 fields if the fields are static. We only need to check instance
13947 * expression.cs (As.DoResolve): Test for reference type.
13949 * statement.cs (Using.ResolveExpression): Use
13950 ConvertImplicitRequired, not ConvertImplicit which reports an
13952 (Using.ResolveLocalVariableDecls): ditto.
13954 * expression.cs (Binary.ResolveOperator): Report errors in a few
13955 places where we had to.
13957 * typemanager.cs (IsUnmanagedtype): Finish implementation.
13959 2002-10-08 Miguel de Icaza <miguel@ximian.com>
13961 * expression.cs: Use StoreFromPtr instead of extracting the type
13962 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
13964 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13965 an enumeration value to a System.Enum, but System.Enum is not a
13966 value type, but an class type, so we need to box.
13968 (Expression.ConvertExplicit): One codepath could return
13969 errors but not flag them. Fix this. Fixes #31853
13971 * parameter.cs (Resolve): Do not allow void as a parameter type.
13973 2002-10-06 Martin Baulig <martin@gnome.org>
13975 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13976 if it's a class type and not a struct. Fixes #31815.
13978 2002-10-06 Martin Baulig <martin@gnome.org>
13980 * statement.cs: Reworked the flow analysis code a bit to make it
13981 usable for dead code elimination.
13983 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13985 * cs-parser.jay: allow empty source files. Fixes bug #31781.
13987 2002-10-04 Miguel de Icaza <miguel@ximian.com>
13989 * expression.cs (ComposedCast.DoResolveType): A quick workaround
13990 to fix the test 165, will investigate deeper.
13992 2002-10-04 Martin Baulig <martin@gnome.org>
13994 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13995 finally blocks actually work.
13996 (Try.Resolve): We don't need to create a sibling for `finally' if
13997 there is no finally block.
13999 2002-10-04 Martin Baulig <martin@gnome.org>
14001 * class.cs (Constructor.Define): The default accessibility for a
14002 non-default constructor is private, not public.
14004 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14006 * class.cs (Constructor): Make AllowedModifiers public, add
14009 * cs-parser.jay: Perform the modifiers test here, as the
14010 constructor for the Constructor class usually receives a zero
14011 because of the way we create it (first we create, later we
14012 customize, and we were never checking the modifiers).
14014 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14015 is a version of LookupTypeReflection that includes the type-name
14016 cache. This can be used as a fast path for functions that know
14017 the fully qualified name and are only calling into *.GetType() to
14018 obtain a composed type.
14020 This is also used by TypeManager.LookupType during its type
14023 (LookupType): We now also track the real type name, as sometimes
14024 we can get a quey for the real type name from things like
14025 ComposedCast. This fixes bug 31422.
14027 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14028 complete type fullname, it does not have to go through the type
14029 resolution system to obtain the composed version of the type (for
14030 obtaining arrays or pointers).
14032 (Conditional.Emit): Use the EmitBoolExpression to
14033 generate nicer code, as requested by Paolo.
14035 (ArrayCreation.CheckIndices): Use the patch from
14036 hwang_rob@yahoo.ca to validate the array initializers.
14038 2002-10-03 Miguel de Icaza <miguel@ximian.com>
14040 * class.cs (ConstructorInitializer.Emit): simplify code by using
14041 Invocation.EmitCall, and at the same time, fix the bugs in calling
14042 parent constructors that took variable arguments.
14044 * ecore.cs (Expression.ConvertNumericExplicit,
14045 Expression.ImplicitNumericConversion): Remove the code that
14046 manually wrapped decimal (InternalTypeConstructor call is now gone
14049 * expression.cs (Cast.TryReduce): Also handle decimal types when
14050 trying to perform a constant fold on the type.
14052 * typemanager.cs (IsUnmanagedtype): Partially implemented.
14054 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14055 that only turned off an error report, and did nothing else.
14057 2002-10-02 Miguel de Icaza <miguel@ximian.com>
14059 * driver.cs: Handle and ignore /fullpaths
14061 2002-10-01 Miguel de Icaza <miguel@ximian.com>
14063 * expression.cs (Binary.ResolveOperator): Catch the case where
14064 DoNumericPromotions returns true,
14066 (Binary.DoNumericPromotions): Simplify the code, and the tests.
14068 2002-09-27 Miguel de Icaza <miguel@ximian.com>
14070 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14073 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14075 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14076 conversion exists, but it is also required that the conversion be
14077 performed. This manifested in "(Type64Enum) 2".
14079 * class.cs (TypeManager.AddMethod): The fix is not to change
14080 AddEnum, because that one was using a fully qualified name (every
14081 DeclSpace derivative does), but to change the AddMethod routine
14082 that was using an un-namespaced name. This now correctly reports
14083 the duplicated name.
14085 Revert patch until I can properly fix it. The issue
14086 is that we have a shared Type space across all namespaces
14087 currently, which is wrong.
14089 Options include making the Namespace a DeclSpace, and merge
14090 current_namespace/current_container in the parser.
14092 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14094 * cs-parser.jay: Improve error reporting when we get a different
14095 kind of expression in local_variable_type and
14096 local_variable_pointer_type.
14098 Propagate this to avoid missleading errors being reported.
14100 * ecore.cs (ImplicitReferenceConversion): treat
14101 TypeManager.value_type as a target just like object_type. As
14106 Is valid, and needs to result in the int 1 being boxed before it
14107 is assigned to the value type v.
14109 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14110 to validate the enumeration name.
14112 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14113 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14114 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14116 * ecore.cs (TryImplicitIntConversion): When doing an
14117 implicit-enumeration-conversion, check if the type is 64-bits and
14118 perform a conversion before passing to EnumConstant.
14120 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14122 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14123 report ambiguous type references. Unlike the MS version, we
14124 report what the ambiguity is. Innovation at work ;-)
14126 (DeclSpace.FindType): Require a location argument to
14127 display when we display an ambiguous error.
14129 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14131 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14133 * expression.cs (EmitDynamicInitializers): Apply patch from
14134 hwang_rob@yahoo.ca that fixes the order in which we emit our
14137 2002-09-21 Martin Baulig <martin@gnome.org>
14139 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14140 delegate takes no arguments.
14142 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14144 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14147 * expression.cs: Extract the underlying type.
14149 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14151 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14153 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14155 * class.cs (TypeContainer.DefineType): We can not use the nice
14156 PackingSize with the size set to 1 DefineType method, because it
14157 will not allow us to define the interfaces that the struct
14160 This completes the fixing of bug 27287
14162 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14163 means also structs. This fixes part of the problem.
14164 (Expresion.ImplicitReferenceConversionExists): ditto.
14166 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14167 error if there were no errors reported during the type lookup
14168 process, to avoid duplicates or redundant errors. Without this
14169 you would get an ambiguous errors plus a type not found. We have
14170 beaten the user enough with the first error.
14172 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14175 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14176 during the resolution process, stop the lookup, this avoids
14177 repeated error reports (same error twice).
14179 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14181 * typemanager.cs (LookupType): Redo the type lookup code to match
14182 the needs of System.Reflection.
14184 The issue is that System.Reflection requires references to nested
14185 types to begin with a "+" sign instead of a dot. So toplevel
14186 types look like: "NameSpace.TopLevelClass", and nested ones look
14187 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14190 2002-09-19 Martin Baulig <martin@gnome.org>
14192 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14193 says that a method always returns or always throws an exception,
14194 don't report the CS0161.
14196 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14197 set `Returns = new_returns'.
14199 2002-09-19 Martin Baulig <martin@gnome.org>
14201 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14202 to an enum constant, check for a CS0176.
14204 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14206 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14207 for operators that must be in pairs and report errors.
14209 * ecore.cs (SimpleName.DoResolveType): During the initial type
14210 resolution process, when we define types recursively, we must
14211 check first for types in our current scope before we perform
14212 lookups in the enclosing scopes.
14214 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14216 (Invocation.VerifyArgumentsCompat): Call
14217 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14218 I thought we were supposed to always call this, but there are a
14219 few places in the code where we dont do it.
14221 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14223 * driver.cs: Add support in -linkres and -resource to specify the
14224 name of the identifier.
14226 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14228 * ecore.cs (StandardConversionExists): Sync with the conversion
14229 code: allow anything-* to void* conversions.
14231 (FindMostSpecificSource): Use an Expression argument
14232 instead of a Type, because we might be handed over a Literal which
14233 gets a few more implicit conversions that plain types do not. So
14234 this information was being lost.
14236 Also, we drop the temporary type-holder expression when not
14239 2002-09-17 Martin Baulig <martin@gnome.org>
14241 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14242 this is an explicit interface implementation.
14244 2002-09-17 Martin Baulig <martin@gnome.org>
14246 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14247 different `IndexerName' attributes.
14249 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14250 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14251 virtual CommonResolve().
14253 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14255 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14256 and convert that to the UnderlyingType.
14258 * statement.cs (Foreach.Resolve): Indexers are just like variables
14259 or PropertyAccesses.
14261 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14262 inside quoted strings, we were not doing this before.
14264 2002-09-16 Martin Baulig <martin@gnome.org>
14266 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14267 resolve it. This is needed for the definite assignment check of the
14268 instance expression, fixes bug #29846.
14269 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14271 2002-09-16 Nick Drochak <ndrochak@gol.com>
14273 * parameter.cs: Fix compile error. Cannot reference static member
14274 from an instance object. Is this an mcs bug?
14276 2002-09-14 Martin Baulig <martin@gnome.org>
14278 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14279 multiple times. Fixes bug #30295, added test-166.cs.
14281 2002-09-14 Martin Baulig <martin@gnome.org>
14283 * statement.cs (Block.Emit): Don't emit unreachable code.
14284 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14285 `break' statements.
14286 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14288 2002-09-14 Martin Baulig <martin@gnome.org>
14290 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14293 2002-09-14 Martin Baulig <martin@gnome.org>
14295 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14296 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14297 be false on the ms runtime.
14299 2002-09-13 Martin Baulig <martin@gnome.org>
14301 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14302 the CS0038 error message.
14304 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14306 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14307 constant inside, return it.
14309 2002-09-12 Martin Baulig <martin@gnome.org>
14311 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14312 implicit conversion can be done between enum types.
14314 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14315 check whether an implicit conversion to the current enum's UnderlyingType
14316 exists and report an error if not.
14318 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14319 without debugging support.
14321 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14322 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14324 2002-09-12 Martin Baulig <martin@gnome.org>
14326 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14328 * ecore.cs (IMemberExpr.DeclaringType): New property.
14329 (SimpleName.SimpleNameResolve): Check whether we're accessing a
14330 nonstatic member of an outer type (CS0038).
14332 2002-09-11 Miguel de Icaza <miguel@ximian.com>
14334 * driver.cs: Activate the using-error detector at warning level
14335 4 (at least for MS-compatible APIs).
14337 * namespace.cs (VerifyUsing): Small buglett fix.
14339 * pending.cs (PendingImplementation): pass the container pointer.
14341 * interface.cs (GetMethods): Allow for recursive definition. Long
14342 term, I would like to move every type to support recursive
14343 definitions, not the current ordering mechanism that we have right
14346 The situation is this: Attributes are handled before interfaces,
14347 so we can apply attributes to interfaces. But some attributes
14348 implement interfaces, we will now handle the simple cases
14349 (recursive definitions will just get an error).
14351 * parameter.cs: Only invalidate types at the end if we fail to
14354 2002-09-09 Martin Baulig <martin@gnome.org>
14356 * ecore.cs (PropertyExpr.Emit): Also check for
14357 TypeManager.system_int_array_get_length so this'll also work when
14358 compiling corlib. Fixes #30003.
14360 2002-09-09 Martin Baulig <martin@gnome.org>
14362 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14363 and throw an exception if we can't get the type's size. Fixed #30040,
14366 2002-09-09 Martin Baulig <martin@gnome.org>
14368 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14370 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14371 context. Fixes bug #30027.
14373 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14374 virtual functions. Fixes bug #30043, added test-164.cs.
14376 2002-09-08 Ravi Pratap <ravi@ximian.com>
14378 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14380 2002-09-08 Nick Drochak <ndrochak@gol.com>
14382 * driver.cs: Use an object to get the windows codepage since it's not a
14385 2002-09-08 Miguel de Icaza <miguel@ximian.com>
14387 * statement.cs (For.Emit): for infinite loops (test == null)
14388 return whether there is a break inside, not always "true".
14390 * namespace.cs (UsingEntry): New struct to hold the name of the
14391 using definition, the location where it is defined, and whether it
14392 has been used in a successful type lookup.
14394 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14399 2002-09-06 Ravi Pratap <ravi@ximian.com>
14401 * attribute.cs : Fix incorrect code which relied on catching
14402 a NullReferenceException to detect a null being passed in
14403 where an object was expected.
14405 2002-09-06 Miguel de Icaza <miguel@ximian.com>
14407 * statement.cs (Try): flag the catch variable as assigned
14409 * expression.cs (Cast): Simplified by using ResolveType instead of
14410 manually resolving.
14412 * statement.cs (Catch): Fix bug by using ResolveType.
14414 2002-09-06 Ravi Pratap <ravi@ximian.com>
14416 * expression.cs (BetterConversion): Special case for when we have
14417 a NullLiteral as the argument and we have to choose between string
14418 and object types - we choose string the way csc does.
14420 * attribute.cs (Attribute.Resolve): Catch the
14421 NullReferenceException and report error #182 since the Mono
14422 runtime no more has the bug and having this exception raised means
14423 we tried to select a constructor which takes an object and is
14426 2002-09-05 Ravi Pratap <ravi@ximian.com>
14428 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14429 message (1502, 1503) when we can't locate a method after overload
14430 resolution. This is much more informative and closes the bug
14433 * interface.cs (PopulateMethod): Return if there are no argument
14434 types. Fixes a NullReferenceException bug.
14436 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14437 expressions too. Previously we were checking only in one place for
14438 positional arguments leaving out named arguments.
14440 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14441 type to the enum type is not allowed. Remove code corresponding to
14444 (ConvertNumericExplicit): Allow explicit conversions from
14445 the underlying type to enum type. This precisely follows the spec
14446 and closes a bug filed by Gonzalo.
14448 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14451 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14453 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14455 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14456 it was important that we stored the right value after the
14457 reduction in `converted'.
14459 2002-09-04 Martin Baulig <martin@gnome.org>
14461 * location.cs (Location.SymbolDocument): Use full pathnames for the
14464 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14466 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14467 of the expression resolve mechanism, because that will catch the
14468 SimpleName error failures.
14470 (Conditional): If we can not resolve the
14471 expression, return, do not crash.
14473 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14476 (location): display token name instead of its number.
14478 2002-08-28 Martin Baulig <martin@gnome.org>
14480 * expression.cs (Binary.ResolveOperator): Don't silently return
14481 but return an error if an operator cannot be applied between two
14484 2002-08-28 Martin Baulig <martin@gnome.org>
14486 * class.cs (Constructor.Define): Set the permission attributes
14487 correctly instead of making all constructors public.
14489 2002-08-28 Martin Baulig <martin@gnome.org>
14491 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14492 for private members before reporting a CS0103; if we find anything,
14495 2002-08-28 Martin Baulig <martin@gnome.org>
14497 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14498 to check whether `closure_start_type == closure_invocation_type',
14499 we also need to check whether `m.DeclaringType == closure_invocation_type'
14500 before bypassing the permission checks. We might be accessing
14501 protected/private members from the base class.
14502 (TypeManager.RealMemberLookup): Only set private_ok if private
14503 members were requested via BindingFlags.NonPublic.
14505 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14507 * expression.cs (MemberAccess.ResolveMemberAccess): Set
14508 MethodGroupExpr.IsExplicitImpl if appropriate.
14509 (Invocation.DoResolve): Don't report the CS0120 for explicit
14510 interface implementations.
14512 2002-08-27 Martin Baulig <martin@gnome.org>
14514 * expression.cs (Invocation.DoResolve): If this is a static
14515 method and we don't have an InstanceExpression, we must report
14518 2002-08-25 Martin Baulig <martin@gnome.org>
14520 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14521 `==' between a valuetype and an object.
14523 2002-08-25 Miguel de Icaza <miguel@ximian.com>
14525 * ecore.cs (TypeExpr): Provide a ToString method.
14527 2002-08-24 Martin Baulig <martin@gnome.org>
14529 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14530 now called proggie.dbg and it's a binary file.
14532 2002-08-23 Martin Baulig <martin@gnome.org>
14534 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14536 2002-08-23 Martin Baulig <martin@gnome.org>
14538 * struct.cs (MyStructInfo.ctor): Make this work with empty
14539 structs; it's not allowed to use foreach() on null.
14541 2002-08-23 Martin Baulig <martin@gnome.org>
14543 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14544 writer the full pathname of the generated assembly.
14546 2002-08-23 Martin Baulig <martin@gnome.org>
14548 * statements.cs (FlowBranching.UsageVector.MergeChildren):
14549 A `finally' block never returns or breaks; improved handling of
14552 2002-08-23 Martin Baulig <martin@gnome.org>
14554 * statement.cs (Throw.Resolve): Allow `throw null'.
14556 2002-08-23 Martin Baulig <martin@gnome.org>
14558 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14559 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14560 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
14561 MemberLookup would return a wrong event if this is an explicit
14562 interface implementation and the class has an event with the same
14565 2002-08-23 Martin Baulig <martin@gnome.org>
14567 * statement.cs (Block.AddChildVariableNames): New public method.
14568 (Block.AddChildVariableName): Likewise.
14569 (Block.IsVariableNameUsedInChildBlock): Likewise.
14570 (Block.AddVariable): Check whether a variable name has already
14571 been used in a child block.
14573 * cs-parser.jay (declare_local_variables): Mark all variable names
14574 from the current block as being used in a child block in the
14577 2002-08-23 Martin Baulig <martin@gnome.org>
14579 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14580 find the symbol writer.
14582 * driver.cs: csc also allows the arguments to /define being
14583 separated by commas, not only by semicolons.
14585 2002-08-23 Martin Baulig <martin@gnome.org>
14587 * interface.cs (Interface.GetMembers): Added static check for events.
14589 2002-08-15 Martin Baulig <martin@gnome.org>
14591 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14592 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14594 * ecore.cs (Expression.MemberLookup): Added documentation and explained
14595 why the MethodData.EmitDestructor() change was necessary.
14597 2002-08-20 Martin Baulig <martin@gnome.org>
14599 * class.cs (TypeContainer.FindMembers): Added static check for events.
14601 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14603 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14604 use Type.GetEvents(), not Type.FindMembers().
14606 2002-08-20 Martin Baulig <martin@gnome.org>
14608 * decl.cs (MemberCache): Added a special method cache which will
14609 be used for method-only searched. This ensures that a method
14610 search will return a MethodInfo with the correct ReflectedType for
14613 2002-08-20 Martin Baulig <martin@gnome.org>
14615 * decl.cs (DeclSpace.FindMembers): Made this public.
14617 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14619 * delegate.cs: fixed build on windows.
14620 [FIXME: Filed as bug #29150: MCS must report these errors.]
14622 2002-08-19 Ravi Pratap <ravi@ximian.com>
14624 * ecore.cs (StandardConversionExists): Return a false
14625 if we are trying to convert the void type to anything else
14626 since that is not allowed.
14628 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14629 we flag error 70 in the event an event is trying to be accessed
14630 directly from outside the declaring type.
14632 2002-08-20 Martin Baulig <martin@gnome.org>
14634 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14635 MemberCache from typemanager.cs to decl.cs.
14637 2002-08-19 Martin Baulig <martin@gnome.org>
14639 * class.cs (TypeContainer): Implement IMemberContainer.
14640 (TypeContainer.DefineMembers): Create the MemberCache.
14641 (TypeContainer.FindMembers): Do better BindingFlags checking; only
14642 return public members if BindingFlags.Public was given, check
14643 whether members are static.
14645 2002-08-16 Martin Baulig <martin@gnome.org>
14647 * decl.cs (DeclSpace.Define): Splitted this in Define and
14648 DefineMembers. DefineMembers is called first and initializes the
14651 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
14652 DefineMembers() on all our DeclSpaces.
14654 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14655 but call DefineMembers() on all nested interfaces. We call their
14656 Define() in our new Define() function.
14658 * interface.cs (Interface): Implement IMemberContainer.
14659 (Interface.Define): Moved all code except the attribute stuf to
14661 (Interface.DefineMembers): Initialize the member cache.
14663 * typemanager.cs (IMemberFinder): Removed this interface, we don't
14664 need this anymore since we can use MemberCache.FindMembers directly.
14666 2002-08-19 Martin Baulig <martin@gnome.org>
14668 * typemanager.cs (MemberCache): When creating the cache for an
14669 interface type, add all inherited members.
14670 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14671 to `out bool used_cache' and documented it.
14672 (TypeManager.MemberLookup): If we already used the cache in the first
14673 iteration, we don't need to do the interfaces check.
14675 2002-08-19 Martin Baulig <martin@gnome.org>
14677 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
14678 here from IMemberFinder and don't implement this interface anymore.
14679 (DeclSpace.MemberCache): Moved here from IMemberFinder.
14681 * typemanager.cs (IMemberFinder): This interface is now only used by
14682 classes which actually support the member cache.
14683 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14684 since we only put DeclSpaces into this Hashtable.
14685 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14686 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14688 2002-08-16 Martin Baulig <martin@gnome.org>
14690 * typemanager.cs (ICachingMemberFinder): Removed.
14691 (IMemberFinder.MemberCache): New property.
14692 (TypeManager.FindMembers): Merged this with RealFindMembers().
14693 This function will never be called from TypeManager.MemberLookup()
14694 so we can't use the cache here, just the IMemberFinder.
14695 (TypeManager.MemberLookup_FindMembers): Check whether the
14696 IMemberFinder has a MemberCache and call the cache's FindMembers
14698 (MemberCache): Rewrote larger parts of this yet another time and
14699 cleaned it up a bit.
14701 2002-08-15 Miguel de Icaza <miguel@ximian.com>
14703 * driver.cs (LoadArgs): Support quoting.
14705 (Usage): Show the CSC-like command line arguments.
14707 Improved a few error messages.
14709 2002-08-15 Martin Baulig <martin@gnome.org>
14711 * typemanager.cs (IMemberContainer.Type): New property.
14712 (IMemberContainer.IsInterface): New property.
14714 The following changes are conditional to BROKEN_RUNTIME, which is
14715 defined at the top of the file.
14717 * typemanager.cs (MemberCache.MemberCache): Don't add the base
14718 class'es members, but add all members from TypeHandle.ObjectType
14719 if we're an interface.
14720 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14721 is the current type.
14722 (MemberCache.CacheEntry.Container): Removed this field.
14723 (TypeHandle.GetMembers): Include inherited members.
14725 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14727 * typemanager.cs: fixed compilation and added a comment on a field that
14730 2002-08-15 Martin Baulig <martin@gnome.org>
14732 * class.cs (ConstructorInitializer.Resolve): In the
14733 Expression.MemberLookup call, use the queried_type as
14736 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14737 declared' attribute, it's always true.
14738 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14739 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14740 temporary wrapper for FindMembers which tells MemberLookup whether
14741 members from the base classes are included in the return value.
14742 This will go away soon.
14743 (TypeManager.MemberLookup): Use this temporary hack here; once the
14744 new MemberCache is completed, we don't need to do the DeclaredOnly
14745 looping here anymore since the MemberCache will take care of this.
14746 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14747 (MemberCache): When creating the MemberCache for a class, get
14748 members from the current class and all its base classes.
14749 (MemberCache.CacheEntry.Container): New field. This is a
14750 temporary hack until the Mono runtime is fixed to distinguish
14751 between ReflectedType and DeclaringType. It allows us to use MCS
14752 with both the MS runtime and the unfixed Mono runtime without
14753 problems and without accecting performance.
14754 (MemberCache.SearchMembers): The DeclaredOnly looping from
14755 TypeManager.MemberLookup is now done here.
14757 2002-08-14 Martin Baulig <martin@gnome.org>
14759 * statement.cs (MyStructInfo.MyStructInfo): Don't call
14760 Type.GetFields on dynamic types but get the fields from the
14761 corresponding TypeContainer.
14762 (MyStructInfo.GetStructInfo): Added check for enum types.
14764 * typemanager.cs (MemberList.IsSynchronized): Implemented.
14765 (MemberList.SyncRoot): Implemented.
14766 (TypeManager.FilterWithClosure): No need to check permissions if
14767 closure_start_type == closure_invocation_type, don't crash if
14768 closure_invocation_type is null.
14770 2002-08-13 Martin Baulig <martin@gnome.org>
14772 Rewrote TypeContainer.FindMembers to use a member cache. This
14773 gives us a speed increase of about 35% for the self-hosting MCS
14774 build and of about 15-20% for the class libs (both on GNU/Linux).
14776 * report.cs (Timer): New class to get enhanced profiling. This
14777 whole class is "TIMER" conditional since it remarkably slows down
14780 * class.cs (MemberList): New class. This is an IList wrapper
14781 which we're now using instead of passing MemberInfo[]'s around to
14782 avoid copying this array unnecessarily.
14783 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14784 (ICachingMemberFinder, IMemberContainer): New interface.
14785 (TypeManager.FilterWithClosure): If `criteria' is null, the name
14786 has already been checked, otherwise use it for the name comparision.
14787 (TypeManager.FindMembers): Renamed to RealMemberFinder and
14788 provided wrapper which tries to use ICachingMemberFinder.FindMembers
14789 if possible. Returns a MemberList, not a MemberInfo [].
14790 (TypeHandle): New class, implements IMemberContainer. We create
14791 one instance of this class per type, it contains a MemberCache
14792 which is used to do the member lookups.
14793 (MemberCache): New class. Each instance of this class contains
14794 all members of a type and a name-based hash table.
14795 (MemberCache.FindMembers): This is our new member lookup
14796 function. First, it looks up all members of the requested name in
14797 the hash table. Then, it walks this list and sorts out all
14798 applicable members and returns them.
14800 2002-08-13 Martin Baulig <martin@gnome.org>
14802 In addition to a nice code cleanup, this gives us a performance
14803 increase of about 1.4% on GNU/Linux - not much, but it's already
14804 half a second for the self-hosting MCS compilation.
14806 * typemanager.cs (IMemberFinder): New interface. It is used by
14807 TypeManager.FindMembers to call FindMembers on a TypeContainer,
14808 Enum, Delegate or Interface.
14809 (TypeManager.finder_to_member_finder): New PtrHashtable.
14810 (TypeManager.finder_to_container): Removed.
14811 (TypeManager.finder_to_delegate): Removed.
14812 (TypeManager.finder_to_interface): Removed.
14813 (TypeManager.finder_to_enum): Removed.
14815 * interface.cs (Interface): Implement IMemberFinder.
14817 * delegate.cs (Delegate): Implement IMemberFinder.
14819 * enum.cs (Enum): Implement IMemberFinder.
14821 * class.cs (TypeContainer): Implement IMemberFinder.
14823 2002-08-12 Martin Baulig <martin@gnome.org>
14825 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14827 2002-08-12 Martin Baulig <martin@gnome.org>
14829 * ecore.cs (ITypeExpression): New interface for expressions which
14831 (TypeExpression): Renamed to TypeLookupExpression.
14832 (Expression.DoResolve): If we're doing a types-only lookup, the
14833 expression must implement the ITypeExpression interface and we
14834 call DoResolveType() on it.
14835 (SimpleName): Implement the new ITypeExpression interface.
14836 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14837 hack, the situation that we're only looking up types can't happen
14838 anymore when this method is called. Moved the type lookup code to
14839 DoResolveType() and call it.
14840 (SimpleName.DoResolveType): This ITypeExpression interface method
14841 is now doing the types-only lookup.
14842 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14843 (ResolveFlags): Added MaskExprClass.
14845 * expression.cs (MemberAccess): Implement the ITypeExpression
14847 (MemberAccess.DoResolve): Added support for a types-only lookup
14848 when we're called via ITypeExpression.DoResolveType().
14849 (ComposedCast): Implement the ITypeExpression interface.
14851 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
14852 Expression.Resolve() with ResolveFlags.Type instead.
14854 2002-08-12 Martin Baulig <martin@gnome.org>
14856 * interface.cs (Interface.Define): Apply attributes.
14858 * attribute.cs (Attribute.ApplyAttributes): Added support for
14859 interface attributes.
14861 2002-08-11 Martin Baulig <martin@gnome.org>
14863 * statement.cs (Block.Emit): Only check the "this" variable if we
14864 do not always throw an exception.
14866 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14867 whether the property has a set accessor.
14869 2002-08-11 Martin Baulig <martin@gnome.org>
14871 Added control flow analysis support for structs.
14873 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14874 with control flow analysis turned off.
14875 (IVariable): New interface.
14876 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14877 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14878 (FieldExpr.DoResolve): Resolve the instance expression with flow
14879 analysis turned off and do the definite assignment check after the
14880 resolving when we know what the expression will resolve to.
14882 * expression.cs (LocalVariableReference, ParameterReference):
14883 Implement the new IVariable interface, only call the flow analysis
14884 code if ec.DoFlowAnalysis is true.
14885 (This): Added constructor which takes a Block argument. Implement
14886 the new IVariable interface.
14887 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14888 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14889 This does the definite assignment checks for struct members.
14891 * class.cs (Constructor.Emit): If this is a non-static `struct'
14892 constructor which doesn't have any initializer, call
14893 Block.AddThisVariable() to tell the flow analysis code that all
14894 struct elements must be initialized before control returns from
14897 * statement.cs (MyStructInfo): New public class.
14898 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14899 argument to this indexer. If non-zero, check an individual struct
14900 member, not the whole struct.
14901 (FlowBranching.CheckOutParameters): Check struct members.
14902 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14903 overloaded versions of these methods which take an additional
14904 `int field_idx' argument to check struct members.
14905 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14906 overloaded versions of these methods which take an additional
14907 `string field_name' argument to check struct member.s
14908 (VariableInfo): Implement the IVariable interface.
14909 (VariableInfo.StructInfo): New public property. Returns the
14910 MyStructInfo instance of the variable if it's a struct or null.
14911 (Block.AddThisVariable): New public method. This is called from
14912 Constructor.Emit() for non-static `struct' constructor which do
14913 not have any initializer. It creates a special variable for the
14914 "this" instance variable which will be checked by the flow
14915 analysis code to ensure that all of the struct's fields are
14916 initialized before control returns from the constructor.
14917 (UsageVector): Added support for struct members. If a
14918 variable/parameter is a struct with N members, we reserve a slot
14919 in the usage vector for each member. A struct is considered fully
14920 initialized if either the struct itself (slot 0) or all its
14921 members are initialized.
14923 2002-08-08 Martin Baulig <martin@gnome.org>
14925 * driver.cs (Driver.MainDriver): Only report an error CS5001
14926 if there were no compilation errors.
14928 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14929 `UnsafeContext' property to determine whether the parent is in
14930 unsafe context rather than checking the parent's ModFlags:
14931 classes nested in an unsafe class are unsafe as well.
14933 2002-08-08 Martin Baulig <martin@gnome.org>
14935 * statement.cs (UsageVector.MergeChildren): Distinguish between
14936 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14937 we return. Added test17() and test18() to test-154.cs.
14939 2002-08-08 Martin Baulig <martin@gnome.org>
14941 * typemanager.cs (TypeManager.FilterWithClosure): If we have
14942 Family access, make sure the invoking type isn't a subclass of the
14943 queried type (that'd be a CS1540).
14945 * ecore.cs (Expression.MemberLookup): Added overloaded version of
14946 this method which takes an additional `Type invocation_type'.
14948 * expression.cs (BaseAccess.DoResolve): Use the base type as
14949 invocation and query type.
14950 (MemberAccess.DoResolve): If the lookup failed and we're about to
14951 report a CS0122, try a lookup with the ec.ContainerType - if this
14952 succeeds, we must report a CS1540.
14954 2002-08-08 Martin Baulig <martin@gnome.org>
14956 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14957 (MethodGroupExpr): Implement the IMemberExpr interface.
14959 * expression (MemberAccess.ResolveMemberAccess): No need to have
14960 any special code for MethodGroupExprs anymore, they're now
14963 2002-08-08 Martin Baulig <martin@gnome.org>
14965 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14966 Family, FamANDAssem and FamORAssem permissions.
14967 (TypeManager.IsSubclassOrNestedChildOf): New public method.
14969 2002-08-08 Martin Baulig <martin@gnome.org>
14971 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14972 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14975 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14977 * driver.cs: implemented /resource option to embed managed resources.
14979 2002-08-07 Martin Baulig <martin@gnome.org>
14981 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14982 (FieldBase.HasFieldInitializer): New public property.
14983 (FieldBase.GetInitializerExpression): New public method. Resolves and
14984 returns the field initializer and makes sure it is only resolved once.
14985 (TypeContainer.EmitFieldInitializers): Call
14986 FieldBase.GetInitializerExpression to get the initializer, this ensures
14987 that it isn't resolved multiple times.
14989 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
14990 the resolving process (SimpleName/MemberLookup) that we're currently
14991 emitting a field initializer (which must not access any instance members,
14992 this is an error CS0236).
14994 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14995 argument, if the `IsFieldInitializer' flag is set, we must report and
14996 error CS0236 and not an error CS0120.
14998 2002-08-07 Martin Baulig <martin@gnome.org>
15000 * ecore.cs (IMemberExpr): New public interface.
15001 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15002 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15003 if the expression is an IMemberExpr.
15005 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15006 to be null, implicitly default to `this' if we're non-static in
15007 this case. Simplified the code a lot by using the new IMemberExpr
15008 interface. Also fixed bug #28176 here.
15010 2002-08-06 Martin Baulig <martin@gnome.org>
15012 * cs-parser.jay (SimpleLookup): Removed. We need to create
15013 ParameterReferences during semantic analysis so that we can do a
15014 type-only search when resolving Cast, TypeOf and SizeOf.
15015 (block): Pass the `current_local_parameters' to the Block's
15018 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15019 argument to the constructor.
15020 (ConstructorInitializer.Resolve): Create a temporary implicit
15021 block with the parameters.
15023 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15024 references here if we aren't doing a type-only search.
15026 * statement.cs (Block): Added constructor which takes a
15027 `Parameters parameters' argument.
15028 (Block.Parameters): New public property.
15030 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15031 to `Parameters' and made it public readonly.
15033 2002-08-06 Martin Baulig <martin@gnome.org>
15035 * ecore.cs (Expression.Warning): Made this public as well.
15037 * report.cs (Report.Debug): Print the contents of collections.
15039 2002-08-06 Martin Baulig <martin@gnome.org>
15041 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
15042 used to tell Resolve() which kinds of expressions it may return.
15043 (Expression.Resolve): Added overloaded version of this method which
15044 takes a `ResolveFlags flags' argument. This can be used to tell
15045 Resolve() which kinds of expressions it may return. Reports a
15047 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15048 ResolveFlags.SimpleName.
15049 (Expression.Error118): Added overloaded version of this method which
15050 takes a `ResolveFlags flags' argument. It uses the flags to determine
15051 which kinds of expressions are allowed.
15053 * expression.cs (Argument.ResolveMethodGroup): New public method.
15054 Resolves an argument, but allows a MethodGroup to be returned.
15055 This is used when invoking a delegate.
15057 * TODO: Updated a bit.
15059 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15061 Fixed compilation with csc.
15063 * ecore.cs: Expression.Error made public. Is this correct? Should
15064 Warning be made public too?
15066 * expression.cs: use ea.Location instead of ea.loc.
15067 [FIXME: Filed as bug #28607: MCS must report these errors.]
15069 2002-08-06 Martin Baulig <martin@gnome.org>
15071 * ecore.cs (Expression.loc): Moved the location here instead of
15072 duplicating it in all derived classes.
15073 (Expression.Location): New public property.
15074 (Expression.Error, Expression.Warning): Made them non-static and
15075 removed the location argument.
15076 (Expression.Warning): Added overloaded version which takes an
15077 `int level' argument.
15078 (Expression.Error118): Make this non-static and removed the
15079 expression and location arguments.
15080 (TypeExpr): Added location argument to the constructor.
15082 * expression.cs (StaticCallExpr): Added location argument to
15084 (Indirection, PointerArithmetic): Likewise.
15085 (CheckedExpr, UnCheckedExpr): Likewise.
15086 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15087 (StringPtr): Likewise.
15090 2002-08-05 Martin Baulig <martin@gnome.org>
15092 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15094 * assign.cs (Assign.DoResolve): Check whether the source
15095 expression is a value or variable.
15097 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15098 while resolving the corresponding blocks.
15100 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15101 an error, don't silently return null.
15103 * statement.cs (Block.AddVariable): Do the error reporting here
15104 and distinguish between CS0128 and CS0136.
15105 (Block.DoResolve): Report all unused labels (warning CS0164).
15106 (LabeledStatement): Pass the location to the constructor.
15107 (LabeledStatement.HasBeenReferenced): New property.
15108 (LabeledStatement.Resolve): Set it to true here.
15110 * statement.cs (Return.Emit): Return success even after reporting
15111 a type mismatch error (CS0126 or CS0127), this is what csc does and
15112 it avoids confusing the users with any consecutive errors.
15114 2002-08-05 Martin Baulig <martin@gnome.org>
15116 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15118 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15120 * expression.cs (MemberAccess.DoResolve): Silently return if an
15121 error has already been reported.
15123 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15124 error has already been reported.
15126 2002-08-05 Martin Baulig <martin@gnome.org>
15128 * statement.cs (UsageVector): Only initialize the `parameters'
15129 vector if we actually have any "out" parameters.
15131 2002-08-05 Martin Baulig <martin@gnome.org>
15133 * expression.cs (Binary.ResolveOperator): When combining delegates,
15134 they must have the same type.
15136 2002-08-05 Martin Baulig <martin@gnome.org>
15138 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15139 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15140 work with the ms runtime and we also don't need it: if we're a
15141 PropertyBuilder and not in the `indexer_arguments' hash, then we
15142 are a property and not an indexer.
15144 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15145 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15146 since the latter one doesn't work with the ms runtime.
15148 2002-08-03 Martin Baulig <martin@gnome.org>
15150 Fixed bugs #27998 and #22735.
15152 * class.cs (Method.IsOperator): New public field.
15153 (Method.CheckBase): Report CS0111 if there's already a method
15154 with the same parameters in the current class. Report CS0508 when
15155 attempting to change the return type of an inherited method.
15156 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15157 and it's not marked abstract or extern.
15158 (PropertyBase): New abstract base class for Property and Indexer.
15159 (PropertyBase.CheckBase): Moved here from Property and made it work
15161 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15162 the same so we can reuse it there.
15163 (Property, Indexer): Derive from PropertyBase.
15164 (MethodSignature.inheritable_property_signature_filter): New delegate
15165 to find properties and indexers.
15167 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15168 argument and improved error reporting.
15170 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15171 EmptyReadOnlyParameters and made it a property.
15173 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15174 version of this method which takes a `PropertyInfo indexer'.
15175 (TypeManager.RegisterIndexer): New method.
15177 * class.cs: Added myself as author of this file :-)
15179 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15181 * class.cs: fixed compilation on windoze.
15183 2002-08-03 Martin Baulig <martin@gnome.org>
15185 * interface.cs (Interface.GetInterfaceBases): Check whether all
15186 base interfaces are at least as accessible than the current one.
15188 * class.cs (TypeContainer.GetClassBases): Check whether base types
15189 are at least as accessible than the current type.
15190 (TypeContainer.AsAccessible): Implemented and made non-static.
15191 (MemberBase.CheckParameters): Report errors if the accessibility
15194 * delegate.cs (Delegate.Delegate): The default visibility is
15195 internal for top-level types and private for nested types.
15196 (Delegate.Define): Report errors if the accessibility checks fail.
15198 * enum.cs (Enum.Enum): The default visibility is internal for
15199 top-level types and private for nested types.
15200 (Enum.DefineType): Compute the correct visibility.
15202 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15203 function which takes a `bool is_toplevel' instead of a TypeContainer.
15205 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15208 2002-08-02 Martin Baulig <martin@gnome.org>
15210 * expression.cs (LocalVariableReferenc): Added constructor which
15211 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15212 (LocalVariableReference.IsReadOnly): New property.
15213 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15214 variable is readonly, use our own readonly flag to do this; you can
15215 use the new constructor to get a writable reference to a read-only
15218 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15219 reference to the local variable.
15221 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15223 * rootcontext.cs (ResolveCore): Also include System.Exception
15225 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15226 we reach an EmptyStatement.
15228 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15231 * expression.cs (Binary.ResolveOperator): Check error result in
15234 use brtrue/brfalse directly and avoid compares to null.
15236 2002-08-02 Martin Baulig <martin@gnome.org>
15238 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15239 Fixes bug #28407, added test-155.cs.
15241 2002-08-01 Martin Baulig <martin@gnome.org>
15243 * class.cs (Event.EmitDefaultMethod): Make this work with static
15244 events. Fixes #28311, added verify-3.cs.
15246 2002-08-01 Martin Baulig <martin@gnome.org>
15248 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15249 `is_disposable' fields.
15250 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15251 `hm.is_disposable' if we're using the collection pattern.
15252 (Foreach.EmitCollectionForeach): Use the correct type for the
15253 enumerator's local variable, only emit the try/finally block if
15254 necessary (fixes #27713).
15256 2002-08-01 Martin Baulig <martin@gnome.org>
15258 * ecore.cs (Expression.report118): Renamed to Error118 and made
15261 * statement.cs (Throw.Resolve): Check whether the expression is of
15262 the correct type (CS0118) and whether the type derives from
15263 System.Exception (CS0155).
15264 (Catch.Resolve): New method. Do the type lookup here and check
15265 whether it derives from System.Exception (CS0155).
15266 (Catch.CatchType, Catch.IsGeneral): New public properties.
15268 * typemanager.cs (TypeManager.exception_type): Added.
15270 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15272 * driver.cs: Updated About function.
15274 2002-07-31 Martin Baulig <martin@gnome.org>
15276 Implemented Control Flow Analysis.
15278 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15279 (EmitContext.CurrentBranching): Added.
15280 (EmitContext.StartFlowBranching): Added.
15281 (EmitContext.EndFlowBranching): Added.
15282 (EmitContext.KillFlowBranching): Added.
15283 (EmitContext.IsVariableAssigned): Added.
15284 (EmitContext.SetVariableAssigned): Added.
15285 (EmitContext.IsParameterAssigned): Added.
15286 (EmitContext.SetParameterAssigned): Added.
15287 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15288 Added control flow analysis stuff here.
15290 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15291 resolve the expression as lvalue.
15292 (LocalVariableReference.DoResolve): Check whether the variable has
15293 already been assigned.
15294 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15295 the parameter as assigned here.
15296 (ParameterReference.DoResolve): Check whether the parameter has already
15298 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15299 expression as lvalue.
15301 * statement.cs (FlowBranching): New class for the flow analysis code.
15302 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15303 (LabeledStatement.IsDefined): New public property.
15304 (LabeledStatement.AddUsageVector): New public method to tell flow
15305 analyis that the label may be reached via a forward jump.
15306 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15308 (VariableInfo.Number): New public field. This is used by flow analysis
15309 to number all locals of a block.
15310 (Block.CountVariables): New public property. This is the number of
15311 local variables in this block (including the locals from all parent
15313 (Block.EmitMeta): Number all the variables.
15315 * statement.cs: Added flow analysis support to all classes.
15317 2002-07-31 Martin Baulig <martin@gnome.org>
15319 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15320 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15321 then use this argument.
15323 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15325 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15326 use this to specify /define options.
15328 2002-07-29 Martin Baulig <martin@gnome.org>
15330 * statement.cs (Fixed): Moved all code that does variable lookups
15331 and resolvings from Emit to Resolve.
15333 * statement.cs (For): Moved all code that does variable lookups
15334 and resolvings from Emit to Resolve.
15336 * statement.cs (Using): Moved all code that does variable lookups
15337 and resolvings from Emit to Resolve.
15339 2002-07-29 Martin Baulig <martin@gnome.org>
15341 * attribute.cs (Attribute.Resolve): Explicitly catch a
15342 System.NullReferenceException when creating the
15343 CustromAttributeBuilder and report a different warning message.
15345 2002-07-29 Martin Baulig <martin@gnome.org>
15347 * support.cs (ParameterData.ParameterName): Added method to
15348 get the name of a parameter.
15350 * typemanager.cs (TypeManager.IsValueType): New public method.
15352 2002-07-29 Martin Baulig <martin@gnome.org>
15354 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
15355 is a flag which specifies that it's either ref or out.
15356 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15357 the out parameter to `out Parameter.Modifier mod', also set the
15358 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15360 * support.cs (InternalParameters.ParameterModifier): Distinguish
15361 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15362 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15364 * expression.cs (Argument.GetParameterModifier): Distinguish
15365 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15366 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15368 2002-07-29 Martin Baulig <martin@gnome.org>
15370 * expression.cs (ParameterReference.ParameterReference): Added
15371 `Location loc' argument to the constructor.
15373 * cs-parser.jay: Pass location to ParameterReference.
15375 2002-07-28 Miguel de Icaza <miguel@ximian.com>
15377 * statement.cs (Try): Initialize the location.
15379 * cs-parser.jay: pass location to Try.
15381 * expression.cs (Unary.Reduce): Change the prototype to return
15382 whether a constant fold could be performed or not. The result is
15383 returned in an out parameters. In the case of Indirection and
15384 AddressOf, we want to perform the full tests.
15386 2002-07-26 Miguel de Icaza <miguel@ximian.com>
15388 * statement.cs (Statement.Emit): Flag dead code.
15390 2002-07-27 Andrew Birkett <andy@nobugs.org>
15392 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15394 2002-07-27 Martin Baulig <martin@gnome.org>
15396 * class.cs (MethodData.Define): Put back call to
15397 TypeManager.AddMethod(), accidentally commented this out.
15399 * report.cs (Debug): New public method to print debugging information,
15400 this is `[Conditional ("DEBUG")]'.
15402 2002-07-26 Martin Baulig <martin@gnome.org>
15404 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15405 (switch_statement): Push the current_block to the switch_stack and
15406 pop it again when we're done with the switch.
15407 (switch_section): The new block is a child of the current_block.
15408 Fixes bug #24007, added test-152.cs.
15410 2002-07-27 Martin Baulig <martin@gnome.org>
15412 * expression.cs (Invocation.EmitArguments): When calling a varargs
15413 function with only its fixed arguments, we need to pass an empty
15416 2002-07-27 Martin Baulig <martin@gnome.org>
15418 Mono 0.13 has been released.
15420 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15422 * driver.cs: Rename --resource to --linkres, because that is what
15423 we do currently, we dont support --resource yet.
15425 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15427 2002-07-25 Martin Baulig <martin@gnome.org>
15429 * class.cs (MethodData): New public class. This is a `method builder'
15430 class for a method or one accessor of a Property/Indexer/Event.
15431 (MethodData.GetMethodFlags): Moved here from MemberBase.
15432 (MethodData.ApplyAttributes): Likewise.
15433 (MethodData.ApplyObsoleteAttribute): Likewise.
15434 (MethodData.ApplyConditionalAttribute): Likewise.
15435 (MethodData.ApplyDllImportAttribute): Likewise.
15436 (MethodData.CheckAbstractAndExternal): Likewise.
15437 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15438 (MethodData.Emit): Formerly known as Method.Emit().
15439 (MemberBase): Moved everything which was specific to a single
15440 accessor/method to MethodData.
15441 (Method): Create a new MethodData and call Define() and Emit() on it.
15442 (Property, Indexer, Event): Create a new MethodData objects for each
15443 accessor and call Define() and Emit() on them.
15445 2002-07-25 Martin Baulig <martin@gnome.org>
15447 Made MethodCore derive from MemberBase to reuse the code from there.
15448 MemberBase now also checks for attributes.
15450 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15451 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15453 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15454 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15455 (MemberBase.ApplyAttributes): New virtual method; applies the
15456 attributes to a method or accessor.
15457 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15458 (MemberBase.ApplyConditionalAttribute): Likewise.
15459 (MemberBase.ApplyDllImportAttribute): Likewise.
15460 (MemberBase.CheckAbstractAndExternal): Likewise.
15461 (MethodCore.ParameterTypes): This is now a property instead of a
15462 method, it's initialized from DoDefineParameters().
15463 (MethodCore.ParameterInfo): Removed the set accessor.
15464 (MethodCore.DoDefineParameters): New protected virtual method to
15465 initialize ParameterTypes and ParameterInfo.
15466 (Method.GetReturnType): We can now simply return the MemberType.
15467 (Method.GetMethodFlags): Override the MemberBase version and add
15468 the conditional flags.
15469 (Method.CheckBase): Moved some code from Define() here, call
15470 DoDefineParameters() here.
15471 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15472 here to avoid some larger code duplication.
15473 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15474 ensure that abstract and external accessors don't declare a body.
15476 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15477 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15478 lookup in the attribute's parent classes, so we need to abort as soon
15479 as we found the first match.
15480 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15481 the attribute has no arguments.
15483 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15486 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15488 * cs-parser.jay: reverted previous patch.
15490 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15492 * cs-parser.jay: fixed bug #22119.
15494 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15496 * attribute.cs: fixed compilation. The error was:
15497 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
15498 be assigned to before control leaves the current method."
15499 [FIXME: Filed as bug #28186: MCS must report this error.]
15501 2002-07-25 Martin Baulig <martin@gnome.org>
15503 * attribute.cs (Attribute.Conditional_GetConditionName): New static
15504 method to pull the condition name ouf of a Conditional attribute.
15505 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15506 the obsolete message and error flag out of an Obsolete attribute.
15508 * class.cs (Method.GetMethodFlags): New public method to get the
15509 TypeManager.MethodFlags for this method.
15510 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15512 (Method.Define): Get and apply the Obsolete and Conditional attributes;
15513 if we're overriding a virtual function, set the new private variable
15514 `parent_method'; call the new TypeManager.AddMethod().
15516 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
15517 the MethodBuilder and the Method in a PtrHashtable.
15518 (TypeManager.builder_to_method): Added for this purpose.
15519 (TypeManager.MethodFlags): Added IsObsoleteError.
15520 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
15521 Obsolete and Conditional arguments in MethodBuilders. If we discover
15522 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15523 the message from the attribute.
15525 2002-07-24 Martin Baulig <martin@gnome.org>
15527 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15528 preprocessor directives, ensure that the argument to #define/#undef is
15529 exactly one identifier and that it's actually an identifier.
15531 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15534 2002-07-24 Martin Baulig <martin@gnome.org>
15536 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15537 initialize it to TypeManager.object_type in the constructor.
15538 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15539 of the `hm.get_current' method if we're using the collection pattern.
15540 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15541 for the explicit conversion to make it work when we're using the collection
15542 pattern and the `Current' property has a different return type than `object'.
15545 2002-07-24 Martin Baulig <martin@gnome.org>
15547 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15548 does not match, but don't report any errors. This method is called in
15549 order for all methods in a MethodGroupExpr until a matching method is
15550 found, so we don't want to bail out if the first method doesn't match.
15551 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15552 matches, report the 123. Fixes #28070.
15554 2002-07-24 Martin Baulig <martin@gnome.org>
15556 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15557 TypeManager.TypeToCoreType() to the top of the method so the
15558 following equality checks will work. Fixes #28107.
15560 2002-07-24 Martin Baulig <martin@gnome.org>
15562 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15563 operand is of type uint, and the other operand is of type sbyte,
15564 short or int, the operands are converted to type long." -
15565 Actually do what this comment already told us. Fixes bug #28106,
15568 2002-07-24 Martin Baulig <martin@gnome.org>
15570 * class.cs (MethodBase): New abstract class. This is now a base
15571 class for Property, Indexer and Event to avoid some code duplication
15572 in their Define() and DefineMethods() methods.
15573 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15574 generic methods for Define() and DefineMethods().
15575 (FieldBase): Derive from MemberBase, not MemberCore.
15576 (Property): Derive from MemberBase, not MemberCore.
15577 (Property.DefineMethod): Moved all the code from this method to the
15578 new MethodBase.DefineAccessor(), just call it with appropriate
15580 (Property.Define): Call the new Property.DoDefine(), this does some
15581 sanity checks and we don't need to duplicate the code everywhere.
15582 (Event): Derive from MemberBase, not MemberCore.
15583 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15584 accessors, this will also make them work with interface events.
15585 (Indexer): Derive from MemberBase, not MemberCore.
15586 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15587 (Indexer.Define): Use the new MethodBase functions.
15589 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15590 argument to the constructor.
15591 (Interface.FindMembers): Added support for interface events.
15592 (Interface.PopluateEvent): Implemented.
15594 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
15596 2002-07-22 Miguel de Icaza <miguel@ximian.com>
15598 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15599 but this is required to check for a method name being the same as
15600 the containing class.
15604 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15606 * interface.cs: initialize variable.
15608 2002-07-23 Martin Baulig <martin@gnome.org>
15610 Implemented the IndexerName attribute in interfaces.
15612 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15613 name if this is an explicit interface implementation.
15614 (Indexer.InterfaceIndexerName): New public variable. If we're
15615 implementing an interface indexer, this is the IndexerName in that
15616 interface. Otherwise, it's the IndexerName.
15617 (Indexer.DefineMethod): If we're implementing interface indexer,
15618 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
15619 and Pending.ImplementIndexer methods.
15620 (Indexer.Define): Also define the PropertyBuilder if we're
15621 implementing an interface indexer and this is neither an explicit
15622 interface implementation nor do the IndexerName match the one in
15625 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15626 If a method is defined here, then we always need to create a proxy
15627 for it. This is used when implementing interface indexers.
15628 (Pending.IsInterfaceIndexer): New public method.
15629 (Pending.ImplementIndexer): New public method.
15630 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15631 This is used when implementing interface indexers to define a proxy
15633 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15634 define a proxy if necessary.
15636 * interface.cs (Interface.IndexerName): New public variable.
15637 (Interface.PopulateIndexer): Set the IndexerName.
15638 (Interface.DefineIndexers): New private method. Populate all the
15639 indexers and make sure their IndexerNames match.
15641 * typemanager.cs (IndexerPropertyName): Added support for interface
15644 2002-07-22 Martin Baulig <martin@gnome.org>
15646 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15647 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15648 ret if HasReturnLabel.
15649 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15652 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15653 and set the ec.LoopBeginTryCatchLevel.
15654 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15655 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15656 the current ec.TryCatchLevel, the branch goes out of an exception
15657 block. In this case, we need to use Leave and not Br.
15659 2002-07-22 Martin Baulig <martin@gnome.org>
15661 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15662 block unless the block does not always return or it is contained in
15663 another try { ... } catch { ... } block. Fixes bug #26506.
15664 Added verify-1.cs to the test suite.
15666 2002-07-22 Martin Baulig <martin@gnome.org>
15668 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15669 then we do not always return. Fixes bug #24985.
15671 2002-07-22 Martin Baulig <martin@gnome.org>
15673 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15674 lookup on a per-class level; ie. walk up the class hierarchy until we
15675 found at least one applicable method, then choose the best among them.
15676 Fixes bug #24463 and test-29.cs.
15678 2002-07-22 Martin Baulig <martin@gnome.org>
15680 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15681 return types of the methods. The return type is not part of the
15682 signature and we must not check it to make the `new' modifier work.
15683 Fixes bug #27999, also added test-147.cs.
15684 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15686 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15687 on the method's return type.
15689 2002-07-21 Martin Baulig <martin@gnome.org>
15691 * assign.cs: Make this work if the rightmost source is a constant and
15692 we need to do an implicit type conversion. Also adding a few more tests
15693 to test-38.cs which should have caught this.
15695 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15696 target in the makefile for this. The makefile.gnu is primarily intended
15697 for end-users who don't want to debug the compiler.
15699 2002-07-21 Martin Baulig <martin@gnome.org>
15701 * assign.cs: Improved the Assign class so it can now handle embedded
15702 assignments (X = Y = Z = something). As a side-effect this'll now also
15703 consume less local variables. test-38.cs now passes with MCS, added
15704 a few new test cases to that test.
15706 2002-07-20 Martin Baulig <martin@gnome.org>
15708 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15709 instructions. Fixes bug #27977, also added test-146.cs.
15711 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15713 * cs-tokenizer.cs: fixed getHex ().
15715 2002-07-19 Martin Baulig <martin@gnome.org>
15717 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15718 not Type.GetType() to lookup the array type. This is needed when
15719 we're constructing an array of a user-defined type.
15720 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15721 single-dimensional arrays, but also for single-dimensial arrays of
15724 2002-07-19 Martin Baulig <martin@gnome.org>
15726 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15727 this function is called, it's not allowed to share LocalBuilders
15728 among ILGenerators.
15730 2002-07-19 Martin Baulig <martin@gnome.org>
15732 * expression.cs (Argument.Resolve): Report an error 118 when trying
15733 to pass a type as argument.
15735 2002-07-18 Martin Baulig <martin@gnome.org>
15737 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15738 Conv_R_Un for the signed `long' type.
15740 2002-07-15 Miguel de Icaza <miguel@ximian.com>
15742 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15743 `expr' for the temporary result, as that will fail if we do
15744 multiple resolves on the same expression.
15746 2002-07-05 Miguel de Icaza <miguel@ximian.com>
15748 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15749 ec.TypeContainer for looking up aliases.
15751 * class.cs (TypeContainer): Remove LookupAlias from here.
15753 * decl.cs (DeclSpace); Move here.
15755 2002-07-01 Miguel de Icaza <miguel@ximian.com>
15757 * class.cs (FindMembers): Only call filter if the constructor
15758 bulider is not null.
15760 Also handle delegates in `NestedTypes' now. Now we will perform
15761 type lookups using the standard resolution process. This also
15764 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15765 This uses Expressions (the limited kind that can be parsed by the
15766 tree) instead of strings.
15768 * expression.cs (ComposedCast.ToString): Implement, used to flag
15769 errors since now we have to render expressions.
15771 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
15774 * ecore.cs (SimpleName.ToString): ditto.
15776 * cs-parser.jay: Instead of using strings to assemble types, use
15777 Expressions to assemble the type (using SimpleName, ComposedCast,
15778 MemberAccess). This should fix the type lookups in declarations,
15779 because we were using a different code path for this.
15781 * statement.cs (Block.Resolve): Continue processing statements
15782 even when there is an error.
15784 2002-07-17 Miguel de Icaza <miguel@ximian.com>
15786 * class.cs (Event.Define): Also remove the `remove' method from
15787 the list of pending items.
15789 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15790 generate more compact code.
15792 2002-07-17 Martin Baulig <martin@gnome.org>
15794 * const.cs (Const.LookupConstantValue): Add support for constant
15795 `unchecked' and `checked' expressions.
15796 Also adding test case test-140.cs for this.
15798 2002-07-17 Martin Baulig <martin@gnome.org>
15800 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15801 check whether mi.ReturnType implements the IEnumerator interface; the
15802 `==' and the IsAssignableFrom() will fail in this situation.
15804 2002-07-16 Ravi Pratap <ravi@ximian.com>
15806 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
15809 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15811 * expression.cs: fixed bug #27811.
15813 2002-07-14 Miguel de Icaza <miguel@ximian.com>
15815 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15816 Molaro: when we are a ref, the value already contains a pointer
15817 value, do not take the address of it.
15819 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15820 * removed mb-parser.jay and mb-tokenizer.cs
15822 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15824 * expression.cs: check against the building corlib void type.
15826 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15828 * ecore.cs: fix for valuetype static readonly fields: when
15829 initializing them, we need their address, not the address of a copy.
15831 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15833 * typemanager.cs: register also enum_type in corlib.
15835 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15837 * class.cs: allow calling this (but not base) initializers in structs.
15839 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15841 * ecore.cs: make sure we compare against the building base types
15844 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15846 * typemanager.cs: fix TypeToCoreType() to handle void and object
15847 (corlib gets no more typerefs after this change).
15849 2002-07-12 Miguel de Icaza <miguel@ximian.com>
15851 * expression.cs (ArrayCreation.EmitArrayArguments): use
15852 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15854 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15855 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
15856 array indexes, the runtime actually forbids them.
15858 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15859 for array arguments here.
15861 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15862 instead of the default for ValueTypes.
15864 (New.DoEmit): Use IsValueType instead of
15865 IsSubclassOf (value_type)
15866 (New.DoResolve): ditto.
15867 (Invocation.EmitCall): ditto.
15869 * assign.cs (Assign): ditto.
15871 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15872 Statements *are* currently doing part of their resolution during
15875 Expressions do always resolve during resolve, but statements are
15876 only required to propagate resolution to their children.
15878 2002-07-11 Miguel de Icaza <miguel@ximian.com>
15880 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15882 (LoadAssembly): Do not add the dll if it is already specified
15884 (MainDriver): Add the System directory to the link path at the end,
15885 after all the other -L arguments.
15887 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15888 wrong opcode for loading bytes and bools (ldelem.i1 instead of
15889 ldelem.u1) and using the opposite for sbytes.
15891 This fixes Digger, and we can finally run it.
15893 * driver.cs (UnixParseOption): Move the option parsing here.
15894 (CSCParseOption): Implement CSC-like parsing of options.
15896 We now support both modes of operation, the old Unix way, and the
15897 new CSC-like way. This should help those who wanted to make cross
15898 platform makefiles.
15900 The only thing broken is that /r:, /reference: and /lib: are not
15901 implemented, because I want to make those have the same semantics
15902 as the CSC compiler has, and kill once and for all the confussion
15903 around this. Will be doing this tomorrow.
15905 * statement.cs (Unsafe.Resolve): The state is checked during
15906 resolve, not emit, so we have to set the flags for IsUnsfe here.
15908 2002-07-10 Miguel de Icaza <miguel@ximian.com>
15910 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15911 not catch the Error_ObjectRefRequired in SimpleName (as it is
15912 possible to have a class/instance variable name that later gets
15913 deambiguated), we have to check this here.
15915 2002-07-10 Ravi Pratap <ravi@ximian.com>
15917 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15918 make static and put into Expression.
15920 (Event.Define): Register the private field of the event with the
15921 TypeManager so that GetFieldFromEvent can get at it.
15923 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15924 keep track of the private field associated with an event which
15927 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15930 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15932 2002-07-10 Miguel de Icaza <miguel@ximian.com>
15934 * expression.cs (Binary.EmitBranchable): this routine emits the
15935 Binary expression in a branchable context. This basically means:
15936 we need to branch somewhere, not just get the value on the stack.
15938 This works together with Statement.EmitBoolExpression.
15940 * statement.cs (Statement.EmitBoolExpression): Use
15943 2002-07-09 Miguel de Icaza <miguel@ximian.com>
15945 * statement.cs (For): Reduce the number of jumps in loops.
15947 (For): Implement loop inversion for the For statement.
15949 (Break): We can be breaking out of a Try/Catch controlled section
15950 (foreach might have an implicit try/catch clause), so we need to
15951 use Leave instead of Br.
15953 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15954 now). If the instace expression supports IMemoryLocation, we use
15955 the AddressOf method from the IMemoryLocation to extract the
15956 address instead of emitting the instance.
15958 This showed up with `This', as we were emitting the instance
15959 always (Emit) instead of the Address of This. Particularly
15960 interesting when This is a value type, as we dont want the Emit
15961 effect (which was to load the object).
15963 2002-07-08 Miguel de Icaza <miguel@ximian.com>
15965 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15967 * statement.cs (Checked): Set the CheckedState during the resolve
15968 process too, as the ConvCast operations track the checked state on
15969 the resolve process, and not emit.
15971 * cs-parser.jay (namespace_member_declaration): Flag that we have
15972 found a declaration when we do. This is used to flag error 1529
15974 * driver.cs: Report ok when we display the help only.
15976 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
15978 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15980 2002-07-04 Miguel de Icaza <miguel@ximian.com>
15982 * cs-tokenizer.cs (define): We also have to track locally the
15983 defines. AllDefines is just used for the Conditional Attribute,
15984 but we also need the local defines for the current source code.
15986 2002-07-03 Miguel de Icaza <miguel@ximian.com>
15988 * statement.cs (While, For, Do): These loops can exit through a
15989 Break statement, use this information to tell whether the
15990 statement is the last piece of code.
15992 (Break): Flag that we break.
15994 * codegen.cs (EmitContexts): New `Breaks' state variable.
15996 2002-07-03 Martin Baulig <martin@gnome.org>
15998 * class.cs (TypeContainer.MethodModifiersValid): Allow override
15999 modifiers in method declarations in structs. Otherwise, you won't
16000 be able to override things like Object.Equals().
16002 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16004 * class.cs (Method, Property, Indexer): Do not allow the public
16005 modifier to be used in explicit interface implementations.
16007 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16008 override modifiers in method declarations in structs
16010 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16012 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16013 integer or real overflow, report an error
16015 2002-07-02 Martin Baulig <martin@gnome.org>
16017 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16018 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16019 to tell the runtime about our newly created System.Object and
16020 System.ValueType types.
16022 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16024 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16025 struct instead of Ldarg/Starg.
16027 2002-07-02 Martin Baulig <martin@gnome.org>
16029 * expression.cs (Indirection.Indirection): Call
16030 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16032 2002-07-02 Martin Baulig <martin@gnome.org>
16034 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16035 ValueType, call TypeManager.TypeToCoreType() on it.
16036 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16037 the OpCodes.Newarr argument.
16039 2002-07-02 Martin Baulig <martin@gnome.org>
16041 * expression.cs (Invocation.EmitCall): When compiling corlib,
16042 replace all calls to the system's System.Array type to calls to
16043 the newly created one.
16045 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16046 System.Array methods.
16047 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16048 from the system's System.Array type which must be replaced.
16050 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16052 * typemanager.cs: load unverifiable_code_ctor so we can build
16053 corlib using the correct type. Avoid using GetTypeCode() with
16055 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16056 TypeManager.object_type to allow building corlib.
16058 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16060 * ecore.cs: handle System.Enum separately in LoadFromPtr().
16062 2002-07-01 Martin Baulig <martin@gnome.org>
16064 * class.cs: Make the last change actually work, we need to check
16065 whether `ifaces != null' to avoid a crash.
16067 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16069 * class.cs: when we build structs without fields that implement
16070 interfaces, we need to add the interfaces separately, since there is
16071 no API to both set the size and add the interfaces at type creation
16074 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16076 * expression.cs: the dimension arguments to the array constructors
16077 need to be converted if they are a long.
16079 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16081 * class.cs: don't emit ldarg.0 if there is no parent constructor
16082 (fixes showstopper for corlib).
16084 2002-06-29 Martin Baulig <martin@gnome.org>
16086 MCS now compiles corlib on GNU/Linux :-)
16088 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16089 ie. check for MethodImplOptions.InternalCall.
16091 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16092 and TypeManager.attribute_type are null, so we must explicitly check
16093 whether parent is not null to find out whether it's an attribute type.
16094 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16095 and SetBuilder, not only if the property is neither abstract nor external.
16096 This is necessary to set the MethodImplOptions on the accessor methods.
16097 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16098 SetBuilder, see Property.Emit().
16100 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16101 populate "System.Object", "System.ValueType" and "System.Attribute" since
16102 they've already been populated from BootCorlib_PopulateCoreTypes().
16104 2002-06-29 Martin Baulig <martin@gnome.org>
16106 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16107 is the NullLiteral, we also need to make sure that target_type is not
16110 2002-06-29 Martin Baulig <martin@gnome.org>
16112 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16113 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16114 before calling BootstrapCorlib_ResolveDelegate ().
16116 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16118 * statement.cs: fixed build-breaker. All tests passed ok.
16120 2002-06-27 Martin Baulig <martin@gnome.org>
16122 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16123 for System.Decimal when compiling corlib.
16125 2002-06-27 Martin Baulig <martin@gnome.org>
16127 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16128 switch blocks which contain nothing but a default clause.
16130 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16132 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16134 2002-06-27 Martin Baulig <martin@gnome.org>
16136 * ecore.cs (PropertyExpr.PropertyExpr): Call
16137 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16139 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16140 is already a TypeBuilder.
16142 2002-06-27 Martin Baulig <martin@gnome.org>
16144 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16145 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16146 the "from an array-type to System.Array" case. This makes it work
16147 when compiling corlib.
16149 2002-06-27 Martin Baulig <martin@gnome.org>
16151 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16152 non-static PropertyExpr, set its InstanceExpression. This makes
16153 the `ICollection.Count' property work in System/Array.cs.
16155 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16157 * driver.cs: Made error handling more consistent. Errors now
16158 tracked by Report class, so many methods which used to return int
16159 now return void. Main() now prints success/failure and
16160 errors/warnings message.
16162 Renamed '--probe' compiler argument to '--expect-error'. Removed
16163 the magic number return values (123 and 124). Now, if the
16164 expected error occurs, the compiler exits with success (exit value
16165 0). If the compilation completes without seeing that particular
16166 error, the compiler exits with failure (exit value 1). The
16167 makefile in mcs/errors has been changed to handle the new behaviour.
16169 * report.cs: Made 'expected error' number a property and renamed
16170 it from 'Probe' to 'ExpectedError'.
16172 * genericparser.cs: Removed error handling support, since it is
16173 now all done by Report class.
16175 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16176 class, so parse() no longer returns an int.
16178 * namespace.cs: Use Report.Error instead of GenericParser.error
16180 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16182 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16183 TypeContainer.AddOperator): At the front of the list put the
16184 explicit implementations, so they get resolved/defined first.
16186 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16188 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16189 interface type is implemented by this TypeContainer. Used during
16190 explicit interface implementation.
16192 (Property.Define, Indexer.Define, Method.Define): Validate that
16193 the given interface in the explicit implementation is one of the
16194 base classes for the containing type.
16196 Also if we are explicitly implementing an interface, but there is
16197 no match in the pending implementation table, report an error.
16199 (Property.Define): Only define the property if we are
16200 not explicitly implementing a property from an interface. Use the
16201 correct name also for those properties (the same CSC uses,
16202 although that is really not needed).
16204 (Property.Emit): Do not emit attributes for explicitly implemented
16205 properties, as there is no TypeBuilder.
16207 (Indexer.Emit): ditto.
16209 Hiding then means that we do not really *implement* a pending
16210 implementation, which makes code fail.
16212 2002-06-22 Martin Baulig <martin@gnome.org>
16214 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16215 the return value of Object.GetType(). [FIXME: we need to do this whenever
16216 we get a type back from the reflection library].
16218 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16220 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16222 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16224 * attribute.cs: Return null if we can not look up the type.
16226 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16227 the interface types found.
16229 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16230 interface types found.
16232 * typemanager.cs (GetInterfaces): Make this routine returns alll
16233 the interfaces and work around the lame differences between
16234 System.Type and System.Reflection.Emit.TypeBuilder in the results
16235 result for GetInterfaces.
16237 (ExpandInterfaces): Given an array of interface types, expand and
16238 eliminate repeated ocurrences of an interface. This expands in
16239 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16242 2002-06-21 Martin Baulig <martin@gnome.org>
16244 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16247 2002-06-21 Martin Baulig <martin@gnome.org>
16249 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16250 and called with one of the core types, return the corresponding typebuilder for
16253 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16256 2002-06-21 Martin Baulig <martin@gnome.org>
16258 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16259 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16260 (Expression.ConvertReferenceExplicit): Likewise.
16262 * expression.cs (ElementAccess.DoResolve): Likewise.
16263 (ElementAccess.DoResolveLValue): Likewise.
16265 2002-06-10 Martin Baulig <martin@gnome.org>
16267 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16268 add the "value" parameter to the parameter list.
16270 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16273 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16275 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16276 the argument to an int, uint, long or ulong, per the spec. Also
16277 catch negative constants in array creation.
16279 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16281 * class.cs: do not allow the same interface to appear twice in
16282 the definition list.
16284 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16286 * ecore.cs: don't use ldlen with System.Array.
16288 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16290 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16292 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16294 * modifiers.cs: produce correct field attributes for protected
16295 internal. Easy fix so miguel can work on ther harder stuff:-)
16297 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16299 * pending.cs: New file. Move the code from class.cs here.
16300 Support clearning the pending flag for all methods (when not doing
16301 explicit interface implementation).
16303 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16305 * rootcontext.cs: added a couple more types needed to bootstrap.
16307 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16309 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16310 constructor in the type, instead of any constructor in the type
16311 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16312 a bug in the Mono runtime when applying the params attribute).
16314 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16315 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16317 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16319 * expression.cs (Unary.ResolveOperator): Use TypeManager
16320 to resolve the type.
16322 2002-06-13 Ravi Pratap <ravi@ximian.com>
16324 * cs-parser.jay (enum_member_declaration): Pass in the attributes
16327 * enum.cs (AddEnumMember): Add support to store the attributes associated
16328 with each member too.
16330 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16331 field builders too - this takes care of the enum member case.
16333 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
16335 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16336 address-of operator on both value types and pointers.
16338 2002-06-10 Martin Baulig <martin@gnome.org>
16340 * interface.cs (Interface.PopulateIndexer): Add the indexer's
16341 PropertyBuilder to the `property_builders' list.
16343 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16344 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16345 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
16346 find any indexers which are inherited from an interface.
16348 2002-06-09 Martin Baulig <martin@gnome.org>
16350 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16351 the same type as the constant if necessary. There's also a test-130.cs
16354 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16356 * typemanager.cs (TypeManager.ChangeType): Previously known as
16357 Enum.ChangeEnumType().
16359 2002-06-09 Martin Baulig <martin@gnome.org>
16361 * expression.cs (Cast.TryReduce): Added support for consts.
16363 2002-06-08 Ravi Pratap <ravi@ximian.com>
16365 * class.cs (Accessor): Hold attributes information so we can pass
16368 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16369 Modify to pass in attributes attached to the methods.
16371 (add_accessor_declaration, remove_accessor_declaration): Ditto.
16373 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16374 to handle the Accessor kind :-)
16376 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16378 2002-06-08 Martin Baulig <martin@gnome.org>
16380 * expression.cs (Unary.TryReduceNegative): Added support for
16383 2002-06-08 Martin Baulig <martin@gnome.org>
16385 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16386 name can't be found in the `defined_names' - the caller will do a
16387 MemberLookup in this case and thus find methods in System.Enum
16388 such as Enum.IsDefined().
16390 2002-06-08 Martin Baulig <martin@gnome.org>
16392 * enum.cs (Enum.ChangeEnumType): This is a custom version of
16393 Convert.ChangeType() which works with TypeBuilder created types.
16394 (Enum.LookupEnumValue, Enum.Define): Use it here.
16396 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16397 `TypeBuilder.BaseType != null' check.
16398 (TypeContainer.FindMembers): Only lookup parent members if we
16399 actually have a parent.
16400 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16401 (ConstructorInitializer.Resolve): Likewise.
16403 * interface.cs (Interface.FindMembers): Added
16404 `TypeBuilder.BaseType != null' check.
16406 * rootcontext.cs (RootContext.ResolveCore): Added
16407 "System.Runtime.CompilerServices.IndexerNameAttribute" to
16408 classes_second_stage.
16410 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16411 debug_type and trace_type when compiling with --nostdlib.
16413 2002-06-07 Martin Baulig <martin@gnome.org>
16415 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16416 (AddField): Set it to true when adding a non-static field.
16417 (DefineType): Use `have_nonstatic_fields' to find out whether we
16418 have non-static fields, not `Fields != null'.
16420 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16422 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16423 dereferencing a null on the static-field code path)
16425 2002-05-30 Martin Baulig <martin@gnome.org>
16427 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16428 to take command line arguments. Use reflection to call the new
16429 custom `Initialize' function on the symbol writer and pass it the
16430 command line arguments.
16432 * driver.cs (--debug-args): New command line argument to pass command
16433 line arguments to the symbol writer.
16435 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16437 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16438 the target type for indexers and properties. Thanks to Joe for
16441 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16443 * typemanager.cs (MethodFlags): returns the method flags
16444 (Obsolete/ShouldIgnore) that control warning emission and whether
16445 the invocation should be made, or ignored.
16447 * expression.cs (Invocation.Emit): Remove previous hack, we should
16448 not do this on matching a base type, we should do this based on an attribute
16450 Only emit calls to System.Diagnostics.Debug and
16451 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16452 on the command line.
16454 * rootcontext.cs: Global settings for tracing and debugging.
16456 * cs-tokenizer.cs (define): New utility function to track
16457 defines. Set the global settings for TRACE and DEBUG if found.
16459 2002-05-25 Ravi Pratap <ravi@ximian.com>
16461 * interface.cs (Populate*): Pass in the TypeContainer as well as
16462 the DeclSpace as parameters so that we can create EmitContexts and
16463 then use that to apply attributes etc.
16465 (PopulateMethod, PopulateEvent, PopulateProperty)
16466 (PopulateIndexer): Apply attributes everywhere.
16468 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16471 (ApplyAttributes): Update accordingly.
16473 We now apply interface attributes for all members too.
16475 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16477 * class.cs (Indexer.Define); Correctly check if we are explicit
16478 implementation (instead of checking the Name for a ".", we
16479 directly look up if the InterfaceType was specified).
16481 Delay the creation of the PropertyBuilder.
16483 Only create the PropertyBuilder if we are not an explicit
16484 interface implementation. This means that explicit interface
16485 implementation members do not participate in regular function
16486 lookups, and hence fixes another major ambiguity problem in
16487 overload resolution (that was the visible effect).
16489 (DefineMethod): Return whether we are doing an interface
16492 * typemanager.cs: Temporary hack until we get attributes in
16493 interfaces (Ravi is working on that) and we get IndexerName
16494 support in interfaces.
16496 * interface.cs: Register the indexers as properties.
16498 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16499 warning, I have verified that this is a bug in the .NET runtime
16500 (JavaScript suffers of the same problem).
16502 * typemanager.cs (MemberLookup): When looking up members for
16503 interfaces, the parent of an interface is the implicit
16504 System.Object (so we succeed in searches of Object methods in an
16505 interface method invocation. Example: IEnumerable x; x.ToString
16508 2002-05-25 Miguel de Icaza <miguel@ximian.com>
16510 * class.cs (Event): Events should also register if they do
16511 implement the methods that an interface requires.
16513 * typemanager.cs (MemberLookup); use the new GetInterfaces
16516 (GetInterfaces): The code used to lookup interfaces for a type is
16517 used in more than one place, factor it here.
16519 * driver.cs: Track the errors at the bottom of the file, we kept
16522 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16523 instance if the method we are calling is static!
16525 2002-05-24 Miguel de Icaza <miguel@ximian.com>
16527 * attribute.cs (ApplyAttributes): Make this function filter out
16528 the IndexerName attribute (as that attribute in reality is never
16529 applied) and return the string constant for the IndexerName
16532 * class.cs (TypeContainer.Emit): Validate that all the indexers
16533 have the same IndexerName attribute, and if so, set the
16534 DefaultName attribute on the class.
16536 * typemanager.cs: The return value might contain other stuff (not
16537 only methods). For instance, consider a method with an "Item"
16538 property and an Item method.
16540 * class.cs: If there is a problem with the parameter types,
16543 2002-05-24 Ravi Pratap <ravi@ximian.com>
16545 * ecore.cs (ImplicitConversionExists): Wrapper function which also
16546 looks at user defined conversion after making a call to
16547 StandardConversionExists - we need this for overload resolution.
16549 * expression.cs : Update accordingly the various method calls.
16551 This fixes 2 bugs filed against implicit user defined conversions
16553 2002-05-22 Miguel de Icaza <miguel@ximian.com>
16555 * statement.cs: Track the result of the assignment.
16557 2002-05-21 Miguel de Icaza <miguel@ximian.com>
16559 * expression.cs (MemberAccess): Improved error reporting for
16560 inaccessible members.
16562 2002-05-22 Martin Baulig <martin@gnome.org>
16564 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
16565 itself with debugging support.
16567 2002-05-22 Martin Baulig <martin@gnome.org>
16569 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16570 Removed, this isn't needed anymore.
16572 2002-05-20 Martin Baulig <martin@gnome.org>
16574 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16575 be underlying type for an enum.
16577 2002-05-20 Miguel de Icaza <miguel@ximian.com>
16579 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16580 that splits out the loading of just the core types.
16582 * rootcontext.cs (ResolveCore): Split the struct resolution in
16583 two, so we can load the enumeration underlying types before any
16586 * expression.cs (Is): Bandaid until we fix properly Switch (see
16587 bug #24985 for details).
16589 * typemanager.cs (ImplementsInterface): The hashtable will contain
16590 a null if there are no interfaces implemented.
16592 2002-05-18 Miguel de Icaza <miguel@ximian.com>
16594 * cs-parser.jay (indexer_declarator): It is fine to have array
16597 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16599 * typemanager.cs: (RegisterBuilder): New function used to register
16600 TypeBuilders that implement interfaces. Since
16601 TypeBuilder.GetInterfaces (as usual) does not work with lame
16603 (AddUserType): register interfaces.
16605 (ImplementsInterface): Use the builder_to_ifaces hash if we are
16606 dealing with TypeBuilder. Also, arrays are showing up as
16607 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16608 methods can not be invoked on them!
16610 * ecore.cs (ExplicitReferenceConversionExists): Made public.
16611 (ImplicitReferenceConversionExists): Split out from
16612 StandardConversionExists.
16614 * expression.cs (As): We were only implementing one of the three
16615 cases for the as operator. We now implement them all.
16616 (Is): Implement the various other cases for Is as well.
16618 * typemanager.cs (CACHE): New define used to control if we want or
16619 not the FindMembers cache. Seems to have a negative impact on
16620 performance currently
16622 (MemberLookup): Nested types have full acess to
16623 enclosing type members
16625 Remove code that coped with instance/static returns for events, we
16626 now catch this in RealFindMembers.
16628 (RealFindMembers): only perform static lookup if the instance
16629 lookup did not return a type or an event.
16631 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16633 * assign.cs (CompoundAssign): We pass more semantic information
16634 now to Compound Assignments than we did before: now we have all
16635 the information at hand, and now we resolve the target *before* we
16636 do the expression expansion, which allows the "CacheValue" method
16637 to have the effect we intended (before, a [x] += 1 would generate
16638 two differen ArrayAccess expressions from the ElementAccess,
16639 during the resolution process).
16641 (CompoundAssign.DoResolve): Resolve target and original_source here.
16643 2002-05-16 Miguel de Icaza <miguel@ximian.com>
16645 * expression.cs (ArrayAccess): dropped debugging information.
16647 * typemanager.cs: Small bug fix: I was always returning i_members,
16648 instead of one of i_members or s_members (depending on which had
16651 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
16652 method is invoked before any code generation takes place, and it
16653 is a mechanism to inform that the expression will be invoked more
16654 than once, and that the method should use temporary values to
16655 avoid having side effects
16657 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16659 * ecore.cs (Expression.CacheTemporaries): Provide empty default
16662 * expression.cs (Indirection, ArrayAccess): Add support for
16663 CacheTemporaries in these two bad boys.
16665 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16666 ldobj or ldind_ref.
16667 (StoreFromPtr): Handle stobj as well.
16669 * expression.cs (UnaryMutator): Share more code.
16671 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16672 down: I was not tracking the Filter function as well, which
16673 was affecting the results of the cache.
16675 2002-05-15 Miguel de Icaza <miguel@ximian.com>
16677 * attribute.cs: Remove the hack to handle the CharSet property on
16680 2002-05-14 Miguel de Icaza <miguel@ximian.com>
16682 * attribute.cs (DoResolve): More uglyness, we now only try to
16683 resolve the attribute partially, to extract the CharSet
16684 information (only if we are a StructLayout attribute). Otherwise
16686 (GetExtraTypeInfo): Add some code to conditionally kill in the
16687 future this. I am more and more convinced that the .NET
16688 framework has special code to handle the attribute setting on
16691 * expression.cs (IsParamsMethodApplicable): Revert my previous
16692 foreach change here, it was wrong.
16694 2002-05-13 Miguel de Icaza <miguel@ximian.com>
16696 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16697 (pp_expr): do not abort on unknown input, just return.
16698 (eval): abort if there are pending chars.
16700 * attribute.cs (Attribute.Resolve): Positional parameters are
16701 optional. Deal with that case.
16703 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16704 the Ansi/Unicode/Auto information for the type.
16706 (TypeContainer.DefineType): instantiate the EmitContext here, as
16707 we will be using it during the type definition (to resolve
16708 attributes) and during the emit phase.
16710 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16711 to pull type information out of the attributes
16713 (Attribute.Resolve): track the constructor builder, and allow for
16714 multiple invocations (structs and classes will use this).
16716 * ecore.cs (MemberLookupFinal): new version with all the
16717 parameters customizable.
16719 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16720 constructors. Return if the result value is null (as the error
16721 would have been flagged already by MemberLookupFinal)
16723 Do not allow instances of abstract classes or interfaces to be
16726 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16727 We have to compare the assembly property here when dealing with
16728 FamANDAssem and Assembly access modifiers, because we might be
16729 creating an assembly from *modules* (that means that we are not
16730 getting TypeBuilders for types defined in other modules that are
16731 part of this assembly).
16733 (Method.Emit): If the method is marked abstract and has a body,
16736 (TypeContainer.DefineMembers): If both the defined member and the
16737 parent name match are methods, then do not emit any warnings: let
16738 the Method.Define routine take care of flagging warnings. But if
16739 there is a mismatch (method overrides something else, or method is
16740 overriwritten by something, then emit warning).
16742 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16743 set to null, this means `do not check for the return type on the
16746 (Method.Define): set the return type for the method signature to
16747 null, so that we get methods with the same name and parameters and
16748 different return types. This is used to flag warning 114 (you are
16749 hiding a method, and you probably want to use the new/override
16752 * typemanager.cs (MemberLookup): Implemented proper access
16753 control, closing a long standing set of bug reports. The problem
16754 was that the Framework only has two bits: Public and NonPublic,
16755 and NonPublic includes private and protected methods, but we need
16756 to enforce the FamANDAssem, FamOrAssem and Family.
16758 2002-05-11 Miguel de Icaza <miguel@ximian.com>
16760 * statement.cs (GotoCase): Return true: Ammounts to giving up
16761 knowledge on whether we return or not, and letting the other case
16762 be responsible for it.
16764 2002-05-10 Miguel de Icaza <miguel@ximian.com>
16766 * driver.cs: Do not load directories for each file processed, only
16767 do it if there is a pattern.
16769 * ecore.cs: Report readonly assigns here as well, as we might have
16770 been resolved only by MemberAccess.
16772 (SimpleName.SimpleNameResolve): Also be useful for LValue
16773 resolution. We need this to propagate assign to local readonly variables
16775 * typemanager.cs: Use a ptrhashtable for the criteria, because we
16776 do not want to reuse potential criteria memory.
16778 * class.cs (MyEventBuilder): Set reflected_type;
16780 * ecore.cs (Constantify): Added support for constifying bools.
16782 (RootContext.LookupType): Added a cache for values looked up in
16783 the declaration space.
16785 * typemanager.cs (FindMembers): Now is a front-end to
16786 RealFindMembers, and provides a two-level hashtable-based cache to
16789 15% performance improvement: from 22.5 to 19.2 seconds.
16791 * expression.cs (IsParamsMethodApplicable): use foreach.
16792 (Invocation.DoResolve): ditto.
16793 (New.DoResolve): ditto.
16794 (ArrayCreation.DoResolve): ditto.
16796 * ecore.cs (FindMostEncompassingType): use foreach.
16798 * delegate.cs (NewDelegate.DoResolve): Use foreach
16800 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16801 (RemoveMethods): use foreach.
16803 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16804 nested foreach statements instead of for, and also break out of
16805 the inner loop once a match is found.
16807 (Invocation.OverloadResolve): Use foreach, simplify the code.
16809 2002-05-08 Miguel de Icaza <miguel@ximian.com>
16811 * cfold.cs (BinaryFold): During an enumeration evaluation context,
16812 we actually unwrap the expression to allow for extra information
16815 * expression.cs: Use Shr_Un on unsigned operations.
16817 2002-05-08 Ravi Pratap <ravi@ximian.com>
16819 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
16820 applicable operators was not being considered correctly. This closes
16821 the bug Miguel reported.
16823 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16825 * attribute.cs: check that the type derives from System.Attribute
16826 and report the correct error in that case (moved the duplicate code to
16827 its own method, too).
16829 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16831 * attribute.cs: lookup attribute type name as the spec says: first the
16832 bare attribute name and then name + "Attribute" (nant compiles with
16833 mcs after this fix).
16835 2002-05-07 Miguel de Icaza <miguel@ximian.com>
16837 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
16838 Because of the way we parse things, we should try to see if a
16839 UIntConstant can fit in an integer.
16841 2002-05-07 Ravi Pratap <ravi@ximian.com>
16843 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16844 when we are in an explicit context.
16846 (ConvertReferenceExplicit): When converting from Iface type S to Class
16847 T make sure the rules are implemented as an OR.
16849 * parameter.cs (ParameterType): Make it a property for now although the
16850 purpose really isn't anything immediate.
16852 * expression.cs (Is*Applicable): Do better checking on the parameter type
16853 of a ref/out parameter. The ones from the system assemblies are already
16854 marked with the correct type so we don't need to do any correction.
16856 * ecore.cs (StandardConversionExists): Conversion from Interface types to
16857 the object type is standard too so include that.
16859 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16861 * ecore.cs (StandardConversionExists): Augment with missing code:
16862 deal with IntConstant, LongConstants and Enumerations.
16864 * assign.cs: Report the error, instead of failing silently
16866 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16867 typecontainer that they are declared, because the
16868 typecontainer/namespace will have the list of using clauses that
16869 need to be applied.
16871 Assembly Attributes were escaping the normal registration
16874 (EmitCode): Apply attributes within an EmitContext that represents
16875 the container they were declared on.
16877 * cs-parser.jay: Track bases for structs. How did I get this wrong?
16879 2002-05-06 Ravi Pratap <ravi@ximian.com>
16881 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16882 Revamp completely - make much cleaner as we now operate only
16885 (FindMostSpecificSource, FindMostSpecificTarget): New methods
16886 to implement the logic detailed in the spec more correctly.
16888 (UserDefinedConversion): Update accordingly.
16890 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16892 * statement.cs: Return flow analysis information up.
16894 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16897 (token): Do not consume an extra character before calling
16900 2002-05-06 Piers Haken <piersh@friskit.com>
16902 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16904 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16906 * class.cs (Constructor.Emit): Set the IsStatic flag in the
16907 EmitContext during the instance constructor initializer
16908 resolution, to stop access to instance variables.
16910 This is mandated by the spec, last paragraph of the `constructor
16911 initializers' section.
16913 2002-05-05 Miguel de Icaza <miguel@ximian.com>
16915 * cs-parser.jay, class.cs (Accessor): new class used to represent
16916 an accessor (get or set). In the past we used `null' to represent
16917 a missing accessor. But this is ambiguous because there was no
16918 way to tell in abstract indexers/properties if one of them was
16921 Now there is a way of addressing that.
16923 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16924 instead of FindMembers.
16926 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16927 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16929 * attribute.cs: Treat indexers and properties as the same in terms
16930 of applying attributes
16932 * ecore.cs (FindMostEncompassedType): Use statically initialized
16933 EmptyExpressions()s like we do elsewhere to avoid creating useless
16934 objects (and we take this out of the tight loop).
16936 (GetConversionOperators): Move the code to extract the actual
16937 operators to a separate routine to clean things up.
16939 2002-05-04 Miguel de Icaza <miguel@ximian.com>
16941 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16942 events are always registered FieldBuilders.
16944 * class.cs (FieldBase): New class shared by Fields
16946 * delegate.cs: If we are a toplevel delegate, use our full name.
16947 If we are a nested delegate, then only use our tail name.
16949 2002-05-02 Ravi Pratap <ravi@ximian.com>
16951 * expression.cs (IsApplicable): Ensure that we add the "&" to
16952 ref/out types before comparing it with the type of the argument.
16954 (IsParamsMethodApplicable): Ditto.
16956 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
16959 * delegate.cs : Handle the case when we have more than one applicable
16960 method. Flag an error only when we finish checking all.
16962 2002-05-02 Miguel de Icaza <miguel@ximian.com>
16964 * expression.cs: Add support for boolean static initializers.
16966 2002-05-01 Miguel de Icaza <miguel@ximian.com>
16968 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16970 * parameter.cs (ComputeParameterTypes,
16971 ComputeAndDefineParameterTypes): Better error handling: now we
16972 clear the `types' cache if we fail during any of the type lookups.
16973 We also return the status code correctly to our caller
16975 * delegate.cs: If we fail to define a delegate, abort the extra
16978 * expression.cs (Binary.ResolveOperator): for
16979 operator==(object,object) and operator !=(object, object) we also
16980 have to verify that there is an implicit conversion from one to
16983 (ArrayAccess.DoResolve): Array Access can operate on
16986 2002-04-30 Miguel de Icaza <miguel@ximian.com>
16988 * assign.cs (CompoundAssign): A new class used as a "flag" that
16989 the assignment actually is happening as part of a compound
16990 assignment operator.
16992 During compound assignment, a few new rules exist to enable things
16999 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17000 to the type of x) if y is implicitly convertible to the type of x,
17001 and the operator is a builtin operator and the return type of the
17002 operator is explicitly convertible to the type of x.
17004 * rootcontext.cs: Reset warning level to 2. 4 catches various
17005 "interesting" features in mcs, we must clean this up at some
17006 point, but currently am trying to kill other bugs ;-)
17008 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17009 in container classes as well.
17011 * expression.cs (Binary.ResolveOperator): Handle string case
17012 before anything else (as operator overloading does emit an error
17013 before doing anything else).
17015 This code could go away when we move to a table driven model, but
17016 i could not come up with a good plan last night.
17018 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17020 * typemanager.cs (CSharpName): reimplementation using regex.
17021 * class.cs: added null check for fields in Emit
17022 * rootcontext.cs: set warninglevel to 4
17024 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17026 * typemanager.cs (CSharpName): reimplemented with Lupus
17029 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17031 * statement.cs (If): correclty implement Resolve, because we were
17032 not catching sem errors in there. The same process is needed
17034 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17037 (Statement.Warning_DeadCodeFound): Factorize code.
17038 (While): Report dead code here too.
17040 (Statement): Added Resolve virtual method to allow
17041 for resolution split from the emit code.
17043 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17045 * statement.cs (EmitBoolExpression): No longer try to resolve the
17047 (MakeBoolean): New utility function that resolve, implicitly
17048 converts to boolean and tags the expression.
17051 (If, Do): Implement dead code elimination.
17052 (While): Implement loop inversion
17054 (Do, While, For, If): Resolve the expression prior to calling our
17057 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
17060 - added method Report28 (warning: program has more than one entry point)
17061 - added method IsEntryPoint, implements paragraph 10.1 of the spec
17062 - modified method Method.Define, the part at the end of the method
17064 * rootcontext.cs: added static public Location EntryPointLocation;
17066 * ../errors/cs0028.cs : Add test case for the above warning.
17069 - modified method CSharpName to allow arrays of primitive type to
17070 be printed nicely (e.g. instead of System.Int32[][] it now prints
17072 - added method CSharpSignature: returns the signature of a method
17073 in string format to be used in reporting errors, warnings, etc.
17075 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17078 2002-04-26 Ravi Pratap <ravi@ximian.com>
17080 * delegate.cs (Define): Fix extremely silly bug where I was
17081 setting the type of the 'object' parameter of the BeginInvoke
17082 method to System.IAsyncResult instead of System.Object ;-)
17084 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17086 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17089 (Constructor.Emit): return if we fail to initialize the
17090 constructor. Another door closed!
17092 * expression.cs (New.DoResolve): Improve error message (from -6 to
17093 1501). Use DeclaredOnly lookup to find the exact constructor.
17095 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17096 loop. This is useful.
17098 * cs-parser.jay: Adjust the default parameters so that destructors
17099 have the proper signature.
17101 2002-04-26 Martin Baulig <martin@gnome.org>
17103 * driver.cs (LoadAssembly): If `assembly' contains any characters
17104 which are only valid in path names and not in assembly names
17105 (currently slash, backslash and point), use Assembly.LoadFrom ()
17106 instead of Assembly.Load () on the `assembly' (before iteration
17107 over the link_paths).
17109 2002-04-26 Martin Baulig <martin@gnome.org>
17111 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17113 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17115 * class.cs (Property): use the new typemanager.MemberLookup
17117 (TypeContainer.MemberLookup): Implement using the
17118 TypeManager.MemberLookup now.
17120 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17121 and return MemberInfos, so that these can be used without an
17122 EmitContext (what we had before).
17124 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17126 * expression.cs: Fix the case where the argument to params if the
17127 type of the params. I omitted handling this before. Fixed
17129 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17131 * driver.cs: Call BootCorlib_PopulateCoreType
17133 * class.cs (Property.CheckBase): Check for properties only, not
17136 * interface.cs: Temporary hack: try/catch around the
17137 CustomAttributeBuilder, because I am getting an exception that I
17140 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17141 types whose definitions are required to be there (attributes are
17142 defined before standard types).
17144 Compute definitions as we boot the various types, as they are used
17145 immediately (value_type class will need object_type, but if we do
17146 not initialize object_type, we will pass a null, which will let
17147 the runtime pick the System.Object from the existing corlib, which
17148 is not what we want).
17150 2002-04-22 Patrik Torstensson <totte@labs2.com>
17152 * cs-tokenizer.cs: fixed a number of trim() issues.
17154 2002-04-22 Ravi Pratap <ravi@ximian.com>
17156 * expression.cs (Argument.Type): Ensure that we return the correct
17157 type when we have out or ref parameters [in which case we
17160 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17162 * class.cs (Property, Indexer): Allow extern modifier in there.
17164 * typemanager.cs (InitBaseTypes): Initializes object_type and
17165 value_type, since those will be used early on during the bootstrap
17166 process to compile corlib.
17168 (InitCoreTypes): Move code from here to InitBaseTypes.
17170 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17172 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17173 single-dimension arrays as using the ldlen opcode.
17175 Daniel Lewis discovered this optimization.
17177 * typemanager.cs: Add signature for System.Array::get_Length
17179 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17181 * statement.cs: report the error when the foreach does not apply to an
17182 array nor a collection.
17184 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17186 * expression.cs: Add implicit conversions to the operator ~.
17188 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17190 * typemanager.cs: Locate the decimal constructor.
17192 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17194 * attribute.cs: use the new property of TypeOf.
17195 * expression.cs: added 'get' property around typearg.
17197 These changes fix a build breaker reported by NickD. Is this the
17198 correct way to fix? If not, please, revert my changes and make it
17201 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17203 * attribute.cs: Add support for typeof in attribute invocations.
17204 I am not sure that this is right though.
17206 2002-04-14 Duncan Mak <duncan@ximian.com>
17208 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17209 Binary.Operator.Division case.
17211 2002-04-13 Ravi Pratap <ravi@ximian.com>
17213 * class.cs (DefineType): Ensure that we do a proper check on
17214 attribute types and also register it with the TypeManager.
17216 (TypeContainer.Targets): The default for attribute types is
17217 AttributeTargets.All.
17219 * attribute.cs (ApplyAttributes): Registering the attribute type
17220 is done elsewhere, not when we discover we have a Usage attribute.
17222 2002-04-12 Ravi Pratap <ravi@ximian.com>
17224 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17225 and get rid of is_delegate parameter.
17227 * everywhere : update.
17229 2002-04-12 Ravi Pratap <ravi@ximian.com>
17231 * cs-parser.jay (compilation_unit): Revamp completely to use
17232 some new ideas that I got from Rhys' grammar to solve the problems
17233 with assembly level attributes.
17235 (outer_declaration): New grammar production.
17237 (attribute_sections): Add.
17239 (opt_attributes): Base on attribute_sections
17241 (namespace_declaration): Allow opt_attributes to tackle the case
17242 when we have assembly level attributes - we are clever in this
17245 * attribute.cs (ApplyAttributes): Do not worry about assembly
17246 attributes in the non-global context.
17248 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17249 instead of SetGlobalAttributes.
17251 * class.cs, rootcontext.cs : Ensure we define and generate
17252 attribute types before anything else.
17254 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17255 and flag the new error -20 for the case when the attribute type
17256 does not have valid targets specified. csc does not catch this.
17258 * ../errors/errors.txt : update for error # -20
17260 2002-04-11 Ravi Pratap <ravi@ximian.com>
17262 * support.cs (InternalParameters.ParameterModifier): Do some null
17263 checking and return sane values.
17265 * class.cs (Method.Define): If we are a PInvoke method, ensure
17266 that we are static and extern. Report error # 601
17268 * ../errors/cs0601.cs : Add test case for the above error.
17270 2002-04-07 Ravi Pratap <ravi@ximian.com>
17272 * rootcontext.cs (attribute_types): We need to keep type of
17273 all attribute types separately and emit code for them first.
17275 (RegisterAttribute) : Implement.
17277 * class.cs (DefineType): Check if the current Type is a custom
17278 attribute type and register it accordingly.
17280 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17281 adding the first attribute twice and rename to
17283 (SetGlobalAttributes): this.
17285 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17288 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17289 if we are processing global arguments. Hmm, I am unsure of this.
17291 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17293 * expression.cs: added static array of strings to avoid calling
17294 Enum.ToString () for Operator in Binary. Significant recover of
17297 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17299 * class.cs (FindMembers): Allow the Builders of the various
17300 members to be null. If they are skip them. This only happens
17301 during the PInvoke declaration.
17303 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17305 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17306 failure, so we do not keep going afterwards.
17308 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17309 wanted to pass `false' as the `is_delegate' argument. If this is
17310 the case, why not use delegate_type == null to mean `is_delegate =
17311 false' and anything else as is_delegate = true.
17313 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17315 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17316 code for the section, not the beginning of the tests.
17318 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17320 * cfold.cs: Handle operator + (Enum x, Underlying x)
17322 * expression.cs (Binary): same. Warn about errors where we have
17323 Enum/Enum in operator + as well.
17325 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
17328 - added support for switch(bool)
17329 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17330 - add TableSwitchEmit() to handle table-based switch statements
17332 2002-04-05 Ravi Pratap <ravi@ximian.com>
17334 * expression.cs (Invocation.OverloadResolve): Factor out code which
17335 does parameter compatibility checking with arguments so that we can
17336 re-use the code even from Delegate.VerifyApplicability
17338 (VerifyArgumentsCompat): Move above code here.
17340 * delegate.cs (VerifyApplicability): Get rid of duplicate code
17341 and instead make a call to the above method.
17343 2002-03-31 Ravi Pratap <ravi@ximian.com>
17345 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17346 We use it to keep track of classes which are attribute types.
17348 2002-04-02 Miguel de Icaza <miguel@ximian.com>
17350 * delegate.cs (Delegate.Define): Correctly define the types in the
17351 presence of fixed and array parameters.
17353 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17356 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17357 include NonPublic after the first iteration.
17359 * class.cs (Indexer.CheckBase): Only check if both parents are
17362 * cs-parser.jay (accessor_body): If empty, set to null.
17364 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17365 same code path here to resolve constants names that we did have in
17366 MemberAccess.DoResolve. There is too much code duplicated here.
17368 2002-04-01 Miguel de Icaza <miguel@ximian.com>
17370 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17372 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17375 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17376 tokens, numbers and strings.
17378 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17381 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17382 asyncronous parameters and the regular parameters.
17384 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17385 specify the target directory.
17387 * expression.cs: (This.DoResolve): Simplify
17388 (As.Emit): Optimize, do not generate IsInst if the expression is
17389 always of the given type.
17391 (Is.DoResolve): Bug fix, we were reporting both always/never for
17394 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17395 creating too many unnecessary arrays.
17397 2002-03-31 Miguel de Icaza <miguel@ximian.com>
17399 * class.cs (EmitFieldInitializer): Use Assign expression to assign
17400 fields instead of rolling our own initializer. Takes care of all
17401 implicit conversions, and drops unnecessary static checks/argument.
17403 2002-03-31 Dick Porter <dick@ximian.com>
17405 * driver.cs: use the GetDirectories() return values properly, and
17406 use "/" as path separator.
17408 2002-03-30 Miguel de Icaza <miguel@ximian.com>
17410 * expression.cs (Unary): Optimize - - expr into expr.
17411 (Binary): Optimize a + (-b) into a -b.
17413 * codegen.cs (CodeGen): Made all methods static.
17415 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17419 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17420 TypeBuilder property.
17422 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17425 * tree.cs: Removed the various RecordXXXX, and replaced with a
17426 single RecordDecl. Removed all the accessor methods, and just
17427 left a single access point Type
17429 * enum.cs: Rename DefineEnum to DefineType.
17431 * decl.cs: New abstract method `DefineType' used to unify the
17432 Defines for Enumerations, Interfaces, TypeContainers and
17435 (FindType): Moved LookupInterfaceOrClass here. Moved the
17436 LookupBaseClasses method that used to live in class.cs and
17437 interface.cs here, and renamed to FindType.
17439 * delegate.cs: Implement DefineType. Take advantage of the
17440 refactored pattern for locating the parent builder without taking
17441 the parent_builder argument (which we know does not work if we are
17442 nested, and triggering a toplevel definition).
17444 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17446 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17447 accessibility of a member has changed during override and report
17450 * class.cs (Method.Define, Property.Define): Only complain on
17451 overrides if the method is private, any other accessibility is
17452 fine (and since we just checked the permission is the same, we are
17455 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17456 and elif are processed always. The other pre-processing
17457 directives are only processed if we are "taking" the path
17459 2002-03-29 Martin Baulig <martin@gnome.org>
17461 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17462 current location is not Null.
17464 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17465 a separate method so we can profile it.
17467 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17468 `span.Seconds' are just seconds, but no minutes or hours.
17469 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17471 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17473 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17474 Remove the gratuitous set of Final:
17476 // If an interface implementation, then we can set Final.
17477 if (((flags & MethodAttributes.Abstract) == 0) &&
17478 implementing.DeclaringType.IsInterface)
17479 flags |= MethodAttributes.Final;
17481 I do not know what I was smoking when I used that.
17484 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17485 step into fixing the name resolution issues for delegates and
17486 unifying the toplevel name resolution.
17488 2002-03-28 Martin Baulig <martin@gnome.org>
17490 * class.cs (Method.Emit): If we have a symbol writer, call its
17491 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17492 tell it about the current method.
17494 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17495 writer that we're going to emit the first byte of IL code for a new
17496 statement (a new source line).
17497 (EmitContext.EmitTopBlock): If we have a symbol writer, call
17498 EmitContext.Mark() before emitting any code.
17500 * location.cs (SymbolDocument): Return null when we're Null.
17502 * statement.cs (Statement): Moved the `Location loc' variable here.
17503 (Statement.EmitBoolExpression): If we have a symbol writer, call
17504 ec.Mark() before emitting any code to tell it that we're at the
17505 beginning of a new statement.
17506 (StatementExpression): Added `Location' argument to the constructor.
17507 (Block): Added public readonly variable `StartLocation' and public
17508 variable `EndLocation'. The latter is to be set using SetEndLocation().
17509 (Block): Added constructor which takes a start and end location.
17510 (Block.SetEndLocation): New method. This sets the end location.
17511 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17512 local variables we create.
17513 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17514 each statement and do also mark the begin and end of the block.
17516 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17517 tell it the current lexer.Location, use Location.Null for the end of the
17519 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17520 current block, set its end location using SetEndLocation().
17521 (statement_expression): StatementExpression constructor now takes the
17522 lexer.Location as additional argument.
17523 (for_statement, declare_local_variables): Likewise.
17524 (declare_local_variables): When creating a new implicit block, use the
17525 new Block constructor and pass it the lexer.Location.
17527 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17529 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17530 members also on the parent interfaces recursively.
17532 2002-03-27 Miguel de Icaza <miguel@ximian.com>
17534 * report.cs: Use new formats, since Gonzalo finished the missing
17537 * expression.cs (Binary.ResolveOperator): added missing operator|
17538 operator& and operator^ for bool/bool.
17540 * cs-parser.jay: CheckDef now takes a Location argument that is
17541 used to report errors more precisly (instead of reporting the end
17542 of a definition, we try to track something which is a lot closer
17543 to the source of the problem).
17545 * cs-tokenizer.cs: Track global token use, so we can properly flag
17546 the use of #define/#undef after the first token has been seen.
17548 Also, rename the reportXXXX to Error_DescriptiveName
17550 * decl.cs (DeclSpace.IsTopLevel): Move property here from
17551 TypeContainer, so that Enum and Interface can use this too.
17553 * class.cs (TypeContainer.LookupInterfaceOrClass,
17554 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17555 `builder' argument. Typically this was used to pass the parent
17556 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17559 The problem is that a nested class could trigger the definition of
17560 a toplevel class, and the builder would be obviously wrong in that
17563 So we drop this argument, and we compute dynamically the
17564 TypeBuilder/ModuleBuilder (the correct information was available
17565 to us anyways from DeclSpace.Parent)
17567 * interface.cs (Interface.DefineInterface): Drop builder
17568 parameter cleanup like class.cs
17570 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
17573 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17576 (Try.Emit): Propagate the returns value from the statement.
17578 (Return.Emit): Even if we are leavning
17580 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17582 * modifiers.cs: Fix the computation of MethodAttributes flags.
17584 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17586 * driver.cs: allow compilation of files that start with '/'.
17587 Add a default case when checking the argument of --target.
17589 2002-03-25 Miguel de Icaza <miguel@ximian.com>
17591 * interface.cs: Implement the same search algorithm for types in
17592 the interface code.
17594 * delegate.cs: Do not allow multiple definition.
17596 * Recovered ChangeLog that got accidentally amputated
17598 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17600 * rootcontext.cs: Load manually enum to allow core classes to
17601 contain enumerations.
17603 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17604 Update to new static methods in TypeManager.
17606 * typemanager.cs (GetMethod, GetConstructor): Use our
17607 implementation of FindMembers to find the members, since during
17608 corlib compilation, the types are TypeBuilders and GetMethod and
17609 GetConstructor do not work.
17611 Make all methods in TypeManager static.
17613 (InitCodeHelpers): Split the functionality from
17614 the InitCodeTypes function.
17616 * driver.cs: Call InitCodeHelpers after we have populated the
17619 * cs-parser.jay (delegate_declaration): we did not used to compute
17620 the delegate name correctly for void delegates.
17622 2002-03-24 Miguel de Icaza <miguel@ximian.com>
17624 * rootcontext.cs (RootContext): Init the interface_resolve_order
17625 and type_container_resolve_order always.
17627 (ResolveCore, BootstrapCorlib_ResolveClass,
17628 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17629 compiler when compiling with --nostdlib
17631 * class.cs (TypeContainer.DefineType): Check that our parent is
17632 not null. This test is most important when we are bootstraping
17635 * codegen.cs: Split out the symbol writing code.
17637 2002-03-25 Martin Baulig <martin@gnome.org>
17639 * driver.cs (-g): Made -g an alias for --debug.
17641 2002-03-24 Martin Baulig <martin@gnome.org>
17643 * codegen.cs (SymbolWriter): New public variable. Returns the
17644 current symbol writer.
17645 (CodeGen): Added `bool want_debugging_support' argument to the
17646 constructor. If true, tell the ModuleBuild that we want debugging
17647 support and ask it for the ISymbolWriter.
17648 (Save): If we have a symbol writer, call it's Close() method after
17649 saving the assembly.
17651 * driver.c (--debug): New command line argument to create a
17652 debugger information file.
17654 * location.cs (SymbolDocument): New public property. Returns an
17655 ISymbolDocumentWriter object for the current source file or null
17656 if we don't have a symbol writer.
17658 2002-03-21 Miguel de Icaza <miguel@ximian.com>
17660 * driver.cs (LoadAssembly): Correctly return when all the paths
17661 have been tried and not before.
17663 * statement.cs (Switch.Emit): return the actual coverage for this
17664 statement (returns/not-returns)
17666 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17667 switch of the statement if we are the last switch section. That
17668 kills two problems: try/catch problems (we used to emit an empty
17669 nop at the end) and switch statements where all branches would
17672 2002-03-19 Miguel de Icaza <miguel@ximian.com>
17674 * driver.cs: Add default assemblies (the equivalent to the
17675 Microsoft CSC.RSP file)
17677 * cs-tokenizer.cs: When updating `cols and setting it to zero,
17678 also update tokens_seen and set it to false.
17680 * driver.cs: Implement --recurse for Mike.
17682 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17683 correctly splitting out the paths.
17685 2002-03-18 Miguel de Icaza <miguel@ximian.com>
17687 * interface.cs (Interface.PopulateProperty): Instead of using
17688 `parent' as the declaration space for the set parameters, use
17691 * support.cs (InternalParameters): InternalParameters constructor
17692 takes a DeclSpace instead of a TypeContainer.
17694 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17695 types are being initialized, load the address of it before calling
17698 (New): Provide a mechanism to disable the generation of local
17699 value type temporaries when the caller will be providing us with
17700 an address to store it.
17702 (ArrayCreation.EmitDynamicInitializers): Use it.
17704 2002-03-17 Miguel de Icaza <miguel@ximian.com>
17706 * expression.cs (Invocation.EmitArguments): Only probe for array
17707 property if there is more than one argument. Sorry about that.
17709 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17710 empty param arrays.
17712 * class.cs (Method.LabelParameters): Fix incorrect code path that
17713 prevented the `ParamArrayAttribute' from being applied to the
17716 2002-03-16 Miguel de Icaza <miguel@ximian.com>
17718 * support.cs (ReflectionParameters): Correctly compute whether the
17719 last argument is a params array. Fixes the problem with
17722 * typemanager.cs: Make the assemblies array always be non-null
17723 (empty, but non-null)
17725 * tree.cs (RecordDecl): New function that abstracts the recording
17726 of names. This reports error 101, and provides a pointer to the
17727 previous declaration. Fixes a crash in the compiler.
17729 * cs-parser.jay (constructor_declaration): Update to new grammar,
17730 and provide a constructor_body that can be empty.
17732 2002-03-15 Miguel de Icaza <miguel@ximian.com>
17734 * driver.cs: Add support for --resources.
17736 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17737 Make all types for the various array helper methods be integer.
17739 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17740 CheckState to ConvCast.
17742 (ConvCast): Now it takes a `checked' state argument, to avoid
17743 depending on the emit context for the conversion, and just using
17744 the resolve time setting.
17746 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17747 instead of Invocation.EmitArguments. We do not emit the original
17748 arguments, instead we emit those which have been converted to
17749 unsigned int expressions.
17751 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17753 * codegen.cs: ditto.
17755 * expression.cs (LocalVariableReference): Drop the use of the
17756 Store function that depended on the variable index.
17758 * statement.cs (VariableInfo): Drop the `Idx' property from this
17759 class, as this is not taking into account the indexes for
17760 temporaries tat we generate during the execution, getting the
17763 * class.cs: First emit class initializers, then call the parent
17766 * expression.cs (Binary): Fix opcode emision.
17767 (UnaryMutator.EmitCode): Support checked code generation
17769 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17770 matches for events for both the Static and Instance scans,
17771 pointing to the same element. Fix that.
17773 2002-03-14 Miguel de Icaza <miguel@ximian.com>
17775 * rootcontext.cs (ResolveTree): Always set the
17776 interface_resolve_order, because nested interfaces will be calling
17779 * class.cs (GetInterfaceOrClass): Track the same resolution
17780 process used by TypeManager.LookupType. This fixes the nested
17781 type lookups in class declarations (separate path from
17784 (TypeContainer.DefineType): Also define nested interfaces.
17785 (TypeContainer.RegisterOrder): New public function used to
17786 register the order in which child interfaces need to be closed.
17788 Nested interfaces need to be closed after their parents have been
17791 * interface.cs (InterfaceAttr): Put all the logic for computing
17792 the interface attribute here.
17794 (DefineInterface): Register our interface order with the
17795 RootContext or with the TypeContainer depending on the case.
17797 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17799 * cs-parser.jay: rework foreach statement to work with the new
17800 changes to the policy on SimpleNames.
17802 * report.cs: support Stacktrace on warnings as well.
17804 * makefile: drop --unsafe and /unsafe from the compile.
17806 2002-03-13 Ravi Pratap <ravi@ximian.com>
17808 * ecore.cs (StandardConversionExists): Modify to take an Expression
17809 as the first parameter. Ensure we do null -> reference type conversion
17812 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17813 temporary Expression objects.
17815 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17817 * interface.cs: workaround bug in method overloading resolution
17818 (there is already a bugzilla bug for it).
17820 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17822 We could also solve this problem by having a separate path for
17823 performing type lookups, instead of DoResolve, we could have a
17824 ResolveType entry point, and only participating pieces of the
17825 production (simplename, deref, array) would implement this.
17827 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17828 signal SimpleName to only resolve type names and not attempt to
17829 resolve anything else.
17831 * expression.cs (Cast): Set the flag.
17833 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17835 * class.cs: Only report 108 if there is no `new' modifier.
17837 * cs-parser.jay: rework foreach statement to work with the new
17838 changes to the policy on SimpleNames.
17840 * report.cs: support Stacktrace on warnings as well.
17842 * makefile: drop --unsafe and /unsafe from the compile.
17844 2002-03-11 Miguel de Icaza <miguel@ximian.com>
17846 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17847 lookups here, instead of doing that at parse time. This means
17848 that our grammar will not introduce `LocalVariableReferences' as
17849 expressions at this point. That solves the problem of code like
17853 static void Main ()
17857 This is only half the fix. The full fix requires parameters to
17858 also be handled in this way.
17860 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17861 makes the use more obvious of the DeclSpace. The
17862 ec.TypeContainer.TypeBuilder is now only used to pull the
17863 TypeBuilder for it.
17865 My theory is that I can get rid of the TypeBuilder completely from
17866 the EmitContext, and have typecasts where it is used (from
17867 DeclSpace to where it matters).
17869 The only pending problem is that the code that implements Aliases
17870 is on TypeContainer, and probably should go in DeclSpace.
17872 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17873 lookups here, instead of doing that at parse time. This means
17874 that our grammar will not introduce `LocalVariableReferences' as
17875 expressions at this point. That solves the problem of code like
17879 static void Main ()
17883 This is only half the fix. The full fix requires parameters to
17884 also be handled in this way.
17886 * class.cs (Property.DefineMethod): When implementing an interface
17887 method, set newslot, when implementing an abstract method, do not
17888 set the flag (before we tried never setting it, or always setting
17889 it, which is the difference).
17890 (Indexer.DefineMethod): same.
17891 (Method.DefineMethod): same.
17893 * ecore.cs: Only set the status used flag if we get back a Field.
17895 * attribute.cs: Temporary hack, so Paolo can keep working.
17897 2002-03-08 Ravi Pratap <ravi@ximian.com>
17899 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17900 the unmanaged type in the case we have a MarshalAs attribute.
17902 (Resolve): Handle the case when we are parsing the special MarshalAs
17903 attribute [we need to store the unmanaged type to use later]
17905 * typemanager.cs (marshal_as_attr_type): Built in type for the
17906 MarshalAs Attribute.
17908 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
17909 on parameters and accordingly set the marshalling info.
17911 2002-03-09 Miguel de Icaza <miguel@ximian.com>
17913 * class.cs: Optimizing slightly by removing redundant code after
17914 we switched to the `NoTypes' return value.
17915 (Property.DefineMethod): use NoTypes here too.
17917 This fixes the bug I introduced in my last batch of changes.
17919 2002-03-05 Ravi Pratap <ravi@ximian.com>
17921 * tree.cs (RecordEnum): Add. We now keep track of enums too.
17923 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17924 Enums since those are types too.
17926 * cs-parser.jay (enum_declaration): Record enums as we parse them.
17928 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
17929 thanks to a call during the lookup process.
17931 2002-03-07 Miguel de Icaza <miguel@ximian.com>
17933 * statement.cs (Foreach): Lots of work to accomodate a particular
17934 kind of foreach statement that I had not kept in mind. It is
17935 possible to have foreachs on classes that provide a GetEnumerator
17936 method that return objects that implement the "pattern" for using
17937 a foreach, there is no need to support GetEnumerator
17940 This is needed to compile nant.
17942 * decl.cs: Only report 114 if the member is not `Finalize' and if
17943 the warning level is at least 2.
17945 * class.cs: Moved the compare function from Method to
17948 (MethodSignature.InheritableMemberSignatureCompare): Add new
17949 filter function that is used to extract inheritable methods from a
17952 (Method.Define): Use the new `inheritable_method_signature_filter'
17955 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17958 2002-03-06 Miguel de Icaza <miguel@ximian.com>
17960 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17962 * cs-parser.jay: Add opt_semicolon to the interface declaration.
17964 * expression.cs: Pass location information to
17965 ConvertImplicitStandard.
17967 * class.cs: Added debugging code to track return values from
17970 2002-03-05 Miguel de Icaza <miguel@ximian.com>
17972 * expression.cs (Is.DoResolve): If either side of the `is' is an
17973 interface, do not flag the warning.
17975 * ecore.cs (ImplicitReferenceConversion): We need a separate test
17978 * report.cs: Allow for --fatal to be used with --probe.
17980 * typemanager.cs (NoTypes): Move the definition for the empty Type
17983 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17985 (TypeContainer.DefineProxy): New function used to proxy to parent
17986 implementations when implementing interfaces.
17987 (TypeContainer.ParentImplements): used to lookup if our parent
17988 implements a public function that is required by an interface.
17989 (TypeContainer.VerifyPendingMethods): Hook this up.
17991 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17992 `modules' and `assemblies' arraylists into arrays. We only grow
17993 these are the very early start up of the program, so this improves
17994 the speedof LookupType (nicely measured).
17996 * expression.cs (MakeByteBlob): Replaced unsafe code with
17997 BitConverter, as suggested by Paolo.
17999 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18000 folding of string concatenation, but if either side is a string,
18001 and the other is not, then return null, and let the runtime use
18002 the concatenation on the string plus the object (using
18003 `Object.ToString').
18005 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18007 Constant Folding has been implemented now.
18009 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18010 the error instead on types that are not supported in one's
18013 * constant.cs (Constant and all children): New set of functions to
18014 perform implict and explicit conversions.
18016 * ecore.cs (EnumConstant): Implement the new functions to perform
18017 conversion by proxying to the child expression.
18019 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18020 own separate setting that can not be turned off from the command
18021 line using --unchecked or --checked and is only controlled using
18022 the checked/unchecked statements and expressions. This setting is
18023 used by the constant folder to flag errors.
18025 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18026 ConstantCheckState as well.
18028 During Resolve, they also have to flag the state, because the
18029 constant folder runs completely in the Resolve phase.
18031 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18034 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18036 * cfold.cs: New file, this file contains the constant folder.
18038 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18039 argument to track whether we are using the resulting address to
18040 load or store a value and provide better error messages.
18042 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18043 new AddressOf arguments.
18045 * statement.cs (Foreach.EmitCollectionForeach): Update
18047 * expression.cs (Argument.Emit): Call AddressOf with proper
18048 arguments to track usage.
18050 (New.DoEmit): Call AddressOf with new arguments.
18052 (Unary.Emit): Adjust AddressOf call.
18054 2002-03-01 Ravi Pratap <ravi@ximian.com>
18056 * cs-parser.jay (member_access): Change the case for pre-defined types
18057 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
18060 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18063 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18064 essentially like methods and apply attributes like MethodImplOptions to them too.
18066 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18069 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18070 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18073 * Update code everywhere accordingly.
18075 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18077 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18079 2002-02-28 Ravi Pratap <ravi@ximian.com>
18081 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18082 try performing lookups against those instead of jumping straight into using
18083 the 'using' clauses.
18085 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18087 (LookupType): Perform lookups in implicit parents too.
18089 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18090 sequence as RootContext.LookupType.
18092 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18093 the various cases of namespace lookups into this method.
18095 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18097 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18098 in positional arguments)
18100 * class.cs (Operator): Update the AllowedModifiers to contain
18103 * cs-parser.jay: Update operator declaration to allow for the
18104 operator body to be empty.
18106 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18109 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18111 * class.cs (Method.Emit): Label parameters.
18113 * driver.cs: Return 1 or 0 as the program exit code.
18115 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18117 * expression.cs: Special case the `null' object when trying to
18118 auto-compute the type, as anything can be explicitly converted to
18121 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18122 spotting this Paolo.
18124 (Expression.ImplicitNumericConversion): Perform comparissions of
18125 the type using the underlying type in the case of an enumeration
18126 rather than using the enumeration type for the compare.
18128 Cope with the underlying == type case, which is not possible to
18131 (Expression.ConvertNumericExplicit): Perform comparissions of
18132 the type using the underlying type in the case of an enumeration
18133 rather than using the enumeration type for the compare.
18135 * driver.cs: If the user does not supply an extension, assume .exe
18137 * cs-parser.jay (if_statement): Rewrote so that we can track the
18138 location for the if statement.
18140 * expression.cs (Binary.ConstantFold): Only concat strings when
18141 the operation is "+", not everything ;-)
18143 * statement.cs (Statement.EmitBoolExpression): Take a location
18145 (If, While, Do): Track location.
18147 * expression.cs (Binary.ResolveOperator): In the object + string
18148 case, I was missing a call to ConvertImplicit
18150 2002-02-25 Ravi Pratap <ravi@ximian.com>
18152 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18153 Location arguments. Ensure we use RootContext.LookupType to do our work
18154 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18156 * interface.cs (PopulateMethod): Handle the type of the parameter being
18159 * expression.cs (Invocation.BetterFunction): Handle the case when we
18160 have a params method with no fixed arguments and a call is made with no
18163 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18165 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18166 the verbatim-string-literal
18168 * support.cs (InternalParameters.ParameterModifier): handle null
18170 (InternalParameters.ParameterType): ditto.
18172 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18173 duplicating the name of the variable parameter.
18174 (GetParameterByName): Fix bug where we were not looking up array
18175 paramters if they were the only present (thanks Paolo!).
18176 (GetParameterInfo): We only have an empty set of types if both
18177 fixed and array are set to null.
18178 (GetParameterInfo-idx): Handle FixedParameter == null
18180 * cs-parser.jay: Handle the case where there is no catch
18181 statements (missing null test).
18183 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18185 * driver.cs (MainDriver): Be conservative on our command line
18188 Catch DirectoryNotFoundException when calling GetFiles.
18190 (SplitPathAndPattern): Used to split the input specification into
18191 a path and a pattern that we can feed to Directory.GetFiles.
18193 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18195 * statement.cs (Fixed): Implement the last case of the Fixed
18196 statement (string handling).
18198 * expression.cs (StringPtr): New class used to return a char * to
18199 a string; Used by the Fixed statement.
18201 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18203 * expression.cs (Binary.ResolveOperator): Remove redundant
18204 MemberLookup pn parent type.
18205 Optimize union call, we do not need a union if the types are the same.
18206 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18209 Specialize the use of MemberLookup everywhere, instead of using
18210 the default settings.
18212 (StackAlloc): Implement stackalloc keyword.
18214 * cs-parser.jay: Add rule to parse stackalloc.
18216 * driver.cs: Handle /h, /help, /?
18218 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18219 before we supported unsafe code.
18221 * makefile: add --unsafe to the self compilation of mcs.
18223 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18225 * expression.cs (PointerArithmetic): New class that is used to
18226 perform pointer arithmetic.
18227 (Binary.Resolve): Handle pointer arithmetic
18228 Handle pointer comparission.
18229 (ArrayPtr): Utility expression class that is used to take the
18230 address of an array.
18232 (ElementAccess): Implement array access for pointers
18234 * statement.cs (Fixed): Implement fixed statement for arrays, we
18235 are missing one more case before we are done.
18237 * expression.cs (Indirection): Implement EmitAssign and set the
18238 ExprClass to Variable. This allows pointer dereferences to be
18239 treated as variables, and to have values assigned to them.
18241 * ecore.cs (Expression.StoreFromPtr): New utility function to
18242 store values dereferencing.
18244 2002-02-20 Ravi Pratap <ravi@ximian.com>
18246 * expression.cs (Binary.ResolveOperator): Ensure that we are
18247 not trying to operate on a void type - this fixes the reported
18250 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18251 the parent implementation is sealed.
18253 * ../errors/cs0239.cs : Add.
18255 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18257 * typemanager.cs (unverifiable_code_type): Corresponds to
18258 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18259 which have unsafe code in them.
18261 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18264 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18266 * cs-tokenizer.cs: Add support for @"litreal strings"
18268 Make tokenizer accept pre-processor directives
18269 on any column (remove the old C-like limitation).
18271 * rootcontext.cs (EmitCode): Emit any global attributes.
18272 (AddGlobalAttributes): Used to keep track of assembly attributes.
18274 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18276 * cs-parser.jay: Add support for global attributes.
18278 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18280 * expression.cs (Indirection): New helper class. Unary will
18281 create Indirection classes to be able to implement the
18282 IMemoryLocation interface on it.
18284 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18286 * cs-parser.jay (fixed_statement): reference the right statement.
18288 * statement.cs (Fixed.Emit): Finish implementing the fixed
18289 statement for the &x case.
18291 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18293 * class.cs (Property.Define, Method.Define): Remove newslot when
18296 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18297 wrong. NewSlot should only be used if the `new' keyword is present.
18299 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18300 locating our system dir. Sorry about this.
18302 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18304 * driver.cs (GetSystemDir): Compute correctly the location of our
18305 system assemblies. I was using the compiler directory instead of
18306 the library directory.
18308 2002-02-13 Ravi Pratap <ravi@ximian.com>
18310 * expression.cs (BetterFunction): Put back in what Miguel commented out
18311 since it is the correct fix. The problem is elsewhere ;-)
18313 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18314 parameters of the parms method are themselves compatible or not !
18316 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18317 to check that a class implements an interface before saying that an implicit
18318 conversion was allowed. Use ImplementsInterface to do the checking.
18320 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18322 * class.cs (Method.Define): Track whether we are an explicit
18323 implementation or not. And only call DefineMethodOverride if we
18324 are an explicit implementation.
18326 (Property.DefineMethod): Ditto.
18328 2002-02-11 Ravi Pratap <ravi@ximian.com>
18330 * expression.cs (BetterFunction): Catch hideous bug which was
18331 preventing us from detecting ambiguous calls due to implicit casts i.e
18334 2002-01-29 Miguel de Icaza <miguel@ximian.com>
18336 * support.cs (Pair): Remove un-needed method. I figured why I was
18337 getting the error in cs-parser.jay, the variable in a foreach loop
18338 is readonly, and the compiler does not really treat this as a variable.
18340 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
18341 instead of EQUALS in grammar.
18343 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18345 * expression.cs (Unary.DoResolve): Check whether the argument is
18348 2002-01-28 Miguel de Icaza <miguel@ximian.com>
18350 * support.cs: Api for Pair to set a value. Despite the fact that
18351 the variables are public the MS C# compiler refuses to compile
18352 code that accesses the field if the variable is part of a foreach
18355 * statement.cs (Fixed): Begin implementation of the fixed
18358 (Block.AddVariable): Return the VariableInfo on success and null
18359 on failure instead of true/false.
18361 * cs-parser.jay (foreach): Catch errors on variables already
18362 defined (we were ignoring this value before) and properly unwind
18363 the block hierarchy
18365 (fixed_statement): grammar for the fixed statement.
18367 2002-01-25 Miguel de Icaza <miguel@ximian.com>
18369 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18370 pointer types to be incretemented.
18372 (SizeOf): Implement.
18374 * cs-parser.jay (pointer_member_access): Implement
18375 expr->IDENTIFIER production.
18377 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18378 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18381 (Unary): Implement indirection.
18383 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18384 use in non-unsafe context).
18386 (SimpleName.DoResolve): Check for pointers in field access on safe
18389 (Expression.LoadFromPtr): Factor the load-indirect code in this
18390 function. This was duplicated in UnboxCast and ParameterReference
18392 2002-01-24 Miguel de Icaza <miguel@ximian.com>
18394 * expression.cs (ComposedCast): report an error if a pointer cast
18395 is used in a safe region.
18397 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18398 pointer type casts in unsafe context.
18400 * codegen.cs (EmitContext): Set up IsUnsafe.
18402 * cs-parser.jay (non_expression_type): Add productions for pointer
18405 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18406 code. We should not use force into static mode if the method is
18407 not virtual. Fixes bug in MIS
18409 * statement.cs (Do.Emit, While.Emit, For.Emit,
18410 Statement.EmitBoolExpression): Add support to Do and While to
18411 propagate infinite loop as `I do return' semantics.
18413 Improve the For case to also test for boolean constants.
18415 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18416 to the list of attributes we can add.
18418 Remove `EmitContext' argument.
18420 * class.cs (Method.Define): Apply parameter attributes.
18421 (Constructor.Define): Apply parameter attributes.
18422 (MethodCore.LabelParameters): Move here the core of labeling
18425 * support.cs (ReflectionParameters.ParameterModifier,
18426 InternalParameters.ParameterModifier): Use IsByRef on the type and
18427 only return the OUT bit for these parameters instead of in/out/ref
18430 This is because I miss-understood things. The ParameterInfo.IsIn
18431 and IsOut represent whether the parameter has the [In] and [Out]
18434 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18436 * ecore.cs (FieldExpr.Emit): Release temporaries.
18438 * assign.cs (LocalTemporary.Release): new function.
18440 * codegen.cs (EmitContext.GetTemporaryStorage,
18441 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18442 temporary storage. Now we can "put back" localbuilders when we
18445 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18447 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18448 need to make a copy of the variable to generate verifiable code.
18450 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18452 * driver.cs: Compute dynamically the system directory.
18454 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18455 Slower, but more generally useful. Used by the abstract
18456 registering implementation.
18458 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18459 the rules for the special rule on Type/instances. First check if
18460 we have the same name, and if so, try that special static path
18461 rather than the instance path.
18463 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18465 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18468 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18469 Enum, ValueType, Delegate or Array for non-corlib compiles.
18471 * cs-tokenizer.cs: Catch long identifiers (645)
18473 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18476 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18477 fix, we were returning too early, so we were not registering
18478 pending methods from abstract classes.
18480 Do not register pending methods if the class is abstract.
18482 * expression.cs (Conditional.DoResolve): Report circular implicit
18483 conversions when we neecd to compute it for conditional
18486 (Is.DoResolve): If the expression is always of the provided type,
18487 flag warning 183. If the expression can not ever be of the
18488 provided type flag warning 184.
18490 * class.cs: Catch 169 as well.
18492 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18495 2002-01-18 Nick Drochak <ndrochak@gol.com>
18497 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
18499 2002-01-17 Miguel de Icaza <miguel@ximian.com>
18501 * interface.cs: (PopulateMethod): Check for pointers being defined
18502 only if the unsafe context is active.
18503 (PopulateProperty): ditto.
18504 (PopulateIndexer): ditto.
18506 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18507 specified. If pointers are present, make sure that they are
18508 present in an unsafe context.
18509 (Constructor, Constructor.Define): ditto.
18510 (Field, Field.Define): ditto.
18511 (Property, Property.Define): ditto.
18512 (Event, Event.Define): ditto.
18514 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18515 hashtable if there are classes or structs defined.
18517 * expression.cs (LocalVariableReference.DoResolve): Simplify this
18518 code, as the constant resolution moved.
18520 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18521 the metadata, so we can flag error 133.
18523 * decl.cs (MemberCore.UnsafeOK): New function to test that a
18524 pointer is being declared in an unsafe context.
18526 2002-01-16 Miguel de Icaza <miguel@ximian.com>
18528 * modifiers.cs (Modifiers.Check): Require a Location argument.
18529 Report error 227 for Unsafe use.
18531 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18533 * statement.cs (For.Emit): If the test is null, then report that
18534 we do `return', as we wont reach anything afterwards.
18536 (Switch.SwitchGoverningType): Track the expression that matched
18539 * driver.cs: Allow negative numbers as an error code to flag.
18541 * cs-parser.jay: Handle 1551.
18543 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18545 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18547 * cs-parser.jay: Report 1518 (type declaration can only contain
18548 class, struct, interface, enum or delegate)
18550 (switch_label): Report 1523 (keywords `case' or `default' must
18553 (opt_switch_sections): Report 1522 (empty switch)
18555 * driver.cs: Report 1515 (response file specified multiple times)
18556 Report 1516 (Source file specified multiple times).
18558 * expression.cs (Argument.Resolve): Signal 1510
18560 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18561 access not allowed in static code)
18563 2002-01-11 Ravi Pratap <ravi@ximian.com>
18565 * typemanager.cs (IsPointerType): Utility method which we are going
18568 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18569 the object type, so we take care of that.
18571 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18573 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18574 added to non-params parameters :-)
18576 * typemanager.cs (CSharpName): Include 'void' type too.
18578 (void_ptr_type): Include in the set of core types.
18580 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
18583 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
18586 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
18587 completely forgotten about it.
18589 2002-01-10 Ravi Pratap <ravi@ximian.com>
18591 * cs-parser.jay (pointer_type): Add. This begins our implementation
18592 of parsing rules for unsafe code.
18594 (unsafe_statement): Implement.
18596 (embedded_statement): Modify to include the above.
18598 * statement.cs (Unsafe): Implement new class for unsafe blocks.
18600 * codegen.cs (EmitContext.InUnsafe): Add. This determines
18601 if the current context is an unsafe one.
18603 * cs-parser.jay (local_variable_pointer_type): Since local variable types
18604 are handled differently, we need separate rules for them.
18606 (local_variable_declaration): Update to use local_variable_pointer_type
18607 to allow variable declarations of unmanaged pointer types.
18609 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18610 in unsafe contexts.
18612 * ../errors/cs0214.cs : Add.
18614 2002-01-16 Nick Drochak <ndrochak@gol.com>
18616 * makefile: remove 'response' file when cleaning.
18618 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18620 * cs-parser.jay: Report 1524.
18622 2002-01-14 Miguel de Icaza <miguel@ximian.com>
18624 * typemanager.cs (RegisterMethod): drop checking if we have
18625 registered this from here
18627 2002-01-12 Miguel de Icaza <miguel@ximian.com>
18629 * class.cs (Method.EmitDestructor): Implement calling our base
18632 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18633 value of InFinally.
18635 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18636 this routine and will wrap the call in a try/catch block. Deal
18639 2002-01-11 Miguel de Icaza <miguel@ximian.com>
18641 * ecore.cs (Expression.MemberLookup): instead of taking a
18642 parameter `same_type' that was used to tell whether we could
18643 access private members we compute our containing type from the
18646 (FieldExpr): Added partial support for volatile fields. This does
18647 not work for volatile fields exposed from assemblies, as I can not
18648 figure out how to extract the modreq from it.
18650 Updated all the source files to use this.
18652 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18653 because it is referenced by MemberLookup very often.
18655 2002-01-09 Ravi Pratap <ravi@ximian.com>
18657 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18658 TypeBuilder.GetCustomAttributes to retrieve what we need.
18660 Get rid of redundant default_member_attr_type as this is the same as
18661 default_member_type which already exists.
18663 * interface.cs, attribute.cs : Update accordingly.
18665 2002-01-08 Miguel de Icaza <miguel@ximian.com>
18667 * typemanager.cs: Enable IndexerPropertyName again. It does not
18668 work for TYpeBuilders though. Ravi, can you please fix this?
18670 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18672 * expression.cs (Argument.Emit): Handle the case of ref objects
18673 being passed to ref functions;
18675 (ParameterReference.EmitLoad): Loads the content of the pointer
18676 without dereferencing.
18678 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18680 * cs-tokenizer.cs: Implemented the pre-processing expressions.
18682 2002-01-08 Ravi Pratap <ravi@ximian.com>
18684 * class.cs (Indexer.DefineMethod): Incorporate the interface
18685 type in the name of the method if we are doing explicit interface
18688 * expression.cs (ConversionExists): Remove as it is completely obsolete.
18690 (BetterConversion): Fix extremely trivial bug where we were referring to
18691 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18694 * ../errors/bug16.cs : Add although we have fixed it.
18696 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18698 * expression.cs (BaseIndexer): Begin implementation.
18700 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18702 * cs-parser.jay (indexer_declarator): Use qualified_identifier
18703 production directly to remove a shift/reduce, and implement
18704 explicit interface implementation.
18706 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18707 after a floating point suffix.
18709 * expression.cs (DoNumericPromotions): Improved the conversion for
18710 uint/uint. If we have a constant, we avoid doing a typecast to a
18713 * class.cs (Indexer): Implement explicit interface implementation
18716 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18718 * class.cs: make the default instance constructor public and hidebysig.
18720 2001-01-03 Ravi Pratap <ravi@ximian.com>
18722 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18723 so we can call it from elsewhere.
18725 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18726 we emit it internally if the class has a defined indexer; otherwise the user
18727 emits it by decorating the class definition with the DefaultMemberAttribute.
18729 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18730 attribute is not used on a type which defines an indexer.
18732 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18733 character when we skip whitespace.
18735 * ../errors/cs0646.cs : Add.
18737 2002-01-03 Miguel de Icaza <miguel@ximian.com>
18739 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18742 * makefile: Add practical target `mcs3.exe' which builds the third
18743 generation compiler.
18745 * expression.cs (New): Fix structures constructor calling.
18747 * class.cs (Property, Method, Indexer): Emit Final flag on the
18748 method if we are an interface implementation and we are not
18751 * ecore.cs (PropertyExpr): New public field `IsBase', tells
18752 whether this property is referencing a `base' method.
18754 * expression.cs (Invocation.EmitCall): take an extra argument:
18755 is_base, this is used to determine whether the `call' or
18756 `callvirt' opcode should be used.
18759 * delegate.cs: update EmitCall.
18761 * class.cs (Method.Define): Set NewSlot for the cases where we are
18762 not implementing an interface method.
18764 (Property.Define): ditto.
18766 2002-01-02 Miguel de Icaza <miguel@ximian.com>
18768 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18769 'r'. Allows mcs to parse itself fully.
18771 2002-01-02 Ravi Pratap <ravi@ximian.com>
18773 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18774 of the number of initializers that require the InitializeArray method.
18776 (CheckIndices): Store the Expression in all cases - not the plain value. Also
18777 update the above field where necessary.
18779 (MakeByteBlob): Update accordingly.
18781 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
18784 (EmitDynamicInitializers): Update in accordance with the new optimization.
18786 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18787 same OpCode applies.
18789 * cs-parser.jay : Fix some glaring errors I introduced.
18791 2002-01-01 Ravi Pratap <ravi@ximian.com>
18793 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18794 so that we can check for name clashes there too.
18796 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18797 for interface indexers.
18799 * interfaces.cs (Define): Emit the default member attribute.
18801 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18802 variable was being referred to while setting the value ;-)
18804 2002-01-01 Miguel de Icaza <miguel@ximian.com>
18806 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18807 byte-by-byte information when we know the data is zero.
18809 Make the block always a multiple of 4, because
18810 DefineInitializedData has a bug.
18812 * assign.cs: Fix, we should assign from the temporary, not from
18815 * expression.cs (MakeByteBlob): Fix my incorrect code.
18817 2001-12-31 Miguel de Icaza <miguel@ximian.com>
18819 * typemanager.cs (EnumToUnderlying): This function is used to get
18820 the underlying type from an enumeration, because it does not
18823 * constant.cs: Use the I4_S form for values between -128 and 127.
18825 * statement.cs (Block.LookupLabel): Looks up a label.
18826 (Block): Drop support for labeled blocks.
18828 (LabeledStatement): New kind of statement that represents a label
18831 (Goto): Finally implement this bad boy.
18833 * cs-parser.jay: Update to reflect new mechanism to implement
18836 2001-12-30 Miguel de Icaza <miguel@ximian.com>
18838 * codegen.cs (EmitContext.This): a codegen property that keeps the
18839 a single instance of this instead of creating many different this
18842 * delegate.cs (Delegate.DoResolve): Update to use the property;
18844 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18846 * expression.cs (BaseAccess.DoResolve): Ditto.
18848 2001-12-29 Ravi Pratap <ravi@ximian.com>
18850 * typemanager.cs (methodimpl_attr_type): Add to hold the type
18851 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18853 (InitCoreTypes): Update accordingly.
18855 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18856 so we can quickly store the state.
18858 (ApplyAttributes): Set the correct implementation flags
18859 for InternalCall methods.
18861 2001-12-29 Miguel de Icaza <miguel@ximian.com>
18863 * expression.cs (EmitCall): if a method is not virtual, then do
18864 not use callvirt on it.
18866 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18867 user defined stuff) requires the use of stobj, which takes an
18868 address on the stack instead of an array and an index. So emit
18869 the Ldelema operation for it.
18871 (EmitStoreOpcode): Use stobj for valuetypes.
18873 (UnaryMutator.EmitCode): Use the right 1 value depending on
18874 whether we are dealing with int64/uint64, float or doubles.
18876 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18877 constructors that I implemented last night.
18879 (Constructor.IsDefault): Fix to work properly for static
18882 * cs-parser.jay (CheckDef): report method signature errors.
18883 Update error number 103 to be 132.
18885 * decl.cs: New AdditionResult enumeration value: MethodExists.
18886 Although we do this check for methods later on in the semantic
18887 analysis, catching repeated default constructors is so easy that
18888 we catch these here.
18890 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18893 (ParameterReference.EmitAssign, Emit): handle
18896 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18897 (ArrayAccess.EmitStoreOpcode): ditto.
18899 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18901 * expression.cs (MakeByteBlob): Complete all the missing types
18902 (uint, short, ushort, byte, sbyte)
18904 * class.cs: Only init instance field initializers on instance
18907 Rename `constructors' to instance_constructors.
18909 (TypeContainer.AddConstructor): Only add constructors to the list
18910 if it is not static.
18912 Make sure that we handle default_static_constructor independently
18913 everywhere where we handle instance_constructors
18915 2001-12-28 Miguel de Icaza <miguel@ximian.com>
18917 * class.cs: Do not lookup or create a base initializer for a
18918 static constructor.
18920 (ConstructorInitializer.Resolve): use the proper type to lookup
18923 * cs-parser.jay: Report error 1585 (modifiers between type and name).
18925 * enum.cs, interface.cs: Remove CloseType, this is taken care by
18928 * decl.cs: CloseType is now an virtual method, the default
18929 implementation just closes this type.
18931 2001-12-28 Ravi Pratap <ravi@ximian.com>
18933 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18934 to PreserveSig by default. Also emit HideBySig on such methods.
18936 Basically, set the defaults to standard values.
18938 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18939 argument, if candidate is better, it can't be worse than the best !
18941 (Invocation): Re-write bits to differentiate between methods being
18942 applicable in their expanded form and their normal form - for params
18945 Get rid of use_standard everywhere as only standard conversions are allowed
18946 in overload resolution.
18948 More spec conformance.
18950 2001-12-27 Miguel de Icaza <miguel@ximian.com>
18952 * driver.cs: Add --timestamp, to see where the compiler spends
18955 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18956 `this' in static code.
18958 (SimpleName.DoResolve): Implement in terms of a helper function
18959 that allows static-references to be passed upstream to
18962 (Expression.ResolveWithSimpleName): Resolve specially simple
18963 names when called by MemberAccess to implement the special
18966 (Expression.ImplicitReferenceConversion): Handle conversions from
18967 Null to reference types before others, as Null's type is
18970 * expression.cs (Invocation.EmitCall): Handle the special case of
18971 calling methods declared on a reference type from a ValueType
18972 (Base classes System.Object and System.Enum)
18974 (MemberAccess.Resolve): Only perform lookups on Enumerations if
18975 the left hand side is a TypeExpr, not on every enumeration.
18977 (Binary.Resolve): If types are reference types, then do a cast to
18978 object on operators != and == of both arguments.
18980 * typemanager.cs (FindMembers): Extract instance and static
18981 members if requested.
18983 * interface.cs (PopulateProperty): Use void_type instead of null
18984 as the return type for the setter method.
18986 (PopulateIndexer): ditto.
18988 2001-12-27 Ravi Pratap <ravi@ximian.com>
18990 * support.cs (ReflectionParameters): Fix minor bug where we
18991 were examining the wrong parameter for the ParamArray attribute.
18993 Cope with requests for the type of the parameter at position
18994 greater than the params parameter's. We now return the element
18995 type of the params array as that makes more sense.
18997 * expression.cs (Invocation.IsParamsMethodApplicable): Update
18998 accordingly as we no longer have to extract the element type
19001 (Invocation.OverloadResolve): Update.
19003 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19005 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19006 against IEnumerator, test whether the return value is a descendant
19007 of the IEnumerator interface.
19009 * class.cs (Indexer.Define): Use an auxiliary method to implement
19010 the other bits of the method definition. Begin support for
19011 explicit interface implementation.
19013 (Property.DefineMethod): Use TypeManager.void_type instead of null
19014 for an empty return value.
19016 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19018 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19019 dealing with a FieldExpr which is composed of a FieldBuilder, in
19020 the code path we did extract the constant, but we should have
19021 obtained the underlying value to be able to cast it (otherwise we
19022 end up in an infinite loop, this is what Ravi was running into).
19024 (ArrayCreation.UpdateIndices): Arrays might be empty.
19026 (MemberAccess.ResolveMemberAccess): Add support for section
19027 14.5.4.1 that deals with the special case of E.I when E is a type
19028 and something else, that I can be a reference to a static member.
19030 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19031 handle a particular array type to create byte blobs, it is just
19032 something we dont generate byteblobs for.
19034 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19037 * location.cs (Push): remove the key from the hashtable that we
19038 are about to add. This happens for empty files.
19040 * driver.cs: Dispose files after we have parsed them.
19042 (tokenize): new function that only runs the tokenizer on its
19043 input, for speed testing.
19045 2001-12-26 Ravi Pratap <ravi@ximian.com>
19047 * class.cs (Event.Define): Define the private field only if there
19048 are no accessors defined.
19050 * expression.cs (ResolveMemberAccess): If there is no associated
19051 field with the event, that means we have an event defined with its
19052 own accessors and we should flag error cs0070 since transforming
19053 ourselves into a field is not valid in that case.
19055 * ecore.cs (SimpleName.DoResolve): Same as above.
19057 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19058 and charset to sane values.
19060 2001-12-25 Ravi Pratap <ravi@ximian.com>
19062 * assign.cs (DoResolve): Perform check on events only if they
19063 are being accessed outside the declaring type.
19065 * cs-parser.jay (event_declarations): Update rules to correctly
19066 set the type of the implicit parameter etc.
19068 (add_accessor, remove_accessor): Set current local parameters.
19070 * expression.cs (Binary): For delegate addition and subtraction,
19071 cast the return value from the method into the appropriate delegate
19074 2001-12-24 Ravi Pratap <ravi@ximian.com>
19076 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19077 of these as the workaround is unnecessary.
19079 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19080 delegate data - none of that is needed at all.
19082 Re-write bits to extract the instance expression and the delegate method
19085 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19088 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19089 of attaching attributes instead of duplicating code everywhere.
19091 * everywhere : Update code to do attribute emission using the above method.
19093 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19095 * expression.cs (IsParamsMethodApplicable): if there are not
19096 parameters, return immediately.
19098 * ecore.cs: The 0 literal can be implicity converted to an enum
19101 (SimpleName.DoResolve): First lookup the type, then lookup the
19104 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19105 want to get its address. If the InstanceExpression is not
19106 addressable, store the result in a temporary variable, then get
19109 * codegen.cs: Only display 219 errors on warning level or above.
19111 * expression.cs (ArrayAccess): Make it implement the
19112 IMemoryLocation interface.
19114 (Binary.DoResolve): handle the operator == (object a, object b)
19115 and operator != (object a, object b) without incurring into a
19116 BoxedCast (because 5 != o should never be performed).
19118 Handle binary enumerator operators.
19120 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19121 value type, otherwise use Ldelem_ref.
19123 Use precomputed names;
19125 (AddressOf): Implement address of
19127 * cs-parser.jay (labeled_statement): Fix recursive block
19128 addition by reworking the production.
19130 * expression.cs (New.DoEmit): New has a special case:
19132 If we are dealing with a ValueType, we have a few
19133 situations to deal with:
19135 * The target of New is a ValueType variable, that is
19136 easy, we just pass this as the variable reference
19138 * The target of New is being passed as an argument,
19139 to a boxing operation or a function that takes a
19142 In this case, we need to create a temporary variable
19143 that is the argument of New.
19146 2001-12-23 Ravi Pratap <ravi@ximian.com>
19148 * rootcontext.cs (LookupType): Check that current_type is not null before
19149 going about looking at nested types.
19151 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19152 not implement the IAssignMethod interface any more.
19154 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19155 where we tranform them into FieldExprs if they are being resolved from within
19156 the declaring type.
19158 * ecore.cs (SimpleName.DoResolve): Do the same here.
19160 * assign.cs (DoResolve, Emit): Clean up code considerably.
19162 * ../errors/bug10.cs : Add.
19164 * ../errors/cs0070.cs : Add.
19166 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19168 * assign.cs : Get rid of EventIsLocal everywhere.
19170 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19172 * ecore.cs (ConvertIntLiteral): finished the implementation.
19174 * statement.cs (SwitchLabel): Convert the value we are using as a
19175 key before looking up the table.
19177 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19179 * codegen.cs (EmitTopBlock): Require a Location argument now.
19181 * cs-parser.jay (constructor_declarator): We need to setup
19182 current_local_parameters before we parse the
19183 opt_constructor_initializer, to allow the variables to be bound
19184 to the constructor arguments.
19186 * rootcontext.cs (LookupType): First lookup nested classes in our
19187 class and our parents before we go looking outside our class.
19189 * expression.cs (ConstantFold): Extract/debox the values at the
19192 * rootcontext.cs (EmitCode): Resolve the constants first before we
19193 resolve the types. This is not really needed, but it helps debugging.
19195 * statement.cs: report location.
19197 * cs-parser.jay: pass location to throw statement.
19199 * driver.cs: Small bug fix.
19201 * report.cs: Updated format to be 4-zero filled digits.
19203 2001-12-22 Ravi Pratap <ravi@ximian.com>
19205 * expression.cs (CheckIndices): Fix minor bug where the wrong
19206 variable was being referred to ;-)
19208 (DoEmit): Do not call EmitStaticInitializers when the
19209 underlying type is System.Object.
19211 2001-12-21 Ravi Pratap <ravi@ximian.com>
19213 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19214 and do the usual workaround for SRE.
19216 * class.cs (MyEventBuilder.EventType): New member to get at the type
19217 of the event, quickly.
19219 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19221 * assign.cs (Assign.DoResolve): Handle the case when the target
19222 is an EventExpr and perform the necessary checks.
19224 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19227 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19229 (EventExpr): Set the type in the constructor itself since we
19230 are meant to be born fully resolved.
19232 (EventExpr.Define): Revert code I wrote earlier.
19234 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19235 instance expression is null. The instance expression is a This in that case
19236 or a null, depending on whether it is a static method or not.
19238 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19239 refers to more than one method.
19241 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19242 and accordingly flag errors.
19244 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19246 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19248 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19250 * location.cs (ToString): Provide useful rutine.
19252 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19254 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19255 objects, return the actual integral boxed.
19257 * statement.cs (SwitchLabel): define an ILLabel for each
19260 (Switch.CheckSwitch): If the value is a Literal, extract
19261 the underlying literal.
19263 Also in the unused hashtable we had, add the SwitchLabel so we can
19264 quickly look this value up.
19266 * constant.cs: Implement a bunch of new constants. Rewrite
19267 Literal based on this. Made changes everywhere to adapt to this.
19269 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19270 dereferencing array only once, and also copes with enumrations.
19272 bytes are two bytes wide, not one.
19274 (Cast): Perform constant conversions.
19276 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19277 wrappers to the literals here.
19279 * expression.cs (DoNumericPromotions): long literals can converted
19280 to ulong implicity (this is taken care of elsewhere, but I was
19281 missing this spot).
19283 * ecore.cs (Expression.Literalize): Make the return type Literal,
19284 to improve type checking.
19286 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19288 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19290 * literal.cs: Revert code from ravi that checked the bounds. The
19291 bounds are sane by the definition of the type itself.
19293 * typemanager.cs: Fix implementation of ImplementsInterface. We
19294 need to actually look up in our parent hierarchy for interfaces
19297 * const.cs: Use the underlying type for enumerations
19299 * delegate.cs: Compute the basename for the delegate creation,
19300 that should fix the delegate test case, and restore the correct
19301 Type Lookup semantics in rootcontext
19303 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19304 referencing a nested type with the Reflection API is using the "+"
19307 * cs-parser.jay: Do not require EOF token at the end.
19309 2001-12-20 Ravi Pratap <ravi@ximian.com>
19311 * rootcontext.cs (LookupType): Concatenate type names with
19312 a '.' instead of a '+' The test suite passes again.
19314 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19315 field of the enumeration.
19317 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19318 the case when the member is an EventExpr.
19320 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19321 static has an associated instance expression.
19323 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19325 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19327 * class.cs (Event.Define): Register event and perform appropriate checks
19330 We define the Add and Remove methods even if the use provides none because
19331 in that case, we provide default implementations ourselves.
19333 Define a private field of the type of the event. This is done by the CSC compiler
19334 and we should be doing it too ;-)
19336 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19337 More methods we use in code we generate.
19339 (multicast_delegate_type, delegate_type): Two separate types since the distinction
19342 (InitCoreTypes): Update accordingly for the above.
19344 * class.cs (Event.Emit): Generate code for default accessors that we provide
19346 (EmitDefaultMethod): Do the job in the above.
19348 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
19351 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19353 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19354 builders even if we were missing one.
19356 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19357 pass the Basename as our class name instead of the Name. The
19358 basename will be correctly composed for us.
19360 * parameter.cs (Paramters): Now takes a Location argument.
19362 * decl.cs (DeclSpace.LookupType): Removed convenience function and
19363 make all the code call directly LookupType in RootContext and take
19364 this chance to pass the Location information everywhere.
19366 * Everywhere: pass Location information.
19368 2001-12-19 Miguel de Icaza <miguel@ximian.com>
19370 * class.cs (Constructor.Define): Updated way of detecting the
19371 length of the parameters.
19373 (TypeContainer.DefineType): Use basename as the type name for
19376 (TypeContainer.Define): Do not recursively define types here, as
19377 definition is taken care in order by the RootContext.
19379 * tree.cs: Keep track of namespaces in a per-file basis.
19381 * parameter.cs (Parameter.ComputeSignature): Update to use
19384 (Parameters.GetSignature): ditto.
19386 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19387 instead of a TypeContainer.
19389 (Interface.SemanticAnalysis): Use `this' instead of our parent to
19390 resolve names. Because we need to be resolve in our context, not
19393 * driver.cs: Implement response files.
19395 * class.cs (TypeContainer.DefineType): If we are defined, do not
19396 redefine ourselves.
19398 (Event.Emit): Emit the code for add/remove handlers.
19399 (Event.Define): Save the MethodBuilders for add/remove.
19401 * typemanager.cs: Use pair here too.
19403 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19404 DictionaryEntry requires the first argument to be non-null.
19406 (enum_declaration): Compute full name for registering the
19409 (delegate_declaration): Instead of using
19410 formal_parameter_list, use opt_formal_parameter_list as the list
19413 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19414 (EventParsing): New property that controls whether `add' and
19415 `remove' are returned as tokens or identifiers (for events);
19417 2001-12-19 Ravi Pratap <ravi@ximian.com>
19419 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19420 use MyEventBuilder only and let it wrap the real builder for us.
19422 (MyEventBuilder): Revamp constructor etc.
19424 Implement all operations that we perform on EventBuilder in precisely the same
19427 (FindMembers): Update to use the EventBuilder member.
19429 (Event.Emit): Update accordingly.
19431 2001-12-18 Ravi Pratap <ravi@ximian.com>
19433 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19434 by calling the appropriate methods.
19436 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19439 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19441 2001-12-17 Ravi Pratap <ravi@ximian.com>
19443 * delegate.cs (Delegate.Populate): Check that the return type
19444 and various parameters types are indeed accessible.
19446 * class.cs (Constructor.Define): Same here.
19448 (Field.Define): Ditto.
19450 (Event.Define): Ditto.
19452 (Operator.Define): Check that the underlying Method defined itself
19453 correctly - so it's MethodBuilder should not be null.
19455 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19456 expression happens to be null.
19458 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19459 members but as of now we don't seem to be able to do anything really useful with it.
19461 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19462 not the EventBuilder.
19464 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19466 * cs-tokenizer.cs: Add support for defines.
19467 Add support for #if, #elif, #else, #endif
19469 (eval_var): evaluates a variable.
19470 (eval): stubbed for evaluating functions.
19472 * cs-parser.jay: Pass the defines information
19474 * driver.cs: Add --define command line option.
19476 * decl.cs: Move MemberCore here.
19478 Make it the base class for DeclSpace. This allows us to catch and
19479 report 108 and 109 for everything now.
19481 * class.cs (TypeContainer.Define): Extract all the members
19482 before populating and emit the warning 108 (new keyword required
19483 to override) instead of having each member implement this.
19485 (MemberCore.Define): New abstract method, we will be using this in
19486 the warning reporting engine in Populate.
19488 (Operator.Define): Adjust to new MemberCore protocol.
19490 * const.cs (Const): This does not derive from Expression, it is a
19491 temporary object we use to create fields, it is a MemberCore.
19493 * class.cs (Method.Define): Allow the entry point to be in a
19496 * driver.cs: Rewrite the argument handler to clean it up a bit.
19498 * rootcontext.cs: Made it just an auxiliary namespace feature by
19499 making everything static.
19501 * driver.cs: Adapt code to use RootContext type name instead of
19504 * delegate.cs: Remove RootContext argument.
19506 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19509 * class.cs (Event.Define): The lookup can fail.
19511 * cs-tokenizer.cs: Begin implementation of pre-procesor.
19513 * expression.cs: Resolve the this instance before invoking the code.
19515 2001-12-17 Miguel de Icaza <miguel@ximian.com>
19517 * cs-parser.jay: Add a production in element_access that allows
19518 the thing to become a "type" reference. This way we can parse
19519 things like "(string [])" as a type.
19521 Note that this still does not handle the more complex rules of
19525 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
19527 * ecore.cs: (CopyNewMethods): new utility function used to
19528 assemble the list of methods from running FindMembers.
19530 (MemberLookup): Rework FindMembers so that
19532 2001-12-16 Miguel de Icaza <miguel@ximian.com>
19534 * class.cs (TypeContainer): Remove Delegates who fail to be
19537 * delegate.cs (Populate): Verify that we dont get null return
19538 values. TODO: Check for AsAccessible.
19540 * cs-parser.jay: Use basename to emit error 574 (destructor should
19541 have the same name as container class), not the full name.
19543 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19544 possible representation.
19546 Also implements integer type suffixes U and L.
19548 2001-12-15 Miguel de Icaza <miguel@ximian.com>
19550 * expression.cs (ArrayCreation.DoResolve): We need to do the
19551 argument resolution *always*.
19553 * decl.cs: Make this hold the namespace. Hold the root context as
19555 (LookupType): Move here.
19557 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19559 * location.cs (Row, Name): Fixed the code, it was always returning
19560 references to the first file.
19562 * interface.cs: Register properties defined through interfaces.
19564 * driver.cs: Add support for globbing on the command line
19566 * class.cs (Field): Make it derive from MemberCore as well.
19569 2001-12-15 Ravi Pratap <ravi@ximian.com>
19571 * class.cs (Event::Define): Check that the type of the event is a delegate
19572 type else flag error #66.
19574 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19577 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19578 values of EntryPoint, CharSet etc etc.
19580 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19582 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19583 be null and we should ignore this. I am not sure if this is really clean. Apparently,
19584 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19585 which needs this to do its work.
19587 * ../errors/cs0066.cs : Add.
19589 2001-12-14 Miguel de Icaza <miguel@ximian.com>
19591 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19594 * class.cs: (MethodSignature.MethodSignature): Removed hack that
19595 clears out the parameters field.
19596 (MemberSignatureCompare): Cleanup
19598 (MemberCore): New base class used to share code between MethodCore
19601 (RegisterRequiredImplementations) BindingFlags.Public requires
19602 either BindingFlags.Instace or Static. Use instance here.
19604 (Property): Refactored code to cope better with the full spec.
19606 * parameter.cs (GetParameterInfo): Return an empty array instead
19609 * class.cs (Property): Abstract or extern properties have no bodies.
19611 * parameter.cs (GetParameterInfo): return a zero-sized array.
19613 * class.cs (TypeContainer.MethodModifiersValid): Move all the
19614 method modifier validation to the typecontainer so we can reuse
19615 this on properties.
19617 (MethodCore.ParameterTypes): return an empty sized array of types.
19619 (Property.Define): Test property modifier validity.
19621 Add tests for sealed/override too.
19623 (Method.Emit): abstract or extern methods have no bodies.
19625 2001-12-14 Ravi Pratap <ravi@ximian.com>
19627 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19630 (Method::Define, ::Emit): Modify accordingly.
19632 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19634 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19636 * makefile: Pass in /unsafe.
19638 2001-12-13 Miguel de Icaza <miguel@ximian.com>
19640 * class.cs (MakeKey): Kill routine.
19642 * class.cs (TypeContainer.Define): Correctly define explicit
19643 method implementations (they require the full interface name plus
19646 * typemanager.cs: Deply the PtrHashtable here and stop using the
19647 lame keys. Things work so much better.
19649 This of course broke everyone who depended on `RegisterMethod' to
19650 do the `test for existance' test. This has to be done elsewhere.
19652 * support.cs (PtrHashtable): A hashtable that avoid comparing with
19653 the object stupid Equals method (because, that like fails all over
19654 the place). We still do not use it.
19656 * class.cs (TypeContainer.SetRequiredInterface,
19657 TypeContainer.RequireMethods): Killed these two routines and moved
19658 all the functionality to RegisterRequiredImplementations.
19660 (TypeContainer.RegisterRequiredImplementations): This routine now
19661 registers all the implementations required in an array for the
19662 interfaces and abstract methods. We use an array of structures
19663 which can be computed ahead of time to reduce memory usage and we
19664 also assume that lookups are cheap as most classes will not
19665 implement too many interfaces.
19667 We also avoid creating too many MethodSignatures.
19669 (TypeContainer.IsInterfaceMethod): Update and optionally does not
19670 clear the "pending" bit if we find that there are problems with
19673 (TypeContainer.VerifyPendingMethods): Update to report errors of
19674 methods that look like implementations but are not.
19676 (TypeContainer.Define): Add support for explicit interface method
19679 2001-12-12 Miguel de Icaza <miguel@ximian.com>
19681 * typemanager.cs: Keep track of the parameters here instead of
19682 being a feature of the TypeContainer.
19684 * class.cs: Drop the registration of parameters here, as
19685 InterfaceMethods are also interface declarations.
19687 * delegate.cs: Register methods with the TypeManager not only with
19688 the TypeContainer. This code was buggy.
19690 * interface.cs: Full registation here.
19692 2001-12-11 Miguel de Icaza <miguel@ximian.com>
19694 * expression.cs: Remove reducer for binary expressions, it can not
19697 * const.cs: Put here the code that used to go into constant.cs
19699 * constant.cs: Put here the code for constants, this is a new base
19700 class for Literals.
19702 * literal.cs: Make Literal derive from Constant.
19704 2001-12-09 Miguel de Icaza <miguel@ximian.com>
19706 * statement.cs (Return.Emit): Report error 157 if the user
19707 attempts to return from a finally block.
19709 (Return.Emit): Instead of emitting a return, jump to the end of
19712 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19713 LocalBuilder to store the result of the function. ReturnLabel is
19714 the target where we jump.
19717 2001-12-09 Radek Doulik <rodo@ximian.com>
19719 * cs-parser.jay: remember alias in current namespace
19721 * ecore.cs (SimpleName::DoResolve): use aliases for types or
19724 * class.cs (LookupAlias): lookup alias in my_namespace
19726 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19728 (LookupAlias): lookup alias in this and if needed in parent
19731 2001-12-08 Miguel de Icaza <miguel@ximian.com>
19735 * rootcontext.cs: (ModuleBuilder) Made static, first step into
19736 making things static. I need this to avoid passing the
19737 TypeContainer when calling ParameterType.
19739 * support.cs (InternalParameters.ParameterType): Remove ugly hack
19740 that did string manipulation to compute the type and then call
19741 GetType. Use Parameter.ParameterType instead.
19743 * cs-tokenizer.cs: Consume the suffix for floating values.
19745 * expression.cs (ParameterReference): figure out whether this is a
19746 reference parameter or not. Kill an extra variable by computing
19747 the arg_idx during emission.
19749 * parameter.cs (Parameters.GetParameterInfo): New overloaded
19750 function that returns whether a parameter is an out/ref value or not.
19752 (Parameter.ParameterType): The type of the parameter (base,
19753 without ref/out applied).
19755 (Parameter.Resolve): Perform resolution here.
19756 (Parameter.ExternalType): The full type (with ref/out applied).
19758 * statement.cs (Using.Emit, Using.EmitExpression): Implement
19759 support for expressions on the using statement.
19761 2001-12-07 Miguel de Icaza <miguel@ximian.com>
19763 * statement.cs (Using.EmitLocalVariableDecls): Split the
19764 localvariable handling of the using statement.
19766 (Block.EmitMeta): Keep track of variable count across blocks. We
19767 were reusing slots on separate branches of blocks.
19769 (Try.Emit): Emit the general code block, we were not emitting it.
19771 Check the type of the declaration to be an IDisposable or
19772 something that can be implicity converted to it.
19774 Emit conversions if required.
19776 * ecore.cs (EmptyExpression): New utility class.
19777 (Expression.ImplicitConversionExists): New utility function.
19779 2001-12-06 Miguel de Icaza <miguel@ximian.com>
19781 * statement.cs (Using): Implement.
19783 * expression.cs (LocalVariableReference): Support read only variables.
19785 * statement.cs: Remove the explicit emit for the Leave opcode.
19786 (VariableInfo): Add a readonly field.
19788 2001-12-05 Miguel de Icaza <miguel@ximian.com>
19790 * ecore.cs (ConvCast): new class used to encapsulate the various
19791 explicit integer conversions that works in both checked and
19792 unchecked contexts.
19794 (Expression.ConvertNumericExplicit): Use new ConvCast class to
19795 properly generate the overflow opcodes.
19797 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19799 * statement.cs: The correct type for the EmptyExpression is the
19800 element_type, not the variable type. Ravi pointed this out.
19802 2001-12-04 Ravi Pratap <ravi@ximian.com>
19804 * class.cs (Method::Define): Handle PInvoke methods specially
19805 by using DefinePInvokeMethod instead of the usual one.
19807 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19808 above to do the task of extracting information and defining the method.
19810 2001-12-04 Ravi Pratap <ravi@ximian.com>
19812 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19813 of the condition for string type.
19815 (Emit): Move that here.
19817 (ArrayCreation::CheckIndices): Keep string literals in their expression
19820 (EmitDynamicInitializers): Handle strings appropriately.
19822 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19824 * codegen.cs (EmitContext): Replace multiple variables with a
19825 single pointer to the current Switch statement.
19827 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19830 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19834 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19837 (Foreach.Emit): Foreach on arrays was not setting
19838 up the loop variables (for break/continue).
19840 (GotoCase): Semi-implented.
19842 2001-12-03 Ravi Pratap <ravi@ximian.com>
19844 * attribute.cs (CheckAttribute): Handle system attributes by using
19845 Attribute.GetAttributes to examine information we need.
19847 (GetValidPlaces): Same here.
19849 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19851 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19853 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19855 (Method::Define): Set appropriate flags if we have a DllImport attribute.
19857 (Method::Emit): Handle the case when we are a PInvoke method.
19859 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19861 * expression.cs: Use ResolveWithSimpleName on compound names.
19863 2001-12-02 Ravi Pratap <ravi@ximian.com>
19865 * constant.cs (EmitConstant): Make sure we resolve the associated expression
19866 before trying to reduce it.
19868 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19870 * constant.cs (LookupConstantValue): Implement.
19872 (EmitConstant): Use the above in emitting the constant.
19874 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19875 that are user-defined by doing a LookupConstantValue on them.
19877 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19880 2001-11-29 Miguel de Icaza <miguel@ximian.com>
19882 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19884 (BaseAccess.DoResolve): Implement.
19886 (MemberAccess.DoResolve): Split this routine into a
19887 ResolveMemberAccess routine that can be used independently
19889 2001-11-28 Miguel de Icaza <miguel@ximian.com>
19891 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19892 As that share bits of the implementation. Is returns a boolean,
19893 while As returns the Type that is being probed.
19895 2001-12-01 Ravi Pratap <ravi@ximian.com>
19897 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19898 instead of a Literal - much easier.
19900 (EnumInTransit): Remove - utterly useless :-)
19902 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19904 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19906 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19907 chain when we have no associated expression.
19909 2001-11-30 Ravi Pratap <ravi@ximian.com>
19911 * constant.cs (Define): Use Location while reporting the errror.
19913 Also emit a warning when 'new' is used and there is no inherited
19916 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
19919 (LookupEnumValue): Implement to lookup an enum member's value and define it
19922 (Populate): Re-write accordingly to use the above routine.
19924 2001-11-27 Miguel de Icaza <miguel@ximian.com>
19926 * expression.cs (This): Fix prototype for DoResolveLValue to
19927 override the base class DoResolveLValue.
19929 * cs-parser.cs: Report errors cs574 and cs575 (destructor
19932 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19933 (we need to load the address of the field here). This fixes
19936 (FieldExpr.DoResolveLValue): Call the DoResolve
19937 function to initialize the Instance expression.
19939 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19940 correctly the GetEnumerator operation on a value type.
19942 * cs-parser.jay: Add more simple parsing error catches.
19944 * statement.cs (Switch): Add support for string switches.
19945 Handle null specially.
19947 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
19949 2001-11-28 Ravi Pratap <ravi@ximian.com>
19951 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19953 (declare_local_constant): New helper function.
19955 * statement.cs (AddConstant): Keep a separate record of constants
19957 (IsConstant): Implement to determine if a variable is a constant.
19959 (GetConstantExpression): Implement.
19961 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19963 * statement.cs (IsVariableDefined): Re-write.
19965 2001-11-27 Ravi Pratap <ravi@ximian.com>
19967 * class.cs (TypeContainer::FindMembers): Look for constants
19968 in the case when we are looking for MemberTypes.Field
19970 * expression.cs (MemberAccess::DoResolve): Check that in the
19971 case we are a FieldExpr and a Literal, we are not being accessed
19972 by an instance reference.
19974 * cs-parser.jay (local_constant_declaration): Implement.
19976 (declaration_statement): Implement for constant declarations.
19978 2001-11-26 Miguel de Icaza <miguel@ximian.com>
19980 * statement.cs (Switch): Catch double defaults.
19982 (Switch): More work on the switch() statement
19983 implementation. It works for integral values now, need to finish
19987 2001-11-24 Miguel de Icaza <miguel@ximian.com>
19989 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19990 integer literals into other integer literals. To be used by
19993 2001-11-24 Ravi Pratap <ravi@ximian.com>
19995 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19998 (EmitDynamicInitializers): Cope with the above since we extract data
19999 directly from ArrayData now.
20001 (ExpectInitializers): Keep track of whether initializers are mandatory
20004 (Bounds): Make it a hashtable to prevent the same dimension being
20005 recorded for every element in that dimension.
20007 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20010 Also fix bug which was causing the indices to be emitted in the reverse
20013 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20015 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20016 unfinished. They do not work, because the underlying code is
20019 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20021 * cs-parser.jay: Remove bogus fixme.
20023 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20024 on Switch statement.
20026 2001-11-23 Ravi Pratap <ravi@ximian.com>
20028 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20031 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20032 parameter. Apparently, any expression is allowed.
20034 (ValidateInitializers): Update accordingly.
20036 (CheckIndices): Fix some tricky bugs thanks to recursion.
20038 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
20039 I was being completely brain-dead.
20041 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20042 and re-write acordingly.
20044 (DelegateInvocation): Re-write accordingly.
20046 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20048 (MakeByteBlob): Handle types more correctly.
20050 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20051 initialization from expressions but it is incomplete because I am a complete
20054 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20056 * statement.cs (If.Emit): Fix a bug that generated incorrect code
20057 on If. Basically, we have to return `true' (ie, we do return to
20058 our caller) only if both branches of the if return.
20060 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20061 short-circuit operators, handle them as short circuit operators.
20063 (Cast.DoResolve): Resolve type.
20064 (Cast.Cast): Take an expression as the target type.
20066 * cs-parser.jay (cast_expression): Remove old hack that only
20067 allowed a limited set of types to be handled. Now we take a
20068 unary_expression and we resolve to a type during semantic
20071 Use the grammar productions from Rhys to handle casts (this is
20072 not complete like Rhys syntax yet, we fail to handle that corner
20073 case that C# has regarding (-x), but we will get there.
20075 2001-11-22 Ravi Pratap <ravi@ximian.com>
20077 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20078 field which is an array type.
20080 * cs-parser.jay (declare_local_variables): Support array initialization too.
20082 * typemanager.cs (MakeKey): Implement.
20084 (everywhere): Use the above appropriately.
20086 * cs-parser.jay (for_statement): Update for array initialization while
20087 declaring variables.
20089 * ecore.cs : The error message was correct, it's the variable's names that
20090 were misleading ;-) Make the code more readable.
20092 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20093 the correct type etc.
20095 (ConvertExplicit): Handle Enum types by examining the underlying type.
20097 2001-11-21 Ravi Pratap <ravi@ximian.com>
20099 * parameter.cs (GetCallingConvention): Always return
20100 CallingConventions.Standard for now.
20102 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20104 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20105 and `r' after calling DoNumericPromotions.
20107 * ecore.cs: Fix error message (the types were in the wrong order).
20109 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20110 BindingFlags.Instance as well
20112 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20113 implicit int literal conversion in an empty cast so that we
20114 propagate the right type upstream.
20116 (UnboxCast): new class used to unbox value types.
20117 (Expression.ConvertExplicit): Add explicit type conversions done
20120 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20121 the target type before applying the implicit LongLiterals to ULong
20124 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20126 * cs-parser.jay (for_statement): Reworked the way For works: now
20127 we declare manually any variables that are introduced in
20128 for_initializer to solve the problem of having out-of-band code
20129 emition (that is what got for broken).
20131 (declaration_statement): Perform the actual variable declaration
20132 that used to be done in local_variable_declaration here.
20134 (local_variable_declaration): Do not declare anything, just pass
20135 the information on a DictionaryEntry
20137 2001-11-20 Ravi Pratap <ravi@ximian.com>
20139 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20140 re-write of the logic to now make it recursive.
20142 (UpdateIndices): Re-write accordingly.
20144 Store element data in a separate ArrayData list in the above methods.
20146 (MakeByteBlob): Implement to dump the array data into a byte array.
20148 2001-11-19 Ravi Pratap <ravi@ximian.com>
20150 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20153 * constant.cs (Define): Implement.
20155 (EmitConstant): Re-write fully.
20157 Pass in location info.
20159 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20162 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20163 DictionaryEntry since we need location info too.
20165 (constant_declaration): Update accordingly.
20167 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20168 code into another method : UpdateIndices.
20170 2001-11-18 Ravi Pratap <ravi@ximian.com>
20172 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20173 some type checking etc.
20175 2001-11-17 Ravi Pratap <ravi@ximian.com>
20177 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20178 bits to provide dimension info if the user skips doing that.
20180 Update second constructor to store the rank correctly.
20182 2001-11-16 Ravi Pratap <ravi@ximian.com>
20184 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20185 and try to implement.
20187 * ../errors/cs0150.cs : Add.
20189 * ../errors/cs0178.cs : Add.
20191 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20193 * statement.cs: Implement foreach on multi-dimensional arrays.
20195 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20196 name of the params argument.
20198 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20199 initializing the array.
20201 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20202 we can use this elsewhere.
20204 * statement.cs: Finish implementation of foreach for single
20207 * cs-parser.jay: Use an out-of-band stack to pass information
20208 around, I wonder why I need this.
20210 foreach_block: Make the new foreach_block the current_block.
20212 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20213 function used to return a static Parameters structure. Used for
20214 empty parameters, as those are created very frequently.
20216 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20218 2001-11-15 Ravi Pratap <ravi@ximian.com>
20220 * interface.cs : Default modifier is private, not public. The
20221 make verify test passes again.
20223 2001-11-15 Ravi Pratap <ravi@ximian.com>
20225 * support.cs (ReflectionParameters): Fix logic to determine
20226 whether the last parameter is a params one. Test 9 passes again.
20228 * delegate.cs (Populate): Register the builders we define with
20229 RegisterParameterForBuilder. Test 19 passes again.
20231 * cs-parser.jay (property_declaration): Reference $6 instead
20232 of $$ to get at the location.
20234 (indexer_declaration): Similar stuff.
20236 (attribute): Ditto.
20238 * class.cs (Property): Register parameters for the Get and Set methods
20239 if they exist. Test 23 passes again.
20241 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20242 call to EmitArguments as we are sure there aren't any params arguments.
20243 Test 32 passes again.
20245 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20246 IndexOutOfRangeException.
20248 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20249 Test 33 now passes again.
20251 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20253 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20254 broke a bunch of things. Will have to come up with a better way
20255 of tracking locations.
20257 * statement.cs: Implemented foreach for single dimension arrays.
20259 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20261 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20262 an error. This removes the lookup from the critical path.
20264 * cs-parser.jay: Removed use of temporary_loc, which is completely
20267 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20269 * support.cs (ReflectionParameters.ParameterModifier): Report
20270 whether the argument is a PARAMS argument or not.
20272 * class.cs: Set the attribute `ParamArrayAttribute' on the
20273 parameter argument.
20275 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20276 and cons_param_array_attribute (ConstructorInfo for
20277 ParamArrayAttribute).,
20279 * codegen.cs: Emit the return using the `Return' statement, that
20280 way we can report the error correctly for missing return values.
20282 * class.cs (Method.Emit): Clean up.
20284 * expression.cs (Argument.Resolve): Take another argument: the
20285 location where this argument is used. Notice that this is not
20286 part of the "Argument" class as to reduce the size of the
20287 structure (we know the approximate location anyways).
20289 Test if the argument is a variable-reference, if not, then
20290 complain with a 206.
20292 (Argument.Emit): Emit addresses of variables.
20294 (Argument.FullDesc): Simplify.
20296 (Invocation.DoResolve): Update for Argument.Resolve.
20298 (ElementAccess.DoResolve): ditto.
20300 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20301 method should be virtual, as this method is always virtual.
20303 (NewDelegate.DoResolve): Update for Argument.Resolve.
20305 * class.cs (ConstructorInitializer.DoResolve): ditto.
20307 * attribute.cs (Attribute.Resolve): ditto.
20309 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20311 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20313 * expression.cs (ParameterReference): Drop IStackStorage and implement
20314 IAssignMethod instead.
20316 (LocalVariableReference): ditto.
20318 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20319 IAssignMethod instead.
20321 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20323 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20324 enumerations that are used in heavily used structures derive from
20325 byte in a laughable and pathetic attempt to reduce memory usage.
20326 This is the kind of pre-optimzations that you should not do at
20327 home without adult supervision.
20329 * expression.cs (UnaryMutator): New class, used to handle ++ and
20330 -- separatedly from the other unary operators. Cleans up the
20331 code, and kills the ExpressionStatement dependency in Unary.
20333 (Unary): Removed `method' and `Arguments' from this class, making
20334 it smaller, and moving it all to SimpleCall, so I can reuse this
20335 code in other locations and avoid creating a lot of transient data
20336 strucutres when not required.
20338 * cs-parser.jay: Adjust for new changes.
20340 2001-11-11 Miguel de Icaza <miguel@ximian.com>
20342 * enum.cs (Enum.Populate): If there is a failure during
20345 * cs-parser.jay (opt_enum_base): we used to catch type errors
20346 here, but this is really incorrect. The type error should be
20347 catched during semantic analysis.
20349 2001-12-11 Ravi Pratap <ravi@ximian.com>
20351 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20352 current_local_parameters as expected since I, in my stupidity, had forgotten
20355 * attribute.cs (GetValidPlaces): Fix stupid bug.
20357 * class.cs (Method::Emit): Perform check on applicability of attributes.
20359 (Constructor::Emit): Ditto.
20361 (Field::Emit): Ditto.
20363 (Field.Location): Store location information.
20365 (Property, Event, Indexer, Operator): Ditto.
20367 * cs-parser.jay (field_declaration): Pass in location for each field.
20369 * ../errors/cs0592.cs : Add.
20371 2001-11-12 Ravi Pratap <ravi@ximian.com>
20373 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20375 (InitCoreTypes): Update accordingly.
20377 (RegisterAttrType, LookupAttr): Implement.
20379 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20380 info about the same.
20382 (Resolve): Update to populate the above as necessary.
20384 (Error592): Helper.
20386 (GetValidPlaces): Helper to the above.
20388 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20390 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20392 2001-11-12 Ravi Pratap <ravi@ximian.com>
20394 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20396 * ../errors/cs0617.cs : Add.
20398 2001-11-11 Ravi Pratap <ravi@ximian.com>
20400 * enum.cs (Emit): Rename to Populate to be more consistent with what
20401 we expect it to do and when exactly it is called.
20403 * class.cs, rootcontext.cs : Update accordingly.
20405 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20406 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20408 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20410 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20411 of a fieldinfo using the above, when dealing with a FieldBuilder.
20413 2001-11-10 Ravi Pratap <ravi@ximian.com>
20415 * ../errors/cs0031.cs : Add.
20417 * ../errors/cs1008.cs : Add.
20419 * ../errrors/cs0543.cs : Add.
20421 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20424 (FindMembers): Implement.
20426 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20427 enums and delegates too.
20429 (enum_types): Rename to builder_to_enum.
20431 (delegate_types): Rename to builder_to_delegate.
20433 * delegate.cs (FindMembers): Implement.
20435 2001-11-09 Ravi Pratap <ravi@ximian.com>
20437 * typemanager.cs (IsEnumType): Implement.
20439 * enum.cs (Emit): Re-write parts to account for the underlying type
20440 better and perform checking etc.
20442 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20443 of the underlying type.
20445 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20448 * enum.cs (error31): Helper to report error #31.
20450 * cs-parser.jay (enum_declaration): Store location of each member too.
20452 * enum.cs (member_to_location): New hashtable.
20454 (AddEnumMember): Update location hashtable.
20456 (Emit): Use the location of each member while reporting errors.
20458 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20460 * cs-parser.jay: A for_initializer if is a
20461 local_variable_declaration really ammount to have an implicit
20462 block with the variable declaration and no initializer for for.
20464 * statement.cs (For.Emit): Cope with null initializers.
20466 This fixes the infinite loop on for initializers.
20468 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20470 * enum.cs: More cleanup.
20472 * ecore.cs: Remove dead code.
20474 * class.cs (Property.Emit): More simplification.
20475 (Event.Emit): ditto.
20477 Reworked to have less levels of indentation.
20479 2001-11-08 Ravi Pratap <ravi@ximian.com>
20481 * class.cs (Property): Emit attributes.
20491 * enum.cs (Emit): Ditto.
20493 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20496 * class.cs (Field, Event, etc.): Move attribute generation into the
20497 Emit method everywhere.
20499 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20500 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20501 as we had no way of defining nested enums !
20503 * rootcontext.cs : Adjust code accordingly.
20505 * typemanager.cs (AddEnumType): To keep track of enum types separately.
20507 2001-11-07 Ravi Pratap <ravi@ximian.com>
20509 * expression.cs (EvalConstantExpression): Move into ecore.cs
20511 * enum.cs (Enum): Rename some members and make them public and readonly
20512 according to our convention.
20514 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20517 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20519 (Enum::Emit): Write a simple version for now which doesn't try to compute
20520 expressions. I shall modify this to be more robust in just a while.
20522 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20524 (TypeContainer::CloseType): Create the Enum types too.
20526 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20528 * expression.cs (EvalConstantExpression): Get rid of completely.
20530 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20531 user-defined values and other cases.
20533 (IsValidEnumLiteral): Helper function.
20535 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
20536 out there in the case we had a literal FieldExpr.
20538 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20540 (Literalize): Revamp a bit to take two arguments.
20542 (EnumLiteral): New class which derives from Literal to wrap enum literals.
20544 2001-11-06 Ravi Pratap <ravi@ximian.com>
20546 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20548 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20550 (Resolve): Use the above to ensure we have proper initializers.
20552 2001-11-05 Ravi Pratap <ravi@ximian.com>
20554 * expression.cs (Expression::EvalConstantExpression): New method to
20555 evaluate constant expressions.
20557 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20559 2001-11-07 Miguel de Icaza <miguel@ximian.com>
20561 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20564 (Binary.ResolveOperator): Handle operator != (object a, object b)
20565 and operator == (object a, object b);
20567 (Binary.DoNumericPromotions): Indicate whether the numeric
20568 promotion was possible.
20570 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20573 Made the ArrayAccess implement interface IAssignMethod instead of
20574 IStackStore as the order in which arguments are passed reflects
20577 * assign.cs: Instead of using expr.ExprClass to select the way of
20578 assinging, probe for the IStackStore/IAssignMethod interfaces.
20580 * typemanager.cs: Load InitializeArray definition.
20582 * rootcontext.cs (RootContext.MakeStaticData): Used to define
20583 static data that can be used to initialize arrays.
20585 2001-11-05 Miguel de Icaza <miguel@ximian.com>
20587 * expression.cs: Handle operator== and operator!= for booleans.
20589 (Conditioal.Reduce): Implement reducer for the ?: operator.
20591 (Conditional.Resolve): Implement dead code elimination.
20593 (Binary.Resolve): Catch string literals and return a new
20594 concatenated string.
20596 (Unary.Reduce): Implement reduction of unary expressions.
20598 * ecore.cs: Split out the expression core handling here.
20600 (Expression.Reduce): New method used to perform constant folding
20601 and CSE. This is needed to support constant-expressions.
20603 * statement.cs (Statement.EmitBoolExpression): Pass true and false
20604 targets, and optimize for !x.
20606 2001-11-04 Ravi Pratap <ravi@ximian.com>
20608 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20609 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20610 set custom atttributes.
20612 * literal.cs (Literal::GetValue): New abstract method to return the actual
20613 value of the literal, cast as an object.
20615 (*Literal): Implement GetValue method.
20617 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20618 expressions to the arraylist but objects of type Argument.
20620 * class.cs (TypeContainer::Emit): Emit our attributes too.
20622 (Method::Emit, Constructor::Emit): Ditto.
20624 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20625 to be ignoring earlier.
20627 2001-11-03 Ravi Pratap <ravi@ximian.com>
20629 * attribute.cs (AttributeSection::Define): Implement to do the business
20630 of constructing a CustomAttributeBuilder.
20632 (Attribute): New trivial class. Increases readability of code.
20634 * cs-parser.jay : Update accordingly.
20636 (positional_argument_list, named_argument_list, named_argument): New rules
20638 (attribute_arguments): Use the above so that we are more correct.
20640 2001-11-02 Ravi Pratap <ravi@ximian.com>
20642 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20643 to perform all checks for a method with a params parameter.
20645 (Invocation::OverloadResolve): Update to use the above method and therefore
20646 cope correctly with params method invocations.
20648 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
20651 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20652 constructors in our parent too because we can't afford to miss out on
20655 * attribute.cs (AttributeSection): New name for the class Attribute
20657 Other trivial changes to improve readability.
20659 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20660 use the new class names.
20662 2001-11-01 Ravi Pratap <ravi@ximian.com>
20664 * class.cs (Method::Define): Complete definition for params types too
20666 (Indexer::Define): Ditto.
20668 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20669 Cope everywhere with a request for info about the array parameter.
20671 2001-11-01 Ravi Pratap <ravi@ximian.com>
20673 * tree.cs (RecordNamespace): Fix up to check for the correct key.
20675 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
20676 local_variable_type to extract the string corresponding to the type.
20678 (local_variable_type): Fixup the action to use the new helper method.
20680 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
20683 * expression.cs : Clean out code which uses the above.
20685 2001-10-31 Ravi Pratap <ravi@ximian.com>
20687 * typemanager.cs (RegisterMethod): Check if we already have an existing key
20688 and bale out if necessary by returning a false.
20690 (RegisterProperty): Ditto.
20692 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20693 and print out appropriate error messages.
20695 * interface.cs (everywhere): Ditto.
20697 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20698 location to constructor.
20700 * class.cs (Property, Event, Indexer): Update accordingly.
20702 * ../errors/cs111.cs : Added.
20704 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20705 of a method, as laid down by the spec.
20707 (Invocation::OverloadResolve): Use the above method.
20709 2001-10-31 Ravi Pratap <ravi@ximian.com>
20711 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20712 now take a TypeContainer and a Parameters object.
20714 (ParameterData): Modify return type of ParameterModifier method to be
20715 Parameter.Modifier and not a string.
20717 (ReflectionParameters, InternalParameters): Update accordingly.
20719 * expression.cs (Argument::GetParameterModifier): Same here.
20721 * support.cs (InternalParameters::ParameterType): Find a better way of determining
20722 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20723 symbol in it at all so maybe this is only for now.
20725 2001-10-30 Ravi Pratap <ravi@ximian.com>
20727 * support.cs (InternalParameters): Constructor now takes an extra argument
20728 which is the actual Parameters class.
20730 (ParameterDesc): Update to provide info on ref/out modifiers.
20732 * class.cs (everywhere): Update call to InternalParameters to pass in
20733 the second argument too.
20735 * support.cs (ParameterData): Add ParameterModifier, which is a method
20736 to return the modifier info [ref/out etc]
20738 (InternalParameters, ReflectionParameters): Implement the above.
20740 * expression.cs (Argument::ParameterModifier): Similar function to return
20741 info about the argument's modifiers.
20743 (Invocation::OverloadResolve): Update to take into account matching modifiers
20746 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20747 a new SetFormalParameters object which we pass to InternalParameters.
20749 2001-10-30 Ravi Pratap <ravi@ximian.com>
20751 * expression.cs (NewArray): Merge into the ArrayCreation class.
20753 2001-10-29 Ravi Pratap <ravi@ximian.com>
20755 * expression.cs (NewArray): Merge classes NewBuiltinArray and
20756 NewUserdefinedArray into one as there wasn't much of a use in having
20759 * expression.cs (Argument): Change field's name to ArgType from Type.
20761 (Type): New readonly property which returns the proper type, taking into
20762 account ref/out modifiers.
20764 (everywhere): Adjust code accordingly for the above.
20766 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20767 whether we are emitting for a ref or out parameter.
20769 * expression.cs (Argument::Emit): Use the above field to set the state.
20771 (LocalVariableReference::Emit): Update to honour the flag and emit the
20774 * parameter.cs (Attributes): Set the correct flags for ref parameters.
20776 * expression.cs (Argument::FullDesc): New function to provide a full desc.
20778 * support.cs (ParameterData): Add method ParameterDesc to the interface.
20780 (ReflectionParameters, InternalParameters): Implement the above method.
20782 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20785 (Invocation::FullMethodDesc): Ditto.
20787 2001-10-29 Miguel de Icaza <miguel@ximian.com>
20789 * cs-parser.jay: Add extra production for the second form of array
20792 * expression.cs (ArrayCreation): Update to reflect the above
20795 * Small changes to prepare for Array initialization.
20797 2001-10-28 Miguel de Icaza <miguel@ximian.com>
20799 * typemanager.cs (ImplementsInterface): interface might be null;
20800 Deal with this problem;
20802 Also, we do store negative hits on the cache (null values), so use
20803 this instead of calling t.GetInterfaces on the type everytime.
20805 2001-10-28 Ravi Pratap <ravi@ximian.com>
20807 * typemanager.cs (IsBuiltinType): New method to help determine the same.
20809 * expression.cs (New::DoResolve): Get rid of array creation code and instead
20810 split functionality out into different classes.
20812 (New::FormArrayType): Move into NewBuiltinArray.
20814 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20817 (NewBuiltinArray): New class to handle creation of built-in arrays.
20819 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20820 account creation of one-dimensional arrays.
20822 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20824 (NewUserdefinedArray::DoResolve): Implement.
20826 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20828 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20829 we maintain inside the TypeManager. This is necessary to perform lookups on the
20832 (LookupType): Update to perform GetType on the module builders too.
20834 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20836 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20838 2001-10-23 Ravi Pratap <ravi@ximian.com>
20840 * expression.cs (New::DoResolve): Implement guts of array creation.
20842 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20844 2001-10-27 Miguel de Icaza <miguel@ximian.com>
20846 * expression.cs: Fix bug I introduced lsat night that broke
20849 (Expression.Resolve): Report a 246 error (can not resolve name)
20850 if we find a SimpleName in the stream.
20852 (Expression.ResolveLValue): Ditto.
20854 (Expression.ResolveWithSimpleName): This function is a variant of
20855 ResolveName, this one allows SimpleNames to be returned without a
20856 warning. The only consumer of SimpleNames is MemberAccess
20858 2001-10-26 Miguel de Icaza <miguel@ximian.com>
20860 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20861 might arrive here. I have my doubts that this is correct.
20863 * statement.cs (Lock): Implement lock statement.
20865 * cs-parser.jay: Small fixes to support `lock' and `using'
20867 * cs-tokenizer.cs: Remove extra space
20869 * driver.cs: New flag --checked, allows to turn on integer math
20872 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20873 Threading.Monitor.Exit
20875 2001-10-23 Miguel de Icaza <miguel@ximian.com>
20877 * expression.cs (IndexerAccess::DoResolveLValue): Set the
20878 Expression Class to be IndexerAccess.
20880 Notice that Indexer::DoResolve sets the eclass to Value.
20882 2001-10-22 Miguel de Icaza <miguel@ximian.com>
20884 * class.cs (TypeContainer::Emit): Emit code for indexers.
20886 * assign.cs (IAssignMethod): New interface implemented by Indexers
20887 and Properties for handling assignment.
20889 (Assign::Emit): Simplify and reuse code.
20891 * expression.cs (IndexerAccess, PropertyExpr): Implement
20892 IAssignMethod, clean up old code.
20894 2001-10-22 Ravi Pratap <ravi@ximian.com>
20896 * typemanager.cs (ImplementsInterface): New method to determine if a type
20897 implements a given interface. Provides a nice cache too.
20899 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20902 (ConvertReferenceExplicit): Ditto.
20904 * delegate.cs (Delegate::Populate): Update to define the parameters on the
20905 various methods, with correct names etc.
20907 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
20908 Operator.UnaryNegation.
20910 * cs-parser.jay (operator_declarator): Be a little clever in the case where
20911 we have a unary plus or minus operator.
20913 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
20916 * everywhere : update accordingly.
20918 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20921 * class.cs (Method::Define): For the case where we are implementing a method
20922 inherited from an interface, we need to set the MethodAttributes.Final flag too.
20923 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20925 2001-10-21 Ravi Pratap <ravi@ximian.com>
20927 * interface.cs (FindMembers): Implement to work around S.R.E
20930 * typemanager.cs (IsInterfaceType): Implement.
20932 (FindMembers): Update to handle interface types too.
20934 * expression.cs (ImplicitReferenceConversion): Re-write bits which
20935 use IsAssignableFrom as that is not correct - it doesn't work.
20937 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20938 and accordingly override EmitStatement.
20940 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20941 using the correct logic :-)
20943 2001-10-19 Ravi Pratap <ravi@ximian.com>
20945 * ../errors/cs-11.cs : Add to demonstrate error -11
20947 2001-10-17 Miguel de Icaza <miguel@ximian.com>
20949 * assign.cs (Assign::Resolve): Resolve right hand side first, and
20950 then pass this as a hint to ResolveLValue.
20952 * expression.cs (FieldExpr): Add Location information
20954 (FieldExpr::LValueResolve): Report assignment to readonly
20957 (Expression::ExprClassFromMemberInfo): Pass location information.
20959 (Expression::ResolveLValue): Add new method that resolves an
20962 (Expression::DoResolveLValue): Default invocation calls
20965 (Indexers): New class used to keep track of indexers in a given
20968 (IStackStore): Renamed from LValue, as it did not really describe
20969 what this did. Also ResolveLValue is gone from this interface and
20970 now is part of Expression.
20972 (ElementAccess): Depending on the element access type
20974 * typemanager.cs: Add `indexer_name_type' as a Core type
20975 (System.Runtime.CompilerServices.IndexerNameAttribute)
20977 * statement.cs (Goto): Take a location.
20979 2001-10-18 Ravi Pratap <ravi@ximian.com>
20981 * delegate.cs (Delegate::VerifyDelegate): New method to verify
20982 if two delegates are compatible.
20984 (NewDelegate::DoResolve): Update to take care of the case when
20985 we instantiate a delegate from another delegate.
20987 * typemanager.cs (FindMembers): Don't even try to look up members
20988 of Delegate types for now.
20990 2001-10-18 Ravi Pratap <ravi@ximian.com>
20992 * delegate.cs (NewDelegate): New class to take care of delegate
20995 * expression.cs (New): Split the delegate related code out into
20996 the NewDelegate class.
20998 * delegate.cs (DelegateInvocation): New class to handle delegate
21001 * expression.cs (Invocation): Split out delegate related code into
21002 the DelegateInvocation class.
21004 2001-10-17 Ravi Pratap <ravi@ximian.com>
21006 * expression.cs (New::DoResolve): Implement delegate creation fully
21007 and according to the spec.
21009 (New::DoEmit): Update to handle delegates differently.
21011 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21012 because of which we were printing out arguments in reverse order !
21014 * delegate.cs (VerifyMethod): Implement to check if the given method
21015 matches the delegate.
21017 (FullDelegateDesc): Implement.
21019 (VerifyApplicability): Implement.
21021 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21022 delegate invocations too.
21024 (Invocation::Emit): Ditto.
21026 * ../errors/cs1593.cs : Added.
21028 * ../errors/cs1594.cs : Added.
21030 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21032 2001-10-16 Ravi Pratap <ravi@ximian.com>
21034 * typemanager.cs (intptr_type): Core type for System.IntPtr
21036 (InitCoreTypes): Update for the same.
21038 (iasyncresult_type, asynccallback_type): Ditto.
21040 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21043 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21046 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21047 the builders for the 4 members of a delegate type :-)
21049 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21052 * expression.cs (New::DoResolve): Implement guts for delegate creation.
21054 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21056 2001-10-15 Miguel de Icaza <miguel@ximian.com>
21058 * statement.cs (Break::Emit): Implement.
21059 (Continue::Emit): Implement.
21061 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
21062 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
21063 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
21064 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
21067 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21068 properties that track the label for the current loop (begin of the
21069 loop and end of the loop).
21071 2001-10-15 Ravi Pratap <ravi@ximian.com>
21073 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21074 use of emitting anything at all.
21076 * class.cs, rootcontext.cs : Get rid of calls to the same.
21078 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21080 (Populate): Define the constructor correctly and set the implementation
21083 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21086 (AddDelegateType): Implement.
21088 (IsDelegateType): Implement helper method.
21090 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21092 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21093 and accordingly handle it.
21095 * delegate.cs (Populate): Take TypeContainer argument.
21096 Implement bits to define the Invoke method. However, I still haven't figured out
21097 how to take care of the native int bit :-(
21099 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21100 Qualify the name of the delegate, not its return type !
21102 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21105 (StandardConversionExists): Checking for array types turns out to be recursive.
21107 (ConvertReferenceExplicit): Implement array conversion.
21109 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21111 2001-10-12 Ravi Pratap <ravi@ximian.com>
21113 * cs-parser.jay (delegate_declaration): Store the fully qualified
21114 name as it is a type declaration.
21116 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21119 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21120 as TypeContainer::DefineType.
21122 (Populate): Method in which all the definition of the various methods (Invoke)
21125 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21128 (CloseDelegate): Finally creates the delegate.
21130 * class.cs (TypeContainer::DefineType): Update to define delegates.
21131 (Populate, Emit and CloseType): Do the same thing here too.
21133 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21134 delegates in all these operations.
21136 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21138 * expression.cs: LocalTemporary: a new expression used to
21139 reference a temporary that has been created.
21141 * assign.cs: Handle PropertyAccess back here, so that we can
21142 provide the proper semantic access to properties.
21144 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21145 a few more explicit conversions.
21147 * modifiers.cs: `NEW' modifier maps to HideBySig.
21149 * expression.cs (PropertyExpr): Make this into an
21150 ExpressionStatement, and support the EmitStatement code path.
21152 Perform get/set error checking, clean up the interface.
21154 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21155 them into toplevel access objects.
21157 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21159 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21162 * typemanager.cs: Keep track here of our PropertyBuilders again to
21163 work around lameness in SRE.
21165 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21167 * expression.cs (LValue::LValueResolve): New method in the
21168 interface, used to perform a second resolution pass for LValues.
21170 (This::DoResolve): Catch the use of this in static methods.
21172 (This::LValueResolve): Implement.
21174 (This::Store): Remove warning, assigning to `this' in structures
21177 (Invocation::Emit): Deal with invocation of
21178 methods on value types. We need to pass the address to structure
21179 methods rather than the object itself. (The equivalent code to
21180 emit "this" for structures leaves the entire structure on the
21181 stack instead of a pointer to it).
21183 (ParameterReference::DoResolve): Compute the real index for the
21184 argument based on whether the method takes or not a `this' pointer
21185 (ie, the method is static).
21187 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21188 value types returned from functions when we need to invoke a
21189 method on the sturcture.
21192 2001-10-11 Ravi Pratap <ravi@ximian.com>
21194 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21195 defining the type in the Modulebuilder or Typebuilder. This is to take
21196 care of nested types which need to be defined on the TypeBuilder using
21197 DefineNestedMethod.
21199 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21200 methods in RootContext, only ported to be part of TypeContainer.
21202 (TypeContainer::GetInterfaceOrClass): Ditto.
21204 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21206 * interface.cs (Interface::DefineInterface): New method. Does exactly
21207 what RootContext.CreateInterface did earlier, only it takes care of nested types
21210 (Interface::GetInterfaces): Move from RootContext here and port.
21212 (Interface::GetInterfaceByName): Same here.
21214 * rootcontext.cs (ResolveTree): Re-write.
21216 (PopulateTypes): Re-write.
21218 * class.cs (TypeContainer::Populate): Populate nested types too.
21219 (TypeContainer::Emit): Emit nested members too.
21221 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21222 instead just use the name argument passed in as it is already fully
21225 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21226 to TypeContainer mapping to see if a type is user-defined.
21228 * class.cs (TypeContainer::CloseType): Implement.
21230 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21231 the default constructor.
21233 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21236 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21238 * interface.cs (CloseType): Create the type here.
21240 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21243 Remove all the methods which are now in TypeContainer.
21245 2001-10-10 Ravi Pratap <ravi@ximian.com>
21247 * delegate.cs (Define): Re-write bits to define the delegate
21250 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21252 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21254 * expression.cs (ImplicitReferenceConversion): handle null as well
21255 as a source to convert to any reference type.
21257 * statement.cs (Return): Perform any implicit conversions to
21258 expected return type.
21260 Validate use of return statement.
21262 * codegen.cs (EmitContext): Pass the expected return type here.
21264 * class.cs (Method, Constructor, Property): Pass expected return
21265 type to EmitContext.
21267 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21269 * expression.cs: Make DoResolve take an EmitContext instead of a
21272 Replaced `l' and `location' for `loc', for consistency.
21274 (Error, Warning): Remove unneeded Tc argument.
21276 * assign.cs, literal.cs, constant.cs: Update to new calling
21279 * codegen.cs: EmitContext now contains a flag indicating whether
21280 code is being generated in a static method or not.
21282 * cs-parser.jay: DecomposeQI, new function that replaces the old
21283 QualifiedIdentifier. Now we always decompose the assembled
21284 strings from qualified_identifier productions into a group of
21287 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21289 * rootcontext.cs: Deal with field-less struct types correctly now
21290 by passing the size option to Define Type.
21292 * class.cs: Removed hack that created one static field.
21294 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21296 * statement.cs: Moved most of the code generation here.
21298 2001-10-09 Ravi Pratap <ravi@ximian.com>
21300 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21303 (ElementAccess): Remove useless bits for now - keep checks as the spec
21306 2001-10-08 Ravi Pratap <ravi@ximian.com>
21308 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21309 and start performing checks according to the spec.
21311 2001-10-07 Ravi Pratap <ravi@ximian.com>
21313 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21314 rank_specifiers instead.
21316 (rank_specifiers): Change the order in which the rank specifiers are stored
21318 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21320 * expression.cs (ElementAccess): Implement the LValue interface too.
21322 2001-10-06 Ravi Pratap <ravi@ximian.com>
21324 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21325 except that user defined conversions are not included.
21327 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
21328 perform the conversion of the return type, if necessary.
21330 (New::DoResolve): Check whether we are creating an array or an object
21331 and accordingly do the needful.
21333 (New::Emit): Same here.
21335 (New::DoResolve): Implement guts of array creation.
21337 (New::FormLookupType): Helper function.
21339 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21341 * codegen.cs: Removed most of the code generation here, and move the
21342 corresponding code generation bits to the statement classes.
21344 Added support for try/catch/finalize and throw.
21346 * cs-parser.jay: Added support for try/catch/finalize.
21348 * class.cs: Catch static methods having the flags override,
21349 virtual or abstract.
21351 * expression.cs (UserCast): This user cast was not really doing
21352 what it was supposed to do. Which is to be born in fully resolved
21353 state. Parts of the resolution were being performed at Emit time!
21357 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21359 * expression.cs: Implicity convert the result from UserCast.
21361 2001-10-05 Ravi Pratap <ravi@ximian.com>
21363 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21364 prevented it from working correctly.
21366 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21367 merely ConvertImplicit.
21369 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21371 * typemanager.cs: Make the LookupTypeContainer function static,
21372 and not per-instance.
21374 * class.cs: Make static FindMembers (the one that takes a Type
21377 * codegen.cs: Add EmitForeach here.
21379 * cs-parser.jay: Make foreach a toplevel object instead of the
21380 inline expansion, as we need to perform semantic analysis on it.
21382 2001-10-05 Ravi Pratap <ravi@ximian.com>
21384 * expression.cs (Expression::ImplicitUserConversion): Rename to
21385 UserDefinedConversion.
21387 (Expression::UserDefinedConversion): Take an extra argument specifying
21388 whether we look for explicit user conversions too.
21390 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21392 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21394 (ExplicitUserConversion): Make it a call to UserDefinedConversion
21395 with the appropriate arguments.
21397 * cs-parser.jay (cast_expression): Record location too.
21399 * expression.cs (Cast): Record location info.
21401 (Expression::ConvertExplicit): Take location argument.
21403 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21404 to determine if we are doing explicit conversions.
21406 (UserCast::Emit): Update accordingly.
21408 (Expression::ConvertExplicit): Report an error if everything fails.
21410 * ../errors/cs0030.cs : Add.
21412 2001-10-04 Miguel de Icaza <miguel@ximian.com>
21414 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21415 virtual and newslot bits.
21417 * class.cs (TypeContainer::RegisterRequiredImplementations):
21418 Record methods we need.
21420 (TypeContainer::MakeKey): Helper function to make keys for
21421 MethodBases, since the Methodbase key is useless.
21423 (TypeContainer::Populate): Call RegisterRequiredImplementations
21424 before defining the methods.
21426 Create a mapping for method_builders_to_methods ahead of time
21427 instead of inside a tight loop.
21429 (::RequireMethods): Accept an object as the data to set into the
21430 hashtable so we can report interface vs abstract method mismatch.
21432 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21434 * report.cs: Make all of it static.
21436 * rootcontext.cs: Drop object_type and value_type computations, as
21437 we have those in the TypeManager anyways.
21439 Drop report instance variable too, now it is a global.
21441 * driver.cs: Use try/catch on command line handling.
21443 Add --probe option to debug the error reporting system with a test
21446 * report.cs: Add support for exiting program when a probe
21447 condition is reached.
21449 2001-10-03 Ravi Pratap <ravi@ximian.com>
21451 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21452 we do a forcible conversion regardless of type, to check if
21453 ForceConversion returns a null.
21455 (Binary::error19): Use location to report error.
21457 (Unary::error23): Use location here too.
21459 * ../errors/cs0019.cs : Check in.
21461 * ../errors/cs0023.cs : Check in.
21463 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21464 case of a non-null MethodInfo object with a length of 0 !
21466 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21467 an applicable member - according to the spec :-)
21468 Also fix logic to find members in base types.
21470 (Unary::ResolveOperator): Same here.
21472 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21473 as I was getting thoroughly confused between this and error19 :-)
21475 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21476 (::FindMostEncompassedType): Implement.
21477 (::FindMostEncompassingType): Implement.
21478 (::StandardConversionExists): Implement.
21480 (UserImplicitCast): Re-vamp. We now need info about most specific
21481 source and target types so that we can do the necessary conversions.
21483 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21484 mathematical union with no duplicates.
21486 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21488 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21489 in order from base classes to child classes, so that we can in
21490 child classes look up in our parent for method names and
21491 attributes (required for handling abstract, virtual, new, override
21492 constructs: we need to instrospect our base class, and if we dont
21493 populate the classes in order, the introspection might be
21494 incorrect. For example, a method could query its parent before
21495 the parent has any methods and would determine that the parent has
21496 no abstract methods (while it could have had them)).
21498 (RootContext::CreateType): Record the order in which we define the
21501 2001-10-02 Miguel de Icaza <miguel@ximian.com>
21503 * class.cs (TypeContainer::Populate): Also method definitions can
21504 fail now, keep track of this.
21506 (TypeContainer::FindMembers): Implement support for
21507 DeclaredOnly/noDeclaredOnly flag.
21509 (Constructor::Emit) Return the ConstructorBuilder.
21511 (Method::Emit) Return the MethodBuilder.
21512 Check for abstract or virtual methods to be public.
21514 * rootcontext.cs (RootContext::CreateType): Register all the
21515 abstract methods required for the class to be complete and the
21516 interface methods that must be implemented.
21518 * cs-parser.jay: Report error 501 (method requires body if it is
21519 not marked abstract or extern).
21521 * expression.cs (TypeOf::Emit): Implement.
21523 * typemanager.cs: runtime_handle_type, new global type.
21525 * class.cs (Property::Emit): Generate code for properties.
21527 2001-10-02 Ravi Pratap <ravi@ximian.com>
21529 * expression.cs (Unary::ResolveOperator): Find operators on base type
21530 too - we now conform exactly to the spec.
21532 (Binary::ResolveOperator): Same here.
21534 * class.cs (Operator::Define): Fix minor quirk in the tests.
21536 * ../errors/cs0215.cs : Added.
21538 * ../errors/cs0556.cs : Added.
21540 * ../errors/cs0555.cs : Added.
21542 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21544 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21545 single integer which is really efficient
21547 2001-10-01 Ravi Pratap <ravi@ximian.com>
21549 * expression.cs (Expression::ImplicitUserConversion): Use location
21550 even in the case when we are examining True operators.
21552 * class.cs (Operator::Define): Perform extensive checks to conform
21553 with the rules for operator overloading in the spec.
21555 * expression.cs (Expression::ImplicitReferenceConversion): Implement
21556 some of the other conversions mentioned in the spec.
21558 * typemanager.cs (array_type): New static member for the System.Array built-in
21561 (cloneable_interface): For System.ICloneable interface.
21563 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21564 we start resolving the tree and populating types.
21566 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21568 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21570 * expression.cs (Expression::ExprClassFromMemberInfo,
21571 Expression::Literalize): Create literal expressions from
21572 FieldInfos which are literals.
21574 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21575 type casts, because they were wrong. The test suite in tests
21578 (ImplicitNumericConversion): ushort to ulong requires a widening
21581 Int32 constant to long requires widening cast as well.
21583 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21584 for integers because the type on the stack is not i4.
21586 2001-09-30 Miguel de Icaza <miguel@ximian.com>
21588 * expression.cs (report118): require location argument.
21590 * parameter.cs: Do not dereference potential null value.
21592 * class.cs: Catch methods that lack the `new' keyword when
21593 overriding a name. Report warnings when `new' is used without
21594 anything being there to override.
21596 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21598 * class.cs: Only add constructor to hashtable if it is non-null
21599 (as now constructors can fail on define).
21601 (TypeManager, Class, Struct): Take location arguments.
21603 Catch field instance initialization in structs as errors.
21605 accepting_filter: a new filter for FindMembers that is static so
21606 that we dont create an instance per invocation.
21608 (Constructor::Define): Catch errors where a struct constructor is
21611 * cs-parser.jay: Pass location information for various new
21614 * delegate.cs (Delegate): take a location argument.
21616 * driver.cs: Do not call EmitCode if there were problesm in the
21617 Definition of the types, as many Builders wont be there.
21619 * decl.cs (Decl::Decl): Require a location argument.
21621 * cs-tokenizer.cs: Handle properly hex constants that can not fit
21622 into integers, and find the most appropiate integer for it.
21624 * literal.cs: Implement ULongLiteral.
21626 * rootcontext.cs: Provide better information about the location of
21627 failure when CreateType fails.
21629 2001-09-29 Miguel de Icaza <miguel@ximian.com>
21631 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21634 * expression.cs (Binary::CheckShiftArguments): Add missing type
21636 (Binary::ResolveOperator): Add type to the logical and and logical
21637 or, Bitwise And/Or and Exclusive Or code paths, it was missing
21640 (Binary::DoNumericPromotions): In the case where either argument
21641 is ulong (and most signed types combined with ulong cause an
21642 error) perform implicit integer constant conversions as well.
21644 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21646 * expression.cs (UserImplicitCast): Method should always be
21648 (Invocation::BetterConversion): Simplified test for IntLiteral.
21650 (Expression::ImplicitNumericConversion): Split this routine out.
21651 Put the code that performs implicit constant integer conversions
21654 (Expression::Resolve): Become a wrapper around DoResolve so we can
21655 check eclass and type being set after resolve.
21657 (Invocation::Badness): Remove this dead function
21659 (Binary::ResolveOperator): Do not compute the expensive argumnets
21660 unless we have a union for it.
21662 (Probe::Emit): Is needs to do an isinst and then
21663 compare against null.
21665 (::CanConvert): Added Location argument. If the Location argument
21666 is null (Location.Null), then we do not report errors. This is
21667 used by the `probe' mechanism of the Explicit conversion. We do
21668 not want to generate an error for something that the user
21669 explicitly requested to be casted. But the pipeline for an
21670 explicit cast first tests for potential implicit casts.
21672 So for now, if the Location is null, it means `Probe only' to
21673 avoid adding another argument. Might have to revise this
21676 (ClassCast): New class used to type cast objects into arbitrary
21677 classes (used in Explicit Reference Conversions).
21679 Implement `as' as well.
21681 Reverted all the patches from Ravi below: they were broken:
21683 * The use of `level' as a mechanism to stop recursive
21684 invocations is wrong. That was there just to catch the
21685 bug with a strack trace but not as a way of addressing
21688 To fix the problem we have to *understand* what is going
21689 on and the interactions and come up with a plan, not
21690 just get things going.
21692 * The use of the type conversion cache that I proposed
21693 last night had an open topic: How does this work across
21694 protection domains. A user defined conversion might not
21695 be public in the location where we are applying the
21696 conversion, a different conversion might be selected
21697 (ie, private A->B (better) but public B->A (worse),
21698 inside A, A->B applies, but outside it, B->A will
21701 * On top of that (ie, even if the above is solved),
21702 conversions in a cache need to be abstract. Ie, `To
21703 convert from an Int to a Short use an OpcodeCast', not
21704 `To convert from an Int to a Short use the OpcodeCast on
21705 the variable 5' (which is what this patch was doing).
21707 2001-09-28 Ravi Pratap <ravi@ximian.com>
21709 * expression.cs (Invocation::ConversionExists): Re-write to use
21710 the conversion cache
21712 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21713 cache all conversions done, not just user-defined ones.
21715 (Invocation::BetterConversion): The real culprit. Use ConversionExists
21716 to determine if a conversion exists instead of acutually trying to
21717 perform the conversion. It's faster too.
21719 (Expression::ConvertExplicit): Modify to use ConversionExists to check
21720 and only then attempt the implicit conversion.
21722 2001-09-28 Ravi Pratap <ravi@ximian.com>
21724 * expression.cs (ConvertImplicit): Use a cache for conversions
21725 already found. Check level of recursion and bail out if necessary.
21727 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21729 * typemanager.cs (string_concat_string_string, string_concat_object_object):
21730 Export standard methods that we expect for string operations.
21732 * statement.cs (Block::UsageWarning): Track usage of variables and
21733 report the errors for not used variables.
21735 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21738 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21740 * codegen.cs: remove unnneded code
21742 * expression.cs: Removed BuiltinTypeAccess class
21744 Fix the order in which implicit conversions are
21747 The previous fixed dropped support for boxed conversions (adding a
21748 test to the test suite now)
21750 (UserImplicitCast::CanConvert): Remove test for source being null,
21751 that code is broken. We should not feed a null to begin with, if
21752 we do, then we should track the bug where the problem originates
21753 and not try to cover it up here.
21755 Return a resolved expression of type UserImplicitCast on success
21756 rather than true/false. Ravi: this is what I was talking about,
21757 the pattern is to use a static method as a "constructor" for
21760 Also, do not create arguments until the very last minute,
21761 otherwise we always create the arguments even for lookups that
21762 will never be performed.
21764 (UserImplicitCast::Resolve): Eliminate, objects of type
21765 UserImplicitCast are born in a fully resolved state.
21767 * typemanager.cs (InitCoreTypes): Init also value_type
21768 (System.ValueType).
21770 * expression.cs (Cast::Resolve): First resolve the child expression.
21772 (LValue): Add new method AddressOf to be used by
21775 Change the argument of Store to take an EmitContext instead of an
21776 ILGenerator, because things like FieldExpr need to be able to call
21777 their children expression to generate the instance code.
21779 (Expression::Error, Expression::Warning): Sugar functions for
21782 (Expression::MemberLookup): Accept a TypeContainer instead of a
21783 Report as the first argument.
21785 (Expression::ResolvePrimary): Killed. I still want to improve
21786 this as currently the code is just not right.
21788 (Expression::ResolveMemberAccess): Simplify, but it is still
21791 (Unary::Resolve): Catch errors in AddressOf operators.
21793 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21794 index to a byte for the short-version, or the compiler will choose
21795 the wrong Emit call, which generates the wrong data.
21797 (ParameterReference::Emit, ::Store): same.
21799 (FieldExpr::AddressOf): Implement.
21801 * typemanager.cs: TypeManager: made public variable instead of
21804 * driver.cs: document --fatal.
21806 * report.cs (ErrorMessage, WarningMessage): new names for the old
21807 Error and Warning classes.
21809 * cs-parser.jay (member_access): Turn built-in access to types
21810 into a normal simplename
21812 2001-09-27 Ravi Pratap <ravi@ximian.com>
21814 * expression.cs (Invocation::BetterConversion): Fix to cope
21815 with q being null, since this was introducing a bug.
21817 * expression.cs (ConvertImplicit): Do built-in conversions first.
21819 2001-09-27 Ravi Pratap <ravi@ximian.com>
21821 * expression.cs (UserImplicitCast::Resolve): Fix bug.
21823 2001-09-27 Ravi Pratap <ravi@ximian.com>
21825 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21826 I had introduced long ago (what's new ?).
21828 * expression.cs (UserImplicitCast::CanConvert): Static method to do
21829 the work of all the checking.
21830 (ConvertImplicit): Call CanConvert and only then create object if necessary.
21831 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21833 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21834 that is the right way.
21836 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
21837 overloading resolution. Use everywhere instead of cutting and pasting code.
21839 (Binary::ResolveOperator): Use MakeUnionSet.
21841 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
21842 we have to convert to bool types. Not complete yet.
21844 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21846 * typemanager.cs (TypeManager::CSharpName): support ushort.
21848 * expression.cs (Expression::TryImplicitIntConversion): Attempts
21849 to provide an expression that performsn an implicit constant int
21850 conversion (section 6.1.6).
21851 (Expression::ConvertImplicitRequired): Reworked to include
21852 implicit constant expression conversions.
21854 (Expression::ConvertNumericExplicit): Finished.
21856 (Invocation::Emit): If InstanceExpression is null, then it means
21857 that we perform a call on this.
21859 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21861 * expression.cs (Unary::Emit): Remove some dead code.
21862 (Probe): Implement Resolve and Emit for `is'.
21863 (Expression::ConvertImplicitRequired): Attempt to do constant
21864 expression conversions here. Maybe should be moved to
21865 ConvertImplicit, but I am not sure.
21866 (Expression::ImplicitLongConstantConversionPossible,
21867 Expression::ImplicitIntConstantConversionPossible): New functions
21868 that tell whether is it possible to apply an implicit constant
21869 expression conversion.
21871 (ConvertNumericExplicit): Started work on explicit numeric
21874 * cs-parser.jay: Update operator constants.
21876 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21877 (Parameters::GetSignature): Hook up VerifyArgs here.
21878 (Parameters::VerifyArgs): Verifies that no two arguments have the
21881 * class.cs (Operator): Update the operator names to reflect the
21882 ones that the spec expects (as we are just stringizing the
21885 * expression.cs (Unary::ResolveOperator): Fix bug: Use
21886 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21887 previous usage did only work for our methods.
21888 (Expression::ConvertImplicit): Handle decimal implicit numeric
21889 conversions as well.
21890 (Expression::InternalTypeConstructor): Used to invoke constructors
21891 on internal types for default promotions.
21893 (Unary::Emit): Implement special handling for the pre/post
21894 increment/decrement for overloaded operators, as they need to have
21895 the same semantics as the other operators.
21897 (Binary::ResolveOperator): ditto.
21898 (Invocation::ConversionExists): ditto.
21899 (UserImplicitCast::Resolve): ditto.
21901 2001-09-26 Ravi Pratap <ravi@ximian.com>
21903 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21904 operator, return after emitting body. Regression tests pass again !
21906 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21907 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21908 (Invocation::OverloadResolve): Ditto.
21909 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21911 * everywhere : update calls to the above methods accordingly.
21913 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21915 * assign.cs (Assign): Make it inherit from ExpressionStatement.
21917 * expression.cs (ExpressionStatement): New base class used for
21918 expressions that can appear in statements, so that we can provide
21919 an alternate path to generate expression that do not leave a value
21922 (Expression::Emit, and all the derivatives): We no longer return
21923 whether a value is left on the stack or not. Every expression
21924 after being emitted leaves a single value on the stack.
21926 * codegen.cs (EmitContext::EmitStatementExpression): Use the
21927 facilties of ExpressionStatement if possible.
21929 * cs-parser.jay: Update statement_expression.
21931 2001-09-25 Miguel de Icaza <miguel@ximian.com>
21933 * driver.cs: Change the wording of message
21935 2001-09-25 Ravi Pratap <ravi@ximian.com>
21937 * expression.cs (Binary::ResolveOperator): Had forgottten to set
21938 the type of the expression to the return type of the method if
21939 we have an overloaded operator match ! The regression tests pass again !
21940 (Unary::ResolveOperator): Ditto.
21942 * expression.cs (Invocation::ConversionExists): Correct the member lookup
21943 to find "op_Implicit", not "implicit" ;-)
21944 (UserImplicitCast): New class to take care of user-defined implicit conversions.
21945 (ConvertImplicit, ForceConversion): Take TypeContainer argument
21947 * everywhere : Correct calls to the above accordingly.
21949 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21950 (ConvertImplicit): Do user-defined conversion if it exists.
21952 2001-09-24 Miguel de Icaza <miguel@ximian.com>
21954 * assign.cs: track location.
21955 (Resolve): Use implicit conversions on assignment.
21957 * literal.cs: Oops. Not good, Emit of short access values should
21958 pass (Bytes) or the wrong argument will be selected.
21960 * expression.cs (Unary::Emit): Emit code for -expr.
21962 (Unary::ResolveOperator): Handle `Substract' for non-constants
21963 (substract from zero from the non-constants).
21964 Deal with Doubles as well.
21966 (Expression::ConvertImplicitRequired): New routine that reports an
21967 error if no implicit conversion exists.
21969 (Invocation::OverloadResolve): Store the converted implicit
21970 expressions if we make them
21972 2001-09-24 Ravi Pratap <ravi@ximian.com>
21974 * class.cs (ConstructorInitializer): Take a Location argument.
21975 (ConstructorBaseInitializer): Same here.
21976 (ConstructorThisInitializer): Same here.
21978 * cs-parser.jay : Update all calls accordingly.
21980 * expression.cs (Unary, Binary, New): Take location argument.
21981 Update accordingly everywhere.
21983 * cs-parser.jay : Update all calls to the above to take a location
21986 * class.cs : Ditto.
21988 2001-09-24 Ravi Pratap <ravi@ximian.com>
21990 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21991 (Invocation::BetterConversion): Same here
21992 (Invocation::ConversionExists): Ditto.
21994 (Invocation::ConversionExists): Implement.
21996 2001-09-22 Ravi Pratap <ravi@ximian.com>
21998 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21999 Also take an additional TypeContainer argument.
22001 * All over : Pass in TypeContainer as argument to OverloadResolve.
22003 * typemanager.cs (CSharpName): Update to check for the string type and return
22006 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22009 2001-09-21 Ravi Pratap <ravi@ximian.com>
22011 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22012 (Invocation::BetterFunction): Implement.
22013 (Invocation::BetterConversion): Implement.
22014 (Invocation::ConversionExists): Skeleton, no implementation yet.
22016 Okay, things work fine !
22018 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22020 * typemanager.cs: declare and load enum_type, delegate_type and
22023 * expression.cs (Expression::Emit): Now emit returns a value that
22024 tells whether a value is left on the stack or not. This strategy
22025 might be reveted tomorrow with a mechanism that would address
22026 multiple assignments.
22027 (Expression::report118): Utility routine to report mismatches on
22030 (Unary::Report23): Report impossible type/operator combination
22033 (Unary::IsIncrementableNumber): Whether the type can be
22034 incremented or decremented with add.
22035 (Unary::ResolveOperator): Also allow enumerations to be bitwise
22037 (Unary::ResolveOperator): Implement ++, !, ~,
22039 (Invocation::Emit): Deal with new Emit convetion.
22041 * All Expression derivatives: Updated their Emit method to return
22042 whether they leave values on the stack or not.
22044 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22045 stack for expressions that are statements.
22047 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22049 * expression.cs (LValue): New interface. Must be implemented by
22051 (LocalVariableReference, ParameterReference, FieldExpr): Implement
22054 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22055 interface for generating code, simplifies the code.
22057 2001-09-20 Ravi Pratap <ravi@ximian.com>
22059 * expression.cs (everywhere): Comment out return statements in ::Resolve
22060 methods to avoid the warnings.
22062 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22064 * driver.cs (parse): Report error 2001 if we can not open the
22067 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22070 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22073 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22074 otherwise nested blocks end up with the same index.
22076 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22078 * expression.cs: Instead of having FIXMEs in the Resolve
22079 functions, throw exceptions so it is obvious that we are facing a
22082 * cs-parser.jay (invocation_expression): Pass Location information.
22084 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22085 Use a basename for those routines because .NET does not like paths
22088 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22091 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22093 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22094 are loading the correct data types (throws an exception if not).
22095 (TypeManager::InitCoreTypes): Use CoreLookupType
22097 * expression.cs (Unary::ResolveOperator): return the child
22098 expression for expressions which are just +expr.
22099 (Unary::ResolveOperator): Return negative literals for -LITERAL
22100 expressions (otherwise they are Unary {Literal}).
22101 (Invocation::Badness): Take into account `Implicit constant
22102 expression conversions'.
22104 * literal.cs (LongLiteral): Implement long literal class.
22105 (IntLiteral): export the `Value' of the intliteral.
22107 2001-09-19 Ravi Pratap <ravi@ximian.com>
22109 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22111 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22112 instead of 'Operator'
22114 * expression.cs (Binary::ResolveOperator): Update accordingly.
22115 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22118 * cs-parser.jay (unary_expression): Update to use the new names.
22120 * gen-treedump.cs (GetUnary): Same here.
22122 * expression.cs (Unary::Resolve): Implement.
22123 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22124 operators are found instead of making noise ;-)
22125 (Unary::ResolveOperator): New method to do precisely the same thing which
22126 Binary::ResolveOperator does for Binary expressions.
22127 (Unary.method, .Arguments): Add.
22128 (Unary::OperName): Implement.
22129 (Unary::ForceConversion): Copy and Paste !
22131 * class.cs (Operator::Define): Fix a small bug for the case when we have
22134 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22135 for the inbuilt operators. Only overloading works for now ;-)
22137 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22139 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22140 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22142 * expression.cs (This::Emit): Implement.
22143 (This::Resolve): Implement.
22144 (TypeOf:Resolve): Implement.
22145 (Expression::ResolveSimpleName): Add an implicit this to instance
22147 (MemberAccess::Resolve): Deal with Parameters and Fields.
22148 Bind instance variable to Field expressions.
22149 (FieldExpr::Instance): New field used to track the expression that
22150 represents the object instance.
22151 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22153 (FieldExpr::Emit): Implement.
22155 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22156 the last instruction contains a return opcode to avoid generating
22157 the last `ret' instruction (this generates correct code, and it is
22158 nice to pass the peverify output).
22160 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22161 initializer for static and instance variables.
22162 (Constructor::Emit): Allow initializer to be null in the case of
22163 static constructors. Only emit initializer for instance
22166 (TypeContainer::FindMembers): Return a null array if there are no
22169 Also fix the code for the MemberTypes.Method branch, as it was not
22170 scanning that for operators (or tried to access null variables before).
22172 * assign.cs (Assign::Emit): Handle instance and static fields.
22176 * driver.cs: Stop compilation if there are parse errors.
22178 * cs-parser.jay (constructor_declaration): Provide default base
22179 initializer for non-static constructors.
22180 (constructor_declarator): Do not provide a default base
22181 initializers if none was specified.
22182 Catch the fact that constructors should not have parameters.
22184 * class.cs: Do not emit parent class initializers for static
22185 constructors, that should be flagged as an error.
22187 2001-09-18 Ravi Pratap <ravi@ximian.com>
22189 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22190 Move back code into TypeContainer::Populate.
22192 2001-09-18 Ravi Pratap <ravi@ximian.com>
22194 * class.cs (TypeContainer::AddConstructor): Fix the check to
22195 compare against Name, not Basename.
22196 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22198 * cs-parser.jay : Update accordingly.
22200 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22201 for methods, don't forget to look into the operators too.
22202 (RegisterMethodBuilder): Helper method to take care of this for
22203 methods, constructors and operators.
22204 (Operator::Define): Completely revamp.
22205 (Operator.OperatorMethod, MethodName): New fields.
22206 (TypeContainer::Populate): Move the registering of builders into
22207 RegisterMethodBuilder.
22208 (Operator::Emit): Re-write.
22210 * expression.cs (Binary::Emit): Comment out code path to emit method
22211 invocation stuff for the case when we have a user defined operator. I am
22212 just not able to get it right !
22214 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22216 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22219 (Expression::MemberLookup): Provide a version that allows to
22220 specify the MemberTypes and BindingFlags.
22222 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22223 so it was not fetching variable information from outer blocks.
22225 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22226 Beforefieldinit as it was buggy.
22228 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22229 that Ravi put here.
22231 * class.cs (Constructor::Emit): Only emit if block is not null.
22232 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22233 deal with this by semantically definining it as if the user had
22236 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22237 constructors as we now "emit" them at a higher level.
22239 (TypeContainer::DefineDefaultConstructor): Used to define the
22240 default constructors if none was provided.
22242 (ConstructorInitializer): Add methods Resolve and Emit.
22244 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22246 2001-09-17 Ravi Pratap <ravi@ximian.com>
22248 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22249 the default constructor builder with our hashtable for methodbuilders
22252 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22253 and argument_count is 0 in which case we have a match.
22254 (Binary::ResolveOperator): More null checking and miscellaneous coding
22257 2001-09-17 Ravi Pratap <ravi@ximian.com>
22259 * rootcontext.cs (IsNameSpace): Compare against null.
22261 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22263 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22264 and Unary::Operator.
22266 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22269 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22270 we have overloaded operators.
22271 (Binary::ResolveOperator): Implement the part which does the operator overload
22274 * class.cs (Operator::Emit): Implement.
22275 (TypeContainer::Emit): Emit the operators we have too.
22277 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22278 the case when we have a user-defined operator.
22280 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22282 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22284 2001-09-16 Ravi Pratap <ravi@ximian.com>
22286 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22287 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22288 (Constructor::Emit): Implement.
22289 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22290 if we have no work to do.
22291 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22294 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22295 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22297 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22300 2001-09-15 Ravi Pratap <ravi@ximian.com>
22302 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22304 (Tree::RecordNamespace): Method to do what the name says ;-)
22305 (Tree::Namespaces): Property to get at the namespaces hashtable.
22307 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22310 * rootcontext.cs (IsNamespace): Fixed it :-)
22312 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22314 * class.cs (TypeContainer::FindMembers): Add support for
22316 (MethodCore): New class that encapsulates both the shared aspects
22317 of a Constructor and a Method.
22318 (Method, Constructor): Factored pieces into MethodCore.
22320 * driver.cs: Added --fatal which makes errors throw exceptions.
22321 Load System assembly as well as part of the standard library.
22323 * report.cs: Allow throwing exceptions on errors for debugging.
22325 * modifiers.cs: Do not use `parent', instead use the real type
22326 container to evaluate permission settings.
22328 * class.cs: Put Ravi's patch back in. He is right, and we will
22329 have to cope with the
22331 2001-09-14 Ravi Pratap <ravi@ximian.com>
22333 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22334 FamORAssem, not FamANDAssem.
22336 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22338 * driver.cs: Added --parse option that only parses its input files
22341 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
22342 incorrect. IsTopLevel is not used to tell whether an object is
22343 root_types or not (that can be achieved by testing this ==
22344 root_types). But to see if this is a top-level *class* (not
22345 necessarly our "toplevel" container).
22347 2001-09-14 Ravi Pratap <ravi@ximian.com>
22349 * enum.cs (Enum::Define): Modify to call the Lookup method on the
22350 parent instead of a direct call to GetType.
22352 2001-09-14 Ravi Pratap <ravi@ximian.com>
22354 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22355 Modifiers.TypeAttr. This should just be a call to that method.
22357 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22358 object so that we can determine if we are top-level or not.
22360 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
22363 * enum.cs (Enum::Define): Ditto.
22365 * modifiers.cs (FieldAttr): Re-write.
22367 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22368 (TypeContainer::HaveStaticConstructor): New property to provide access
22369 to precisely that info.
22371 * modifiers.cs (MethodAttr): Re-write.
22372 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22374 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22375 of top-level types as claimed.
22377 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22379 * expression.cs (MemberLookup): Fruitless attempt to lookup
22380 constructors. Maybe I need to emit default constructors? That
22381 might be it (currently .NET emits this for me automatically).
22382 (Invocation::OverloadResolve): Cope with Arguments == null.
22383 (Invocation::EmitArguments): new function, shared by the new
22384 constructor and us.
22385 (Invocation::Emit): Handle static and instance methods. Emit
22386 proper call instruction for virtual or non-virtual invocations.
22387 (New::Emit): Implement.
22388 (New::Resolve): Implement.
22389 (MemberAccess:Resolve): Implement.
22390 (MethodGroupExpr::InstanceExpression): used conforming to the spec
22391 to track instances.
22392 (FieldExpr::Resolve): Set type.
22394 * support.cs: Handle empty arguments.
22396 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22397 SimpleLookup): Auxiliary routines to help parse a qualifier
22400 Update qualifier_identifier rule.
22402 * codegen.cs: Removed debugging messages.
22404 * class.cs: Make this a global thing, this acts just as a "key" to
22405 objects that we might have around.
22407 (Populate): Only initialize method_builders_to_methods once.
22409 * expression.cs (PropertyExpr): Initialize type from the
22412 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22413 Resolve pattern. Attempt to implicitly convert value to boolean.
22416 * expression.cs: Set the type for the int32/int32 argument case.
22417 (Binary::ResolveOperator): Set the return type to boolean for
22418 comparission operators
22420 * typemanager.cs: Remove debugging print code.
22422 (Invocation::Resolve): resolve type.
22424 * class.cs: Allocate a MemberInfo of the correct size, as the code
22425 elsewhere depends on the test to reflect the correct contents.
22427 (Method::) Keep track of parameters, due to System.Reflection holes
22429 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22432 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22433 of the exact size and return that.
22435 (Class::LookupMethodByBuilder): New function that maps
22436 MethodBuilders to its methods. Required to locate the information
22437 on methods because System.Reflection bit us again.
22439 * support.cs: New file, contains an interface ParameterData and
22440 two implementations: ReflectionParameters and InternalParameters
22441 used to access Parameter information. We will need to grow this
22444 * expression.cs (Invocation::GetParameterData): implement a cache
22445 and a wrapper around the ParameterData creation for methods.
22446 (Invocation::OverloadResolve): Use new code.
22448 2001-09-13 Ravi Pratap <ravi@ximian.com>
22450 * class.cs (TypeContainer::EmitField): Remove and move into
22451 (Field::Define): here and modify accordingly.
22452 (Field.FieldBuilder): New member.
22453 (TypeContainer::Populate): Update accordingly.
22454 (TypeContainer::FindMembers): Implement.
22456 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22458 * statement.cs: (VariableInfo::VariableType): New field to be
22459 initialized with the full type once it is resolved.
22461 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22463 * parameter.cs (GetParameterInfo): Use a type cache to compute
22464 things only once, and to reuse this information
22466 * expression.cs (LocalVariableReference::Emit): Implement.
22467 (OpcodeCast::Emit): fix.
22469 (ParameterReference::Resolve): Implement.
22470 (ParameterReference::Emit): Implement.
22472 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22473 that are expressions need to stay as Expressions.
22475 * typemanager.cs (CSharpName): Returns the C# name of a type if
22478 * expression.cs (Expression::ConvertImplicit): New function that
22479 implements implicit type conversions.
22481 (Expression::ImplicitReferenceConversion): Implements implicit
22482 reference conversions.
22484 (EmptyCast): New type for transparent casts.
22486 (OpcodeCast): New type for casts of types that are performed with
22487 a sequence of bytecodes.
22489 (BoxedCast): New type used for casting value types into reference
22490 types. Emits a box opcode.
22492 (Binary::DoNumericPromotions): Implements numeric promotions of
22493 and computation of the Binary::Type.
22495 (Binary::EmitBranchable): Optimization.
22497 (Binary::Emit): Implement code emission for expressions.
22499 * typemanager.cs (TypeManager): Added two new core types: sbyte
22502 2001-09-12 Ravi Pratap <ravi@ximian.com>
22504 * class.cs (TypeContainer::FindMembers): Method which does exactly
22505 what Type.FindMembers does, only we don't have to use reflection. No
22506 implementation yet.
22508 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22509 typecontainer objects as we need to get at them.
22510 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22512 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22513 typecontainer object.
22515 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22516 of just a Report object.
22518 2001-09-11 Ravi Pratap <ravi@ximian.com>
22520 * class.cs (Event::Define): Go back to using the prefixes "add_" and
22522 (TypeContainer::Populate): Now define the delegates of the type too.
22523 (TypeContainer.Delegates): Property to access the list of delegates defined
22526 * delegates.cs (Delegate::Define): Implement partially.
22528 * modifiers.cs (TypeAttr): Handle more flags.
22530 2001-09-11 Ravi Pratap <ravi@ximian.com>
22532 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22534 (Operator::Define): Re-write logic to get types by using the LookupType method
22535 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22536 (Indexer::Define): Ditto.
22537 (Event::Define): Ditto.
22538 (Property::Define): Ditto.
22540 2001-09-10 Ravi Pratap <ravi@ximian.com>
22542 * class.cs (TypeContainer::Populate): Now define operators too.
22543 (TypeContainer.Operators): New property to access the list of operators
22545 (Operator.OperatorMethodBuilder): New member to hold the method builder
22546 for the operator we are defining.
22547 (Operator::Define): Implement.
22549 2001-09-10 Ravi Pratap <ravi@ximian.com>
22551 * class.cs (Event::Define): Make the prefixes of the accessor methods
22552 addOn_ and removeOn_
22554 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22555 of the location being passed in too. Ideally, this should go later since all
22556 error reporting should be done through the Report object.
22558 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22559 (Populate): Iterate thru the indexers we have and define them too.
22560 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22561 for the get and set accessors.
22562 (Indexer::Define): Implement.
22564 2001-09-09 Miguel de Icaza <miguel@ximian.com>
22566 * expression.cs (Binary::Resolve): Beginning of it. I scratched
22567 my previous implementation, did not work.
22569 * typemanager.cs: Add a couple of missing types (the longs).
22571 * literal.cs: Use TypeManager.bool_type instead of getting it.
22573 * expression.cs (EventExpr): New kind of expressions.
22574 (Expressio::ExprClassFromMemberInfo): finish
22576 2001-09-08 Miguel de Icaza <miguel@ximian.com>
22578 * assign.cs: Emit stores to static fields differently.
22580 2001-09-08 Ravi Pratap <ravi@ximian.com>
22582 * Merge in changes and adjust code to tackle conflicts. Backed out my
22583 code in Assign::Resolve ;-)
22585 2001-09-08 Ravi Pratap <ravi@ximian.com>
22587 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22588 instead Report.Error and also pass in the location.
22589 (CSharpParser::Lexer): New readonly property to return the reference
22590 to the Tokenizer object.
22591 (declare_local_variables): Use Report.Error with location instead of plain
22595 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22596 (Operator.CheckBinaryOperator): Ditto.
22598 * cs-parser.jay (operator_declarator): Update accordingly.
22600 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22601 (CheckBinaryOperator): Same here.
22603 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22604 on the name without any prefixes of namespace names etc. This is because we
22605 already might have something already fully qualified like
22606 'System.Console.WriteLine'
22608 * assign.cs (Resolve): Begin implementation. Stuck ;-)
22610 2001-09-07 Ravi Pratap <ravi@ximian.com>
22612 * cs-tokenizer.cs (location): Return a string which also contains
22615 * expression.cs (ElementAccess): New class for expressions of the
22616 type 'element access.'
22617 (BaseAccess): New class for expressions of the type 'base access.'
22618 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22621 * cs-parser.jay (element_access): Implement action.
22622 (base_access): Implement actions.
22623 (checked_expression, unchecked_expression): Implement.
22625 * cs-parser.jay (local_variable_type): Correct and implement.
22626 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22628 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22630 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22631 name and the specifiers.
22633 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22635 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
22636 making them all public ;-)
22638 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22641 2001-09-07 Miguel de Icaza <miguel@ximian.com>
22643 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22645 (FieldExpr, PropertyExprs): New resolved expressions.
22646 (SimpleName::MemberStaticCheck): Perform static checks for access
22647 to non-static fields on static methods. Maybe this should be
22648 generalized for MemberAccesses.
22649 (SimpleName::ResolveSimpleName): More work on simple name
22652 * cs-parser.jay (primary_expression/qualified_identifier): track
22653 the parameter index.
22655 * codegen.cs (CodeGen::Save): Catch save exception, report error.
22656 (EmitContext::EmitBoolExpression): Chain to expression generation
22657 instead of temporary hack.
22658 (::EmitStatementExpression): Put generic expression code generation.
22660 * assign.cs (Assign::Emit): Implement variable assignments to
22661 local variables, parameters and fields.
22663 2001-09-06 Miguel de Icaza <miguel@ximian.com>
22665 * statement.cs (Block::GetVariableInfo): New method, returns the
22666 VariableInfo for a variable name in a block.
22667 (Block::GetVariableType): Implement in terms of GetVariableInfo
22669 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22670 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22672 2001-09-06 Ravi Pratap <ravi@ximian.com>
22674 * cs-parser.jay (operator_declaration): Continue on my quest : update
22675 to take attributes argument.
22676 (event_declaration): Ditto.
22677 (enum_declaration): Ditto.
22678 (indexer_declaration): Ditto.
22680 * class.cs (Operator::Operator): Update constructor accordingly.
22681 (Event::Event): Ditto.
22683 * delegate.cs (Delegate::Delegate): Same here.
22685 * enum.cs (Enum::Enum): Same here.
22687 2001-09-05 Ravi Pratap <ravi@ximian.com>
22689 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22691 * ../tests/cs0658.cs : New file to demonstrate error 0658.
22693 * attribute.cs (Attributes): New class to encapsulate all attributes which were
22694 being passed around as an arraylist.
22695 (Attributes::AddAttribute): Method to add attribute sections.
22697 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22698 (struct_declaration): Update accordingly.
22699 (constant_declaration): Update.
22700 (field_declaration): Update.
22701 (method_header): Update.
22702 (fixed_parameter): Update.
22703 (parameter_array): Ditto.
22704 (property_declaration): Ditto.
22705 (destructor_declaration): Ditto.
22707 * class.cs (Struct::Struct): Update constructors accordingly.
22708 (Class::Class): Ditto.
22709 (Field::Field): Ditto.
22710 (Method::Method): Ditto.
22711 (Property::Property): Ditto.
22712 (TypeContainer::OptAttribute): update property's return type.
22714 * interface.cs (Interface.opt_attributes): New member.
22715 (Interface::Interface): Update to take the extra Attributes argument.
22717 * parameter.cs (Parameter::Parameter): Ditto.
22719 * constant.cs (Constant::Constant): Ditto.
22721 * interface.cs (InterfaceMemberBase): New OptAttributes field.
22722 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
22723 the attributes as a parameter.
22724 (InterfaceProperty): Update constructor call.
22725 (InterfaceEvent): Ditto.
22726 (InterfaceMethod): Ditto.
22727 (InterfaceIndexer): Ditto.
22729 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
22730 pass the attributes too.
22731 (interface_event_declaration): Ditto.
22732 (interface_property_declaration): Ditto.
22733 (interface_method_declaration): Ditto.
22734 (interface_declaration): Ditto.
22736 2001-09-05 Miguel de Icaza <miguel@ximian.com>
22738 * class.cs (Method::Define): Track the "static Main" definition to
22739 create an entry point.
22741 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22742 EntryPoint if we find it.
22744 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22745 (EmitContext::ig): Make this variable public.
22747 * driver.cs: Make the default output file be the first file name
22748 with the .exe extension.
22750 Detect empty compilations
22752 Handle various kinds of output targets. Handle --target and
22753 rename -t to --dumper.
22755 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22756 methods inherited from Expression return now an Expression. This
22757 will is used during the tree rewriting as we resolve them during
22760 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22761 the spec. Missing entirely is the information about
22762 accessability of elements of it.
22764 (Expression::ExprClassFromMemberInfo): New constructor for
22765 Expressions that creates a fully initialized Expression based on
22766 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22769 (Invocation::Resolve): Begin implementing resolution of invocations.
22771 * literal.cs (StringLiteral): Implement Emit.
22773 2001-09-05 Ravi Pratap <ravi@ximian.com>
22775 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22778 2001-09-04 Ravi Pratap <ravi@ximian.com>
22780 * cs-parser.jay (attribute_arguments): Implement actions.
22781 (attribute): Fix bug in production. Implement action.
22782 (attribute_list): Implement.
22783 (attribute_target): Implement.
22784 (attribute_target_specifier, opt_target_specifier): Implement
22785 (CheckAttributeTarget): New method to check if the attribute target
22787 (attribute_section): Implement.
22788 (opt_attributes): Implement.
22790 * attribute.cs : New file to handle attributes.
22791 (Attribute): Class to hold attribute info.
22793 * cs-parser.jay (opt_attribute_target_specifier): Remove production
22794 (attribute_section): Modify production to use 2 different rules to
22795 achieve the same thing. 1 s/r conflict down !
22796 Clean out commented, useless, non-reducing dimension_separator rules.
22798 * class.cs (TypeContainer.attributes): New member to hold list
22799 of attributes for a type.
22800 (Struct::Struct): Modify to take one more argument, the attribute list.
22801 (Class::Class): Ditto.
22802 (Field::Field): Ditto.
22803 (Method::Method): Ditto.
22804 (Property::Property): Ditto.
22806 * cs-parser.jay (struct_declaration): Update constructor call to
22807 pass in the attributes too.
22808 (class_declaration): Ditto.
22809 (constant_declaration): Ditto.
22810 (field_declaration): Ditto.
22811 (method_header): Ditto.
22812 (fixed_parameter): Ditto.
22813 (parameter_array): Ditto.
22814 (property_declaration): Ditto.
22816 * constant.cs (Constant::Constant): Update constructor similarly.
22817 Use System.Collections.
22819 * parameter.cs (Parameter::Parameter): Update as above.
22821 2001-09-02 Ravi Pratap <ravi@ximian.com>
22823 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22824 (TypeContainer.delegates): New member to hold list of delegates.
22826 * cs-parser.jay (delegate_declaration): Implement the action correctly
22827 this time as I seem to be on crack ;-)
22829 2001-09-02 Miguel de Icaza <miguel@ximian.com>
22831 * rootcontext.cs (RootContext::IsNamespace): new function, used to
22832 tell whether an identifier represents a namespace.
22834 * expression.cs (NamespaceExpr): A namespace expression, used only
22835 temporarly during expression resolution.
22836 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22837 utility functions to resolve names on expressions.
22839 2001-09-01 Miguel de Icaza <miguel@ximian.com>
22841 * codegen.cs: Add hook for StatementExpressions.
22843 * class.cs: Fix inverted test for static flag in methods.
22845 2001-09-02 Ravi Pratap <ravi@ximian.com>
22847 * class.cs (Operator::CheckUnaryOperator): Correct error number used
22848 to make it coincide with MS' number.
22849 (Operator::CheckBinaryOperator): Ditto.
22851 * ../errors/errors.txt : Remove error numbers added earlier.
22853 * ../errors/cs1019.cs : Test case for error # 1019
22855 * ../errros/cs1020.cs : Test case for error # 1020
22857 * cs-parser.jay : Clean out commented cruft.
22858 (dimension_separators, dimension_separator): Comment out. Ostensibly not
22859 used anywhere - non-reducing rule.
22860 (namespace_declarations): Non-reducing rule - comment out.
22862 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22863 with TypeContainer::AddEnum.
22865 * delegate.cs : New file for delegate handling classes.
22866 (Delegate): Class for declaring delegates.
22868 * makefile : Update.
22870 * cs-parser.jay (delegate_declaration): Implement.
22872 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
22874 * class.cs (Event::Define): Implement.
22875 (Event.EventBuilder): New member.
22877 * class.cs (TypeContainer::Populate): Update to define all enums and events
22879 (Events): New property for the events arraylist we hold. Shouldn't we move to using
22880 readonly fields for all these cases ?
22882 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22884 * class.cs (Property): Revamp to use the convention of making fields readonly.
22885 Accordingly modify code elsewhere.
22887 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22888 the Define method of the Property class.
22890 * class.cs : Clean up applied patch and update references to variables etc. Fix
22892 (TypeContainer::Populate): Update to define all the properties we have. Also
22893 define all enumerations.
22895 * enum.cs (Define): Implement.
22897 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22899 * cs-parser.jay (overloadable_operator): The semantic value is an
22900 enum of the Operator class.
22901 (operator_declarator): Implement actions.
22902 (operator_declaration): Implement.
22904 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22905 validity of definitions.
22906 (Operator::CheckBinaryOperator): Static method to check for binary operators
22907 (TypeContainer::AddOperator): New method to add an operator to a type.
22909 * cs-parser.jay (indexer_declaration): Added line to actually call the
22910 AddIndexer method so it gets added ;-)
22912 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
22913 already taken care of by the MS compiler ?
22915 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
22917 * class.cs (Operator): New class for operator declarations.
22918 (Operator::OpType): Enum for the various operators.
22920 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
22922 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22923 ostensibly handle this in semantic analysis.
22925 * cs-parser.jay (general_catch_clause): Comment out
22926 (specific_catch_clauses, specific_catch_clause): Ditto.
22927 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22928 (catch_args, opt_catch_args): New productions.
22929 (catch_clause): Rewrite to use the new productions above
22930 (catch_clauses): Modify accordingly.
22931 (opt_catch_clauses): New production to use in try_statement
22932 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22933 and re-write the code in the actions to extract the specific and
22934 general catch clauses by being a little smart ;-)
22936 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22937 Hooray, try and catch statements parse fine !
22939 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22941 * statement.cs (Block::GetVariableType): Fix logic to extract the type
22942 string from the hashtable of variables.
22944 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22945 I end up making that mistake ;-)
22946 (catch_clauses): Fixed gross error which made Key and Value of the
22947 DictionaryEntry the same : $1 !!
22949 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22951 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22953 * cs-parser.jay (event_declaration): Correct to remove the semicolon
22954 when the add and remove accessors are specified.
22956 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22958 * cs-parser.jay (IndexerDeclaration): New helper class to hold
22959 information about indexer_declarator.
22960 (indexer_declarator): Implement actions.
22961 (parsing_indexer): New local boolean used to keep track of whether
22962 we are parsing indexers or properties. This is necessary because
22963 implicit_parameters come into picture even for the get accessor in the
22964 case of an indexer.
22965 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22967 * class.cs (Indexer): New class for indexer declarations.
22968 (TypeContainer::AddIndexer): New method to add an indexer to a type.
22969 (TypeContainer::indexers): New member to hold list of indexers for the
22972 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22974 * cs-parser.jay (add_accessor_declaration): Implement action.
22975 (remove_accessor_declaration): Implement action.
22976 (event_accessors_declaration): Implement
22977 (variable_declarators): swap statements for first rule - trivial.
22979 * class.cs (Event): New class to hold information about event
22981 (TypeContainer::AddEvent): New method to add an event to a type
22982 (TypeContainer::events): New member to hold list of events.
22984 * cs-parser.jay (event_declaration): Implement actions.
22986 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22988 * cs-parser.jay (dim_separators): Implement. Make it a string
22989 concatenating all the commas together, just as they appear.
22990 (opt_dim_separators): Modify accordingly
22991 (rank_specifiers): Update accordingly. Basically do the same
22992 thing - instead, collect the brackets here.
22993 (opt_rank_sepcifiers): Modify accordingly.
22994 (array_type): Modify to actually return the complete type string
22995 instead of ignoring the rank_specifiers.
22996 (expression_list): Implement to collect the expressions
22997 (variable_initializer): Implement. We make it a list of expressions
22998 essentially so that we can handle the array_initializer case neatly too.
22999 (variable_initializer_list): Implement.
23000 (array_initializer): Make it a list of variable_initializers
23001 (opt_array_initializer): Modify accordingly.
23003 * expression.cs (New::NType): Add enumeration to help us
23004 keep track of whether we have an object/delegate creation
23005 or an array creation.
23006 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23007 members to hold data about array creation.
23008 (New:New): Modify to update NewType
23009 (New:New): New Overloaded contructor for the array creation
23012 * cs-parser.jay (array_creation_expression): Implement to call
23013 the overloaded New constructor.
23015 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23017 * class.cs (TypeContainer::Constructors): Return member
23018 constructors instead of returning null.
23020 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23022 * typemanager.cs (InitCoreTypes): Initialize the various core
23023 types after we have populated the type manager with the user
23024 defined types (this distinction will be important later while
23025 compiling corlib.dll)
23027 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23028 on Expression Classification. Now all expressions have a method
23029 `Resolve' and a method `Emit'.
23031 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23032 generation from working. Also add some temporary debugging
23035 2001-08-24 Miguel de Icaza <miguel@ximian.com>
23037 * codegen.cs: Lots of code generation pieces. This is only the
23038 beginning, will continue tomorrow with more touches of polish. We
23039 handle the fundamentals of if, while, do, for, return. Others are
23040 trickier and I need to start working on invocations soon.
23042 * gen-treedump.cs: Bug fix, use s.Increment here instead of
23045 * codegen.cs (EmitContext): New struct, used during code
23046 emission to keep a context. Most of the code generation will be
23049 * cs-parser.jay: Add embedded blocks to the list of statements of
23050 this block. So code generation proceeds in a top down fashion.
23052 2001-08-23 Miguel de Icaza <miguel@ximian.com>
23054 * statement.cs: Add support for multiple child blocks.
23056 2001-08-22 Miguel de Icaza <miguel@ximian.com>
23058 * codegen.cs (EmitCode): New function, will emit the code for a
23059 Block of code given a TypeContainer and its ILGenerator.
23061 * statement.cs (Block): Standard public readonly optimization.
23062 (Block::Block constructors): Link children.
23063 (Block::Child): Child Linker.
23064 (Block::EmitVariables): Emits IL variable declarations.
23066 * class.cs: Drop support for MethodGroups here, delay until
23068 (Method::): Applied the same simplification that I did before, and
23069 move from Properties to public readonly fields.
23070 (Method::ParameterTypes): Returns the parameter types for the
23071 function, and implements a cache that will be useful later when I
23072 do error checking and the semantic analysis on the methods is
23074 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23075 and made a method, optional argument tells whether this is a class
23076 or a structure to apply the `has-this' bit.
23077 (Method::GetCallingConvention): Implement, returns the calling
23079 (Method::Define): Defines the type, a second pass is performed
23080 later to populate the methods.
23082 (Constructor::ParameterTypes): implement a cache similar to the
23083 one on Method::ParameterTypes, useful later when we do semantic
23086 (TypeContainer::EmitMethod): New method. Emits methods.
23088 * expression.cs: Removed MethodGroup class from here.
23090 * parameter.cs (Parameters::GetCallingConvention): new method.
23092 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23094 * class.cs (TypeContainer::Populate): Drop RootContext from the
23097 (Constructor::CallingConvention): Returns the calling convention.
23098 (Constructor::ParameterTypes): Returns the constructor parameter
23101 (TypeContainer::AddConstructor): Keep track of default constructor
23102 and the default static constructor.
23104 (Constructor::) Another class that starts using `public readonly'
23105 instead of properties.
23107 (Constructor::IsDefault): Whether this is a default constructor.
23109 (Field::) use readonly public fields instead of properties also.
23111 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23112 track of static constructors; If none is used, turn on
23113 BeforeFieldInit in the TypeAttributes.
23115 * cs-parser.jay (opt_argument_list): now the return can be null
23116 for the cases where there are no arguments.
23118 (constructor_declarator): If there is no implicit `base' or
23119 `this', then invoke the default parent constructor.
23121 * modifiers.cs (MethodAttr): New static function maps a set of
23122 modifiers flags into a MethodAttributes enum
23123 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23124 MethodAttr, TypeAttr to represent the various mappings where the
23125 modifiers are used.
23126 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23128 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23130 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23133 * interface.cs (PopulateIndexer): Implemented the code generator
23134 for interface indexers.
23136 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23138 * interface.cs (InterfaceMemberBase): Now we track the new status
23141 (PopulateProperty): Implement property population. Woohoo! Got
23142 Methods and Properties going today.
23144 Removed all the properties for interfaces, and replaced them with
23145 `public readonly' fields.
23147 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23149 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23150 initialize their hashtables/arraylists only when they are needed
23151 instead of doing this always.
23153 * parameter.cs: Handle refs and out parameters.
23155 * cs-parser.jay: Use an ArrayList to construct the arguments
23156 instead of the ParameterCollection, and then cast that to a
23159 * parameter.cs: Drop the use of ParameterCollection and use
23160 instead arrays of Parameters.
23162 (GetParameterInfo): Use the Type, not the Name when resolving
23165 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23167 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23168 and instead use public readonly fields.
23170 * class.cs: Put back walking code for type containers.
23172 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23174 * class.cs (MakeConstant): Code to define constants.
23176 * rootcontext.cs (LookupType): New function. Used to locate types
23179 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23181 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23182 this System.Reflection code is. Kudos to Microsoft
23184 * typemanager.cs: Implement a type cache and avoid loading all
23185 types at boot time. Wrap in LookupType the internals. This made
23186 the compiler so much faster. Wow. I rule!
23188 * driver.cs: Make sure we always load mscorlib first (for
23189 debugging purposes, nothing really important).
23191 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23192 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23194 * rootcontext.cs: Lookup types on their namespace; Lookup types
23195 on namespaces that have been imported using the `using' keyword.
23197 * class.cs (TypeContainer::TypeAttr): Virtualize.
23198 (Class::TypeAttr): Return attributes suitable for this bad boy.
23199 (Struct::TypeAttr): ditto.
23200 Handle nested classes.
23201 (TypeContainer::) Remove all the type visiting code, it is now
23202 replaced with the rootcontext.cs code
23204 * rootcontext.cs (GetClassBases): Added support for structs.
23206 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23208 * interface.cs, statement.cs, class.cs, parameter.cs,
23209 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23210 Drop use of TypeRefs, and use strings instead.
23212 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23216 * class.cs (Struct::Struct): set the SEALED flags after
23217 checking the modifiers.
23218 (TypeContainer::TypeAttr): new property, returns the
23219 TypeAttributes for a class.
23221 * cs-parser.jay (type_list): Oops, list production was creating a
23222 new list of base types.
23224 * rootcontext.cs (StdLib): New property.
23225 (GetInterfaceTypeByName): returns an interface by type name, and
23226 encapsulates error handling here.
23227 (GetInterfaces): simplified.
23228 (ResolveTree): Encapsulated all the tree resolution here.
23229 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23232 * driver.cs: Add support for --nostdlib, to avoid loading the
23233 default assemblies.
23234 (Main): Do not put tree resolution here.
23236 * rootcontext.cs: Beginning of the class resolution.
23238 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23240 * rootcontext.cs: Provide better error reporting.
23242 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23244 * rootcontext.cs (CreateInterface): Handle the case where there
23245 are no parent interfaces.
23247 (CloseTypes): Routine to flush types at the end.
23248 (CreateInterface): Track types.
23249 (GetInterfaces): Returns an array of Types from the list of
23250 defined interfaces.
23252 * typemanager.c (AddUserType): Mechanism to track user types (puts
23253 the type on the global type hash, and allows us to close it at the
23256 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23258 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23259 RecordInterface instead.
23261 * cs-parser.jay: Updated to reflect changes above.
23263 * decl.cs (Definition): Keep track of the TypeBuilder type that
23264 represents this type here. Not sure we will use it in the long
23265 run, but wont hurt for now.
23267 * driver.cs: Smaller changes to accomodate the new code.
23269 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23272 * rootcontext.cs (CreateInterface): New method, used to create
23273 the System.TypeBuilder type for interfaces.
23274 (ResolveInterfaces): new entry point to resolve the interface
23276 (CodeGen): Property, used to keep track of the code generator.
23278 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23280 * cs-parser.jay: Add a second production for delegate_declaration
23283 (enum_body): Put an opt_comma here instead of putting it on
23284 enum_body or enum_member_declarations so we can handle trailing
23285 commas on enumeration members. Gets rid of a shift/reduce.
23287 (type_list): Need a COMMA in the middle.
23289 (indexer_declaration): Tell tokenizer to recognize get/set
23291 * Remove old targets.
23293 * Re-add the parser target.
23295 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23297 * cs-parser.jay: Add precendence rules for a number of operators
23298 ot reduce the number of shift/reduce conflicts in the grammar.
23300 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23302 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23305 Get rid of old crufty code.
23307 * rootcontext.cs: Use this to keep track of the parsed
23308 representation and the defined types available to the program.
23310 * gen-treedump.cs: adjust for new convention.
23312 * type.cs: Split out the type manager, and the assembly builder
23315 * typemanager.cs: the type manager will live here now.
23317 * cil-codegen.cs: And the code generator here.
23319 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23321 * makefile: Fixed up for easy making.
23323 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23325 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23328 (unary_expression): Expand pre_increment_expression and
23329 post_decrement_expression to reduce a shift/reduce.
23331 2001-07-11 Simon Cozens
23333 * cs-tokenizer.cs: Hex numbers should begin with a 0.
23335 Improve allow_keyword_as_indent name.
23337 2001-06-19 Miguel de Icaza <miguel@ximian.com>
23339 * Adjustments for Beta2.
23341 2001-06-13 Miguel de Icaza <miguel@ximian.com>
23343 * decl.cs: Added `Define' abstract method.
23344 (InTransit): new property, used to catch recursive definitions.
23346 * interface.cs: Implement `Define'.
23348 * modifiers.cs: Map Modifiers.constants to
23349 System.Reflection.TypeAttribute flags.
23351 * class.cs: Keep track of types and user-defined types.
23352 (BuilderInit): New method for creating an assembly
23353 (ResolveType): New function to launch the resolution process, only
23354 used by interfaces for now.
23356 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23357 that are inserted into the name space.
23359 2001-06-08 Miguel de Icaza <miguel@ximian.com>
23361 * ARGH. I have screwed up my tree so many times due to the use of
23362 rsync rather than using CVS. Going to fix this at once.
23364 * driver.cs: Objetify driver. Load assemblies, use assemblies to
23367 2001-06-07 Miguel de Icaza <miguel@ximian.com>
23369 * Experiment successful: Use System.Type rather that our own
23372 2001-05-25 Miguel de Icaza <miguel@ximian.com>
23374 * cs-parser.jay: Removed nsAliases from here.
23376 Use new namespaces, handle `using XXX;'
23378 * namespace.cs: Reimplemented namespace handling, use a recursive
23379 definition of the class. Now we can keep track of using clauses
23380 and catch invalid using clauses.
23382 2001-05-24 Miguel de Icaza <miguel@ximian.com>
23384 * gen-treedump.cs: Adapted for all the renaming.
23386 * expression.cs (Expression): this class now has a Type property
23387 which returns an expression Type.
23389 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23390 `Type', as this has a different meaning now in the base
23392 2001-05-22 Miguel de Icaza <miguel@ximian.com>
23394 * interface.cs, class.cs: Removed from all the sources the
23395 references to signature computation, as we can not do method
23396 signature computation during the parsing time, as we are not
23397 trying to solve at that point distinguishing:
23401 void a (NS.Blah x) {}
23404 Which depending on the context might be valid or not, as we do not
23405 know if Blah is the same thing as NS.Blah at that point.
23407 * Redid everything so the code uses TypeRefs now instead of
23408 Types. TypeRefs are just temporary type placeholders, that need
23409 to be resolved. They initially have a pointer to a string and the
23410 current scope in which they are used. This is used later by the
23411 compiler to resolve the reference to an actual Type.
23413 * DeclSpace is no longer a CIR.Type, and neither are
23414 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23415 are all DeclSpaces, but no Types.
23417 * type.cs (TypeRefManager): This implements the TypeRef manager,
23418 which keeps track of all the types that need to be resolved after
23419 the parsing has finished.
23421 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23423 * ARGH. We are going to have to store `foreach' as a class rather
23424 than resolving it, as we need to verify error 1579 after name
23425 resolution. *OR* we could keep a flag that says `This request to
23426 IEnumerator comes from a foreach statement' which we can then use
23427 to generate the error.
23429 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23431 * class.cs (TypeContainer.AddMethod): we now add methods to the
23432 MethodGroup instead of the method hashtable.
23434 * expression.cs: Add MethodGroup abstraction, which gets us one
23435 step closer to the specification in the way we handle method
23438 * cs-parser.jay (primary_expression): qualified_identifier now
23439 tried to match up an identifier to a local variable reference or
23440 to a parameter reference.
23442 current_local_parameters is now a parser global variable that
23443 points to the current parameters for the block, used during name
23446 (property_declaration): Now creates an implicit `value' argument to
23449 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23451 * parameter.cs: Do not use `param' arguments as part of the
23452 signature, per the spec.
23454 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23456 * decl.cs: Base class for classes, structs and interfaces. This
23457 is the "Declaration Space"
23459 * cs-parser.jay: Use CheckDef for checking declaration errors
23460 instead of having one on each function.
23462 * class.cs: Factor out some code for handling error handling in
23463 accordance to the "Declarations" section in the "Basic Concepts"
23464 chapter in the ECMA C# spec.
23466 * interface.cs: Make all interface member classes derive from
23467 InterfaceMemberBase.
23469 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23471 * Many things: all interfaces are parsed and generated in
23472 gen-treedump. Support for member variables, constructors,
23473 destructors, properties, constants is there.
23475 Beginning of the IL backend, but very little done, just there for
23478 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23480 * cs-parser.jay: Fix labeled statement.
23482 * cs-tokenizer.cs (escape): Escape " and ' always.
23483 ref_line, ref_name: keep track of the line/filename as instructed
23484 by #line by the compiler.
23487 2001-04-27 Miguel de Icaza <miguel@ximian.com>
23489 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23490 to match the values in System.CodeDOM.
23492 Divid renamed to Divide.
23494 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23496 (Statements.set): remove.
23498 * System.CodeDOM/CodeCatchClause.cs: always have a valid
23501 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23502 falseStatements always have valid values.
23504 * cs-parser.jay: Use System.CodeDOM now.