1 2005-10-14 Miguel de Icaza <miguel@novell.com>
3 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
5 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
7 * cs-parser.jay, expression.cs : CS0214 was missing error location
8 for constants. Fixed bug #76404.
10 2005-10-10 Raja R Harinath <rharinath@novell.com>
12 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
14 (PropertyExpr.EmitCall): Likewise.
15 * expression.cs (Invocation.EmitArguments): Handle case where
17 (Invocation.EmitCall): Avoid allocating temporary variable if
18 there are no arguments.
20 2005-10-11 Marek Safar <marek.safar@seznam.cz>
23 * convert.cs (ExplicitConversionCore): Fixed object->enum
26 2005-10-07 Raja R Harinath <rharinath@novell.com>
29 * convert.cs (ImplicitConversionStandard): Move conversion of
30 void* to arbitrary pointer types ...
31 (ExplicitConversionStandard): .. here.
32 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
33 error to always print typenames.
35 2005-10-07 Raja R Harinath <rharinath@novell.com>
37 * convert.cs (GetConversionOperator): Rename from
38 GetConversionOperators. Move operator selection code from ...
39 (UserDefinedConversion): ... here.
41 2005-10-06 Marek Safar <marek.safar@seznam.cz>
43 * convert.cs (ExplicitConversionCore): Removed duplicate enum
46 2005-10-05 Marek Safar <marek.safar@seznam.cz>
48 * assign.cs (Assign.DoResolve): Error method changed.
50 * cfold.cs (DoConstantNumericPromotions): Error method changed.
52 * const.cs (ResolveValue): Reset in_transit immediately.
54 * constant.cs: Error method changed.
56 * convert.cs: Removed useless location parameter.
57 (ExplicitNumericConversion): Don't do double enum check.
58 (ExplicitConversionCore): Renamed from ExplicitConversion.
59 (ExplicitUnsafe): Extracted from ExplicitConversion.
60 (ExplicitConversion): Uses for error reporting.
62 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
64 (ResolveBoolean): Uses common error method.
65 (CastToDecimal): Get rid of ec.
66 (CastFromDecimal): Optimized.
67 (ConvCast): Get rid of ec.
69 * enum.cs (ResolveValue): Reset in_transit immediately.
70 (Emit): Return after first error.
72 * expression.cs: Convert changes.
74 * literal.cs: Error method changed.
76 * statement.cs: Error method changed.
78 2005-10-06 Raja R Harinath <rharinath@novell.com>
80 Fix gtest-131.cs and gtest-211.cs.
81 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
82 Only emit code for a label if it is used. Unreachable code can
83 violate ECMA evaluation stack invariants.
85 2005-09-27 Marek Safar <marek.safar@seznam.cz>
87 * anonymous.cs: Implemented ExprClassName.
89 * assign.cs (Assign.DoResolve): Don't chrash when type is not
92 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
95 * class.cs (StaticClass.DefineContainerMembers): Report protected
98 * codegen.cs: if(ed) PRODUCTION.
100 * convert.cs (Error_CannotImplicitConversion): Better error
103 * cs-parser.jay: More error checks.
105 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
107 * driver.cs (CSCParseOption): Enabled wrong option check.
109 * ecore.cs (Expression.ExprClassName): Turned to property.
110 (MemberExpr.CheckIntermediateModification): For checking boxed
111 value types modification.
113 * statement.cs (Fixed.Resolve): Expression type must be
114 convertible to fixed type.
115 (CollectionForeach.GetEnumeratorFilter,TryType):
116 Small refactoring for easier error checking.
118 2005-09-26 Marek Safar <marek.safar@seznam.cz>
120 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
123 * class.cs (GeneratedBaseInitializer): New class for customization
124 compiler generated initializers.
125 (MemberBase.DoDefine): Check Obsolete attribute here.
126 (FieldMember.DoDefine): Ditto.
128 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
131 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
132 (MemberCore.GetObsoleteAttribute): Removed argument.
133 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
134 (MemberCore.CheckObsoleteType): New helper.
138 * statement.cs: Updates after MemberCore changes.
140 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
141 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
143 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
144 obsolete attribute for compiler construct.
145 (As.DoResolve): Cache result.
147 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
149 2005-10-01 Miguel de Icaza <miguel@novell.com>
151 * expression.cs (Probe): instead of having a "Type probe_type"
152 keep the extra information as a TypeExpr probe_type_expr since the
153 "As" operator needs to perform some type checks.
155 * (As.DoResolve): If the type is a type parameter, ensure that it
156 is constrained by a class.
158 2005-09-22 Miguel de Icaza <miguel@novell.com>
160 * statement.cs (Lock): Use the TemporaryVariable class instead of
161 manually using local variables as those do not work when variables
164 * ecore.cs: Moved the TemporaryVariable class from being a nested
165 class inside Foreach to be a public class that can be employed in
168 2005-09-19 Marek Safar <marek.safar@seznam.cz>
170 * cs-parser.jay: interface_accessors replaced by
171 accessor_declarations.
173 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
176 * statement.cs (GotoCase.Resolve): Convert null constant to
178 (SwitchLabel.ResolveAndReduce): Ditto.
179 (SwitchLabel.NullStringCase): Custom null stamp.
180 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
182 typemanager.cs (CSharpSignature): Don't skip first argument
185 2005-09-16 Marek Safar <marek.safar@seznam.cz>
187 * cfold.cs, constant.cs, convert.cs, ecore.cs,
188 expression.cs, iterators.cs, literal.cs: Store constants and
191 * class.cs (MemberBase.ShortName): Pass location.
193 * cs-parser.jay: Some location fixes.
195 * ecore.cs (Expression.Location): Made virtual.
197 2005-09-27 Marek Safar <marek.safar@seznam.cz>
200 * const.cs (Const.ResolveValue): Check for assigning non-null
201 value to reference type.
203 2005-09-26 Raja R Harinath <rharinath@novell.com>
206 * expression.cs (This.VerifyFixed): In a value type T, the type of
207 'this' is T&, iow, 'this' is either an out or ref parameter. In a
208 value type R, 'this' is treated as a value parameter.
210 2005-09-05 Miguel de Icaza <miguel@novell.com>
212 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
213 if the underlying types are the same, otherwise we need to produce
214 code that will do the proper cast.
216 This was exposed by Marek's constant rewrite which produced
217 invalid code for the call site:
224 This fixes test-49.cs
226 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
228 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
229 Type/Object should be allowed as well. Fixed bug #75968.
231 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
233 * expression.cs : (Binary.DoResolve): when one is enum constant and
234 another is constant 0, then return enum one *as enum type*.
237 2005-10-04 Martin Baulig <martin@ximian.com>
239 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
240 `SetMemberIsUsed()' work for generics, too.
242 2005-10-04 Martin Baulig <martin@ximian.com>
244 * expression.cs (DelegateInvocation.EmitStatement): Make this work
245 for corlib. Fixes #75691.
247 2005-09-28 Marek Safar <marek.safar@seznam.cz>
250 * driver.cs: Fix compilation files with full root path.
252 2005-09-25 Miguel de Icaza <miguel@novell.com>
254 * report.cs (SymbolRelatedToPreviousError): Format the output so
255 it does not use an open parenthesis that is never closed.
257 * driver.cs: Follow coding guidelines
259 2005-09-18 Miguel de Icaza <miguel@novell.com>
261 * driver.cs: Set InEmacs based on the environment variable EMACS.
263 * location.cs (InEmacs): in this mode, do not report column
264 location as it confuses Emacs.
266 2005-10-03 Raja R Harinath <rharinath@novell.com>
268 * support.cs (SeekableStreamReader.Position): Don't error out when
269 the requested position is just beyond the end of the current
272 2005-09-28 Raja R Harinath <rharinath@novell.com>
274 * support.cs (SeekableStreamReader): Simplify drastically. Don't
275 try to keep in sync with the byte count of the underlying Stream.
276 However, this limits us to a window size of 2048 characters: i.e.,
277 the maximum lookahead of our lexer/parser can be 2048 characters.
279 2005-09-22 Martin Baulig <martin@ximian.com>
281 * driver.cs: Removed a debugging FIXME.
283 2005-09-21 Raja R Harinath <rharinath@novell.com>
285 * cs-parser.jay (type_arguments): Add CS1644 check.
286 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
288 2005-09-15 Raja R Harinath <rharinath@novell.com>
290 * Makefile (PROGRAM): Make profile specific.
291 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
292 the current directory.
295 * expression.cs (Invocation.EmitCall): Remove optimization on
296 this_call since it doesn't handle 'this' being a value type.
298 2005-09-05 Geoff Norton <gnorton@customerdna.com>
300 * driver.cs: Ensure file handles are closed after parsing
302 2005-09-05 Miguel de Icaza <miguel@novell.com>
304 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
305 if the underlying types are the same, otherwise we need to produce
306 code that will do the proper cast.
308 This was exposed by Marek's constant rewrite which produced
309 invalid code for the call site:
316 This fixes test-49.cs
318 2005-09-05 Martin Baulig <martin@ximian.com>
320 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
321 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
323 * cs-parser.jay (delegate_declaration): Small fix for #75852.
325 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
327 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
328 to be a pointer type due to the spec 25.2, so check if declaring
329 type is generic type definition. Fixed bug #75772.
331 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
334 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
335 both types are not defined by methods.
336 * expression.cs : (Invocation.IsApplicable): it should work when
337 the argument type is equal to the parameter type, not only when
338 ImplicitConversionExists() returns true.
340 2005-09-02 Raja R Harinath <rharinath@novell.com>
342 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
346 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
347 flow-branching for LocalVariableReferences in case we were invoked
349 * expression.cs (LocalVariableReference.VerifyAssigned): New.
351 (LocalVariableReference.DoResolveBase): ... this.
352 (MemberAccess.Resolve): Do the check that was disabled during
355 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
358 (PartialContainer.Create): check abstract/sealed/static strictly
359 but abstract/sealed can exist only at one side. Fixed bug #75883.
361 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
364 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
365 specified, don't default to UnmanagedType.I4.
367 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
369 * expression.cs : conditional operator should check possibly
370 incorrect assign expression. Fixed bug #75946.
372 2005-08-30 Raja R Harinath <rharinath@novell.com>
375 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
376 (ScopeInfo.EmitScopeType): Use it to construct field names from
377 names of captured locals.
380 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
381 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
382 Pass 'target_type' to BoxedCast. Don't default to 'object'.
383 (ExplicitConversion): Remove enum cases already handled by
384 implicit conversion. Move implicit conversion check to the beginning.
385 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
386 * expression.cs (ArrayCreation.EmitDynamicInitializers):
387 Don't treat System.Enum as a struct.
389 2005-08-30 Jb Evain <jbevain@gmail.com>
391 * attribute.cs: handles as expression in parameters.
393 2005-08-30 Raja R Harinath <rharinath@novell.com>
396 * class.cs (TypeContainer.VerifyClsName): Don't use a
397 PartialContainer when verifying CLS compliance.
398 (AbstractPropertyEventMethod): Set Parent here, ...
399 (PropertyMethod): ... not here.
401 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
403 * attribute.cs : escaped attribute name should not be allowed to be
404 resolved (e.g. @class as classAttribute). Fixed bug #75930.
406 2005-08-29 Raja R Harinath <rharinath@novell.com>
409 * convert.cs (ImplicitStandardConversionExists): Allow zero also
410 when converting a long constant to unsigned long.
411 * expression.cs (Invocation.OverloadResolve): Add sanity check to
412 detect where IsApplicable and VerifyArgumentsCompat disagree.
414 2005-08-29 Raja R Harinath <rharinath@novell.com>
415 and Carlos Alberto Cortez <carlos@unixmexico.org>
418 * class.cs (TypeContainer.CanElideInitializer): New helper.
419 (TypeContainer.EmitFieldInitializers): Use it to determine if we
420 can safely emitting the initializer of a field.
422 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
424 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
425 allowed inside a switch (without loop). Fixed bug #75433.
427 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
429 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
430 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
432 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
434 * driver.cs : kinda reverting the default encoding changes (not exact
435 revert since I noticed that "codepage:reset" might not work fine).
437 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
439 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
440 Location. Now getter and setter store location correctly.
441 (errors/cs0111-12.cs now reports the expected location.)
443 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
445 * driver.cs : Use default encoding on the environment.
446 Removed (now that) extra parameter for SeekableStreamReader.
447 * support.cs : (SeekableStreamReader) third .ctor() argument for
448 StreamReader is not required (always true). preamble size could
449 be acquired in simpler and safe way.
451 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
453 * cs-parser.jay: report CS0642 at warning level 3
454 and report CS0642 for an if else statement also
455 fixes bug #74745. Patch by John Luke (and a bit
457 Removed extra CS0642 warning check for "while",
459 * statement.cs: In Block.Resolve(), CS0642 check
460 is reimplemented to check a sequence of an empty
461 statement and a block.
465 2005-08-24 Marek Safar <marek.safar@seznam.cz>
467 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
468 detection until I fix it.
470 * cs-tokenizer.cs: Changed error message.
472 * cs-parser.jay: Fixed 2 error locations.
474 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
475 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
478 * enum.cs (GetSignatureForError): Fixed.
480 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
484 * typemanager.cs (RegisterProperty): Removed.
486 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
488 2005-08-24 Raja R Harinath <rharinath@novell.com>
491 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
492 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
494 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
496 * expression.cs : tiny fix is required for not warning positive ulong.
499 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
501 * expression.cs : add CS0652 check for constant and integral
502 expression. Fixed bug #53974.
504 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
506 * expression.cs : in DoNumericPromotions(), check if there is implicit
507 conversion overload for string (to check CS0034). Fixed bug #52492.
509 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
511 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
513 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
515 * ecore.cs : report location when it is *not* Null.
517 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
523 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
524 correctly. Fixed bug #75721.
526 2005-08-23 Raja R Harinath <rharinath@novell.com>
528 * support.cs (SeekableStreamReader.Position): Avoid an expensive
529 loop that performs 'min (pos, char_count)'.
532 * expression.cs (Unary.ResolveOperator): Don't discard implicit
533 converted value in Operator.OnesComplement.
535 2005-08-22 Ben Maurer <bmaurer@ximian.com>
537 * anonymous.cs: If the anon method is pulled into a helper class,
538 it needs to be `internal' not `private'. Fixes runtime behavior on
541 2005-08-17 Marek Safar <marek.safar@seznam.cz>
544 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
547 2005-08-16 Marek Safar <marek.safar@seznam.cz>
549 The big constants rewrite
550 Fix #75746, #75685 and more
551 As a side effect saved 1MB for MWF ;-)
553 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
554 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
555 enum based for corlib compilation.
557 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
560 * class.cs (FixedField.Define): Use ResolveAsConstant.
562 * const.cs (IConstant): Interface constants and enums.
563 (Const.ResolveValue): New method for constant resolvning.
564 (ExternalConstant): Constants from imported assemblies.
566 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
567 conversion; like enums.
568 (Constant.ToType): Converts this constant to different type.
569 (Constant.Increment): Adds 1.
571 * convert.cs (ImplicitConversionRequired): Simplified.
573 * cs-parser.jay: Create EnumMember directly.
575 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
577 * doc.cs (GenerateEnumDocComment): Removed.
579 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
580 (ConvertIntLiteral): Removed.
581 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
583 * enum.cs (EnumMember): Implement IConstant.
584 (Enum.IsValidEnumConstant): Removed.
585 (Enum.GetNextDefaultValue): Removed.
586 (Enum.FindMembers): Updated.
587 (Enum.GenerateDocComment): Iterate enum members.
589 * expression.cs (Cast.TryReduce): Handle enums correctly.
590 (New.Constantify): Made public.
591 (MemberAccess.DoResolve): Removed contant specific if(s).
593 * literal.cs (NullLiteral): Implement new abstract methods.
595 * statement.cs (GotoCase.Resolve): Use new constant methods.
596 (SwitchLabel.ResolveAndReduce): Use new constant methods.
598 * typemanager.cs (LookupEnum): Removed.
599 (IsEnumType): Fixed to work with corlib.
600 (RegisterConstant): Removed.
601 (LookupConstant): Removed.
602 (GetConstant): Changed to work with IConstant.
604 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
606 * location.cs : Fixed overflown (>255) column number.
608 2005-08-03 Raja R Harinath <rharinath@novell.com>
610 First cut of the qualified-alias-member feature.
611 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
613 * cs-parser.jay (DOUBLE_COLON): New token.
614 (namespace_or_type_name): Add rule for recognizing
615 qualified-alias-members.
616 (primary_expression): Likewise.
617 (element_access): Allow QualifiedAliasMember as a possible
618 type-bearing expression.
619 (local_variable_type, local_variable_pointer_type): Likewise.
620 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
621 aliases in the current and enclosing namespace declarations.
622 (NamespaceEntry.UsingAlias): Add CS0440 warning.
623 * decl.cs (MemberName.is_double_colon): New.
624 (MemberName.MemberName): Add new constructor for alias-member.
625 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
626 * expression.cs (QualifiedAliasMember): New expression type.
628 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
630 * location.cs : it borked when no argument was specified.
632 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
634 * location.cs : tiny ToString() format fix.
636 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
638 * statement.cs : oops, it was missing.
640 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
642 A set of fixes for precise line/column location.
645 "token" field now holds a file/line "delta", a line number offset
646 from the segment, and a column number. See also:
647 http://lists.ximian.com/pipermail/mono-devel-list/2004-
649 Removed static IsNull. Use instance IsNull property instead.
651 For some tokens it stores Location. For Identifier it stores
652 LocatedToken which is a pair of string name and location.
653 Column numbers are adjusted only at getChar().
655 Use Location.ToString() for reporting (it now contains column).
657 Largely modified to use LocatedToken instead of
658 string (IDENTIFIER), and to acquire Location from some tokens.
659 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
660 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
662 Now MemberName holds Location. DeclSpace.ctor() receives Location
663 as a parameter. Removed extra parameters to all derived classes.
664 Replaced Location.IsNull() with instance property.
665 * assign.cs, expression.cs :
666 Added .ctor() overload that omits Location.
668 Added "nameEscaped" flag that indicates the identifier was escaped
669 in the source file. This fixes bug #57047.
671 2005-09-02 Martin Baulig <martin@ximian.com>
673 * class.cs: Make CS3005 a warning, not an error.
675 2005-08-02 Marek Safar <marek.safar@seznam.cz>
677 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
678 New method, looking for lo-case imported cls type.
680 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
683 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
685 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
687 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
689 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
691 Optimized to save 3.5 MB for SWF compilation.
693 2005-08-01 Marek Safar <marek.safar@seznam.cz>
695 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
696 (PartialContainer.Create): Moved logic AddToContainer.
697 (PartialContainer.MarkForDuplicationCheck): Shares name.
699 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
702 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
704 (Namespace.GetSignatureForError): New method.
706 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
707 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
709 2005-08-01 Raja R Harinath <rharinath@novell.com>
712 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
713 member lookup rather than qualifier_type, since qualifier_type can
716 2005-08-01 Marek Safar <marek.safar@seznam.cz>
718 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
721 2005-07-31 Miguel de Icaza <miguel@novell.com>
723 * statement.cs: Copy the local exception into the exception
724 captured local. Fixes 75674
726 2005-07-31 Raja R Harinath <harinath@gmail.com>
729 * expression.cs (Invocation.OverloadResolve): Don't report error
730 CS1501 if error CS1502 has been reported.
731 (New.DoResolve): Delegate CS1501 reporting to
732 Invocation.OverloadResolve.
735 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
736 invariant-meaning-in-block property in an enclosing block if
739 2005-07-29 Marek Safar <marek.safar@seznam.cz>
741 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
742 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
743 (Switch.CheckSwitch): Just save 50kb for SWF.
745 2005-07-27 Martin Baulig <martin@ximian.com>
747 * anonymous.cs (CaptureContext.AddField): Added
748 `AnonymousContainer am' argument; compute its toplevel scope if
749 it's not already computed. Fixes #75649.
751 2005-07-26 Raja R Harinath <rharinath@novell.com>
754 * class.cs (Constructor.Emit): Reset block to null if the block
757 2005-07-25 Marek Safar <marek.safar@seznam.cz>
759 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
761 2005-07-25 Marek Safar <marek.safar@seznam.cz>
763 * class.cs (MethodData.Define): Check whether accessor implementing
766 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
768 2005-07-22 Marek Safar <marek.safar@seznam.cz>
771 * namespace.cs (LookupType): Moved same type check to...
773 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
776 2005-07-21 Raja R Harinath <rharinath@novell.com>
778 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
779 already found a typebuilder.
780 * class.cs (MethodCore.IsDuplicateImplementation): Compare
781 MemberNames, not strings.
783 * const.cs (Error_ExpressionMustBeConst):
784 Rename from Error_EpressionMustBeConst.
785 * const.cs, class.cs, statement.cd: Update.
787 2005-07-21 Marek Safar <marek.safar@seznam.cz>
791 * const.cs (Const.LookupConstantValue): Report missing contant expression
793 (Error_EpressionMustBeConstant): Only one error method.
795 * class.cs, statement.c: Updated.
797 2005-07-20 Raja R Harinath <rharinath@novell.com>
799 * statement.cs (Block.Flags): Add back HasVarargs.
800 (Block.flags): Make protected.
801 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
803 * typemanager.cs (types, typecontainers, user_types): Remove.
804 (UserTypes, TypeContainers): Likewise.
805 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
806 (CleanUp, Reset): Update.
807 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
808 (GetNestedType): Use Type.GetNestedType.
809 (CoreLookupType): Take two arguments, the namespace and the
810 basename of the type. Update to use the Namespace.Lookup
812 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
813 (RealMemberLookup): Use IsNestedChildOf instead of playing with
814 string concatenation and substring matches.
815 * class.cs, enum.cs, delegate.cs: Update to changes.
817 2005-07-20 Marek Safar <marek.safar@seznam.cz>
819 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
820 Expression and made virtual.
822 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
823 (ImplicitStandardConversionExists): Fixed `byte' typo ?
825 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
827 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
830 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
833 2005-07-18 Marek Safar <marek.safar@seznam.cz>
836 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
837 AssemblyCultureAttribute is not used on executable.
840 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
842 2005-07-16 Raja R Harinath <rharinath@novell.com>
845 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
846 New. Reports CS0252/CS0253.
847 Mostly taken from preliminary patch by Duncak Mak.
848 (Binary.DoResolveOperator): Store results of operator lookup.
849 Use them to detect if we need to warn about unintended reference
852 2005-07-15 Raja R Harinath <rharinath@novell.com>
855 * namespace.cs (Namespace.Lookup): Add back location parameter.
856 (Namespace.LookupType): Add CS0436 report. Add location parameter.
857 * delegate.cs, ecore.cs, expression.cs: Update to changes.
859 * codegen.cs (EmitContext.DeclSpace): Make readonly.
860 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
861 (Namespace.LookupType): ... this.
862 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
864 * typemanager.cs (LookupTypeReflection): Remove buggy code that
865 purported to handle pointers.
866 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
869 2005-07-15 Marek Safar <marek.safar@seznam.cz>
871 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
874 2005-07-15 Raja R Harinath <rharinath@novell.com>
876 * namespace.cs (Namespace.Lookup): Drop location parameter.
877 (NamespaceEntry.LookupAlias): Remove. Merge into ...
878 (NamespaceEntry.Lookup): ... this.
879 (NamespaceEntry.Error_AmbiguousTypeReference):
880 Move here from DeclSpace.
881 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
883 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
884 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
885 Move to NamespaceEntry.
886 * delegate.cs, expression.cs: Update to changes.
888 2005-08-31 Martin Baulig <martin@ximian.com>
890 Committing a patch from Atsushi Enomoto for #75850.
892 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
893 Prefer a generic enumerator over a non-generic one.
895 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
897 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
898 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
900 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
902 * driver.cs : reverting default encoding change as well as mcs.
904 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
906 * driver.cs, support.cs : merged r48826.
908 > could you integrate your mcs changes to gmcs otherwise
909 > gmcs cannot compile some files.
911 2005-08-20 Martin Baulig <martin@ximian.com>
913 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
914 scope if we don't already have it.
916 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
917 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
920 2005-07-31 Miguel de Icaza <miguel@novell.com>
922 * statement.cs: Copy the local exception into the exception
923 captured local. Fixes 75674
925 2005-07-15 Marek Safar <marek.safar@seznam.cz>
927 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
930 2005-08-12 Martin Baulig <martin@ximian.com>
932 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
933 for nested types here to avoid hitting the cache too early.
935 2005-08-09 Miguel de Icaza <miguel@novell.com>
937 * enum.cs: On the new compiler CLS error 3005 is now a warning not
940 2005-08-03 Martin Baulig <martin@ximian.com>
942 Make iterators in generic methods work; see gtest-191.cs.
945 (Constraints.Resolve): Protect against being called twice.
948 (TypeContainer.GetClassBases): Make this `protected virtual'.
950 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
951 (Iterator.GetClassBases): Override this and compute the base
953 (Iterator.DefineNestedTypes): If we're a generic method, all our
954 method type parameters become class type parameters on the proxy
958 (ToplevelBlock.Parameters): Make this a property, not a field.
959 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
961 2005-08-03 Martin Baulig <martin@ximian.com>
963 * typemanager.cs (TypeManager.IsSubclassOf): Use
964 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
965 (TypeManager.GetFullName_recursed): Improved.
967 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
970 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
971 Private accessor case, using TypeManager.IsPrivateAccessible instead of
972 invocation_type == mi.DeclaringType, since the first one also checks
973 other condition used by generic instances.
975 2005-07-27 Martin Baulig <martin@ximian.com>
977 * anonymous.cs (CaptureContext.AddField): Added
978 `AnonymousContainer am' argument; compute its toplevel scope if
979 it's not already computed. Fixes #75649.
981 2005-07-14 Marek Safar <marek.safar@seznam.cz>
983 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
984 CheckAttributeType and refactored.
985 (Attribute.ResolvePossibleAttributeType): Changed to reuse
986 ResolveAsTypeTerminal error handling.
987 (ResolveAsTypeTerminal): Introduced because of global attributes extra
989 (GetSignatureForError): Print errors in same way.
992 * codegen.cs: Reflect attribute GetSignatureForError change.
995 * expression.cs: Add silent parameter to ResolveAsTypeStep.
997 * namespace.cs (UsingEntry): Refactored to make fields private.
1000 statement.cs: Error_UnexpectedKind has extra parameter.
1002 2005-07-14 Raja R Harinath <rharinath@novell.com>
1004 * ecore.cs (IAlias): Remove.
1005 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
1006 that implement the interface.
1007 * namespace.cs (Namespace): Likewise.
1008 (Namespace.declspaces): Renamed from 'defined_names'.
1009 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
1010 DeclSpace instead of an IAlias.
1011 * tree.cs (Tree.AddDecl): Update.
1013 2005-07-12 Raja R Harinath <rharinath@novell.com>
1015 * statement.cs (Block.Flags); Remove HasVarargs.
1016 (Block.HasVarargs): Move to ToplevelBlock.
1017 (Block.ThisVariable, Block.AddThisVariable): Likewise.
1018 (Block.Variables): Make protected. Initialize variable hashtable
1020 (Block.AddVariable): Update.
1021 (Block.Resolve): Update to changes.
1022 (ToplevelBlock.HasVarargs): New boolean.
1023 (ToplevelBlock.ThisVariable): Move here from Block.
1024 (ToplevelBlock.AddThisVariable): Likewise.
1025 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
1026 * expression.cs (This.ResolveBase): Update to changes.
1027 (ArglistAccess.DoResolve): Likewise.
1029 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1032 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1034 * class.cs (TypeContainer.VerifyMembers): Distinguish between
1035 not used and not used & assigned.
1036 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1038 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1041 * expression.cs (Is.DoResolve): null is never provided type.
1043 2005-07-08 Marek Safar <marek.safar@seznam.cz>
1046 * cs-parser.jay: Less strict event error rule to catch more errors.
1048 2005-07-11 Martin Baulig <martin@ximian.com>
1050 * generic.cs (ConstructedType.CheckConstraints): Improve the check
1051 for the constructor constraint: we do not only have to check
1052 whether the class has a public constructor, but also ensure that
1053 it's parameterless. Fixes #75492.
1055 2005-07-11 Martin Baulig <martin@ximian.com>
1057 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
1058 between type parameters if they either have the reference type
1059 constraint or the class constraint.
1061 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
1063 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
1065 2005-07-07 Marek Safar <marek.safar@seznam.cz>
1068 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1069 (ExtractSecurityPermissionSet): Cope with self referencing security
1070 attributes properly.
1072 * driver.cs (SetOutputFile): Made public property OutputFile.
1074 2005-07-07 Raja R Harinath <rharinath@novell.com>
1077 * class.cs (TypeContainer.first_nonstatic_field): Rename from
1078 has_nonstatic_fields. Make into a FieldBase pointer.
1079 (TypeContainer.AddField): Add CS0282 check.
1080 (TypeContainer.EmitType): Update.
1082 2005-07-06 Miguel de Icaza <miguel@novell.com>
1084 * cs-tokenizer.cs (consume_identifier): Do not create strings to
1085 compare if they start with __.
1087 2005-07-06 Raja R Harinath <rharinath@novell.com>
1089 * statement.cs (Switch.SwitchGoverningType): Only look at
1090 UserCasts that don't need implicit standard conversions to one of
1091 the allowed switch types (Fixes test-322.cs).
1092 (LocalInfo.Resolve): Re-enable sanity-test.
1094 2005-07-06 Marek Safar <marek.safar@seznam.cz>
1096 * cs-tokenizer.cs (consume_identifier): Detect double undescores
1098 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1100 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1102 2005-07-06 Raja R Harinath <rharinath@novell.com>
1105 * ecore.cs (SimpleName.GetSignatureForError): Add.
1106 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1107 (MemberAccess.GetSignatureForError): Add.
1109 2005-07-05 Marek Safar <marek.safar@seznam.cz>
1111 The big error and warning messages review.
1141 * typemanager.cs: Updated.
1143 * class.cs: (MethodCore.SetYields): Moved here to share.
1144 (PropertyMethod.Define): Moved iterator setup here.
1146 * iterators.cs: Add orig_method to have full access to parent
1149 2005-07-05 Raja R Harinath <rharinath@novell.com>
1151 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1152 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1153 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1154 variable of struct type.
1155 * expression.cs (Unary.ResolveOperator): Update to change.
1156 (Indirection.VerifyFixed): Likewise.
1157 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1158 (ParameterReference.VerifyFixed): Value parameters are fixed.
1159 (This.VerifyFixed): Treat 'this' as a value parameter.
1160 * statement.cs (LocalInfo.IsFixed): Remove.
1162 2005-07-01 Martin Baulig <martin@ximian.com>
1164 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1165 `ec.EmitThis ()' to get the correct scope.
1167 2005-07-01 Martin Baulig <martin@ximian.com>
1169 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1170 instance is a ParameterReference; fixes #75299.
1172 2005-06-30 Raja R Harinath <rharinath@novell.com>
1175 * expression.cs (Indexers.map): Remove.
1176 (Indexers.Append): Filter out inaccessible setters and getters.
1177 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1180 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
1182 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1183 (FieldExpr.Emit, PropertyExpr.Emit): Update.
1184 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1185 * expression.cs (Invocation.EmitCall): Add CS0120 check.
1187 2005-06-30 Marek Safar <marek.safar@seznam.cz>
1190 * class.cs (FieldBase.GetInitializerExpression): One more field
1193 2005-06-28 Miguel de Icaza <miguel@novell.com>
1195 * pending.cs: Do not define a proxy if the base method is virtual,
1196 it will be picked up by the runtime (bug 75270).
1198 2005-07-08 Martin Baulig <martin@ximian.com>
1200 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1201 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1203 2005-07-07 Martin Baulig <martin@ximian.com>
1205 * generic.cs (ConstructedType.CheckConstraint): Use
1206 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
1207 called recursively; fixes #75329.
1209 2005-07-06 Martin Baulig <martin@ximian.com>
1211 * generic.cs (TypeManager.InferTypeArguments): Added support for
1212 anonymous methods; fixes #75461.
1214 2005-07-01 Martin Baulig <martin@ximian.com>
1216 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1217 `ec.EmitThis ()' to get the correct scope.
1219 2005-07-01 Martin Baulig <martin@ximian.com>
1221 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
1222 instance is `This'; fixes #75299.
1224 2005-06-30 Martin Baulig <martin@ximian.com>
1226 * class.cs (Indexer): Implement IIteratorContainer; added support
1227 for iterators in indexers.
1230 (EmitContext.CurrentIterator): Make this a property, not a field.
1232 * anonymous.cs (AnonymousContainer.Iterator): New public property.
1234 2005-06-28 Miguel de Icaza <miguel@novell.com>
1236 * pending.cs: Do not define a proxy if the base method is virtual,
1237 it will be picked up by the runtime (bug 75270).
1239 2005-06-28 Martin Baulig <martin@ximian.com>
1241 * cs-parser.jay (interface_method_declaration): Avoid a
1242 reduce/reduce conflict by moving some of the code into a separate
1243 `interface_method_declaration_body' rule; fixes #75368.
1245 2005-06-28 Martin Baulig <martin@ximian.com>
1247 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
1248 array check after the check for TypeBuilder's.
1250 2005-06-21 Raja R Harinath <rharinath@novell.com>
1252 * convert.cs (FindMostEncompassedType): Add two trivial special
1253 cases (number_of_types == 0 || number_of_types == 1).
1254 (FindMostEncompasingType): Likewise.
1256 2005-06-17 Raja R Harinath <rharinath@novell.com>
1258 Some cleanups preparing for the fix of #75283.
1259 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1261 (EventExpr.InstanceResolve): Likewise.
1262 (EventExpr.DoResolve): Remove redundant checks.
1264 2005-06-08 Miguel de Icaza <miguel@novell.com>
1266 * class.cs: Small fix.
1268 2005-06-08 Raja R Harinath <rharinath@novell.com>
1271 * class.cs (GetPartialBases): Fix return value check of
1274 2005-06-07 Raja R Harinath <rharinath@novell.com>
1276 Ensure that partial classes are registered in their enclosing
1277 namespace. Initial part of fix of #75160.
1278 * tree.cs (Tree.RecordDecl): Add new namespace argument.
1279 Register declspace with namespace here, not in
1280 DeclSpace.RecordDecl.
1281 * cs-parser.jay: Pass namespace to RecordDecl.
1282 * class.cs (PartialContainer.Create): Likewise.
1283 (ClassPart.DefineType): New sanity-check. Throws an exception if
1285 * decl.cs (Declspace.RecordDecl): Remove.
1286 * namespace.cs (NamespaceEntry.DefineName): Remove.
1288 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1290 * rootcontext.cs: Reset TargetExt as well.
1292 2005-06-03 Raja R Harinath <rharinath@novell.com>
1294 * ecore.cs (Expression.Resolve): Emit CS0654 error when
1297 2005-06-02 Raja R Harinath <rharinath@novell.com>
1299 Fix #75080, cs0119.cs.
1300 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
1302 (Expression.Resolve): ... this. Use it. Remove bogus code
1303 allowing ExprClass.Type and ExprClass.Namespace for
1304 ResolveFlags.VariableOrValue.
1305 (Expression.Resolve) [1-argument variant]: Change default resolve
1306 flags based on language version.
1307 (Expression.Error_UnexpectedKind): Use a simple string array
1308 rather than an ArrayList.
1309 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1311 (TypeOfVoid.DoResolve): Likewise.
1312 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
1313 flags argument -- it always has the same value.
1315 2005-05-31 Raja R Harinath <rharinath@novell.com>
1318 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1319 Use it in the error message.
1320 * assign.cs, expression.cs, statement.cs: Update.
1322 2005-05-30 Raja R Harinath <rharinath@novell.com>
1325 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1326 the "almostMatchedMember" case too.
1327 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1328 that failed the accessibility checks to 'almost_match'.
1330 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
1332 * attribute.cs: Use internal MethodBuilder methods to set
1333 ExactSpelling and SetLastError on PInvoke methods, instead
1334 of passing them via charset. Fixes #75060.
1336 2005-05-27 Raja R Harinath <rharinath@novell.com>
1338 * parameter.cs (Parameter): Remove TODO comment.
1339 (Parameter.DefineParameter): Remove Location parameter.
1340 (Parameters.LabelParameters): Likewise.
1341 * class.cs (Constructor.Emit): Update to change.
1342 (MethodData.Emit): Likewise.
1343 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
1344 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1346 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
1349 Removed Parameters.Location and added Parameter.Location instead.
1350 Removed Location parameter from Emit() and GetSignature().
1357 Modified all related calls.
1359 2005-06-21 Martin Baulig <martin@ximian.com>
1361 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
1362 left-hand side is not a nullable type; fixes #75328.
1364 2005-06-21 Martin Baulig <martin@ximian.com>
1367 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
1368 (TypeManager.GetFullNameSignature): Likewise.
1370 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
1371 `source.FullName' and `target.FullName' to check whether there are
1372 two conflicting definitions.
1374 2005-06-21 Martin Baulig <martin@ximian.com>
1376 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
1377 a BoxedCast - also for reference types - to be compatible with csc.
1379 2005-06-21 Martin Baulig <martin@ximian.com>
1381 * expression.cs (MemberAccess.DoResolve): Add support for nested
1382 types in a generic instance; fixes #75320.
1384 2005-06-20 Martin Baulig <martin@ximian.com>
1386 * generic.cs (TypeManager.InferType): Also walk the class
1387 hierarchy for generic instances; fixes #75261.
1389 2005-06-17 Martin Baulig <martin@ximian.com>
1391 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
1392 to make things work for corlib.
1394 2005-06-15 Martin Baulig <martin@ximian.com>
1396 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
1397 obsolete `SecurityAction' values.
1399 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1401 * rootcontext.cs: Reset TargetExt as well.
1403 2005-06-09 Martin Baulig <martin@ximian.com>
1405 * delegate.cs (Delegate.VerifyMethod): Added
1406 `MethodGroupExpr old_mg' argument; inherit its
1407 `HasTypeParameters'; fix #75085.
1409 2005-06-09 Martin Baulig <martin@ximian.com>
1411 * expression.cs (Invocation.OverloadResolve): Correctly handle
1412 generic methods for the SetMemberIsUsed(); fix #75064.
1414 2005-06-09 Martin Baulig <martin@ximian.com>
1416 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
1419 2005-06-08 Martin Baulig <martin@ximian.com>
1421 * cs-parser.jay (nullable_type_or_conditional): If we put the
1422 nullable back and our `type' is a `ComposedCast', remove the
1423 nullable from it. Fixes #75156.
1425 * expression.cs (ComposedCast.RemoveNullable): New public method.
1427 2005-06-08 Martin Baulig <martin@ximian.com>
1429 The big Iterators rewrite :-)
1431 * iterators.cs: Rewrite this to use the anonymous methods framework.
1433 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1434 before the TypeContainers; see 2test-21.cs.
1437 (TypeContainer.DefineType): Don't create a new EmitContext if we
1438 already have one (this only happens if we're an Iterator).
1439 (TypeContainer.Define): Also call Define() on all our iterators.
1440 (Method.CreateEmitContext): Added support for iterators.
1443 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1444 (AnonymousContainer.CreateMethodHost): Moved here from
1445 AnonymousMethod and made abstract.
1446 (AnonymousContainer.CreateScopeType): New abstract method.
1447 (AnonymousContainer.IsIterator): New public property.
1448 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1449 get the ScopeTypeBuilder rather than manually defining it here.
1450 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1453 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1454 before RootContext.DefineTypes().
1456 * codegen.cs (EmitContext.RemapToProxy): Removed.
1457 (EmitContext.CurrentAnonymousMethod): Changed type from
1458 AnonymousMethod -> AnonymousContainer.
1459 (EmitContext.ResolveTopBlock): Protect from being called twice.
1460 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1461 (EmitContext.EmitThis): Removed the iterators hacks; use the
1462 anonymous methods framework for that.
1465 (ToplevelBlock.Container): Make this a property, not a field.
1466 (ToplevelBlock.ReParent): New public method; move the
1467 ToplevelBlock into a new container.
1468 (Foreach.TemporaryVariable): Simplify.
1470 2005-06-05 Martin Baulig <martin@ximian.com>
1472 * statement.cs (LocalInfo.CompilerGenerated): New flag.
1473 (Block.AddTemporaryVariable): New public method; creates a new
1474 `LocalInfo' for a temporary variable.
1475 (Block.EmitMeta): Create the LocalBuilders for all the temporary
1477 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1478 non-iterator variables.
1480 2005-06-05 Martin Baulig <martin@ximian.com>
1482 * statement.cs (Foreach.TemporaryVariable): Create the
1483 LocalBuilder in the Emit phase and not in Resolve since in some
1484 situations, we don't have an ILGenerator during Resolve; see
1485 2test-19.cs for an example.
1487 2005-06-04 Martin Baulig <martin@ximian.com>
1489 The big Foreach rewrite - Part II.
1491 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1492 with `PropertyInfo ienumerator_getcurrent'.
1494 * codegen.cs (VariableStorage): Removed.
1497 (Foreach): Derive from Statement, not ExceptionStatement.
1498 (Foreach.CollectionForeach): New nested class. Moved all the code
1499 dealing with collection foreach here.
1500 (Foreach.ForeachHelperMethods): Removed.
1501 (Foreach.TemporaryVariable): Implement IMemoryLocation.
1503 2005-05-23 Martin Baulig <martin@ximian.com>
1505 * statement.cs (Try.DoResolve): Don't create a `finally' if we
1506 don't need to. Fix #75014.
1508 2005-05-26 Raja R Harinath <rharinath@novell.com>
1510 Improve user-defined conversion handling.
1511 * convert.cs (GetConversionOperators): Rewrite. Return only the
1512 applicable operators.
1513 (AddConversionOperators): New. Helper for GetConversionOperators.
1514 (FindMostEncompassedType, FindMostEncompassingType): Verify that
1515 there is only one most encompassed/encompassing type.
1516 (FindMostSpecificSource, FindMostSpecificTarget): Remove
1517 "applicable operator" handling.
1518 (UserConversion): Move cache here from GetConversionOperators.
1519 Directly cache the chosen operator, rather than the whole
1521 (ExplicitNumericConversion): Fix buggy implementation of Decimal
1522 case. Allow conversion of decimal to sbyte and byte too.
1523 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1524 New static methods. Used to avoid allocating EmptyExpressions in
1527 2005-05-24 Duncan Mak <duncan@novell.com>
1529 * ecore.cs (CastFromDecimal): New class for casting a decimal to
1530 another class, used in Convert.ExplicitNumericConversion.
1531 (CastToDecimal): New class, similar to above, but casts to
1532 System.Decimal, used in Convert.ImplicitNumericConversion and also
1533 in explicit convesion from double/float to decimal.
1535 * convert.cs (ImplicitNumericConversion): Handle implicit
1536 conversions to System.Decimal.
1537 (ExplicitNumericConversion): handle explicit conversions to
1542 2005-05-20 Miguel de Icaza <miguel@novell.com>
1544 * typemanager.cs: Do not throw an exception in the TypeBuilder
1545 case, we take care of it on the TypeCode.
1547 2005-05-17 Marek Safar <marek.safar@seznam.cz>
1549 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1552 * cs-parser.jay: Catch more lexical errors.
1554 * report.cs: Add one more Error method.
1557 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1559 2005-05-20 Martin Baulig <martin@ximian.com>
1561 * class.cs (TypeContainer.CircularDepException): Removed.
1562 (TypeContainer.DefineType): Removed the `InTransit' stuff.
1563 (TypeContainer.CheckRecursiveDefinition): Check for circular class
1564 (CS0146) and interface (CS0529) dependencies here.
1566 2005-05-20 Martin Baulig <martin@ximian.com>
1568 * expression.cs (New.DoResolve): Move the CS0712 check above the
1569 CS0144 check; otherwise it can never be reached.
1571 2005-05-20 Martin Baulig <martin@ximian.com>
1573 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
1575 2005-05-20 Martin Baulig <martin@ximian.com>
1577 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
1579 * typemanager.cs (TypeManager.IsAttributeType): New public method.
1581 2005-05-19 Martin Baulig <martin@ximian.com>
1584 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1585 to disable error reporting.
1587 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1588 here since we don't want to report an error; see the new test-336.cs.
1590 2005-05-19 Raja R Harinath <rharinath@novell.com>
1592 * statement.cs (ToplevelBlock.GetParameterReference)
1593 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1594 Move here from class Block.
1595 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1596 * expression.cs (ParameterReference.DoResolveBase): Likewise.
1598 2005-05-18 Martin Baulig <martin@ximian.com>
1603 (FlowBranching.Reachability): Add non-static public And() and Or()
1605 (FlowBranchingSwitch): New class; do the `break_origins' thing
1606 like in FlowBranchingLoop.
1607 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1608 reachability, not just locals and parameters.
1609 (FlowBranching.MergeChild): Remove some of the hacks for loop and
1610 switch; MergeBreakOrigins() now takes care of that.
1612 2005-05-18 Martin Baulig <martin@ximian.com>
1614 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1615 a loop and may leave it, reset the barrier; fixes #74974.
1617 2005-05-16 Raja R Harinath <rharinath@novell.com>
1619 Fix test-382.cs. Emit values of decimal constants.
1620 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1622 (TypeContainer.AddField): ... this.
1623 (TypeContainer.EmitFieldInitializers): Allow the list of fields
1624 with initializers to include 'Const's.
1625 (ClassPart.RegisterFieldForInitialization): Forward to
1627 * const.cs (Const.Const): Pass initializer to base class.
1628 (Const.Define): In case of decimal constants, register them for
1629 initialization in a static constructor.
1631 2005-05-14 Martin Baulig <martin@ximian.com>
1633 * statement.cs (Block.Resolve): Correctly handle unreachable code;
1634 do not call ResolveUnreachable() on unreachable statements in
1635 here, see the comment in the source code.
1637 2005-05-13 Raja R Harinath <rharinath@novell.com>
1640 * expression.cs (BinaryResolveOperator): If one of the operands of
1641 an equality comparison is 'null' and the other is a pointer type,
1642 convert the null to a NullPointer.
1643 * convert.cs (ImplicitReferenceConversion): If the expression is a
1644 NullLiteral and the target type is a pointer type, return a
1645 NullPointer instead.
1646 (ImplicitConversionStandard): Likewise.
1648 2005-05-13 Marek Safar <marek.safar@seznam.cz>
1650 * cs-parser.jay: Set readonly context based on special constructs.
1652 * expression.cs (LocalVariableReference.DoResolveBase): Improved
1653 readonly variable error handling.
1655 * rootcontext.cs (EmitCode): Don't verify members when error
1658 * statement.cs (LocalInfo): Add reaodnly context information.
1659 (SetReadOnlyContext, GetReadOnlyContext): New methods.
1661 2005-05-17 Martin Baulig <martin@ximian.com>
1663 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1666 2005-05-13 Martin Baulig <martin@ximian.com>
1668 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
1669 handle unreachable blocks.
1671 2005-05-13 Martin Baulig <martin@ximian.com>
1674 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1675 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1678 2005-05-13 Martin Baulig <martin@ximian.com>
1680 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1681 instance variable, not a local. Fix #74873.
1682 (Block.ResolveUnreachable): Set it to true here.
1684 2005-05-12 Martin Baulig <martin@ximian.com>
1686 * cs-parser.jay (property_declaration): Pass the `current_class',
1687 not the `current_container' to Property's .ctor. Fixes #74912.
1689 2005-05-11 Martin Baulig <martin@ximian.com>
1691 * typemanager.cs (Closure): Copy this from MCS and merge all the
1692 GMCS-specific changes into it.
1694 2005-05-12 Raja R Harinath <harinath@gmail.com>
1697 * typemanager.cs (unmanaged_enclosing_types): New.
1698 (IsUnmanagedType): Avoid infloops by using
1699 'unmanaged_enclosing_types' to talk with recursive invocations.
1701 2005-05-11 Duncan Mak <duncan@novell.com>
1703 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1704 continuing to process for 'arg'.
1705 (handle_preprocessing_directive): Check the argument of the #endif
1706 directive and report error CS1025 if there are any trailing
1709 According to the C# spec, having even whitespace after the #endif
1710 directive is illegal; however, because we call arg.TrimEnd ()
1711 beforehand, we have the same behavior as csc, allowing whitespace
1712 after the directive.
1716 2005-05-11 Marek Safar <marek.safar@seznam.cz>
1720 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1721 (Constructor.GetObsoleteAttribute): Implemented correctly.
1723 2005-05-10 Martin Baulig <martin@ximian.com>
1725 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1726 resolve the type; fixes #74864.
1727 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1728 in DoResolve(); fixes #74862.
1730 2005-05-10 Martin Baulig <martin@ximian.com>
1732 * support.cs (ReflectionParameters.ParameterModifier): Use
1733 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1734 and `ParameterAttributes.In'. Fixes #74884.
1736 2005-05-10 Martin Baulig <martin@ximian.com>
1738 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1739 the cache if we're just looking for `MemberTypes.NestedType' in a
1742 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1743 constraints if we're still resolving the type tree.
1744 (Expression.MemberLookup): If we're resolving the type tree, only
1745 look for `MemberTypes.NestedType' since we're only interested in
1748 * class.cs (TypeContainer.DefineType): Don't resolve the type
1749 parameters here; do this later in ResolveType() after the type
1750 tree has been resolved.
1751 (TypeContainer.ResolveType): New public method; this is called
1752 after the type tree is resolved and before the types are being
1753 populated. We resolve the generic constraints here.
1754 (TypeContainer.DoDefineMember): Check the constraints on our base
1755 class and interfaces.
1757 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1758 set the `ResolvingTypeTree' flag on the EmitContext.
1760 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1762 2005-05-10 Marek Safar <marek.safar@seznam.cz>
1764 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1766 * expression.cs (Argument.GetParameterModifier): Turned to property.
1767 (Invocation.Error_InvalidArguments): Add more descriptive errors.
1769 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1772 2005-05-09 Raja R Harinath <rharinath@novell.com>
1775 * decl.cs (MemberCache.AddMethods): Register override methods,
1776 rather than non-override methods.
1777 * typemanager.cs (RegisterOverride): New.
1778 (IsOverride): Update.
1780 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1782 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1784 2005-05-06 Martin Baulig <martin@ximian.com>
1787 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1788 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1790 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1794 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1795 recursive declaration.
1797 * statement.cs (Block.ResolveMeta): Report any error in resolving.
1799 2005-05-06 Marek Safar <marek.safar@seznam.cz>
1801 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1803 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1805 2005-05-05 Raja R Harinath <rharinath@novell.com>
1808 * decl.cs (DeclSpace.FamilyAccessible):
1809 Use TypeManager.IsNestedFamilyAccessible.
1811 Fix reopened #64812.
1812 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1815 2005-05-04 Raja R Harinath <rharinath@novell.com>
1816 Abin Thomas <projectmonokochi@rediffmail.com>
1817 Anoob V E <projectmonokochi@rediffmail.com>
1818 Harilal P R <projectmonokochi@rediffmail.com>
1821 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1822 allow access to all static members.
1824 2005-05-04 Martin Baulig <martin@ximian.com>
1826 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1828 2005-05-04 Martin Baulig <martin@ximian.com>
1832 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1833 section at the end; make things work if `default' is not the last
1836 2005-05-04 Martin Baulig <martin@ximian.com>
1840 * statement.cs (Switch): Replaced the `got_default' field with a
1841 `default_section' one.
1842 (Switch.CheckSwitch): Set `default_section' here.
1843 (Switch.Resolve): If we're a constant switch and the constant is
1844 not found, use the default section.
1846 2005-05-03 Martin Baulig <martin@ximian.com>
1848 * expression.cs (ArrayAccess.EmitGetLength): New public method.
1850 * statement.cs (Foreach.ArrayForeach): New nested class.
1851 (Foreach.TemporaryVariable): New nested class.
1852 (Foreach.EmitArrayForeach): Removed; this is now in the new
1855 2005-05-03 Raja R Harinath <rharinath@novell.com>
1857 * pending.cs (BaseImplements): Move the #74773 fix here. This is
1859 (VerifyPendingMethods): Revert change below.
1861 * typemanager.cs (IsOverride, RegisterNonOverride): New.
1862 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1863 that used to trigger warning -28. Remove warning -28.
1864 * expression.cs (Invocation.OverloadResolve): Use
1865 TypeManager.IsOverride to distinguish override methods.
1868 * pending.cs (VerifyPendingMethods): If a base type implements the
1869 requested interface, don't bother checking individual methods of
1870 the base type. As a side-effect, this prevents the creation of
1871 unnecessary proxies.
1873 2005-05-02 Martin Baulig <martin@ximian.com>
1877 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1878 Also `And' the locals if the old vector is null.
1879 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1880 null; in this case we basically reset all the variables.
1882 2005-05-02 Martin Baulig <martin@ximian.com>
1886 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1887 Added `FlowBranching branching' argument; always `and' the
1888 variables instead of `or'ing them unless we're an infinite loop.
1890 * statement.cs (While.Resolve): Create a new sibling unless we're
1893 2005-05-02 Martin Baulig <martin@ximian.com>
1897 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1898 arguments; use it instead of creating a new TopLevelBlock.
1899 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1900 our ConstructorInitializer.
1903 (TopLevelBlock.TopLevelBranching): New public property.
1904 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1905 and create our `TopLevelBranching'.
1907 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1908 anonymous method host, use `block.TopLevelBranching' rather than
1909 creating a new branching.
1911 2005-04-20 Miguel de Icaza <miguel@novell.com>
1913 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1914 a ScopeInfo, if any of the current children is a child of the new
1915 entry, move those children there.
1917 2005-04-30 Martin Baulig <martin@ximian.com>
1919 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1920 at the beginning of a SwitchSection. Fix #73335.
1922 2005-04-27 Marek Safar <marek.safar@seznam.cz>
1925 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1927 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1928 (FieldExpr.DoResolve): Obsolete members are ignored for field
1931 2005-04-26 Marek Safar <marek.safar@seznam.cz>
1933 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1934 of arrays detection.
1936 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1938 (Field.VerifyClsCompliance): Volatile fields are not compliant.
1940 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1943 2005-04-25 Ben Maurer <bmaurer@ximian.com>
1945 * cs-parser.jay: Use the prefered version of -unsafe in error
1948 2005-04-22 Marek Safar <marek.safar@seznam.cz>
1950 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1953 2005-04-20 John Luke <john.luke@gmail.com>
1955 * driver.cs: fix typo in error message, --outout to --output
1957 2005-04-30 Martin Baulig <martin@ximian.com>
1959 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1960 handle the .NET 2.x security attributes.
1962 2005-04-30 Martin Baulig <martin@ximian.com>
1965 (TypeManager.ExpandInterfaces): Don't add things twice.
1968 (TypeContainer.VerifyClsCompliance): Allow generic instances.
1970 2005-04-29 Martin Baulig <martin@ximian.com>
1972 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1974 * anonymous.cs: Added support for anonymous generic methods.
1976 2005-04-29 Martin Baulig <martin@ximian.com>
1978 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1981 2005-04-29 Martin Baulig <martin@ximian.com>
1983 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1985 * expression.cs (New.DoResolve): Fix the CS0304 check.
1987 2005-04-29 Martin Baulig <martin@ximian.com>
1989 * typemanager.cs (TypeManager.GetFullName): Updated to the new
1992 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1993 explicit interface implementation, compare the interface types.
1994 (MethodData.Define): Use the new naming scheme from the latest
1996 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1998 * decl.cs (MemberName.GetMemberName): Removed.
1999 (MemberName.MethodName, FullName): New properties.
2001 2005-04-25 Raja R Harinath <rharinath@novell.com>
2003 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
2005 2005-04-22 Martin Baulig <martin@ximian.com>
2007 * generic.cs (GenericMethod): Create the EmitContext in the
2008 `Define()'; in `Define(MethodBuilder)', create the type parameters
2009 before calling `Define()'. Fixes #73933.
2011 2005-04-22 Martin Baulig <martin@ximian.com>
2014 (Constraints.Resolve): Make things work wrt. the new type lookup system.
2015 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
2017 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
2018 ConstructedType, check its constraints.
2020 2005-04-20 Marek Safar <marek.safar@seznam.cz>
2022 * codegen.cs (InRefOutArgumentResolving): New field.
2024 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2025 fields outside contructor.
2027 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2029 2005-04-19 Miguel de Icaza <miguel@novell.com>
2031 * anonymous.cs (CaptureContext.EmitParameterInstance): The
2032 parameter code was not completed ever, so it was not as up-to-date
2033 as local variables. Must finish it.
2035 The bug fix was to compare the Toplevel of the block, not the
2036 current block. Thanks for Ben for pointing this out.
2038 2005-04-19 Raja R Harinath <rharinath@novell.com>
2040 * decl.cs (AddMethods): Use the declaring type of the problem
2041 method to determine if we want to squash a warning.
2043 2005-04-19 Marek Safar <marek.safar@seznam.cz>
2045 * attribute.cs: Removed debug output.
2047 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2049 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2052 2005-04-18 Raja R Harinath <rharinath@novell.com>
2055 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2056 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2057 all null comparisons against reference types.
2059 2005-04-18 Marek Safar <marek.safar@seznam.cz>
2062 * class.cs (TypeContainer.CircularDepException) New nested
2064 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2065 (TypeContainer.DefineType): Removed error, reset InTransit before
2067 (Class.DefineType): Throw exception when is in Transit.
2068 Catch exception and report error.
2069 (Struct.DefineType): Throw exception when is in Transit.
2070 Catch exception and report error.
2071 (Interface.DefineType): Throw exception when is in Transit.
2072 Catch exception and report error.
2074 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2075 handle nested exception handlers.
2077 * flowanalysis.cs (InTryWithCatch): New method, search for try with
2080 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2081 InFinally and InCatch storage.
2083 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2084 (Catch.Resolve): Set and Restore ec.InCatch.
2085 (Try.Resolve): Set and Restore ec.InFinally.
2086 (Try.HasCatch): True when try has catch.
2088 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
2090 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2091 for the same event member, so exclude such cases from warning 419.
2094 2005-04-16 Miguel de Icaza <miguel@novell.com>
2096 * expression.cs (Binary.ResolveOperator): Apply patch from John
2097 Luke to fix bug 59864: operators &, | and ^ on enumerations
2098 require that the same enum type on both sides.
2100 * driver.cs: Add warnings to old flag usage, this is to assist
2101 people who produce Makefiles and hope that the Makefiles will be
2104 * class.cs (TypeContainer.EmitType): Moved the definition of the
2105 special $PRIVATE$ field from the resolve phase to the Emit phase.
2106 During resolve we do not know if we are a struct with
2107 HasExplicitLayout, we know this only after the attributes for the
2110 Set the FieldOffset to zero on the dummy field that we create for
2111 the class. Fixes 74590.
2113 2005-04-16 Raja R Harinath <rharinath@novell.com>
2116 * ecore.cs (PropertyExpr.resolved): New.
2117 (DoResolve): Use it to handle a case of double resolution here.
2118 Handle a case of identical-name-and-type-name.
2119 * expression.cs (ArrayCreation.CheckIndices): Avoid double
2120 resolution by storing the results of expression resolution back
2121 into the "probes" array.
2123 2005-04-15 Raja R Harinath <rharinath@novell.com>
2125 Fix cs0208-7.cs and cs0208-8.cs.
2126 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2127 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
2128 error reporting to point out the reason a struct is not unmanaged.
2130 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2132 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
2133 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2135 2005-04-13 Raja R Harinath <rharinath@novell.com>
2138 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2139 IdenticalNameAndTypeName here.
2140 (EventExpr.InstanceResolve): Likewise.
2142 2005-04-13 Marek Safar <marek.safar@seznam.cz>
2144 C# 2.0 DefaultCharSetAttribute implementation
2146 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2147 which allows us to set GlobalNamespace for every resolve.
2148 (Attribute.ResolveArguments): Cut from Resolve.
2149 (Attribute.GetCharSetValue): Returns CharSet named argument.
2150 (Attribute.DefinePInvokeMethod): Gets default charset from
2152 (GlobalAttribute.ResolveAsTypeStep): Override.
2153 (GlobalAttribute.ResolveArguments): Override.
2155 * class.cs (TypeAttr): Is protected.
2157 * codegen.cs (ModuleClass.DefaultCharSet): New member.
2158 (ModuleClass.DefaultCharSetType): New memeber.
2159 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2161 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2162 charset from module.
2164 * delegate.cs (TypeAttr): Override.
2165 (Delegate.DefineType): Use this TypeAttr.
2167 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2168 at very early stage (before types are defined) to resolve model
2169 module attributes. It will probably not work with corlib but it
2172 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2173 charset from module.
2175 * typemanager.cs (default_charset_type): New type.
2177 2005-04-13 Raja R Harinath <rharinath@novell.com>
2179 * decl.cs (MemberCache.AddMethods): Don't warn if
2180 System.Object.Finalize has buggy MethodAttributes.
2182 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2185 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2187 * doc.cs : detect ambiguous reference to overloaded members.
2188 Fixed bug #71603. MS 1.1 csc does not detect it.
2190 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2192 * doc.cs : delegates must not be referenced with parameters.
2195 2005-04-12 Miguel de Icaza <miguel@novell.com>
2197 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2199 2005-04-10 Miguel de Icaza <miguel@novell.com>
2201 * driver.cs (MainDriver): Stop processing if the CLS stage found
2204 (CompilerCallableEntryPoint.InvokeCompiler): Always
2205 reset after execution; Take a TextWriter argument for the
2208 * report.cs: Use the error stream instead of hardcoding stderr.
2210 2005-04-09 Miguel de Icaza <miguel@novell.com>
2212 * class.cs: Reduce code paths to test, too small of an
2213 optimization to make it worth the extra testing. Always perform
2216 2005-04-08 Raja R Harinath <rharinath@novell.com>
2219 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2220 operators that had errors reported on them.
2222 2005-04-08 Marek Safar <marek.safar@seznam.cz>
2224 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2226 (Attribute.Resolve): Add named argument type checking.
2228 * class.cs (FixedField.Define): Use IsPrimitiveType
2230 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2232 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2233 unsafe parameter types.
2235 * statement.cs (Using.ResolveExpression): Add better error description.
2237 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2239 2005-04-08 Raja R Harinath <rharinath@novell.com>
2242 * attribute.cs (Attribute.GetAttributeUsage): Resolve
2243 AttributeUsageAttribute in the emitcontext of the attribute class,
2244 not in the emitcontext of the attributable entity it was attached to.
2245 * cs-parser.jay: Use 'current_class', not 'current_container',
2246 when creating a GlobalAttribute.
2248 2005-04-08 Alp Toker <alp@atoker.com>
2250 * pending.cs: The fix to #58413 failed to compile methods implementing
2251 interfaces with/without params modifiers and vice versa, even though
2252 params modifiers aren't part of the signature. Make the modifier check
2253 less strict as in csc.
2255 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
2256 Anoob V E <projectmonokochi@rediffmail.com>
2257 Harilal P R <projectmonokochi@rediffmail.com>
2260 * pending.cs (TypeAndMethods.mods): New. Store the parameter
2261 modifiers of pending methods.
2262 (PendingImplementation.PendingImplementation): Initialize it.
2263 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2264 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2265 with ParameterData. Add check for modifiers.
2266 * class.cs (MethodData.Define): Update to changes.
2268 2005-04-07 Raja R Harinath <rharinath@novell.com>
2270 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2272 2005-04-07 Marek Safar <marek.safar@seznam.cz>
2274 * class.cs (PropertyMethod.Define): Check private accessor in abstract
2277 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2280 * typemanager.cs: Registered RequiredAttributeAttribute.
2282 2005-04-06 Marek Safar <marek.safar@seznam.cz>
2284 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2285 Warning CS0169 is back at level 3.
2286 (IMethodData.SetMemberIsUsed): New method.
2288 * decl.cs (IsUsed): New value; moved from FieldBase.Status
2289 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2291 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2293 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2295 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2298 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2301 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2302 to avoid the problems with nested types.
2304 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
2305 Anoob V.E <projectmonokochi@rediffmail.com>
2306 Harilal P.R <projectmonokochi@rediffmail.com>
2307 Raja R Harinath <rharinath@novell.com>
2310 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2312 * typemanager (GetConstructor): Make public.
2314 2005-04-05 John Luke <john.luke@gmail.com>
2315 Raja R Harinath <rharinath@novell.com>
2318 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2319 struct too. Return false quicker in a few cases.
2320 (VerifyUnManaged): Use it.
2322 2005-04-05 Raja R Harinath <rharinath@novell.com>
2325 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2326 not 'unreachable_seen'.
2328 2005-04-04 Marek Safar <marek.safar@seznam.cz>
2330 * attribute.cs (Attribute.GetValue): Removed unused.
2332 * codegen.cs (CodeGen.TrimExt): Removed unused.
2334 * cs-parser.jay (output): Removed unused.
2336 * cs-tokenizer.cs (hex_digits): Removed unused.
2338 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2340 * expression.cs (Indirection.LoadExprValue): Removed unused.
2341 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2343 * iterators.cs (Iterator.param_types): Removed unused.
2345 * statement.cs (Goto.block): Removed unused.
2346 (ToplevelBlock.did): Removed unused.
2347 (Switch.ResolveConstantSwitch): Removed unused.
2349 2005-04-01 Ben Maurer <bmaurer@ximian.com>
2351 * rootcontext.cs: Allow mcs to bootstrap with the compilation
2354 2005-04-19 Martin Baulig <martin@ximian.com>
2356 Merged r42462 from MCS and made it work for GMCS.
2358 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
2360 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
2362 2005-04-01 Raja R Harinath <rharinath@novell.com>
2364 Fix #74232 and cs0208-3.cs.
2365 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2366 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2367 unmanaged type. Don't use FieldBuilders when 't' is a
2368 TypeBuilder. Use ModFlags and MemberType fields.
2369 * class.cs (MemberBase.member_type): Rename from MemberType.
2370 (MemberBase.MemberType): New property. Determines member_type on
2372 (MemberBase.DoDefine): Don't initialize MemberType here.
2373 (FieldMember.Define): Likewise.
2375 2005-04-01 Marek Safar <marek.safar@seznam.cz>
2378 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2379 Attributes are emitted there.
2381 2005-04-01 Raja R Harinath <rharinath@novell.com>
2383 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2384 keyword in 'partial enum' too.
2385 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2387 Report from Kamil Skalski <nazgul@omega.pl>.
2390 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2391 have partial containers too.
2393 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2394 in block' checks to Block.CheckInvariantMeaningInBlock.
2395 * statement.cs (Block.GetKnownVariableInfo): Make private.
2396 (Block.IsVariableUsedInChildBlock): Remove.
2397 (Block.IsVariableUsedInBlock): Likewise.
2398 (Block.CheckInvariantMeaningInBlock): New. Show location of
2399 conflicting declaration.
2400 (Block.AddVariable): Make error messages less long-winded and more
2401 specific. Show location of conflicting declaration.
2402 * parameter.cs (Parameters.Location): New readonly property.
2404 2005-03-31 Raja R Harinath <rharinath@novell.com>
2406 Clean up semantics of invoking ResolveMemberAccess.
2407 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2408 can have an instance, ensure that we pass in a non-TypeExpression
2409 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
2410 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2411 argument. Update to changes and simplify.
2412 (FieldExpr.Emitinstance): Remove CS0120 check.
2413 (PropertyExpr.EmitInstance): Likewise.
2414 * expression.cs (Argument.Resolve): Likewise.
2415 (Invocation.DoResolve): Update to changes in semantics of
2418 2005-03-31 Marek Safar <marek.safar@seznam.cz>
2421 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2424 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2426 2005-03-31 Raja R Harinath <rharinath@novell.com>
2428 Fix difference in behaviour with commandline invocation.
2429 * driver.cs (Driver.Reset): New.
2430 (CompilerCallableEntryPoint): Call it.
2432 * statement.cs (If.Resolve): Avoid spurious "uninitialized
2433 variable" warnings if the boolean expression failed to resolve.
2435 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
2437 * attribute.cs: Fix the union of several permissions when some of them
2438 are unrestricted (so the result isn't an unrestricted permission set).
2441 2005-03-30 Raja R Harinath <rharinath@novell.com>
2443 * ecore.cs (MemberExpr): New class. Convert from interface
2445 (MemberExpr.ResolveMemberAccess): Refactor and move here from
2446 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
2448 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2449 (MethodGroupExpr.IsExplicitImpl): Remove.
2450 (Expression.GetFieldFromEvent): Remove.
2451 (SimpleName.MemberStaticCheck): Remove.
2452 (SimpleName.DoSimpleNameResolve): Update to changes.
2453 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2454 (MemberAccess.IdenticalNameAndTypeName): Remove.
2455 (MemberAccess.error176): Move to MemberExpr.
2456 (MemberAccess.DoResolve): Update to changes.
2457 (BaseAccess.DoResolve): Likewise.
2459 2005-03-30 Marek Safar <marek.safar@seznam.cz>
2461 C# 2.0 Conditional attribute class implementation
2463 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2464 Analyzes class whether it has attribute which has ConditionalAttribute
2465 and its condition is not defined.
2467 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2468 (Class.IsExcluded): New method. Search for at least one defined
2469 condition in ConditionalAttribute of attribute class.
2471 2005-03-30 Raja R Harinath <rharinath@novell.com>
2473 * ecore.cs (PropertyExpr): Derive from Expression, not
2474 ExpressionStatement.
2475 (PropertyExpr.EmitStatement): Remove.
2477 2005-03-29 Raja R Harinath <rharinath@novell.com>
2480 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2481 internal field "value__" of an enum be private. The examples for
2482 "value__" that I found on MSDN all used FieldAttributes.Private.
2484 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2485 Don't mention IL method attribute names.
2487 Fix #47991. Remove a TODO.
2488 * statement.cs (Block.Toplevel): Make into a field.
2489 (Block.Parameters): Move into ToplevelBlock.
2490 (Block.known_variables): Rename from child_variable_names.
2491 (Block.Block): Remove variants that take Parameters. Initialize
2492 'Toplevel' with the immediately surrounding toplevel block.
2493 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
2494 LocalInfo parameter.
2495 (Block.GetKnownVariableInfo): New.
2496 (Block.IsVariableNameUsedInChildBlock): Update.
2497 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
2498 the block, even though it may not be in scope.
2499 (Block.AddVariable): Remove Parameters parameter. Use
2500 Toplevel.Parameters instead.
2501 (Block.AddConstant): Remove Parameters parameter.
2502 (Block.GetParameterReference): Update to use Toplevel.Parameters.
2503 (Block.IsParamaterReference): Likewise.
2504 (Block.IsLocalParameter): Likewise. Simplify a lot.
2505 (ToplevelBlock.Parameters): New. Moved from Block.
2506 (ToplevelBlock.ToplevelBlock): Update to changes. Always
2507 initialize Parameters to a non-null value.
2508 * cs-parser.jay: Update to changes.
2509 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2510 simple names that mean different things in the same block. Use
2511 Block.IsVariableNameUsedInBlock.
2513 2005-03-28 Raja R Harinath <rharinath@novell.com>
2515 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2517 2005-03-26 Raja R Harinath <harinath@acm.org>
2520 * assign.cs (Assign.DoResolve): When the RHS of an assignment
2521 fails to resolve, ensure that the LHS is still resolved as an
2524 2005-03-25 Raja R Harinath <harinath@acm.org>
2526 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2528 (Enum.current_ec): Remove.
2529 (Enum.LookupEnumValue): Remove EmitContext argument.
2530 Just uses the one created during DefineType.
2531 (Enum.FindMembers): Update.
2532 * expression.cs (MemberAccess.DoResolve): Update.
2534 2005-03-22 Marek Safar <marek.safar@seznam.cz>
2536 * assign.cs (Assign.DoResolve): Check for CS1717 when
2537 source and target are same (uses Equals).
2539 * expression.cs (LocalVariableReference, ParameterReference,
2540 This): Implemented Equals, GetHashCode.
2542 * statement.cs (Block.GetParameterReference): Removed useless
2545 2005-03-22 Raja R Harinath <rharinath@novell.com>
2548 * statement.cs (Block.AddVariable): Ensure that we skip implicit
2549 blocks before deciding whether the error is cs0136 or cs0128.
2551 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2552 (using_alias_directive, using_namespace_directive): Pass
2553 MemberName, not an expression to Namespace.UsingAlias and
2555 (MakeName): Use the MemberName of the namespace.
2556 * namespace.cs (Namespace.MemberName): New.
2557 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2558 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2560 * decl.cs (MemberName.Name): Make readonly.
2561 (MemberName.FromDotted): New "constructor".
2562 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2563 (MemberCore.Name): Compute from MemberName on demand.
2564 (MemberCore.SetMemberName): Provide a way to change the
2566 (MemberCore.AddToContainer): Don't take a fullname parameter.
2567 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2568 fully qualified name of the container to the member name.
2569 (TypeContainer.AddToTypeContainer): Use a fully qualified name
2570 only if the type is a member of the root container.
2571 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2572 MemberName.Left rather than searching for an embedded ".".
2573 (PartialContainer.CreatePart): Update to changes in RootContext.
2574 (MemberBase.ShortName): Turn into a property. Use
2575 MemberCore.SetMemberName.
2576 (MemberBase.ExplicitInterfaceName): Remove.
2577 (MemberBase.UpdateMemberName): Remove.
2578 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2579 (PropertyBase.SetMemberName): New override.
2580 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2581 (Tree.GetDecl): New.
2582 (Tree.AllDecls): Rename from Decls.
2583 * attribute.cs, enum.cs, report.cs: Update to changes.
2584 * driver.cs (MainDriver): Use MemberName.FromDotted on
2585 RootContext.MainClass.
2587 2005-03-21 Marek Safar <marek.safar@seznam.cz>
2589 * class.cs (FixedField.Define): Check for CS1664 and more sanity
2592 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2594 2005-03-18 Marek Safar <marek.safar@seznam.cz>
2596 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2597 property accessor modifiers.
2599 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2600 fixed buffer attribute (CS1716).
2601 (PropertyMethod.HasCustomAccessModifier): When property accessor
2602 has custom modifier.
2604 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2606 (PropertyExpr.DoResolveLValue): Add CS0272.
2608 2005-03-17 Miguel de Icaza <miguel@novell.com>
2610 * convert.cs: When converting to a pointer, use the proper Conv.U
2611 or Conv.I depending on the source data type.
2613 * cs-tokenizer.cs: Make the size for large decimal constants,
2616 2005-03-17 Martin Baulig <martin@ximian.com>
2618 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2619 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
2621 2005-03-17 Martin Baulig <martin@ximian.com>
2623 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2624 to bool so we can return an error condition.
2625 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2628 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
2630 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2633 2005-03-16 Raja R Harinath <rharinath@novell.com>
2635 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2636 Refactor to avoid traversing the list of assemblies, and to avoid
2637 string concatenation.
2638 * typemanager.cs (guid_attr_type): Remove.
2639 (negative_hits, pointers, references): Remove hashes.
2641 (GetConstructedType): New. Uses type_hash to handle constructed
2642 types (arrays, references, pointers).
2643 (GetReferenceType, GetPointerType): Use it.
2644 (GetNestedType): New. Uses type_hash to handle nested types of
2646 (LookupType, LookupTypeDirect): Remove.
2647 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
2648 'types' hash and LookupTypeReflection directly.
2649 (params_string, params_object): Use GetConstructedType.
2650 * namespace.cs (Namespace.cached_types): New. Cache of reflected
2652 (Namespace.Lookup): Use cached_types.
2653 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2654 provided by old TypeManager.LookupType.
2655 * rootcontext.cs (MakeFQN): Remove.
2656 * decl.cs (DeclSpace.MakeFQN): Likewise.
2657 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2658 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2659 TypeManager.GetConstructedType.
2660 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2662 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
2664 * cs-parser.jay: Fix build.
2666 2005-03-15 Marek Safar <marek.safar@seznam.cz>
2668 * class.cs (TypeContainer.CircularDepException) New nested
2669 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
2671 * cs-parser.jay: Reports CS1527 for any namespace element.
2673 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2676 * expression.cs (ParameterReference.IsAssigned): Changed error to
2678 (Error_WrongNumArguments): Moved CS0245 detection here.
2680 * statement.cs (Return.Resolve): Add CS1622 report.
2682 2005-03-11 Marek Safar <marek.safar@seznam.cz>
2684 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2686 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
2688 * attribute.cs expression.cs: Get rid of some allocations.
2690 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
2692 * doc.cs : just eliminate the latest change.
2694 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2696 * doc.cs : commented out the latest change. It breaks xml-030.cs
2698 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2700 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2701 fail. So invoke CreateType() in FindDocumentedType().
2703 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2705 * cs-tokenizer.cs : added IsKeyword().
2706 * doc.cs : Detect keyword incorrectly used as identifier.
2707 Allow identifiers prefixed by @.
2709 2005-03-10 Marek Safar <marek.safar@seznam.cz>
2711 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2712 It caused exception in namespace resolving (again!).
2714 * class.cs (Class.ctor): Removed exit.
2715 (PropertyMethod.ctor): ditto.
2717 * codegen.cs (Codegen.Reset): Reset static data.
2718 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2720 * cs-tokenizer.cs (Cleanup): Removed.
2722 * driver.cs (GetSystemDir): Rewrote to one line command.
2723 It caused problem with unloaded dynamic modules.
2724 (UnixParseOption): Removed Exit.
2725 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2726 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2727 Now can be mcs used as library.
2729 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2732 * location.cs (Reset): Reset static data.
2734 * namespace.cs (Reset): Reset static data.
2736 * report.cs (Report.Reset): Reset static data.
2738 * rootcontext.cs (RootContext.Reset): Reset static data.
2740 * tree.cs (RootTypes.ctor): Use Location.Null
2742 * typemanager.cs (TypeManager.Reset): Reset static data.
2743 (CoreLookupType): Removed Exit.
2744 (TypeHandle.Reset): Reset static data.
2746 2005-03-10 Raja R Harinath <rharinath@novell.com>
2749 * typemanager.cs (ComputeNamespaces): Import namespaces from
2750 referenced modules too.
2752 2005-03-09 Raja R Harinath <rharinath@novell.com>
2754 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2757 2005-03-09 Raja R Harinath <rharinath@novell.com>
2759 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2760 enclosing DeclSpace. This ensures that a name-lookup populates
2761 more caches and there are fewer 'TypeExpression's. Carve out
2762 nested type lookup into ...
2763 (LookupNestedTypeInHierarchy): ... this.
2765 2005-04-15 Martin Baulig <martin@ximian.com>
2767 Merged r41590 from MCS and make it work in the generics land.
2769 * generic.cs (TypeParameter.UpdateConstraints): Removed the
2772 * class.cs (PartialContainer.UpdateConstraints): Removed.
2773 (PartialContainer.CheckConstraints): Removed.
2774 (PartialContainer.SetParameterInfo): Store the constraints here.
2775 (PartialContainer.DefineTypeParameters): New public method;
2776 resolve the type parameter's constraints here. Note that the
2777 PartialContainer doesn't have an EmitContext anymore, so we must
2778 do this in the ClassPart.
2780 2005-03-09 Raja R Harinath <rharinath@novell.com>
2782 Clean up a few partial-class semantics.
2783 Fixes test-357.cs and cs1618-2.cs.
2784 * cs-parser.jay (struct_declaration): Use 'current_class' as
2785 parent of newly-created struct. Remove call to Register ().
2786 Use 'pop_current_class' to complete handing the current struct.
2787 (interface_declaration): Likewise.
2788 (class_declaration): Likewise.
2789 (enum_declaration): Use 'current_class' as parent of newly created
2791 (delegate_declaration): Likewise.
2792 (pop_current_class): New function. This is used to handle closing
2793 up the 'current_class' and 'current_container', and pointing them
2794 to the enclosing class/container.
2795 (CSharpParser): Initialize 'current_class' too.
2796 * decl.cs (MemberCore): Add check for invariant: a partial
2797 container is not a parsed entity, and thus does not enclose any
2799 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2800 (DeclSpace.BaseTypeExpr): Use it.
2801 (DeclSpace.LookupType): Add check for invariant.
2802 * class.cs (TypeContainer): Add check for invariant: a nested
2803 class should have the same NamespaceEntry as its enclosing class.
2804 (TypeContainer.EmitFieldInitializers): Make virtual.
2805 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2807 (TypeContainer.Register): Remove.
2808 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2809 null. Use TypeResolveEmitContext for resolving base types and
2810 interfaces. Move initialization of Parts.TypeBuilder here from
2812 (TypeContainer.DefineNestedTypes): ... here.
2813 (PartialContainer): Take a Namespace not a NamespaceEntry.
2814 (PartialContainer.Create): Don't use Register. Call the
2815 appropriate Add... function directly.
2816 (ClassPart): Take both the PartialContainer and the enclosing
2817 class as constructor arguments.
2818 (ClassPart.EmitFieldInitializers): Override.
2819 (ClassPart.PartFindNestedTypes): Remove.
2820 (FieldBase.GetInitializerExpression): Resolve the initializer
2821 expression in the emit context of the enclosing class.
2822 * tree.cs (RootTypes): Remove Register ().
2824 2005-03-08 Marek Safar <marek.safar@seznam.cz>
2826 * cs-parser.jay: Removed CS0134.
2828 * driver.cs: Removed CS1901.
2830 * expression.cs (SizeOf.DoResolve): Don't report CS0233
2831 for predefined types.
2833 2005-03-07 Duncan Mak <duncan@novell.com>
2835 * codegen.cs (Save): Catch UnauthorizedAccessException as
2836 well. Fixes bug #73454.
2838 2005-03-07 Marek Safar <marek.safar@seznam.cz>
2840 * cs-tokenizer.cs (xtoken): Add CS1035.
2842 * class.cs (MethodData.Define): Add CS0683.
2843 (FieldMember.ctor): Add CS0681.
2845 2005-03-07 Raja R Harinath <rharinath@novell.com>
2847 * ecore.cs (SimpleName.DoResolve): Rename from
2848 SimpleName.DoResolveAllowStatic.
2849 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2850 Pass 'intermediate' flag to MemberStaticCheck.
2851 (SimpleName.MemberStaticCheck): Skip "static check" only in case
2852 of "intermediate" lookups via MemberAccess.
2853 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
2854 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2856 2005-03-07 Raja R Harinath <rharinath@novell.com>
2859 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2860 slipped in because of variable names that are identical to a
2861 builtin type's BCL equivalent ('string String;', 'int Int32;').
2862 (PropertyExpr.EmitInstance): Likewise.
2864 2005-03-04 Marek Safar <marek.safar@seznam.cz>
2866 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2868 * report.cs (warning_ignore_table): Made public.
2870 2005-03-04 Raja R Harinath <rharinath@novell.com>
2873 * class.cs (MethodData.Emit): Pass 'container' to
2874 container.GetObsoleteAttribute instead of 'container.Parent'.
2876 2005-03-03 Marek Safar <marek.safar@seznam.cz>
2878 * cs-parser.jay: Add 1534 error test.
2880 * iterators.cs (Yield.CheckContext): Add error 1629.
2881 (Iterator.ctor): Save unsafe modifier.
2882 (MoveNextMethod.DoEmit): Restore unsafe context.
2884 * namespace.cs (UsingAlias): Better error message.
2886 2005-03-03 Dan Winship <danw@novell.com>
2888 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2889 the warning message [#73219]
2891 2005-03-03 Raja R Harinath <rharinath@novell.com>
2893 Fix compile with MCS 1.0.0.0.
2894 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2895 w_restore to not depend on string constant folding.
2897 2005-03-03 Raja R Harinath <rharinath@novell.com>
2899 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
2900 CS0246 check to users who passed 'silent = false'.
2901 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2903 (SimpleName.SimpleNameResolve): Update.
2904 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2905 (MemberAccess.IdenticalNameAndTypeName): Update.
2906 * doc.cs (FindDocumentedTypeNonArray): Update.
2908 2005-03-03 Raja R Harinath <rharinath@novell.com>
2910 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2911 * parameters.cs (ComputeAndDefineParameters): Remove.
2912 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2913 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2914 Use GetParameterInfo.
2916 2005-03-02 Marek Safar <marek.safar@seznam.cz>
2918 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2920 2005-03-02 Raja R Harinath <rharinath@novell.com>
2922 Unify DeclSpace.LookupType and DeclSpace.FindType.
2923 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
2924 is in charge of defining nested types on demand.
2925 (DeclSpace.LookupType): Use it when the current_type is a
2926 TypeBuilder. Use LookupTypeDirect for reflected types.
2927 (DeclSpace.FindType): Remove.
2928 (DeclSpace.LookupInterfaceOrClass): Likewise.
2929 (DeclSpace.DefineTypeAndParents): Likewise.
2930 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2931 DeclSpace.LookupType.
2932 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2933 * typemanager.cs (LookupType): Simplify.
2934 (AddUserType): Remove type from negative_hits.
2935 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2936 * class.cs (TypeContainer.FindMembers): Move handling of nested
2938 (TypeContainer.FindMembers_NestedTypes): ... here.
2939 (TypeContainer.FindNestedType): Implement override.
2940 (ClassPart.FindNestedType): Delegate to PartialContainer.
2941 (ClassPart.PartFindNestedType): Looks up the nested types of the
2944 2005-04-14 Martin Baulig <martin@ximian.com>
2946 * generic.cs (ConstructedType): Moved all the type lookup and
2947 nested class logic into SimpleName.
2948 (ConstructedType.ResolveConstructedType): Our underlying type is
2949 already fully resolved; all the type lookup stuff is in
2952 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2953 constructed types here instead of in ConstructedType.
2955 * decl.cs (MemberName.GetTypeExpression): Always create a
2956 SimpleName, not a ConstructedType.
2957 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2959 2005-03-02 Martin Baulig <martin@ximian.com>
2961 * class.cs (TypeContainer.DoDefineMembers): We also need a default
2962 static constructor in static classes.
2964 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
2966 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2967 sizeParamIndex is not specified.
2969 2005-03-01 Marek Safar <marek.safar@seznam.cz>
2972 * report.cs (WarningMessage.IsEnabled): Missing null check.
2974 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2976 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2977 in the fields and not in the properties.
2979 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
2981 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
2984 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2986 * attribute.cs: Small refactoring (improved robustness).
2987 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2988 (ValidateGuid): Removed.
2989 (Resolve): Removed referenced to above mentioned.
2990 (GetAttributeUsage): Made private and changed to work without
2992 (GetIndexerAttributeValue): Don't crash.
2993 (GetConditionalAttributeValue): Ditto.
2994 (GetClsCompliantAttributeValue): Ditto.
2995 (ExtractSecurityPermissionSet): All attributes exceptions are
2997 (GetPropertyValue): New helper.
2998 (GetMethodImplOptions): New method.
2999 (DefinePInvokeMethod): Reuse common code. Implemented handling of
3000 some missing properties.
3002 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3003 (Method.ApplyAttributeBuilder): Updated.
3005 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3008 2005-02-28 Raja R Harinath <rharinath@novell.com>
3011 * report.cs (Report.SymbolRelatedToPreviousError): Handle
3012 non-simple types (array, pointer, reference).
3014 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3016 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3018 * class.cs (MethodCore.IsDuplicateImplementation): Special error
3020 (Method.CheckBase): Catch wrong destructor here.
3021 (MethodData.Define): Add errors 550, 668.
3023 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3025 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3027 * pending.cs (VerifyPendingMethods): Add error 551.
3029 * typemanager.cs (CSharpName): Next error report helper.
3031 2005-02-25 Marek Safar <marek.safar@seznam.cz>
3033 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3034 attributes. Removed useless attribute double check.
3035 It saves almost 2MBs for corlib.
3037 2005-02-25 Raja R Harinath <rharinath@novell.com>
3040 * statement.cs (ExpressionStatement.Resolve): Make robust to being
3041 called twice in case of error.
3043 2005-02-23 Chris Toshok <toshok@ximian.com>
3045 Fix compiler portions of #72827.
3046 * statement.cs (Block.Emit): call Begin/EndScope on the
3047 EmitContext instead of the ILGenerator.
3049 * codegen.cs (EmitContext.BeginScope): new method, call
3050 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3052 (EmitContext.BeginScope): same, but EndScope and CloseScope
3054 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3055 offset and call the superclass's OpenScope(int) with it.
3056 (SymbolWriter.CloseScope): get the current il
3057 offset and call superclass's CloseScope(int) with it.
3059 2005-02-23 Marek Safar <marek.safar@seznam.cz>
3061 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3062 CS1677 for out and ref as well.
3064 * class.cs (Method.Define): Add error CS1599 detection.
3066 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3068 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3070 * delegate.cs (Delegate.Define): Add error CS1599 detection.
3072 * support.cs.cs (ModifierDesc): New helper method.
3074 2005-02-23 Raja R Harinath <rharinath@novell.com>
3075 Abin Thomas <projectmonokochi@rediffmail.com>
3076 Anoob V E <projectmonokochi@rediffmail.com>
3077 Harilal P R <projectmonokochi@rediffmail.com>
3080 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3081 MemberLookup (used for error reporting) actually returns a result.
3082 Fix error report number (122, not 112).
3084 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
3085 Anoob V E <projectmonokochi@rediffmail.com>
3086 Harilal P R <projectmonokochi@rediffmail.com>
3089 * pending.cs (PendingImplementation.GetAbstractMethods):
3090 Find NonPublic members too.
3092 2005-02-22 Marek Safar <marek.safar@seznam.cz>
3094 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3097 * class.cs (MethodCore.CheckMethodAgainstBase):
3098 Add error 239 report.
3100 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3102 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3104 * class.cs (Operator.Define): Add error 217 report.
3106 2005-02-21 Raja R Harinath <rharinath@novell.com>
3109 * expression.cs (Invocation.IsApplicable): Make public.
3110 (Invocation.IsParamsMethodApplicable): Likewise.
3111 * delegate.cs (Delegate.VerifyApplicability): Don't use
3112 Invocation.VerifyArgumentCompat for parameter applicability
3113 testing. Use Invocation.IsApplicable and
3114 Invocation.IsParamsMethodApplicable.
3116 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3118 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3120 * class.cs (Operator.Define): Add error 217 report.
3122 2005-02-21 Raja R Harinath <rharinath@novell.com>
3124 * namespace.cs (UsingEntry.Resolve): Undo change below.
3126 2005-02-21 Raja R Harinath <rharinath@novell.com>
3129 * ecore.cs (Expression.MemberLookupFailed): Add argument to
3130 disable the error message when the extended MemberLookup also
3132 (Expression.MemberLookupFinal): Update.
3133 (SimpleName.DoSimpleNameResolve): Update.
3134 * expression.cs (MemberAccess.ResolveNamespaceOrType):
3135 Don't use MemberLookupFinal.
3136 (New.DoResolve): Update.
3137 (BaseAccess.CommonResolve): Update.
3139 2005-02-21 Raja R Harinath <rharinath@novell.com>
3142 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3143 occured previously, don't resolve again.
3145 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3148 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3149 argument. Call ResolveAttributeUsage for unresolved.
3150 when types doesn't match ctor arguments.
3152 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3153 for nested attribute classes.
3154 (Class.attribute_usage): Removed.
3155 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3156 for attribute class.
3158 * ecore.cs (IsAttribute): Removed.
3160 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3162 * rootcontext.cs (RegisterAttribute): Removed, attributes are
3164 (attribute_types): Removed.
3165 (EmitCode): Global attributes are emited as the latest.
3167 2005-02-18 Marek Safar <marek.safar@seznam.cz>
3169 * class.cs (EmitFieldInitializers): Don't emit field initializer
3170 for default values when optimilization is on.
3172 * constant.cs (Constant.IsDefaultValue): New property.
3174 * driver.cs: Add /optimize handling.
3178 * literal.cs: Implement new IsDefaultValue property.
3180 * rootcontext.cs (Optimize): New field, holds /optimize option.
3182 2005-02-18 Raja R Harinath <rharinath@novell.com>
3184 Fix crasher in re-opened #72347.
3185 * namespace.cs (Namespace.Lookup): Return null if
3186 DeclSpace.DefineType returns null.
3189 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3191 2005-02-18 Raja R Harinath <rharinath@novell.com>
3193 Fix remainder of #63202. Change semantics of DoResolveLValue: it
3194 now returns null if it cannot resolve to an lvalue.
3195 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3196 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3197 returned null. Remove check for SimpleName.
3198 (EventExpr.DoResolveLValue): New.
3199 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3200 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
3202 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
3204 (Unary.ResolveOperator): Move CS0211 check ...
3205 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
3207 (Unary.DoResolveLValue): Simplify.
3208 (AddressOf.DoResolveLValue): New.
3209 (ArrayAccess.DoResolveLValue): New.
3211 2005-02-16 Marek Safar <marek.safar@seznam.cz>
3213 * attribute.cs (Attribute.Resolve): Add arguments casting for
3214 when types doesn't match ctor arguments.
3216 2005-02-16 Raja R Harinath <rharinath@novell.com>
3218 Fix parts of #63202.
3219 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3220 lookup of operator in base type. Ensure that all checks happen
3221 when the operator resolves to an "op_..." method.
3223 2005-02-15 Raja R Harinath <rharinath@novell.com>
3226 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3227 'ignore_cs0104' parameter. Pass it to ...
3228 (NamespaceEntry.Lookup): ... this.
3229 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3230 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3231 (TypeLookupExpression.DoResolveAsTypeStep): Update.
3232 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3233 Update. Request that cs0104 errors be ignored.
3234 (ComposedCast.ResolveAsTypeStep): Update.
3236 2005-02-14 Raja R Harinath <rharinath@novell.com>
3239 * expression.cs (Invocation.BetterFunction): Remove support for
3240 comparing virtual functions and their overrides.
3241 (Invocation.IsOverride): New.
3242 (Invocation.OverloadResolve): Don't consider 'override' functions
3243 during candidate selection. Store them in a lookaside list.
3244 If the selected method is a 'virtual' function, use the list to
3245 find any overrides that are closer to the LHS type.
3247 2005-02-14 Marek Safar <marek.safar@seznam.cz>
3249 * expression.cs (New.DoResolve): Add complex core type reduction.
3250 (New.Constantify): Converts complex core type syntax like 'new int ()'
3253 2005-02-14 Raja R Harinath <rharinath@novell.com>
3255 * decl.cs (EntryType.EntryType): New constructor to create an
3256 updated copy of a cache entry.
3257 (MemberCache.AddMethods): Use it.
3258 (MemberCache.ClearDeclaredOnly): Remove.
3259 (MemberCache.MemberCache): Update.
3261 2005-02-11 Miguel de Icaza <miguel@novell.com>
3263 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3264 variable. This one is represents the actual low-level declaration
3265 of the method, as opposed to the semantic level `IsStatic'.
3267 An anonymous method which is hosted into a static method might be
3268 actually an instance method. IsStatic would reflect the
3269 container, while MethodIsStatic represents the actual code
3272 * expression.cs (ParameterReference): Use the new MethodIsStatic
3273 instead of IsStatic.
3275 * anonymous.cs (AnonymousMethod.Compatible): Pass the
3276 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3277 set on the current EmitContext.
3279 * expression.cs (Cast): Overload DoResolveLValue so we can pass
3280 resolve our casted expression as an LValue. This triggers the
3281 proper LValue processing that is later required by Assign.
3285 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3287 2005-02-11 Marek Safar <marek.safar@seznam.cz>
3289 C# 2.0 Fixed buffer implementation
3291 * anonymous.cs: Update after RegisterHelperClass renaming.
3293 * attribute.cs (AttributeTester.fixed_buffer_cache):
3294 Cache of external fixed buffers.
3295 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3296 implementation if field is fixed buffer else null.
3299 (TypeContainer.AddField): Accept FieldMember instead of Field.
3300 (FieldBase.IsFieldClsCompliant): Extracted code from
3301 VerifyClsCompliance descendant customization.
3302 (FixedField): New class handles fixed buffer fields.
3303 (FixedFieldExternal): Keeps information about imported fixed
3305 (IFixedField): Make access to internal or external fixed buffer
3308 * cs-parser.jay: Add fixed buffer parsing.
3310 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3313 * expression.cs (Indirection): Extended implementation to accept
3315 (PointerArithmetic.Emit): Get element from fixed buffer as well.
3316 (ElementAccess.MakePointerAccess): Get type as parameter.
3317 (DoResolve): Add fixed buffer field expression conversion.
3318 (DoResolveLValue): Ditto.
3319 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3320 (ArrayPtr): Derives from FixedBufferPtr.
3321 (ArrayPtr.Emit): Add extra emit for array elements.
3323 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3325 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3326 for compiler generated types.
3327 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3329 * statement.cs (Fixed): Refactored to be easier add fixed buffer
3330 and consume less memory.
3331 (Fixed.Resolve): Add fixed buffer case.
3333 * typemanager.cs (compiler_generated_attr_ctor,
3334 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3335 (HasElementType): Add our own implementation to work on every
3338 2005-02-11 Miguel de Icaza <miguel@novell.com>
3340 * anonymous.cs (CaptureContext): Track whether `this' has been
3343 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
3344 only captured `this' if it was implicitly done (instance
3345 methods/variables were used).
3347 * codegen.cs (EmitContext.CaptureThis): New method to flag that
3348 `this' must be captured.
3350 2005-01-30 Miguel de Icaza <miguel@novell.com>
3352 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3353 is null it means that there has been no need to capture anything,
3354 so we just create a sibling.
3356 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3358 Just a partial fix. The other half is fairly elusive.
3360 2005-02-10 Raja R Harinath <rharinath@novell.com>
3362 Fix #52586, cs0121-4.cs.
3363 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
3364 and return a hashtable.
3365 (MemberCache.ClearDeclaredOnly): New.
3366 (MemberCache.MemberCache): Update to change. Make a deep copy of
3367 the method_hash of a base type too.
3368 (MemberCache.AddMethods): Adapt to having a deep copy of the base
3369 type methods. Overwrite entries with the same MethodHandle so
3370 that the ReflectedType is correct. The process leaves in base
3371 virtual functions and their overrides as distinct entries.
3372 (CacheEntry): Now a class instead of a struct. It shouldn't alter
3373 matters since it was boxed in a ArrayList before.
3374 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3376 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
3377 case of a virtual function and its override (choose the overload
3379 (Invocation.OverloadResolve): Avoid 'override' members during
3380 'applicable_type' calculation.
3382 2005-03-28 Raja R Harinath <rharinath@novell.com>
3384 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3385 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3386 GetTypeHandle. It is possible for a reflected type to derive from
3387 a TypeBuilder (e.g., int[] derives from the TypeBuilder
3388 System.Array during mscorlib compilation).
3389 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3390 contain a method_hash, don't create one either. Don't create a
3391 deep copy of the base cache's method_hash.
3392 (MemberCache.SetupCache): Rename back from DeepCopy.
3393 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3394 already initialized. If we see an override function, add its
3395 underlying base virtual function to the member_hash too.
3397 2005-02-09 Raja R Harinath <rharinath@novell.com>
3399 Combine two near-redundant caches.
3400 * typemanager.cs (method_params): Rename from method_internal_params.
3401 (TypeManager.GetParameterData): New. Replace
3402 Invocation.GetParameterData.
3403 (TypeManager.LookupParametersByBuilder): Remove.
3404 * expression.cs (Invocation.method_parameter_cache): Remove.
3405 (Invocation.GetParameterData): Remove.
3407 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3410 2005-02-08 Raja R Harinath <rharinath@novell.com>
3413 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3414 TypeManager.multicast_delegate_type is null, resolve it by looking
3415 up "System.MulticastDelegate".
3416 * rootcontext.cs (RootContext.ResolveCore): Simplify.
3418 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
3419 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
3420 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
3423 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3424 (LabeledStatement.AddReference): New. Set 'referenced'.
3425 (Goto.Resolve): Use it.
3427 2005-02-05 John Luke <john.luke@gmail.com>
3429 * driver.cs: remove duplicate -doc line in Usage ()
3431 2005-02-04 Raja R Harinath <rharinath@novell.com>
3433 * location.cs (Location.AddFile): Fix CS2002 error report.
3435 2005-02-02 Martin Baulig <martin@ximian.com>
3437 * delegate.cs (Delegate.DefineType): Report an internal error if
3438 TypeManager.multicast_delegate_type is null. See bug #72015 for
3441 2005-02-02 Raja R Harinath <rharinath@novell.com>
3443 Fix a crasher in a variant of #31984.
3444 * const.cs (Constant.CheckBase): New override that defers the
3445 new-or-override check in case the base type hasn't been populated
3447 (Constant.Define): Ensure the new-or-override check is performed.
3449 2005-02-01 Duncan Mak <duncan@ximian.com>
3451 * const.cs (LookupConstantValue): Check that `ce' is not null
3452 before calling GetValue ().
3454 2005-02-01 Raja R Harinath <rharinath@novell.com>
3456 Fix test-334.cs (#69519).
3457 * cs-parser.jay (using_alias_directive): Pass in an expression to
3458 NamespaceEntry.UsingAlias.
3459 (using_namespace_directive): Pass in an expression to
3460 NamespaceEntry.Using.
3461 (namespace_name): Don't flatten to a string.
3462 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3463 (NamespaceEntry.AliasEntry.Resolve): Lookup using
3465 (NamespaceEntry.UsingEntry): Likewise.
3466 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3468 (NamespaceEntry.LookupForUsing): Remove.
3469 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3471 (NamespaceEntry.Lookup): Remove support for dotted names.
3473 2005-02-01 Raja R Harinath <rharinath@novell.com>
3475 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3477 (NamespaceEntry.ImplicitParent): Compute on demand.
3478 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3479 parallels the current.
3480 (NamespaceEntry.LookupForUsing): Use it.
3481 (NamespaceEntry.Lookup): If the current namespace-entry is
3482 implicit, don't search aliases and using tables.
3484 2005-02-01 Raja R Harinath <rharinath@novell.com>
3487 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3489 (TypeContainer.BaseCache): Compute on demand.
3490 (TypeContainer.FindMembers): Define constants and types if they're
3491 not already created.
3492 (FieldMember.Define): Move resetting of ec.InUnsafe before error
3494 * const.cs (Constant.Define): Make idempotent.
3496 2005-01-29 Miguel de Icaza <miguel@novell.com>
3498 * pending.cs: Produce better code (no nops produced by using Ldarg
3501 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3502 i - 1' it should be arg + 1.
3506 2005-01-28 Raja R Harinath <rharinath@novell.com>
3508 * attribute.cs (Attribute.CheckAttributeType): Make private
3510 (Attribute.ResolveType): Make virtual.
3511 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3512 handling of RootContext.Tree.Types.
3514 2005-01-27 Raja R Harinath <rharinath@novell.com>
3516 Update attribute-handling to use the SimpleName/MemberAccess
3518 * cs-parser.jay (attribute): Pass in an expression to the
3519 constructors of Attribute and GlobalAttribute.
3520 * attribute.cs (Attribute): Take an expression for the name.
3521 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
3522 passed in attribute name expression.
3523 (Attribute.CheckAttributeType): Use it.
3524 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3525 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3526 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
3527 argument to prevent error messages if the lookup fails.
3529 2005-01-27 Marek Safar <marek.safar@seznam.cz>
3531 * expression.cs (Indirection): Implemented IVariable interface
3532 to support indirection in AddressOf operator.
3533 (PointerArithmetic.Emit): Add optimalization for case where
3534 result can be precomputed.
3536 2005-01-26 Martin Baulig <martin@ximian.com>
3538 * class.cs (TypeContainer.AttributeTargets): Return the correct
3539 AttributeTargets depending on our `Kind' instead of throwing an
3540 exception; fixes #71632.
3542 2005-01-26 Marek Safar <marek.safar@seznam.cz>
3545 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3548 2005-03-17 Martin Baulig <martin@ximian.com>
3550 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3551 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
3553 2005-03-17 Martin Baulig <martin@ximian.com>
3555 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3556 to bool so we can return an error condition.
3557 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3560 2005-03-17 Martin Baulig <martin@ximian.com>
3562 * generic.cs (TypeMananager.IsIEnumerable): New public method.
3564 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
3565 converting from an array-type of T to `IEnumerable<T>'.
3567 2005-03-16 Martin Baulig <martin@ximian.com>
3569 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
3570 (Nullable.LiftedUnaryMutator): New public class.
3572 * expression.cs (UnaryMutator.DoResolve): Added support for
3575 2005-03-14 Martin Baulig <martin@ximian.com>
3577 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
3579 2005-03-14 Martin Baulig <martin@ximian.com>
3581 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
3582 the comparision operators `<', `>', `<=' and `>='.
3584 2005-03-13 Martin Baulig <martin@ximian.com>
3587 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
3588 avoid confusion with the `NullLiteral'.
3589 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
3591 2005-03-13 Martin Baulig <martin@ximian.com>
3593 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
3594 comparing arbitrary types with the null literal.
3596 2005-03-13 Martin Baulig <martin@ximian.com>
3598 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
3599 boolean operators '&&', '||', '&' and '|'.
3600 (Nullable.OperatorTrueOrFalse): New public class.
3602 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
3603 instead of a `StaticCallExpr'; added support for nullables.
3605 2005-03-10 Martin Baulig <martin@ximian.com>
3608 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
3609 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
3611 2005-03-07 Martin Baulig <martin@ximian.com>
3613 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
3614 it work if `expr' is not an IMemoryLocation.
3615 (Nullable.Lifted): Implement IMemoryLocation.
3616 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
3619 2005-03-05 Martin Baulig <martin@ximian.com>
3621 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
3622 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
3623 (Nullable): Added support for lifted unary and binary operators.
3625 * expression.cs (Unary.DoResolve): Added support for nullable types.
3626 (Binary.DoResolve): Likewise.
3627 (Conditional.DoResolve): Likewise.
3629 2005-03-02 Martin Baulig <martin@ximian.com>
3631 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
3633 * class.cs (ClassPart.SetParameterInfo): Override this.
3634 (PartialContainer.SetParameterInfo): Override this.
3635 (TypeContainer.CheckConstraints): New protected method.
3636 (PartialContainer.CheckConstraints): Override this and check
3637 whether the same contraints were specified in all parts of a
3638 partial generic type definition.
3639 (PartialContainer.UpdateConstraints): New public method.
3641 * generic.cs (TypeParameter.UpdateConstraints): New public method.
3643 2005-03-02 Martin Baulig <martin@ximian.com>
3645 Committing a patch from Carlos Alberto Cortez to fix #72887.
3647 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
3648 casts from `T []' to `int []'.
3650 2005-03-02 Martin Baulig <martin@ximian.com>
3652 * generic.cs (TypeManager.IsEqual): Make this symmetric.
3654 * expression.cs (Binary.ResolveOperator): When resolving a
3655 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
3656 `=='. Fixes #71866. See gen-127.cs.
3658 2005-03-02 Martin Baulig <martin@ximian.com>
3660 * class.cs (TypeContainer.DoDefineMembers): We also need a default
3661 static constructor in static classes.
3663 2005-03-02 Martin Baulig <martin@ximian.com>
3666 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
3667 (Nullable.LiftedConversion): Added support for user-defined
3670 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
3672 * cs-parser.jay: Use ComposedCast everywhere instead of
3673 NullableType, so we don't need to check for NullableType
3675 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3676 case where we'll be resolved into a `parenthesized_expression_0'
3680 (Convert.UserDefinedConversion): Added nullable conversions.
3682 2005-02-28 Martin Baulig <martin@ximian.com>
3684 * generic.cs (TypeManager.IsNullableType): New static method.
3685 (Nullable): New abstract class.
3686 (Nullable.NullLiteral): New public class.
3687 (Nullable.LiftedConversion): New public class.
3689 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3690 `builtin_types opt_nullable'.
3693 (Convert.ImplicitConversionStandard): Added nullable conversions.
3694 (Convert.ExplicitConversionStandard): Likewise.
3695 (Convert.ExplicitConversion): Likewise.
3697 2005-02-26 Martin Baulig <martin@ximian.com>
3699 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3700 begin with a "?", for instance "?[]". Don't do a type lookup if
3703 2005-02-25 Martin Baulig <martin@ximian.com>
3705 The first part of Nullable Types :-)
3707 * generic.cs (NullableType): New public class.
3708 (NullCoalescingOperator): New public class.
3709 (TypeArguments.Resolve): Add a CS0306 check.
3711 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3712 (opt_nullable): New rule.
3713 (type): Added `opt_nullable' to `namespace_or_type_name',
3714 `builtin_types' and `pointer_type'.
3715 (array_type): Added `opt_nullable'.
3716 (opt_rank_specifier_or_nullable): New rule; this is the
3717 combination of `opt_rank_specifier' and `opt_nullable'.
3718 (opt_error): New rule; catch errors here.
3719 (nullable_type_or_conditional): New rule; we use this to check for
3720 nullable and still detect the conditional operator.
3721 (local_variable_type): Use `opt_rank_specifier_or_nullable'
3722 instead `opt_rank_specifier'.
3724 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3727 2005-02-24 Martin Baulig <martin@ximian.com>
3729 * README, README.Changes: Removed; they're old and obsolete.
3731 2005-02-22 Martin Baulig <martin@ximian.com>
3733 * generic.cs (TypeParameter.Resolve): If resolving the constraints
3734 returned an error, set `constraints' to null to avoid a crash
3736 (TypeParameter.ResolveType): Likewise.
3738 2005-02-22 Martin Baulig <martin@ximian.com>
3741 (Constraints.ResolveTypes): Protect against being called twice.
3742 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3743 (TypeParameter.ResolveType): New public method; calls
3744 constraints.ResolveTypes().
3745 (TypeParameter.DefineType): Moved constraints.ResolveType() out
3746 into the new ResolveType().
3747 (GenericMethod.Define): Call ResolveType() on all our
3750 2005-02-21 Martin Baulig <martin@ximian.com>
3753 (TypeManager.generic_nullable_type): New static public field.
3754 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3757 (RootContext.ResolveCore): Resolve "System.Nullable`1".
3759 2005-02-15 Martin Baulig <martin@ximian.com>
3761 * generic.cs (ConstructedType.Constraints): Correctly check
3762 constraints if the argument type is a type parameter; fixes
3765 2005-02-02 Martin Baulig <martin@ximian.com>
3767 * delegate.cs (Delegate.DefineType): Report an internal error if
3768 TypeManager.multicast_delegate_type is null. See bug #72015 for
3771 2005-01-29 Miguel de Icaza <miguel@novell.com>
3773 * pending.cs: Produce better code (no nops produced by using Ldarg
3776 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3777 i - 1' it should be arg + 1.
3781 2005-01-26 Martin Baulig <martin@ximian.com>
3783 * cs-parser.jay (indexer_declarator): Don't report an error if we
3784 have type parameters since we can be an explicit interface
3785 implementation; fixes #71449.
3787 2005-01-26 Martin Baulig <martin@ximian.com>
3789 * class.cs (TypeContainer.AttributeTargets): Return the correct
3790 AttributeTargets depending on our `Kind' instead of throwing an
3791 exception; fixes #71632.
3793 2005-01-26 Martin Baulig <martin@ximian.com>
3795 * delegate.cs (Delegate.DefineType): Correctly define our type
3796 parameters. Fixes #71483.
3798 2005-01-25 Raja R Harinath <rharinath@novell.com>
3801 * expression.cs (MemberAccess.DoResolve): Don't complain with
3802 cs0572 when the LHS of a member access has identical name and type
3805 2005-01-25 Marek Safar <marek.safar@seznam.cz>
3808 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3810 Create custom PermissionSet only for PermissionSetAttribute.
3812 2005-01-24 Marek Safar <marek.safar@seznam.cz>
3815 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3816 delegates in static class.
3818 2005-01-24 Martin Baulig <martin@ximian.com>
3820 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3821 merging an implicit block, just use its reachability.
3823 * statement.cs (Block.Resolve): Make the unreachable code check
3824 work wrt. implicit blocks; see test-337 from #63842.
3826 2005-01-21 Alp Toker <alp@atoker.com>
3828 * cs-parser.jay: destructor_declaration's container is PartialContainer
3829 not Class when partial types are used, so use Kind prop instead of
3832 2005-01-22 Miguel de Icaza <miguel@ximian.com>
3834 * cs-parser.jay: Improve error reporting when an interface
3837 2005-01-20 Dick Porter <dick@ximian.com>
3839 * support.cs: SeekableStreamReader fix from Sandor Dobos
3840 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3841 chars are read. Fixes bug 70369.
3843 2005-01-20 Raja R Harinath <rharinath@novell.com>
3845 * cs-parser.jay (catch_clause): Simplify current_block handling
3848 2005-01-17 Miguel de Icaza <miguel@ximian.com>
3850 * convert.cs (ImplicitStandardConversionExists): Synchronize the
3851 code with ImplicitStandardConversion to handle the implicit
3852 conversion of method groups into valid delegate invocations.
3854 The problem is that in parameter handling we were using this code
3855 path. Fixes bug #64698
3857 2005-01-19 Raja R Harinath <rharinath@novell.com>
3859 * cs-parser.jay: Fix several infelicities.
3860 - Avoid assigning to the parser value stack. Code like
3861 '$3 = null' is unclean. Synthesize a value for the code block
3863 - Avoid using oob_stack for storing location information. Use ...
3864 (_mark_): ... this. New (empty) rule. Saves the current location
3866 (foreach_statement): Avoid using oob_stack for current_block
3867 handling. Use technique used in for_statement and
3868 using_statement. Synthesize a value for the code block to store
3869 additional intermediate information.
3871 2005-01-13 Miguel de Icaza <miguel@ximian.com>
3873 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3874 of a different type is only allowed to private fields of a
3875 containing type, not on fields of a base class.
3877 See test-174.cs and error cs0122-9.cs
3879 2005-01-13 Raja R Harinath <rharinath@novell.com>
3881 Fix test-335.cs (bug #58126).
3882 * cs-parser.jay (argument): Split out non-expression parts of the
3883 rule into 'non_simple_argument'.
3884 (invocation_expression): Support parenthesized invocations with
3885 multiple arguments, and with single non-simple arguments.
3887 2005-01-13 Raja R Harinath <rharinath@novell.com>
3889 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3892 2005-01-12 Raja R Harinath <rharinath@novell.com>
3894 Fix cs0038-1.cs, cs1640-6.cs.
3895 * ecore.cs (Expression.Resolve): Remove special-case for
3896 SimpleName in error-handling.
3897 (Expression.almostMatchedMembers): Relax access permission to
3899 (Expression.MemberLookupFailed): Handle duplicates in
3900 almostMatchedMembers list.
3901 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3902 * expression.cs (New.DoResolve): Report CS1540 for more cases.
3903 * typemanager.cs (GetFullNameSignature): Use the MethodBase
3904 overload if the passed in MemberInfo is a MethodBase.
3906 2005-01-25 Martin Baulig <martin@ximian.com>
3909 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
3911 2005-01-12 Marek Safar <marek.safar@seznam.cz>
3914 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3915 for non-CAS & merge permission sets properly.
3917 2005-01-11 Raja R Harinath <rharinath@novell.com>
3919 Improve standard-compliance of simple name and member access
3920 resolution. Fixes bugs #52697, #57200, #67520, #69519.
3921 * ecore.cs (FullNamedExpression): New abstract base class
3922 for Namespaces and TypeExpressions.
3923 (ResolveFlags.SimpleName): Remove.
3924 (SimpleName): Remove support for dotted names.
3925 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
3926 DeclSpace.FindType and DeclSpace.LookupType.
3927 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3928 (Expression.ExprClassName): Make member function.
3929 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3930 a namespace. Remove creation of dotted "SimpleName"s.
3931 (MemberAccess.DoResolve): Likewise.
3932 * decl.cs (DeclSpace.Cache): Make private.
3933 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3934 (DeclSpace.FindType): Update.
3935 (DeclSpace.LookupType): Move here from RootContext. Return a
3936 FullNamedExpression.
3937 * namespace.cs (Namespace): Derive from FullNamedExpression
3938 so that it can be part of expression resolution.
3939 (Namespace.Lookup): Return an FullNamedExpression.
3940 (NamespaceEntry.LookupAlias): Lookup aliases only in current
3942 * rootcontext.cs (NamespaceLookup): Remove.
3943 (LookupType): Move to DeclSpace.
3944 * attribute.cs (CheckAttributeType): Update.
3945 * doc.cs (FindDocumentedType): Remove allowAlias argument.
3946 (FindDocumentedTypeNonArray): Likewise.
3948 2005-01-11 Raja R Harinath <rharinath@novell.com>
3950 Fix cs0509.cs, cs1632.cs.
3951 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3952 is the same as IsInterface.
3953 (TypeContainer.GetClassBases): Likewise.
3954 * statement.cs (LabeledStatement.ig): New field.
3955 (LabeledStatement.LabelTarget): Save ILGenerator which created the
3957 (LabeledStatement.DoEmit): Check that the label was created with
3958 the same ILGenerator.
3960 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3963 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3964 accessors to its properties.
3966 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3967 from accessors to property.
3969 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3972 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3975 2005-01-08 Miguel de Icaza <miguel@ximian.com>
3977 * attribute.cs: Check for null and empty strings.
3979 I have lost another battle to Paolo.
3981 2005-01-07 Marek Safar <marek.safar@seznam.cz>
3984 * class.cs (PropertyMethod): Set Parent field in ctors.
3985 (SetMethod.InternalParameters): Add unsafe switch hack.
3986 Override MarkForDuplicationCheck where it is appropriate.
3988 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3989 It says whether container allows members with the same name.
3991 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3992 Removed is_method parameter.
3994 2005-01-06 Duncan Mak <duncan@ximian.com>
3996 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3997 because the previous change led to incorrect reporting of CS1032
3998 ("Cannot define/undefine preprocessor symbols after first token in
3999 file"). Instead of using `tokens_seen' as the only flag that
4000 triggers CS1040, introduce `comments_seen'. This new flag is used
4001 to signify having seen comments on the current line, so it is
4002 unset after a newline.
4004 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
4006 * doc.cs : When searching for a type, find nested type too.
4007 This fixes bug #71040.
4009 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
4012 - Warn missing member comment on those classes which also does not
4013 have doc comments. Fixed bug #71041.
4014 - Don't warn missing doc comment on default constructor.
4017 2005-01-06 Duncan Mak <duncan@ximian.com>
4019 * cs-tokenizer.cs (xtoken): After handling traditional C-style
4020 comments, set `tokens_seen' to true. This allows us to detect
4021 misplaced preprocessor directives (i.e. not at the beginning of
4022 the a line, nor after whitespaces). In that case, report error
4023 CS1040. This fixes bug #56460.
4025 * cs-parser.jay (interface_member_declaration): Add checks for
4026 IsExplicitImpl, and report CS0541 error if an interface member is
4027 defined as an explicit interface declaration.
4029 2005-01-06 Marek Safar <marek.safar@seznam.cz>
4032 * class.cs (PropertyMethod): Set Parent field in ctors.
4033 (SetMethod.InternalParameters): Add unsafe switch hack.
4035 * decl.cs (MemberCore.Parent): Cannot be readonly.
4037 2005-01-06 Raja R Harinath <rharinath@novell.com>
4039 * decl.cs (DeclSpace.ResolveType): Remove.
4040 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4041 Merge in code from ...
4042 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
4043 * class.cs, enum.cs: Update to changes.
4045 2005-01-06 Miguel de Icaza <miguel@ximian.com>
4047 * anonymous.cs: Ensure that we init the scope of our parent if it
4048 has not been initialized yet.
4050 2004-12-30 Duncan Mak <duncan@ximian.com>
4052 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
4053 if field.FieldBuilder is null. Fixes #70758.
4055 * convert.cs: Fixed some typos and updated some of the comments.
4056 (ImplicitStandardConversionExists):
4057 (TryImplicitIntConversion): If `target_type' is an interface and
4058 the type of `ic' implements this interface, return true or a new
4059 BoxedCast instead of null. This fixes #70468.
4061 2004-12-29 Duncan Mak <duncan@ximian.com>
4063 * expression.cs (Argument.Emit): Check that Expr is
4064 IMemoryLocation before casting to it, and report CS1510 otherwise.
4068 2004-12-21 Ben Maurer <bmaurer@ximian.com>
4070 * statement.cs (Block.ThisVariable): remove the recursion here, to
4071 make the --profile more sane.
4073 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
4075 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4076 assembly, by JB Evain.
4078 2004-12-17 Raja R Harinath <rharinath@novell.com>
4080 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
4081 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4082 "parent" refers to enclosing type/class. "base" refers to superclass.
4084 2004-12-17 Raja R Harinath <rharinath@novell.com>
4086 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4087 Ensure that we only have GlobalAttributes.
4088 * attribute.cs (Attribute.Emit): Make non-virtual.
4089 (GlobalAttribute.Emit): Remove.
4090 (Attribute.Resolve): Make virtual.
4091 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
4092 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4093 the argument. Don't create one.
4094 (Attribute.GetObsoleteAttribute): Likewise.
4095 (Attribute.GetClsCompliantAttributeValue): Likewise.
4096 * class.cs, decl.cs: Update to changes.
4098 2004-12-17 Marek Safar <marek.safar@seznam.cz>
4100 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4102 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4104 * statement.cs (Foreach.Resolve): Add error 186 report.
4106 2004-12-16 Marek Safar <marek.safar@seznam.cz>
4108 * expression.cs (Conditional.DoResolve): Add warning 429.
4110 * statement.cs (If.Resolve): Add warning 665.
4112 2004-12-16 Raja R Harinath <rharinath@novell.com>
4114 New invariant: RootContext.Tree.Types.NamespaceEntry == null
4115 except when in the parser, and in GlobalAttribute.
4116 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4117 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4118 RootContext.Tree.Types.NamespaceEntry once work is done.
4119 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
4120 and resets RootContext.Tree.Types.NamespaceEntry.
4122 2004-12-15 Marek Safar <marek.safar@seznam.cz>
4124 * cs-parser.jay: Don't create a block for every variable.
4126 2004-12-14 Miguel de Icaza <miguel@ximian.com>
4128 * location.cs: Provide extra information.
4130 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4131 variables from the captured environment, it is the ldarg_0.
4133 2004-12-14 Marek Safar <marek.safar@seznam.cz>
4135 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4138 * class.cs: Changed warning level for 169 to avoid developer
4139 displeasure from warning flooding. It will be changed back when they
4140 fix most of current BCL warnings.
4142 * RootContext.cs: Pushed default WarningLevel to 3.
4144 * statement.cs: Removed unused variable.
4146 2004-12-14 Marek Safar <marek.safar@seznam.cz>
4148 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4149 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4150 Add error 502 report.
4151 (StaticClass.DefineType): Add error 441 report.
4152 (Class.AllowedModifiersProp): New virtual property as temporary
4153 extension to AllowedModifiers.
4154 (Class.DefineType): Add error 418 report. Moved ModFlags check here
4155 to share implementation with StaticClass and don't call virtual
4158 * driver.cs (MainDriver): Add error 1558 test.
4160 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4161 report. Moved error 36 test here.
4163 * statement.cs (Throw.Resolve): Add error 724 report.
4165 * typemanager.cs: Add out_attribute_type core type.
4167 2004-12-13 Marek Safar <marek.safar@seznam.cz>
4169 * class.cs (TypeContainer.VerifyClsCompliance): Add error
4171 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4173 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4176 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4178 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
4179 Add error 3023 report.
4180 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4182 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4185 2004-12-12 John Luke <john.luke@gmail.com>
4187 * driver.cs (AddArgs): take -- into account when
4188 adding arguments, fixes bug 65710
4190 2004-12-12 Martin Baulig <martin@ximian.com>
4192 * expression.cs (Unary.TryReduceNegative): Added support for
4193 SByteConstant and ByteConstant.
4194 (Unary.Reduce): Check error values from TryReduceNegative().
4196 2004-12-10 Marek Safar <marek.safar@seznam.cz>
4198 * attributes.cs (Attribute.Resolve): Avoid multiple error report
4199 and report exception as error 182.
4201 2004-12-10 Raja R Harinath <rharinath@novell.com>
4203 * driver.cs (Main): Fix message when there are warnings.
4205 2004-12-09 Miguel de Icaza <miguel@ximian.com>
4207 * delegate.cs: Fixed my fix from yesterday, sorry about that.
4209 2004-12-09 Marek Safar <marek.safar@seznam.cz>
4211 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
4212 Reduced number of warnings.
4214 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4216 2004-12-08 Miguel de Icaza <miguel@ximian.com>
4218 * driver.cs: Removed message.
4220 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4222 2004-12-08 <vargaz@freemail.hu>
4224 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4226 2004-12-08 Martin Baulig <martin@ximian.com>
4228 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4229 instead of a CS3002 for properties and indexer.
4231 2004-12-08 Martin Baulig <martin@ximian.com>
4233 * decl.cs (MemberName.ToString): Make this work again.
4235 2004-12-08 Marek Safar <marek.safar@seznam.cz>
4237 * attribute.cs (Resolve): Add error 591 detection.
4239 * class.cs (FieldMember.Define): Add error 1547 detection.
4240 (Indexer.Define): Add error 620 detection.
4241 (Operator.Define): Add error 590 detection.
4243 * ecore.cs: Missing argument for error 79.
4245 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4248 2004-12-07 Marek Safar <marek.safar@seznam.cz>
4251 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4254 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4256 * cs-parser.jay : handle doc comments on implicit/explicit operators.
4257 Some operator comments were suppressed.
4258 * doc.cs : Implicit/explicit operator name in doc comments are like
4259 "op_Explicit(type)~returnType", so added suffix handling.
4261 2005-01-21 Alp Toker <alp@atoker.com>
4263 * cs-parser.jay: destructor_declaration's container is PartialContainer
4264 not Class when partial types are used, so use Kind prop instead of 'is'.
4266 2004-12-12 Martin Baulig <martin@ximian.com>
4268 * expression.cs (Unary.TryReduceNegative): Added support for
4269 SByteConstant and ByteConstant.
4270 (Unary.Reduce): Check error values from TryReduceNegative().
4272 2004-12-11 Martin Baulig <martin@ximian.com>
4274 * support.cs (ReflectionParameters.ParameterName): If we have a
4275 `gpd', call `ParameterName' on it.
4277 * parameter.cs (Parameter.GetParameterAttributes): New static method.
4279 * pending.cs (PendingImplementation.DefineProxy): Call
4280 DefineParameter() for all of the MethodBuilder's arguments.
4282 2004-12-09 Martin Baulig <martin@ximian.com>
4284 * doc.cs (DocUtil): Make this a static class.
4286 2004-12-09 Martin Baulig <martin@ximian.com>
4288 * expression.cs (Invocation.InferType): Moved the type inference
4289 implementation into TypeManager.
4291 * generics.cs (TypeManager): Moved the type inference
4292 implementation here.
4294 2004-12-09 Martin Baulig <martin@ximian.com>
4296 * typemanager.cs (TypeManager): Make this a partial class.
4299 (TypeManager): Move the generics part of `TypeManager' here.
4301 2004-12-08 Martin Baulig <martin@ximian.com>
4303 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4304 instead of a CS3002 for properties and indexer. Added CS3024
4305 check for generic interfaces.
4307 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
4308 instances are not CLS-compliant.
4310 2004-12-08 Martin Baulig <martin@ximian.com>
4313 (void_pointer_expression): New rule for `void*', `void**' etc.
4314 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
4316 2004-12-08 Martin Baulig <martin@ximian.com>
4318 * expression.cs (Invocation.InferType): Removed the hack for
4319 MethodCore.MayUnify().
4321 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4324 * class.cs (MethodCore.MayUnify): Use
4325 TypeManager.MayBecomeEqualGenericTypes().
4327 2004-12-08 Martin Baulig <martin@ximian.com>
4329 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
4330 parameter, box it. Fixes #69233.
4332 2004-12-08 Martin Baulig <martin@ximian.com>
4334 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
4335 have the ctor constraint. Fixes #68326.
4337 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4339 * cs-parser.jay : interface comment was not consumed because of
4340 extra opt_semicolon before doc handling.
4342 2004-12-03 Raja R Harinath <rharinath@novell.com>
4344 Fix test-327.cs, test-328.cs, and put in early infrastructure
4345 for eventually fixing #52697.
4346 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4347 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4349 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4350 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4351 (VerifyUsing, error246): Update.
4352 * rootcontext.cs (RootContext.NamespaceLookup): Just use
4353 'NamespaceEntry.LookupNamespaceOrType'.
4355 2004-12-07 Martin Baulig <martin@ximian.com>
4357 * driver.cs: Call it "BETA SOFTWARE" :-)
4359 2004-12-06 Raja R Harinath <rharinath@novell.com>
4361 Fix crash on cs0657-17.cs.
4362 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4363 Use RootContext.Tree.Types, not 'new RootTypes ()'.
4364 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4365 the case where the NamespaceEntry gets overwritten.
4367 2004-12-06 Marek Safar <marek.safar@seznam.cz>
4369 Fixed #69195, #56821
4370 * ecore.cs (ResolveBoolean): Tiny refactoring.
4372 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4373 of right expression resolving when left is false constant and
4374 operator is LogicalAnd OR true constant and operator is LogicalOr.
4376 * statement.cs (ResolveUnreachable): Always reports warning.
4378 2004-12-05 Miguel de Icaza <miguel@ximian.com>
4380 * class.cs: Distinguish between 1721 and 1722 (just a little help
4381 for the programmer).
4383 2004-12-03 Miguel de Icaza <miguel@ximian.com>
4385 * delegate.cs: Only allow this on new versions of the language.
4387 2004-12-02 Duncan Mak <duncan@ximian.com>
4389 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4391 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4392 here as a static method. Take an additional bool out parameter
4393 `must_do_cs1540_check' for signaling to InstanceResolve.
4394 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4395 member field from PropertyExpr class and made it an argument of
4397 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4398 check for MarshalByRefObject, and report CS0122 instead of CS1540.
4399 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4400 and `remove_accessor' as well as InstanceResolve: report CS0122
4405 2004-12-07 Martin Baulig <martin@ximian.com>
4407 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
4408 and CS0692 where appropriate.
4410 2004-12-06 Martin Baulig <martin@ximian.com>
4412 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
4413 IsDuplicateImplementation() and improved it.
4415 * expression.cs (Invocation.InferTypeArguments): Added
4416 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
4417 and removed the "ref" modifier from `infered_types'.
4419 * decl.cs (MemberName.ToString): Removed the exception.
4421 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
4423 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4424 comments are allowed.
4426 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4428 * delegate.cs: Add checks for subtypes in paramaters and return values
4429 in VerifyMethod () to add support for Covariance/Contravariance
4432 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4434 * report.cs: Remove extra closing parenthesis.
4436 * convert.cs (Error_CannotImplicitConversion): If the name of the
4437 types are the same, provide some extra information.
4439 2004-12-02 Marek Safar <marek.safar@seznam.cz>
4442 * attribute.cs (Resolve): Improved implementation of params
4443 attribute arguments.
4445 * support.cs (ParameterData): Add HasParams to be faster.
4447 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
4449 all things are for /doc support:
4451 * doc.cs: new file that supports XML documentation generation.
4452 * mcs.exe.sources: added doc.cs.
4454 Handle /doc command line option.
4455 Report error 2006 instead of 5 for missing file name for /doc.
4456 Generate XML documentation when required, after type resolution.
4458 Added support for picking up documentation (/// and /** ... */),
4459 including a new XmlCommentState enumeration.
4461 Added lines to fill Documentation element for field, constant,
4462 property, indexer, method, constructor, destructor, operator, event
4463 and class, struct, interface, delegate, enum.
4464 Added lines to warn incorrect comment.
4466 Added Documentation field (passed only when /doc was specified).
4468 Added DocComment, DocCommentHeader, GenerateDocComment() and
4469 OnGenerateDocComment() and some supporting private members for
4470 /doc feature to MemberCore.
4472 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4474 Added overriden DocCommentHeader.
4476 Added overriden DocCommentHeader and GenerateDocComment().
4478 2004-12-01 Miguel de Icaza <miguel@ximian.com>
4480 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4481 unwrapping the enumeration values, chain to
4482 DoConstantNumericPromotions again, so we can promote things to the
4483 fundamental types (takes care of enums that are bytes, sbytes).
4487 2004-12-01 Raja R Harinath <rharinath@novell.com>
4489 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4490 Fix long-standing bug in type-lookup. Use FindType instead of
4491 LookupType when ec.ResolvingTypeTree.
4492 (Attribute.ResolveType, Attribute.Resolve)
4493 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4495 (Attributes.Search): Remove internal version. Update.
4496 (Attributes.SearchMulti): Update.
4497 (Attributes.GetClsCompliantAttribute): Remove.
4498 (Attributes.GetIndexerNameAttribute): Remove.
4499 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4500 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4501 * class.cs (Indexer.Define): Likewise.
4503 2004-12-01 Marek Safar <marek.safar@seznam.cz>
4506 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4507 MarshallByReference members access.
4509 * expression.cs: Use CheckMarshallByRefAccess;
4510 Better error CS0197 message.
4512 * report.cs: Print whole related error message.
4514 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4516 * class (GetClassBases): Better error 60 report.
4517 (EventProperty): Disabled warning 67 detection.
4519 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4522 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4524 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4527 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4530 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4532 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4534 2004-11-26 Miguel de Icaza <miguel@ximian.com>
4536 * attribute.cs (Attribute.Resolve): Refine error reporting and
4537 report a cs0117 if the identifier does not exist, to distinguish
4538 from 0617 which is a miss-use of the actual identifier.
4540 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4541 between cs0070 and cs0079.
4543 * class.cs (MemberBase.DoDefine): When reporting a wrong
4544 accessibility level, we use MethodCore to compare instead of
4545 Method (this was a regression in some refactoring effort).
4547 So now we correctly report cs0056 again.
4549 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4550 testing the target_type (which was known to be object_type) and
4551 not the source type (which is anonymous_method).
4553 Fixed reporting of error cs1660.
4555 * expression.cs (UserCast.Source): Expose the underlying cast.
4557 * statement.cs (Switch.SwitchGoverningType): Sort the list of
4558 allowed types to find a match to int32 first (most common).
4560 In addition, it ignores any ImplicitUserConversions that did an
4561 internal implicit conversion (as the switch statement allows only
4562 one integral conversion to exist).
4564 * class.cs (PartialContainer.Create): rename `name' to
4565 `member_name' for clarity. Then replace the string calls with a
4566 call to MemberName.GetPartialName, as now using
4567 MemberName.ToString is an error (this is due to the side effects
4568 it had, that were fixed in the past).
4570 This will restore the error reporting on a number of partial class
4571 errors that were missusing this (and getting an exception as a
4572 results, which is now just a plain textual warning, because
4573 yyparse debug output would crash otherwise).
4575 2004-11-26 Raja R Harinath <rharinath@novell.com>
4577 * Makefile (PROGRAM_INSTALL_DIR): Remove.
4579 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4581 * rootcontext.cs (LookupType): Make sure to cache lookups that
4582 don't give us a negative result. This saves about 5% of corlib
4585 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4587 * report.cs (AbstractMessage.Print): messages are sent to stderr
4589 * class.cs (TypeContainer.GetClassBases): It is an error to have a
4590 non-interface in the list of interfaces (at this point, either
4591 parent was properly set, or a base class is being listed in the
4592 interfaces section).
4594 This flags error 1722, and resolves the crash from bug 69259.
4596 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4598 * statement.cs (Using.EmitExpressionFinally): make this work right
4599 for valuetypes. Fixes 69926.
4601 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4603 * const.cs (Const.ChangeType): Cope with the "0 literal can be
4604 converted to an enum" here, before we try to change the underlying
4605 type. This code exists, but it is a different code path than the
4606 one used while encoding constants.
4608 (ImplicitReferenceConversionExists): In addition, resynchronized
4609 the code here, so it matches the same code in
4610 ImplicitReferenceConversionExists for the `from any class-type S
4611 to any interface-type T'.
4613 2004-11-25 Marek Safar <marek.safar@seznam.cz>
4615 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4617 2004-11-24 Miguel de Icaza <miguel@ximian.com>
4619 * cs-parser.jay: Use verbosity accordingly.
4621 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4623 * expression.cs (Unary.ResolveOperator): Do not report warning;
4624 AddressOf reads from variable.
4626 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4628 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4632 * attribute.cs (Attributable): Removed CheckTargets.
4633 (Attributes.Emit): Explicit attribute targets are tested here.
4635 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4636 not enabled for interfaces.
4638 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4639 (GetAssemblyName): Ouch next bug there.
4641 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4643 * expression.cs: Error 275 added.
4645 2004-11-23 Marek Safar <marek.safar@seznam.cz>
4647 Fix bug #69177 (Implemented decimal constant support)
4649 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4650 (BinaryFold): Add DecimalConstant.
4652 * const.cs (Define): Decimal constant
4654 (ChangeType): Add decimal type handling.
4655 (LookupConstantValue): Don't set value for decimal type but
4656 emit DecimalConstantAttribute. Needed for constant optimization.
4658 * constant.cs (ToDecimal): New method.
4659 (ConvertToDecimal): New method.
4660 (IntConstant): Implemented ConvertToDecimal.
4661 (DecimalConstant.Emit): Emit optimized version for decimals in
4664 * expression.cs (ResolveOperator): Changed order of constant
4665 reduction to work correctly with native types which have
4666 overloaded operators.
4667 (ResolveMemberAccess): Extract constant value from attribute
4670 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4672 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4673 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4674 (ChangeType): Decimal is special.
4675 (TypeToCoreType): Add decimal type.
4677 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4679 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4682 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4684 * class.cs (EventField.ApplyAttributeBuilder): Fix error
4687 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4689 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4691 * pending.cs (PendingImplementation): Grab only interfaces.
4693 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4695 * statement.cs (ForeachHelperMethods): Add location member and
4696 error 202 detection.
4698 2004-11-18 Marek Safar <marek.safar@seznam.cz>
4700 * expression.cs (DoResolveBase): Fixed wrong warning for out
4703 2004-12-04 Martin Baulig <martin@ximian.com>
4705 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4706 to check whether the conversion is ok.
4708 * typemanager.cs (TypeManager.GetTypeArguments): Just return
4709 `Type.EmptyTypes' if we're not a generic TypeContainer.
4711 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4713 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4714 old bug: when converting from the null literal to a pointer,
4715 return an EmptyCast, not the NullLiteral.
4717 This fixes #69921, the recent null_type changes probably made this
4720 2004-12-03 Martin Baulig <martin@ximian.com>
4722 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4723 method as our child, call AnonymousMethod.Compatible() on it.
4725 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4727 * class.cs (FieldBase): Use an unused bit field from the field to
4728 encode the `has_offset' property from the FieldMember. This saves
4729 a couple of Ks on bootstrap compilation.
4731 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4732 method as our child, return the AnonymousMethod resolved
4735 * expression.cs (New.DoResolve): Allow return values from
4736 NewDelegate to also include AnonymousMethods.
4740 2004-11-29 Raja R Harinath <rharinath@novell.com>
4742 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4744 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4745 System.Runtime.InteropServices._Exception, since it's a base
4746 interface of the core type System.Exception in the net_2_0 profile.
4748 2004-11-27 Martin Baulig <martin@ximian.com>
4750 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4752 2004-11-26 Raja R Harinath <rharinath@novell.com>
4754 * Makefile: Convert to use executable.make.
4755 * gmcs.exe.sources: New.
4757 2004-11-25 Martin Baulig <martin@ximian.com>
4759 * expression.cs (Invocation.InferType): Added support for byref types.
4761 2004-11-25 Martin Baulig <martin@ximian.com>
4763 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4764 in TypeManager.TypeToCoreType().
4766 2004-11-25 Martin Baulig <martin@ximian.com>
4768 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4769 "Dispose" method from the `current_type'.
4770 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4771 DoDefineMembers() instead of using the MethodBuilder; this is
4772 required for generic iterators.
4774 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4776 2004-11-24 Martin Baulig <martin@ximian.com>
4778 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4780 2004-11-20 Martin Baulig <martin@ximian.com>
4782 * expression.cs (Invocation.InferType): Correctly infer generic
4783 instances; see gen-103.cs.
4784 (Invocation.InferTypeArguments): If a generic method doesn't have
4785 any unbound type parameters, we don't need to infer anything.
4787 2004-11-19 Raja R Harinath <rharinath@novell.com>
4789 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4791 2004-11-17 Raja R Harinath <rharinath@novell.com>
4793 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4794 (TypeHandle.GetMemberCache): New.
4795 (TypeHandle.TypeHandle): Update.
4796 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4797 (TypeManager.LookupParentInterfacesCache):
4798 Rename from LookupInterfaceCache. Optimize slightly.
4799 (TypeManager.MemberLookup_FindMembers): Update.
4800 * decl.cs (MemberCache.MemberCache): Set Container to null in the
4802 (AddCacheContents): Rename from AddHashtable.
4803 * class.cs (TypeContainer.parent_container): Remove.
4804 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4805 (TypeContainer.DoDefineMembers): Don't initialize it.
4806 Update to name changes.
4808 2004-11-17 Miguel de Icaza <miguel@ximian.com>
4810 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4811 that factors the code to check access modifiers on override.
4813 (PropertyBase): Use the code here.
4815 Patch from Lluis S'anchez, fixes bug #69361.
4817 2004-11-15 Miguel de Icaza <miguel@ximian.com>
4819 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4820 routine that is used to report the use of a captured variable
4821 whose address has been taken.
4823 There are two checks: one when variables are being captured and
4824 the other check is when the address of a variable is taken.
4826 (because an anonymous methods might be resolved before *or* after
4827 the address has been taken) and
4829 * expression.cs (Conditional.DoResolve): Remove the special
4830 casing that Martin added to trueExpr and falseExpr being both
4831 NullLiteral. We get the right behavior now just by introducing
4832 the null_type into the compiler.
4834 * convert.cs (ExplicitConversion): Change the code to use
4835 null_type instead of testing `expr is NullLiteral'.
4836 (ImplicitConversionStandard): use null_type too.
4837 (ImplicitReferenceConversionExists): use null_type too.
4838 (ImplicitReferenceConversion): use null_type too.
4840 * literal.cs: The type of `NullLiteral' is now null_type instead
4842 (Resolve): Set the type here.
4844 * typemanager.cs: Introduce null_type.
4846 2004-11-18 Martin Baulig <martin@ximian.com>
4849 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
4851 2004-11-18 Martin Baulig <martin@ximian.com>
4853 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
4855 2004-11-18 Martin Baulig <martin@ximian.com>
4857 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
4858 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
4859 call ResolveConstructedType() on it to resolve it without checking
4861 (Constraints.ResolveTypes): Check them here.
4862 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
4863 but don't check constraints.
4864 (ConstructedType.ResolveAsTypeTerminal): Override this and also
4865 check constraints here.
4866 (ConstructedType.ResolveConstructedType): New public method. This
4867 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
4868 resolve ourselves without checking constraints.
4870 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
4872 2004-11-18 Martin Baulig <martin@ximian.com>
4875 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
4877 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
4879 2004-11-18 Martin Baulig <martin@ximian.com>
4881 * ecore.cs (TypeExpr.ResolveType): Removed.
4882 (Expression.ResolveAsTypeTerminal): We always return a fully
4883 resolved `TypeExpr', so we can just access its `Type'.
4885 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
4887 2004-11-17 Martin Baulig <martin@ximian.com>
4889 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
4890 sure we don't return any unresolved TypeExpr's.
4891 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
4893 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
4895 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
4896 unresolved `ConstructedType's.
4898 2004-11-17 Martin Baulig <martin@ximian.com>
4900 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
4902 2004-11-17 Martin Baulig <martin@ximian.com>
4905 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
4907 * decl.cs (DeclSpace.ResolveType): Removed.
4908 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
4910 2004-11-17 Martin Baulig <martin@ximian.com>
4912 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4913 direction, like FindMembers() does. Fixes #69546, testcase is in
4916 2004-11-16 Martin Baulig <martin@ximian.com>
4918 This is based on a patch from Marek Safar, see bug #69082.
4919 Fixes bugs #63705 and #67130.
4921 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4922 method; create a MemberCache for an interface type and cache the
4925 * decl.cs (IMemberContainer.ParentContainer): Removed.
4926 (IMemberContainer.ParentCache): New property.
4927 (MemberCache.SetupCacheForInterface): Removed.
4928 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4929 to create a cache for an interface's "parent".
4931 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4934 2004-11-14 Ben Maurer <bmaurer@ximian.com>
4936 * statement.cs: Avoid adding bools to a hashtable.
4938 2004-11-15 Martin Baulig <martin@ximian.com>
4940 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
4942 2004-11-11 Martin Baulig <martin@ximian.com>
4944 * typemanager.cs (TypeManager.GetMethodName): New method.
4946 * class.cs (MethodData.Define): Include the generic arity in the
4947 name of an explicit interface; also add it to the method name.
4949 * pending.cs (PendingImplementation.InterfaceMethod): The method
4950 name now includes the generic arity.
4952 2004-11-07 Miguel de Icaza <miguel@ximian.com>
4954 * expression.cs (Invocation.OverloadResolve): Flag error if we are
4955 calling an unsafe method from a safe location.
4957 2004-11-06 Marek Safar <marek.safar@seznam.cz>
4960 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4962 2004-11-06 Miguel de Icaza <miguel@ximian.com>
4964 * namespace.cs (VerifyUsing): use GetPartialName instead of
4967 2004-11-05 Miguel de Icaza <miguel@ximian.com>
4969 * statement.cs (Return.Resolve): Fix regression in typo: if
4970 `in_exc', we have to request a NeedReturnLabel, this was a typo
4971 introduced in the anonymous method check-in. Fixes #69131.
4973 * Indexers were using the ShortName when defining themselves,
4974 causing a regression in the compiler bootstrap when applying the
4975 patch from 2004-11-02 (first part), now they use their full name
4976 and the bug is gone.
4978 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
4980 * driver.cs: Strip the path from the names of embedded resources. Fixes
4983 2004-11-04 Raja R Harinath <rharinath@novell.com>
4985 Fix error message regression: cs0104-2.cs.
4986 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4987 (AliasEntry.Resolve): Update.
4988 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
4990 (RootContext.LookupType): Update.
4992 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
4994 * cs-parser.jay: Add support for handling accessor modifiers
4995 * class: Add support port accessor modifiers and error checking,
4996 define PropertyMethod.Define as virtual (not abstract anymore)
4997 * ecore.cs: Add checking for proeprties access with access modifiers
4998 * iterators.cs: Modify Accessor constructor call based in the modified
5000 2004-11-02 Ben Maurer <bmaurer@ximian.com>
5002 * expression.cs (StringConcat): Handle being called twice,
5003 as when we have a concat in a field init with more than two
5006 2004-11-02 Miguel de Icaza <miguel@ximian.com>
5008 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5009 special case explicit implementations, we should always produce
5010 the .property or .event declaration.
5012 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5013 since it will not return correct data if people use this
5014 unresolved in the presence of using statements (see test-313).
5016 * class.cs (MethodData.Define): If we are an explicit interface
5017 implementation, set the method name to the full name of the
5018 interface plus the name of the method.
5020 Notice that using the method.MethodName.GetFullName() does not
5021 work, as it will only contain the name as declared on the source
5022 file (it can be a shorthand in the presence of using statements)
5023 and not the fully qualifed type name, for example:
5027 class D : ICloneable {
5028 object ICloneable.Clone () {
5032 Would produce a method called `ICloneable.Clone' instead of
5033 `System.ICloneable.Clone'.
5035 * namespace.cs (Alias.Resolve): Use GetPartialName.
5037 2004-11-01 Marek Safar <marek.safar@seznam.cz>
5039 * cs-parser.jay: Add error 1055 report.
5041 2004-11-01 Miguel de Icaza <miguel@ximian.com>
5043 * assign.cs (Assign.DoResolve): Only do the transform of
5044 assignment into a New if the types are compatible, if not, fall
5045 through and let the implicit code deal with the errors and with
5046 the necessary conversions.
5048 2004-11-01 Marek Safar <marek.safar@seznam.cz>
5050 * cs-parser.jay: Add error 1031 report.
5052 * cs-tokenizer.cs: Add location for error 1038.
5054 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5056 * cs-parser.jay: Add error 1016 report.
5058 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5060 * cs-parser.jay: Add errors 1575,1611 report.
5062 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5064 * cs-parser.jay: Add error 1001 report.
5066 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5069 * attribute.cs (GetMarshal): Add method argument for
5070 caller identification.
5072 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5073 agument for GetMarshal and RuntimeMissingSupport.
5075 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5077 * attribute.cs (ExtractSecurityPermissionSet): Removed
5078 TypeManager.code_access_permission_type.
5080 * typemanager.cs: Removed TypeManager.code_access_permission_type.
5082 2004-10-27 Miguel de Icaza <miguel@ximian.com>
5084 * expression.cs (LocalVariableReference.DoResolveLValue): Check
5085 for obsolete use of a variable here. Fixes regression on errors
5086 cs0619-25 and cs0619-26.
5088 2004-10-27 Marek Safar <marek.safar@seznam.cz>
5090 Fix #62358, implemented security attribute encoding.
5092 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5093 Tests permitted SecurityAction for assembly or other types.
5094 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5095 data from SecurityPermissionAttribute to PermisionSet class.
5097 * class.cs (ApplyAttributeBuilder): Added special handling
5098 for System.Security.Permissions.SecurityAttribute based types.
5100 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5101 special handling for System.Security.Permissions.SecurityAttribute
5104 * enum.cs (ApplyAttributeBuilder): Added special handling
5105 for System.Security.Permissions.SecurityAttribute based types.
5107 * parameter.cs (ApplyAttributeBuilder): Added special handling
5108 for System.Security.Permissions.SecurityAttribute based types.
5110 * rootcontext.cs: Next 2 core types.
5112 * typemanager.cs (TypeManager.security_permission_attr_type):
5113 Built in type for the SecurityPermission Attribute.
5114 (code_access_permission_type): Build in type.
5116 2004-10-17 Miguel de Icaza <miguel@ximian.com>
5118 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5119 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5120 all of this information into
5121 EmitContext.EmitCapturedVariableInstance.
5123 * codegen.cs (EmitCapturedVariableInstance): move here the
5124 funcionality of emitting an ldarg.0 in the presence of a
5125 remapping. This centralizes the instance emit code.
5127 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5128 then emit a load of this: it means that we have reached the
5129 topmost ScopeInfo: the one that contains the pointer to the
5130 instance of the class hosting the anonymous method.
5132 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5133 captures to the topmost CaptureContext.
5135 2004-10-12 Miguel de Icaza <miguel@ximian.com>
5137 * expression.cs (LocalVariableReference): Move the knowledge about
5138 the iterators into codegen's EmitCapturedVariableInstance.
5140 2004-10-11 Miguel de Icaza <miguel@ximian.com>
5142 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5143 all code paths return a value from an anonymous method (it is the
5144 same as the 161 error, but for anonymous methods).
5146 2004-10-08 Miguel de Icaza <miguel@ximian.com>
5148 The introduction of anonymous methods in the compiler changed
5149 various ways of doing things in the compiler. The most
5150 significant one is the hard split between the resolution phase
5151 and the emission phases of the compiler.
5153 For instance, routines that referenced local variables no
5154 longer can safely create temporary variables during the
5155 resolution phase: they must do so from the emission phase,
5156 since the variable might have been "captured", hence access to
5157 it can not be done with the local-variable operations from the runtime.
5161 (Block.Flags): New flag `IsTopLevel' to indicate that this block
5162 is a toplevel block.
5164 (ToplevelBlock): A new kind of Block, these are the blocks that
5165 are created by the parser for all toplevel method bodies. These
5166 include methods, accessors and anonymous methods.
5168 These contain some extra information not found in regular blocks:
5169 A pointer to an optional CaptureContext (for tracking captured
5170 local variables and parameters). A pointer to the parent
5173 (Return.Resolve): Catch missmatches when returning a value from an
5174 anonymous method (error 1662).
5175 Invoke NeedReturnLabel from the Resolve phase instead of the emit
5178 (Break.Resolve): ditto.
5180 (SwitchLabel): instead of defining the labels during the
5181 resolution phase, we now turned the public ILLabel and ILLabelCode
5182 labels into methods called GetILLabelCode() and GetILLabel() that
5183 only define the label during the Emit phase.
5185 (GotoCase): Track the SwitchLabel instead of the computed label
5186 (its contained therein). Emit the code by using
5187 SwitchLabel.GetILLabelCode ().
5189 (LocalInfo.Flags.Captured): A new flag has been introduce to track
5190 whether the Local has been captured or not.
5192 (LocalInfo.IsCaptured): New property, used to tell whether the
5193 local has been captured.
5195 * anonymous.cs: Vastly updated to contain the anonymous method
5198 The main classes here are: CaptureContext which tracks any
5199 captured information for a toplevel block and ScopeInfo used to
5200 track the activation frames for various local variables.
5202 Each toplevel block has an optional capture context associated
5203 with it. When a method contains an anonymous method both the
5204 toplevel method and the anonymous method will create a capture
5205 context. When variables or parameters are captured, they are
5206 recorded on the CaptureContext that owns them, for example:
5210 MyDelegate d = delegate {
5215 Here `a' will be recorded as captured on the toplevel
5216 CapturedContext, the inner captured context will not have anything
5217 (it will only have data if local variables or parameters from it
5218 are captured in a nested anonymous method.
5220 The ScopeInfo is used to track the activation frames for local
5221 variables, for example:
5223 for (int i = 0; i < 10; i++)
5224 for (int j = 0; j < 10; j++){
5225 MyDelegate d = delegate {
5230 At runtime this captures a single captured variable `i', but it
5231 captures 10 different versions of the variable `j'. The variable
5232 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5233 recorded on a child.
5235 The toplevel ScopeInfo will also track information like the `this'
5236 pointer if instance variables were referenced (this is necessary
5237 as the anonymous method lives inside a nested class in the host
5238 type of the method).
5240 (AnonymousMethod): Expanded to track the Toplevel, implement
5241 `AnonymousMethod.Compatible' to tell whether an anonymous method
5242 can be converted to a target delegate type.
5244 The routine now also produces the anonymous method content
5246 (AnonymousDelegate): A helper class that derives from
5247 DelegateCreation, this is used to generate the code necessary to
5248 produce the delegate for the anonymous method that was created.
5250 * assign.cs: API adjustments for new changes in
5251 Convert.ImplicitStandardConversionExists.
5253 * class.cs: Adjustments to cope with the fact that now toplevel
5254 blocks are of type `ToplevelBlock'.
5256 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5257 insteda of standard blocks.
5259 Flag errors if params arguments are passed to anonymous methods.
5261 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5262 `CurrentAnonymousMethod' which points to the current Anonymous
5263 Method. The variable points to the AnonymousMethod class that
5264 holds the code being compiled. It is set in the new EmitContext
5265 created for the anonymous method.
5267 (EmitContext.Phase): Introduce a variable and an enumeration to
5268 assist in enforcing some rules about when and where we are allowed
5269 to invoke certain methods (EmitContext.NeedsReturnLabel is the
5270 only one that enfonces this right now).
5272 (EmitContext.HaveCaptureInfo): new helper method that returns
5273 whether we have a CapturedContext initialized.
5275 (EmitContext.CaptureVariable): New method used to register that a
5276 LocalInfo must be flagged for capturing.
5278 (EmitContext.CapturedParameter): New method used to register that a
5279 parameters must be flagged for capturing.
5281 (EmitContext.CapturedField): New method used to register that a
5282 field must be flagged for capturing.
5284 (EmitContext.HaveCapturedVariables,
5285 EmitContext.HaveCapturedFields): Return whether there are captured
5286 variables or fields.
5288 (EmitContext.EmitMethodHostInstance): This is used to emit the
5289 instance for the anonymous method. The instance might be null
5290 (static methods), this (for anonymous methods that capture nothing
5291 and happen to live side-by-side with the current method body) or a
5292 more complicated expression if the method has a CaptureContext.
5294 (EmitContext.EmitTopBlock): Routine that drives the emission of
5295 code: it will first resolve the top block, then emit any metadata
5296 and then emit the code. The split is done so that we can extract
5297 any anonymous methods and flag any captured variables/parameters.
5299 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5300 during this phase, the ILGenerator should not be used as labels
5301 and local variables declared here might not be accessible to any
5302 code that is part of an anonymous method.
5304 Exceptions to this include the temporary variables that are
5305 created by some statements internally for holding temporary
5308 (EmitContext.EmitMeta): New routine, in charge of emitting all the
5311 (EmitContext.TemporaryReturn): This method is typically called
5312 from the Emit phase, and its the only place where we allow the
5313 ReturnLabel to be defined other than the EmitMeta. The reason is
5314 that otherwise we would have to duplicate a lot of logic in the
5315 Resolve phases of various methods that today is on the Emit
5318 (EmitContext.NeedReturnLabel): This no longer creates the label,
5319 as the ILGenerator is not valid during the resolve phase.
5321 (EmitContext.EmitThis): Extended the knowledge in this class to
5322 work in anonymous methods in addition to iterators.
5324 (EmitContext.EmitCapturedVariableInstance): This emits whatever
5325 code is necessary on the stack to access the instance to a local
5326 variable (the variable will be accessed as a field).
5328 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5329 EmitContext.EmitAddressOfParameter): Routines to support
5330 parameters (not completed at this point).
5332 Removals: Removed RemapLocal and RemapLocalLValue. We probably
5333 will also remove the parameters.
5335 * convert.cs (Convert): Define a `ConstantEC' which points to a
5336 null. This is just to prefity some code that uses
5337 ImplicitStandardConversion code and do not have an EmitContext
5340 The idea is to flag explicitly that at that point in time, it is
5341 known that the conversion will not trigger the delegate checking
5342 code in implicit conversions (which requires a valid
5345 Everywhere: pass new EmitContext parameter since
5346 ImplicitStandardConversionExists now requires it to check for
5347 anonymous method conversions.
5349 (Convert.ImplicitStandardConversionExists): If the type of an
5350 expression is the anonymous_method_type, and the type is a
5351 delegate, we invoke the AnonymousMethod.Compatible method to check
5352 whether an implicit conversion is possible.
5354 (Convert.ImplicitConversionStandard): Only do implicit method
5355 group conversions if the language level is not ISO_1.
5357 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5358 MethodInfo for the Invoke method. used by Delegate and
5361 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5362 method conversions if the target type is a delegate.
5364 Removed extra debugging nops.
5366 (LocalVariableReference): Turn the `local_info' into a public
5369 Add `prepared' field, the same hack used for FieldExprs to cope
5370 with composed assignments, as Local variables do not necessarily
5371 operate purely on the stack as they used to: they can be captured
5374 Add `temp' for a temporary result, like fields.
5376 Refactor DoResolve and DoResolveLValue into DoResolveBase.
5378 It now copes with Local variables that are captured and emits the
5379 proper instance variable to load it from a field in the captured
5382 (ParameterReference.DoResolveBase): During the resolve phase,
5383 capture parameters if we are in an anonymous method.
5385 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5386 anonymous method, use the EmitContext helper routines to emit the
5387 parameter reference.
5389 * iterators.cs: Set RemapToProxy to true/false during the
5392 * parameters.cs (GetParameterByName): New helper method.
5394 * typemanager.cs (anonymous_method_type) a new type that
5395 represents an anonyous method. This is always an internal type,
5396 used as a fencepost to test against the anonymous-methodness of an
5399 2004-10-20 Marek Safar <marek.safar@seznam.cz>
5401 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5403 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5405 2004-11-10 Martin Baulig <martin@ximian.com>
5407 * expression.cs (Invocation.BetterFunction): If two methods have
5408 equal parameter types, but only one of them is generic, the
5409 non-generic one wins.
5410 (New.DoResolve): Don't set `is_struct' to false if we're a generic
5411 instance; just use `Type.IsValueType' to determine whether
5412 something is a struct or not.
5413 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
5414 so we can be called multiple times.
5416 2004-11-10 Martin Baulig <martin@ximian.com>
5418 * generic.cs (TypeParameter.DefineConstraints): New public method.
5419 (TypeParameter.CheckAccessLevel): Override this and return true.
5420 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
5421 override ResolveType() anymore.
5422 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
5424 2004-11-10 Martin Baulig <martin@ximian.com>
5426 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
5427 call DeclSpace.ResolveNestedType() on it.
5429 2004-11-10 Martin Baulig <martin@ximian.com>
5431 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
5432 non-null, call ParameterModifier() on it.
5434 2004-11-10 Martin Baulig <martin@ximian.com>
5437 (Iterators): Added `current_type' and `this_type' fields.
5438 (Iterators.DefineIterator): Create a new EmitContext and store it
5439 in `ec'; compute `this_type'.
5441 2004-11-10 Martin Baulig <martin@ximian.com>
5444 (TypeManager.IsPrivateAccessible): New public method.
5445 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
5447 2004-11-10 Martin Baulig <martin@ximian.com>
5449 * class.cs (TypeContainer.DefineType): Call
5450 TypeBuilder.DefineGenericParameters() before resolving the type
5452 (MethodData.parent_method): New protected field.
5453 (MethodData..ctor): Added `MethodInfo parent_method' argument.
5454 (MethodData.Define): Compute `parent_method'.
5457 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5458 (MemberCore.GetClsCompliantAttributeValue): Likewise.
5459 (DeclSpace.ec): New protected field; store the EmitContext here.
5460 (DeclSpace.EmitContext): New public property.
5461 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
5462 (DeclSpace.ResolveNestedType): New public method.
5463 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
5464 (DeclSpace.NestedAccessible): Added `Type tb' argument.
5465 (DeclSpace.FamilyAccessible): Likewise.
5466 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
5467 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5470 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
5473 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5474 (Enum.Emit): Don't create a new EmitContext.
5476 2004-10-18 Martin Baulig <martin@ximian.com>
5478 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5479 `Type' directly, but call ResolveType() on it.
5480 (Catch.Resolve): Likewise.
5481 (Foreach.Resolve): Likewise.
5483 2004-10-18 Martin Baulig <martin@ximian.com>
5485 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5486 `Type' directly, but call ResolveType() on it.
5487 (Probe.DoResolve): Likewise.
5488 (ArrayCreation.LookupType): Likewise.
5489 (TypeOf.DoResolve): Likewise.
5490 (SizeOf.DoResolve): Likewise.
5492 2004-10-18 Raja R Harinath <rharinath@novell.com>
5494 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5497 2004-10-17 John Luke <john.luke@gmail.com>
5499 * class.cs (Operator.GetSignatureForError): use CSharpName
5501 * parameter.cs (Parameter.GetSignatureForError): Returns
5502 correct name even if was not defined.
5504 2004-10-13 Raja R Harinath <rharinath@novell.com>
5507 * class.cs (TypeContainer.EmitContext): New property.
5508 (DefineNestedTypes): Create an emitcontext for each part.
5509 (MethodCore.DoDefineParameters): Use container's emitcontext.
5510 Pass type array to InternalParameters.
5511 (MemberBase.DoDefine): Use container's emitcontext.
5512 (FieldMember.Define): Likewise.
5513 (Event.Define): Likewise.
5514 (SetMethod.GetParameterInfo): Change argument to EmitContext.
5515 Pass type array to InternalParameters.
5516 (SetIndexerMethod.GetParameterInfo): Likewise.
5517 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5518 * delegate.cs (Define): Pass emitcontext to
5519 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
5520 array to InternalParameters.
5521 * expression.cs (ParameterReference.DoResolveBase): Pass
5522 emitcontext to GetParameterInfo.
5523 (ComposedCast.DoResolveAsTypeStep): Remove check on
5524 ec.ResolvingTypeTree.
5525 * parameter.cs (Parameter.Resolve): Change argument to
5526 EmitContext. Use ResolveAsTypeTerminal.
5527 (Parameter.GetSignature): Change argument to EmitContext.
5528 (Parameters.ComputeSignature): Likewise.
5529 (Parameters.ComputeParameterTypes): Likewise.
5530 (Parameters.GetParameterInfo): Likewise.
5531 (Parameters.ComputeAndDefineParameterTypes): Likewise.
5532 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
5533 * support.cs (InternalParameters..ctor): Remove variant that takes
5535 * typemanager.cs (system_intptr_expr): New.
5536 (InitExpressionTypes): Initialize it.
5538 2004-10-12 Chris Toshok <toshok@ximian.com>
5540 * cs-parser.jay: fix location for try_statement and catch_clause.
5542 2004-10-18 Martin Baulig <martin@ximian.com>
5544 * class.cs (FieldMember.Define): Don't access the TypeExpr's
5545 `Type' directly, but call ResolveType() on it.
5546 (MemberBase.DoDefine): Likewise.
5548 * expression.cs (New.DoResolve): Don't access the TypeExpr's
5549 `Type' directly, but call ResolveType() on it.
5550 (ComposedCast.DoResolveAsTypeStep): Likewise.
5552 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5553 `Type' directly, but call ResolveType() on it.
5555 2004-10-17 John Luke <john.luke@gmail.com>
5557 * class.cs (Operator.GetSignatureForError): use CSharpName
5559 * parameter.cs (Parameter.GetSignatureForError): Returns
5560 correct name even if was not defined.
5562 2004-10-13 Raja R Harinath <rharinath@novell.com>
5565 * class.cs (TypeContainer.EmitContext): New property.
5566 (DefineNestedTypes): Create an emitcontext for each part.
5567 (MethodCore.DoDefineParameters): Use container's emitcontext.
5568 Pass type array to InternalParameters.
5569 (MemberBase.DoDefine): Use container's emitcontext.
5570 (FieldMember.Define): Likewise.
5571 (Event.Define): Likewise.
5572 (SetMethod.GetParameterInfo): Change argument to EmitContext.
5573 Pass type array to InternalParameters.
5574 (SetIndexerMethod.GetParameterInfo): Likewise.
5575 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5576 * delegate.cs (Define): Pass emitcontext to
5577 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
5578 array to InternalParameters.
5579 * expression.cs (ParameterReference.DoResolveBase): Pass
5580 emitcontext to GetParameterInfo.
5581 (ComposedCast.DoResolveAsTypeStep): Remove check on
5582 ec.ResolvingTypeTree.
5583 * parameter.cs (Parameter.Resolve): Change argument to
5584 EmitContext. Use ResolveAsTypeTerminal.
5585 (Parameter.GetSignature): Change argument to EmitContext.
5586 (Parameters.ComputeSignature): Likewise.
5587 (Parameters.ComputeParameterTypes): Likewise.
5588 (Parameters.GetParameterInfo): Likewise.
5589 (Parameters.ComputeAndDefineParameterTypes): Likewise.
5590 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
5591 * support.cs (InternalParameters..ctor): Remove variant that takes
5593 * typemanager.cs (system_intptr_expr): New.
5594 (InitExpressionTypes): Initialize it.
5596 2004-10-12 Chris Toshok <toshok@ximian.com>
5598 * cs-parser.jay: fix location for try_statement and catch_clause.
5600 2004-10-07 Raja R Harinath <rharinath@novell.com>
5602 More DeclSpace.ResolveType avoidance.
5603 * decl.cs (MemberCore.InUnsafe): New property.
5604 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
5605 with newly created EmitContext.
5606 (FieldMember.Define): Likewise.
5607 * delegate.cs (Delegate.Define): Likewise.
5608 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5609 only if normal name-lookup fails.
5610 (TypeExpr.DoResolve): Enable error-checking.
5611 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5612 (SizeOf.DoResolve): Likewise.
5613 (ComposedCast.DoResolveAsTypeStep): Likewise.
5614 (StackAlloc.DoResolve): Likewise.
5615 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5616 (Block.Unsafe): New property.
5617 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5618 (Unsafe): Set 'unsafe' flag of contained block.
5619 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5620 (Fixed.Resolve): Likewise.
5621 (Catch.Resolve): Likewise.
5622 (Using.ResolveLocalVariableDecls): Likewise.
5623 (Foreach.Resolve): Likewise.
5625 2004-10-05 John Luke <john.luke@gmail.com>
5627 * cs-parser.jay: add location to error CS0175
5629 2004-10-04 Miguel de Icaza <miguel@ximian.com>
5631 * ecore.cs (Expression.Constantity): Add support for turning null
5634 * const.cs (Const.Define): Allow constants to be reference types
5635 as long as the value is Null.
5637 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
5639 * namespace.cs (NamespaceEntry.Using): No matter which warning
5640 level is set, check if this namespace name has already been added.
5642 2004-10-03 Ben Maurer <bmaurer@ximian.com>
5644 * expression.cs: reftype [!=]= null should always use br[true,false].
5647 2004-10-03 Marek Safar <marek.safar@seznam.cz>
5650 * attribute.cs: Enum conversion moved to
5651 GetAttributeArgumentExpression to be applied to the all
5654 2004-10-01 Raja R Harinath <rharinath@novell.com>
5656 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5657 * class.c (TypeContainer.DefineType): Flag error if
5658 base types aren't accessible due to access permissions.
5659 * decl.cs (DeclSpace.ResolveType): Move logic to
5660 Expression.ResolveAsTypeTerminal.
5661 (DeclSpace.ResolveTypeExpr): Thin layer over
5662 Expression.ResolveAsTypeTerminal.
5663 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5664 Refactor code into NestedAccess. Use it.
5665 (DeclSpace.NestedAccess): New.
5666 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5667 argument to silence errors. Check access permissions.
5668 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5669 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5670 (Cast.DoResolve): Likewise.
5671 (New.DoResolve): Likewise.
5672 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5673 (TypeOf.DoResolve): Likewise.
5675 * expression.cs (Invocation.BetterConversion): Return the Type of
5676 the better conversion. Implement section 14.4.2.3 more faithfully.
5677 (Invocation.BetterFunction): Make boolean. Make correspondence to
5678 section 14.4.2.2 explicit.
5679 (Invocation.OverloadResolve): Update.
5680 (Invocation): Remove is_base field.
5681 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
5682 (Invocation.Emit): Likewise.
5684 2004-09-24 Marek Safar <marek.safar@seznam.cz>
5686 * cs-parser.jay: Reverted 642 warning fix.
5688 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5691 * decl.cs (FindMemberWithSameName): Indexer can have more than
5694 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5696 * expression.cs (LocalVariableReference.DoResolveLValue):
5697 Do not report warning 219 for out values.
5698 (EmptyExpression.Null): New member to avoid extra allocations.
5700 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5702 * cs-parser.jay: Fix wrong warning 642 report.
5704 * cs-tokenizer.cs (CheckNextToken): New helper;
5705 Inspect next character if is same as expected.
5707 2004-09-23 Martin Baulig <martin@ximian.com>
5709 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5710 (Convert.ImplicitReferenceConversionExists): Likewise.
5712 2004-11-09 Raja R Harinath <rharinath@novell.com>
5714 * Makefile (DISTFILES): Comment out a few missing files.
5716 2004-10-29 Raja R Harinath <rharinath@novell.com>
5718 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5719 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
5720 (gmcs.exe): Invoke bootstrap-libs.
5721 (clean-local): Clean the net_2_0_bootstrap profile too.
5722 (PROGRAM_INSTALL_DIR): New.
5723 (install-local): Use it.
5725 2004-10-13 Martin Baulig <martin@ximian.com>
5727 * generic.cs (TypeManager.InflatedConstraints): New nested class.
5728 (TypeParameter.DefineType): If we're a method type parameter and
5729 that method is overriding something, "inflate" its constraints.
5731 2004-10-12 Martin Baulig <martin@ximian.com>
5733 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5734 and have type arguments, create and resolve a ConstructedType.
5736 2004-10-12 Martin Baulig <martin@ximian.com>
5738 * decl.cs (MemberCache.FindMemberToOverride): Use
5739 TypeManager.IsEqual() to compare the parameters and Type.Equals()
5740 to compare the invocationType.
5742 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5743 When comparing two type parameters, only do the signature-only
5744 comparision for method type parameters.
5746 2004-10-11 Martin Baulig <martin@ximian.com>
5748 * report.cs: Don't make --fatal abort on warnings, we have
5749 -warnaserror for that.
5751 2004-10-11 Martin Baulig <martin@ximian.com>
5754 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5755 (TypeManager.IsEqual): Call ourself recursively instead of using
5758 2004-10-11 Martin Baulig <martin@ximian.com>
5760 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5761 on our own type parameters, not on the ones we inherit from a containing
5764 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5767 * generic.cs (TypeParameter.Define): We may only be called once.
5769 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5770 instead of TypeManager.IsEqual().
5772 2004-09-28 Martin Baulig <martin@ximian.com>
5775 (GenericConstraints.EffectiveBaseClass): New public property.
5776 (TypeParameter.GenericConstraints): New public property.
5777 (ConstructedType.CheckConstraints): Improved.
5779 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5780 (Convert.TypeParameterConversion): New private method; use this in
5781 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5782 for all conversions related to type parameters.
5784 2004-09-24 Martin Baulig <martin@ximian.com>
5786 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5787 type parameter conversions for type parameters which are known to
5790 2004-09-24 Martin Baulig <martin@ximian.com>
5792 * generic.cs (GenericConstraints): Added `IsReferenceType' and
5793 `IsValueType' properties.
5795 * support.cs (ReflectionConstraints): Use
5796 Type.GetGenericParameterConstraints() instead of the old hack.
5798 2004-09-24 Martin Baulig <martin@ximian.com>
5800 * generic.cs (GenericConstraints): Moved here and made it an
5803 * support.cs (GenericConstraints): Moved to generic.cs.
5805 2004-09-24 Martin Baulig <martin@ximian.com>
5808 (ReflectionConstraints): Un-nested this class and made it public.
5811 (TypeManager.GetTypeParameterConstraints): New public method.
5812 (TypeManager.HasConstructorConstraint): Use the attributes.
5814 2004-09-24 Martin Baulig <martin@ximian.com>
5816 * support.cs (GenericConstraints): Replaced `HasConstructor',
5817 `IsReferenceType' and `IsValueType' with `Attributes'.
5818 (ReflectionParameters.ReflectionConstraints): Removed the Create()
5819 method and made the .ctor public.
5821 * generic.cs (Constraints.Attributes): New public property.
5822 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5823 `IsReferenceType' -> `HasReferenceTypeConstraint' and
5824 `IsValueType' -> `HasValueTypeConstraint'.
5826 2004-09-23 Martin Baulig <martin@ximian.com>
5828 * generic.cs (Constraints): Reflect latest runtime changes.
5830 2004-09-23 Martin Baulig <martin@ximian.com>
5832 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5833 (Convert.ImplicitReferenceConversionExists): Likewise.
5835 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5837 * class.cs (Operator.Define): Add error 448 and 559 report.
5839 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5841 * class.cs (MemberBase.IsTypePermitted): New protected
5842 method for checking error CS0610.
5844 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5846 * class.cs (TypeContainer.HasExplicitLayout): New property
5847 Returns whether container has StructLayout attribute set Explicit.
5848 (FieldMember): New abstract class for consts and fields.
5849 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5850 (Field): Reuse FieldMember.
5852 * const.cs (Const): Reuse FieldMember.
5854 * rootcontext.cs: EmitConstants call moved to class.
5856 2004-09-22 Martin Baulig <martin@ximian.com>
5858 Marek and me just fixed one of our oldest bugs: #28562 :-)
5860 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5862 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5863 we're an EnumConstant, just return that.
5864 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5865 an EnumConstant. In this case, we need to use GetValueAsEnumType()
5866 to get the value which'll actually be written into the attribute.
5867 However, we have to use GetValue() to access the attribute's value
5870 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5872 * constant.cs (Constant.IsNegative): New abstract property
5875 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5876 (StackAlloc.DoResolve): Reused IsNegative.
5878 2004-09-22 Martin Baulig <martin@ximian.com>
5880 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
5881 public method; like LookupTypeContainer, but also works for
5884 * report.cs (Report.SymbolRelatedToPreviousError): Use
5885 TypeManager.LookupGenericTypeContainer().
5887 2004-09-22 Martin Baulig <martin@ximian.com>
5889 Thanks to Peter Sestoft for this bug report.
5891 * expression.cs (Conditional): If both the `trueExpr' and the
5892 `falseExpr' is a NullLiteral, return a NullLiteral.
5894 2004-09-22 Martin Baulig <martin@ximian.com>
5896 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5897 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5898 for the "get_Current" call.
5900 2004-09-21 Martin Baulig <martin@ximian.com>
5902 * convert.cs (Convert.ImplicitReferenceConversion): When
5903 converting to an interface type, first check whether we're
5904 converting from a reference type.
5906 2004-09-14 Martin Baulig <martin@ximian.com>
5908 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5910 2004-09-14 Marek Safar <marek.safar@seznam.cz>
5913 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5914 called and is obsolete then this member suppress message
5915 when call is inside next [Obsolete] method or type.
5917 * expression.cs: Use TestObsoleteMethodUsage member.
5919 2004-09-14 Martin Baulig <martin@ximian.com>
5921 * genericparser.cs: Removed.
5923 2004-09-13 Marek Safar <marek.safar@seznam.cz>
5925 * class.cs (MethodCore.CheckBase): Fix bug #65757.
5927 2004-09-12 Marek Safar <marek.safar@seznam.cz>
5929 * attribute.cs (Attribute.Resolve): Add error 653 report.
5931 * class.cs (Class.ApplyAttributeBuilder): Add error 641
5933 (Method.ApplyAttributeBuilder): Add error 685 report.
5934 (Operator.Define): Add error 564 report.
5936 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5938 * expression.cs (Invocation.DoResolve): Add error
5941 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5944 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5946 * class.cs (ConstructorInitializer.Resolve):
5947 Wrong error number (515->516).
5949 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5951 * class.cs (Indexer.Define): Add error 631 report.
5953 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5955 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5957 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5959 * expression.cs (Probe.DoResolve): Add error CS0241 report.
5961 2004-09-10 Marek Safar <marek.safar@seznam.cz>
5963 * cs-parser.jay: Added error CS0241 report.
5965 2004-09-10 Raja R Harinath <rharinath@novell.com>
5967 * cs-parser.jay (fixed_statement): Introduce a scope for the
5968 declaration in the 'fixed' statement.
5970 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5972 * cs-parser.jay: Added CS0230 error report.
5974 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5976 * cs-parser.jay: Added errors CS0231 and CS0257 report.
5978 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5980 * expression.cs (Argument.Resolve): Added error CS0192 and
5983 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5985 C# 2.0 #pragma warning feature
5987 * cs-tokenizer.cs (PreProcessPragma): New method;
5988 Handles #pragma directive.
5990 * report.cs (WarningRegions): New class; Support
5991 class for #pragma warning directive. It tests whether
5992 warning is enabled for a given line.
5994 2004-09-08 Miguel de Icaza <miguel@ximian.com>
5996 * const.cs: Add more descriptive error report, tahnks to
5999 2004-09-08 Marek Safar <marek.safar@seznam.cz>
6001 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
6003 2004-09-07 Miguel de Icaza <miguel@ximian.com>
6005 * expression.cs: Apply patch from Ben: Remove dead code from
6006 ArrayCreation, and remove the TurnintoConstant call in const.cs,
6007 as that code just threw an exception anwyays.
6009 * const.cs: Remove the call to the turnintoconstant, for details
6012 * literal.cs: The type of the null-literal is the null type; So
6013 we use a placeholder type (literal.cs:System.Null, defined here)
6016 * expression.cs (Conditional.DoResolve): Remove some old code that
6017 is no longer needed, conversions have been fixed.
6019 (ArrayCreationExpression.DoResolve): Return false if we fail to
6020 resolve the inner expression.
6022 2004-09-07 Raja R Harinath <rharinath@novell.com>
6025 * cs-parser.jay (delegate_declaration): Record a delegate
6026 declaration as a type declaration.
6027 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
6029 2004-09-06 Miguel de Icaza <miguel@ximian.com>
6031 * parameter.cs: Do not crash if the type can not be resolved.
6033 * expression.cs: Report errors with unsafe pointers, fixes #64896
6035 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
6037 * expression.cs: Pointer arith always needs to do a conv.i
6038 if the operand is a long. fix 65320
6040 2004-09-04 Marek Safar <marek.safar@seznam.cz>
6042 Fixed cs0619-37.cs, cs0619-38.cs
6044 * enum.cs (GetObsoleteAttribute): Removed.
6046 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
6047 on Enum member is double staged. The first is tested member
6050 2004-09-04 Marek Safar <marek.safar@seznam.cz>
6052 Fixed #56986, #63631, #65231
6054 * class.cs: (TypeContainer.AddToMemberContainer): New method,
6055 adds member to name container.
6056 (TypeContainer.AddToTypeContainer): New method, adds type to
6058 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6059 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6060 AddOperator): Simplified by reusing AddToMemberContainer.
6061 (TypeContainer.UserDefinedStaticConstructor): Changed to property
6063 (Method.CheckForDuplications): Fixed implementation to test all
6065 (MemberBase): Detection whether member is explicit interface
6066 implementation is now in constructor.
6067 (MemberBase.UpdateMemberName): Handles IndexerName.
6068 (Accessor): Changed to keep also location information.
6069 (AbstractPropertyEventMethod): Is derived from MemberCore.
6070 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6071 will be emited or not.
6072 (PropertyBase.AreAccessorsDuplicateImplementation):
6073 Tests whether accessors are not in collision with some method.
6074 (Operator): Is derived from MethodCore to simplify common
6077 * decl.cs (Flags.TestMethodDuplication): Test for duplication
6079 (DeclSpace.AddToContainer): Adds the member to defined_names
6080 table. It tests for duplications and enclosing name conflicts.
6082 * enum.cs (EnumMember): Clean up to reuse the base structures
6084 2004-09-03 Martin Baulig <martin@ximian.com>
6086 Merged latest changes into gmcs. Please keep this comment in
6087 here, it makes it easier for me to see what changed in MCS since
6088 the last time I merged.
6090 2004-09-03 Martin Baulig <martin@ximian.com>
6092 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6093 into TypeContainer, to make partial classes work again.
6095 2004-09-03 Martin Baulig <martin@ximian.com>
6097 * rootcontext.cs (RootContext.V2): Removed.
6099 2004-03-23 Martin Baulig <martin@ximian.com>
6101 * expression.cs (Invocation.OverloadResolve): Added `bool
6102 may_fail' argument and use it instead of the Location.IsNull() hack.
6104 2004-09-09 Martin Baulig <martin@ximian.com>
6106 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
6108 2004-09-09 Martin Baulig <martin@ximian.com>
6110 * generic.cs (TypeParameter.DefineType): Added support for
6111 explicit interface methods.
6113 2004-09-09 Martin Baulig <martin@ximian.com>
6115 * README.Changes: New document. Started to list important changes
6116 between MCS and GMCS here.
6118 2004-09-08 Martin Baulig <martin@ximian.com>
6121 (TypeContainer.CheckRecursiveDefinition): New protected method.
6122 (TypeContainer.DefineType): Move the CS0146 check into
6123 CheckRecursiveDefinition().
6125 2004-09-06 Martin Baulig <martin@ximian.com>
6127 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
6128 types for the constructor constraint.
6130 2004-09-03 Martin Baulig <martin@ximian.com>
6132 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6133 into TypeContainer, to make partial classes work again.
6135 2004-09-03 Martin Baulig <martin@ximian.com>
6137 * rootcontext.cs (RootContext.V2): Removed.
6139 2004-03-23 Martin Baulig <martin@ximian.com>
6141 * expression.cs (Invocation.OverloadResolve): Added `bool
6142 may_fail' argument and use it instead of the Location.IsNull() hack.
6144 2004-09-03 Martin Baulig <martin@ximian.com>
6146 Merged latest changes into gmcs. Please keep this comment in
6147 here, it makes it easier for me to see what changed in MCS since
6148 the last time I merged.
6150 2004-09-03 Raja R Harinath <rharinath@novell.com>
6153 * expression.cs (BetterConversion): Don't allow either conversion
6154 to be null. Remove redundant implicit conversion test when 'q ==
6155 null' -- when this function is invoked, we already know that the
6156 implicit conversion exists.
6157 (BetterFunction): Assume that 'best' is non-null. Remove
6158 redundant reimplementation of IsApplicable when 'best' is null.
6159 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6160 number of arguments.
6161 (IsAncestralType): Extract from OverloadResolve.
6162 (OverloadResolve): Make robust to the MethodGroupExpr being
6163 unsorted. Implement all the logic of Section 14.5.5.1, and
6164 support overloading of methods from multiple applicable types.
6165 Clean up logic somewhat. Don't pass null methods to BetterFunction.
6167 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6168 (RealError, Warning): Append type of report to related symbol.
6170 2004-09-03 Marek Safar <marek.safar@seznam.cz>
6172 * enum.cs: Fixed CLS-Compliance checks for enum members.
6173 Error tests cs3008-8.cs, cs3014-8.cs
6175 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6177 Fixed bug #62342, #63102
6178 * class.cs: ImplementIndexer uses member.IsExplicitImpl
6179 like ImplementMethod.
6181 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6183 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6186 2004-09-02 Martin Baulig <martin@ximian.com>
6188 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6189 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6192 2004-09-01 Marek Safar <marek.safar@seznam.cz>
6194 C# 2.0 Static classes implemented
6196 * class.cs (TypeContainer): instance_constructors,
6197 initialized_fields, initialized_static_fields,
6198 default_constructor, base_inteface_types are protected to be
6199 accessible from StaticClass.
6200 (TypeContainer.DefineDefaultConstructor): New virtual method
6201 for custom default constructor generating
6202 (StaticClass): New class to handle "Static classes" feature.
6204 * cs-parser.jay: Handle static keyword on class like instance
6207 * driver.cs: Added "/langversion" command line switch with two
6208 options (iso-1, default).
6210 2004-08-31 Marek Safar <marek.safar@seznam.cz>
6212 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6214 2004-08-31 Miguel de Icaza <miguel@ximian.com>
6216 * delegate.cs: Style.
6218 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
6220 * delegate.cs: Add seperate instance expr field for miguel.
6222 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6224 * PointerArithmetic (Resolve): make sure we are not doing
6225 pointer arith on void*. Also, make sure we are resolved
6226 by not setting eclass until resolve.
6228 All callers: Make sure that PointerArithmetic gets resolved.
6230 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6232 * ArrayCreation (LookupType): If the type does not resolve
6233 to an array, give an error.
6235 2004-08-27 Marek Safar <marek.safar@seznam.cz>
6237 * statement.cs (Try.Resolve): Fixed bug #64222
6239 2004-08-27 Martin Baulig <martin@ximian.com>
6242 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6245 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6247 * ecore.cs (Constantify): Get underlying type via
6248 System.Enum.GetUnderlyingType to avoid StackOverflow on the
6249 Windows in special cases.
6251 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6253 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6254 for obtaining also private methods.
6255 (GetRemoveMethod): Used GetRemoveMethod (true)
6256 for obtaining also private methods.
6258 2004-09-02 Martin Baulig <martin@ximian.com>
6260 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6261 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6264 2004-08-27 Martin Baulig <martin@ximian.com>
6267 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6270 2004-08-25 Martin Baulig <martin@ximian.com>
6272 * support.cs (ReflectionParameters..ctor): If this is a generic
6273 method, retrieve and store its type parameters.
6274 (InternalParameters..ctor): Added `TypeParameter[]' argument.
6275 (ReflectionParameters.GenericConstraints): The argument specifies
6276 the type parameter, not the method parameter.
6277 (InternalParameters.GenericConstraints): Likewise.
6279 * generic.cs (TypeParameter.DefineType): Correctly handle
6280 constraints wrt. generic methods in interfaces and their
6283 2004-08-24 Martin Baulig <martin@ximian.com>
6285 * generic.cs (TypeParameter.IsSubclassOf): New public method.
6286 (Constraints.IsSubclassOf): New internal method.
6288 * typemanager.cs (TypeManager.FindMembers): Added special support
6289 for GenericTypeParameterBuilder's.
6290 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
6293 2004-08-24 Martin Baulig <martin@ximian.com>
6296 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6297 this for accessibility checks.
6298 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6299 IsNestedFamilyAccessible.
6300 (TypeManager.IsSubclassOf): New method, do what the name actually
6303 2004-08-24 Martin Baulig <martin@ximian.com>
6305 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
6306 as a SimpleName, include the generic arity.
6308 2004-08-24 Martin Baulig <martin@ximian.com>
6310 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6311 MethodAttributes.HideBySig for operators.
6313 2004-08-23 Martin Baulig <martin@ximian.com>
6315 Back to the old error reporting system :-)
6317 * report.cs (Message): Removed.
6318 (Report.MessageData, ErrorData, WarningData): Removed.
6319 (Report.Error, Warning): Back to the old system.
6321 2004-08-23 Martin Baulig <martin@ximian.com>
6323 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6325 * class.cs (TypeContainer.ParentContainer): New public virtual
6326 method; replaces the explicit interface implementation.
6327 (ClassPart.ParentContainer): Override.
6329 2004-08-23 Martin Baulig <martin@ximian.com>
6331 * statement.cs (Switch): Added support for constant switches; see
6332 #59428 or test-285.cs.
6334 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6337 * statement.cs (GetEnumeratorFilter): Removed useless
6338 logic because C# specs is strict. GetEnumerator must be
6341 2004-08-22 Martin Baulig <martin@ximian.com>
6343 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6344 a switch and may break, reset the barrier. Fixes #59867.
6346 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6348 CLS-Compliance speed up (~5% for corlib)
6350 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6351 New method. Tests container for CLS-Compliant names
6353 * class.cs (TypeContainer.VerifyClsName): New method.
6354 Checks whether container name is CLS Compliant.
6355 (Constructor): Implements IMethodData.
6357 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6358 low-case table for CLS Compliance test.
6359 (MemberCache.VerifyClsParameterConflict): New method.
6360 Checks method parameters for CS3006 error.
6362 * enum.cs (EnumMember): Is derived from MemberCore.
6363 (Enum.VerifyClsName): Optimized for better performance.
6365 2004-08-06 Marek Safar <marek.safar@seznam.cz>
6367 * report.cs: Renamed Error_T to Error and changed all
6370 2004-08-06 Marek Safar <marek.safar@seznam.cz>
6372 * class.cs (TypeContainer.IndexerArrayList): New inner class
6373 container for indexers.
6374 (TypeContainer.DefaultIndexerName): New constant for default
6375 indexer name. Replaced all "Item" with this constant.
6376 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6378 * typemanager.cs (TypeManager.default_member_ctor): Cache here
6379 DefaultMemberAttribute constructor.
6381 2004-08-05 Martin Baulig <martin@ximian.com>
6383 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6386 2004-08-05 Marek Safar <marek.safar@seznam.cz>
6388 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6389 multi platforms problem.
6391 * compiler.csproj: Included shared files.
6393 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6395 Fix bug 60333, 55971 in the more general way
6396 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6397 Added arg_type argument for constant conversion.
6398 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6400 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6403 * class.cs (TypeContainer ): New inner classes MethodArrayList,
6404 OperatorArrayList, MethodCoreArrayList for typecontainer
6405 containers. Changed class member types to these new types.
6406 (MethodArrayList.DefineMembers): Added test for CS0659.
6408 2004-08-04 Miguel de Icaza <miguel@ximian.com>
6410 * cfold.cs: Synchronize the folding with the code in expression.cs
6411 Binary.DoNumericPromotions for uint operands.
6413 * attribute.cs: Revert patch from Raja, it introduced a regression
6414 while building Blam-1.2.1 (hard to isolate a test case).
6416 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6420 (TypeContainer.Define): Renamed to DefineContainerMembers because of
6422 (MethodCore.parent_method): New member. The method we're overriding
6423 if this is an override method.
6424 (MethodCore.CheckBase): Moved from Method class and made common.
6425 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6427 (MethodCore.CheckForDuplications): New abstract method. For custom
6428 member duplication search in a container
6429 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6430 method and its return type.
6431 (Event.conflict_symbol): New member. Symbol with same name in the
6435 (MemberCache.FindMemberWithSameName): New method. The method
6436 is looking for conflict with inherited symbols.
6438 2004-08-04 Martin Baulig <martin@ximian.com>
6440 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6442 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6444 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6446 * report.cs (Message): New enum for better error, warning reference in
6448 (MessageData): New inner abstract class. It generally handles printing of
6449 error and warning messages.
6450 Removed unused Error, Warning, Message methods.
6452 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6454 Fix for cs0592-8.cs test
6456 (Attributable.ValidAttributeTargets): Made public.
6457 (Attribute.ExplicitTarget): New member for explicit target value.
6458 (Attribute.CheckTargets): Now we translate explicit attribute
6459 target to Target here.
6461 2004-08-03 Ben Maurer <bmaurer@ximian.com>
6463 * ecore.cs (MethodGroupExpr): new IsBase property.
6465 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6467 * delegate.cs (DelegateCreation): store a MethodGroupExpr
6468 rather than an instance expr.
6470 (DelegateCreation.Emit): Use the method group rather than
6471 the instance expression. Also, if you have base.Foo as the
6472 method for a delegate, make sure to emit ldftn, not ldftnvirt.
6474 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
6476 (NewDelegate.DoResolve): Only check for the existance of Invoke
6477 if the method is going to be needed. Use MethodGroupExpr.
6479 (NewDelegate.Emit): Remove, DelegateCreation implements this.
6481 * expression.cs: For pointer arith., make sure to use
6482 the size of the type, not the size of the pointer to
6485 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6488 * class.cs (Class): Added error CS0502 test.
6490 2004-08-03 John Luke <jluke@cfl.rr.com>
6491 Raja R Harinath <rharinath@novell.com>
6494 * attribute.cs (Attribute.complained_before): New flag.
6495 (Attribute.ResolveType, Attribute.Resolve),
6496 (Attribute.DefinePInvokeMethod): Set it.
6497 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6499 2004-08-03 Martin Baulig <martin@ximian.com>
6501 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6502 use a user-defined operator; we still need to do numeric
6503 promotions in case one argument is a builtin type and the other
6504 one has an implicit conversion to that type. Fixes #62322.
6506 2004-08-18 Martin Baulig <martin@ximian.com>
6508 * class.cs (Method.Define): Use the correct method name when
6509 creating the MethodBuilder for a generic method.
6511 2004-08-17 Martin Baulig <martin@ximian.com>
6513 * generic.cs (Constraints): Support type parameter constraints.
6515 2004-08-16 Martin Baulig <martin@ximian.com>
6517 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
6518 (Token.GENERIC_DIMENSION): New token; this is returned if we
6519 encounter an unbound generic type in a typeof() expression.
6521 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
6522 this token is only generated while parsing a typeof() expression.
6523 (typeof_expression): Removed the old unbound_type hack.
6525 * generic.cs (TypeArguments.IsUnbound): New public property.
6527 * decl.cs (MemberName): Added support for unbound types.
6529 2004-08-14 Martin Baulig <martin@ximian.com>
6532 (TypeManager.IsEqualGenericInstance): New static method.
6533 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
6534 just used to check accessibility, so follow the rules of 26.1.6.
6536 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
6537 ConstructedType instead of a TypeExpression if we have type arguments.
6539 * cs-parser.jay (typeof_expression): Support unbound generic types.
6541 * ecore.cs (UnboundTypeExpression): New public class.
6543 2004-08-12 Martin Baulig <martin@ximian.com>
6545 * typemanager.cs (TypeManager.IsNestedChildOf): Use
6546 TypeManager.IsEqual() rather than `=='.
6548 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
6549 generic instances as well.
6551 2004-08-12 Martin Baulig <martin@ximian.com>
6553 * expression.cs (Invocation.InferType): We can only infer method
6554 type parameters. Fixes #62647.
6556 2004-08-11 Martin Baulig <martin@ximian.com>
6558 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
6559 before resolving the base classes.
6561 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6563 * Makefile: install .mdb file too.
6565 2004-08-05 Martin Baulig <martin@ximian.com>
6567 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
6568 initializer, the current type is just the TypeBuilder, not the
6569 instantiated generic type.
6570 (FieldExpr.IsFieldInitializer): New public property.
6572 2004-08-04 Martin Baulig <martin@ximian.com>
6574 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6576 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6578 2004-08-03 Martin Baulig <martin@ximian.com>
6580 * class.cs (MethodData.Define): If we're an explicit
6581 implementation, remove the generic arity from the type name.
6583 2004-08-03 Martin Baulig <martin@ximian.com>
6585 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6586 use a user-defined operator; we still need to do numeric
6587 promotions in case one argument is a builtin type and the other
6588 one has an implicit conversion to that type. Fixes #62322.
6590 2004-08-02 Martin Baulig <martin@ximian.com>
6592 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
6594 (TypeContainer.GetClassBases): Return the unexpanded list of
6595 interfaces; we expand them later.
6596 (TypeContainer.DefineType): After creating the TypeBuilder, call
6597 TypeManager.ExpandInterfaces() to get an expanded and resolved
6600 * ecore.cs (TypeExpr.GetInterfaces): Removed
6602 * generics.cs (Constraints.InterfaceConstraints): Remove.
6603 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
6604 register the interface constraints.
6607 (TypeManager.AddUserType): Removed the `ifaces' argument.
6608 (TypeManager.AddTypeParameter): Likewise.
6609 (TypeManager.AddUserInterface): Removed, was unused.
6610 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
6611 `TypeExpr[]' array for the interfaces.
6612 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
6613 has been defined, returns a list of the resolved interfaces types.
6614 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
6615 (TypeManager.GetExplicitInterfaces): Likewise.
6617 2004-08-02 Martin Baulig <martin@ximian.com>
6619 * expression.cs (Invocation.EmitCall): If we're invoking a method
6620 on a type parameter, use the new `Constrained' prefix opcode.
6622 2004-08-02 Martin Baulig <martin@ximian.com>
6624 * statement.cs (LocalInfo.Flags): Added `IsThis'.
6625 (LocalInfo.IsThis): New public property.
6626 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6628 2004-08-01 Martin Baulig <martin@ximian.com>
6630 * class.cs (TypeContainer.GetClassBases): Don't set the default
6631 here since we may get called from GetPartialBases().
6632 (TypeContainer.DefineType): If GetClassBases() didn't return a
6633 parent, use the default one.
6635 2004-07-30 Martin Baulig <martin@ximian.com>
6637 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6639 * class.cs (SourceMethod): New public class, derive from the
6640 symbol writer's ISourceMethod.
6641 (Method): Use the new symbol writer API.
6643 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6644 as argument and use the new symbol writer.
6647 (SourceFile): Implement the symbol writer's ISourceFile.
6648 (Location.SymbolDocument): Removed.
6649 (Location.SourceFile): New public property.
6651 * symbolwriter.cs: Use the new symbol writer API.
6653 2004-07-30 Raja R Harinath <rharinath@novell.com>
6655 * Makefile (install-local): Remove. Functionality moved to
6658 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
6660 * Makefile: Install mcs.exe.config file together with mcs.exe.
6661 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6662 correct runtime version.
6664 2004-07-25 Martin Baulig <martin@ximian.com>
6667 (TypeContainer.RegisterOrder): Removed, this was unused.
6668 (TypeContainer, interface_order): Removed.
6669 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6670 TypeContainer as argument since we can also be called with a
6671 `PartialContainer' for a partial class/struct/interface.
6672 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6673 of checking whether we're an `Interface' - we could be a
6675 (PartialContainer.Register): Override; call
6676 AddClass()/AddStruct()/AddInterface() on our parent.
6678 * cs-parser.jay (interface_member_declaration): Add things to the
6679 `current_container', not the `current_class'.
6681 * rootcontext.cs (RegisterOrder): The overloaded version which
6682 takes an `Interface' was unused, removed.
6684 * typemanager.cs (TypeManager.LookupInterface): Return a
6685 `TypeContainer', not an `Interface'.
6686 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6687 contain a `PartialContainer' for an interface, so check it's
6688 `Kind' to figure out what it is.
6690 2004-07-25 Martin Baulig <martin@ximian.com>
6692 * class.cs (Class.DefaultTypeAttributes): New public constant.
6693 (Struct.DefaultTypeAttributes): Likewise.
6694 (Interface.DefaultTypeAttributes): Likewise.
6695 (PartialContainer.TypeAttr): Override this and add the
6696 DefaultTypeAttributes.
6698 2004-07-25 Martin Baulig <martin@ximian.com>
6700 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6701 we can just use the `Parent' field instead.
6703 2004-07-25 Martin Baulig <martin@ximian.com>
6705 * class.cs (TypeContainer.Emit): Renamed to EmitType().
6707 2004-07-25 Martin Baulig <martin@ximian.com>
6709 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6710 our parts before defining any methods.
6711 (TypeContainer.VerifyImplements): Make this virtual.
6712 (ClassPart.VerifyImplements): Override and call VerifyImplements()
6713 on our PartialContainer.
6715 2004-07-25 Martin Baulig <martin@ximian.com>
6717 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6719 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6720 argument, we can just use the `Parent' field instead.
6723 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
6724 (MemberBase.DoDefine): Likewise.
6726 2004-07-24 Martin Baulig <martin@ximian.com>
6728 * decl.cs (MemberCore.Parent): New public field.
6729 (DeclSpace.Parent): Moved to MemberCore.
6731 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6732 (MemberBase.ctor): Added TypeContainer argument, pass it to our
6734 (FieldBase, Field, Operator): Likewise.
6735 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6736 (EventField, Event): Likewise.
6738 2004-07-23 Martin Baulig <martin@ximian.com>
6740 * class.cs (PartialContainer): New public class.
6741 (ClassPart): New public class.
6742 (TypeContainer): Added support for partial classes.
6743 (TypeContainer.GetClassBases): Splitted some of the functionality
6744 out into GetNormalBases() and GetPartialBases().
6746 * cs-tokenizer.cs (Token.PARTIAL): New token.
6747 (Tokenizer.consume_identifier): Added some hacks to recognize
6748 `partial', but only if it's immediately followed by `class',
6749 `struct' or `interface'.
6751 * cs-parser.jay: Added support for partial clases.
6753 2004-07-23 Martin Baulig <martin@ximian.com>
6755 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6756 a `DeclSpace' and also made it readonly.
6757 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6758 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6759 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6761 * cs-parser.jay: Pass the `current_class', not the
6762 `current_container' (at the moment, this is still the same thing)
6763 to a new Method, Property, Event, Indexer or Constructor.
6765 2004-07-23 Martin Baulig <martin@ximian.com>
6767 * cs-parser.jay (CSharpParser): Added a new `current_class' field
6768 and removed the `current_interface' one.
6769 (struct_declaration, class_declaration, interface_declaration):
6770 Set `current_class' to the newly created class/struct/interface;
6771 set their `Bases' and call Register() before parsing their body.
6773 2004-07-23 Martin Baulig <martin@ximian.com>
6775 * class.cs (Kind): New public enum.
6776 (TypeContainer): Made this class abstract.
6777 (TypeContainer.Kind): New public readonly field.
6778 (TypeContainer.CheckDef): New public method; moved here from
6780 (TypeContainer.Register): New public abstract method.
6781 (TypeContainer.GetPendingImplementations): New public abstract
6783 (TypeContainer.GetClassBases): Removed the `is_class' and
6784 `is_iface' parameters.
6785 (TypeContainer.DefineNestedTypes): Formerly known as
6787 (ClassOrStruct): Made this class abstract.
6789 * tree.cs (RootTypes): New public type.
6791 2004-07-20 Martin Baulig <martin@ximian.com>
6793 * tree.cs (Tree.RecordNamespace): Removed.
6794 (Tree.Namespaces): Removed.
6796 * rootcontext.cs (RootContext.IsNamespace): Removed.
6798 * cs-parser.jay (namespace_declaration): Just create a new
6799 NamespaceEntry here.
6801 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
6803 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6804 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6805 entry to make sure it runs in the correct runtime version.
6807 2004-07-18 Martin Baulig <martin@ximian.com>
6809 * generic.cs (ConstructedType.CheckConstraints): Improved
6810 constraints checking.
6812 2004-07-18 Martin Baulig <martin@ximian.com>
6814 * expression.cs (Invocation.BetterMethod): Call
6815 TypeManager.TypeToCoreType() on all types and removed my previous
6816 hack; we're already doig the right thing here.
6818 2004-07-17 Martin Baulig <martin@ximian.com>
6820 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6822 2004-07-16 Martin Baulig <martin@ximian.com>
6824 * iterators.cs: Added generics support.
6826 2004-07-16 Martin Baulig <martin@ximian.com>
6828 * iterators.cs: Rewrote this. We're now using one single Proxy
6829 class for both the IEnumerable and the IEnumerator interface and
6830 `Iterator' derives from Class so we can use the high-level API.
6832 * class.cs (TypeContainer.AddIterator): New method.
6833 (TypeContainer.DoDefineType): New protected virtual method, which
6834 is called from DefineType().
6835 (TypeContainer.DoDefineMembers): Call DefineType() and
6836 DefineMembers() on all our iterators.
6837 (TypeContainer.Emit): Call Emit() on all our iterators.
6838 (TypeContainer.CloseType): Call CloseType() on all our iterators.
6840 * codegen.cs (EmitContext.CurrentIterator): New public field.
6842 2004-07-15 Martin Baulig <martin@ximian.com>
6845 (TypeManager.not_supported_exception_type): New type.
6847 2004-07-14 Martin Baulig <martin@ximian.com>
6850 (TypeManager.generic_ienumerable_type): New type.
6851 (TypeManager.generic_ienumerator_type): New type.
6854 (RootContext.interfaces_first_stage): Added
6855 "System.Collections.Generic.IEnumerator`1" and
6856 "System.Collections.Generic.IEnumerable`1".
6858 2004-07-14 Martin Baulig <martin@ximian.com>
6860 * iterators.cs: Use real error numbers.
6862 2004-07-14 Martin Baulig <martin@ximian.com>
6864 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6865 requires this to be a System.Collection.IEnumerable and not a
6866 class implementing that interface.
6867 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
6869 2004-07-13 Marek Safar <marek.safar@seznam.cz>
6871 * class.cs: Fixed previous fix, it broke some error tests.
6873 2004-07-12 Martin Baulig <martin@ximian.com>
6875 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6878 2004-07-14 Martin Baulig <martin@ximian.com>
6880 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
6881 an exclamation mark (!) for the generic arity to reflect the
6882 latest spec changes; ie. use "System.Collections.Generic.IList`1".
6884 2004-07-13 Martin Baulig <martin@ximian.com>
6886 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
6887 specifiers being part of a type argument.
6889 2004-07-13 Martin Baulig <martin@ximian.com>
6891 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
6892 name for generic types.
6894 2004-07-13 Martin Baulig <martin@ximian.com>
6896 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
6899 2004-07-09 Miguel de Icaza <miguel@ximian.com>
6901 * assign.cs (LocalTemporary): Add new argument: is_address,If
6902 `is_address' is true, then the value that we store is the address
6903 to the real value, and not the value itself.
6905 * ecore.cs (PropertyExpr): use the new local temporary
6906 stuff to allow us to handle X.Y += z (where X is a struct)
6908 2004-07-08 Martin Baulig <martin@ximian.com>
6910 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6911 not always return, just like we're doing in Using.Resolve().
6913 2004-07-07 Miguel de Icaza <miguel@ximian.com>
6915 * cs-parser.jay (fixed_statement): flag this as Pinned.
6917 2004-07-06 Miguel de Icaza <miguel@ximian.com>
6919 * typemanager.cs (TypeManager): Removed MakePinned method, this
6920 mechanism is replaced with the .NET 2.x compatible mechanism of
6921 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6923 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
6924 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6925 `IsFixed' property which has a different meaning.
6927 2004-07-02 Raja R Harinath <rharinath@novell.com>
6929 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6930 visible from inside a nested class, not just the names of the
6931 immediately enclosing class.
6934 2004-06-24 Raja R Harinath <rharinath@novell.com>
6936 * expression.cs (BetterConversion): Remove buggy special-case
6937 handling of "implicit constant expression conversions". At this
6938 point, we already know that the conversion is possible -- we're
6939 only checking to see which is better.
6941 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6943 * cs-parser.jay: Added error CS0210 test.
6945 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6947 * cs-parser.jay: Added error CS0134 test.
6949 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6952 * cs-parser.jay: Added error CS0145 test.
6954 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6956 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6958 2004-06-23 Ben Maurer <bmaurer@ximian.com>
6960 * expression.cs (StackAlloc.Resolve): The argument may not
6961 be a constant; deal with this case.
6963 2004-06-23 Marek Safar <marek.safar@seznam.cz>
6965 * attribute.cs (IndexerName_GetIndexerName): Renamed to
6966 GetIndexerAttributeValue.
6967 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6969 * class.cs (Indexer.Define): Added error tests for CS0415,
6972 2004-06-23 Miguel de Icaza <miguel@ximian.com>
6974 * attribute.cs (Attribute.Resolve): Keep field code in sync with
6977 2004-06-23 Martin Baulig <martin@ximian.com>
6979 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6980 neither return nor throw, reset the barrier as well. Fixes #60457.
6982 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
6984 * class.cs : EventAttributes is now set to None by default.
6985 This fixes bug #60459.
6987 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6990 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6991 Don't throw exception but return null (it's sufficient now).
6993 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6995 * typemanager.cs (GetArgumentTypes): Faster implementation.
6997 2004-06-18 Martin Baulig <martin@ximian.com>
6999 * attribute.cs (Attribute.Resolve): Check whether we're an
7000 EmptyCast which a Constant child. Fixes #60333.
7002 2004-06-17 Ben Maurer <bmaurer@ximian.com>
7004 * statement.cs (EmitCollectionForeach): Account for the fact that
7005 not all valuetypes are in areas which we can take the address of.
7006 For these variables, we store to a temporary variable. Also, make
7007 sure that we dont emit a `callvirt' on a valuetype method.
7009 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7011 * expression.cs (StackAlloc.DoReSolve): Added test for
7012 negative parameter (CS0247).
7014 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7017 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7019 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7022 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7025 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7027 Fix bug #58254 & cs1555.cs, cs1556.cs
7028 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7030 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7032 * cs-parser.jay: Added error CS1669 test for indexers.
7034 2004-06-18 Martin Baulig <martin@ximian.com>
7036 * generics.cs (GenericMethod.ctor): Don't take an Attributes
7037 argument. Fixes #60441.
7039 2004-06-16 Ben Maurer <bmaurer@ximian.com>
7040 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
7041 The name needs to have the actual name of the method in order
7042 for other tests (such as the one in OverloadResolve for Invoke
7043 on a delegate) to work. As well, it does not really help
7044 error reporting because the method group had multiple methods.
7045 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
7046 Make profiling work.
7048 2004-06-13 Martin Baulig <martin@ximian.com>
7050 * cs-parser.jay: Don't allow generic attributes.
7052 2004-06-13 Martin Baulig <martin@ximian.com>
7054 * class.cs (MemberBase.DoDefineBase): New protected method.
7055 (MemberBase.DoDefine): Compute the `flags' in the new
7056 DoDefineBase() which must be called first.
7057 (Method.Define): Call DoDefineBase() first so we have the flags
7058 when defining the generic method.
7060 * cs-parser.jay (interface_method_declaration): Support generic methods.
7062 2004-06-13 Martin Baulig <martin@ximian.com>
7064 * decl.cs (TypeName): Removed.
7065 (MemberName): Removed TypeName and MemberNow; now we just have
7068 * cs-parser.jay: Don't distinguish between type arguments and type
7069 parameters in the grammar and simplified the rules a bit. The
7070 reduce/reduce conflicts are now gone (except the one we inherited
7073 2004-06-11 Martin Baulig <martin@ximian.com>
7075 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7076 call this twice: for params and varargs methods.
7078 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7081 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7083 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7085 * attribute.cs (Attribute.GetValidTargets): Made public.
7088 (AbstractPropertyEventMethod): New class for better code sharing.
7089 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7091 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7093 2004-06-09 Martin Baulig <martin@ximian.com>
7095 * cs-parser.jay: Removed a reduce/reduce conflict.
7097 2004-06-03 Martin Baulig <martin@ximian.com>
7099 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
7100 GetSimpleName() and return a SimpleName.
7102 * ecore.cs (SimpleName.Arguments): New public field.
7103 (SimpleName): Added overloaded ctor which takes an additional
7104 TypeArguments argument.
7105 (SimpleName.SimpleNameResolve): Added support for generic methods.
7106 (MethodGroupExpr.ResolveGeneric): New public method. The code was
7107 formerly in MemberAccess.DoResolve(), but we also need it in
7108 SimpleNameResolve().
7110 * expression.cs (MemberAccess.DoResolve): Use the new
7111 MethodGroupExpr.ResolveGeneric().
7113 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7115 * decl.cs: If possible, use lookuptypedirect here. We can only do
7116 this if there is no `.' after the namespace. Avoids using
7117 LookupType, which does lots of slow processing.
7118 (FindNestedType) New method, does what it says :-).
7119 * namespace.cs: use LookupTypeDirect.
7120 * rootcontext.cs: use membercache, if possible.
7121 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7123 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7126 According to the spec,
7128 In a member access of the form E.I, if E is a single identifier,
7129 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7130 field, property, localvariable, or parameter with the same type as
7131 the meaning of E as a type-name (§3.8), then both possible
7132 meanings of E are permitted.
7134 We did not check that E as a simple-name had the same type as E as
7137 This trivial check gives us 5-7% on bootstrap time.
7139 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7141 * expression.cs (Invocation.OverloadResolve): Avoid the
7142 use of hashtables and boxing here by allocating on demand.
7144 2004-05-30 Martin Baulig <martin@ximian.com>
7146 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7147 we're doing a silent lookup. Don't try to lookup nested types in
7148 TypeManager.object_type (thanks to Ben Maurer).
7150 2004-05-30 Martin Baulig <martin@ximian.com>
7152 Committing a patch from Ben Maurer.
7154 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7156 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7158 * convert.cs: add a trivial cache for overload operator resolution.
7160 2004-05-31 Marek Safar <marek.safar@seznam.cz>
7163 (AttributeTester.GetObsoleteAttribute): Returns instance of
7164 ObsoleteAttribute when type is obsolete.
7167 (TypeContainer.VerifyObsoleteAttribute): Override.
7168 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7169 (MethodCode.VerifyObsoleteAttribute): Override.
7170 (MemberBase.VerifyObsoleteAttribute): Override.
7173 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7174 and report proper error.
7177 (Delegate.VerifyObsoleteAttribute): Override.
7180 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7181 and report proper error.
7182 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7185 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7189 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7190 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7191 Added test for ObsoleteAttribute.
7194 (Catch): Derived from Statement.
7196 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7198 * decl.cs: If possible, use lookuptypedirect here. We can only do
7199 this if there is no `.' after the namespace. Avoids using
7200 LookupType, which does lots of slow processing.
7201 (FindNestedType) New method, does what it says :-).
7202 * namespace.cs: use LookupTypeDirect.
7203 * rootcontext.cs: use membercache, if possible.
7204 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7206 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7209 According to the spec,
7211 In a member access of the form E.I, if E is a single identifier,
7212 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7213 field, property, localvariable, or parameter with the same type as
7214 the meaning of E as a type-name (§3.8), then both possible
7215 meanings of E are permitted.
7217 We did not check that E as a simple-name had the same type as E as
7220 This trivial check gives us 5-7% on bootstrap time.
7222 2004-05-30 Marek Safar <marek.safar@seznam.cz>
7224 Fixed bug #59071 & cs0160.cs
7225 * statement.cs (Try.Resolve): Check here whether order of catch
7226 clauses matches their dependencies.
7228 2004-05-30 Marek Safar <marek.safar@seznam.cz>
7231 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
7234 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7236 * expression.cs (Invocation.OverloadResolve): Avoid the
7237 use of hashtables and boxing here by allocating on demand.
7239 2004-05-30 Martin Baulig <martin@ximian.com>
7241 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7242 we're doing a silent lookup. Don't try to lookup nested types in
7243 TypeManager.object_type (thanks to Ben Maurer).
7245 2004-05-30 Martin Baulig <martin@ximian.com>
7247 Committing a patch from Ben Maurer.
7249 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7251 2004-05-29 Martin Baulig <martin@ximian.com>
7253 * class.cs (IMethodData.ShouldIgnore): New method.
7255 * typemanager.cs (TypeManager.MethodFlags): Don't take a
7256 `Location' argument, we don't need it anywhere. Use
7257 `IMethodData.ShouldIgnore ()' instead of
7258 `MethodData.GetMethodFlags ()'.
7259 (TypeManager.AddMethod): Removed.
7260 (TypeManager.AddMethod2): Renamed to AddMethod.
7262 2004-05-29 Martin Baulig <martin@ximian.com>
7264 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7266 * convert.cs (Convert.ImplicitReferenceConversion): If we're
7267 converting from a class type S to an interface type and we already
7268 have an object on the stack, don't box it again. Fixes #52578.
7270 2004-05-29 Martin Baulig <martin@ximian.com>
7272 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7273 Added support for `params' parameters. Fixes #59267.
7275 2004-05-29 Martin Baulig <martin@ximian.com>
7277 * literal.cs (NullPointer): Provide a private .ctor which sets
7278 `type' to TypeManager.object_type. Fixes #59048.
7280 2004-05-29 Martin Baulig <martin@ximian.com>
7282 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7283 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
7285 * ecore.cs (EventExpr.instance_expr): Make the field private.
7287 2004-05-26 Marek Safar <marek.safar@seznam.cz>
7289 Fixed bug #50080 & cs0214-2.cs
7290 * expression.cs (Cast.DoResolve): Check unsafe context here.
7292 * statement.cs (Resolve.DoResolve): Likewise.
7294 2004-05-26 Martin Baulig <martin@ximian.com>
7296 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7298 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7299 (RootContext.LookupType): Pass down the `silent' flag.
7301 2004-05-25 Martin Baulig <martin@ximian.com>
7304 (MethodGroupExpr.IdenticalTypeName): New public property.
7305 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7306 expression actually refers to a type.
7308 2004-05-25 Martin Baulig <martin@ximian.com>
7310 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7311 for #56176 and made it actually work.
7313 2004-05-25 Martin Baulig <martin@ximian.com>
7315 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7316 (FieldExpr, PropertyExpr): Override and implement
7317 CacheTemporaries. Fixes #52279.
7319 2004-05-25 Miguel de Icaza <miguel@ximian.com>
7321 * location.cs: In the new compiler listing a file twice is a
7322 warning, not an error.
7324 2004-05-24 Martin Baulig <martin@ximian.com>
7326 * enum.cs (Enum.DefineType): For the `BaseType' to be a
7327 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
7329 2004-05-24 Martin Baulig <martin@ximian.com>
7331 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7332 walking the `using' list. Fixes #53921.
7334 2004-05-24 Martin Baulig <martin@ximian.com>
7336 * const.cs (Const.LookupConstantValue): Added support for
7337 EmptyCast's; fixes #55251.
7339 2004-05-24 Martin Baulig <martin@ximian.com>
7341 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7342 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7343 which does the CS0135 check. The reason is that we first need to
7344 check whether the variable actually exists.
7346 2004-05-24 Martin Baulig <martin@ximian.com>
7348 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7349 than RootContext.LookupType() to find the explicit interface
7352 2004-05-24 Raja R Harinath <rharinath@novell.com>
7354 * Makefile: Simplify. Use executable.make.
7355 * mcs.exe.sources: New file. List of sources of mcs.exe.
7357 2004-05-24 Anders Carlsson <andersca@gnome.org>
7361 Use the invariant culture when doing String.Compare for CLS case
7364 2004-05-23 Martin Baulig <martin@ximian.com>
7366 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7367 don't have any dots. Fixes #52622, added cs0246-8.cs.
7369 * namespace.cs (NamespaceEntry.Lookup): Likewise.
7371 2004-05-23 Marek Safar <marek.safar@seznam.cz>
7373 * class.cs (MemberBase.Define): Reuse MemberType member for
7374 resolved type. Other methods can use it too.
7376 2004-05-23 Martin Baulig <martin@ximian.com>
7378 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7379 the variable also exists in the current block (otherwise, we need
7380 to report a CS0103). Fixes #58670.
7382 2004-05-23 Martin Baulig <martin@ximian.com>
7384 * flowanalysis.cs (Reachability.Reachable): Compute this
7385 on-the-fly rather than storing it as a field.
7387 2004-05-23 Martin Baulig <martin@ximian.com>
7389 * flowanalysis.cs (Reachability.And): Manually compute the
7390 resulting `barrier' from the reachability.
7392 2004-05-23 Marek Safar <marek.safar@seznam.cz>
7395 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7396 instance of ObsoleteAttribute when symbol is obsolete.
7399 (IMethodData): Extended interface for ObsoleteAttribute support.
7401 2004-05-22 Marek Safar <marek.safar@seznam.cz>
7403 * attribute.cs: Fix bug #55970
7405 2004-05-22 Marek Safar <marek.safar@seznam.cz>
7409 (GetObsoleteAttribute): New method. Creates the instance of
7411 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7412 ObsoleteAttribute when member is obsolete.
7413 (AttributeTester.Report_ObsoleteMessage): Common method for
7414 Obsolete error/warning reporting.
7417 (TypeContainer.base_classs_type): New member for storing parent type.
7420 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7421 for this MemberCore.
7423 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7425 * attribute.cs, const.cs: Fix bug #58590
7427 2004-05-21 Martin Baulig <martin@ximian.com>
7429 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7430 out parameters if the end of the method is unreachable. Fixes
7433 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7435 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7436 Hari was right, why extra method.
7438 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7440 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7442 2004-05-20 Martin Baulig <martin@ximian.com>
7444 * delegate.cs: Convert this file to Unix mode - like the original
7447 2004-05-20 Martin Baulig <martin@ximian.com>
7449 * attribute.cs: Convert this file to Unix mode - like the original
7452 2004-05-19 Marek Safar <marek.safar@seznam.cz>
7454 Fix bug #58688 (MCS does not report error when the same attribute
7457 * attribute.cs (Attribute.Emit): Distinction between null and default.
7459 2004-05-19 Raja R Harinath <rharinath@novell.com>
7461 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7462 of a top-level attribute without an attribute target.
7463 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
7465 (Attribute.Conditional_GetConditionName),
7466 (Attribute.Obsolete_GetObsoleteMessage): Update.
7467 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
7468 part of ScanForIndexerName.
7469 (Attribute.CanIgnoreInvalidAttribute): New function.
7470 (Attribute.ScanForIndexerName): Move to ...
7471 (Attributes.ScanForIndexerName): ... here.
7472 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7473 (Attributes.Search): New internal variant that can choose not to
7474 complain if types aren't resolved. The original signature now
7476 (Attributes.GetClsCompliantAttribute): Use internal variant, with
7477 complaints suppressed.
7478 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7479 only if it not useful.
7480 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7481 top-level for attributes that are shared between the assembly
7482 and a top-level class.
7483 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7484 * class.cs: Update to reflect changes.
7485 (DefineIndexers): Fuse loops.
7486 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
7487 a couple more variants of attribute names.
7489 2004-05-18 Marek Safar <marek.safar@seznam.cz>
7491 Fix bug #52585 (Implemented explicit attribute declaration)
7494 (Attributable.ValidAttributeTargets): New abstract method. It gets
7495 list of valid attribute targets for explicit target declaration.
7496 (Attribute.Target): It holds target itself.
7497 (AttributeSection): Removed.
7498 (Attribute.CheckTargets): New method. It checks whether attribute
7499 target is valid for the current element.
7502 (EventProperty): New class. For events that are declared like
7503 property (with add and remove accessors).
7504 (EventField): New class. For events that are declared like field.
7507 * cs-parser.jay: Implemented explicit attribute target declaration.
7509 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
7510 Override ValidAttributeTargets.
7513 (ReturnParameter): Class for applying custom attributes on
7515 (ParameterAtribute): New class. Class for applying custom
7516 attributes on the parameter type.
7518 2004-05-17 Miguel de Icaza <miguel@ximian.com>
7520 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7523 (Method): Allow UNSAFE here.
7525 * modifiers.cs: Support unsafe reporting.
7527 2004-05-17 Marek Safar <marek.safar@seznam.cz>
7529 * decl.cs: Fix bug #58478.
7531 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7533 * statement.cs: When checking for unreachable code on an EmptyStatement,
7534 set the location. Fixes bug #58488.
7536 2004-05-13 Miguel de Icaza <miguel@ximian.com>
7538 * driver.cs: Add -pkg handling.
7540 From Gonzalo: UseShelLExecute=false
7542 2004-05-12 Marek Safar <marek.safar@seznam.cz>
7545 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7547 (Attribute.IsClsCompliaceRequired): Moved to base for better
7549 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7550 when attribute is AttributeUsageAttribute.
7551 (Attribute.GetValidTargets): Simplified.
7552 (Attribute.GetAttributeUsage): New method returns AttributeUsage
7553 attribute for this type.
7554 (Attribute.ApplyAttributes): Method renamed to Emit and make
7556 (GlobalAttributeSection): New class for special handling of global
7557 attributes (assembly, module).
7558 (AttributeSection.Emit): New method.
7560 * class.cs: Implemented Attributable abstract methods.
7561 (MethodCore.LabelParameters): Moved to Parameter class.
7562 (Accessor): Is back simple class.
7563 (PropertyMethod): Implemented Attributable abstract class.
7564 (DelegateMethod): Implemented Attributable abstract class.
7565 (Event): New constructor for disctintion between normal Event
7566 and Event with accessors.
7568 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7570 * codegen.cs, const.cs, decl.cs, delegate.cs:
7571 (CommonAssemblyModulClass): Implemented Attributable abstract class
7574 * enum.cs: Implement IAttributeSupport interface.
7575 (EnumMember): New class for emum members. Implemented Attributable
7579 (ParameterBase): Is abstract.
7580 (ReturnParameter): New class for easier [return:] attribute handling.
7582 * typemanager.cs: Removed builder_to_attr.
7584 2004-05-11 Raja R Harinath <rharinath@novell.com>
7587 * attribute.cs (Attribute.GetPositionalValue): New function.
7588 * class.cs (TypeContainer.VerifyMembers): New function.
7589 (TypeContainer.Emit): Use it.
7590 (ClassOrStruct): New base class for Class and Struct.
7591 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
7592 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7594 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7595 then each non-static field should have a FieldOffset attribute.
7596 Otherwise, none of the fields should have a FieldOffset attribute.
7597 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
7598 and FieldOffset attributes.
7599 * typemanager.cs (TypeManager.struct_layout_attribute_type)
7600 (TypeManager.field_offset_attribute_type): New core types.
7601 (TypeManager.InitCoreTypes): Initialize them.
7603 2004-05-11 Michal Moskal <malekith@pld-linux.org>
7605 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7606 Return correct type.
7609 2004-05-09 Miguel de Icaza <miguel@ximian.com>
7611 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7612 be implicitly converted to ulong.
7614 * expression.cs: The logic for allowing operator &, | and ^ worked
7615 was wrong, it worked before because we did not report an error in
7616 an else branch. Fixes 57895.
7618 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7619 allow volatile fields to be reference types.
7621 2004-05-07 Miguel de Icaza <miguel@ximian.com>
7623 * driver.cs: Add support for /debug-
7625 2004-05-07 Raja R Harinath <rharinath@novell.com>
7627 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
7628 Add a 'complain' parameter to silence errors.
7629 (Attribute.Resolve): Update to changes. Put in sanity check to catch
7630 silently overlooked type-resolutions.
7631 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7633 (Attributes.Search): New function.
7634 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7635 (Attributes.GetAttributeFullName): Remove hack.
7636 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
7637 Update to reflect changes.
7638 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7639 Use Attributes.Search instead of nested loops.
7641 2004-05-07 Marek Safar <marek.safar@seznam.cz>
7644 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7645 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7646 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7648 * report.cs: (Report.Warning): Renamed to Warning_T because of
7649 parameter collision.
7651 2004-05-05 Raja R Harinath <rharinath@novell.com>
7653 * expression.cs (MemberAccess.ResolveMemberAccess):
7654 Exit with non-zero status after Report.Error.
7655 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7657 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7659 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7661 * support.cs: Don't hang when the file is empty.
7663 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7665 * support.cs: In SeekableStreamReader, compute the preamble size of the
7666 underlying stream. Position changes should take into account that initial
7669 2004-05-03 Todd Berman <tberman@sevenl.net>
7671 * driver.cs: remove unused GetSysVersion function.
7673 2004-05-03 Todd Berman <tberman@sevenl.net>
7675 * driver.cs: Remove the hack from saturday, as well as the hack
7676 from jackson (LoadAssemblyFromGac), also adds the CWD to the
7677 link_paths to get that bit proper.
7679 2004-05-01 Todd Berman <tberman@sevenl.net>
7681 * driver.cs: Try a LoadFrom before a Load, this checks the current
7682 path. This is currently a bug in mono that is be fixed, however, this
7683 provides a workaround for now. This will be removed when the bug
7686 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
7688 * CryptoConvert.cs: Updated to latest version. Fix issue with
7689 incomplete key pairs (#57941).
7691 2004-05-01 Todd Berman <tberman@sevenl.net>
7693 * driver.cs: Remove '.' from path_chars, now System.* loads properly
7696 2004-04-30 Jackson Harper <jackson@ximian.com>
7698 * codegen.cs: Open keys readonly.
7700 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7702 * typemanager.cs: don't report cyclic struct layout when a struct
7703 contains 2 or more fields of the same type. Failed for Pango.AttrShape
7704 which has 2 Pango.Rectangle fields.
7706 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
7708 * expression.cs: Handle IntPtr comparisons with IL code
7709 rather than a method call.
7711 2004-04-29 Martin Baulig <martin@ximian.com>
7713 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
7714 the list of PropertyInfo's in class hierarchy and find the
7715 accessor. Fixes #56013.
7717 2004-04-29 Martin Baulig <martin@ximian.com>
7719 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7721 2004-04-29 Martin Baulig <martin@ximian.com>
7723 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7725 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7727 2004-04-29 Martin Baulig <martin@ximian.com>
7729 * class.cs (ConstructorInitializer.Resolve): Check whether the
7730 parent .ctor is accessible. Fixes #52146.
7732 2004-04-29 Martin Baulig <martin@ximian.com>
7734 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7736 * statement.cs (Using.EmitLocalVariableDecls): Use
7737 TypeManager.idisposable_type, not typeof (IDisposable).
7738 (Foreach.EmitCollectionForeach): Added support for valuetypes.
7740 2004-04-29 Martin Baulig <martin@ximian.com>
7742 * class.cs (Event.Define): Don't emit the field and don't set
7743 RTSpecialName and SpecialName for events on interfaces. Fixes
7746 2004-04-29 Raja R Harinath <rharinath@novell.com>
7748 Refactor Attribute.ApplyAttributes.
7749 * attribute.cs (Attributable): New base class for objects that can
7750 have Attributes applied on them.
7751 (Attribute): Make AttributeUsage fields public.
7752 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7753 (Attribute.IsInternalCall): New property.
7754 (Attribute.UsageAttr): Convert to a public read-only property.
7755 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7756 (Attribute.ResolveType, Attribute.Resolve)
7757 (Attribute.ScanForIndexerName): Update to reflect changes.
7758 (Attribute.CheckAttributeTarget): Re-format.
7759 (Attribute.ApplyAttributes): Refactor, to various
7760 Attributable.ApplyAttributeBuilder methods.
7761 * decl.cs (MemberCore): Make Attributable.
7762 * class.cs (Accessor): Make Attributable.
7763 (MethodData.ApplyAttributes): Use proper attribute types, not
7765 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7766 (TypeContainer.ApplyAttributeBuilder)
7767 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7768 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
7769 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7770 (Operator.ApplyAttributeBuilder): New factored-out methods.
7771 * const.cs (Const.ApplyAttributeBuilder): Likewise.
7772 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7773 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7774 * parameter.cs (ParameterBase): New Attributable base class
7775 that can also represent Return types.
7776 (Parameter): Update to the changes.
7778 2004-04-29 Jackson Harper <jackson@ximian.com>
7780 * driver.cs: Prefer the corlib system version when looking for
7781 assemblies in the GAC. This is still a hack, but its a better hack
7784 2004-04-29 Marek Safar <marek.safar@seznam.cz>
7786 * decl.cs, enum.cs: Improved error 3005 reporting.
7788 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7789 (related_symbols): New private member for list of symbols
7790 related to reported error/warning.
7792 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7794 2004-04-29 Martin Baulig <martin@ximian.com>
7796 * ecore.cs (Expression.Constantify): If we're an enum and
7797 TypeManager.TypeToCoreType() doesn't give us another type, use
7798 t.UnderlyingSystemType. Fixes #56178.
7800 2004-04-29 Martin Baulig <martin@ximian.com>
7802 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7803 interfaces and for each interface, only add members directly
7804 declared in that interface. Fixes #53255.
7806 2004-04-28 Martin Baulig <martin@ximian.com>
7808 * expression.cs (ConditionalLogicalOperator): Use a temporary
7809 variable for `left' to avoid that we evaluate it more than once;
7812 2004-04-28 Martin Baulig <martin@ximian.com>
7814 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7817 2004-04-28 Martin Baulig <martin@ximian.com>
7819 * statement.cs (LocalInfo.Resolve): Check whether the type is not
7822 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7823 whether the type is not void (CS1547).
7825 2004-04-28 Martin Baulig <martin@ximian.com>
7827 * expression.cs (Unary.DoResolveLValue): Override this and report
7828 CS0131 for anything but Operator.Indirection.
7830 2004-04-28 Martin Baulig <martin@ximian.com>
7832 Committing a patch from Ben Maurer; see bug #50820.
7834 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7837 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7840 2004-04-28 Martin Baulig <martin@ximian.com>
7842 Committing a patch from Ben Maurer; see bug #50820.
7844 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7847 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7850 2004-04-28 Martin Baulig <martin@ximian.com>
7852 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7853 (Block.AddLabel): Call DoLookupLabel() to only search in the
7856 2004-04-28 Martin Baulig <martin@ximian.com>
7858 * cfold.cs (ConstantFold.BinaryFold): Added special support for
7859 comparing StringConstants and NullLiterals in Equality and Inequality.
7861 2004-04-28 Jackson Harper <jackson@ximian.com>
7863 * driver.cs: Attempt to load referenced assemblies from the
7864 GAC. This is the quick and dirty version of this method that
7865 doesnt take into account versions and just takes the first
7866 canidate found. Will be good enough for now as we will not have more
7867 then one version installed into the GAC until I update this method.
7869 2004-04-28 Martin Baulig <martin@ximian.com>
7871 * typemanager.cs (TypeManager.CheckStructCycles): New public
7872 static method to check for cycles in the struct layout.
7874 * rootcontext.cs (RootContext.PopulateTypes): Call
7875 TypeManager.CheckStructCycles() for each TypeContainer.
7876 [Note: We only need to visit each type once.]
7878 2004-04-28 Martin Baulig <martin@ximian.com>
7880 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7882 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7883 success and added `out object value'. Use a `bool resolved' field
7884 to check whether we've already been called rather than
7885 `ConstantValue != null' since this breaks for NullLiterals.
7887 2004-04-28 Raja R Harinath <rharinath@novell.com>
7889 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7890 setting of this flag, since the 'set' method may be non-public.
7892 2004-04-28 Raja R Harinath <rharinath@novell.com>
7894 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7895 check on current_vector.Block.
7897 2004-04-27 Martin Baulig <martin@ximian.com>
7899 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7900 a field initializer. Fixes #56459.
7902 2004-04-27 Martin Baulig <martin@ximian.com>
7904 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7905 we're not attempting to use an indexer. Fixes #52154.
7907 2004-04-27 Martin Baulig <martin@ximian.com>
7909 * statement.cs (Return): Don't create a return label if we don't
7910 need it; reverts my change from January 20th. Thanks to Ben
7913 2004-04-27 Martin Baulig <martin@ximian.com>
7915 According to the spec, `goto' can only leave a nested scope, but
7918 * statement.cs (Block.LookupLabel): Only lookup in the current
7919 block, don't recurse into parent or child blocks.
7920 (Block.AddLabel): Check in parent and child blocks, report
7921 CS0140/CS0158 if we find a duplicate.
7922 (Block): Removed this indexer for label lookups.
7923 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7924 this already does the error reporting for us.
7927 (FlowBranching.UsageVector.Block): New public variable; may be null.
7928 (FlowBranching.CreateSibling): Added `Block' argument.
7929 (FlowBranching.LookupLabel): New public virtual method. Lookup a
7930 label for the target of a `goto' and check whether we're not
7931 leaving a `finally'.
7933 2004-04-27 Martin Baulig <martin@ximian.com>
7935 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7936 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7939 2004-04-27 Martin Baulig <martin@ximian.com>
7941 * statement.cs (Block.AddLabel): Also check for implicit blocks
7942 and added a CS0158 check.
7944 2004-04-27 Martin Baulig <martin@ximian.com>
7946 * flowanalysis.cs (FlowBranchingLoop): New class.
7947 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7948 UsageVector's instead of an ArrayList.
7949 (FlowBranching.Label): Likewise.
7950 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7951 (FlowBranching.AddBreakVector): New method.
7953 2004-04-27 Miguel de Icaza <miguel@ximian.com>
7955 * attribute.cs: Small regression fix: only convert the type if we
7956 the type is different, fixes System.Drawing build.
7958 2004-04-27 Martin Baulig <martin@ximian.com>
7960 * attribute.cs (Attribute.Resolve): If we have a constant value
7961 for a named field or property, implicity convert it to the correct
7964 2004-04-27 Raja R Harinath <rharinath@novell.com>
7966 * statement.cs (Block.Block): Implicit blocks share
7967 'child_variable_names' fields with parent blocks.
7968 (Block.AddChildVariableNames): Remove.
7969 (Block.AddVariable): Mark variable as "used by a child block" in
7970 every surrounding block.
7971 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7972 been used in a child block, complain about violation of "Invariant
7973 meaning in blocks" rule.
7974 * cs-parser.jay (declare_local_variables): Don't use
7975 AddChildVariableNames.
7976 (foreach_statement): Don't create an implicit block: 'foreach'
7979 2004-04-23 Miguel de Icaza <miguel@ximian.com>
7981 * convert.cs (ImplicitNumericConversion): 0 is also positive when
7982 converting from 0L to ulong. Fixes 57522.
7984 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7986 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7987 derived class hides via 'new' keyword field from base class (test-242.cs).
7988 TODO: Handle this in the more general way.
7990 * class.cs (CheckBase): Ditto.
7992 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7994 * decl.cs (caching_flags): New member for storing cached values
7996 (MemberCore.Flags): New enum where bit flags for caching_flags
7998 (MemberCore.cls_compliance): Moved to caching_flags.
7999 (DeclSpace.Created): Moved to caching_flags.
8001 * class.cs: Use caching_flags instead of DeclSpace.Created
8003 2004-04-21 Miguel de Icaza <miguel@ximian.com>
8005 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
8006 if we are only a derived class, not a nested class.
8008 * typemanager.cs: Same as above, but do this at the MemberLookup
8009 level (used by field and methods, properties are handled in
8010 PropertyExpr). Allow for the qualified access if we are a nested
8013 2004-04-21 Marek Safar <marek.safar@seznam.cz>
8015 * class.cs: Refactoring.
8016 (IMethodData): New inteface; Holds links to parent members
8017 to avoid member duplication (reduced memory allocation).
8018 (Method): Implemented IMethodData interface.
8019 (PropertyBase): New inner classes for get/set methods.
8020 (PropertyBase.PropertyMethod): Implemented IMethodData interface
8021 (Event): New inner classes for add/remove methods.
8022 (Event.DelegateMethod): Implemented IMethodData interface.
8024 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8025 EmitContext (related to class.cs refactoring).
8027 2004-04-21 Raja R Harinath <rharinath@novell.com>
8029 * delegate.cs (Delegate.VerifyApplicability): If the number of
8030 arguments are the same as the number of parameters, first try to
8031 verify applicability ignoring any 'params' modifier on the last
8035 2004-04-08 Martin Baulig <martin@ximian.com>
8037 Merged latest changes into gmcs. Please keep this comment in
8038 here, it makes it easier for me to see what changed in MCS since
8039 the last time I merged.
8041 2004-04-16 Raja R Harinath <rharinath@novell.com>
8043 * class.cs (TypeContainer.AddIndexer): Use
8044 'ExplicitInterfaceName' to determine if interface name was
8045 explicitly specified. 'InterfaceType' is not initialized at this time.
8046 (TypeContainer.DefineIndexers): Remove use of temporary list. The
8047 Indexers array is already in the required order. Initialize
8048 'IndexerName' only if there are normal indexers.
8049 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8050 (TypeContainer.Emit): Emit DefaultMember attribute only if
8051 IndexerName is initialized.
8054 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
8056 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8059 2004-04-15 Raja R Harinath <rharinath@novell.com>
8061 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
8065 * attribute.cs (Attribute.Resolve): Check for duplicate named
8069 2004-04-15 Miguel de Icaza <miguel@ximian.com>
8071 * iterators.cs (MarkYield): track whether we are in an exception,
8072 and generate code accordingly. Use a temporary value to store the
8073 result for our state.
8075 I had ignored a bit the interaction of try/catch with iterators
8076 since their behavior was not entirely obvious, but now it is
8077 possible to verify that our behavior is the same as MS .NET 2.0
8081 2004-04-14 Miguel de Icaza <miguel@ximian.com>
8083 * iterators.cs: Avoid creating temporaries if there is no work to
8086 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8087 Enumerations, use TypeManager.EnumToUnderlying and call
8090 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8093 (This.Emit): Use EmitContext.EmitThis to emit our
8096 (This.EmitAssign): Ditto.
8098 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8099 codepaths, we will move all the functionality into
8102 (FieldExpr.EmitAssign): Ditto.
8104 This fixes several hidden bugs that I uncovered while doing a code
8105 review of this today.
8107 * codegen.cs (EmitThis): reworked so the semantics are more clear
8108 and also support value types "this" instances.
8110 * iterators.cs: Changed so that for iterators in value types, we
8111 do not pass the value type as a parameter.
8113 Initialization of the enumerator helpers is now done in the caller
8114 instead of passing the parameters to the constructors and having
8115 the constructor set the fields.
8117 The fields have now `assembly' visibility instead of private.
8119 2004-04-11 Miguel de Icaza <miguel@ximian.com>
8121 * expression.cs (Argument.Resolve): Check if fields passed as ref
8122 or out are contained in a MarshalByRefObject.
8124 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8125 another compiler type.
8127 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
8129 * class.cs (Indexer.Define): use the new name checking method.
8130 Also, return false on an error.
8131 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8132 (is_identifier_[start/part]_character): make static.
8134 2004-04-10 Miguel de Icaza <miguel@ximian.com>
8136 * expression.cs (Binary.ResolveOperator): Do no append strings
8137 twice: since we can be invoked more than once (array evaluation)
8138 on the same concatenation, take care of this here. Based on a fix
8139 from Ben (bug #56454)
8141 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8143 * codegen.cs: Fix another case where CS1548 must be reported (when
8144 delay-sign isn't specified and no private is available #56564). Fix
8145 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8146 error when MCS is used on the MS runtime and we need to delay-sign
8147 (which seems unsupported by AssemblyBuilder - see #56621).
8149 2004-04-08 Marek Safar <marek.safar@seznam.cz>
8151 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8152 (TypeManager.ComputeNamespaces): Faster implementation for
8155 * compiler.csproj: Updated AssemblyName to mcs.
8157 2004-05-11 Jackson Harper <jackson@ximian.com>
8159 * Makefile: Preserve MONO_PATH
8161 2004-05-11 Jackson Harper <jackson@ximian.com>
8163 * Makefile: Use mono and mcs to build gmcs
8165 2004-05-03 Miguel de Icaza <miguel@ximian.com>
8167 * codegen.cs: Add patch from Robert Shade
8168 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
8171 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
8173 * CryptoConvert.cs: Updated to latest version. Fix issue with
8174 incomplete key pairs (#57941).
8176 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8178 * codegen.cs: Fix another case where CS1548 must be reported (when
8179 delay-sign isn't specified and no private is available #56564). Fix
8180 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8181 error when MCS is used on the MS runtime and we need to delay-sign
8182 (which seems unsupported by AssemblyBuilder - see #56621).
8184 2004-04-29 Jackson Harper <jackson@ximian.com>
8186 * Makefile: Set MONO_PATH to use the bootstrap corlib
8187 * driver.cs: Check the GAC for referenced assemblies.
8189 2004-04-29 Martin Baulig <martin@ximian.com>
8191 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
8193 2004-04-07 Martin Baulig <martin@ximian.com>
8195 * expression.cs (Binary.ResolveOperator): Added special case for
8196 Equality/Inequality between a type parameter and a null literal.
8198 2004-04-07 Martin Baulig <martin@ximian.com>
8200 * convert.cs: Check null literal -> type parameter conversions.
8202 2004-04-07 Martin Baulig <martin@ximian.com>
8204 * generic.cs (ConstructedType.CheckConstraints): Enforce the
8205 `class' and `struct' constraints.
8207 2004-04-07 Martin Baulig <martin@ximian.com>
8209 * generic.cs (SpecialConstraint): New public enum.
8210 (Constraints.Resolve): Added support for the `class' and `struct'
8213 * cs-parser.jay (type_parameter_constraint): Added support for the
8214 `class' and `struct' constraints.
8216 2004-04-07 Martin Baulig <martin@ximian.com>
8218 * support.cs (GenericConstraints): Replaced `Types' by
8219 `ClassConstraint' and `InterfaceConstraints'; added
8220 `HasClassConstraint'.
8222 2004-04-07 Martin Baulig <martin@ximian.com>
8225 (Constraints.InterfaceConstraints): New public property.
8226 (Constraints.Types): Make this property public
8227 (TypeParameter): Implement IMemberContainer.
8228 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
8229 instead of a TypeBuilder/MethodBuilder; pass the interface
8230 constraints to TypeManager.AddTypeParameter().
8231 (TypeParameter.DefineType): Just take an EmitContext and no
8232 TypeBuilder/MethodBuilder. Use the new public API.
8234 * typemanager.cs (TypeManager.AddTypeParameter): Added
8235 `TypeExpr[]' argument; add the interfaces to the
8236 `builder_to_ifaces' hash.
8237 (TypeManager.LookupMemberContainer): For
8238 GenericTypeParameterBuilders, get the TypeParameter from the
8239 `builder_to_type_param'.
8240 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
8241 the TypeParameter and call FindMembers on it.
8243 2004-04-07 Martin Baulig <martin@ximian.com>
8246 (MethodCore.GenericMethod): Moved this field here from Method.
8247 (MethodCore.IsDuplicateImplementation): Take the number of type
8248 parameters into account if we're a generic method.
8250 * expression.cs (Invocation.InferTypeArguments): Don't return true
8251 if `arguments' is null; we still need to check whether we actually
8252 don't need to infer anything in this case.
8253 (MemberAccess): Merged the functionality from GenericMemberAccess
8256 * generic.cs (GenericMemberAccess): Removed.
8258 2004-04-05 Martin Baulig <martin@ximian.com>
8260 * decl.cs (MemberCore): For generic classes, interfaces and
8261 structs, `Name' now includes the number of type parameters
8263 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
8264 encode the number of type arguments in the type name.
8266 * expression.cs (Expression.MemberLookup): Removed the
8267 `num_type_args' argument; we now encode the number of type
8268 arguments in the type name.
8270 * ecore.cs (SimpleName): Encode the number of type arguments in
8271 the type name itself.
8273 * generic.cs (ConstructedType): Likewise.
8275 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
8276 `MemberName'; we now include the number of type parameters in the
8279 * typemanager.cs (TypeManager.CheckGeneric): Removed.
8280 (TypeManager.MemberLookup): Removed the
8281 `num_type_args' argument; we now encode the number of type
8282 arguments in the type name.
8284 2004-04-03 Martin Baulig <martin@ximian.com>
8286 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
8287 (MemberCore.MemberName): Moved here from MemberBase.
8288 (DeclSpace.SetParameterInfo): Just take the constraints as an
8289 ArrayList; we already have the type parameters in our
8290 `MemberName'; also do the CS0080 reporting here.
8292 * cs-parser.jay (struct_declaration): Use `member_name' instead of
8293 `IDENTIFIER opt_type_parameter_list'; when constructing our
8294 `MemberName', it'll already include our type parameters.
8295 (class_declaration, interface_declaration): Likewise.
8296 (delegate_declaration): Likewise.
8297 (MakeName): Take a MemberName and return a MemberName.
8298 The following two changes are required to avoid shift/reduce conflicts:
8299 (member_name): Don't include a TypeName anymore; ie. this is now
8300 just 'IDENTIFIER opt_type_parameter_list'.
8301 (property_declaration, event_declaration): Use a
8302 `namespace_or_type_name' instead of a `member_name'.
8304 2004-04-03 Martin Baulig <martin@ximian.com>
8306 * decl.cs (MemberName): Renamed to `TypeName' and created a new
8308 (TypeName): Formerly known as MemberName.
8310 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
8311 instead of a `MemberName'.
8313 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
8314 (member_name): New rule; create a MemberName.
8316 2004-04-02 Martin Baulig <martin@ximian.com>
8318 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
8319 (CS0305 and CS0308).
8321 2004-04-02 Martin Baulig <martin@ximian.com>
8323 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
8324 support for nested types.
8326 2004-04-02 Martin Baulig <martin@ximian.com>
8328 * ecore.cs (IAlias): New public interface.
8329 (TypeExpr, TypeExpression): Implement IAlias.
8330 (TypeAliasExpression): New public class.
8332 * namespace.cs (Namespace): Implement IAlias.
8333 (Namespace.Lookup): Return an IAlias instead on an object.
8334 (Namespace.DefineName): Take an IAlias instead of an object.
8335 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
8337 (NamespaceEntry.UsingAlias): Take a Membername instead of an
8339 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
8341 (NamespaceEntry.Lookup): Likewise.
8343 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
8346 * decl.cs (DeclSpace): Implement IAlias.
8347 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
8349 * generic.cs (ConstructedType): Improved error checking.
8351 2004-04-02 Martin Baulig <martin@ximian.com>
8353 * convert.cs: Added type parameter conversions.
8356 (UnboxCast.Emit): Emit an `unbox.any' for type params.
8357 (ClassCast.Emit): If the source type is a type parameter, box it.
8358 If the target type is a type parameter, emit an `unbox.any'
8359 instead of a `classcast'.1
8361 2004-04-01 Martin Baulig <martin@ximian.com>
8363 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
8365 2004-04-01 Martin Baulig <martin@ximian.com>
8367 * generic.cs (ConstructedType.CheckConstraints): Use
8368 Convert.ImplicitStandardConversionExists(); user-defined implicit
8369 conversions are not allowed according to the spec.
8371 2004-03-30 Martin Baulig <martin@ximian.com>
8373 * expression.cs (New): Added support for type parameters.
8376 (TypeManager.activator_type): New public static field.
8377 (TypeManager.activator_create_instance): Likewise.
8379 2004-03-30 Martin Baulig <martin@ximian.com>
8381 * typemanager.cs (TypeManager.HasConstructorConstraint): New
8384 2004-03-30 Martin Baulig <martin@ximian.com>
8386 * generic.cs (ConstructedType.CheckConstraints): Actually follow
8387 the spec here: the argument type must be convertible to the
8390 2004-03-30 Martin Baulig <martin@ximian.com>
8393 (TypeParameter.Define, TypeParameter.DefineMethod): Call
8394 TypeManager.AddTypeParameter().
8395 (ConstructedType.CheckConstraints): Re-enable this and actually
8396 check whether we have a constructor constraint.
8399 (TypeManager.builder_to_type_param): New static field.
8400 (TypeManager.AddTypeParameter): New static method.
8401 (TypeManager.LookupTypeParameter): New public method.
8403 2004-03-30 Martin Baulig <martin@ximian.com>
8405 * generic.cs (TypeParameter.DefineType): Return a boolean and use
8406 the new API to actually define the constructor constraint.
8409 (TypeManager.new_constraint_attr_type): New static field.
8410 (TypeManager.InitCoreTypes): Initialize it.
8412 2004-03-30 Martin Baulig <martin@ximian.com>
8414 * generic.cs (Constraints): Completed error checking, use correct
8417 2004-03-29 Martin Baulig <martin@ximian.com>
8419 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
8421 * expression.cs (Invocation.InferTypeArguments): Added overloaded
8422 public version which takes a `ParameterData pd' instead of an
8425 2004-03-29 Martin Baulig <martin@ximian.com>
8427 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
8430 2004-03-29 Martin Baulig <martin@ximian.com>
8432 * expression.cs (Argument.ResolveMethodGroup): If we're a
8433 ConstructedType, call GetMemberAccess() on it.
8435 2004-03-29 Martin Baulig <martin@ximian.com>
8437 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
8438 (MethodCore.CheckGenericOverride): When overriding a generic
8439 method, check whether the constraints match.
8441 * support.cs (GenericConstraints): New public interface.
8442 (ParameterData.GenericConstraints): New public method.
8444 * parameter.cs (Parameter.Resolve): Check whether we're a generic
8445 method parameter and compute our constraints if appropriate.
8446 (Parameter.GenericConstraints): New public property.
8448 * generic.cs (Constraints): Implement GenericConstraints.
8450 2004-03-29 Martin Baulig <martin@ximian.com>
8452 * decl.cs (MemberCache.FindMemberToOverride): Use
8453 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
8455 2004-03-29 Martin Baulig <martin@ximian.com>
8457 * generic.cs (GenericMethod.Define): Resolve our type parameters.
8459 2004-03-29 Martin Baulig <martin@ximian.com>
8461 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
8462 not allowed on non-generic declarations").
8464 2004-03-29 Martin Baulig <martin@ximian.com>
8466 * expression.cs (Invocation.InferTypeArguments): Added overloaded
8467 public version of this method.
8469 * class.cs (MethodCore.IsDuplicateImplementation): Use
8470 Invocation.InferTypeArguments() to check this.
8472 2004-03-29 Martin Baulig <martin@ximian.com>
8474 * convert.cs: Use TypeManager.IsDelegateType() instead of
8475 comparing types correctly.
8477 2004-03-29 Martin Baulig <martin@ximian.com>
8479 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
8480 types directly to make it work for generic instances.
8482 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
8484 2004-03-29 Martin Baulig <martin@ximian.com>
8486 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
8489 2004-03-24 Martin Baulig <martin@ximian.com>
8491 * decl.cs (DeclSpace.FindType): Also use
8492 TypeManager.CheckGeneric() for types from the using clauses.
8494 2004-03-23 Martin Baulig <martin@ximian.com>
8496 * expression.cs (Invocation.OverloadResolve): Added `bool
8497 may_fail' argument and use it instead of the Location.IsNull() hack.
8499 2004-03-23 Martin Baulig <martin@ximian.com>
8501 * expression.cs (Invocation.InferType): Use correct type inference
8504 2004-03-23 Martin Baulig <martin@ximian.com>
8506 * ecore.cs (MethodGroupExpr.Name): Use
8507 TypeManager.CSharpSignature() instead of just the name.
8509 * expression.cs (Invocation.OverloadResolve): Provide better error
8511 (Invocation.DoResolve): OverloadResolve() never returns null
8512 without reporting an error, so removed the error -6 reporting here.
8514 2004-03-23 Martin Baulig <martin@ximian.com>
8516 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
8519 * cs-parser.jay (delegate_declaration): Support generic delegates.
8521 * delegate.cs: Support generic delegates.
8523 2004-03-22 Martin Baulig <martin@ximian.com>
8525 * expression.cs (Invocation.InferParamsTypeArguments): New static
8526 method; does type inference for params arguments.
8528 2004-03-21 Martin Baulig <martin@ximian.com>
8530 * typemanager.cs (TypeManager.IsGenericMethod): New public static
8531 method; checks whether a method is a generic method.
8533 * expression.cs (Invocation.InferTypeArguments): New static method;
8534 infer type arguments for generic method invocation.
8536 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
8537 property; we set this to true if we're resolving a generic method
8538 invocation and the user specified type arguments, ie. we're not
8539 doing type inference.
8541 2004-03-20 Martin Baulig <martin@ximian.com>
8543 * class.cs (MethodData.DeclaringType): New public property.
8544 (MethodData.Define): Set DeclaringType here.
8545 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
8546 instead of OperatorMethodBuilder.DeclaringType.
8548 2004-03-20 Martin Baulig <martin@ximian.com>
8550 * cs-tokenizer.cs (xtoken): Return a special
8551 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
8553 * cs-parser.jay (default_value_expression): Switch to the new
8556 2004-03-19 Martin Baulig <martin@ximian.com>
8558 * decl.cs (MemberName): New class. We use this to "construct"
8559 namespace_or_type_name's.
8561 * generics.cs (TypeArguments.GetDeclarations): New public method;
8562 returns the type arguments as a string[] and reports a CS0081 if
8563 one of them is not an identifier.
8565 * class.cs (MemberBase): The .ctor now takes the name as a
8566 MemberName instead of a string.
8567 (MemberBase.ExplicitInterfaceName): Changed type from string to
8569 (MemberBase.DoDefine): If we're an explicit implementation, the
8570 InterfaceType may be a generic instance.
8572 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
8573 (namespace_name): Call MemberName.GetName () to transform the
8574 MemberName into a string and ensure we don't have any type
8576 (type_name): Call MemberName.GetTypeExpression() to transfrom the
8577 MemberName into an expression.
8578 (method_header): Use namespace_or_type_name instead of member_name.
8580 2004-04-07 Miguel de Icaza <miguel@ximian.com>
8582 * rootcontext.cs: Add new types to the boot resolution.
8584 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8585 MulticastDelegate is not allowed.
8587 * typemanager.cs: Add new types to lookup: System.TypedReference
8590 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8591 check for TypedReference or ArgIterator, they are not allowed.
8593 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8594 makes us properly catch 1510 in some conditions (see bug 56016 for
8597 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
8599 * CryptoConvert.cs: update from corlib version
8602 2004-04-05 Miguel de Icaza <miguel@ximian.com>
8604 * class.cs (Indexer.Define): Check indexername declaration
8606 2004-04-05 Marek Safar <marek.safar@seznam.cz>
8608 * attribute.cs (IsClsCompliant): Fixed problem with handling
8609 all three states (compliant, not-compliant, undetected).
8611 2004-03-30 Marek Safar <marek.safar@seznam.cz>
8613 * attribute.cs (Attribute): Location is now public.
8614 (Resolve): Store resolved arguments (pos_values) in attribute class.
8615 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8616 (GetClsCompliantAttributeValue): New method that gets
8617 CLSCompliantAttribute value.
8618 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8619 if exists else null.
8620 (AttributeTester): New class for CLS-Compliant verification routines.
8622 * class.cs (Emit): Add CLS-Compliant verification.
8623 (Method.GetSignatureForError): Implemented.
8624 (Constructor.GetSignatureForError): Implemented
8625 (Constructor.HasCompliantArgs): Returns if constructor has
8626 CLS-Compliant arguments.
8627 (Constructor.Emit): Override.
8628 (Construcor.IsIdentifierClsCompliant): New method; For constructors
8629 is needed to test only parameters.
8630 (FieldBase.GetSignatureForError): Implemented.
8631 (TypeContainer): New member for storing base interfaces.
8632 (TypeContainer.FindMembers): Search in base interfaces too.
8634 * codegen.cs (GetClsComplianceAttribute): New method that gets
8635 assembly or module CLSCompliantAttribute value.
8636 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8638 (ModuleClass.Emit): Add error 3012 test.
8640 * const.cs (Emit): Override and call base for CLS-Compliant tests.
8642 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8643 state for all decl types.
8644 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8645 if CLS-Compliant tests are required.
8646 (IsClsCompliaceRequired): New method. Analyze whether code
8647 must be CLS-Compliant.
8648 (IsExposedFromAssembly): New method. Returns true when MemberCore
8649 is exposed from assembly.
8650 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8651 value or gets cached value.
8652 (HasClsCompliantAttribute): New method. Returns true if MemberCore
8653 is explicitly marked with CLSCompliantAttribute.
8654 (IsIdentifierClsCompliant): New abstract method. This method is
8655 used to testing error 3005.
8656 (IsIdentifierAndParamClsCompliant): New method. Common helper method
8657 for identifier and parameters CLS-Compliant testing.
8658 (VerifyClsCompliance): New method. The main virtual method for
8659 CLS-Compliant verifications.
8660 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8661 null. I don't know why is null (too many public members !).
8662 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8663 and get value of first CLSCompliantAttribute that found.
8665 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8666 (VerifyClsCompliance): Override and add extra tests.
8668 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8669 clscheck- disable CLS-Compliant verification event if assembly is has
8670 CLSCompliantAttribute(true).
8672 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8673 ApllyAttribute is now called in emit section as in the other cases.
8674 Possible future Emit integration.
8675 (IsIdentifierClsCompliant): New override.
8676 (VerifyClsCompliance): New override.
8677 (GetEnumeratorName): Returns full enum name.
8679 * parameter.cs (GetSignatureForError): Implemented.
8681 * report.cs (WarningData): New struct for Warning message information.
8682 (LocationOfPreviousError): New method.
8683 (Warning): New method. Reports warning based on the warning table.
8684 (Error_T): New method. Reports error based on the error table.
8686 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8687 verifications are done here.
8689 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8691 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8692 CLSCompliantAttribute.
8693 (all_imported_types): New member holds all imported types from other
8695 (LoadAllImportedTypes): New method fills static table with exported types
8696 from all referenced assemblies.
8697 (Modules): New property returns all assembly modules.
8699 2004-03-30 Miguel de Icaza <miguel@ximian.com>
8701 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8702 throwing a parser error.
8704 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8705 which removes the hardcoded get_/set_ prefixes for properties, as
8706 IL allows for the properties to be named something else.
8710 * expression.cs: Do not override operand before we know if it is
8713 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8715 * typemanager.cs: support for pinned variables.
8717 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8719 * decl.cs, typemanager.cs: Avoid using an arraylist
8720 as a buffer if there is only one result set.
8722 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8724 * expression.cs: Make sure you cant call a static method
8725 with an instance expression, bug #56174.
8727 2004-03-29 Miguel de Icaza <miguel@ximian.com>
8729 * class.cs (IsDuplicateImplementation): Improve error reporting to
8730 flag 663 (method only differs in parameter modifier).
8732 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8733 in preprocessor directives.
8735 * location.cs (LookupFile): Allow for the empty path.
8737 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
8738 better approach for some of that patch, but its failing with the
8739 CharSet enumeration. For now try/catch will do.
8741 * typemanager.cs: Do not crash if a struct does not have fields.
8744 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8746 * expression.cs: cs0213, cant fix a fixed expression.
8749 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8751 * cs-parser.jay: detect invalid embeded statements gracefully.
8754 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8756 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8759 the invocation type may not be a subclass of the tye of the item/
8760 The type of the item must be a subclass of the invocation item.
8765 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
8767 * attribute.cs: Added methods to get a string and a bool from an
8768 attribute. Required to information from AssemblyKeyFileAttribute,
8769 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8770 * codegen.cs: Modified AssemblyName creation to include support for
8771 strongnames. Catch additional exceptions to report them as CS1548.
8772 * compiler.csproj: Updated include CryptoConvert.cs.
8773 * compiler.csproj.user: Removed file - user specific configuration.
8774 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
8775 Mono.Security assembly. The original class is maintained and tested in
8776 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8777 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8778 like CSC 8.0 (C# v2) supports.
8779 * Makefile: Added CryptoConvert.cs to mcs sources.
8780 * rootcontext.cs: Added new options for strongnames.
8782 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
8784 * driver.cs: For --expect-error, report error code `2'
8785 if the program compiled with no errors, error code `1' if
8786 it compiled with an error other than the one expected.
8788 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
8790 * compiler.csproj: Updated for Visual Studio .NET 2003.
8791 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8792 * compiler.sln: Updated for Visual Studio .NET 2003.
8794 2004-03-24 Ravi Pratap M <ravi@ximian.com>
8796 * expression.cs: Fix bug #47234. We basically need to apply the
8797 rule that we prefer the conversion of null to a reference type
8798 when faced with a conversion to 'object' (csc behaviour).
8800 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8802 * statement.cs: Shorter form for foreach, eliminates
8803 a local variable. r=Martin.
8805 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8807 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8808 checks if we can use brtrue/brfalse to test for 0.
8809 * expression.cs: use the above in the test for using brtrue/brfalse.
8812 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8814 * expression.cs: Rewrite string concat stuff. Benefits:
8816 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8817 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8818 rather than a concat chain.
8820 * typemanager.cs: Add lookups for more concat overloads.
8822 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8824 * expression.cs: Emit shorter il code for array init.
8841 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
8843 * statement.cs: Before, two switch blocks would be merged if the
8844 total size of the blocks (end_item - begin_item + 1) was less than
8845 two times the combined sizes of the blocks.
8847 Now, it will only merge if after the merge at least half of the
8852 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
8854 * class.cs : csc build fix for GetMethods(). See bug #52503.
8856 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
8858 * expression.cs: Make sure fp comparisons work with NaN.
8859 This fixes bug #54303. Mig approved this patch a long
8860 time ago, but we were not able to test b/c the runtime
8863 2004-03-19 Miguel de Icaza <miguel@ximian.com>
8865 * ecore.cs (TypExpr.GetHashCode): implement this overload.
8867 2004-03-19 Martin Baulig <martin@ximian.com>
8869 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
8870 two overloads may unify for some type parameter substitutions and
8871 report a CS0408 if appropriate.
8873 2004-03-19 Martin Baulig <martin@ximian.com>
8875 * class.cs (MemberCore.IsDuplicateImplementation): Report the
8876 error here and not in our caller.
8878 2004-03-19 Martin Baulig <martin@ximian.com>
8880 * interface.cs: Completely killed this file.
8881 (Interface): We're now a TypeContainer and live in class.cs.
8883 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8884 argument; we're now also called for interfaces.
8885 (TypeContainer.DefineMembers): Allow this method being called
8887 (TypeContainer.GetMethods): New public method; formerly known as
8888 Interface.GetMethod(). This is used by PendingImplementation.
8889 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8890 it's now private and non-static.
8891 (Interface): Moved this here; it's now implemented similar to
8893 (Method, Property, Event, Indexer): Added `bool is_interface'
8894 argument to their .ctor's.
8895 (MemberBase.IsInterface): New public field.
8897 * cs-parser.jay: Create normal Method, Property, Event, Indexer
8898 instances instead of InterfaceMethod, InterfaceProperty, etc.
8899 (opt_interface_base): Removed; we now use `opt_class_base' instead.
8900 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8902 2004-03-19 Martin Baulig <martin@ximian.com>
8904 * class.cs (MethodCore.IsDuplicateImplementation): New private
8905 method which does the CS0111 checking.
8906 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8907 Use IsDuplicateImplementation().
8909 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
8911 * decl.cs (FindMemberToOverride): New method to find the correct
8912 method or property to override in the base class.
8914 - Make Method/Property use the above method to find the
8915 version in the base class.
8916 - Remove the InheritableMemberSignatureCompare as it is now
8919 This patch makes large code bases much faster to compile, as it is
8920 O(n) rather than O(n^2) to do this validation.
8922 Also, it fixes bug 52458 which is that nested classes are not
8923 taken into account when finding the base class member.
8925 Reviewed/Approved by Martin.
8927 2004-03-17 Martin Baulig <martin@ximian.com>
8929 * expression.cs (MemberAccess.DoResolve): Take the parent's number
8930 of type arguments into account; use the `real_num_type_args'
8931 approach like in DoResolveAsTypeStep().
8933 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
8936 2004-03-17 Marek Safar <marek.safar@seznam.cz>
8938 * interface.cs: In all interface classes removed redundant
8939 member initialization.
8941 2004-03-16 Martin Baulig <martin@ximian.com>
8943 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8945 2004-03-15 Miguel de Icaza <miguel@ximian.com>
8947 * decl.cs (DefineTypeAndParents): New helper method to define a
8948 type's containers before the type itself is defined; This is a
8949 bug exposed by the recent changes to Windows.Forms when an
8950 implemented interface was defined inside a class that had not been
8953 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8955 (Check): Loop correctly to report errors modifiers
8956 (UNSAFE was not in the loop, since it was the same as TOP).
8958 * interface.cs: Every interface member now takes a ModFlags,
8959 instead of a "is_new" bool, which we set on the base MemberCore.
8961 Every place where we called "UnsafeOk" in the interface, now we
8962 call the proper member (InterfaceMethod.UnsafeOK) instead to get
8963 the unsafe settings from the member declaration instead of the
8964 container interface.
8966 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
8968 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8969 `set_indexer_name' to the pending bits (one per type).
8971 We fixed a bug today that was picking the wrong method to
8972 override, since for properties the existing InterfaceMethod code
8973 basically ignored the method name. Now we make sure that the
8974 method name is one of the valid indexer names.
8976 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
8978 * support.cs (SeekableStreamReader): Keep track of stream byte
8979 positions and don't mix them with character offsets to the buffer.
8981 Patch from Gustavo Giráldez
8983 2004-03-15 Marek Safar <marek.safar@seznam.cz>
8985 * interface.cs (InterfaceSetGetBase): Removed double member
8986 initialization, base class does it as well.
8988 2004-03-13 Martin Baulig <martin@ximian.com>
8990 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8991 when compiling corlib.
8993 2004-03-13 Miguel de Icaza <miguel@ximian.com>
8995 * convert.cs (ExplicitConversion): We were reporting an error on
8996 certain conversions (object_type source to a value type, when the
8997 expression was `null') before we had a chance to pass it through
8998 the user defined conversions.
9000 * driver.cs: Replace / and \ in resource specifications to dots.
9003 * class.cs: Add check for duplicate operators. Fixes 52477
9005 2004-03-11 Miguel de Icaza <miguel@ximian.com>
9007 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9008 that are in the middle of the statements, not only at the end.
9011 * class.cs (TypeContainer.AddField): No longer set the
9012 `HaveStaticConstructor' flag, now we call it
9013 `UserDefineStaticConstructor' to diferentiate the slightly
9014 semantic difference.
9016 The situation is that we were not adding BeforeFieldInit (from
9017 Modifiers.TypeAttr) to classes that could have it.
9018 BeforeFieldInit should be set to classes that have no static
9023 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9025 And most importantly Zoltan's comment:
9027 http://bugzilla.ximian.com/show_bug.cgi?id=44229
9029 "I think beforefieldinit means 'it's ok to initialize the type sometime
9030 before its static fields are used', i.e. initialization does not need
9031 to be triggered by the first access to the type. Setting this flag
9032 helps the JIT to compile better code, since it can run the static
9033 constructor at JIT time, and does not need to generate code to call it
9034 (possibly lots of times) at runtime. Unfortunately, mcs does not set
9035 this flag for lots of classes like String.
9037 csc sets this flag if the type does not have an explicit static
9038 constructor. The reasoning seems to be that if there are only static
9039 initalizers for a type, and no static constructor, then the programmer
9040 does not care when this initialization happens, so beforefieldinit
9043 This bug prevents the AOT compiler from being usable, since it
9044 generates so many calls to mono_runtime_class_init that the AOT code
9045 is much slower than the JITted code. The JITted code is faster,
9046 because it does not generate these calls if the vtable is type is
9047 already initialized, which is true in the majority of cases. But the
9048 AOT compiler can't do this."
9050 2004-03-10 Miguel de Icaza <miguel@ximian.com>
9052 * class.cs (MethodData.Emit): Refactor the code so symbolic
9053 information is generated for destructors; For some reasons we
9054 were taking a code path that did not generate symbolic information
9057 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
9059 * class.cs: Create a Constructor.CheckBase method that
9060 takes care of all validation type code. The method
9061 contains some code that was moved from Define.
9063 It also includes new code that checks for duplicate ctors.
9064 This fixes bug #55148.
9066 2004-03-09 Joshua Tauberer <tauberer@for.net>
9068 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9069 a { ... }-style array creation invokes EmitStaticInitializers
9070 which is not good for reference-type arrays. String, decimal
9071 and now null constants (NullCast) are not counted toward
9072 static initializers.
9074 2004-03-05 Martin Baulig <martin@ximian.com>
9076 * location.cs (SourceFile.HasLineDirective): New public field;
9077 specifies whether the file contains or is referenced by a "#line"
9079 (Location.DefineSymbolDocuments): Ignore source files which
9080 either contain or are referenced by a "#line" directive.
9082 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
9084 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9085 direct access to our parent, so check the method inline there.
9087 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
9089 * expression.cs (Invocation.EmitCall): Miguel's last commit
9090 caused a regression. If you had:
9095 In Foo the implict this would be null.
9097 2004-02-27 Miguel de Icaza <miguel@ximian.com>
9099 * expression.cs (Invocation.EmitCall): If the method is not
9100 virtual, do not emit a CallVirt to it, use Call.
9102 * typemanager.cs (GetFullNameSignature): Improve the method to
9103 cope with ".ctor" and replace it with the type name.
9105 * class.cs (ConstructorInitializer.Resolve): Now the method takes
9106 as an argument the ConstructorBuilder where it is being defined,
9107 to catch the recursive constructor invocations.
9109 2004-03-16 Martin Baulig <martin@ximian.com>
9111 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
9112 ConstructedType, call ResolveType() on it to get the type rather
9113 than just using `expr.Type'.
9115 2004-03-16 Martin Baulig <martin@ximian.com>
9117 * generics.cs (ConstructedType.GetMemberAccess): Take the
9118 EmitContext instead on the TypeExpr and use
9119 ec.TypeContainer.CurrentType/ec.ContainerType.
9121 2004-03-16 Martin Baulig <martin@ximian.com>
9123 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
9124 parameters before aliases.
9126 2004-03-16 Martin Baulig <martin@ximian.com>
9128 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
9129 New oublic function; checks whether two generic instances may become
9130 equal under some instantiations (26.3.1).
9132 * class.cs (TypeContainer.Define): Call
9133 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
9136 2004-03-16 Martin Baulig <martin@ximian.com>
9138 * class.cs (TypeContainer.GetClassBases): Moved
9139 Error_TypeParameterAsBase() here and also check whether the base
9140 class is not an attribute.
9142 2004-03-16 Martin Baulig <martin@ximian.com>
9144 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9146 2004-03-16 Martin Baulig <martin@ximian.com>
9148 * class.cs (Error_TypeParameterAsBase): Use correct error number
9151 2004-03-16 Martin Baulig <martin@ximian.com>
9153 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
9156 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
9159 2004-03-15 Martin Baulig <martin@ximian.com>
9161 * typemanager.cs (TypeManager.GetFullName): New public method.
9162 (TypeManager.MemberLookup): Added `int_num_type_arguments'
9163 argument; only return members with the correct number of type
9165 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
9166 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
9167 whether the number of type arguments matches.
9169 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
9170 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
9172 * expression.cs (MemberAccess): Added public `NumTypeArguments'
9173 field; it's set by the protected .ctor when we're actually a
9174 GenericMemberAccess.
9175 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
9176 arguments and pass it to MemberLookupFinal ().
9178 * ecore.cs (Expression.MemberLookup): Added `int
9179 num_type_arguments' argument; only return members with the correct
9180 number of type arguments.
9181 (Expression.MemberLookupFailed): Check whether the MemberLookup
9182 failed because we did not have the correct number of type
9183 arguments; report CS0305 in this case.
9185 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
9186 `e.ResolveAsTypeTerminal()' already did so.
9188 2004-03-15 Martin Baulig <martin@ximian.com>
9190 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
9191 we're a ConstructedType; in this case, the caller must report an
9192 error (for instance CS0131).
9194 * generic.cs (TypeArguments): Added Location argument to the .ctor.
9195 (TypeArguments.Resolve): Actually report errors here.
9197 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9199 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9200 `set_indexer_name' to the pending bits (one per type).
9202 We fixed a bug today that was picking the wrong method to
9203 override, since for properties the existing InterfaceMethod code
9204 basically ignored the method name. Now we make sure that the
9205 method name is one of the valid indexer names.
9207 2004-03-15 Martin Baulig <martin@ximian.com>
9209 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
9210 for generic instances.
9212 2004-03-13 Martin Baulig <martin@ximian.com>
9214 * class.cs (TypeContainer.DefineType): Call
9215 TypeManager.AddUserType() immediately after creating the
9216 TypeBuilder; pass all type parameters when creating the
9219 * decl.cs (DeclSpace.FindNestedType): New public method.
9220 (DeclSpace.FindType): Added `int num_type_args' argument; only
9221 return types with the correct number of type parameters.
9222 (DeclSpace.CountTypeParams): New public property.
9224 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
9225 the number of type parameters; defaults to zero.
9227 * generic.cs (TypeArguments.Count): New public property.
9228 (ConstructedType.DoResolveAsTypeStep): First call
9229 ds.FindNestedType() to find out whether we're nested in the
9230 current generic type; in this case, we inherit all type parameters
9231 from the current class.
9233 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
9234 num_type_args' argument.
9235 (RootContext.LookupType): Added overloaded version which takes the
9236 number of type arguments; only return types with the correct
9237 number of type arguments.
9239 * typemanager.cs (TypeManager.CheckGeneric): New public function;
9240 checks whether `Type t' has `int num_type_args'.
9242 2004-03-13 Martin Baulig <martin@ximian.com>
9244 * generic.cs (GenericMethod.DefineType): New method; calls
9245 DefineType() on all the type parameters.
9247 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
9248 (MethodData.Define): If we're a generic method, call
9249 GenericMethod.DefineType() to define the type parameters.
9251 2004-03-10 Martin Baulig <martin@ximian.com>
9253 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
9254 instead of IsAssignableFrom.
9256 2004-03-10 Martin Baulig <martin@ximian.com>
9258 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
9260 * support.cs (ParameterData.HasArrayParameter): New property.
9261 (ReflectionParameters.ctor): Take a MethodBase instead of a
9262 ParameterInfo[]. If we have any type parameters, get the generic
9263 method definition and ask it whether we have variable arguments.
9265 2004-02-26 Miguel de Icaza <miguel@ximian.com>
9267 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9268 routines to check if a type is an enumerable/enumerator allow
9269 classes that implement the IEnumerable or IEnumerator interfaces.
9271 * class.cs (Property, Operator): Implement IIteratorContainer, and
9272 implement SetYields.
9274 (Property.Define): Do the block swapping for get_methods in the
9275 context of iterators. We need to check if Properties also
9276 include indexers or not.
9278 (Operator): Assign the Block before invoking the
9279 OperatorMethod.Define, so we can trigger the Iterator code
9282 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
9283 Property and Operator classes are not created when we parse the
9284 declarator but until we have the block completed, so we use a
9285 singleton SimpleIteratorContainer.Simple to flag whether the
9286 SetYields has been invoked.
9288 We propagate this setting then to the Property or the Operator to
9289 allow the `yield' to function.
9291 2004-02-25 Marek Safar <marek.safar@seznam.cz>
9293 * codegen.cs: Implemented attribute support for modules.
9294 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9295 Assembly/Module functionality.
9297 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9298 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9299 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9301 2004-02-16 Marek Safar <marek.safar@seznam.cz>
9303 * interface.cs (FindMembers): The operation is performed on all base
9304 interfaces and not only on the first. It is required for future CLS Compliance patch.
9306 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
9308 * statement.cs, codegen.cs:
9309 This patch deals with patterns such as:
9311 public class List : IEnumerable {
9313 public MyEnumerator GetEnumerator () {
9314 return new MyEnumerator(this);
9317 IEnumerator IEnumerable.GetEnumerator () {
9321 public struct MyEnumerator : IEnumerator {
9326 Before, there were a few things we did wrong:
9327 1) we would emit callvirt on a struct, which is illegal
9328 2) we emited ldarg when we needed to emit ldarga
9329 3) we would mistakenly call the interface methods on an enumerator
9330 type that derived from IEnumerator and was in another assembly. For example:
9332 public class MyEnumerator : IEnumerator
9334 Would have the interface methods called, even if there were public impls of the
9335 method. In a struct, this lead to invalid IL code.
9337 2004-02-11 Marek Safar <marek.safar@seznam.cz>
9339 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9342 * delegate.cs (Define): Fixed crash when delegate type is undefined.
9344 2004-02-11 Miguel de Icaza <miguel@ximian.com>
9346 * cs-parser.jay: Fix small regression: we were not testing V2
9347 compiler features correctly.
9349 * interface.cs: If the emit context is null, then create one
9351 2004-02-09 Marek Safar <marek.safar@seznam.cz>
9353 * decl.cs (GetSignatureForError): New virtual method to get full name
9356 * attribute.cs (IAttributeSupport): New interface for attribute setting.
9357 Now it is possible to rewrite ApplyAttributes method to be less if/else.
9359 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9360 Duplicated members and code in these classes has been removed.
9361 Better encapsulation in these classes.
9363 2004-02-07 Miguel de Icaza <miguel@ximian.com>
9365 * assign.cs (Assign.DoResolve): When dealing with compound
9366 assignments, there is a new rule in ECMA C# 2.4 (might have been
9367 there before, but it is documented here) that states that in:
9371 If b is of type int, and the `op' is a shift-operator, then the
9372 above is evaluated as:
9376 * expression.cs (Binary.ResolveOperator): Instead of testing for
9377 int/uint/long/ulong, try to implicitly convert to any of those
9378 types and use that in pointer arithmetic.
9380 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9381 method to print information for from the type, not from the
9382 null-method we were given.
9384 2004-02-01 Duncan Mak <duncan@ximian.com>
9386 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9387 parsing for cmd, fixes bug #53694.
9389 2004-02-04 Marek Safar <marek.safar@seznam.cz>
9391 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9392 in the member name duplication tests. Property and operator name duplication
9393 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9395 2004-02-03 Marek Safar <marek.safar@seznam.cz>
9397 * interface.cs (PopulateMethod): Fixed crash when interface method
9398 returns not existing type (error test cs0246-3.cs).
9400 2004-02-02 Ravi Pratap M <ravi@ximian.com>
9402 * cs-parser.jay (interface_accessors): Re-write actions to also
9403 store attributes attached to get and set methods. Fix spelling
9406 (inteface_property_declaration): Modify accordingly.
9408 (InterfaceAccessorInfo): New helper class to store information to pass
9409 around between rules that use interface_accessors.
9411 * interface.cs (Emit): Apply attributes on the get and set
9412 accessors of properties and indexers too.
9414 * attribute.cs (ApplyAttributes): Modify accordingly to use the
9415 right MethodBuilder when applying attributes to the get and set accessors.
9417 2004-01-31 Miguel de Icaza <miguel@ximian.com>
9419 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9421 2004-01-26 Miguel de Icaza <miguel@ximian.com>
9423 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9425 2004-01-25 Miguel de Icaza <miguel@ximian.com>
9427 * cs-parser.jay: Remove YIELD token, instead use the new grammar
9428 changes that treat `yield' specially when present before `break'
9431 * cs-tokenizer.cs: yield is no longer a keyword.
9433 2004-01-23 Marek Safar <marek.safar@seznam.cz>
9435 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9436 setting for default constructors.
9437 For default constructors are almost every time set wrong Modifier. The
9438 generated IL code has been alright. But inside mcs this values was
9439 wrong and this was reason why several of my CLS Compliance tests
9442 2004-02-27 Martin Baulig <martin@ximian.com>
9444 * generics.cs (ConstructedType.ResolveType): Make the nested type
9445 stuff actually work.
9447 2004-02-25 Martin Baulig <martin@ximian.com>
9449 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
9450 property; returns the type parameters just from the current type,
9451 ie. with the ones from outer classes.
9452 (DeclSpace.LookupGeneric): First search in the current class, then
9454 (DeclSpace.initialize_type_params): When hiding a type parameter
9455 from an outer class, put it into the `type_param_list' anyways.
9457 * expression.cs (MemberAccess.expr): Made this field protected.
9459 * class.cs (TypeContainer.Define): The `CurrentType' just contains
9460 the type parameters from the current class.
9462 * generic.cs (ConstructedType.ResolveType): Support nested generic
9463 types by taking the type parameters which we inherit from outer
9464 classes into account.
9465 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
9466 support for nested generic types.
9468 2004-02-23 Martin Baulig <martin@ximian.com>
9470 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
9471 field and check whether we're nested inside a generic type.
9472 (DeclSpace.ResolveType): If we're resolving to a generic type
9473 definition, create a ConstructedType and return its resolved type.
9474 (DeclSpace.initialize_type_params): New private method;
9475 initializes the `type_param_list' field from the type parameters
9476 from this and all enclosing classes.
9477 (DeclSpace.TypeParameters): Call initialize_type_params() unless
9478 we're already initialized.
9480 2004-02-23 Martin Baulig <martin@ximian.com>
9482 * class.cs (Method.Define): Create the generic method before
9484 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
9485 the TypeContainer one); we use this for generic methods.
9487 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
9488 parent's TypeBuilder.
9490 2004-02-18 Martin Baulig <martin@ximian.com>
9492 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
9493 to check for equality.
9495 2004-02-05 Martin Baulig <martin@ximian.com>
9497 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
9498 `ec.TypeContainer.CurrentType', use it instead of
9499 `ec.ContainerType' to check whether we're in the type's ctor.
9501 2004-01-29 Martin Baulig <martin@ximian.com>
9503 * expression.cs (Invocation.DoResolve): If we're a
9504 `ConstructedType', then we're actually a generic method, so
9505 rewrite the expr as a GenericMemberAccess.
9507 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
9508 here; manually parse it into a string.
9510 2004-01-28 Martin Baulig <martin@ximian.com>
9512 * typemanager.cs (TypeManager.IsEqual): New static method.
9513 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
9514 check for equality instead of using `=='.
9516 2004-01-26 Martin Baulig <martin@ximian.com>
9518 * decl.cs (DeclSpace.CurrentType): New public field.
9520 * expression.cs (This.ResolveBase): If we have an
9521 `ec.TypeContainer.CurrentType', use it instead of
9524 * class.cs (TypeContainer.DefineType): If we're a generic type,
9525 create the `CurrentType' (unresolved).
9526 (TypeContainer.GenericType): New private field.
9527 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
9528 it and store it in `GenericType' before creating the MemberCache.
9529 (TypeContainer.GetMembers): If we have a `GenericType', call
9530 TypeManager.FindMembers() on it.
9532 * interface.cs (Interface.GenericType): New private field.
9533 (Interface.DefineType): If we're a generic type, create the
9534 `CurrentType' (unresolved).
9535 (Interface.DefineMembers): If we have a `CurrentType', resolve it
9536 and store it in `GenericType' before creating the MemberCache.
9537 (Interface.GetMembers): If we have a `GenericType', call
9538 TypeManager.FindMembers() on it.
9540 2004-01-22 Martin Baulig <martin@ximian.com>
9542 * cs-parser.jay (namespace_or_type_name): Return an Expression,
9543 not a QualifiedIdentifier. This is what `type_name_expression'
9544 was previously doing.
9545 (type_name_expression): Removed; the code is now in
9546 `namespace_or_type_name'.
9547 (qualified_identifier): Removed, use `namespace_or_type_name'
9549 (QualifiedIdentifier): Removed this class.
9551 2004-01-22 Martin Baulig <martin@ximian.com>
9553 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9554 not a string as alias name.
9556 2004-01-21 Miguel de Icaza <miguel@ximian.com>
9558 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9559 #52730 bug, and instead compute correctly the need to use a
9560 temporary variable when requesting an address based on the
9561 static/instace modified of the field and the constructor.
9563 2004-01-21 Martin Baulig <martin@ximian.com>
9565 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9566 class and namespace before looking up aliases. Fixes #52517.
9568 2004-01-21 Martin Baulig <martin@ximian.com>
9570 * flowanalysis.cs (UsageVector.Merge): Allow variables being
9571 assinged in a 'try'; fixes exception4.cs.
9573 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9574 * class.cs : Implemented parameter-less constructor for TypeContainer
9576 * decl.cs: Attributes are now stored here. New property OptAttributes
9578 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9580 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9582 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9584 * typemanager.cs (CSharpSignature): Now reports also inner class name.
9585 (CSharpSignature): New method for indexer and property signature.
9587 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9589 * pending.cs (IsVirtualFilter): Faster implementation.
9591 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9593 * typemanager.cs: Avoid inclusion of same assembly more than once.
9595 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9597 * cs-parser.jay: Fixed problem where the last assembly attribute
9598 has been applied also to following declaration (class, struct, etc.)
9600 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9602 * class.cs: Added error CS0538, CS0539 reporting.
9603 Fixed crash on Microsoft runtime when field type is void.
9605 * cs-parser.jay: Added error CS0537 reporting.
9607 * pending.cs: Added error CS0535 reporting.
9608 Improved error report for errors CS0536, CS0534.
9610 2004-01-20 Miguel de Icaza <miguel@ximian.com>
9612 Merge a few bits from the Anonymous Method MCS tree.
9614 * statement.cs (ToplevelBlock): New class for toplevel methods,
9615 will hold anonymous methods, lifted variables.
9617 * cs-parser.jay: Create toplevel blocks for delegates and for
9618 regular blocks of code.
9620 2004-01-20 Martin Baulig <martin@ximian.com>
9622 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9623 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9624 and `NeedExplicitReturn'; added `IsLastStatement'.
9625 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9626 have a `ReturnLabel' or we're not unreachable.
9628 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9629 child's reachability; don't just override ours with it. Fixes
9630 #58058 (lluis's example).
9631 (FlowBranching): Added public InTryOrCatch(), InCatch(),
9632 InFinally(), InLoop(), InSwitch() and
9633 BreakCrossesTryCatchBoundary() methods.
9635 * statement.cs (Return): Do all error checking in Resolve().
9636 Unless we are the last statement in a top-level block, always
9637 create a return label and jump to it.
9638 (Break, Continue): Do all error checking in Resolve(); also make
9639 sure we aren't leaving a `finally'.
9640 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9641 statement in a top-level block.
9642 (Block.Flags): Added `IsDestructor'.
9643 (Block.IsDestructor): New public property.
9645 2004-01-20 Martin Baulig <martin@ximian.com>
9647 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9649 2004-01-20 Martin Baulig <martin@ximian.com>
9651 * statement.cs (Statement.ResolveUnreachable): New public method.
9652 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9653 (Block.Resolve): Resolve unreachable statements.
9655 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9657 * expression.cs: We need to fix the case where we do
9658 not have a temp variable here.
9660 * assign.cs: Only expression compound assignments need
9661 temporary variables.
9663 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9665 * flowanalysis.cs: Reduce memory allocation in a few ways:
9666 - A block with no variables should not allocate a bit
9668 - A method with no out parameters does not need any tracking
9669 for assignment of the parameters, so we need not allocate
9672 public readonly Type[] VariableTypes;
9673 public readonly string[] VariableNames;
9674 Are redundant. The data is already stored in the variable
9675 map, so we need not allocate another array for it.
9676 - We need to add alot of checks for if (params | locals) == null
9677 due to the first two changes.
9679 2004-01-18 Miguel de Icaza <miguel@ximian.com>
9681 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9682 implement IMemoryLocation, we store a copy on a local variable and
9683 take the address of it. Patch from Benjamin Jemlich
9685 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9686 to use a special "type_name_expression" rule which reduces the
9687 number of "QualifiedIdentifier" classes created, and instead
9688 directly creates MemberAccess expressions.
9690 2004-01-17 Miguel de Icaza <miguel@ximian.com>
9692 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9693 that fixes #52853. Null literal assignment to ValueType
9695 * class.cs (MethodData.Emit): Instead of checking the name of the
9696 method to determine if its a destructor, create a new derived
9697 class from Method called Destructor, and test for that.
9699 * cs-parser.jay: Create a Destructor object instead of a Method.
9701 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9705 2004-01-16 Miguel de Icaza <miguel@ximian.com>
9707 * expression.cs (Binary.ResolveOperator): Perform an implicit
9708 conversion from MethodGroups to their delegate types on the
9711 * delegate.cs: Introduce a new class DelegateCreation that is the
9712 base class for `NewDelegate' and `ImplicitDelegateCreation',
9713 factor some code in here.
9715 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9716 conversion from MethodGroups to compatible delegate types.
9718 * ecore.cs (Expression.Resolve): Do not flag error 654
9719 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9720 we allow conversions from MethodGroups to delegate types now.
9722 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9723 assignments in v2 either.
9725 2004-01-10 Miguel de Icaza <miguel@ximian.com>
9727 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9728 static read-only fields in ctors.
9730 Applied patch from Benjamin Jemlich
9732 * expression.cs (UnaryMutator): Avoid leaking local variables.
9734 2004-01-09 Miguel de Icaza <miguel@ximian.com>
9736 * cs-tokenizer.cs (IsCastToken): Allow the various native types
9737 here to return true, as they can be used like this:
9741 Fixed 49836 and all the other dups
9743 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
9745 * driver.cs: Implement /win32res and /win32icon.
9747 2004-01-08 Miguel de Icaza <miguel@ximian.com>
9749 * cs-parser.jay: Add a rule to improve error handling for the
9750 common mistake of placing modifiers after the type.
9752 2004-01-07 Miguel de Icaza <miguel@ximian.com>
9754 * cs-parser.jay (interface_event_declaration): Catch
9755 initialization of events on interfaces, and report cs0068
9757 * cs-parser.jay (interface_event_declaration): Catch
9758 initialization of events.
9760 * ecore.cs: Better report missing constructors.
9762 * expression.cs (Binary.ResolveOperator): My previous bug fix had
9763 the error reporting done in the wrong place. Fix.
9765 * expression.cs (Binary.ResolveOperator): Catch the
9766 operator + (E x, E y) error earlier, and later allow for implicit
9767 conversions in operator +/- (E e, U x) from U to the underlying
9770 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9771 52596, if the container class is abstract, the default constructor
9772 is protected otherwise its public (before, we were always public).
9774 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9777 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9778 Jemlich that fixes bug #52597, MCS was generating invalid code for
9779 idisposable structs. Thanks to Ben for following up with this
9782 2004-01-06 Miguel de Icaza <miguel@ximian.com>
9784 * driver.cs: Allow assemblies without code to be generated, fixes
9787 2004-01-07 Nick Drochak <ndrochak@gol.com>
9789 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9791 2004-01-05 Miguel de Icaza <miguel@ximian.com>
9793 * cs-parser.jay: Add rules to improve error reporting if fields or
9794 methods are declared at the namespace level (error 116)
9796 * Add rules to catch event add/remove
9798 2004-01-04 David Sheldon <dave-mono@earth.li>
9800 * expression.cs: Added matching ")" to error message for
9803 2004-01-03 Todd Berman <tberman@gentoo.org>
9805 * ecore.cs, attribute.cs:
9806 Applying fix from #52429.
9808 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9810 * ecore.cs, expression.cs, statement.cs:
9811 Total rewrite of how we handle branching. We
9812 now handle complex boolean expressions with fewer
9813 jumps. As well if (x == 0) no longer emits a ceq.
9815 if (x is Foo) is much faster now, because we generate
9818 Overall, we get a pretty big improvement on our benchmark
9819 tests. The code we generate is smaller and more readable.
9821 I did a full two-stage bootstrap. The patch was reviewed
9822 by Martin and Miguel.
9824 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9826 * cs-parser.jay: Make primary_expression not take a QI.
9827 we dont need this because the member_access rule covers
9828 us here. So we replace the rule with just IDENTIFIER.
9830 This has two good effects. First, we remove a s/r conflict.
9831 Second, we allocate many fewer QualifiedIdentifier objects.
9833 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9835 * attribute.cs: Handle MarshalAs attributes as pseudo, and
9836 set the correct information via SRE. This prevents
9837 hanging on the MS runtime. Fixes #29374.
9839 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9841 * convert.cs: correctly handle conversions to value types
9842 from Enum and ValueType as unboxing conversions.
9844 Fixes bug #52569. Patch by Benjamin Jemlich.
9846 2004-01-02 Ravi Pratap <ravi@ximian.com>
9848 * expression.cs (BetterConversion): Prefer int -> uint
9849 over int -> ulong (csc's behaviour). This fixed bug #52046.
9851 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
9853 * decl.cs (MemberCache.FindMembers): now returns a
9856 * typemanager.cs: In general, go with with ^^.
9857 (CopyNewMethods): take an IList.
9858 (RealMemberLookup): Only allocate an arraylist
9859 if we copy from two sets of methods.
9861 This change basically does two things:
9862 1) Fewer array lists allocated due to CopyNewMethods.
9863 2) the explicit cast in MemberList costed ALOT.
9865 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
9867 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9868 a hashtable to avoid needless string allocations when an identifier is
9869 used more than once (the common case).
9871 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
9873 * pending.cs: MS's TypeBuilder.GetInterfaces ()
9874 is broken, it will not return anything. So, we
9875 have to use the information we have in mcs to
9878 * typemanager.cs: Add a cache for GetInterfaces,
9879 since this will now be used more often (due to ^^)
9881 (GetExplicitInterfaces) New method that gets the
9882 declared, not effective, interfaces on a type
9883 builder (eg, if you have interface IFoo, interface
9884 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9887 This patch makes MCS able to bootstrap itself on
9890 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
9892 * expression.cs: Remove the Nop's that Miguel put
9895 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9897 * report.cs, codegen.cs: Give the real stack trace to
9898 the error when an exception is thrown.
9900 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9902 * decl.cs: only allocate hashtables for ifaces if
9905 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9907 * expression.cs: fix the error from cs0121-2.cs
9908 (a parent interface has two child interfaces that
9909 have a function with the same name and 0 params
9910 and the function is called through the parent).
9912 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
9914 * class.cs, rootcontext.cs, typmanager.cs: do not
9917 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
9919 * codegen.cs: remove stack for the ec flow branching.
9920 It is already a linked list, so no need.
9922 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
9924 * Makefile: Allow custom profiler here.
9926 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
9928 * typemanager.cs (LookupType):
9929 - Use a static char [], because split takes
9930 a param array for args, so it was allocating
9932 - Do not store true in a hashtable, it boxes.
9934 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
9936 * flowanalysis.cs: bytify common enums.
9938 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9940 * modifiers.cs: Add a new set of flags for the
9941 flags allowed on explicit interface impls.
9942 * cs-parser.jay: catch the use of modifiers in
9943 interfaces correctly.
9944 * class.cs: catch private void IFoo.Blah ().
9946 All related to bug #50572.
9948 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9950 * decl.cs: Rewrite the consistant accessability checking.
9951 Accessability is not linear, it must be implemented in
9952 a tableish way. Fixes #49704.
9954 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9956 * expression.cs: Handle negation in a checked context.
9957 We must use subtraction from zero. Fixes #38674.
9959 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
9961 * class.cs: Ignore static void main in DLLs.
9962 * rootcontext.cs: Handle the target type here,
9963 since we are have to access it from class.cs
9964 * driver.cs: account for the above.
9966 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
9968 * report.cs: Give line numbers and files if available.
9970 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
9972 * driver.cs: Implement /addmodule.
9974 * typemanager.cs: Change 'modules' field so it now contains Modules not
9977 2003-12-20 Martin Baulig <martin@ximian.com>
9979 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9980 (FieldBase.IsAssigned): Removed this field.
9981 (FieldBase.SetAssigned): New public method.
9982 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9984 2003-12-20 Martin Baulig <martin@ximian.com>
9986 * expression.cs (LocalVariableReference.DoResolve): Don't set
9987 `vi.Used' if we're called from DoResolveLValue().
9989 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9990 returns the usage vector it just merged into the current one -
9991 pass this one to UsageWarning().
9992 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9993 of the `EmitContext', don't call this recursively on our children.
9995 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
9997 * driver.cs: Implement /target:module.
9999 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
10001 * support.cs (CharArrayHashtable): New helper class.
10003 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
10004 char arrays, not strings, so we can avoid creating a string in
10005 consume_identifier if the identifier is a keyword.
10007 2003-12-16 Martin Baulig <martin@ximian.com>
10009 * statement.cs (LocalInfo.Assigned): Removed this property.
10010 (LocalInfo.Flags): Removed `Assigned'.
10011 (LocalInfo.IsAssigned): New public method; takes the EmitContext
10012 and uses flow analysis.
10013 (Block.UsageWarning): Made this method private.
10014 (Block.Resolve): Call UsageWarning() if appropriate.
10016 * expression.cs (LocalVariableReference.DoResolve): Always set
10017 LocalInfo.Used here.
10019 2003-12-13 Martin Baulig <martin@ximian.com>
10021 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10022 any value here; we're now using flow analysis to figure out
10023 whether a statement/block returns a value.
10025 2003-12-13 Martin Baulig <martin@ximian.com>
10027 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10029 (FlowBranching.MergeFinally): Don't call
10030 `branching.CheckOutParameters()' here, this is called in
10032 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10033 when adding the `finally' vector.
10035 2003-12-13 Martin Baulig <martin@ximian.com>
10038 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10039 actually work and also fix #48962.
10041 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
10043 * decl.cs: Do not check System.Object for nested types,
10044 since we know it does not have any. Big bang for buck:
10047 Run 1: 8.35 seconds
10048 Run 2: 8.32 seconds
10049 corlib: 17.99 seconds
10051 Run 1: 8.17 seconds
10052 Run 2: 8.17 seconds
10053 corlib: 17.39 seconds
10055 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
10057 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10058 time we are returning 0 members, so we save alot here.
10060 2003-12-11 Martin Baulig <martin@ximian.com>
10062 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10063 `MergeChild()', also just take the `FlowBranching' as argument;
10064 call Merge() on it and return the result.
10065 (FlowBranching.Merge): We don't need to do anything if we just
10068 2003-12-11 Martin Baulig <martin@ximian.com>
10070 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10071 them in an `ArrayList' to reduce memory usage. Thanks to Ben
10072 Maurer for this idea.
10074 2003-12-11 Martin Baulig <martin@ximian.com>
10076 * flowanalysis.cs (MergeResult): This class is now gone; we now
10077 use the `UsageVector' for this. The reason for this is that if a
10078 branching just has one sibling, we don't need to "merge" them at
10079 all - that's the next step to do.
10080 (FlowBranching.Merge): We now return a `UsageVector' instead of a
10083 2003-12-11 Martin Baulig <martin@ximian.com>
10085 Reworked flow analyis and made it more precise and bug-free. The
10086 most important change is that we're now using a special `Reachability'
10087 class instead of having "magic" meanings of `FlowReturns'. I'll
10088 do some more cleanups and optimizations and also add some more
10089 documentation this week.
10091 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10092 largely reworked this class.
10093 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10094 the new `Reachability' class instead of having "magic" values here.
10095 (FlowBranching): We're now using an instance of `Reachability'
10096 instead of having separate `Returns', `Breaks' etc. fields.
10098 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10099 based on flow analysis; ignore the return value of block.Emit ().
10101 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10103 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10104 if they are private.
10106 2003-12-09 Martin Baulig <martin@ximian.com>
10108 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10109 call them directly on the UsageVector.
10111 2003-12-09 Martin Baulig <martin@ximian.com>
10113 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10114 Changed return type from `FlowReturns' to `Reachability'.
10116 2003-12-09 Martin Baulig <martin@ximian.com>
10118 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10119 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10120 `Reachable' fields with a single `Reachability' one.
10122 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10124 * class.cs (FindMembers): Remove foreach's.
10129 Run 1: 8.74 seconds
10130 Run 2: 8.71 seconds
10133 Run 1: 8.64 seconds
10134 Run 2: 8.58 seconds
10137 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10142 This patch does a few things:
10143 1. EmptyStatement is now a singleton, so it is never reallocated.
10144 2. All blah is EmptyStatement constructs have been changed to
10145 blah == EmptyStatement.Value, which is much faster and valid
10146 now that EmptyStatement is a singleton.
10147 3. When resolving a block, rather than allocating a new array for
10148 the non-empty statements, empty statements are replaced with
10149 EmptyStatement.Value
10150 4. Some recursive functions have been made non-recursive.
10151 Mainly the performance impact is from (3), however (1) and (2) are needed for
10152 this to work. (4) does not make a big difference in normal situations, however
10153 it makes the profile look saner.
10158 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10159 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10160 Total memory allocated: 56397 KB
10163 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10164 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10165 Total memory allocated: 55666 KB
10167 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10169 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10170 than the hashtable in a hashtable version
10172 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10173 we always end up concating a string. This results in a huge perf
10174 loss, because many strings have to be tracked by the GC. In this
10175 patch, we first use a hashtable that works with two keys, so that
10176 the strings do not need to be concat'ed.
10180 Run 1: 8.74 seconds
10181 Run 2: 8.71 seconds
10184 Run 1: 8.65 seconds
10185 Run 2: 8.56 seconds
10187 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10189 * Makefile: Add a new target `do-time' that does a quick and simple
10190 profile, leaving easy to parse output.
10192 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
10194 * codegen.cs (Init): Create the dynamic assembly with
10195 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10197 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
10199 * support.cs: Make the PtrHashtable use only one
10200 instance of its comparer.
10202 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
10204 * typemanager.cs: Fix lookup of GetNamespaces.
10206 2003-11-29 Miguel de Icaza <miguel@ximian.com>
10208 * expression.cs: Removed redundant line.
10210 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10211 ArrayLists, use for loops with bounds.
10213 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10216 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10217 arraylists, use for loop with bounds.
10219 The above three changes give us a 0.071 second performance
10220 improvement out of 3.294 seconds down to 3.223. On my machine
10221 the above changes reduced the memory usage by 1,387 KB during
10222 compiler bootstrap.
10224 * cs-parser.jay (QualifiedIdentifier): New class used to represent
10225 QualifiedIdentifiers. Before we created a new string through
10226 concatenation, and mostly later on, the result would be
10227 manipulated by DecomposeQI through string manipulation.
10229 This reduced the compiler memory usage for bootstrapping from
10230 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10231 compile times in 0.05 seconds.
10233 2003-11-28 Dick Porter <dick@ximian.com>
10235 * support.cs: Do string compares with the Invariant culture.
10243 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10244 the comparison is done with the Invariant culture.
10246 2003-11-27 Miguel de Icaza <miguel@ximian.com>
10248 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10249 GetEnumerator method.
10251 (ProbeCollectionType): Iterate starting at the most specific type
10252 upwards looking for a GetEnumerator
10254 * expression.cs: Shift count can be up to 31 for int/uint and 63
10257 2003-11-26 Miguel de Icaza <miguel@ximian.com>
10259 * statement.cs (Block.LookupLabel): Also look for the label on the
10260 children blocks. Use a hash table to keep track of visited
10263 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10264 we actually did transform the other operand, otherwise fall back
10265 to the common codepath that casts to long.
10267 * cs-tokenizer.cs: Use the same code pattern as the int case.
10268 Maybe I should do the parsing myself, and avoid depending on the
10269 Parse routines to get this done.
10271 2003-11-25 Miguel de Icaza <miguel@ximian.com>
10273 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10274 which fixes bug 51347. This time test it.
10276 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10277 attributes for example can not tell the difference between these.
10278 The difference was only a syntax feature of the language.
10280 * attribute.cs: Apply attributes to delegates.
10282 * delegate.cs: Call the apply attributes method.
10284 2003-11-24 Miguel de Icaza <miguel@ximian.com>
10286 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10287 comparing 0 vs Byte.MinValue, not the value
10289 (ImplicitConversionRequired): When reporting a conversion error,
10290 use error 31 to print out the constant error instead of the
10293 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10294 which fixes bug 51347.
10296 2003-11-22 Miguel de Icaza <miguel@ximian.com>
10298 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
10299 which fixes the -warnaserror command line option.
10301 2003-11-21 Miguel de Icaza <miguel@ximian.com>
10303 * cfold.cs (DoNumericPromotions): During constant folding of
10304 additions on UIntConstant, special case intconstants with
10305 IntConstants like we do on the expression binary operator.
10307 2003-11-12 Miguel de Icaza <miguel@ximian.com>
10309 * convert.cs (ImplicitReferenceConversion): We were missing a case
10310 (System.Enum are not value types or class types, so we need to
10311 classify them separatedly).
10313 * driver.cs: We do not support error 2007.
10315 2003-11-12 Jackson Harper <jackson@ximian.com>
10317 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10318 system directory. Also use the full file name so users can
10319 libraries names mscorlib-o-tron.dll in a non system dir.
10321 2004-01-04 David Sheldon <dave-mono@earth.li>
10323 * expression.cs: Added matching ")" to error message for CS0077.
10325 2003-12-19 Martin Baulig <martin@ximian.com>
10327 * typemanager.cs (TypeManager.IsEqualGenericType): New public
10328 static method; see documentation in the method.
10329 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
10331 * convert.cs (Convert.ImplicitReferenceConversion,
10332 Convert.ImplicitReferenceConversionExists): Add support for
10333 generic type declarations; see gen-36.cs.
10335 2003-12-19 Martin Baulig <martin@ximian.com>
10337 * pending.cs (Pending.InterfaceMethod): Use
10338 `Type.IsAssignableFrom()' instead of `=='.
10340 2003-12-18 Martin Baulig <martin@ximian.com>
10342 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
10345 * convert.cs (Convert.ImplicitStandardConversionExists): Use
10346 `expr_type.Equals (target_type)' instead of `=='.
10348 2003-12-08 Martin Baulig <martin@ximian.com>
10350 * generics.cs (Constraints.Types): Removed.
10351 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
10353 (Constraints.ResolveTypes): New public method; resolves the
10354 TypeExpr's to Type's.
10355 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
10356 longer takes the constraints.
10357 (TypeParameter.DefineMethod): Likewise.
10358 (TypeParameter.DefineType): New public method. Calls
10359 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
10362 2003-12-08 Martin Baulig <martin@ximian.com>
10364 * convert.cs (Convert.ImplicitConversionStandard): Use
10365 `expr_type.Equals (target_type)' instead of `=='.
10367 2003-12-08 Martin Baulig <martin@ximian.com>
10369 * typemanager.cs (TypeManager.GetReferenceType): Call
10370 `Type.MakeByRefType ()'.
10372 2003-12-08 Martin Baulig <martin@ximian.com>
10374 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
10375 just has some special meaning in some situations. For instance,
10376 it is allowed to use `where' as the name of a variable etc.
10378 2003-12-04 Martin Baulig <martin@ximian.com>
10380 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10381 `Type.MakeArrayType()' for array types.
10383 2003-11-18 Miguel de Icaza <miguel@ximian.com>
10385 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
10388 (SizeOf.DoResolve): assign the `type_queried' field. This gets
10391 2003-11-16 Martin Baulig <martin@ximian.com>
10393 * codegen.cs (EmitContext.IsGeneric): Removed.
10395 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
10396 ResolveGeneric() on the DeclSpace.
10398 2003-11-16 Martin Baulig <martin@ximian.com>
10400 * generic.cs (TypeArguments.Resolve):
10401 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
10402 `ResolveType()' on it to get the Type.
10404 2003-11-15 Martin Baulig <martin@ximian.com>
10406 * generic.cs (ConstructedType.GetInterfaces): Override this.
10408 2003-11-14 Martin Baulig <martin@ximian.com>
10410 * interface.cs (Interface.DefineType): Define all type parameters
10411 before adding the interfaces we inherit.
10413 2003-11-11 Martin Baulig <martin@ximian.com>
10415 * generic.cs (ConstructedType.ResolveType): Always call
10416 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
10418 2003-11-10 Martin Baulig <martin@ximian.com>
10420 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10421 (TypeManager.InitCoreTypes): Initialize them here, but instead of
10422 calling `ResolveType()' on them, directly assign their `Type'.
10424 2003-11-08 Martin Baulig <martin@ximian.com>
10426 * generic.cs (ConstructedType): Override `IsClass' etc.
10428 2003-11-08 Martin Baulig <martin@ximian.com>
10430 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10431 return value and the `out parent' parameter.
10432 (TypeContainer.DefineType): Moved the CS0644 check into
10433 GetClassBases(). Don't pass the interface types to the
10434 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10435 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10437 * ecore.cs (TypeExpr.IsAttribute): New property.
10438 (TypeExpr.GetInterfaces): New method.
10440 * interface.cs (Interface.GetInterfaceTypeByName): Return a
10441 TypeExpr instead of a Type.
10442 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10443 (Interface.DefineType): Don't pass the interface types to the
10444 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10445 them later and then call `TypeBulider.AddInterfaceImplementation()'.
10447 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10448 instead of a `Type[]'.
10449 (TypeManager.RegisterBuilder): Likewise.
10450 (TypeManager.AddUserInterface): Likewise.
10451 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10452 `Type[]' and also return a `TypeExpr[]'.
10453 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10455 2003-11-08 Martin Baulig <martin@ximian.com>
10457 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10460 2003-11-08 Martin Baulig <martin@ximian.com>
10462 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10463 TypeManager.ResolveExpressionTypes().
10465 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10466 instead of an Expression.
10467 (TypeExpr): This is now an abstract base class for `TypeExpression'.
10468 (TypeExpression): New public class; formerly known as `TypeExpr'.
10470 * expression.cs (ComposedCast): Derive from TypeExpr.
10472 * typemanager.cs (TypeManager.system_*_expr): These are now
10473 TypExpr's instead of Expression's.
10474 (TypeManager.ResolveExpressionTypes): New public static function;
10475 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10478 2003-11-06 Miguel de Icaza <miguel@ximian.com>
10480 * expression.cs (New.DoResolve): Do not dereference value that
10481 might be a null return.
10483 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10484 sure that the constant value has the right type. Fixes an
10485 unreported bug, similar to 50425.
10487 * const.cs (Const.LookupConstantValue): Call
10488 ImplicitStandardConversionExists before doing a conversion to
10489 avoid havng the TypeManager.ChangeType do conversions.
10491 Reduced the number of casts used
10493 (Const.ChangeType): New routine to enable reuse of the constant
10494 type changing code from statement.
10496 * typemanager.cs (ChangeType): Move common initialization to
10497 static global variables.
10501 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10502 every value type to go through, even if it was void. Fix that.
10504 * cs-tokenizer.cs: Use is_identifier_start_character on the start
10505 character of the define, and the is_identifier_part_character for
10506 the rest of the string.
10508 2003-11-05 Miguel de Icaza <miguel@ximian.com>
10510 * expression.cs (UnaryMutator.EmitCode): When I updated
10511 LocalVariableReference.DoResolve, I overdid it, and dropped an
10512 optimization done on local variable references.
10514 2003-11-04 Miguel de Icaza <miguel@ximian.com>
10516 * ecore.cs: Convert the return from Ldlen into an int.
10518 2003-10-20 Miguel de Icaza <miguel@ximian.com>
10520 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10521 the accessibility, this is a special case for toplevel non-public
10522 classes (internal for instance).
10524 2003-10-20 Nick Drochak <ndrochak@gol.com>
10526 * ecore.cs: Fix typo and build. Needed another right paren.
10528 2003-10-19 Miguel de Icaza <miguel@ximian.com>
10530 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
10531 `internal' case regular and protected, but not allowing protected
10532 to be evaluated later. Bug 49840
10534 2003-10-15 Miguel de Icaza <miguel@ximian.com>
10536 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10537 to kb.Nlast, and not the kb.nFirst to isolate the switch
10540 Extract the underlying type, so enumerations of long/ulong are
10541 treated like long/ulong.
10543 2003-10-14 Miguel de Icaza <miguel@ximian.com>
10545 * expression.cs (New): Overload the meaning of RequestedType to
10546 track the possible creation of the NewDelegate type, since
10547 DoResolve is invoked more than once for new constructors on field
10550 See bugs: #48800 and #37014
10552 * cs-parser.jay (declare_local_constants): Take an arraylist
10553 instead of a single constant.
10555 (local_constant_declaration): It should take a
10556 constant_declarators, not a constant_declarator. Fixes 49487
10558 * convert.cs: Fix error report.
10560 2003-10-13 Jackson Harper <jackson@ximian.com>
10562 * typemanager.cs (TypeToCoreType): Add float and double this fixes
10565 2003-11-03 Martin Baulig <martin@ximian.com>
10567 * expression.cs (ArrayAccess.GetStoreOpcode): Added
10568 `out bool has_type_arg'; if set, we need to pass the type to
10570 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
10571 Stelem_Any/Ldelem_Any for generic parameters.
10573 2003-11-02 Martin Baulig <martin@ximian.com>
10575 * expression.cs (Invocation.EmitCall): Use
10576 `TypeManager.IsValueType()' to check whether it's a value type.
10577 Don't set `struct_call' when calling a method on a type parameter.
10579 2003-11-02 Martin Baulig <martin@ximian.com>
10581 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
10582 and removed the TypeBuilder argument.
10584 * typemanager.cs (TypeManager.IsValueType): Return
10585 `t.IsGenericParameter || t.IsValueType'.
10587 2003-10-25 Martin Baulig <martin@ximian.com>
10589 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
10590 call ConstructedType.Resolve() on it.
10592 * generic.cs (ConstructedType.Resolve): Set `type' on success.
10594 2003-10-25 Martin Baulig <martin@ximian.com>
10596 * class.cs (TypeContainer.GetClassBases): Changed
10597 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
10598 CS8214 reporting here.
10599 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
10600 instead of a `Type' for our parent. In case of a recursive
10601 declaration (see tests/gen-23.cs for an example), our parent is a
10602 ConstructedType and it doesn't have its type set. So, first
10603 create our own TypeBuilder, then call constructed.Resolve() to get
10604 the parent's type and finally TypeBuilder.SetParent() it.
10606 * ecore.cs (TypeExpr.Name): New public virtual property.
10609 (ConstructedType): We're now a TypeExpr and not just an Expression.
10610 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
10611 arguments here; this is done later.
10612 (ConstructedType.Resolve): New public method to resolve the type
10613 arguments and bind them.
10615 2003-10-21 Martin Baulig <martin@ximian.com>
10617 * convert.cs: Use `TypeManager.IsValueType' instead of
10618 'type.IsValueType' everywhere.
10620 * typemanager.cs (TypeManager.IsValueType): Return true for type
10621 parameters. The reason for this is that we need to box a type
10622 parameter when converting it to a reference type.
10624 * cs-parser.jay: Added support for default value expressions.
10626 * generics.cs (DefaultValueExpression): New public class.
10628 2003-10-17 Martin Baulig <martin@ximian.com>
10630 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
10631 TypeContainer so we can also use this for Interfaces.
10632 (TypeParameter.Resolve): Likewise.
10634 * interface.cs (Interface.DefineType): Added support for generic
10637 * cs-parser.jay: Added support for generic structs and interfaces.
10639 2003-10-17 Martin Baulig <martin@ximian.com>
10641 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
10642 call generic methods :-)
10644 2003-10-16 Martin Baulig <martin@ximian.com>
10646 * cs-parser.jay (namespace_or_type_name): Only create a
10647 GenericMemberAccess if we actually have type arguments.
10649 2003-10-13 Martin Baulig <martin@ximian.com>
10651 * class.cs (Method.Define): If we're a generic method, call
10652 TypeBuilder.DefineGenericMethod () before resolving
10654 (MethodData): Added .ctor which takes an additional MethodBuilder
10655 argument; this is used for generic methods.
10656 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
10657 we already have a MethodBuilder.
10659 2003-10-10 Martin Baulig <martin@ximian.com>
10661 * class.cs (Method): Added .ctor which takes a `GenericMethod'
10662 instead of a `DeclSpace'. This is used for generic methods.
10664 * cs-parser.jay (method_header): Added support for generic
10665 methods; create a `GenericMethod' instance and pass it to the
10666 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
10667 parameters and locals.
10669 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
10670 since we already have the location. Check whether we're a generic
10671 type declaration or a generic method and create the correct type
10674 * generic.cs (TypeParameter.DefineMethod): New public method.
10675 (GenericMethod): New public class; derives from DeclSpace and is
10676 used for generic methods.
10678 2003-10-09 Martin Baulig <martin@ximian.com>
10680 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10682 (MethodCore.DoDefineParameters): Removed the TypeContainer
10683 argument; use the DeclSpace which was passed to the .ctor instead.
10684 (MethodCore.CheckParameter): Take a DeclSpace instead of a
10685 TypeContainer; we only need a DeclSpace here.
10687 2003-10-09 Martin Baulig <martin@ximian.com>
10689 * class.cs (MethodData): Added additional `DeclSpace ds' argument
10691 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10692 EmitContext's .ctor.
10694 2003-10-09 Martin Baulig <martin@ximian.com>
10696 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10697 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10698 AsAccessible(), moved them as well.
10700 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10702 2003-10-07 Miguel de Icaza <miguel@ximian.com>
10704 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10705 generation for >=, as spotted by Paolo, bug 48679.
10706 Patch from David Waite.
10708 * cs-tokenizer.cs: Add handling for #pragma.
10710 * cs-parser.jay: Allow for both yield and yield return in the
10711 syntax. The anti-cobolization of C# fight will go on!
10713 * class.cs (TypeBuilder.DefineType): Catch error condition here
10714 (Parent.DefineType erroring out and returning null).
10716 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10717 coping with enumerations variables, we were mistakenly processing
10718 them as a regular value type instead of built-in types. Fixes the
10721 * typemanager.cs (IsBuiltinOrEnum): New method.
10723 2003-09-30 Miguel de Icaza <miguel@ximian.com>
10725 * cs-parser.jay: Upgrade: yield now needs the return clause.
10727 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10729 * cs-parser.jay : Renamed yyName to yyNames related to jay.
10731 2003-09-29 Martin Baulig <martin@ximian.com>
10733 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10734 inflated generic methods.
10736 * generics.cs (ConstructedType): Distinguish between open and
10737 closed constructed types; correctly resolve the arguments.
10739 2003-09-22 Martin Baulig <martin@ximian.com>
10741 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10742 all type arguments meet their constraints.
10744 2003-09-19 Martin Baulig <martin@ximian.com>
10746 * decl.cs (MemberCache.SetupCacheForInterface): Take a
10747 `MemberCache parent' argument. Normally, an interface doesn't
10748 have a parent type except System.Object, but we use this in gmcs
10749 for generic type parameters.
10751 2003-09-18 Martin Baulig <martin@ximian.com>
10753 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10754 on `type.IsInterface'; don't check whether the type has a parent
10755 to determine whether it's an interface.
10757 2003-09-17 Martin Baulig <martin@ximian.com>
10759 * generic.cs (ConstructedType.ToString): Always use `name' as the
10762 2003-09-15 Martin Baulig <martin@ximian.com>
10764 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10766 * generic.cs (Constraints.Resolve): New public method; this is
10767 called to resolve the constraint types and to check whether all
10768 the constraints are correct.
10769 (Constraints.Types): New public property.
10770 (TypeParameter.Resolve): New public method; resolves all the
10771 type's constraints.
10773 * class.cs (TypeContainer.DefineType): Call
10774 TypeParameter.Resolve() before actually defining the type.
10776 2003-09-15 Martin Baulig <martin@ximian.com>
10778 * class.cs (TypeContainer.DefineType): Added an error flag to
10779 avoid reporting duplicate CS0146's ("class definition is
10782 * driver.cs (Driver.MainDriver): Abort if
10783 RootContext.ResolveTree() reported any errors.
10785 2003-09-07 Martin Baulig <martin@ximian.com>
10787 * report.cs (Error, Warning): Added overloaded versions which take
10788 a `params object[] args' and call String.Format().
10790 2003-09-07 Martin Baulig <martin@ximian.com>
10792 * decl.cs (DeclSpace..ctor): Don't call
10793 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10794 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
10795 (DeclSpace.RecordDecl): New method.
10797 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10799 2003-09-02 Ravi Pratap <ravi@ximian.com>
10801 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10802 value attributes to be applied to ParameterBuilders.
10804 * class.cs (MethodCore.LabelParameters): Make static and more
10805 generic so that it can be used from other places - like interface
10806 methods, for instance.
10808 * interface.cs (Interface.Emit): Call LabelParameters before
10809 emitting attributes on the InterfaceMethod.
10811 2003-09-07 Martin Baulig <martin@ximian.com>
10813 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10814 if the number of type parameters doesn't match.
10816 2003-09-04 Martin Baulig <martin@ximian.com>
10818 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10819 for arrays of generic type params (ie. `!0[]').
10821 2003-09-04 Martin Baulig <martin@ximian.com>
10823 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10826 2003-09-04 Martin Baulig <martin@ximian.com>
10828 * decl.cs (DeclSpace.LookupGeneric): New method.
10829 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10832 * generic.cs (TypeParameterExpr): Take a TypeParameter as
10833 argument, not just a string.
10834 (TypeParameter.Define): New public method; this is called to
10835 actually define the generic parameter; after this, you can use the
10836 new `Type' property to get the type.
10838 2003-09-04 Martin Baulig <martin@ximian.com>
10840 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
10841 is now an ArrayList; initialize the result of the `TypeParameters'
10843 (DeclSpace.GetGenericData): Removed.
10844 (DeclSpace.LookupGeneric): Temporarily removed; we need to
10845 implement this in a different way.
10846 (DeclSpace.GetTypeParameters): Removed; there's now a
10847 `TypeParameters' property.
10848 (DeclSpace.TypeParameters): New public property.
10850 * generic.cs (Constraints): Make this class public.
10851 (TypeParameter): New public class.
10853 2003-09-04 Martin Baulig <martin@ximian.com>
10855 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
10856 generic parameters.
10858 * class.cs (TypeContainer.DefineType): Call
10859 TypeBuilder.DefineGenericParameter () on all generic parameters if
10860 this is a generic type.
10862 2003-08-28 Martin Baulig <martin@ximian.com>
10864 * sample-stack.il: Compile this with ilasm: "ilasm /dll
10867 * sample-hello.cs: Compile this with gmcs: "gmcs
10868 /r:sample-stack.dll sample-hello.cs".
10870 2003-08-28 Martin Baulig <martin@ximian.com>
10872 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
10873 the parameters to the generic type.
10875 2003-08-28 Martin Baulig <martin@ximian.com>
10877 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
10879 2003-08-28 Martin Baulig <martin@ximian.com>
10881 * cs-parser.jay (opt_type_argument_list): Use
10882 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
10883 (primary_expression): Replace `qualified_identifier' with `type_name'.
10884 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
10886 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
10887 parser to check whether it is syntactically a type parameter list;
10888 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
10891 2003-08-26 Martin Baulig <martin@ximian.com>
10893 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10894 resolving aliases; fixes #47927.
10896 2003-08-26 Martin Baulig <martin@ximian.com>
10898 * statement.cs (Using.DoResolve): This is internally emitting a
10899 try/finally clause, so we need to set ec.NeedExplicitReturn if we
10900 do not always return. Fixes #47681.
10902 2003-08-26 Martin Baulig <martin@ximian.com>
10904 * decl.cs (MemberCore): Moved WarningNotHiding(),
10905 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10907 (AdditionResult): Make this nested in DeclSpace.
10908 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10909 argument; call NamespaceEntry.Define() unless we're nested in a
10912 * namespace.cs (Namespace.DefineName): New public function. This
10913 is called from DeclSpace's .ctor to add
10914 (Namespace.Lookup): Include DeclSpaces in the lookup.
10916 * class.cs (Operator): Derive from MemberBase, not MemberCore.
10918 * const.cs (Const): Derive from MemberBase, not MemberCore.
10920 2003-08-25 Martin Baulig <martin@ximian.com>
10922 * convert.cs (Convert.ExplicitReferenceConversion): When
10923 converting from an interface type to a class, unbox if the target
10924 type is a struct type. Fixes #47822.
10926 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10928 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10931 2003-08-22 Martin Baulig <martin@ximian.com>
10933 * class.cs (TypeManager.DefineType): When defining a nested type,
10934 call DefineType() on our parent; fixes #47801.
10936 2003-08-22 Martin Baulig <martin@ximian.com>
10938 * class.cs (MethodData.Define): While checking if a method is an
10939 interface implementation, improve the test a bit more to fix #47654.
10941 2003-08-22 Martin Baulig <martin@ximian.com>
10943 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10944 correctly; fixes #47722.
10946 2003-08-22 Martin Baulig <martin@ximian.com>
10948 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10949 LocalVariableReference, ensure it's not read-only. Fixes #47536.
10951 * statement.cs (Fixed.DoResolve): Make all variables read-only.
10953 2003-08-22 Martin Baulig <martin@ximian.com>
10955 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10956 can only be assigned in static constructors. Fixes #47161.
10958 2003-08-22 Martin Baulig <martin@ximian.com>
10960 Rewrote and improved the flow analysis code.
10962 * flowbranching.cs (FlowBranching): Make this class abstract.
10963 (FlowBranching.CreateBranching): New static function to create a
10964 new flow branching.
10965 (FlowBranchingBlock, FlowBranchingException): New classes.
10966 (FlowBranching.UsageVector.Type): New public readonly field.
10967 (FlowBranching.UsageVector.Breaks): Removed the setter.
10968 (FlowBranching.UsageVector.Returns): Removed the setter.
10969 (FlowBranching.UsageVector): Added Break(), Return(),
10970 NeverReachable() and Throw() methods to modify the reachability.
10971 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10972 done by FlowBranching.Merge().
10973 (FlowBranching.UsageVector.MergeChild): New method; merges the
10974 merge result into the current vector.
10975 (FlowBranching.Merge): New abstract method to merge a branching.
10977 2003-08-12 Martin Baulig <martin@ximian.com>
10979 * expression.cs (Indirection.CacheTemporaries): Create the
10980 LocalTemporary with the pointer type, not its element type.
10982 2003-08-10 Miguel de Icaza <miguel@ximian.com>
10984 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10985 token was a keyword or not.
10987 Add `error' options where an IDENTIFIER was expected; Provide
10988 CheckToken and CheckIdentifierToken convenience error reporting
10991 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10993 * decl.cs: Rename `NamespaceEntry Namespace' public field into
10994 NameSpaceEntry NameSpaceEntry.
10996 (LookupInterfaceOrClass): Avoid creating a full qualified name
10997 from namespace and name: avoid doing lookups when we know the
10998 namespace is non-existant. Use new Tree.LookupByNamespace which
10999 looks up DeclSpaces based on their namespace, name pair.
11001 * driver.cs: Provide a new `parser verbose' to display the
11002 exception thrown during parsing. This is turned off by default
11003 now, so the output of a failure from mcs is more graceful.
11005 * namespace.cs: Track all the namespaces defined in a hashtable
11008 (IsNamespace): New method
11010 2003-08-09 Miguel de Icaza <miguel@ximian.com>
11012 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
11013 we know that we need to concatenate (full typename can never be
11018 * statement.cs: Use a bitfield; Do not initialize to null things
11019 which are done by the constructor by default.
11021 * cs-parser.jay: bug fix, parameter was 4, not 3.
11023 * expression.cs: Just use the property;
11025 * statement.cs: No need for GetVariableInfo method.
11027 2003-08-08 Martin Baulig <martin@ximian.com>
11029 * flowanalysis.cs (FlowReturns): This is now nested in the
11030 `FlowBranching' class.
11031 (MyBitVector): Moved this here from statement.cs.
11032 (FlowBranching.SiblingType): New enum type.
11033 (FlowBranching.CreateSibling): Added `SiblingType' argument.
11035 2003-08-07 Martin Baulig <martin@ximian.com>
11037 * flowanalysis.cs (FlowBranchingType): This is now nested in the
11038 `FlowBranching' class and called `BranchingType'.
11040 2003-08-07 Martin Baulig <martin@ximian.com>
11042 * flowanalysis.cs: Moved all the control flow analysis code into
11045 2003-08-07 Martin Baulig <martin@ximian.com>
11047 * assign.cs (Assign.DoResolve): `target' must either be an
11048 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
11051 2003-08-07 Miguel de Icaza <miguel@ximian.com>
11053 * expression.cs (BinaryMethod): This kind of expression is created by the
11054 Binary class if it determines that the operator has to be handled
11057 (BinaryDelegate): This kind of expression is created if we are
11058 dealing with a + or - operator on delegates.
11060 (Binary): remove method, argumetns, and DelegateOperator: when
11061 dealing with methods,
11063 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11065 * statement.cs (Block): use bitfields for the three extra booleans
11066 we had in use. Remove unused topblock parameter.
11068 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11070 * assign.cs: Drop extra unneeded tests.
11072 2003-08-06 Miguel de Icaza <miguel@ximian.com>
11074 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11076 * statement.cs (Foreach): Use VariableStorage instead of
11079 * codegen.cs (VariableStorage): New class used by clients that
11080 require a variable stored: locals or fields for variables that
11081 need to live across yield.
11083 Maybe provide a convenience api for EmitThis+EmitLoad?
11085 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11088 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11090 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11091 RemapParameterLValue): New methods that are used to turn a
11092 precomputed FieldInfo into an expression like this:
11096 The idea is to use this instead of making LocalVariableReference
11097 have more than one meaning.
11099 * cs-parser.jay: Add error production to BASE.
11101 * ecore.cs: Deal with TypeManager.GetField returning null, which
11102 is now a valid return value.
11104 (FieldExprNoAddress): New expression for Fields whose address can
11107 * expression.cs (LocalVariableReference): During the resolve
11108 phases, create new expressions if we are in a remapping context.
11109 Remove code that dealt with remapping here.
11111 (ParameterReference): same.
11113 (ProxyInstance): New expression, like the `This' expression, but
11114 it is born fully resolved. We know what we are doing, so remove
11115 the errors that are targeted to user-provided uses of `this'.
11117 * statement.cs (Foreach): our variable is now stored as an
11118 Expression; During resolution, follow the protocol, dont just
11119 assume it will return this.
11121 2003-08-06 Martin Baulig <martin@ximian.com>
11123 * support.cs (SeekableStreamReader.cs): New public class.
11125 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11126 SeekableStreamReader instead of the normal StreamReader.
11128 2003-08-04 Martin Baulig <martin@ximian.com>
11130 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11131 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11132 deambiguate casts and delegate invocations.
11133 (parenthesized_expression): Use the new tokens to ensure this is
11134 not a cast of method invocation.
11136 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11137 when reading a `)' and Deambiguate_CloseParens () was previously
11140 * expression.cs (ParenthesizedExpression): New class. This is
11141 just used for the CS0075 test.
11142 (Binary.DoResolve): Check for CS0075.
11144 2003-07-29 Ravi Pratap <ravi@ximian.com>
11146 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11147 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11148 reference comparison.
11150 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11151 examine the ReturnType for equality - this is necessary in the
11152 cases of implicit and explicit operators whose signature also
11153 includes the return type.
11155 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11157 * namespace.cs: Cache the result of the namespace computation,
11158 instead of computing it every time.
11160 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11162 * decl.cs: Use a global arraylist that we reuse over invocations
11163 to avoid excesive memory consumption. Reduces memory usage on an
11164 mcs compile by one meg (45 average).
11166 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11167 private, work around that.
11169 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11171 * literal.cs (IntLiteral): Define Zero and One static literals.
11173 * cs-parser.jay (integer_literal): use static literals to reduce
11174 memory usage for the most used literals (0, 1 and -1). 211kb
11175 reduced in memory usage.
11177 Replace all calls to `new ArrayList' with `new
11178 ArrayList(4)' which is a good average number for most allocations,
11179 and also requires only 16 bytes of memory for its buffer by
11182 This reduced MCS memory usage in seven megabytes for the RSS after
11185 2003-07-28 Ravi Pratap <ravi@ximian.com>
11187 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11188 handle params methods the correct way by forming only one
11189 applicable set with params and normal methods in them. Earlier we
11190 were looking at params methods only if we found no normal methods
11191 which was not the correct thing to do.
11193 (Invocation.BetterFunction): Take separate arguments indicating
11194 when candidate and the best method are params methods in their
11197 This fixes bugs #43367 and #46199.
11199 * attribute.cs: Documentation updates.
11201 (CheckAttribute): Rename to CheckAttributeTarget.
11202 (GetValidPlaces): Rename to GetValidTargets.
11204 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11205 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11209 2003-07-28 Miguel de Icaza <miguel@ximian.com>
11211 * codegen.cs: Compute IsGeneric correctly.
11213 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
11216 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
11217 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
11218 regressions, and I was chasing more bugs than I required.
11220 * interface.cs: Use expressions for base type names (like classes
11221 and structs have been doing for a while now), and resolve that.
11222 This patch should probably go into head as well.
11224 This makes it one less user of FindType.
11226 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11228 This compiler can not self host currently. Need to fix that.
11230 * Makefile: compile to `gmcs.exe'
11232 * driver.cs: Turn on v2 by default on gmcs.
11234 * generic.cs (ConstructedType): Does no longer take a container
11235 type argument; That will be taken care of later.
11237 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
11238 Use SimpleName to resolve for now, so we can continue the work on
11239 the parser, until we get Type.GetType that understands generics.
11241 (ConstructedType.ToString): Implement
11243 (TypeArguments.Resolve): Resolve the child expressions as types.
11245 * cs-parser.jay: Rename interface_constraints to
11246 type_parameter_constraints
11248 (namespace_or_type_name): Only use constructed types for the basic
11249 construction, we will deal with identifier<...> later.
11251 (type/type_name): No longer call DecomposeQI, as
11252 namespace_or_type_name is always decoded now.
11254 2003-07-22 Ravi Pratap <ravi@ximian.com>
11256 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11257 closely: we eliminate methods in base types when we have an
11258 applicable method in a top-level type.
11260 Please see section 14.5.5.1 for an exact description of what goes
11263 This fixes bug #45127 and a host of other related to corlib compilation.
11265 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11266 array is the method corresponding to the top-level type (this is
11267 because of the changes made to icall.c) so we change this
11270 (MethodGroupExpr.Name): This too.
11272 * typemanager.cs (GetElementType): New method which does the right
11273 thing when compiling corlib.
11275 * everywhere: Make use of the above in the relevant places.
11277 2003-07-22 Martin Baulig <martin@ximian.com>
11279 * cs-parser.jay (invocation_expression): Moved
11280 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11281 `cast_expression', but create a InvocationOrCast which later
11282 resolves to either an Invocation or a Cast.
11284 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11285 method; call this before EmitStatement() to make sure that this
11286 expression can be used as a statement.
11288 * expression.cs (InvocationOrCast): New class; resolves to either
11289 an Invocation or a Cast.
11291 * statement.cs (StatementExpression): Call ResolveStatement() on
11292 the ExpressionStatement before emitting it.
11294 2003-07-21 Martin Baulig <martin@ximian.com>
11296 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11297 `ref' and `out' attributes match; fixes #46220.
11298 (MemberAccess.ResolveMemberAccess): You can't reference a type
11299 through an expression; fixes #33180.
11300 (Indexers.GetIndexersForType): Don't return the indexers from
11301 interfaces the class implements; fixes #46502.
11303 2003-07-21 Martin Baulig <martin@ximian.com>
11305 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11306 CS0661 checks; fixes bug #30442.
11308 2003-07-21 Martin Baulig <martin@ximian.com>
11310 * decl.cs (AdditionResult): Added `Error'.
11312 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11314 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
11315 cs0031.cs actually work.
11317 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11319 * cs-parser.jay (namespace_name): do not use
11320 namespace_or_type_name, use qualified_identifier, because
11321 namespace_or_type_name will soon return a composed expression
11322 instead of a string.
11324 (namespace_or_type_name): Instead of returning a string, now this
11325 production returns an expression.
11327 * codegen.cs (EmitContext): Setup IsGeneric property based on
11328 whether our DeclSpace is generic, our the method is generic.
11330 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
11331 the method is generic.
11333 * cs-parser.jay (type_arguments, opt_type_argument_list,
11334 type_parameters, type_parameter_list, opt_type_parameter_list,
11335 type_parameter,, opt_type_parameter_constraints_clauses,
11336 type_parameter_constraints_clauses,
11337 type_parameter_constraint_clause, type_parameter_constraint,
11338 interface_constraints): Add new production
11340 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
11341 DeclSpace is generic or not.
11343 (DeclSpace.SetParameterInfo): New routine, used to set the
11344 parameter info for a type.
11346 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
11347 returns a GenericTypeExpr
11349 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
11350 generic, lookup the generic argument.
11352 * attribute.cs: Do not allow TypeParameterExpressions in
11355 * class.cs: Do not allow the Main method to be defined in a
11358 * expression.cs (SizeOf): Do not allow generic types to be used as
11359 arguments to sizeof.
11361 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
11362 it: whether a type is generic or not. Only works for types we are
11363 currently building for now.
11365 2003-07-20 Martin Baulig <martin@ximian.com>
11367 * namespace.cs: Fixed that bug which caused a crash when compiling
11368 the debugger's GUI.
11370 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11372 * typemanager.cs (LookupTypeReflection): Never expose types which
11373 are NotPublic, NestedPrivate, NestedAssembly, or
11374 NestedFamANDAssem. We used to return these, and later do a check
11375 that would report a meaningful error, but the problem is that we
11376 would not get the real match, if there was a name override.
11378 2003-07-18 Miguel de Icaza <miguel@ximian.com>
11380 * namespace.cs (Namespace, Name): Do not compute the namespace
11381 name dynamically, compute it in the constructor. This reduced
11382 memory usage by 1697 KB.
11384 * driver.cs: Use --pause to pause at the end.
11386 2003-07-17 Peter Williams <peter@newton.cx>
11388 * Makefile: Change the name of the test target so that it doesn't
11389 conflict with the recursive test target.
11391 2003-07-17 Miguel de Icaza <miguel@ximian.com>
11393 * expression.cs (LocalVariableReference.Emit, EmitAssign,
11394 AddressOf): Do not use EmitThis, that was wrong, use the actual
11397 2003-07-15 Miguel de Icaza <miguel@ximian.com>
11399 * class.cs (MethodData.Define): While checking if a method is an
11400 interface implementation, improve the test: If we are not public
11401 (use new test here: use the computed MethodAttributes directly,
11402 instead of the parsed modifier flags) check if the `implementing'
11403 method comes from an interface or not.
11405 * pending.cs (VerifyPendingMethods): Slightly better error
11408 * makefile: add test target that does the mcs bootstrap.
11410 2003-07-16 Ravi Pratap <ravi@ximian.com>
11412 * interface.cs (Define): Do nothing here since there are no
11413 members to populate etc. Move the attribute emission out of here
11414 since this was just totally the wrong place to put it. Attribute
11415 application happens during the 'Emit' phase, not in the 'Define'
11418 (Emit): Add this method and move the attribute emission here
11420 * rootcontext.cs (EmitCode): Call the Emit method on interface
11423 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11425 * expression.cs (OverloadResolve): Report error only if Location
11426 is not 'Null' which means that there was a probe going on.
11428 2003-07-14 Martin Baulig <martin@ximian.com>
11430 * expression.cs (ConditionalLogicalOperator): New public class to
11431 implement user defined conditional logical operators.
11432 This is section 14.11.2 in the spec and bug #40505.
11434 2003-07-14 Martin Baulig <martin@ximian.com>
11436 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11438 2003-07-14 Martin Baulig <martin@ximian.com>
11440 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11442 * ecore.cs (IVariable.VerifyFixed): New interface method.
11444 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11445 operator, check whether the variable is actually fixed. Fixes bug
11446 #36055. Set a variable definitely assigned when taking its
11447 address as required by the spec.
11449 * statement.cs (LocalInfo.IsFixed): New field.
11450 (LocalInfo.MakePinned): Set `IsFixed' to true.
11452 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11454 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11455 for .ctors, ensure that we only ask for members declared in the
11456 attribute type (BindingFlags.DeclaredOnly).
11460 * expression.cs (Error_WrongNumArguments): Report error 1501
11461 correctly the way CSC does.
11463 2003-07-13 Martin Baulig <martin@ximian.com>
11465 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11466 lookup on the fully qualified name, to make things like "X.X" work
11467 where "X.X" is a fully qualified type name, but we also have a
11468 namespace "X" in the using list. Fixes #41975.
11470 2003-07-13 Martin Baulig <martin@ximian.com>
11472 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11473 function. If we're a CompoundAssign, we need to create an embedded
11474 CompoundAssign, not an embedded Assign.
11475 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11478 2003-07-13 Martin Baulig <martin@ximian.com>
11480 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11481 work to fix bug #46088.
11483 2003-07-13 Ravi Pratap <ravi@ximian.com>
11485 * class.cs (Operator.Emit): Do not emit attributes here - it is
11486 taken care of by the Method class that we delegate too. This takes
11487 care of bug #45876.
11489 2003-07-10 Martin Baulig <martin@ximian.com>
11491 * expression.cs (TypeOfVoid): New class.
11492 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
11494 2003-07-10 Martin Baulig <martin@ximian.com>
11496 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11499 2003-07-10 Martin Baulig <martin@ximian.com>
11501 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11502 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11504 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11506 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11508 2003-07-10 Martin Baulig <martin@ximian.com>
11510 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11511 of decimal. Fixes #42850.
11513 NOTE: I also fixed the created byte blob, but this doesn't work on
11514 the MS runtime and csc never produces any byte blobs for decimal
11517 2003-07-10 Martin Baulig <martin@ximian.com>
11519 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11520 structs; fixes #32068.
11521 (Block.AddChildVariableNames): Fixed #44302.
11523 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11525 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11527 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11529 * attribute.cs: And this test is onger needed.
11531 2003-07-08 Martin Baulig <martin@ximian.com>
11533 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11534 inaccessible types. Fixes #36313.
11536 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11538 * namespace.cs (NamespaceEntry): Create implicit entries for all
11539 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11540 implicit entries for N1.N2 and N1.
11542 2003-07-08 Martin Baulig <martin@ximian.com>
11544 Rewrote the handling of namespaces to fix a lot of the issues
11545 wrt. `using' aliases etc.
11547 * namespace.cs (Namespace): Splitted this class into a
11548 per-assembly `Namespace' and a per-file `NamespaceEntry'.
11550 * typemanager.cs (TypeManager.IsNamespace): Removed.
11551 (TypeManager.ComputeNamespaces): Only compute namespaces from
11552 loaded assemblies here, not the namespaces from the assembly we're
11553 currently compiling.
11555 2003-07-08 Martin Baulig <martin@ximian.com>
11557 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11559 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11561 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11564 I thought about the memory savings here, but LookupTypeReflection
11565 is used under already very constrained scenarios. Compiling
11566 corlib or mcs only exposes one hit, so it would not really reduce
11567 any memory consumption.
11569 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11571 * typemanager.cs: fixes bug #45889 by only adding public types from
11572 other assemblies to the list of known types.
11574 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11576 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11577 on the type we resolved.
11579 2003-07-05 Martin Baulig <martin@ximian.com>
11581 * pending.cs (PendingImplementation.ParentImplements): Don't
11582 create the proxy if the parent is abstract.
11584 * class.cs (TypeContainer.DefineIndexers): Process explicit
11585 interface implementations first. Fixes #37714.
11587 2003-07-04 Miguel de Icaza <miguel@ximian.com>
11589 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11590 defined recursively; but since we modify the input parameters
11591 (left is set to `this' temporarily), we reset this value if the
11592 left_is_explicit is false, which gives the original semantics to
11595 * literal.cs (NullPointer): new class used to represent a null
11596 literal in a pointer context.
11598 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11599 type is a pointer, use a NullPointer object instead of a
11600 NullLiteral. Closes 43687
11602 (ExplicitConversion): Convert pointer values using
11603 the conv opcode to the proper type.
11605 * ecore.cs (New): change ValueTypeVariable property into a method,
11606 that returns whether the valuetype is suitable for being used.
11608 * expression.cs (Binary.DoNumericPromotions): Only return if we
11609 the int constant was a valid uint, and we can return both left and
11610 right as uints. If not, we continue processing, to trigger the
11611 type conversion. This fixes 39018.
11613 * statement.cs (Block.EmitMeta): During constant resolution, set
11614 the CurrentBlock property on the emitcontext, so that we resolve
11615 constants propertly.
11617 2003-07-02 Martin Baulig <martin@ximian.com>
11619 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11620 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11622 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11623 than emitting it here.
11625 * statement.cs: Fixed some more flow analysis bugs.
11627 2003-07-02 Martin Baulig <martin@ximian.com>
11629 * class.cs (MethodData.Define): When implementing interface
11630 methods, set Final unless we're Virtual.
11632 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11633 check work for interface methods.
11635 2003-07-01 Martin Baulig <martin@ximian.com>
11637 * ecore.cs (EmitContext.This): Replaced this property with a
11638 GetThis() method which takes a Location argument. This ensures
11639 that we get the correct error location for a CS0188.
11641 2003-07-01 Miguel de Icaza <miguel@ximian.com>
11643 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11644 ImplicitStandardConversion.
11646 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11648 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
11650 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11653 2003-06-30 Miguel de Icaza <miguel@ximian.com>
11655 * class.cs (Constructor.Define): Turn off initlocals for unsafe
11658 (MethodData.Define): Turn off initlocals for unsafe methods.
11660 2003-06-29 Miguel de Icaza <miguel@ximian.com>
11662 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11663 complete; Fixes #37521.
11665 * delegate.cs: Use Modifiers.TypeAttr to compute the
11666 TypeAttributes, instead of rolling our own. This makes the flags
11667 correct for the delegates.
11669 2003-06-28 Miguel de Icaza <miguel@ximian.com>
11671 * class.cs (Constructor.Define): Set the private flag for static
11672 constructors as well.
11674 * cs-parser.jay (statement_expression): Set the return value to
11675 null, to avoid a crash when we catch an error.
11677 2003-06-24 Miguel de Icaza <miguel@ximian.com>
11679 * cs-parser.jay: Applied patch from Jackson that adds support for
11680 extern and unsafe modifiers to destructor declarations.
11682 * expression.cs: Report error 21 if the user is trying to index a
11685 * driver.cs: Add an error message, suggested by the bug report.
11687 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11688 if we do not have a ": this ()" constructor initializer. Fixes 45149
11690 2003-06-14 Miguel de Icaza <miguel@ximian.com>
11692 * namespace.cs: Add some information to reduce FAQs.
11694 2003-06-13 Miguel de Icaza <miguel@ximian.com>
11696 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11697 underlying enumeration types. Fixes #43915.
11699 * expression.cs: Treat ushort/short as legal values to be used in
11700 bitwise operations.
11702 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11704 * delegate.cs: transfer custom attributes for paramenters from
11705 the delegate declaration to Invoke and BeginInvoke.
11707 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11709 * attribute.cs: handle custom marshalers and emit marshal info
11712 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
11714 * makefile.gnu: Added anonymous.cs to the compiler sources.
11716 2003-05-28 Miguel de Icaza <miguel@ximian.com>
11718 * iterators.cs: Change the name of the proxy class to include two
11721 * cs-parser.jay: Update grammar to include anonymous methods.
11723 * anonymous.cs: new file.
11725 2003-05-27 Miguel de Icaza <miguel@ximian.com>
11727 * class.cs (Field.Define): Add missing test for pointers and
11730 2003-05-27 Ravi Pratap <ravi@ximian.com>
11732 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11733 we use the stobj opcode.
11735 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11736 since it wasn't the correct fix.
11738 It still is puzzling that we are required to use stobj for IntPtr
11739 which seems to be a ValueType.
11741 2003-05-26 Miguel de Icaza <miguel@ximian.com>
11743 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11744 during regular simple name resolution. Now, the trick is that
11745 instead of returning for processing the simplename, we do a
11746 TypeManager.LookupType (ie, a rooted lookup as opposed to a
11747 contextual lookup type). If a match is found, return that, if
11748 not, return for further composition.
11750 This fixes long-standing 30485.
11752 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11753 using the address to initialize an object, do an Stobj instead of
11754 using the regular Stelem.
11756 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11757 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11758 Because if we are a BaseIndexerAccess that value will be true.
11761 * statement.cs (GotoCase.Resolve): Return after reporting an
11762 error, do not attempt to continue.
11764 * expression.cs (PointerArithmetic.Emit): If our operand is a
11765 long, convert our constants to match the operand before
11766 multiplying. Convert to I type before adding. Fixes 43670.
11768 2003-05-14 Ravi Pratap <ravi@ximian.com>
11770 * enum.cs (ImplicitConversionExists) : Rename to
11771 ImplicitEnumConversionExists to remove ambiguity.
11773 * ecore.cs (NullCast): New type of cast expression class which
11774 basically is very similar to EmptyCast with the difference being
11775 it still is a constant since it is used only to cast a null to
11777 (eg. (string) null)
11779 * convert.cs (ImplicitReferenceConversion): When casting a null
11780 literal, we return a NullCast.
11782 * literal.cs (NullLiteralTyped): Remove - I don't see why this
11783 should be around anymore.
11785 The renaming (reported was slightly wrong). Corrections:
11787 ConvertImplicitStandard -> ImplicitConversionStandard
11788 ConvertExplicitStandard -> ExplicitConversionStandard
11790 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11791 before passing them in !
11793 * convert.cs (ImplicitConversionStandard): When comparing for
11794 equal expr and target types, ensure that expr is not a
11797 In general, we must not be checking (expr_type ==
11798 target_type) in the top level conversion methods
11799 (ImplicitConversion, ExplicitConversion etc). This checking is
11800 done in the methods that they delegate to.
11802 2003-05-20 Miguel de Icaza <miguel@ximian.com>
11804 * convert.cs: Move Error_CannotConvertType,
11805 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11806 ImplicitNumericConversion, ImplicitConversionExists,
11807 ImplicitUserConversionExists, StandardConversionExists,
11808 FindMostEncompassedType, FindMostSpecificSource,
11809 FindMostSpecificTarget, ImplicitUserConversion,
11810 ExplicitUserConversion, GetConversionOperators,
11811 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11812 TryImplicitIntConversion, Error_CannotConvertImplicit,
11813 ConvertImplicitRequired, ConvertNumericExplicit,
11814 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11815 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11818 Perform the following renames:
11820 StandardConversionExists -> ImplicitStandardConversionExists
11821 ConvertImplicit -> ImplicitConversion
11822 ConvertImplicitStandard -> ImplicitStandardConversion
11823 TryImplicitIntConversion -> ImplicitIntConversion
11824 ConvertImplicitRequired -> ImplicitConversionRequired
11825 ConvertNumericExplicit -> ExplicitNumericConversion
11826 ConvertReferenceExplicit -> ExplicitReferenceConversion
11827 ConvertExplicit -> ExplicitConversion
11828 ConvertExplicitStandard -> ExplicitStandardConversion
11830 2003-05-19 Martin Baulig <martin@ximian.com>
11832 * statement.cs (TypeInfo.StructInfo): Made this type protected.
11833 (TypeInfo): Added support for structs having structs as fields.
11835 * ecore.cs (FieldExpr): Implement IVariable.
11836 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11837 VariableInfo for the field.
11839 2003-05-18 Martin Baulig <martin@ximian.com>
11841 * expression.cs (This.DoResolve): Report a CS0027 if we're
11842 emitting a field initializer.
11844 2003-05-18 Martin Baulig <martin@ximian.com>
11846 * expression.cs (This.ResolveBase): New public function.
11847 (This.DoResolve): Check for CS0188.
11849 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11852 * ecore.cs (MethodGroupExpr.DoResolve): Set the
11853 `instance_expression' to null if we don't have any non-static
11856 2003-05-18 Martin Baulig <martin@ximian.com>
11858 Reworked the way how local variables and parameters are handled by
11859 the flow analysis code.
11861 * statement.cs (TypeInfo, VariableMap): New public classes.
11862 (VariableInfo): New public class. This is now responsible for
11863 checking whether a variable has been assigned. It is used for
11864 parameters and local variables.
11865 (Block.EmitMeta): Take the InternalParameters as argument; compute
11866 the layout of the flow vectors here.
11867 (Block.LocalMap, Block.ParameterMap): New public properties.
11868 (FlowBranching): The .ctor doesn't get the InternalParameters
11869 anymore since Block.EmitMeta() now computes the layout of the flow
11871 (MyStructInfo): This class is now known as `StructInfo' and nested
11872 in `TypeInfo'; we don't access this directly anymore.
11874 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11875 property and removed IsAssigned(), IsFieldAssigned(),
11876 SetAssigned() and SetFieldAssigned(); we now call them on the
11877 VariableInfo so we don't need to duplicate this code everywhere.
11879 * expression.cs (ParameterReference): Added `Block block' argument
11881 (LocalVariableReference, ParameterReference, This): The new
11882 VariableInfo class is now responsible for all the definite
11885 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11886 IsParameterAssigned, SetParameterAssigned): Removed.
11888 2003-05-18 Martin Baulig <martin@ximian.com>
11890 * typemanager.cs (InitCoreTypes): Try calling
11891 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11892 the 3-args-version. Corlib now also needs our `void_type'.
11893 (GetMethod): Added overloaded version which takes an optional
11894 `bool report_errors' to allow lookups of optional methods.
11896 2003-05-12 Martin Baulig <martin@ximian.com>
11898 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11899 only used for locals and not for parameters.
11901 2003-05-12 Miguel de Icaza <miguel@ximian.com>
11903 * support.cs (InternalParameters.ParameterType): Return the
11904 ExternalType of the parameter.
11906 * parameter.cs (Parameter.ExternalType): drop the two arguments,
11909 2003-05-11 Miguel de Icaza <miguel@ximian.com>
11911 * class.cs (MethodData.Define): Do not set the `newslot' on
11912 interface members, if they are also flagged as "override".
11914 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11915 better code for ++i and i++. This only works for static fields
11916 and local variables.
11918 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11919 want to pull the DeclSpace out of the builder_to_declspace instead
11920 of the TypeBuilder (like in TypeContainer.FindMembers).
11922 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11923 instead of LookupTypeContainer. Fixes the crash on .NET for
11924 looking up interface members.
11926 * const.cs: Create our own emit context during the Definition
11927 stage, so that constants are evaluated in the proper context, when
11928 a recursive definition happens.
11930 2003-05-11 Martin Baulig <martin@ximian.com>
11932 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
11933 new block for a switch section.
11934 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11935 the adding/lookup in the switch block. Fixes #39828.
11937 2003-05-09 Miguel de Icaza <miguel@ximian.com>
11939 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11940 functionality: I needed to convert the data after I had performed
11941 the add/sub operation into the operands type size.
11943 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11944 pass the type for the box operation, otherwise the resulting
11945 object would have been of type object.
11947 (BoxedCast): Add constructor to specify the type to box as.
11949 2003-05-07 Miguel de Icaza <miguel@ximian.com>
11951 * iterators.cs: I was reusing the `count' variable inadvertently,
11952 take steps to not allow this to happen.
11954 2003-05-06 Miguel de Icaza <miguel@ximian.com>
11956 * attribute.cs (Attribute.Resolve): Params attributes are encoded
11957 by creating an array at the point where the params starts and
11958 putting all those arguments there, then adjusting the size of the
11961 2003-05-05 Miguel de Icaza <miguel@ximian.com>
11963 * expression.cs (New.AddressOf): Implement interface
11964 IMemoryLocation. This is used when the `new' operator is used in
11965 the context of an invocation to a method on a value type.
11967 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11970 * namespace.cs: Also check the using aliases here.
11972 * driver.cs: Move the test for using validity after the types have
11973 been entered, so we do a single pass that also includes the using
11976 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11977 in the regular case. CreateSiblingForFinally is doing extra
11980 * attribute.cs (GetAttributeArgumentExpression): Store the result
11981 on an out value, and use the return value to indicate failure
11982 instead of using null (which is a valid return for Constant.GetValue).
11984 * statement.cs: Perform the analysis flow for the increment
11985 portion after the statement, because this will be the real flow of
11986 execution. Fixes #42385
11988 * codegen.cs (EmitContext.EmitArgument,
11989 EmitContext.EmitStoreArgument): New helper functions when the
11990 RemapToProxy flag is set.
11992 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11995 Add support for remapping parameters.
11997 * iterators.cs: Propagate parameter values; Store parameter
11998 values in the proxy classes.
12000 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12002 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12003 need a proxy reference; I do not know what I was thinking
12005 * cs-parser.jay (constructor_initializer): catch another error,
12006 and display nice message.
12008 (field_declaration): catch void field declaration
12009 to flag a better error.
12011 * class.cs (MemberBase.CheckBase): Report an error instead of a
12012 warning if a new protected member is declared in a struct.
12013 (Field.Define): catch the error of readonly/volatile.
12015 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12017 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12018 volatile variable is taken
12020 2003-05-02 Miguel de Icaza <miguel@ximian.com>
12022 * statement.cs (Fixed.Resolve): Report an error if we are not in
12025 2003-05-01 Miguel de Icaza <miguel@ximian.com>
12027 * typemanager.cs: reuse the code that handles type clashes for
12028 delegates and enumerations.
12030 * class.cs (Report28): Always report.
12032 * expression.cs (EncodeAsAttribute): Allow nulls here.
12034 2003-04-28 Miguel de Icaza <miguel@ximian.com>
12036 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12037 the functionality for testing whether an expression is valid for
12038 an attribute here. Also handle the case of arrays of elements
12041 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12042 encoding a linear array into an array of objects that are suitable
12043 to be passed to an CustomAttributeBuilder.
12045 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12047 * ecore.cs: (FieldExpr): Handle field remapping here.
12049 * iteratators.cs: Pass the instance variable (if the method is an
12050 instance method) to the constructors, so we can access the field
12051 variables on the class.
12053 TODO: Test this with structs. I think the THIS variable on
12054 structs might have to be a pointer, and not a refenrece
12056 2003-04-27 Miguel de Icaza <miguel@ximian.com>
12058 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12059 local variables to fields in a proxy class.
12061 * iterators.cs (PopulateProxy): Rename our internal fields to
12063 Create a <THIS> field if we are an instance method, so we can
12064 reference our parent container variables.
12065 (MapVariable): Called back from the EmitContext code to enter a
12066 new variable to field mapping into the proxy class (we just create
12070 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12071 for using the remapped locals to fields.
12073 I placed the code here, because that gives the same semantics to
12074 local variables, and only changes the Emit code.
12076 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12077 statements inside iterators.
12078 (VariableInfo): Add a FieldBuilder for the cases when we are
12079 remapping local variables to fields in a proxy class
12081 * ecore.cs (SimpleNameResolve): Avoid testing two times for
12082 current_block != null.
12084 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12085 not cope with strings, as it has been moved to the
12086 TableSwitchEmit. Fixed bug in switch generation.
12088 * expression.cs (New.DoResolve): Provide more context for the user
12089 when reporting an error.
12091 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12094 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12095 check the permissions for it. Note than in a type-resolution
12096 context the check was already present in DeclSpace.ResolveType,
12097 but was missing from the MemberAccess.
12099 (ArrayCreation.CheckIndices): warn if the user has
12100 more nested levels of expressions, but there are no more
12101 dimensions specified. Avoids crash on bug 41906.
12103 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12105 * statement.cs (Block): replace Implicit bool, for a generic
12107 New flag: `Unchecked'. This is used during the EmitMeta phase
12108 (which is out-of-line with the regular Resolve/Emit process for a
12109 statement, as this is done ahead of time, but still gets a chance
12110 to call constant resolve).
12112 (Block.Flags): new enum for adding a new flag.
12114 (Block.EmitMeta): track the state of unchecked.
12116 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12117 to enable constant resolution to work there as well.
12119 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12121 * typemanager.cs (ienumerable_type): Also look up
12122 System.Collections.IEnumerable.
12124 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12126 TODO: Test more than one conditional per method.
12128 * class.cs (Indexer.Define): Report the location where the user is
12129 referencing the unsupported feature.
12131 (MethodData): Overload the use of `conditionals' to
12132 minimize the creation of needless ArrayLists. This saves roughly
12133 212kb on my machine.
12135 (Method): Implement the new IIteratorContainer interface.
12136 (Method.SetYields): Implement the method by setting the ModFlags
12137 to contain METHOD_YIELDS.
12139 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12140 which just got set to null.
12142 * iterators.cs: New file.
12144 (Yield, YieldBreak): New statements.
12146 * statement.cs (Return.Resolve): Flag an error if we are used in
12147 an iterator method.
12149 * codegen.cs (InIterator): New flag set if the code is being
12150 compiled in an iterator method.
12152 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12153 internal modifier, and we just use it to avoid adding extra
12154 fields, as this is seldom used.
12156 * cs-parser.jay: Add yield_statement (yield and yield break).
12158 * driver.cs: New flag -v2 to turn on version 2 features.
12160 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12161 hashtable when v2 is enabled.
12163 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12165 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12166 there is already a namespace defined with this name.
12168 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12169 people upgraded their corlibs.
12171 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12172 always use fully qualified types, no need to use the compiler
12175 (TypeManager.IsNamespace): Use binarysearch.
12177 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12178 AddDelegate): I did not quite use the new IsValid API properly: I
12179 have to pass the short-name and the fullname. I was passing only
12180 the basename instead of the fullname sometimes.
12182 (TypeContainer.DefineType): call NamespaceClash.
12184 * interface.cs (Interface.DefineType): use NamespaceClash before
12187 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12190 * enum.cs: (Enum.DefineType): use NamespaceClash before
12193 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12194 speed increase. First, use the negative_hits cache when we get a
12195 negative. Second, add the type with its full original name
12196 instead of the new . and + encoded name (reflection uses + to
12197 separate type from a nested type). Use LookupTypeReflection
12198 directly which bypasses the type->name hashtable (that we already
12199 know does not contain the type.
12201 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12202 location/container type.
12204 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12206 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12208 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12210 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12211 method is being referenced in the method group from a static
12212 context, and report error 120 if so.
12214 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12217 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12218 is created, we create the A namespace).
12220 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12223 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12225 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12226 invocation to ModuleBuilder.GetType with the same values will
12227 return a new type instance, so we need to cache its return
12230 * expression.cs (Binary.ResolveOperator): Only allow the compare
12231 operators on enums if they are of the same type.
12233 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12234 types of ValueType on their own case. Before we were giving them
12235 the same treatment as objects.
12237 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12238 fullname. Short name is used to compare against container name.
12239 Fullname is used to check against defined namespace names.
12241 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12242 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12244 (Method.CheckBase): Call parent.
12245 (MemberBase.CheckBase): Check for protected members on sealed
12247 (PropertyBase.CheckBase): Call parent.
12248 (Field.Define): Call parent.
12250 * report.cs: Negative error codes are now mapped to 8000 - code,
12251 so that the display is render more nicely.
12253 * typemanager.cs: Do not use try/catch, instead report a regular
12256 (GetPointerType, GetReferenceType): These methods provide
12257 mechanisms to obtain the T* and T& from a T. We had the code
12258 previously scattered around the code base, and it also used
12259 TypeManager.LookupType that would go through plenty of caches.
12260 This one goes directly to the type source.
12262 In some places we did the Type.GetType followed by
12263 ModuleBuilder.GetType, but not in others, so this unifies the
12264 processing as well.
12266 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12267 statements now that we have namespace information.
12269 * typemanager.cs (IsNamespace): New method, returns whether the
12270 string presented is a namespace or not.
12272 (ComputeNamespaces): New public entry point, computes the list of
12273 available namespaces, using the GetNamespaces API call in Mono, or
12274 the slower version in MS.NET.
12276 Now before we start the semantic analysis phase, we have a
12277 complete list of namespaces including everything that the user has
12280 Deleted old code to cache namespaces in .nsc files.
12282 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12284 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12285 class/struct location definition Location for the implicit
12286 constructor location.
12288 (Operator.Define): Use the location of the operator for the
12289 implicit Method definition.
12291 (Constructor.Emit): use the constructor location for the implicit
12292 base initializer constructor.
12294 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12295 and the Expression class now contains two new methods:
12297 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12298 isolate type lookup from the rest of the resolution process.
12300 Since we use Expressions to hold type definitions due to the way
12301 we parse the input we have historically overloaded Resolve to
12302 perform the Type lookups if a special flag is passed. Now this is
12303 eliminated and two methods take their place.
12305 The differences in the two methods between xStep and xTerminal is
12306 that xStep is involved in our current lookup system that uses
12307 SimpleNames to compose a name, while xTerminal is used just to
12308 catch the case where the simplename lookup failed.
12310 2003-04-16 Miguel de Icaza <miguel@ximian.com>
12312 * expression.cs (ResolveMemberAccess): Remove redundant code.
12313 TypeExpr expressions are always born fully resolved.
12315 * interface.cs (PopulateMethod): Do not lookup the types twice.
12316 We were doing it once during SemanticAnalysis and once during
12319 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12320 in local variable type definitions, were being returned as a
12321 SimpleName (we decomposed everything into a string), that is
12322 because primary_expression was being used instead of a type in the
12323 grammar (reduce/reduce conflicts).
12325 The part that was wrong is that we converted the expression into a
12326 string (an oversimplification in one hand, compounded with primary
12327 expressions doing string concatenation).
12333 Would return "A.B.C[]" as a SimpleName. This stopped things like
12334 using clauses from working on this particular context. And a type
12335 was being matched directly against "A.B.C[]".
12337 We now use the correct approach, and allow for ComposedCast to be
12338 part of the unary expression. So the "A.B.C []" become a composed
12339 cast of "A.B.C" (as a nested group of MemberAccess with a
12340 SimpleName at the end) plus the rank composition "[]".
12344 2003-04-10 Miguel de Icaza <miguel@ximian.com>
12346 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12347 for the access level checking.
12349 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
12350 `TypeContainer container', because I kept getting confused when I
12351 was debugging this code.
12353 * expression.cs (Indexers): Instead of tracking getters/setters,
12354 we now track them in parallel. We create one arraylist less, but
12355 most importantly it is possible now for the LValue code to find a
12356 matching get for a set.
12358 (IndexerAccess.DoResolveLValue): Update the code.
12359 GetIndexersForType has been modified already to extract all the
12360 indexers from a type. The code assumed it did not.
12362 Also make the code set the correct return type for the indexer.
12363 This was fixed a long time ago for properties, but was missing for
12364 indexers. It used to be void_type.
12366 (Binary.Emit): Test first for doubles instead of
12367 floats, as they are more common.
12369 (Binary.EmitBranchable): Use the .un version of the branch opcodes
12370 when dealing with floats and the <=, >= operators. This fixes bug
12373 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12374 to load the array value by emitting a load on the foreach variable
12375 type. This was incorrect.
12377 We now emit the code to load an element using the the array
12378 variable type, and then we emit the conversion operator.
12382 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
12384 * attribute.cs: Avoid allocation of ArrayLists in the common case.
12386 2003-04-09 Miguel de Icaza <miguel@ximian.com>
12388 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12389 test for protection before we test for signatures.
12391 (MethodSignature.ToString): implement.
12393 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12394 to the case where we reduced into a LongConstant.
12396 * decl.cs (CheckAccessLevel): If the type is an array, we can not
12397 depend on whether the information is acurrate, because the
12398 Microsoft runtime will always claim that the array type is public,
12399 regardless of the real state.
12401 If the type is a pointer, another problem happens: the type is
12402 reported as non-public in Microsoft.
12404 In both cases we have to call CheckAccessLevel recursively with
12405 the underlying type as the argument to be tested.
12407 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12409 * assign.cs (Assign.Emit): If we are dealing with a compound
12410 assignment expression, we should use the code path that stores the
12411 intermediate result in a temporary value. This fixes #40903.
12413 *expression.cs (Indirection.ToString): Provide ToString method for
12416 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12418 * class.cs: Null out fields holding references to Block objects so
12419 they can be garbage collected.
12421 * expression.cs (OverloadResolve): Remove unused local.
12423 2003-04-07 Martin Baulig <martin@ximian.com>
12425 * codegen.cs (EmitContext.CurrentFile): New public field.
12426 (EmitContext.Mark): Use the CurrentFile to check whether the
12427 location is in the correct file.
12428 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12430 2003-04-07 Martin Baulig <martin@ximian.com>
12432 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12434 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12435 location. [FIXME: The location argument which gets passed to this
12436 method is sometimes wrong!]
12438 2003-04-07 Nick Drochak <ndrochak@gol.com>
12440 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12442 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12444 * expression.cs (Indirection.EmitAssign): We were using the
12445 temporary, but returning immediately instead of continuing the
12448 2003-04-06 Martin Baulig <martin@ximian.com>
12450 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12451 if it's a nested child, but also deriving from the outer class.
12454 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12455 nested child, but also deriving from the outer class. See
12457 (FilterWithClosure): We may access private members of the outer
12458 class if we're a nested child and deriving from the outer class.
12459 (RealMemberLookup): Only set `closure_private_ok' if the
12460 `original_bf' contained BindingFlags.NonPublic.
12462 2003-04-05 Martin Baulig <martin@ximian.com>
12464 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
12465 probe if its a type parameter, and if so, flag an error.
12467 * decl.cs: Move here the SetParameterInfo code from class.cs.
12468 Handle IsGeneric here.
12470 Handle a variety of errors in the parameter info definition.
12472 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
12473 type parameters here.
12475 * cs-parser.jay (class_declaration): report errors for parameters
12478 2003-01-21 Miguel de Icaza <miguel@ximian.com>
12480 * generic.cs: New file, contains support code for generics.
12482 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
12483 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
12485 Update parser for the above removals.
12487 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
12488 now taken care of in the parser.
12490 2003-04-02 Miguel de Icaza <miguel@ximian.com>
12492 * class.cs (Event.Define): Do not allow abstract events to have
12495 2003-04-01 Miguel de Icaza <miguel@ximian.com>
12497 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12498 block in event declarations.
12500 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12501 value type, get its address.
12503 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12504 leaving a class on the stack instead of a boolean value (int
12505 0/1). Change the code so we compare against null, and then the
12506 result against zero.
12508 * class.cs (TypeContainer.GetClassBases): We were checking for the
12509 parent class being sealed too late.
12511 * expression.cs (Binary.Emit): For <= and >= when dealing with
12512 floating point values, use cgt.un and clt.un instead of cgt and
12515 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
12517 * statement.cs: Apply the same optimization as MS: skip the
12518 GetEnumerator returning an IEnumerator, and use the one returning a
12519 CharEnumerator instead. This allows us to avoid the try-finally block
12522 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
12524 * cs-parser.jay: Attributes cannot be applied to
12525 namespaces. Fixes #40473
12527 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12530 (Add*): check if the name is valid using the full name for constants,
12531 fields, properties and events.
12533 2003-03-28 Miguel de Icaza <miguel@ximian.com>
12535 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12536 char constants to be part of the enumeration.
12538 * expression.cs (Conditional.DoResolve): Add support for operator
12539 true. Implements the missing functionality from 14.12
12541 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12542 operator true/false as required by the spec.
12544 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12545 implicit conversion to boolean.
12547 * statement.cs (Statement.ResolveBoolean): A boolean expression is
12548 also one where the type implements `operator true'.
12550 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12551 get an expression that will invoke operator true based on an
12554 (GetConversionOperators): Removed the hack that called op_True
12557 (Expression.ResolveBoolean): Move this from Statement.
12559 2003-03-17 Miguel de Icaza <miguel@ximian.com>
12561 * ecore.cs (FieldExpr): do not allow initialization of initonly
12562 fields on derived classes
12564 2003-03-13 Martin Baulig <martin@ximian.com>
12566 * statement.cs (Block.Emit): Call ig.BeginScope() and
12567 ig.EndScope() when compiling with debugging info; call
12568 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12570 2003-03-08 Miguel de Icaza <miguel@ximian.com>
12572 * expression.cs (Indexers): Do not construct immediately, allow
12573 for new members to be appended as we go. Fixes 38143
12575 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12577 * expression.cs: save/restore context when resolving an unchecked
12580 2003-03-05 Miguel de Icaza <miguel@ximian.com>
12582 * cfold.cs: Catch division by zero in modulus operator during
12585 2003-03-03 Miguel de Icaza <miguel@ximian.com>
12587 * interface.cs (Interface.DefineMembers): Avoid defining members
12590 2003-02-27 Miguel de Icaza <miguel@ximian.com>
12592 * driver.cs: handle the +/- options for -noconfig
12594 * statement.cs (Unckeched.Resolve): Also track the state of
12595 unchecked in the Resolve phase.
12597 2003-02-27 Martin Baulig <martin@ximian.com>
12599 * ecore.cs (Expression.MemberLookup): Don't create a
12600 MethodGroupExpr for something which is not a method. Fixes #38291.
12602 2003-02-25 Miguel de Icaza <miguel@ximian.com>
12604 * class.cs (MemberBase.CheckParameters): Also check that the type
12605 is unmanaged if it is a pointer.
12607 * expression.cs (SizeOf.Resolve): Add location information.
12609 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12610 a managed type is declared.
12612 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12613 parameter modifiers as well. Fixes bug 38606
12615 * class.cs: Very sad. Am backing out the speed up changes
12616 introduced by the ArrayList -> Array in the TypeContainer, as they
12617 were not actually that much faster, and introduced a bug (no error
12618 reports on duplicated methods).
12620 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12621 source first, this will guarantee that we have a valid expression
12622 before calling in lower levels functions that will require a
12623 resolved object. Then use this original_source in the
12624 target.ResolveLValue instead of the original source that was
12627 Another change. Use target.Resolve instead of LValueResolve.
12628 Although we are resolving for LValues, we will let the Assign code
12629 take care of that (it will be called again from Resolve). This
12630 basically allows code like this:
12632 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12633 class Y { void A (X x) { x [0] += o; }
12635 The problem was that the indexer was trying to resolve for
12636 set_Item (idx, object o) and never finding one. The real set_Item
12637 was set_Item (idx, X). By delaying the process we get the right
12642 2003-02-23 Martin Baulig <martin@ximian.com>
12644 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12645 while calling DoEmit ().
12647 * codegen.cs (EmitContext.Mark): Don't mark locations in other
12648 source files; if you use the #line directive inside a method, the
12649 compiler stops emitting line numbers for the debugger until it
12650 reaches the end of the method or another #line directive which
12651 restores the original file.
12653 2003-02-23 Martin Baulig <martin@ximian.com>
12655 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12657 2003-02-23 Martin Baulig <martin@ximian.com>
12659 * statement.cs (Block.AddChildVariableNames): We need to call this
12660 recursively, not just for our immediate children.
12662 2003-02-23 Martin Baulig <martin@ximian.com>
12664 * class.cs (Event.Define): Always make the field private, like csc does.
12666 * typemanager.cs (TypeManager.RealMemberLookup): Make events
12667 actually work, fixes bug #37521.
12669 2003-02-23 Miguel de Icaza <miguel@ximian.com>
12671 * delegate.cs: When creating the various temporary "Parameters"
12672 classes, make sure that we call the ComputeAndDefineParameterTypes
12673 on those new parameters (just like we do with the formal ones), to
12674 allow them to be resolved in the context of the DeclSpace.
12676 This fixes the bug that Dick observed in Bugzilla #38530.
12678 2003-02-22 Miguel de Icaza <miguel@ximian.com>
12680 * expression.cs (ResolveMemberAccess): When resolving a constant,
12681 do not attempt to pull a constant if the value was not able to
12682 generate a valid constant.
12684 * const.cs (LookupConstantValue): Do not report more errors than required.
12686 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12688 * expression.cs: fixes bug #38328.
12690 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12692 * class.cs: Changed all the various members that can be part of a
12693 class from being an ArrayList to be an Array of the right type.
12694 During the DefineType type_list, interface_list, delegate_list and
12695 enum_list are turned into types, interfaces, delegates and enums
12698 And during the member population, indexer_list, event_list,
12699 constant_list, field_list, instance_constructor_list, method_list,
12700 operator_list and property_list are turned into their real arrays.
12702 Although we could probably perform this operation earlier, for
12703 good error reporting we need to keep the lists and remove the
12704 lists for longer than required.
12706 This optimization was triggered by Paolo profiling the compiler
12707 speed on the output of `gen-sample-program.pl' perl script.
12709 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12710 not crash in methods like MemberLookupFailed that use this field.
12712 This problem arises when the compiler fails to resolve a type
12713 during interface type definition for example.
12715 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12717 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12718 inherit from System.Object, so we have to stop at null, not only
12719 when reaching System.Object.
12721 2003-02-17 Miguel de Icaza <miguel@ximian.com>
12723 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12724 DeclaredOnly because the parent indexer might have had a different
12725 name, but did not loop until the top of the hierarchy was reached.
12727 The problem this one fixes is 35492: when a class implemented an
12728 indexer from an interface, we were getting the interface method
12729 (which was abstract) and we were flagging an error (can not invoke
12732 This also keeps bug 33089 functioning, and test-148 functioning.
12734 * typemanager.cs (IsSpecialMethod): The correct way of figuring
12735 out if a method is special is to see if it is declared in a
12736 property or event, or whether it is one of the predefined operator
12737 names. This should fix correctly #36804.
12739 2003-02-15 Miguel de Icaza <miguel@ximian.com>
12741 The goal here is to remove the dependency on EmptyCast.Peel ().
12742 Killing it completely.
12744 The problem is that currently in a number of places where
12745 constants are expected, we have to "probe" for an EmptyCast, and
12746 Peel, which is not the correct thing to do, as this will be
12747 repetitive and will likely lead to errors.
12749 The idea is to remove any EmptyCasts that are used in casts that
12750 can be reduced to constants, so we only have to cope with
12753 This bug hunt was triggered by Bug 37363 and the desire to remove
12754 the duplicate pattern where we were "peeling" emptycasts to check
12755 whether they were constants. Now constants will always be
12758 * ecore.cs: Use an enumconstant here instead of wrapping with
12761 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12762 throwing me off. By handling this we can get rid of a few hacks.
12764 * statement.cs (Switch): Removed Peel() code.
12766 2003-02-14 Miguel de Icaza <miguel@ximian.com>
12768 * class.cs: Location information for error 508
12770 * expression.cs (New.DoResolve): Add a guard against double
12771 resolution of an expression.
12773 The New DoResolve might be called twice when initializing field
12774 expressions (see EmitFieldInitializers, the call to
12775 GetInitializerExpression will perform a resolve on the expression,
12776 and later the assign will trigger another resolution
12778 This leads to bugs (#37014)
12780 * delegate.cs: The signature for EndInvoke should contain any ref
12781 or out parameters as well. We were not doing this in the past.
12783 * class.cs (Field.Define): Do not overwrite the type definition
12784 inside the `volatile' group. Turns out that volatile enumerations
12785 were changing the type here to perform a validity test, which
12788 2003-02-12 Miguel de Icaza <miguel@ximian.com>
12790 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12791 and structs, we do not want to load the instance variable
12793 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12794 enum_type has to be handled like an object reference (implicit
12795 conversions exists from this to object), but the regular IsClass
12796 and IsValueType tests will never return true for this one.
12798 Also we use TypeManager.IsValueType instead of type.IsValueType,
12799 just for consistency with the rest of the code (this is only
12800 needed if we ever use the construct exposed by test-180.cs inside
12801 corlib, which we dont today).
12803 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
12805 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12808 2003-02-09 Martin Baulig <martin@ximian.com>
12810 * namespace.cs (Namespace..ctor): Added SourceFile argument.
12811 (Namespace.DefineNamespaces): New static public method; this is
12812 called when we're compiling with debugging to add all namespaces
12813 to the symbol file.
12815 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12816 pass it to the Namespace's .ctor.
12818 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12819 and MethodBase arguments; pass the namespace ID to the symwriter;
12820 pass the MethodBase instead of the token to the symwriter.
12821 (SymbolWriter.DefineNamespace): New method to add a namespace to
12824 2003-02-09 Martin Baulig <martin@ximian.com>
12826 * symbolwriter.cs: New file. This is a wrapper around
12827 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
12828 methods here in near future.
12830 2003-02-09 Martin Baulig <martin@ximian.com>
12832 * codegen.cs (EmitContext.Mark): Just pass the arguments to
12833 ILGenerator.MarkSequencePoint() which are actually used by the
12836 2003-02-09 Martin Baulig <martin@ximian.com>
12838 * location.cs (SourceFile): New public sealed class. This
12839 contains the name and an index which is used in the location's token.
12840 (Location): Reserve an appropriate number of bits in the token for
12841 the source file instead of walking over that list, this gives us a
12842 really huge performance improvement when compiling with debugging.
12844 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12845 `SourceFile' argument instead of a string.
12846 (Driver.ProcessFile): Add all the files via Location.AddFile(),
12847 but don't parse/tokenize here, we need to generate the list of all
12848 source files before we do that.
12849 (Driver.ProcessFiles): New static function. Parses/tokenizes all
12852 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12853 instead of a string.
12855 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12858 2003-02-09 Martin Baulig <martin@ximian.com>
12860 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12861 filename on `#line default'.
12863 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12865 * statement.cs: don't clear the pinned var when the fixed statement
12866 returns from the method (fixes bug#37752).
12868 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12870 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
12873 2003-02-07 Martin Baulig <martin@ximian.com>
12875 * driver.cs: Removed the `--debug-args' command line argument.
12877 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12878 automatically by the AsssemblyBuilder.
12879 (CodeGen.InitializeSymbolWriter): We don't need to call any
12880 initialization function on the symbol writer anymore. This method
12881 doesn't take any arguments.
12883 2003-02-03 Miguel de Icaza <miguel@ximian.com>
12885 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12886 from referenced assemblies as well.
12888 2003-02-02 Martin Baulig <martin@ximian.com>
12890 * class.cs (MethodData.Emit): Generate debugging info for external methods.
12892 2003-02-02 Martin Baulig <martin@ximian.com>
12894 * class.cs (Constructor.Emit): Open the symbol writer before
12895 emitting the constructor initializer.
12896 (ConstructorInitializer.Emit): Call ec.Mark() to allow
12897 single-stepping through constructor initializers.
12899 2003-01-30 Miguel de Icaza <miguel@ximian.com>
12901 * class.cs: Handle error 549: do not allow virtual methods in
12904 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12906 * decl.cs: Check access levels when resolving types
12908 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12910 * statement.cs: Add parameters and locals set in catch blocks that might
12911 return to set vector
12913 2003-01-29 Miguel de Icaza <miguel@ximian.com>
12915 * class.cs (Operator): Set the SpecialName flags for operators.
12917 * expression.cs (Invocation.DoResolve): Only block calls to
12918 accessors and operators on SpecialName methods.
12920 (Cast.TryReduce): Handle conversions from char constants.
12923 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12925 * statement.cs: small memory and time optimization in FlowBranching.
12927 2003-01-28 Pedro Mart <yoros@wanadoo.es>
12929 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12930 problem that the last fix but in the other sid (Set).
12932 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12933 access when there is no indexer in the hierarchy.
12935 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12937 * class.cs: Combine some if statements.
12939 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12941 * driver.cs: fixed bug #37187.
12943 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
12945 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12946 any indexer, it's needed to build a list with all the indexers in the
12947 hierarchy (AllGetters), else we have problems. Fixes #35653.
12949 2003-01-23 Miguel de Icaza <miguel@ximian.com>
12951 * class.cs (MethodData.Define): It is wrong for an interface
12952 implementation to be static in both cases: explicit and implicit.
12953 We were only handling this in one case.
12955 Improve the if situation there to not have negations.
12957 * class.cs (Field.Define): Turns out that we do not need to check
12958 the unsafe bit on field definition, only on usage. Remove the test.
12960 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12962 * driver.cs: use assembly.Location instead of Codebase (the latest
12963 patch made mcs fail when using MS assemblies).
12965 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
12967 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12968 get the path to *corlib.dll.
12970 2003-01-21 Nick Drochak <ndrochak@gol.com>
12974 * typemanager.cs: Remove compiler warnings
12976 2003-01-20 Duncan Mak <duncan@ximian.com>
12978 * AssemblyInfo.cs: Bump the version number to 0.19.
12980 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12982 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12984 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
12986 * class.cs (Constructor::Emit): Emit debugging info for constructors.
12988 2003-01-17 Miguel de Icaza <miguel@ximian.com>
12990 * cs-parser.jay: Small fix: we were not comparing the constructor
12991 name correctly. Thanks to Zoltan for the initial pointer.
12993 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12995 * cs-tokenizer.cs: Set file name when specified with #line
12997 2003-01-15 Miguel de Icaza <miguel@ximian.com>
12999 * cs-parser.jay: Only perform the constructor checks here if we
13000 are named like the class; This will help provider a better
13001 error. The constructor path is taken when a type definition is
13002 not found, but most likely the user forgot to add the type, so
13003 report that rather than the constructor error.
13005 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13007 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13010 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13012 * cs-parser.jay: Add cleanup call.
13014 2003-01-13 Duncan Mak <duncan@ximian.com>
13016 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13017 consistent with other methods.
13019 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13021 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13023 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13025 * attribute.cs: only set GuidAttr to true when we have a
13028 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13032 * typemanager.cs: fixes to allow mcs compile corlib with the new
13033 Type.IsSubclassOf fix.
13035 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13037 * expression.cs (LocalVariableReference.DoResolve): Classify a
13038 constant as a value, not as a variable. Also, set the type for
13041 * cs-parser.jay (fixed_statement): take a type instead of a
13042 pointer_type, so we can produce a better error message later.
13044 * statement.cs (Fixed.Resolve): Flag types that are not pointers
13047 (For.DoEmit): Make inifinite loops have a
13048 non-conditional branch back.
13050 (Fixed.DoEmit): First populate the pinned variables, then emit the
13051 statement, then clear the variables. Before I was emitting the
13052 code once for each fixed piece.
13055 2003-01-08 Martin Baulig <martin@ximian.com>
13057 * statement.cs (FlowBranching.MergeChild): A break in a
13058 SWITCH_SECTION does not leave a loop. Fixes #36155.
13060 2003-01-08 Martin Baulig <martin@ximian.com>
13062 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13063 lives in the same number space than `param_map'. Fixes #36154.
13065 2003-01-07 Miguel de Icaza <miguel@ximian.com>
13067 * cs-parser.jay (constructor_declaration): Set the
13068 Constructor.ModFlags before probing for it. This makes the
13069 compiler report 514, 515 and 132 (the code was there, but got
13072 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13073 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13074 (GotoCase.Resolve): Set `Returns' to ALWAYS.
13076 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13078 * enum.cs: create the enum static fields using the enum type.
13080 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13082 * class.cs: don't try to create the ParamBuilder for the return
13083 type if it's not needed (and handle it breaking for the ms runtime
13086 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13088 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13090 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13092 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13093 the command. This showed up while compiling the JANET source
13094 code, which used \r as its only newline separator.
13096 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13098 * class.cs (Method.Define): If we are an operator (because it
13099 reuses our code), then set the SpecialName and HideBySig. #36128
13101 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13103 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13104 exception, report error 120 `object reference required'.
13106 * driver.cs: Add --pause option, used during to measure the size
13107 of the process as it goes with --timestamp.
13109 * expression.cs (Invocation.DoResolve): Do not allow methods with
13110 SpecialName to be invoked.
13112 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13114 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13115 number before adding it.
13117 2002-12-21 Ravi Pratap <ravi@ximian.com>
13119 * ecore.cs (StandardImplicitConversion): When in an unsafe
13120 context, we allow conversion between void * to any other pointer
13121 type. This fixes bug #35973.
13123 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13125 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13126 is not thrown when extensionless outputs are used
13128 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13130 * rootcontext.cs: fixed compilation of corlib.
13132 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13134 * attribute.cs (Attributes.Contains): Add new method.
13136 * class.cs (MethodCore.LabelParameters): if the parameter is an
13137 `out' parameter, check that no attribute `[In]' has been passed.
13139 * enum.cs: Handle the `value__' name in an enumeration.
13141 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13143 * decl.cs: Added special case to allow overrides on "protected
13146 2002-12-18 Ravi Pratap <ravi@ximian.com>
13148 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13149 since it makes much more sense.
13151 (Attributes.ctor): Don't require a Location parameter.
13153 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13155 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13156 since we already have that information per attribute.
13158 * everywhere : make appropriate changes.
13160 * class.cs (LabelParameters): Write the code which actually
13161 applies attributes to the return type. We can't do this on the MS
13162 .NET runtime so we flag a warning in the case an exception is
13165 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13167 * const.cs: Handle implicit null conversions here too.
13169 2002-12-17 Ravi Pratap <ravi@ximian.com>
13171 * class.cs (MethodCore.LabelParameters): Remove the extra
13172 Type [] parameter since it is completely unnecessary. Instead
13173 pass in the method's attributes so that we can extract
13174 the "return" attribute.
13176 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13178 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13179 of ignoring it and letting the compile continue.
13181 * typemanager.cs (ChangeType): use an extra argument to return an
13182 error condition instead of throwing an exception.
13184 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13186 * expression.cs (Unary.TryReduce): mimic the code for the regular
13187 code path. Perform an implicit cast in the cases where we can
13188 implicitly convert to one of the integral types, and then reduce
13189 based on that constant. This fixes bug #35483.
13191 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13193 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13195 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13197 * namespace.cs: fixed bug #35489.
13199 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13201 * class.cs: Remove some dead code.
13203 * cs-parser.jay: Estimate the number of methods needed
13204 (RootContext.MethodCount);
13206 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13207 numbers instead of StringBuilders.
13209 * support.cs (PtrHashtable): Add constructor with initial size;
13210 We can now reduce reallocations of the method table.
13212 2002-12-10 Ravi Pratap <ravi@ximian.com>
13214 * attribute.cs (ApplyAttributes): Keep track of the emitted
13215 attributes on a per-target basis. This fixes bug #35413.
13217 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13219 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13220 default to the Windows 1252 encoding.
13222 (UnixParseOption): Support version, thanks to Alp for the missing
13225 * AssemblyInfo.cs: Add nice assembly information.
13227 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13230 * cs-parser.jay: Allow a trailing comma before the close bracked
13231 in the attribute_section production.
13233 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13234 address of the instance was being taken, I will take this out,
13235 because we take the address of the object immediately here.
13237 2002-12-09 Ravi Pratap <ravi@ximian.com>
13239 * typemanager.cs (AreMultipleAllowed): Take care of the most
13240 obvious case where attribute type is not in the current assembly -
13243 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13245 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13246 definitions, instead of doing that afterwards.
13248 Also we use a nice little hack, depending on the constructor, we
13249 know if we are a "composed" name or a simple name. Hence, we
13250 avoid the IndexOf test, and we avoid
13252 * codegen.cs: Add code to assist in a bug reporter to track down
13253 the source of a compiler crash.
13255 2002-12-07 Ravi Pratap <ravi@ximian.com>
13257 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13258 types have been emitted for a given element and flag an error
13259 if something which does not have AllowMultiple set is used more
13262 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13263 attribute types and their corresponding AllowMultiple properties
13265 (AreMultipleAllowed): Check the property for a given type.
13267 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13268 property in the case we have a TypeContainer.
13270 (Attributes.AddAttribute): Detect duplicates and just skip on
13271 adding them. This trivial fix catches a pretty gross error in our
13272 attribute emission - global attributes were being emitted twice!
13274 Bugzilla bug #33187 is now fixed.
13276 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13278 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13279 instead of pp_and).
13281 * expression.cs (Binary.ResolveOperator): I can only use the
13282 Concat (string, string, string) and Concat (string, string,
13283 string, string) if the child is actually a concatenation of
13286 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13288 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13289 context where we need a 2-character lookahead.
13291 * pending.cs (PendingImplementation): Rework so we can keep track
13292 of interface types all the time, and flag those which were
13293 implemented by parents as optional.
13295 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13297 * expression.cs (Binary.ResolveOperator): Use
13298 String.Concat(string,string,string) or
13299 String.Concat(string,string,string,string) when possible.
13301 * typemanager: More helper methods.
13304 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13306 * pending.cs: remove the bogus return from GetMissingInterfaces()
13307 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13309 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13311 * namespace.cs: avoid duplicated 'using xxx' being added to
13312 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13313 when we get more than one 'using' statement for the same namespace.
13314 Report a CS0105 warning for it.
13316 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13318 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13319 of calling getChar/putback, uses internal knowledge of it.
13321 (xtoken): Reorder tokenizer so most common patterns are checked
13322 first. This reduces the compilation time in another 5% (from 8.11s
13323 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13325 The parsing time is 22% of the compilation in mcs, and from that
13326 64% is spent on the tokenization process.
13328 I tried using a binary search for keywords, but this is slower
13329 than the hashtable. Another option would be to do a couple of
13332 * Not use a StringBuilder, instead use an array of chars,
13333 with a set value. Notice that this way we could catch
13334 the 645 error without having to do it *afterwards*.
13336 * We could write a hand-parser to avoid the hashtable
13337 compares altogether.
13339 The identifier consumption process takes 37% of the tokenization
13340 time. Another 15% is spent on is_number. 56% of the time spent
13341 on is_number is spent on Int64.Parse:
13343 * We could probably choose based on the string length to
13344 use Int32.Parse or Int64.Parse and avoid all the 64-bit
13347 Another 3% is spend on wrapping `xtoken' in the `token' function.
13349 Handle 0xa0 as whitespace (#34752)
13351 2002-11-26 Miguel de Icaza <miguel@ximian.com>
13353 * typemanager.cs (IsCLRType): New routine to tell whether a type
13354 is one of the builtin types.
13356 Maybe it needs to use TypeCodes to be faster. Maybe we could use
13357 typecode in more places instead of doing pointer comparissions.
13358 We could leverage some knowledge about the way the typecodes are
13361 New code to cache namespaces in assemblies, it is currently not
13362 invoked, to be used soon.
13364 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13366 * expression.cs (Binary.ResolveOperator): specially handle
13367 strings, and do not perform user-defined operator overloading for
13370 2002-11-24 Miguel de Icaza <miguel@ximian.com>
13372 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13373 internalcall as it is a pretty simple operation; Avoid whenever
13374 possible to call Char.IsLetter.
13376 (consume_identifier): Cut by half the number of
13377 hashtable calls by merging the is_keyword and GetKeyword behavior.
13379 Do not short-circuit, because if we do, we
13380 report errors (ie, #if false && true would produce an invalid
13384 2002-11-24 Martin Baulig <martin@ximian.com>
13386 * expression.cs (Cast.TryReduce): If we're in checked syntax,
13387 check constant ranges and report a CS0221. Fixes #33186.
13389 2002-11-24 Martin Baulig <martin@ximian.com>
13391 * cs-parser.jay: Make this work for uninitialized variable
13392 declarations in the `for' initializer. Fixes #32416.
13394 2002-11-24 Martin Baulig <martin@ximian.com>
13396 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13397 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
13399 2002-11-24 Martin Baulig <martin@ximian.com>
13401 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13402 argument; if true, we also check for user-defined conversions.
13403 This is only needed if both arguments are of a user-defined type.
13404 Fixes #30443, added test-175.cs.
13405 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13407 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13409 2002-11-24 Martin Baulig <martin@ximian.com>
13411 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13412 function to get the store opcode.
13413 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13414 only emit the Ldelema if the store opcode is Stobj. You must run
13415 both test-34 and test-167 to test this. Fixes #34529.
13417 2002-11-23 Martin Baulig <martin@ximian.com>
13419 * ecore.cs (Expression.MemberLookup): Added additional
13420 `qualifier_type' argument which is used when we're being called
13421 from MemberAccess.DoResolve() and null if we're called from a
13423 (Expression.MemberLookupFailed): New method to report errors; this
13424 does the CS1540 check and reports the correct error message.
13426 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13427 argument for the CS1540 check and redone the way how we're dealing
13428 with private members. See the comment in the source code for details.
13429 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13430 `closure_start_type' to `closure_qualifier_type' and check whether
13431 it's not null. It was not this filter being broken, it was just
13432 being called with the wrong arguments.
13434 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13435 and pass it the correct `qualifier_type'; this also does the error
13438 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13440 * expression.cs (Invocation.EmitParams): If the we are dealing
13441 with a non-built-in value type, load its address as well.
13443 (ArrayCreation): Use a a pretty constant instead
13444 of the hardcoded value 2. Use 6 instead of 2 for the number of
13445 static initializers.
13447 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13448 because they are not really value types, just glorified integers.
13450 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13452 * ecore.cs: Remove redundant code for enumerations, make them use
13453 the same code path as everything else, fixes the casting issue
13454 with enumerations in Windows.Forms.
13456 * attribute.cs: Do only cast to string if it is a string, the
13457 validation happens later.
13459 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13460 people upgrade their corlibs.
13462 * ecore.cs: Oops, enumerations were not following the entire code path
13464 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13466 * typemanager.cs (FilterWithClosure): Commented out the test for
13467 1540 in typemanager.cs, as it has problems when accessing
13468 protected methods from a parent class (see test-174.cs).
13470 * attribute.cs (Attribute.ValidateGuid): new method.
13471 (Attribute.Resolve): Use above.
13473 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13475 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13477 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13478 handling for enumerations, as we only needed the TypeContainer
13479 functionality to begin with (this is required for the fix below to
13480 work for enums that reference constants in a container class for
13483 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13485 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13486 a valid TypeBuilder to perform lookups on.o
13488 * class.cs (InheritableMemberSignatureCompare): Use true in the
13489 call to GetGetMethod and GetSetMethod, because we are comparing
13490 the signature, and we need to get the methods *even* if they are
13493 (PropertyBase.CheckBase): ditto.
13495 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13496 GotoCase.Resolve): Use Peel on EmpytCasts.
13498 * ecore.cs (EmptyCast): drop child, add Peel method.
13500 2002-11-17 Martin Baulig <martin@ximian.com>
13502 * ecore.cs (EmptyCast.Child): New public property.
13504 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13505 label resolved to an EmptyCast. Fixes #34162.
13506 (GotoCase.Resolve): Likewise.
13507 (Block.EmitMeta): Likewise.
13509 2002-11-17 Martin Baulig <martin@ximian.com>
13511 * expression.cs (Invocation.BetterConversion): Prefer int over
13512 uint; short over ushort; long over ulong for integer literals.
13513 Use ImplicitConversionExists instead of StandardConversionExists
13514 since we also need to check for user-defined implicit conversions.
13515 Fixes #34165. Added test-173.cs.
13517 2002-11-16 Martin Baulig <martin@ximian.com>
13519 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13520 with the `true' and `false' literals. Fixes #33151.
13522 2002-11-16 Martin Baulig <martin@ximian.com>
13524 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13525 October 22nd; don't do the cs1540 check for static members.
13527 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13528 now using our own filter here and doing the cs1540 check again.
13530 2002-11-16 Martin Baulig <martin@ximian.com>
13532 * support.cs (InternalParameters): Don't crash if we don't have
13533 any fixed parameters. Fixes #33532.
13535 2002-11-16 Martin Baulig <martin@ximian.com>
13537 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13538 when looking up static methods to make this work on Windows.
13541 2002-11-16 Martin Baulig <martin@ximian.com>
13543 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13544 a setter rather than using PropertyInfo.CanWrite.
13546 2002-11-15 Nick Drochak <ndrochak@gol.com>
13548 * class.cs: Allow acces to block member by subclasses. Fixes build
13551 2002-11-14 Martin Baulig <martin@ximian.com>
13553 * class.cs (Constructor.Emit): Added the extern/block check.
13556 2002-11-14 Martin Baulig <martin@ximian.com>
13558 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13559 iteration while looking for indexers, this is needed because the
13560 indexer may have a different name in our base classes. Fixed the
13561 error reporting (no indexers at all, not get accessor, no
13562 overloaded match). Fixes bug #33089.
13563 (IndexerAccess.DoResolveLValue): Likewise.
13565 2002-11-14 Martin Baulig <martin@ximian.com>
13567 * class.cs (PropertyBase.CheckBase): Make this work for multiple
13568 indexers. Fixes the first part of bug #33089.
13569 (MethodSignature.InheritableMemberSignatureCompare): Added support
13572 2002-11-13 Ravi Pratap <ravi@ximian.com>
13574 * attribute.cs (Attribute.Resolve): Catch the
13575 NullReferenceException and report it since it isn't supposed to
13578 2002-11-12 Miguel de Icaza <miguel@ximian.com>
13580 * expression.cs (Binary.EmitBranchable): Also handle the cases for
13581 LogicalOr and LogicalAnd that can benefit from recursively
13582 handling EmitBranchable. The code now should be nice for Paolo.
13584 2002-11-08 Miguel de Icaza <miguel@ximian.com>
13586 * typemanager.cs (LookupType): Added a negative-hit hashtable for
13587 the Type lookups, as we perform quite a number of lookups on
13588 non-Types. This can be removed once we can deterministically tell
13589 whether we have a type or a namespace in advance.
13591 But this might require special hacks from our corlib.
13595 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13596 and double which avoids a conversion from an integer to a double.
13598 * expression.cs: tiny optimization, avoid calling IsConstant,
13599 because it effectively performs the lookup twice.
13601 2002-11-06 Miguel de Icaza <miguel@ximian.com>
13603 But a bogus return here to keep the semantics of the old code
13604 until the Mono runtime is fixed.
13606 * pending.cs (GetMissingInterfaces): New method used to remove all
13607 the interfaces that are already implemented by our parent
13608 classes from the list of pending methods.
13610 * interface.cs: Add checks for calls after ResolveTypeExpr.
13612 2002-11-05 Miguel de Icaza <miguel@ximian.com>
13614 * class.cs (Class.Emit): Report warning 67: event not used if the
13615 warning level is beyond 3.
13617 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13618 being a NullLiteral.
13620 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13623 * class.cs (TypeContainer.GetClassBases): Cover a missing code
13624 path that might fail if a type can not be resolved.
13626 * expression.cs (Binary.Emit): Emit unsigned versions of the
13629 * driver.cs: use error 5.
13631 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13633 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13635 2002-11-01 Miguel de Icaza <miguel@ximian.com>
13637 * cs-parser.jay (switch_section): A beautiful patch from Martin
13638 Baulig that fixed 33094.
13640 2002-10-31 Miguel de Icaza <miguel@ximian.com>
13642 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13643 Check whether the base is abstract and report an error if so.
13645 * expression.cs (IndexerAccess.DoResolveLValue,
13646 IndexerAccess.DoResolve): ditto.
13648 (Invocation.DoResolve): ditto.
13650 (Invocation.FullMethodDesc): Improve the report string.
13652 * statement.cs (Block): Eliminate IsVariableDefined as it is
13653 basically just a wrapper for GetVariableInfo.
13655 * ecore.cs (SimpleName): Use new
13657 * support.cs (ReflectionParamter.ParameterType): We unwrap the
13658 type, as we return the actual parameter ref/unref state on a
13661 2002-10-30 Miguel de Icaza <miguel@ximian.com>
13663 * support.cs: Return proper flags REF/OUT fixing the previous
13666 * expression.cs: Reverted last patch, that was wrong. Is_ref is
13667 not used to mean `ref' but `ref or out' in ParameterReference
13669 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13670 full type signature instead of calling TypeManger.CSharpName
13673 * support.cs (InternalParameters.ParameterDesc): Do not compare
13674 directly to the modflags, because REF/OUT will actually be bitsets
13677 * delegate.cs (VerifyMethod): Check also the modifiers.
13679 * cs-tokenizer.cs: Fix bug where floating point values with an
13680 exponent where a sign was missing was ignored.
13682 * driver.cs: Allow multiple assemblies to be specified in a single
13685 2002-10-28 Miguel de Icaza <miguel@ximian.com>
13687 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
13688 because identifiers after a parenthesis would end up in this kind
13689 of production, and we needed to desamiguate it for having casts
13692 (UserDefinedType *) xxx
13694 2002-10-24 Miguel de Icaza <miguel@ximian.com>
13696 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13697 we should set on the Bindingflags.NonPublic, but not turn on
13698 private_ok. private_ok controls whether a Private member is
13699 returned (this is chekced on the filter routine), while the
13700 BindingFlags.NonPublic just controls whether private/protected
13701 will be allowed. This fixes the problem part of the problem of
13702 private properties being allowed to be used in derived classes.
13704 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13705 so we can call the children DoResolveLValue method (this will
13706 properly signal errors on lvalue assignments to base properties)
13708 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13709 getter are null, and we have a property info, we know that this
13710 happened because the lookup failed, so we report an error 122 for
13711 protection level violation.
13713 We also silently return if setter and getter are null in the
13714 resolve functions, this condition only happens if we have flagged
13715 the error before. This is the other half of the problem.
13717 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13718 not have accessibility information, that is why we were returning
13719 true in the filter function in typemanager.cs.
13721 To properly report 122 (property is inaccessible because of its
13722 protection level) correctly, we report this error in ResolveAccess
13723 by failing if both the setter and the getter are lacking (ie, the
13726 DoResolve and DoLResolve have been modified to check for both
13727 setter/getter being null and returning silently, the reason being
13728 that I did not want to put the knowledge about this error in upper
13731 int old = Report.Errors;
13732 x = new PropertyExpr (...);
13733 if (old != Report.Errors)
13738 So the property expr is returned, but it is invalid, so the error
13739 will be flagged during the resolve process.
13741 * class.cs: Remove InheritablePropertySignatureCompare from the
13742 class, as we no longer depend on the property signature to compute
13743 whether it is possible to implement a method or not.
13745 The reason is that calling PropertyInfo.GetGetMethod will return
13746 null (in .NET, in Mono it works, and we should change this), in
13747 cases where the Get Method does not exist in that particular
13752 class X { public virtual int A { get { return 1; } } }
13754 class Z : Y { public override int A { get { return 2; } } }
13756 Would fail in Z because the parent (Y) would not have the property
13757 defined. So we avoid this completely now (because the alternative
13758 fix was ugly and slow), and we now depend exclusively on the
13761 (PropertyBase.CheckBase): Use a method-base mechanism to find our
13762 reference method, instead of using the property.
13764 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13765 routines are gone now.
13767 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13768 names, they were incorrectly named.
13770 * cs-tokenizer.cs: Return are more gentle token on failure.
13772 * pending.cs (PendingImplementation.InterfaceMethod): This routine
13773 had an out-of-sync index variable, which caused it to remove from
13774 the list of pending methods the wrong method sometimes.
13776 2002-10-22 Miguel de Icaza <miguel@ximian.com>
13778 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13779 CanWrite, because those refer to this particular instance of the
13780 property, and do not take into account the fact that we can
13781 override single members of a property.
13783 Constructor requires an EmitContext. The resolution process does
13784 not happen here, but we need to compute the accessors before,
13785 because the resolution does not always happen for properties.
13787 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13788 subclass, before we did not update this flag, but we did update
13791 (GetAccessors): Drop this routine, as it did not work in the
13792 presence of partially overwritten set/get methods.
13794 Notice that this broke the cs1540 detection, but that will require
13797 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13801 * driver.cs: issue a warning instead of an error if we don't support
13802 debugging for the platform. Also ignore a couple of errors that may
13803 arise when trying to write the symbols. Undo my previous patch.
13805 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13807 * driver.cs: ignore /debug switch except for Unix platforms.
13809 2002-10-23 Nick Drochak <ndrochak@gol.com>
13811 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13813 2002-10-21 Miguel de Icaza <miguel@ximian.com>
13815 * driver.cs: Do not make mcs-debug conditional, so we do not break
13816 builds that use it.
13818 * statement.cs (UsageVector.MergeChildren): I would like Martin to
13819 review this patch. But basically after all the children variables
13820 have been merged, the value of "Breaks" was not being set to
13821 new_breaks for Switch blocks. I think that it should be set after
13822 it has executed. Currently I set this to the value of new_breaks,
13823 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13824 conservative, but I do not understand this code very well.
13826 I did not break anything in the build, so that is good ;-)
13828 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13830 2002-10-20 Mark Crichton <crichton@gimp.org>
13832 * cfold.cs: Fixed compile blocker. Really fixed it this time.
13834 2002-10-20 Nick Drochak <ndrochak@gol.com>
13836 * cfold.cs: Fixed compile blocker.
13838 2002-10-20 Miguel de Icaza <miguel@ximian.com>
13840 * driver.cs: I was chekcing the key, not the file.
13842 2002-10-19 Ravi Pratap <ravi@ximian.com>
13844 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13845 message that we were generating - we just need to silently return
13848 2002-10-19 Miguel de Icaza <miguel@ximian.com>
13850 * class.cs (Event.Define): Change my previous commit, as this
13851 breaks the debugger. This is a temporary hack, as it seems like
13852 the compiler is generating events incorrectly to begin with.
13854 * expression.cs (Binary.ResolveOperator): Added support for
13855 "U operator - (E x, E y)"
13857 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13860 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13861 init-only variables, but this path did not take into account that
13862 there might be also instance readonly variables. Correct this
13865 This fixes bug 32253
13867 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13870 * driver.cs: Change the extension for modules to `netmodule'
13872 * cs-parser.jay: Improved slightly the location tracking for
13873 the debugger symbols.
13875 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13876 modifiers that were specified instead of the hardcoded value
13877 (FamAndAssem). This was basically ignoring the static modifier,
13878 and others. Fixes 32429.
13880 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13881 fixed a bug in the process (32476)
13883 * expression.cs (ArrayAccess.EmitAssign): Patch from
13884 hwang_rob@yahoo.ca that fixes bug 31834.3
13886 2002-10-18 Miguel de Icaza <miguel@ximian.com>
13888 * driver.cs: Make the module extension .netmodule.
13890 2002-10-16 Miguel de Icaza <miguel@ximian.com>
13892 * driver.cs: Report an error if the resource file is not found
13893 instead of crashing.
13895 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13896 false, like Emit does.
13898 2002-10-16 Nick Drochak <ndrochak@gol.com>
13900 * typemanager.cs: Remove unused private member. Also reported mcs
13901 bug to report this as a warning like csc.
13903 2002-10-15 Martin Baulig <martin@gnome.org>
13905 * statement.cs (Statement.Emit): Made this a virtual method; emits
13906 the line number info and calls DoEmit().
13907 (Statement.DoEmit): New protected abstract method, formerly knows
13908 as Statement.Emit().
13910 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13912 2002-10-11 Miguel de Icaza <miguel@ximian.com>
13914 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13915 have fixed a remaining problem: not every AddXXXX was adding a
13916 fully qualified name.
13918 Now everyone registers a fully qualified name in the DeclSpace as
13919 being defined instead of the partial name.
13921 Downsides: we are slower than we need to be due to the excess
13922 copies and the names being registered this way.
13924 The reason for this is that we currently depend (on the corlib
13925 bootstrap for instance) that types are fully qualified, because
13926 we dump all the types in the namespace, and we should really have
13927 types inserted into the proper namespace, so we can only store the
13928 basenames in the defined_names array.
13930 2002-10-10 Martin Baulig <martin@gnome.org>
13932 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13933 from bug #31834, see the bug report for a testcase which is
13936 2002-10-10 Martin Baulig <martin@gnome.org>
13938 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13939 flow analysis code for this.
13941 * statement.cs (Do, While, For): Tell the flow analysis code about
13943 (FlowBranching.UsageVector): Added support for infinite loops.
13944 (Block.Resolve): Moved the dead code elimination here and use flow
13947 2002-10-09 Miguel de Icaza <miguel@ximian.com>
13949 * class.cs (Field.Define): Catch cycles on struct type
13952 * typemanager.cs (IsUnmanagedtype): Do not recursively check
13953 fields if the fields are static. We only need to check instance
13956 * expression.cs (As.DoResolve): Test for reference type.
13958 * statement.cs (Using.ResolveExpression): Use
13959 ConvertImplicitRequired, not ConvertImplicit which reports an
13961 (Using.ResolveLocalVariableDecls): ditto.
13963 * expression.cs (Binary.ResolveOperator): Report errors in a few
13964 places where we had to.
13966 * typemanager.cs (IsUnmanagedtype): Finish implementation.
13968 2002-10-08 Miguel de Icaza <miguel@ximian.com>
13970 * expression.cs: Use StoreFromPtr instead of extracting the type
13971 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
13973 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13974 an enumeration value to a System.Enum, but System.Enum is not a
13975 value type, but an class type, so we need to box.
13977 (Expression.ConvertExplicit): One codepath could return
13978 errors but not flag them. Fix this. Fixes #31853
13980 * parameter.cs (Resolve): Do not allow void as a parameter type.
13982 2002-10-06 Martin Baulig <martin@gnome.org>
13984 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13985 if it's a class type and not a struct. Fixes #31815.
13987 2002-10-06 Martin Baulig <martin@gnome.org>
13989 * statement.cs: Reworked the flow analysis code a bit to make it
13990 usable for dead code elimination.
13992 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13994 * cs-parser.jay: allow empty source files. Fixes bug #31781.
13996 2002-10-04 Miguel de Icaza <miguel@ximian.com>
13998 * expression.cs (ComposedCast.DoResolveType): A quick workaround
13999 to fix the test 165, will investigate deeper.
14001 2002-10-04 Martin Baulig <martin@gnome.org>
14003 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14004 finally blocks actually work.
14005 (Try.Resolve): We don't need to create a sibling for `finally' if
14006 there is no finally block.
14008 2002-10-04 Martin Baulig <martin@gnome.org>
14010 * class.cs (Constructor.Define): The default accessibility for a
14011 non-default constructor is private, not public.
14013 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14015 * class.cs (Constructor): Make AllowedModifiers public, add
14018 * cs-parser.jay: Perform the modifiers test here, as the
14019 constructor for the Constructor class usually receives a zero
14020 because of the way we create it (first we create, later we
14021 customize, and we were never checking the modifiers).
14023 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14024 is a version of LookupTypeReflection that includes the type-name
14025 cache. This can be used as a fast path for functions that know
14026 the fully qualified name and are only calling into *.GetType() to
14027 obtain a composed type.
14029 This is also used by TypeManager.LookupType during its type
14032 (LookupType): We now also track the real type name, as sometimes
14033 we can get a quey for the real type name from things like
14034 ComposedCast. This fixes bug 31422.
14036 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14037 complete type fullname, it does not have to go through the type
14038 resolution system to obtain the composed version of the type (for
14039 obtaining arrays or pointers).
14041 (Conditional.Emit): Use the EmitBoolExpression to
14042 generate nicer code, as requested by Paolo.
14044 (ArrayCreation.CheckIndices): Use the patch from
14045 hwang_rob@yahoo.ca to validate the array initializers.
14047 2002-10-03 Miguel de Icaza <miguel@ximian.com>
14049 * class.cs (ConstructorInitializer.Emit): simplify code by using
14050 Invocation.EmitCall, and at the same time, fix the bugs in calling
14051 parent constructors that took variable arguments.
14053 * ecore.cs (Expression.ConvertNumericExplicit,
14054 Expression.ImplicitNumericConversion): Remove the code that
14055 manually wrapped decimal (InternalTypeConstructor call is now gone
14058 * expression.cs (Cast.TryReduce): Also handle decimal types when
14059 trying to perform a constant fold on the type.
14061 * typemanager.cs (IsUnmanagedtype): Partially implemented.
14063 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14064 that only turned off an error report, and did nothing else.
14066 2002-10-02 Miguel de Icaza <miguel@ximian.com>
14068 * driver.cs: Handle and ignore /fullpaths
14070 2002-10-01 Miguel de Icaza <miguel@ximian.com>
14072 * expression.cs (Binary.ResolveOperator): Catch the case where
14073 DoNumericPromotions returns true,
14075 (Binary.DoNumericPromotions): Simplify the code, and the tests.
14077 2002-09-27 Miguel de Icaza <miguel@ximian.com>
14079 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14082 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14084 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14085 conversion exists, but it is also required that the conversion be
14086 performed. This manifested in "(Type64Enum) 2".
14088 * class.cs (TypeManager.AddMethod): The fix is not to change
14089 AddEnum, because that one was using a fully qualified name (every
14090 DeclSpace derivative does), but to change the AddMethod routine
14091 that was using an un-namespaced name. This now correctly reports
14092 the duplicated name.
14094 Revert patch until I can properly fix it. The issue
14095 is that we have a shared Type space across all namespaces
14096 currently, which is wrong.
14098 Options include making the Namespace a DeclSpace, and merge
14099 current_namespace/current_container in the parser.
14101 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14103 * cs-parser.jay: Improve error reporting when we get a different
14104 kind of expression in local_variable_type and
14105 local_variable_pointer_type.
14107 Propagate this to avoid missleading errors being reported.
14109 * ecore.cs (ImplicitReferenceConversion): treat
14110 TypeManager.value_type as a target just like object_type. As
14115 Is valid, and needs to result in the int 1 being boxed before it
14116 is assigned to the value type v.
14118 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14119 to validate the enumeration name.
14121 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14122 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14123 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14125 * ecore.cs (TryImplicitIntConversion): When doing an
14126 implicit-enumeration-conversion, check if the type is 64-bits and
14127 perform a conversion before passing to EnumConstant.
14129 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14131 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14132 report ambiguous type references. Unlike the MS version, we
14133 report what the ambiguity is. Innovation at work ;-)
14135 (DeclSpace.FindType): Require a location argument to
14136 display when we display an ambiguous error.
14138 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14140 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14142 * expression.cs (EmitDynamicInitializers): Apply patch from
14143 hwang_rob@yahoo.ca that fixes the order in which we emit our
14146 2002-09-21 Martin Baulig <martin@gnome.org>
14148 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14149 delegate takes no arguments.
14151 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14153 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14156 * expression.cs: Extract the underlying type.
14158 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14160 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14162 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14164 * class.cs (TypeContainer.DefineType): We can not use the nice
14165 PackingSize with the size set to 1 DefineType method, because it
14166 will not allow us to define the interfaces that the struct
14169 This completes the fixing of bug 27287
14171 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14172 means also structs. This fixes part of the problem.
14173 (Expresion.ImplicitReferenceConversionExists): ditto.
14175 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14176 error if there were no errors reported during the type lookup
14177 process, to avoid duplicates or redundant errors. Without this
14178 you would get an ambiguous errors plus a type not found. We have
14179 beaten the user enough with the first error.
14181 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14184 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14185 during the resolution process, stop the lookup, this avoids
14186 repeated error reports (same error twice).
14188 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14190 * typemanager.cs (LookupType): Redo the type lookup code to match
14191 the needs of System.Reflection.
14193 The issue is that System.Reflection requires references to nested
14194 types to begin with a "+" sign instead of a dot. So toplevel
14195 types look like: "NameSpace.TopLevelClass", and nested ones look
14196 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14199 2002-09-19 Martin Baulig <martin@gnome.org>
14201 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14202 says that a method always returns or always throws an exception,
14203 don't report the CS0161.
14205 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14206 set `Returns = new_returns'.
14208 2002-09-19 Martin Baulig <martin@gnome.org>
14210 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14211 to an enum constant, check for a CS0176.
14213 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14215 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14216 for operators that must be in pairs and report errors.
14218 * ecore.cs (SimpleName.DoResolveType): During the initial type
14219 resolution process, when we define types recursively, we must
14220 check first for types in our current scope before we perform
14221 lookups in the enclosing scopes.
14223 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14225 (Invocation.VerifyArgumentsCompat): Call
14226 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14227 I thought we were supposed to always call this, but there are a
14228 few places in the code where we dont do it.
14230 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14232 * driver.cs: Add support in -linkres and -resource to specify the
14233 name of the identifier.
14235 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14237 * ecore.cs (StandardConversionExists): Sync with the conversion
14238 code: allow anything-* to void* conversions.
14240 (FindMostSpecificSource): Use an Expression argument
14241 instead of a Type, because we might be handed over a Literal which
14242 gets a few more implicit conversions that plain types do not. So
14243 this information was being lost.
14245 Also, we drop the temporary type-holder expression when not
14248 2002-09-17 Martin Baulig <martin@gnome.org>
14250 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14251 this is an explicit interface implementation.
14253 2002-09-17 Martin Baulig <martin@gnome.org>
14255 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14256 different `IndexerName' attributes.
14258 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14259 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14260 virtual CommonResolve().
14262 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14264 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14265 and convert that to the UnderlyingType.
14267 * statement.cs (Foreach.Resolve): Indexers are just like variables
14268 or PropertyAccesses.
14270 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14271 inside quoted strings, we were not doing this before.
14273 2002-09-16 Martin Baulig <martin@gnome.org>
14275 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14276 resolve it. This is needed for the definite assignment check of the
14277 instance expression, fixes bug #29846.
14278 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14280 2002-09-16 Nick Drochak <ndrochak@gol.com>
14282 * parameter.cs: Fix compile error. Cannot reference static member
14283 from an instance object. Is this an mcs bug?
14285 2002-09-14 Martin Baulig <martin@gnome.org>
14287 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14288 multiple times. Fixes bug #30295, added test-166.cs.
14290 2002-09-14 Martin Baulig <martin@gnome.org>
14292 * statement.cs (Block.Emit): Don't emit unreachable code.
14293 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14294 `break' statements.
14295 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14297 2002-09-14 Martin Baulig <martin@gnome.org>
14299 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14302 2002-09-14 Martin Baulig <martin@gnome.org>
14304 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14305 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14306 be false on the ms runtime.
14308 2002-09-13 Martin Baulig <martin@gnome.org>
14310 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14311 the CS0038 error message.
14313 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14315 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14316 constant inside, return it.
14318 2002-09-12 Martin Baulig <martin@gnome.org>
14320 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14321 implicit conversion can be done between enum types.
14323 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14324 check whether an implicit conversion to the current enum's UnderlyingType
14325 exists and report an error if not.
14327 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14328 without debugging support.
14330 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14331 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14333 2002-09-12 Martin Baulig <martin@gnome.org>
14335 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14337 * ecore.cs (IMemberExpr.DeclaringType): New property.
14338 (SimpleName.SimpleNameResolve): Check whether we're accessing a
14339 nonstatic member of an outer type (CS0038).
14341 2002-09-11 Miguel de Icaza <miguel@ximian.com>
14343 * driver.cs: Activate the using-error detector at warning level
14344 4 (at least for MS-compatible APIs).
14346 * namespace.cs (VerifyUsing): Small buglett fix.
14348 * pending.cs (PendingImplementation): pass the container pointer.
14350 * interface.cs (GetMethods): Allow for recursive definition. Long
14351 term, I would like to move every type to support recursive
14352 definitions, not the current ordering mechanism that we have right
14355 The situation is this: Attributes are handled before interfaces,
14356 so we can apply attributes to interfaces. But some attributes
14357 implement interfaces, we will now handle the simple cases
14358 (recursive definitions will just get an error).
14360 * parameter.cs: Only invalidate types at the end if we fail to
14363 2002-09-09 Martin Baulig <martin@gnome.org>
14365 * ecore.cs (PropertyExpr.Emit): Also check for
14366 TypeManager.system_int_array_get_length so this'll also work when
14367 compiling corlib. Fixes #30003.
14369 2002-09-09 Martin Baulig <martin@gnome.org>
14371 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14372 and throw an exception if we can't get the type's size. Fixed #30040,
14375 2002-09-09 Martin Baulig <martin@gnome.org>
14377 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14379 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14380 context. Fixes bug #30027.
14382 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14383 virtual functions. Fixes bug #30043, added test-164.cs.
14385 2002-09-08 Ravi Pratap <ravi@ximian.com>
14387 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14389 2002-09-08 Nick Drochak <ndrochak@gol.com>
14391 * driver.cs: Use an object to get the windows codepage since it's not a
14394 2002-09-08 Miguel de Icaza <miguel@ximian.com>
14396 * statement.cs (For.Emit): for infinite loops (test == null)
14397 return whether there is a break inside, not always "true".
14399 * namespace.cs (UsingEntry): New struct to hold the name of the
14400 using definition, the location where it is defined, and whether it
14401 has been used in a successful type lookup.
14403 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14408 2002-09-06 Ravi Pratap <ravi@ximian.com>
14410 * attribute.cs : Fix incorrect code which relied on catching
14411 a NullReferenceException to detect a null being passed in
14412 where an object was expected.
14414 2002-09-06 Miguel de Icaza <miguel@ximian.com>
14416 * statement.cs (Try): flag the catch variable as assigned
14418 * expression.cs (Cast): Simplified by using ResolveType instead of
14419 manually resolving.
14421 * statement.cs (Catch): Fix bug by using ResolveType.
14423 2002-09-06 Ravi Pratap <ravi@ximian.com>
14425 * expression.cs (BetterConversion): Special case for when we have
14426 a NullLiteral as the argument and we have to choose between string
14427 and object types - we choose string the way csc does.
14429 * attribute.cs (Attribute.Resolve): Catch the
14430 NullReferenceException and report error #182 since the Mono
14431 runtime no more has the bug and having this exception raised means
14432 we tried to select a constructor which takes an object and is
14435 2002-09-05 Ravi Pratap <ravi@ximian.com>
14437 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14438 message (1502, 1503) when we can't locate a method after overload
14439 resolution. This is much more informative and closes the bug
14442 * interface.cs (PopulateMethod): Return if there are no argument
14443 types. Fixes a NullReferenceException bug.
14445 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14446 expressions too. Previously we were checking only in one place for
14447 positional arguments leaving out named arguments.
14449 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14450 type to the enum type is not allowed. Remove code corresponding to
14453 (ConvertNumericExplicit): Allow explicit conversions from
14454 the underlying type to enum type. This precisely follows the spec
14455 and closes a bug filed by Gonzalo.
14457 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14460 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14462 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14464 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14465 it was important that we stored the right value after the
14466 reduction in `converted'.
14468 2002-09-04 Martin Baulig <martin@gnome.org>
14470 * location.cs (Location.SymbolDocument): Use full pathnames for the
14473 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14475 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14476 of the expression resolve mechanism, because that will catch the
14477 SimpleName error failures.
14479 (Conditional): If we can not resolve the
14480 expression, return, do not crash.
14482 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14485 (location): display token name instead of its number.
14487 2002-08-28 Martin Baulig <martin@gnome.org>
14489 * expression.cs (Binary.ResolveOperator): Don't silently return
14490 but return an error if an operator cannot be applied between two
14493 2002-08-28 Martin Baulig <martin@gnome.org>
14495 * class.cs (Constructor.Define): Set the permission attributes
14496 correctly instead of making all constructors public.
14498 2002-08-28 Martin Baulig <martin@gnome.org>
14500 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14501 for private members before reporting a CS0103; if we find anything,
14504 2002-08-28 Martin Baulig <martin@gnome.org>
14506 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14507 to check whether `closure_start_type == closure_invocation_type',
14508 we also need to check whether `m.DeclaringType == closure_invocation_type'
14509 before bypassing the permission checks. We might be accessing
14510 protected/private members from the base class.
14511 (TypeManager.RealMemberLookup): Only set private_ok if private
14512 members were requested via BindingFlags.NonPublic.
14514 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14516 * expression.cs (MemberAccess.ResolveMemberAccess): Set
14517 MethodGroupExpr.IsExplicitImpl if appropriate.
14518 (Invocation.DoResolve): Don't report the CS0120 for explicit
14519 interface implementations.
14521 2002-08-27 Martin Baulig <martin@gnome.org>
14523 * expression.cs (Invocation.DoResolve): If this is a static
14524 method and we don't have an InstanceExpression, we must report
14527 2002-08-25 Martin Baulig <martin@gnome.org>
14529 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14530 `==' between a valuetype and an object.
14532 2002-08-25 Miguel de Icaza <miguel@ximian.com>
14534 * ecore.cs (TypeExpr): Provide a ToString method.
14536 2002-08-24 Martin Baulig <martin@gnome.org>
14538 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14539 now called proggie.dbg and it's a binary file.
14541 2002-08-23 Martin Baulig <martin@gnome.org>
14543 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14545 2002-08-23 Martin Baulig <martin@gnome.org>
14547 * struct.cs (MyStructInfo.ctor): Make this work with empty
14548 structs; it's not allowed to use foreach() on null.
14550 2002-08-23 Martin Baulig <martin@gnome.org>
14552 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14553 writer the full pathname of the generated assembly.
14555 2002-08-23 Martin Baulig <martin@gnome.org>
14557 * statements.cs (FlowBranching.UsageVector.MergeChildren):
14558 A `finally' block never returns or breaks; improved handling of
14561 2002-08-23 Martin Baulig <martin@gnome.org>
14563 * statement.cs (Throw.Resolve): Allow `throw null'.
14565 2002-08-23 Martin Baulig <martin@gnome.org>
14567 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14568 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14569 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
14570 MemberLookup would return a wrong event if this is an explicit
14571 interface implementation and the class has an event with the same
14574 2002-08-23 Martin Baulig <martin@gnome.org>
14576 * statement.cs (Block.AddChildVariableNames): New public method.
14577 (Block.AddChildVariableName): Likewise.
14578 (Block.IsVariableNameUsedInChildBlock): Likewise.
14579 (Block.AddVariable): Check whether a variable name has already
14580 been used in a child block.
14582 * cs-parser.jay (declare_local_variables): Mark all variable names
14583 from the current block as being used in a child block in the
14586 2002-08-23 Martin Baulig <martin@gnome.org>
14588 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14589 find the symbol writer.
14591 * driver.cs: csc also allows the arguments to /define being
14592 separated by commas, not only by semicolons.
14594 2002-08-23 Martin Baulig <martin@gnome.org>
14596 * interface.cs (Interface.GetMembers): Added static check for events.
14598 2002-08-15 Martin Baulig <martin@gnome.org>
14600 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14601 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14603 * ecore.cs (Expression.MemberLookup): Added documentation and explained
14604 why the MethodData.EmitDestructor() change was necessary.
14606 2002-08-20 Martin Baulig <martin@gnome.org>
14608 * class.cs (TypeContainer.FindMembers): Added static check for events.
14610 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14612 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14613 use Type.GetEvents(), not Type.FindMembers().
14615 2002-08-20 Martin Baulig <martin@gnome.org>
14617 * decl.cs (MemberCache): Added a special method cache which will
14618 be used for method-only searched. This ensures that a method
14619 search will return a MethodInfo with the correct ReflectedType for
14622 2002-08-20 Martin Baulig <martin@gnome.org>
14624 * decl.cs (DeclSpace.FindMembers): Made this public.
14626 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14628 * delegate.cs: fixed build on windows.
14629 [FIXME: Filed as bug #29150: MCS must report these errors.]
14631 2002-08-19 Ravi Pratap <ravi@ximian.com>
14633 * ecore.cs (StandardConversionExists): Return a false
14634 if we are trying to convert the void type to anything else
14635 since that is not allowed.
14637 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14638 we flag error 70 in the event an event is trying to be accessed
14639 directly from outside the declaring type.
14641 2002-08-20 Martin Baulig <martin@gnome.org>
14643 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14644 MemberCache from typemanager.cs to decl.cs.
14646 2002-08-19 Martin Baulig <martin@gnome.org>
14648 * class.cs (TypeContainer): Implement IMemberContainer.
14649 (TypeContainer.DefineMembers): Create the MemberCache.
14650 (TypeContainer.FindMembers): Do better BindingFlags checking; only
14651 return public members if BindingFlags.Public was given, check
14652 whether members are static.
14654 2002-08-16 Martin Baulig <martin@gnome.org>
14656 * decl.cs (DeclSpace.Define): Splitted this in Define and
14657 DefineMembers. DefineMembers is called first and initializes the
14660 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
14661 DefineMembers() on all our DeclSpaces.
14663 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14664 but call DefineMembers() on all nested interfaces. We call their
14665 Define() in our new Define() function.
14667 * interface.cs (Interface): Implement IMemberContainer.
14668 (Interface.Define): Moved all code except the attribute stuf to
14670 (Interface.DefineMembers): Initialize the member cache.
14672 * typemanager.cs (IMemberFinder): Removed this interface, we don't
14673 need this anymore since we can use MemberCache.FindMembers directly.
14675 2002-08-19 Martin Baulig <martin@gnome.org>
14677 * typemanager.cs (MemberCache): When creating the cache for an
14678 interface type, add all inherited members.
14679 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14680 to `out bool used_cache' and documented it.
14681 (TypeManager.MemberLookup): If we already used the cache in the first
14682 iteration, we don't need to do the interfaces check.
14684 2002-08-19 Martin Baulig <martin@gnome.org>
14686 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
14687 here from IMemberFinder and don't implement this interface anymore.
14688 (DeclSpace.MemberCache): Moved here from IMemberFinder.
14690 * typemanager.cs (IMemberFinder): This interface is now only used by
14691 classes which actually support the member cache.
14692 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14693 since we only put DeclSpaces into this Hashtable.
14694 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14695 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14697 2002-08-16 Martin Baulig <martin@gnome.org>
14699 * typemanager.cs (ICachingMemberFinder): Removed.
14700 (IMemberFinder.MemberCache): New property.
14701 (TypeManager.FindMembers): Merged this with RealFindMembers().
14702 This function will never be called from TypeManager.MemberLookup()
14703 so we can't use the cache here, just the IMemberFinder.
14704 (TypeManager.MemberLookup_FindMembers): Check whether the
14705 IMemberFinder has a MemberCache and call the cache's FindMembers
14707 (MemberCache): Rewrote larger parts of this yet another time and
14708 cleaned it up a bit.
14710 2002-08-15 Miguel de Icaza <miguel@ximian.com>
14712 * driver.cs (LoadArgs): Support quoting.
14714 (Usage): Show the CSC-like command line arguments.
14716 Improved a few error messages.
14718 2002-08-15 Martin Baulig <martin@gnome.org>
14720 * typemanager.cs (IMemberContainer.Type): New property.
14721 (IMemberContainer.IsInterface): New property.
14723 The following changes are conditional to BROKEN_RUNTIME, which is
14724 defined at the top of the file.
14726 * typemanager.cs (MemberCache.MemberCache): Don't add the base
14727 class'es members, but add all members from TypeHandle.ObjectType
14728 if we're an interface.
14729 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14730 is the current type.
14731 (MemberCache.CacheEntry.Container): Removed this field.
14732 (TypeHandle.GetMembers): Include inherited members.
14734 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14736 * typemanager.cs: fixed compilation and added a comment on a field that
14739 2002-08-15 Martin Baulig <martin@gnome.org>
14741 * class.cs (ConstructorInitializer.Resolve): In the
14742 Expression.MemberLookup call, use the queried_type as
14745 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14746 declared' attribute, it's always true.
14747 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14748 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14749 temporary wrapper for FindMembers which tells MemberLookup whether
14750 members from the base classes are included in the return value.
14751 This will go away soon.
14752 (TypeManager.MemberLookup): Use this temporary hack here; once the
14753 new MemberCache is completed, we don't need to do the DeclaredOnly
14754 looping here anymore since the MemberCache will take care of this.
14755 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14756 (MemberCache): When creating the MemberCache for a class, get
14757 members from the current class and all its base classes.
14758 (MemberCache.CacheEntry.Container): New field. This is a
14759 temporary hack until the Mono runtime is fixed to distinguish
14760 between ReflectedType and DeclaringType. It allows us to use MCS
14761 with both the MS runtime and the unfixed Mono runtime without
14762 problems and without accecting performance.
14763 (MemberCache.SearchMembers): The DeclaredOnly looping from
14764 TypeManager.MemberLookup is now done here.
14766 2002-08-14 Martin Baulig <martin@gnome.org>
14768 * statement.cs (MyStructInfo.MyStructInfo): Don't call
14769 Type.GetFields on dynamic types but get the fields from the
14770 corresponding TypeContainer.
14771 (MyStructInfo.GetStructInfo): Added check for enum types.
14773 * typemanager.cs (MemberList.IsSynchronized): Implemented.
14774 (MemberList.SyncRoot): Implemented.
14775 (TypeManager.FilterWithClosure): No need to check permissions if
14776 closure_start_type == closure_invocation_type, don't crash if
14777 closure_invocation_type is null.
14779 2002-08-13 Martin Baulig <martin@gnome.org>
14781 Rewrote TypeContainer.FindMembers to use a member cache. This
14782 gives us a speed increase of about 35% for the self-hosting MCS
14783 build and of about 15-20% for the class libs (both on GNU/Linux).
14785 * report.cs (Timer): New class to get enhanced profiling. This
14786 whole class is "TIMER" conditional since it remarkably slows down
14789 * class.cs (MemberList): New class. This is an IList wrapper
14790 which we're now using instead of passing MemberInfo[]'s around to
14791 avoid copying this array unnecessarily.
14792 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14793 (ICachingMemberFinder, IMemberContainer): New interface.
14794 (TypeManager.FilterWithClosure): If `criteria' is null, the name
14795 has already been checked, otherwise use it for the name comparision.
14796 (TypeManager.FindMembers): Renamed to RealMemberFinder and
14797 provided wrapper which tries to use ICachingMemberFinder.FindMembers
14798 if possible. Returns a MemberList, not a MemberInfo [].
14799 (TypeHandle): New class, implements IMemberContainer. We create
14800 one instance of this class per type, it contains a MemberCache
14801 which is used to do the member lookups.
14802 (MemberCache): New class. Each instance of this class contains
14803 all members of a type and a name-based hash table.
14804 (MemberCache.FindMembers): This is our new member lookup
14805 function. First, it looks up all members of the requested name in
14806 the hash table. Then, it walks this list and sorts out all
14807 applicable members and returns them.
14809 2002-08-13 Martin Baulig <martin@gnome.org>
14811 In addition to a nice code cleanup, this gives us a performance
14812 increase of about 1.4% on GNU/Linux - not much, but it's already
14813 half a second for the self-hosting MCS compilation.
14815 * typemanager.cs (IMemberFinder): New interface. It is used by
14816 TypeManager.FindMembers to call FindMembers on a TypeContainer,
14817 Enum, Delegate or Interface.
14818 (TypeManager.finder_to_member_finder): New PtrHashtable.
14819 (TypeManager.finder_to_container): Removed.
14820 (TypeManager.finder_to_delegate): Removed.
14821 (TypeManager.finder_to_interface): Removed.
14822 (TypeManager.finder_to_enum): Removed.
14824 * interface.cs (Interface): Implement IMemberFinder.
14826 * delegate.cs (Delegate): Implement IMemberFinder.
14828 * enum.cs (Enum): Implement IMemberFinder.
14830 * class.cs (TypeContainer): Implement IMemberFinder.
14832 2002-08-12 Martin Baulig <martin@gnome.org>
14834 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14836 2002-08-12 Martin Baulig <martin@gnome.org>
14838 * ecore.cs (ITypeExpression): New interface for expressions which
14840 (TypeExpression): Renamed to TypeLookupExpression.
14841 (Expression.DoResolve): If we're doing a types-only lookup, the
14842 expression must implement the ITypeExpression interface and we
14843 call DoResolveType() on it.
14844 (SimpleName): Implement the new ITypeExpression interface.
14845 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14846 hack, the situation that we're only looking up types can't happen
14847 anymore when this method is called. Moved the type lookup code to
14848 DoResolveType() and call it.
14849 (SimpleName.DoResolveType): This ITypeExpression interface method
14850 is now doing the types-only lookup.
14851 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14852 (ResolveFlags): Added MaskExprClass.
14854 * expression.cs (MemberAccess): Implement the ITypeExpression
14856 (MemberAccess.DoResolve): Added support for a types-only lookup
14857 when we're called via ITypeExpression.DoResolveType().
14858 (ComposedCast): Implement the ITypeExpression interface.
14860 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
14861 Expression.Resolve() with ResolveFlags.Type instead.
14863 2002-08-12 Martin Baulig <martin@gnome.org>
14865 * interface.cs (Interface.Define): Apply attributes.
14867 * attribute.cs (Attribute.ApplyAttributes): Added support for
14868 interface attributes.
14870 2002-08-11 Martin Baulig <martin@gnome.org>
14872 * statement.cs (Block.Emit): Only check the "this" variable if we
14873 do not always throw an exception.
14875 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14876 whether the property has a set accessor.
14878 2002-08-11 Martin Baulig <martin@gnome.org>
14880 Added control flow analysis support for structs.
14882 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14883 with control flow analysis turned off.
14884 (IVariable): New interface.
14885 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14886 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14887 (FieldExpr.DoResolve): Resolve the instance expression with flow
14888 analysis turned off and do the definite assignment check after the
14889 resolving when we know what the expression will resolve to.
14891 * expression.cs (LocalVariableReference, ParameterReference):
14892 Implement the new IVariable interface, only call the flow analysis
14893 code if ec.DoFlowAnalysis is true.
14894 (This): Added constructor which takes a Block argument. Implement
14895 the new IVariable interface.
14896 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14897 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14898 This does the definite assignment checks for struct members.
14900 * class.cs (Constructor.Emit): If this is a non-static `struct'
14901 constructor which doesn't have any initializer, call
14902 Block.AddThisVariable() to tell the flow analysis code that all
14903 struct elements must be initialized before control returns from
14906 * statement.cs (MyStructInfo): New public class.
14907 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14908 argument to this indexer. If non-zero, check an individual struct
14909 member, not the whole struct.
14910 (FlowBranching.CheckOutParameters): Check struct members.
14911 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14912 overloaded versions of these methods which take an additional
14913 `int field_idx' argument to check struct members.
14914 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14915 overloaded versions of these methods which take an additional
14916 `string field_name' argument to check struct member.s
14917 (VariableInfo): Implement the IVariable interface.
14918 (VariableInfo.StructInfo): New public property. Returns the
14919 MyStructInfo instance of the variable if it's a struct or null.
14920 (Block.AddThisVariable): New public method. This is called from
14921 Constructor.Emit() for non-static `struct' constructor which do
14922 not have any initializer. It creates a special variable for the
14923 "this" instance variable which will be checked by the flow
14924 analysis code to ensure that all of the struct's fields are
14925 initialized before control returns from the constructor.
14926 (UsageVector): Added support for struct members. If a
14927 variable/parameter is a struct with N members, we reserve a slot
14928 in the usage vector for each member. A struct is considered fully
14929 initialized if either the struct itself (slot 0) or all its
14930 members are initialized.
14932 2002-08-08 Martin Baulig <martin@gnome.org>
14934 * driver.cs (Driver.MainDriver): Only report an error CS5001
14935 if there were no compilation errors.
14937 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14938 `UnsafeContext' property to determine whether the parent is in
14939 unsafe context rather than checking the parent's ModFlags:
14940 classes nested in an unsafe class are unsafe as well.
14942 2002-08-08 Martin Baulig <martin@gnome.org>
14944 * statement.cs (UsageVector.MergeChildren): Distinguish between
14945 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14946 we return. Added test17() and test18() to test-154.cs.
14948 2002-08-08 Martin Baulig <martin@gnome.org>
14950 * typemanager.cs (TypeManager.FilterWithClosure): If we have
14951 Family access, make sure the invoking type isn't a subclass of the
14952 queried type (that'd be a CS1540).
14954 * ecore.cs (Expression.MemberLookup): Added overloaded version of
14955 this method which takes an additional `Type invocation_type'.
14957 * expression.cs (BaseAccess.DoResolve): Use the base type as
14958 invocation and query type.
14959 (MemberAccess.DoResolve): If the lookup failed and we're about to
14960 report a CS0122, try a lookup with the ec.ContainerType - if this
14961 succeeds, we must report a CS1540.
14963 2002-08-08 Martin Baulig <martin@gnome.org>
14965 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14966 (MethodGroupExpr): Implement the IMemberExpr interface.
14968 * expression (MemberAccess.ResolveMemberAccess): No need to have
14969 any special code for MethodGroupExprs anymore, they're now
14972 2002-08-08 Martin Baulig <martin@gnome.org>
14974 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14975 Family, FamANDAssem and FamORAssem permissions.
14976 (TypeManager.IsSubclassOrNestedChildOf): New public method.
14978 2002-08-08 Martin Baulig <martin@gnome.org>
14980 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14981 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14984 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14986 * driver.cs: implemented /resource option to embed managed resources.
14988 2002-08-07 Martin Baulig <martin@gnome.org>
14990 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14991 (FieldBase.HasFieldInitializer): New public property.
14992 (FieldBase.GetInitializerExpression): New public method. Resolves and
14993 returns the field initializer and makes sure it is only resolved once.
14994 (TypeContainer.EmitFieldInitializers): Call
14995 FieldBase.GetInitializerExpression to get the initializer, this ensures
14996 that it isn't resolved multiple times.
14998 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
14999 the resolving process (SimpleName/MemberLookup) that we're currently
15000 emitting a field initializer (which must not access any instance members,
15001 this is an error CS0236).
15003 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15004 argument, if the `IsFieldInitializer' flag is set, we must report and
15005 error CS0236 and not an error CS0120.
15007 2002-08-07 Martin Baulig <martin@gnome.org>
15009 * ecore.cs (IMemberExpr): New public interface.
15010 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15011 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15012 if the expression is an IMemberExpr.
15014 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15015 to be null, implicitly default to `this' if we're non-static in
15016 this case. Simplified the code a lot by using the new IMemberExpr
15017 interface. Also fixed bug #28176 here.
15019 2002-08-06 Martin Baulig <martin@gnome.org>
15021 * cs-parser.jay (SimpleLookup): Removed. We need to create
15022 ParameterReferences during semantic analysis so that we can do a
15023 type-only search when resolving Cast, TypeOf and SizeOf.
15024 (block): Pass the `current_local_parameters' to the Block's
15027 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15028 argument to the constructor.
15029 (ConstructorInitializer.Resolve): Create a temporary implicit
15030 block with the parameters.
15032 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15033 references here if we aren't doing a type-only search.
15035 * statement.cs (Block): Added constructor which takes a
15036 `Parameters parameters' argument.
15037 (Block.Parameters): New public property.
15039 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15040 to `Parameters' and made it public readonly.
15042 2002-08-06 Martin Baulig <martin@gnome.org>
15044 * ecore.cs (Expression.Warning): Made this public as well.
15046 * report.cs (Report.Debug): Print the contents of collections.
15048 2002-08-06 Martin Baulig <martin@gnome.org>
15050 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
15051 used to tell Resolve() which kinds of expressions it may return.
15052 (Expression.Resolve): Added overloaded version of this method which
15053 takes a `ResolveFlags flags' argument. This can be used to tell
15054 Resolve() which kinds of expressions it may return. Reports a
15056 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15057 ResolveFlags.SimpleName.
15058 (Expression.Error118): Added overloaded version of this method which
15059 takes a `ResolveFlags flags' argument. It uses the flags to determine
15060 which kinds of expressions are allowed.
15062 * expression.cs (Argument.ResolveMethodGroup): New public method.
15063 Resolves an argument, but allows a MethodGroup to be returned.
15064 This is used when invoking a delegate.
15066 * TODO: Updated a bit.
15068 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15070 Fixed compilation with csc.
15072 * ecore.cs: Expression.Error made public. Is this correct? Should
15073 Warning be made public too?
15075 * expression.cs: use ea.Location instead of ea.loc.
15076 [FIXME: Filed as bug #28607: MCS must report these errors.]
15078 2002-08-06 Martin Baulig <martin@gnome.org>
15080 * ecore.cs (Expression.loc): Moved the location here instead of
15081 duplicating it in all derived classes.
15082 (Expression.Location): New public property.
15083 (Expression.Error, Expression.Warning): Made them non-static and
15084 removed the location argument.
15085 (Expression.Warning): Added overloaded version which takes an
15086 `int level' argument.
15087 (Expression.Error118): Make this non-static and removed the
15088 expression and location arguments.
15089 (TypeExpr): Added location argument to the constructor.
15091 * expression.cs (StaticCallExpr): Added location argument to
15093 (Indirection, PointerArithmetic): Likewise.
15094 (CheckedExpr, UnCheckedExpr): Likewise.
15095 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15096 (StringPtr): Likewise.
15099 2002-08-05 Martin Baulig <martin@gnome.org>
15101 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15103 * assign.cs (Assign.DoResolve): Check whether the source
15104 expression is a value or variable.
15106 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15107 while resolving the corresponding blocks.
15109 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15110 an error, don't silently return null.
15112 * statement.cs (Block.AddVariable): Do the error reporting here
15113 and distinguish between CS0128 and CS0136.
15114 (Block.DoResolve): Report all unused labels (warning CS0164).
15115 (LabeledStatement): Pass the location to the constructor.
15116 (LabeledStatement.HasBeenReferenced): New property.
15117 (LabeledStatement.Resolve): Set it to true here.
15119 * statement.cs (Return.Emit): Return success even after reporting
15120 a type mismatch error (CS0126 or CS0127), this is what csc does and
15121 it avoids confusing the users with any consecutive errors.
15123 2002-08-05 Martin Baulig <martin@gnome.org>
15125 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15127 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15129 * expression.cs (MemberAccess.DoResolve): Silently return if an
15130 error has already been reported.
15132 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15133 error has already been reported.
15135 2002-08-05 Martin Baulig <martin@gnome.org>
15137 * statement.cs (UsageVector): Only initialize the `parameters'
15138 vector if we actually have any "out" parameters.
15140 2002-08-05 Martin Baulig <martin@gnome.org>
15142 * expression.cs (Binary.ResolveOperator): When combining delegates,
15143 they must have the same type.
15145 2002-08-05 Martin Baulig <martin@gnome.org>
15147 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15148 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15149 work with the ms runtime and we also don't need it: if we're a
15150 PropertyBuilder and not in the `indexer_arguments' hash, then we
15151 are a property and not an indexer.
15153 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15154 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15155 since the latter one doesn't work with the ms runtime.
15157 2002-08-03 Martin Baulig <martin@gnome.org>
15159 Fixed bugs #27998 and #22735.
15161 * class.cs (Method.IsOperator): New public field.
15162 (Method.CheckBase): Report CS0111 if there's already a method
15163 with the same parameters in the current class. Report CS0508 when
15164 attempting to change the return type of an inherited method.
15165 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15166 and it's not marked abstract or extern.
15167 (PropertyBase): New abstract base class for Property and Indexer.
15168 (PropertyBase.CheckBase): Moved here from Property and made it work
15170 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15171 the same so we can reuse it there.
15172 (Property, Indexer): Derive from PropertyBase.
15173 (MethodSignature.inheritable_property_signature_filter): New delegate
15174 to find properties and indexers.
15176 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15177 argument and improved error reporting.
15179 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15180 EmptyReadOnlyParameters and made it a property.
15182 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15183 version of this method which takes a `PropertyInfo indexer'.
15184 (TypeManager.RegisterIndexer): New method.
15186 * class.cs: Added myself as author of this file :-)
15188 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15190 * class.cs: fixed compilation on windoze.
15192 2002-08-03 Martin Baulig <martin@gnome.org>
15194 * interface.cs (Interface.GetInterfaceBases): Check whether all
15195 base interfaces are at least as accessible than the current one.
15197 * class.cs (TypeContainer.GetClassBases): Check whether base types
15198 are at least as accessible than the current type.
15199 (TypeContainer.AsAccessible): Implemented and made non-static.
15200 (MemberBase.CheckParameters): Report errors if the accessibility
15203 * delegate.cs (Delegate.Delegate): The default visibility is
15204 internal for top-level types and private for nested types.
15205 (Delegate.Define): Report errors if the accessibility checks fail.
15207 * enum.cs (Enum.Enum): The default visibility is internal for
15208 top-level types and private for nested types.
15209 (Enum.DefineType): Compute the correct visibility.
15211 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15212 function which takes a `bool is_toplevel' instead of a TypeContainer.
15214 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15217 2002-08-02 Martin Baulig <martin@gnome.org>
15219 * expression.cs (LocalVariableReferenc): Added constructor which
15220 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15221 (LocalVariableReference.IsReadOnly): New property.
15222 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15223 variable is readonly, use our own readonly flag to do this; you can
15224 use the new constructor to get a writable reference to a read-only
15227 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15228 reference to the local variable.
15230 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15232 * rootcontext.cs (ResolveCore): Also include System.Exception
15234 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15235 we reach an EmptyStatement.
15237 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15240 * expression.cs (Binary.ResolveOperator): Check error result in
15243 use brtrue/brfalse directly and avoid compares to null.
15245 2002-08-02 Martin Baulig <martin@gnome.org>
15247 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15248 Fixes bug #28407, added test-155.cs.
15250 2002-08-01 Martin Baulig <martin@gnome.org>
15252 * class.cs (Event.EmitDefaultMethod): Make this work with static
15253 events. Fixes #28311, added verify-3.cs.
15255 2002-08-01 Martin Baulig <martin@gnome.org>
15257 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15258 `is_disposable' fields.
15259 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15260 `hm.is_disposable' if we're using the collection pattern.
15261 (Foreach.EmitCollectionForeach): Use the correct type for the
15262 enumerator's local variable, only emit the try/finally block if
15263 necessary (fixes #27713).
15265 2002-08-01 Martin Baulig <martin@gnome.org>
15267 * ecore.cs (Expression.report118): Renamed to Error118 and made
15270 * statement.cs (Throw.Resolve): Check whether the expression is of
15271 the correct type (CS0118) and whether the type derives from
15272 System.Exception (CS0155).
15273 (Catch.Resolve): New method. Do the type lookup here and check
15274 whether it derives from System.Exception (CS0155).
15275 (Catch.CatchType, Catch.IsGeneral): New public properties.
15277 * typemanager.cs (TypeManager.exception_type): Added.
15279 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15281 * driver.cs: Updated About function.
15283 2002-07-31 Martin Baulig <martin@gnome.org>
15285 Implemented Control Flow Analysis.
15287 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15288 (EmitContext.CurrentBranching): Added.
15289 (EmitContext.StartFlowBranching): Added.
15290 (EmitContext.EndFlowBranching): Added.
15291 (EmitContext.KillFlowBranching): Added.
15292 (EmitContext.IsVariableAssigned): Added.
15293 (EmitContext.SetVariableAssigned): Added.
15294 (EmitContext.IsParameterAssigned): Added.
15295 (EmitContext.SetParameterAssigned): Added.
15296 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15297 Added control flow analysis stuff here.
15299 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15300 resolve the expression as lvalue.
15301 (LocalVariableReference.DoResolve): Check whether the variable has
15302 already been assigned.
15303 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15304 the parameter as assigned here.
15305 (ParameterReference.DoResolve): Check whether the parameter has already
15307 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15308 expression as lvalue.
15310 * statement.cs (FlowBranching): New class for the flow analysis code.
15311 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15312 (LabeledStatement.IsDefined): New public property.
15313 (LabeledStatement.AddUsageVector): New public method to tell flow
15314 analyis that the label may be reached via a forward jump.
15315 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15317 (VariableInfo.Number): New public field. This is used by flow analysis
15318 to number all locals of a block.
15319 (Block.CountVariables): New public property. This is the number of
15320 local variables in this block (including the locals from all parent
15322 (Block.EmitMeta): Number all the variables.
15324 * statement.cs: Added flow analysis support to all classes.
15326 2002-07-31 Martin Baulig <martin@gnome.org>
15328 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15329 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15330 then use this argument.
15332 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15334 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15335 use this to specify /define options.
15337 2002-07-29 Martin Baulig <martin@gnome.org>
15339 * statement.cs (Fixed): Moved all code that does variable lookups
15340 and resolvings from Emit to Resolve.
15342 * statement.cs (For): Moved all code that does variable lookups
15343 and resolvings from Emit to Resolve.
15345 * statement.cs (Using): Moved all code that does variable lookups
15346 and resolvings from Emit to Resolve.
15348 2002-07-29 Martin Baulig <martin@gnome.org>
15350 * attribute.cs (Attribute.Resolve): Explicitly catch a
15351 System.NullReferenceException when creating the
15352 CustromAttributeBuilder and report a different warning message.
15354 2002-07-29 Martin Baulig <martin@gnome.org>
15356 * support.cs (ParameterData.ParameterName): Added method to
15357 get the name of a parameter.
15359 * typemanager.cs (TypeManager.IsValueType): New public method.
15361 2002-07-29 Martin Baulig <martin@gnome.org>
15363 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
15364 is a flag which specifies that it's either ref or out.
15365 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15366 the out parameter to `out Parameter.Modifier mod', also set the
15367 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15369 * support.cs (InternalParameters.ParameterModifier): Distinguish
15370 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15371 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15373 * expression.cs (Argument.GetParameterModifier): Distinguish
15374 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15375 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15377 2002-07-29 Martin Baulig <martin@gnome.org>
15379 * expression.cs (ParameterReference.ParameterReference): Added
15380 `Location loc' argument to the constructor.
15382 * cs-parser.jay: Pass location to ParameterReference.
15384 2002-07-28 Miguel de Icaza <miguel@ximian.com>
15386 * statement.cs (Try): Initialize the location.
15388 * cs-parser.jay: pass location to Try.
15390 * expression.cs (Unary.Reduce): Change the prototype to return
15391 whether a constant fold could be performed or not. The result is
15392 returned in an out parameters. In the case of Indirection and
15393 AddressOf, we want to perform the full tests.
15395 2002-07-26 Miguel de Icaza <miguel@ximian.com>
15397 * statement.cs (Statement.Emit): Flag dead code.
15399 2002-07-27 Andrew Birkett <andy@nobugs.org>
15401 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15403 2002-07-27 Martin Baulig <martin@gnome.org>
15405 * class.cs (MethodData.Define): Put back call to
15406 TypeManager.AddMethod(), accidentally commented this out.
15408 * report.cs (Debug): New public method to print debugging information,
15409 this is `[Conditional ("DEBUG")]'.
15411 2002-07-26 Martin Baulig <martin@gnome.org>
15413 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15414 (switch_statement): Push the current_block to the switch_stack and
15415 pop it again when we're done with the switch.
15416 (switch_section): The new block is a child of the current_block.
15417 Fixes bug #24007, added test-152.cs.
15419 2002-07-27 Martin Baulig <martin@gnome.org>
15421 * expression.cs (Invocation.EmitArguments): When calling a varargs
15422 function with only its fixed arguments, we need to pass an empty
15425 2002-07-27 Martin Baulig <martin@gnome.org>
15427 Mono 0.13 has been released.
15429 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15431 * driver.cs: Rename --resource to --linkres, because that is what
15432 we do currently, we dont support --resource yet.
15434 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15436 2002-07-25 Martin Baulig <martin@gnome.org>
15438 * class.cs (MethodData): New public class. This is a `method builder'
15439 class for a method or one accessor of a Property/Indexer/Event.
15440 (MethodData.GetMethodFlags): Moved here from MemberBase.
15441 (MethodData.ApplyAttributes): Likewise.
15442 (MethodData.ApplyObsoleteAttribute): Likewise.
15443 (MethodData.ApplyConditionalAttribute): Likewise.
15444 (MethodData.ApplyDllImportAttribute): Likewise.
15445 (MethodData.CheckAbstractAndExternal): Likewise.
15446 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15447 (MethodData.Emit): Formerly known as Method.Emit().
15448 (MemberBase): Moved everything which was specific to a single
15449 accessor/method to MethodData.
15450 (Method): Create a new MethodData and call Define() and Emit() on it.
15451 (Property, Indexer, Event): Create a new MethodData objects for each
15452 accessor and call Define() and Emit() on them.
15454 2002-07-25 Martin Baulig <martin@gnome.org>
15456 Made MethodCore derive from MemberBase to reuse the code from there.
15457 MemberBase now also checks for attributes.
15459 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15460 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15462 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15463 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15464 (MemberBase.ApplyAttributes): New virtual method; applies the
15465 attributes to a method or accessor.
15466 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15467 (MemberBase.ApplyConditionalAttribute): Likewise.
15468 (MemberBase.ApplyDllImportAttribute): Likewise.
15469 (MemberBase.CheckAbstractAndExternal): Likewise.
15470 (MethodCore.ParameterTypes): This is now a property instead of a
15471 method, it's initialized from DoDefineParameters().
15472 (MethodCore.ParameterInfo): Removed the set accessor.
15473 (MethodCore.DoDefineParameters): New protected virtual method to
15474 initialize ParameterTypes and ParameterInfo.
15475 (Method.GetReturnType): We can now simply return the MemberType.
15476 (Method.GetMethodFlags): Override the MemberBase version and add
15477 the conditional flags.
15478 (Method.CheckBase): Moved some code from Define() here, call
15479 DoDefineParameters() here.
15480 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15481 here to avoid some larger code duplication.
15482 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15483 ensure that abstract and external accessors don't declare a body.
15485 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15486 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15487 lookup in the attribute's parent classes, so we need to abort as soon
15488 as we found the first match.
15489 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15490 the attribute has no arguments.
15492 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15495 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15497 * cs-parser.jay: reverted previous patch.
15499 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15501 * cs-parser.jay: fixed bug #22119.
15503 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15505 * attribute.cs: fixed compilation. The error was:
15506 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
15507 be assigned to before control leaves the current method."
15508 [FIXME: Filed as bug #28186: MCS must report this error.]
15510 2002-07-25 Martin Baulig <martin@gnome.org>
15512 * attribute.cs (Attribute.Conditional_GetConditionName): New static
15513 method to pull the condition name ouf of a Conditional attribute.
15514 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15515 the obsolete message and error flag out of an Obsolete attribute.
15517 * class.cs (Method.GetMethodFlags): New public method to get the
15518 TypeManager.MethodFlags for this method.
15519 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15521 (Method.Define): Get and apply the Obsolete and Conditional attributes;
15522 if we're overriding a virtual function, set the new private variable
15523 `parent_method'; call the new TypeManager.AddMethod().
15525 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
15526 the MethodBuilder and the Method in a PtrHashtable.
15527 (TypeManager.builder_to_method): Added for this purpose.
15528 (TypeManager.MethodFlags): Added IsObsoleteError.
15529 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
15530 Obsolete and Conditional arguments in MethodBuilders. If we discover
15531 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15532 the message from the attribute.
15534 2002-07-24 Martin Baulig <martin@gnome.org>
15536 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15537 preprocessor directives, ensure that the argument to #define/#undef is
15538 exactly one identifier and that it's actually an identifier.
15540 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15543 2002-07-24 Martin Baulig <martin@gnome.org>
15545 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15546 initialize it to TypeManager.object_type in the constructor.
15547 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15548 of the `hm.get_current' method if we're using the collection pattern.
15549 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15550 for the explicit conversion to make it work when we're using the collection
15551 pattern and the `Current' property has a different return type than `object'.
15554 2002-07-24 Martin Baulig <martin@gnome.org>
15556 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15557 does not match, but don't report any errors. This method is called in
15558 order for all methods in a MethodGroupExpr until a matching method is
15559 found, so we don't want to bail out if the first method doesn't match.
15560 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15561 matches, report the 123. Fixes #28070.
15563 2002-07-24 Martin Baulig <martin@gnome.org>
15565 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15566 TypeManager.TypeToCoreType() to the top of the method so the
15567 following equality checks will work. Fixes #28107.
15569 2002-07-24 Martin Baulig <martin@gnome.org>
15571 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15572 operand is of type uint, and the other operand is of type sbyte,
15573 short or int, the operands are converted to type long." -
15574 Actually do what this comment already told us. Fixes bug #28106,
15577 2002-07-24 Martin Baulig <martin@gnome.org>
15579 * class.cs (MethodBase): New abstract class. This is now a base
15580 class for Property, Indexer and Event to avoid some code duplication
15581 in their Define() and DefineMethods() methods.
15582 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15583 generic methods for Define() and DefineMethods().
15584 (FieldBase): Derive from MemberBase, not MemberCore.
15585 (Property): Derive from MemberBase, not MemberCore.
15586 (Property.DefineMethod): Moved all the code from this method to the
15587 new MethodBase.DefineAccessor(), just call it with appropriate
15589 (Property.Define): Call the new Property.DoDefine(), this does some
15590 sanity checks and we don't need to duplicate the code everywhere.
15591 (Event): Derive from MemberBase, not MemberCore.
15592 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15593 accessors, this will also make them work with interface events.
15594 (Indexer): Derive from MemberBase, not MemberCore.
15595 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15596 (Indexer.Define): Use the new MethodBase functions.
15598 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15599 argument to the constructor.
15600 (Interface.FindMembers): Added support for interface events.
15601 (Interface.PopluateEvent): Implemented.
15603 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
15605 2002-07-22 Miguel de Icaza <miguel@ximian.com>
15607 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15608 but this is required to check for a method name being the same as
15609 the containing class.
15613 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15615 * interface.cs: initialize variable.
15617 2002-07-23 Martin Baulig <martin@gnome.org>
15619 Implemented the IndexerName attribute in interfaces.
15621 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15622 name if this is an explicit interface implementation.
15623 (Indexer.InterfaceIndexerName): New public variable. If we're
15624 implementing an interface indexer, this is the IndexerName in that
15625 interface. Otherwise, it's the IndexerName.
15626 (Indexer.DefineMethod): If we're implementing interface indexer,
15627 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
15628 and Pending.ImplementIndexer methods.
15629 (Indexer.Define): Also define the PropertyBuilder if we're
15630 implementing an interface indexer and this is neither an explicit
15631 interface implementation nor do the IndexerName match the one in
15634 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15635 If a method is defined here, then we always need to create a proxy
15636 for it. This is used when implementing interface indexers.
15637 (Pending.IsInterfaceIndexer): New public method.
15638 (Pending.ImplementIndexer): New public method.
15639 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15640 This is used when implementing interface indexers to define a proxy
15642 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15643 define a proxy if necessary.
15645 * interface.cs (Interface.IndexerName): New public variable.
15646 (Interface.PopulateIndexer): Set the IndexerName.
15647 (Interface.DefineIndexers): New private method. Populate all the
15648 indexers and make sure their IndexerNames match.
15650 * typemanager.cs (IndexerPropertyName): Added support for interface
15653 2002-07-22 Martin Baulig <martin@gnome.org>
15655 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15656 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15657 ret if HasReturnLabel.
15658 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15661 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15662 and set the ec.LoopBeginTryCatchLevel.
15663 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15664 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15665 the current ec.TryCatchLevel, the branch goes out of an exception
15666 block. In this case, we need to use Leave and not Br.
15668 2002-07-22 Martin Baulig <martin@gnome.org>
15670 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15671 block unless the block does not always return or it is contained in
15672 another try { ... } catch { ... } block. Fixes bug #26506.
15673 Added verify-1.cs to the test suite.
15675 2002-07-22 Martin Baulig <martin@gnome.org>
15677 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15678 then we do not always return. Fixes bug #24985.
15680 2002-07-22 Martin Baulig <martin@gnome.org>
15682 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15683 lookup on a per-class level; ie. walk up the class hierarchy until we
15684 found at least one applicable method, then choose the best among them.
15685 Fixes bug #24463 and test-29.cs.
15687 2002-07-22 Martin Baulig <martin@gnome.org>
15689 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15690 return types of the methods. The return type is not part of the
15691 signature and we must not check it to make the `new' modifier work.
15692 Fixes bug #27999, also added test-147.cs.
15693 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15695 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15696 on the method's return type.
15698 2002-07-21 Martin Baulig <martin@gnome.org>
15700 * assign.cs: Make this work if the rightmost source is a constant and
15701 we need to do an implicit type conversion. Also adding a few more tests
15702 to test-38.cs which should have caught this.
15704 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15705 target in the makefile for this. The makefile.gnu is primarily intended
15706 for end-users who don't want to debug the compiler.
15708 2002-07-21 Martin Baulig <martin@gnome.org>
15710 * assign.cs: Improved the Assign class so it can now handle embedded
15711 assignments (X = Y = Z = something). As a side-effect this'll now also
15712 consume less local variables. test-38.cs now passes with MCS, added
15713 a few new test cases to that test.
15715 2002-07-20 Martin Baulig <martin@gnome.org>
15717 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15718 instructions. Fixes bug #27977, also added test-146.cs.
15720 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15722 * cs-tokenizer.cs: fixed getHex ().
15724 2002-07-19 Martin Baulig <martin@gnome.org>
15726 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15727 not Type.GetType() to lookup the array type. This is needed when
15728 we're constructing an array of a user-defined type.
15729 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15730 single-dimensional arrays, but also for single-dimensial arrays of
15733 2002-07-19 Martin Baulig <martin@gnome.org>
15735 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15736 this function is called, it's not allowed to share LocalBuilders
15737 among ILGenerators.
15739 2002-07-19 Martin Baulig <martin@gnome.org>
15741 * expression.cs (Argument.Resolve): Report an error 118 when trying
15742 to pass a type as argument.
15744 2002-07-18 Martin Baulig <martin@gnome.org>
15746 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15747 Conv_R_Un for the signed `long' type.
15749 2002-07-15 Miguel de Icaza <miguel@ximian.com>
15751 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15752 `expr' for the temporary result, as that will fail if we do
15753 multiple resolves on the same expression.
15755 2002-07-05 Miguel de Icaza <miguel@ximian.com>
15757 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15758 ec.TypeContainer for looking up aliases.
15760 * class.cs (TypeContainer): Remove LookupAlias from here.
15762 * decl.cs (DeclSpace); Move here.
15764 2002-07-01 Miguel de Icaza <miguel@ximian.com>
15766 * class.cs (FindMembers): Only call filter if the constructor
15767 bulider is not null.
15769 Also handle delegates in `NestedTypes' now. Now we will perform
15770 type lookups using the standard resolution process. This also
15773 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15774 This uses Expressions (the limited kind that can be parsed by the
15775 tree) instead of strings.
15777 * expression.cs (ComposedCast.ToString): Implement, used to flag
15778 errors since now we have to render expressions.
15780 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
15783 * ecore.cs (SimpleName.ToString): ditto.
15785 * cs-parser.jay: Instead of using strings to assemble types, use
15786 Expressions to assemble the type (using SimpleName, ComposedCast,
15787 MemberAccess). This should fix the type lookups in declarations,
15788 because we were using a different code path for this.
15790 * statement.cs (Block.Resolve): Continue processing statements
15791 even when there is an error.
15793 2002-07-17 Miguel de Icaza <miguel@ximian.com>
15795 * class.cs (Event.Define): Also remove the `remove' method from
15796 the list of pending items.
15798 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15799 generate more compact code.
15801 2002-07-17 Martin Baulig <martin@gnome.org>
15803 * const.cs (Const.LookupConstantValue): Add support for constant
15804 `unchecked' and `checked' expressions.
15805 Also adding test case test-140.cs for this.
15807 2002-07-17 Martin Baulig <martin@gnome.org>
15809 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15810 check whether mi.ReturnType implements the IEnumerator interface; the
15811 `==' and the IsAssignableFrom() will fail in this situation.
15813 2002-07-16 Ravi Pratap <ravi@ximian.com>
15815 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
15818 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15820 * expression.cs: fixed bug #27811.
15822 2002-07-14 Miguel de Icaza <miguel@ximian.com>
15824 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15825 Molaro: when we are a ref, the value already contains a pointer
15826 value, do not take the address of it.
15828 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15829 * removed mb-parser.jay and mb-tokenizer.cs
15831 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15833 * expression.cs: check against the building corlib void type.
15835 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15837 * ecore.cs: fix for valuetype static readonly fields: when
15838 initializing them, we need their address, not the address of a copy.
15840 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15842 * typemanager.cs: register also enum_type in corlib.
15844 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15846 * class.cs: allow calling this (but not base) initializers in structs.
15848 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15850 * ecore.cs: make sure we compare against the building base types
15853 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15855 * typemanager.cs: fix TypeToCoreType() to handle void and object
15856 (corlib gets no more typerefs after this change).
15858 2002-07-12 Miguel de Icaza <miguel@ximian.com>
15860 * expression.cs (ArrayCreation.EmitArrayArguments): use
15861 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15863 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15864 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
15865 array indexes, the runtime actually forbids them.
15867 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15868 for array arguments here.
15870 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15871 instead of the default for ValueTypes.
15873 (New.DoEmit): Use IsValueType instead of
15874 IsSubclassOf (value_type)
15875 (New.DoResolve): ditto.
15876 (Invocation.EmitCall): ditto.
15878 * assign.cs (Assign): ditto.
15880 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15881 Statements *are* currently doing part of their resolution during
15884 Expressions do always resolve during resolve, but statements are
15885 only required to propagate resolution to their children.
15887 2002-07-11 Miguel de Icaza <miguel@ximian.com>
15889 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15891 (LoadAssembly): Do not add the dll if it is already specified
15893 (MainDriver): Add the System directory to the link path at the end,
15894 after all the other -L arguments.
15896 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15897 wrong opcode for loading bytes and bools (ldelem.i1 instead of
15898 ldelem.u1) and using the opposite for sbytes.
15900 This fixes Digger, and we can finally run it.
15902 * driver.cs (UnixParseOption): Move the option parsing here.
15903 (CSCParseOption): Implement CSC-like parsing of options.
15905 We now support both modes of operation, the old Unix way, and the
15906 new CSC-like way. This should help those who wanted to make cross
15907 platform makefiles.
15909 The only thing broken is that /r:, /reference: and /lib: are not
15910 implemented, because I want to make those have the same semantics
15911 as the CSC compiler has, and kill once and for all the confussion
15912 around this. Will be doing this tomorrow.
15914 * statement.cs (Unsafe.Resolve): The state is checked during
15915 resolve, not emit, so we have to set the flags for IsUnsfe here.
15917 2002-07-10 Miguel de Icaza <miguel@ximian.com>
15919 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15920 not catch the Error_ObjectRefRequired in SimpleName (as it is
15921 possible to have a class/instance variable name that later gets
15922 deambiguated), we have to check this here.
15924 2002-07-10 Ravi Pratap <ravi@ximian.com>
15926 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15927 make static and put into Expression.
15929 (Event.Define): Register the private field of the event with the
15930 TypeManager so that GetFieldFromEvent can get at it.
15932 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15933 keep track of the private field associated with an event which
15936 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15939 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15941 2002-07-10 Miguel de Icaza <miguel@ximian.com>
15943 * expression.cs (Binary.EmitBranchable): this routine emits the
15944 Binary expression in a branchable context. This basically means:
15945 we need to branch somewhere, not just get the value on the stack.
15947 This works together with Statement.EmitBoolExpression.
15949 * statement.cs (Statement.EmitBoolExpression): Use
15952 2002-07-09 Miguel de Icaza <miguel@ximian.com>
15954 * statement.cs (For): Reduce the number of jumps in loops.
15956 (For): Implement loop inversion for the For statement.
15958 (Break): We can be breaking out of a Try/Catch controlled section
15959 (foreach might have an implicit try/catch clause), so we need to
15960 use Leave instead of Br.
15962 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15963 now). If the instace expression supports IMemoryLocation, we use
15964 the AddressOf method from the IMemoryLocation to extract the
15965 address instead of emitting the instance.
15967 This showed up with `This', as we were emitting the instance
15968 always (Emit) instead of the Address of This. Particularly
15969 interesting when This is a value type, as we dont want the Emit
15970 effect (which was to load the object).
15972 2002-07-08 Miguel de Icaza <miguel@ximian.com>
15974 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15976 * statement.cs (Checked): Set the CheckedState during the resolve
15977 process too, as the ConvCast operations track the checked state on
15978 the resolve process, and not emit.
15980 * cs-parser.jay (namespace_member_declaration): Flag that we have
15981 found a declaration when we do. This is used to flag error 1529
15983 * driver.cs: Report ok when we display the help only.
15985 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
15987 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15989 2002-07-04 Miguel de Icaza <miguel@ximian.com>
15991 * cs-tokenizer.cs (define): We also have to track locally the
15992 defines. AllDefines is just used for the Conditional Attribute,
15993 but we also need the local defines for the current source code.
15995 2002-07-03 Miguel de Icaza <miguel@ximian.com>
15997 * statement.cs (While, For, Do): These loops can exit through a
15998 Break statement, use this information to tell whether the
15999 statement is the last piece of code.
16001 (Break): Flag that we break.
16003 * codegen.cs (EmitContexts): New `Breaks' state variable.
16005 2002-07-03 Martin Baulig <martin@gnome.org>
16007 * class.cs (TypeContainer.MethodModifiersValid): Allow override
16008 modifiers in method declarations in structs. Otherwise, you won't
16009 be able to override things like Object.Equals().
16011 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16013 * class.cs (Method, Property, Indexer): Do not allow the public
16014 modifier to be used in explicit interface implementations.
16016 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16017 override modifiers in method declarations in structs
16019 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16021 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16022 integer or real overflow, report an error
16024 2002-07-02 Martin Baulig <martin@gnome.org>
16026 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16027 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16028 to tell the runtime about our newly created System.Object and
16029 System.ValueType types.
16031 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16033 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16034 struct instead of Ldarg/Starg.
16036 2002-07-02 Martin Baulig <martin@gnome.org>
16038 * expression.cs (Indirection.Indirection): Call
16039 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16041 2002-07-02 Martin Baulig <martin@gnome.org>
16043 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16044 ValueType, call TypeManager.TypeToCoreType() on it.
16045 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16046 the OpCodes.Newarr argument.
16048 2002-07-02 Martin Baulig <martin@gnome.org>
16050 * expression.cs (Invocation.EmitCall): When compiling corlib,
16051 replace all calls to the system's System.Array type to calls to
16052 the newly created one.
16054 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16055 System.Array methods.
16056 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16057 from the system's System.Array type which must be replaced.
16059 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16061 * typemanager.cs: load unverifiable_code_ctor so we can build
16062 corlib using the correct type. Avoid using GetTypeCode() with
16064 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16065 TypeManager.object_type to allow building corlib.
16067 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16069 * ecore.cs: handle System.Enum separately in LoadFromPtr().
16071 2002-07-01 Martin Baulig <martin@gnome.org>
16073 * class.cs: Make the last change actually work, we need to check
16074 whether `ifaces != null' to avoid a crash.
16076 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16078 * class.cs: when we build structs without fields that implement
16079 interfaces, we need to add the interfaces separately, since there is
16080 no API to both set the size and add the interfaces at type creation
16083 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16085 * expression.cs: the dimension arguments to the array constructors
16086 need to be converted if they are a long.
16088 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16090 * class.cs: don't emit ldarg.0 if there is no parent constructor
16091 (fixes showstopper for corlib).
16093 2002-06-29 Martin Baulig <martin@gnome.org>
16095 MCS now compiles corlib on GNU/Linux :-)
16097 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16098 ie. check for MethodImplOptions.InternalCall.
16100 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16101 and TypeManager.attribute_type are null, so we must explicitly check
16102 whether parent is not null to find out whether it's an attribute type.
16103 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16104 and SetBuilder, not only if the property is neither abstract nor external.
16105 This is necessary to set the MethodImplOptions on the accessor methods.
16106 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16107 SetBuilder, see Property.Emit().
16109 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16110 populate "System.Object", "System.ValueType" and "System.Attribute" since
16111 they've already been populated from BootCorlib_PopulateCoreTypes().
16113 2002-06-29 Martin Baulig <martin@gnome.org>
16115 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16116 is the NullLiteral, we also need to make sure that target_type is not
16119 2002-06-29 Martin Baulig <martin@gnome.org>
16121 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16122 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16123 before calling BootstrapCorlib_ResolveDelegate ().
16125 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16127 * statement.cs: fixed build-breaker. All tests passed ok.
16129 2002-06-27 Martin Baulig <martin@gnome.org>
16131 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16132 for System.Decimal when compiling corlib.
16134 2002-06-27 Martin Baulig <martin@gnome.org>
16136 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16137 switch blocks which contain nothing but a default clause.
16139 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16141 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16143 2002-06-27 Martin Baulig <martin@gnome.org>
16145 * ecore.cs (PropertyExpr.PropertyExpr): Call
16146 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16148 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16149 is already a TypeBuilder.
16151 2002-06-27 Martin Baulig <martin@gnome.org>
16153 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16154 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16155 the "from an array-type to System.Array" case. This makes it work
16156 when compiling corlib.
16158 2002-06-27 Martin Baulig <martin@gnome.org>
16160 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16161 non-static PropertyExpr, set its InstanceExpression. This makes
16162 the `ICollection.Count' property work in System/Array.cs.
16164 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16166 * driver.cs: Made error handling more consistent. Errors now
16167 tracked by Report class, so many methods which used to return int
16168 now return void. Main() now prints success/failure and
16169 errors/warnings message.
16171 Renamed '--probe' compiler argument to '--expect-error'. Removed
16172 the magic number return values (123 and 124). Now, if the
16173 expected error occurs, the compiler exits with success (exit value
16174 0). If the compilation completes without seeing that particular
16175 error, the compiler exits with failure (exit value 1). The
16176 makefile in mcs/errors has been changed to handle the new behaviour.
16178 * report.cs: Made 'expected error' number a property and renamed
16179 it from 'Probe' to 'ExpectedError'.
16181 * genericparser.cs: Removed error handling support, since it is
16182 now all done by Report class.
16184 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16185 class, so parse() no longer returns an int.
16187 * namespace.cs: Use Report.Error instead of GenericParser.error
16189 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16191 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16192 TypeContainer.AddOperator): At the front of the list put the
16193 explicit implementations, so they get resolved/defined first.
16195 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16197 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16198 interface type is implemented by this TypeContainer. Used during
16199 explicit interface implementation.
16201 (Property.Define, Indexer.Define, Method.Define): Validate that
16202 the given interface in the explicit implementation is one of the
16203 base classes for the containing type.
16205 Also if we are explicitly implementing an interface, but there is
16206 no match in the pending implementation table, report an error.
16208 (Property.Define): Only define the property if we are
16209 not explicitly implementing a property from an interface. Use the
16210 correct name also for those properties (the same CSC uses,
16211 although that is really not needed).
16213 (Property.Emit): Do not emit attributes for explicitly implemented
16214 properties, as there is no TypeBuilder.
16216 (Indexer.Emit): ditto.
16218 Hiding then means that we do not really *implement* a pending
16219 implementation, which makes code fail.
16221 2002-06-22 Martin Baulig <martin@gnome.org>
16223 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16224 the return value of Object.GetType(). [FIXME: we need to do this whenever
16225 we get a type back from the reflection library].
16227 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16229 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16231 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16233 * attribute.cs: Return null if we can not look up the type.
16235 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16236 the interface types found.
16238 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16239 interface types found.
16241 * typemanager.cs (GetInterfaces): Make this routine returns alll
16242 the interfaces and work around the lame differences between
16243 System.Type and System.Reflection.Emit.TypeBuilder in the results
16244 result for GetInterfaces.
16246 (ExpandInterfaces): Given an array of interface types, expand and
16247 eliminate repeated ocurrences of an interface. This expands in
16248 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16251 2002-06-21 Martin Baulig <martin@gnome.org>
16253 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16256 2002-06-21 Martin Baulig <martin@gnome.org>
16258 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16259 and called with one of the core types, return the corresponding typebuilder for
16262 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16265 2002-06-21 Martin Baulig <martin@gnome.org>
16267 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16268 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16269 (Expression.ConvertReferenceExplicit): Likewise.
16271 * expression.cs (ElementAccess.DoResolve): Likewise.
16272 (ElementAccess.DoResolveLValue): Likewise.
16274 2002-06-10 Martin Baulig <martin@gnome.org>
16276 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16277 add the "value" parameter to the parameter list.
16279 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16282 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16284 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16285 the argument to an int, uint, long or ulong, per the spec. Also
16286 catch negative constants in array creation.
16288 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16290 * class.cs: do not allow the same interface to appear twice in
16291 the definition list.
16293 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16295 * ecore.cs: don't use ldlen with System.Array.
16297 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16299 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16301 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16303 * modifiers.cs: produce correct field attributes for protected
16304 internal. Easy fix so miguel can work on ther harder stuff:-)
16306 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16308 * pending.cs: New file. Move the code from class.cs here.
16309 Support clearning the pending flag for all methods (when not doing
16310 explicit interface implementation).
16312 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16314 * rootcontext.cs: added a couple more types needed to bootstrap.
16316 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16318 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16319 constructor in the type, instead of any constructor in the type
16320 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16321 a bug in the Mono runtime when applying the params attribute).
16323 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16324 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16326 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16328 * expression.cs (Unary.ResolveOperator): Use TypeManager
16329 to resolve the type.
16331 2002-06-13 Ravi Pratap <ravi@ximian.com>
16333 * cs-parser.jay (enum_member_declaration): Pass in the attributes
16336 * enum.cs (AddEnumMember): Add support to store the attributes associated
16337 with each member too.
16339 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16340 field builders too - this takes care of the enum member case.
16342 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
16344 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16345 address-of operator on both value types and pointers.
16347 2002-06-10 Martin Baulig <martin@gnome.org>
16349 * interface.cs (Interface.PopulateIndexer): Add the indexer's
16350 PropertyBuilder to the `property_builders' list.
16352 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16353 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16354 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
16355 find any indexers which are inherited from an interface.
16357 2002-06-09 Martin Baulig <martin@gnome.org>
16359 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16360 the same type as the constant if necessary. There's also a test-130.cs
16363 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16365 * typemanager.cs (TypeManager.ChangeType): Previously known as
16366 Enum.ChangeEnumType().
16368 2002-06-09 Martin Baulig <martin@gnome.org>
16370 * expression.cs (Cast.TryReduce): Added support for consts.
16372 2002-06-08 Ravi Pratap <ravi@ximian.com>
16374 * class.cs (Accessor): Hold attributes information so we can pass
16377 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16378 Modify to pass in attributes attached to the methods.
16380 (add_accessor_declaration, remove_accessor_declaration): Ditto.
16382 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16383 to handle the Accessor kind :-)
16385 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16387 2002-06-08 Martin Baulig <martin@gnome.org>
16389 * expression.cs (Unary.TryReduceNegative): Added support for
16392 2002-06-08 Martin Baulig <martin@gnome.org>
16394 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16395 name can't be found in the `defined_names' - the caller will do a
16396 MemberLookup in this case and thus find methods in System.Enum
16397 such as Enum.IsDefined().
16399 2002-06-08 Martin Baulig <martin@gnome.org>
16401 * enum.cs (Enum.ChangeEnumType): This is a custom version of
16402 Convert.ChangeType() which works with TypeBuilder created types.
16403 (Enum.LookupEnumValue, Enum.Define): Use it here.
16405 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16406 `TypeBuilder.BaseType != null' check.
16407 (TypeContainer.FindMembers): Only lookup parent members if we
16408 actually have a parent.
16409 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16410 (ConstructorInitializer.Resolve): Likewise.
16412 * interface.cs (Interface.FindMembers): Added
16413 `TypeBuilder.BaseType != null' check.
16415 * rootcontext.cs (RootContext.ResolveCore): Added
16416 "System.Runtime.CompilerServices.IndexerNameAttribute" to
16417 classes_second_stage.
16419 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16420 debug_type and trace_type when compiling with --nostdlib.
16422 2002-06-07 Martin Baulig <martin@gnome.org>
16424 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16425 (AddField): Set it to true when adding a non-static field.
16426 (DefineType): Use `have_nonstatic_fields' to find out whether we
16427 have non-static fields, not `Fields != null'.
16429 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16431 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16432 dereferencing a null on the static-field code path)
16434 2002-05-30 Martin Baulig <martin@gnome.org>
16436 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16437 to take command line arguments. Use reflection to call the new
16438 custom `Initialize' function on the symbol writer and pass it the
16439 command line arguments.
16441 * driver.cs (--debug-args): New command line argument to pass command
16442 line arguments to the symbol writer.
16444 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16446 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16447 the target type for indexers and properties. Thanks to Joe for
16450 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16452 * typemanager.cs (MethodFlags): returns the method flags
16453 (Obsolete/ShouldIgnore) that control warning emission and whether
16454 the invocation should be made, or ignored.
16456 * expression.cs (Invocation.Emit): Remove previous hack, we should
16457 not do this on matching a base type, we should do this based on an attribute
16459 Only emit calls to System.Diagnostics.Debug and
16460 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16461 on the command line.
16463 * rootcontext.cs: Global settings for tracing and debugging.
16465 * cs-tokenizer.cs (define): New utility function to track
16466 defines. Set the global settings for TRACE and DEBUG if found.
16468 2002-05-25 Ravi Pratap <ravi@ximian.com>
16470 * interface.cs (Populate*): Pass in the TypeContainer as well as
16471 the DeclSpace as parameters so that we can create EmitContexts and
16472 then use that to apply attributes etc.
16474 (PopulateMethod, PopulateEvent, PopulateProperty)
16475 (PopulateIndexer): Apply attributes everywhere.
16477 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16480 (ApplyAttributes): Update accordingly.
16482 We now apply interface attributes for all members too.
16484 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16486 * class.cs (Indexer.Define); Correctly check if we are explicit
16487 implementation (instead of checking the Name for a ".", we
16488 directly look up if the InterfaceType was specified).
16490 Delay the creation of the PropertyBuilder.
16492 Only create the PropertyBuilder if we are not an explicit
16493 interface implementation. This means that explicit interface
16494 implementation members do not participate in regular function
16495 lookups, and hence fixes another major ambiguity problem in
16496 overload resolution (that was the visible effect).
16498 (DefineMethod): Return whether we are doing an interface
16501 * typemanager.cs: Temporary hack until we get attributes in
16502 interfaces (Ravi is working on that) and we get IndexerName
16503 support in interfaces.
16505 * interface.cs: Register the indexers as properties.
16507 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16508 warning, I have verified that this is a bug in the .NET runtime
16509 (JavaScript suffers of the same problem).
16511 * typemanager.cs (MemberLookup): When looking up members for
16512 interfaces, the parent of an interface is the implicit
16513 System.Object (so we succeed in searches of Object methods in an
16514 interface method invocation. Example: IEnumerable x; x.ToString
16517 2002-05-25 Miguel de Icaza <miguel@ximian.com>
16519 * class.cs (Event): Events should also register if they do
16520 implement the methods that an interface requires.
16522 * typemanager.cs (MemberLookup); use the new GetInterfaces
16525 (GetInterfaces): The code used to lookup interfaces for a type is
16526 used in more than one place, factor it here.
16528 * driver.cs: Track the errors at the bottom of the file, we kept
16531 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16532 instance if the method we are calling is static!
16534 2002-05-24 Miguel de Icaza <miguel@ximian.com>
16536 * attribute.cs (ApplyAttributes): Make this function filter out
16537 the IndexerName attribute (as that attribute in reality is never
16538 applied) and return the string constant for the IndexerName
16541 * class.cs (TypeContainer.Emit): Validate that all the indexers
16542 have the same IndexerName attribute, and if so, set the
16543 DefaultName attribute on the class.
16545 * typemanager.cs: The return value might contain other stuff (not
16546 only methods). For instance, consider a method with an "Item"
16547 property and an Item method.
16549 * class.cs: If there is a problem with the parameter types,
16552 2002-05-24 Ravi Pratap <ravi@ximian.com>
16554 * ecore.cs (ImplicitConversionExists): Wrapper function which also
16555 looks at user defined conversion after making a call to
16556 StandardConversionExists - we need this for overload resolution.
16558 * expression.cs : Update accordingly the various method calls.
16560 This fixes 2 bugs filed against implicit user defined conversions
16562 2002-05-22 Miguel de Icaza <miguel@ximian.com>
16564 * statement.cs: Track the result of the assignment.
16566 2002-05-21 Miguel de Icaza <miguel@ximian.com>
16568 * expression.cs (MemberAccess): Improved error reporting for
16569 inaccessible members.
16571 2002-05-22 Martin Baulig <martin@gnome.org>
16573 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
16574 itself with debugging support.
16576 2002-05-22 Martin Baulig <martin@gnome.org>
16578 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16579 Removed, this isn't needed anymore.
16581 2002-05-20 Martin Baulig <martin@gnome.org>
16583 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16584 be underlying type for an enum.
16586 2002-05-20 Miguel de Icaza <miguel@ximian.com>
16588 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16589 that splits out the loading of just the core types.
16591 * rootcontext.cs (ResolveCore): Split the struct resolution in
16592 two, so we can load the enumeration underlying types before any
16595 * expression.cs (Is): Bandaid until we fix properly Switch (see
16596 bug #24985 for details).
16598 * typemanager.cs (ImplementsInterface): The hashtable will contain
16599 a null if there are no interfaces implemented.
16601 2002-05-18 Miguel de Icaza <miguel@ximian.com>
16603 * cs-parser.jay (indexer_declarator): It is fine to have array
16606 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16608 * typemanager.cs: (RegisterBuilder): New function used to register
16609 TypeBuilders that implement interfaces. Since
16610 TypeBuilder.GetInterfaces (as usual) does not work with lame
16612 (AddUserType): register interfaces.
16614 (ImplementsInterface): Use the builder_to_ifaces hash if we are
16615 dealing with TypeBuilder. Also, arrays are showing up as
16616 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16617 methods can not be invoked on them!
16619 * ecore.cs (ExplicitReferenceConversionExists): Made public.
16620 (ImplicitReferenceConversionExists): Split out from
16621 StandardConversionExists.
16623 * expression.cs (As): We were only implementing one of the three
16624 cases for the as operator. We now implement them all.
16625 (Is): Implement the various other cases for Is as well.
16627 * typemanager.cs (CACHE): New define used to control if we want or
16628 not the FindMembers cache. Seems to have a negative impact on
16629 performance currently
16631 (MemberLookup): Nested types have full acess to
16632 enclosing type members
16634 Remove code that coped with instance/static returns for events, we
16635 now catch this in RealFindMembers.
16637 (RealFindMembers): only perform static lookup if the instance
16638 lookup did not return a type or an event.
16640 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16642 * assign.cs (CompoundAssign): We pass more semantic information
16643 now to Compound Assignments than we did before: now we have all
16644 the information at hand, and now we resolve the target *before* we
16645 do the expression expansion, which allows the "CacheValue" method
16646 to have the effect we intended (before, a [x] += 1 would generate
16647 two differen ArrayAccess expressions from the ElementAccess,
16648 during the resolution process).
16650 (CompoundAssign.DoResolve): Resolve target and original_source here.
16652 2002-05-16 Miguel de Icaza <miguel@ximian.com>
16654 * expression.cs (ArrayAccess): dropped debugging information.
16656 * typemanager.cs: Small bug fix: I was always returning i_members,
16657 instead of one of i_members or s_members (depending on which had
16660 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
16661 method is invoked before any code generation takes place, and it
16662 is a mechanism to inform that the expression will be invoked more
16663 than once, and that the method should use temporary values to
16664 avoid having side effects
16666 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16668 * ecore.cs (Expression.CacheTemporaries): Provide empty default
16671 * expression.cs (Indirection, ArrayAccess): Add support for
16672 CacheTemporaries in these two bad boys.
16674 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16675 ldobj or ldind_ref.
16676 (StoreFromPtr): Handle stobj as well.
16678 * expression.cs (UnaryMutator): Share more code.
16680 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16681 down: I was not tracking the Filter function as well, which
16682 was affecting the results of the cache.
16684 2002-05-15 Miguel de Icaza <miguel@ximian.com>
16686 * attribute.cs: Remove the hack to handle the CharSet property on
16689 2002-05-14 Miguel de Icaza <miguel@ximian.com>
16691 * attribute.cs (DoResolve): More uglyness, we now only try to
16692 resolve the attribute partially, to extract the CharSet
16693 information (only if we are a StructLayout attribute). Otherwise
16695 (GetExtraTypeInfo): Add some code to conditionally kill in the
16696 future this. I am more and more convinced that the .NET
16697 framework has special code to handle the attribute setting on
16700 * expression.cs (IsParamsMethodApplicable): Revert my previous
16701 foreach change here, it was wrong.
16703 2002-05-13 Miguel de Icaza <miguel@ximian.com>
16705 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16706 (pp_expr): do not abort on unknown input, just return.
16707 (eval): abort if there are pending chars.
16709 * attribute.cs (Attribute.Resolve): Positional parameters are
16710 optional. Deal with that case.
16712 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16713 the Ansi/Unicode/Auto information for the type.
16715 (TypeContainer.DefineType): instantiate the EmitContext here, as
16716 we will be using it during the type definition (to resolve
16717 attributes) and during the emit phase.
16719 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16720 to pull type information out of the attributes
16722 (Attribute.Resolve): track the constructor builder, and allow for
16723 multiple invocations (structs and classes will use this).
16725 * ecore.cs (MemberLookupFinal): new version with all the
16726 parameters customizable.
16728 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16729 constructors. Return if the result value is null (as the error
16730 would have been flagged already by MemberLookupFinal)
16732 Do not allow instances of abstract classes or interfaces to be
16735 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16736 We have to compare the assembly property here when dealing with
16737 FamANDAssem and Assembly access modifiers, because we might be
16738 creating an assembly from *modules* (that means that we are not
16739 getting TypeBuilders for types defined in other modules that are
16740 part of this assembly).
16742 (Method.Emit): If the method is marked abstract and has a body,
16745 (TypeContainer.DefineMembers): If both the defined member and the
16746 parent name match are methods, then do not emit any warnings: let
16747 the Method.Define routine take care of flagging warnings. But if
16748 there is a mismatch (method overrides something else, or method is
16749 overriwritten by something, then emit warning).
16751 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16752 set to null, this means `do not check for the return type on the
16755 (Method.Define): set the return type for the method signature to
16756 null, so that we get methods with the same name and parameters and
16757 different return types. This is used to flag warning 114 (you are
16758 hiding a method, and you probably want to use the new/override
16761 * typemanager.cs (MemberLookup): Implemented proper access
16762 control, closing a long standing set of bug reports. The problem
16763 was that the Framework only has two bits: Public and NonPublic,
16764 and NonPublic includes private and protected methods, but we need
16765 to enforce the FamANDAssem, FamOrAssem and Family.
16767 2002-05-11 Miguel de Icaza <miguel@ximian.com>
16769 * statement.cs (GotoCase): Return true: Ammounts to giving up
16770 knowledge on whether we return or not, and letting the other case
16771 be responsible for it.
16773 2002-05-10 Miguel de Icaza <miguel@ximian.com>
16775 * driver.cs: Do not load directories for each file processed, only
16776 do it if there is a pattern.
16778 * ecore.cs: Report readonly assigns here as well, as we might have
16779 been resolved only by MemberAccess.
16781 (SimpleName.SimpleNameResolve): Also be useful for LValue
16782 resolution. We need this to propagate assign to local readonly variables
16784 * typemanager.cs: Use a ptrhashtable for the criteria, because we
16785 do not want to reuse potential criteria memory.
16787 * class.cs (MyEventBuilder): Set reflected_type;
16789 * ecore.cs (Constantify): Added support for constifying bools.
16791 (RootContext.LookupType): Added a cache for values looked up in
16792 the declaration space.
16794 * typemanager.cs (FindMembers): Now is a front-end to
16795 RealFindMembers, and provides a two-level hashtable-based cache to
16798 15% performance improvement: from 22.5 to 19.2 seconds.
16800 * expression.cs (IsParamsMethodApplicable): use foreach.
16801 (Invocation.DoResolve): ditto.
16802 (New.DoResolve): ditto.
16803 (ArrayCreation.DoResolve): ditto.
16805 * ecore.cs (FindMostEncompassingType): use foreach.
16807 * delegate.cs (NewDelegate.DoResolve): Use foreach
16809 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16810 (RemoveMethods): use foreach.
16812 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16813 nested foreach statements instead of for, and also break out of
16814 the inner loop once a match is found.
16816 (Invocation.OverloadResolve): Use foreach, simplify the code.
16818 2002-05-08 Miguel de Icaza <miguel@ximian.com>
16820 * cfold.cs (BinaryFold): During an enumeration evaluation context,
16821 we actually unwrap the expression to allow for extra information
16824 * expression.cs: Use Shr_Un on unsigned operations.
16826 2002-05-08 Ravi Pratap <ravi@ximian.com>
16828 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
16829 applicable operators was not being considered correctly. This closes
16830 the bug Miguel reported.
16832 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16834 * attribute.cs: check that the type derives from System.Attribute
16835 and report the correct error in that case (moved the duplicate code to
16836 its own method, too).
16838 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16840 * attribute.cs: lookup attribute type name as the spec says: first the
16841 bare attribute name and then name + "Attribute" (nant compiles with
16842 mcs after this fix).
16844 2002-05-07 Miguel de Icaza <miguel@ximian.com>
16846 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
16847 Because of the way we parse things, we should try to see if a
16848 UIntConstant can fit in an integer.
16850 2002-05-07 Ravi Pratap <ravi@ximian.com>
16852 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16853 when we are in an explicit context.
16855 (ConvertReferenceExplicit): When converting from Iface type S to Class
16856 T make sure the rules are implemented as an OR.
16858 * parameter.cs (ParameterType): Make it a property for now although the
16859 purpose really isn't anything immediate.
16861 * expression.cs (Is*Applicable): Do better checking on the parameter type
16862 of a ref/out parameter. The ones from the system assemblies are already
16863 marked with the correct type so we don't need to do any correction.
16865 * ecore.cs (StandardConversionExists): Conversion from Interface types to
16866 the object type is standard too so include that.
16868 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16870 * ecore.cs (StandardConversionExists): Augment with missing code:
16871 deal with IntConstant, LongConstants and Enumerations.
16873 * assign.cs: Report the error, instead of failing silently
16875 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16876 typecontainer that they are declared, because the
16877 typecontainer/namespace will have the list of using clauses that
16878 need to be applied.
16880 Assembly Attributes were escaping the normal registration
16883 (EmitCode): Apply attributes within an EmitContext that represents
16884 the container they were declared on.
16886 * cs-parser.jay: Track bases for structs. How did I get this wrong?
16888 2002-05-06 Ravi Pratap <ravi@ximian.com>
16890 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16891 Revamp completely - make much cleaner as we now operate only
16894 (FindMostSpecificSource, FindMostSpecificTarget): New methods
16895 to implement the logic detailed in the spec more correctly.
16897 (UserDefinedConversion): Update accordingly.
16899 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16901 * statement.cs: Return flow analysis information up.
16903 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16906 (token): Do not consume an extra character before calling
16909 2002-05-06 Piers Haken <piersh@friskit.com>
16911 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16913 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16915 * class.cs (Constructor.Emit): Set the IsStatic flag in the
16916 EmitContext during the instance constructor initializer
16917 resolution, to stop access to instance variables.
16919 This is mandated by the spec, last paragraph of the `constructor
16920 initializers' section.
16922 2002-05-05 Miguel de Icaza <miguel@ximian.com>
16924 * cs-parser.jay, class.cs (Accessor): new class used to represent
16925 an accessor (get or set). In the past we used `null' to represent
16926 a missing accessor. But this is ambiguous because there was no
16927 way to tell in abstract indexers/properties if one of them was
16930 Now there is a way of addressing that.
16932 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16933 instead of FindMembers.
16935 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16936 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16938 * attribute.cs: Treat indexers and properties as the same in terms
16939 of applying attributes
16941 * ecore.cs (FindMostEncompassedType): Use statically initialized
16942 EmptyExpressions()s like we do elsewhere to avoid creating useless
16943 objects (and we take this out of the tight loop).
16945 (GetConversionOperators): Move the code to extract the actual
16946 operators to a separate routine to clean things up.
16948 2002-05-04 Miguel de Icaza <miguel@ximian.com>
16950 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16951 events are always registered FieldBuilders.
16953 * class.cs (FieldBase): New class shared by Fields
16955 * delegate.cs: If we are a toplevel delegate, use our full name.
16956 If we are a nested delegate, then only use our tail name.
16958 2002-05-02 Ravi Pratap <ravi@ximian.com>
16960 * expression.cs (IsApplicable): Ensure that we add the "&" to
16961 ref/out types before comparing it with the type of the argument.
16963 (IsParamsMethodApplicable): Ditto.
16965 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
16968 * delegate.cs : Handle the case when we have more than one applicable
16969 method. Flag an error only when we finish checking all.
16971 2002-05-02 Miguel de Icaza <miguel@ximian.com>
16973 * expression.cs: Add support for boolean static initializers.
16975 2002-05-01 Miguel de Icaza <miguel@ximian.com>
16977 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16979 * parameter.cs (ComputeParameterTypes,
16980 ComputeAndDefineParameterTypes): Better error handling: now we
16981 clear the `types' cache if we fail during any of the type lookups.
16982 We also return the status code correctly to our caller
16984 * delegate.cs: If we fail to define a delegate, abort the extra
16987 * expression.cs (Binary.ResolveOperator): for
16988 operator==(object,object) and operator !=(object, object) we also
16989 have to verify that there is an implicit conversion from one to
16992 (ArrayAccess.DoResolve): Array Access can operate on
16995 2002-04-30 Miguel de Icaza <miguel@ximian.com>
16997 * assign.cs (CompoundAssign): A new class used as a "flag" that
16998 the assignment actually is happening as part of a compound
16999 assignment operator.
17001 During compound assignment, a few new rules exist to enable things
17008 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17009 to the type of x) if y is implicitly convertible to the type of x,
17010 and the operator is a builtin operator and the return type of the
17011 operator is explicitly convertible to the type of x.
17013 * rootcontext.cs: Reset warning level to 2. 4 catches various
17014 "interesting" features in mcs, we must clean this up at some
17015 point, but currently am trying to kill other bugs ;-)
17017 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17018 in container classes as well.
17020 * expression.cs (Binary.ResolveOperator): Handle string case
17021 before anything else (as operator overloading does emit an error
17022 before doing anything else).
17024 This code could go away when we move to a table driven model, but
17025 i could not come up with a good plan last night.
17027 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17029 * typemanager.cs (CSharpName): reimplementation using regex.
17030 * class.cs: added null check for fields in Emit
17031 * rootcontext.cs: set warninglevel to 4
17033 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17035 * typemanager.cs (CSharpName): reimplemented with Lupus
17038 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17040 * statement.cs (If): correclty implement Resolve, because we were
17041 not catching sem errors in there. The same process is needed
17043 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17046 (Statement.Warning_DeadCodeFound): Factorize code.
17047 (While): Report dead code here too.
17049 (Statement): Added Resolve virtual method to allow
17050 for resolution split from the emit code.
17052 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17054 * statement.cs (EmitBoolExpression): No longer try to resolve the
17056 (MakeBoolean): New utility function that resolve, implicitly
17057 converts to boolean and tags the expression.
17060 (If, Do): Implement dead code elimination.
17061 (While): Implement loop inversion
17063 (Do, While, For, If): Resolve the expression prior to calling our
17066 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
17069 - added method Report28 (warning: program has more than one entry point)
17070 - added method IsEntryPoint, implements paragraph 10.1 of the spec
17071 - modified method Method.Define, the part at the end of the method
17073 * rootcontext.cs: added static public Location EntryPointLocation;
17075 * ../errors/cs0028.cs : Add test case for the above warning.
17078 - modified method CSharpName to allow arrays of primitive type to
17079 be printed nicely (e.g. instead of System.Int32[][] it now prints
17081 - added method CSharpSignature: returns the signature of a method
17082 in string format to be used in reporting errors, warnings, etc.
17084 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17087 2002-04-26 Ravi Pratap <ravi@ximian.com>
17089 * delegate.cs (Define): Fix extremely silly bug where I was
17090 setting the type of the 'object' parameter of the BeginInvoke
17091 method to System.IAsyncResult instead of System.Object ;-)
17093 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17095 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17098 (Constructor.Emit): return if we fail to initialize the
17099 constructor. Another door closed!
17101 * expression.cs (New.DoResolve): Improve error message (from -6 to
17102 1501). Use DeclaredOnly lookup to find the exact constructor.
17104 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17105 loop. This is useful.
17107 * cs-parser.jay: Adjust the default parameters so that destructors
17108 have the proper signature.
17110 2002-04-26 Martin Baulig <martin@gnome.org>
17112 * driver.cs (LoadAssembly): If `assembly' contains any characters
17113 which are only valid in path names and not in assembly names
17114 (currently slash, backslash and point), use Assembly.LoadFrom ()
17115 instead of Assembly.Load () on the `assembly' (before iteration
17116 over the link_paths).
17118 2002-04-26 Martin Baulig <martin@gnome.org>
17120 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17122 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17124 * class.cs (Property): use the new typemanager.MemberLookup
17126 (TypeContainer.MemberLookup): Implement using the
17127 TypeManager.MemberLookup now.
17129 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17130 and return MemberInfos, so that these can be used without an
17131 EmitContext (what we had before).
17133 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17135 * expression.cs: Fix the case where the argument to params if the
17136 type of the params. I omitted handling this before. Fixed
17138 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17140 * driver.cs: Call BootCorlib_PopulateCoreType
17142 * class.cs (Property.CheckBase): Check for properties only, not
17145 * interface.cs: Temporary hack: try/catch around the
17146 CustomAttributeBuilder, because I am getting an exception that I
17149 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17150 types whose definitions are required to be there (attributes are
17151 defined before standard types).
17153 Compute definitions as we boot the various types, as they are used
17154 immediately (value_type class will need object_type, but if we do
17155 not initialize object_type, we will pass a null, which will let
17156 the runtime pick the System.Object from the existing corlib, which
17157 is not what we want).
17159 2002-04-22 Patrik Torstensson <totte@labs2.com>
17161 * cs-tokenizer.cs: fixed a number of trim() issues.
17163 2002-04-22 Ravi Pratap <ravi@ximian.com>
17165 * expression.cs (Argument.Type): Ensure that we return the correct
17166 type when we have out or ref parameters [in which case we
17169 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17171 * class.cs (Property, Indexer): Allow extern modifier in there.
17173 * typemanager.cs (InitBaseTypes): Initializes object_type and
17174 value_type, since those will be used early on during the bootstrap
17175 process to compile corlib.
17177 (InitCoreTypes): Move code from here to InitBaseTypes.
17179 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17181 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17182 single-dimension arrays as using the ldlen opcode.
17184 Daniel Lewis discovered this optimization.
17186 * typemanager.cs: Add signature for System.Array::get_Length
17188 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17190 * statement.cs: report the error when the foreach does not apply to an
17191 array nor a collection.
17193 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17195 * expression.cs: Add implicit conversions to the operator ~.
17197 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17199 * typemanager.cs: Locate the decimal constructor.
17201 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17203 * attribute.cs: use the new property of TypeOf.
17204 * expression.cs: added 'get' property around typearg.
17206 These changes fix a build breaker reported by NickD. Is this the
17207 correct way to fix? If not, please, revert my changes and make it
17210 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17212 * attribute.cs: Add support for typeof in attribute invocations.
17213 I am not sure that this is right though.
17215 2002-04-14 Duncan Mak <duncan@ximian.com>
17217 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17218 Binary.Operator.Division case.
17220 2002-04-13 Ravi Pratap <ravi@ximian.com>
17222 * class.cs (DefineType): Ensure that we do a proper check on
17223 attribute types and also register it with the TypeManager.
17225 (TypeContainer.Targets): The default for attribute types is
17226 AttributeTargets.All.
17228 * attribute.cs (ApplyAttributes): Registering the attribute type
17229 is done elsewhere, not when we discover we have a Usage attribute.
17231 2002-04-12 Ravi Pratap <ravi@ximian.com>
17233 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17234 and get rid of is_delegate parameter.
17236 * everywhere : update.
17238 2002-04-12 Ravi Pratap <ravi@ximian.com>
17240 * cs-parser.jay (compilation_unit): Revamp completely to use
17241 some new ideas that I got from Rhys' grammar to solve the problems
17242 with assembly level attributes.
17244 (outer_declaration): New grammar production.
17246 (attribute_sections): Add.
17248 (opt_attributes): Base on attribute_sections
17250 (namespace_declaration): Allow opt_attributes to tackle the case
17251 when we have assembly level attributes - we are clever in this
17254 * attribute.cs (ApplyAttributes): Do not worry about assembly
17255 attributes in the non-global context.
17257 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17258 instead of SetGlobalAttributes.
17260 * class.cs, rootcontext.cs : Ensure we define and generate
17261 attribute types before anything else.
17263 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17264 and flag the new error -20 for the case when the attribute type
17265 does not have valid targets specified. csc does not catch this.
17267 * ../errors/errors.txt : update for error # -20
17269 2002-04-11 Ravi Pratap <ravi@ximian.com>
17271 * support.cs (InternalParameters.ParameterModifier): Do some null
17272 checking and return sane values.
17274 * class.cs (Method.Define): If we are a PInvoke method, ensure
17275 that we are static and extern. Report error # 601
17277 * ../errors/cs0601.cs : Add test case for the above error.
17279 2002-04-07 Ravi Pratap <ravi@ximian.com>
17281 * rootcontext.cs (attribute_types): We need to keep type of
17282 all attribute types separately and emit code for them first.
17284 (RegisterAttribute) : Implement.
17286 * class.cs (DefineType): Check if the current Type is a custom
17287 attribute type and register it accordingly.
17289 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17290 adding the first attribute twice and rename to
17292 (SetGlobalAttributes): this.
17294 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17297 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17298 if we are processing global arguments. Hmm, I am unsure of this.
17300 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17302 * expression.cs: added static array of strings to avoid calling
17303 Enum.ToString () for Operator in Binary. Significant recover of
17306 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17308 * class.cs (FindMembers): Allow the Builders of the various
17309 members to be null. If they are skip them. This only happens
17310 during the PInvoke declaration.
17312 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17314 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17315 failure, so we do not keep going afterwards.
17317 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17318 wanted to pass `false' as the `is_delegate' argument. If this is
17319 the case, why not use delegate_type == null to mean `is_delegate =
17320 false' and anything else as is_delegate = true.
17322 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17324 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17325 code for the section, not the beginning of the tests.
17327 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17329 * cfold.cs: Handle operator + (Enum x, Underlying x)
17331 * expression.cs (Binary): same. Warn about errors where we have
17332 Enum/Enum in operator + as well.
17334 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
17337 - added support for switch(bool)
17338 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17339 - add TableSwitchEmit() to handle table-based switch statements
17341 2002-04-05 Ravi Pratap <ravi@ximian.com>
17343 * expression.cs (Invocation.OverloadResolve): Factor out code which
17344 does parameter compatibility checking with arguments so that we can
17345 re-use the code even from Delegate.VerifyApplicability
17347 (VerifyArgumentsCompat): Move above code here.
17349 * delegate.cs (VerifyApplicability): Get rid of duplicate code
17350 and instead make a call to the above method.
17352 2002-03-31 Ravi Pratap <ravi@ximian.com>
17354 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17355 We use it to keep track of classes which are attribute types.
17357 2002-04-02 Miguel de Icaza <miguel@ximian.com>
17359 * delegate.cs (Delegate.Define): Correctly define the types in the
17360 presence of fixed and array parameters.
17362 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17365 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17366 include NonPublic after the first iteration.
17368 * class.cs (Indexer.CheckBase): Only check if both parents are
17371 * cs-parser.jay (accessor_body): If empty, set to null.
17373 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17374 same code path here to resolve constants names that we did have in
17375 MemberAccess.DoResolve. There is too much code duplicated here.
17377 2002-04-01 Miguel de Icaza <miguel@ximian.com>
17379 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17381 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17384 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17385 tokens, numbers and strings.
17387 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17390 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17391 asyncronous parameters and the regular parameters.
17393 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17394 specify the target directory.
17396 * expression.cs: (This.DoResolve): Simplify
17397 (As.Emit): Optimize, do not generate IsInst if the expression is
17398 always of the given type.
17400 (Is.DoResolve): Bug fix, we were reporting both always/never for
17403 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17404 creating too many unnecessary arrays.
17406 2002-03-31 Miguel de Icaza <miguel@ximian.com>
17408 * class.cs (EmitFieldInitializer): Use Assign expression to assign
17409 fields instead of rolling our own initializer. Takes care of all
17410 implicit conversions, and drops unnecessary static checks/argument.
17412 2002-03-31 Dick Porter <dick@ximian.com>
17414 * driver.cs: use the GetDirectories() return values properly, and
17415 use "/" as path separator.
17417 2002-03-30 Miguel de Icaza <miguel@ximian.com>
17419 * expression.cs (Unary): Optimize - - expr into expr.
17420 (Binary): Optimize a + (-b) into a -b.
17422 * codegen.cs (CodeGen): Made all methods static.
17424 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17428 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17429 TypeBuilder property.
17431 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17434 * tree.cs: Removed the various RecordXXXX, and replaced with a
17435 single RecordDecl. Removed all the accessor methods, and just
17436 left a single access point Type
17438 * enum.cs: Rename DefineEnum to DefineType.
17440 * decl.cs: New abstract method `DefineType' used to unify the
17441 Defines for Enumerations, Interfaces, TypeContainers and
17444 (FindType): Moved LookupInterfaceOrClass here. Moved the
17445 LookupBaseClasses method that used to live in class.cs and
17446 interface.cs here, and renamed to FindType.
17448 * delegate.cs: Implement DefineType. Take advantage of the
17449 refactored pattern for locating the parent builder without taking
17450 the parent_builder argument (which we know does not work if we are
17451 nested, and triggering a toplevel definition).
17453 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17455 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17456 accessibility of a member has changed during override and report
17459 * class.cs (Method.Define, Property.Define): Only complain on
17460 overrides if the method is private, any other accessibility is
17461 fine (and since we just checked the permission is the same, we are
17464 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17465 and elif are processed always. The other pre-processing
17466 directives are only processed if we are "taking" the path
17468 2002-03-29 Martin Baulig <martin@gnome.org>
17470 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17471 current location is not Null.
17473 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17474 a separate method so we can profile it.
17476 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17477 `span.Seconds' are just seconds, but no minutes or hours.
17478 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17480 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17482 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17483 Remove the gratuitous set of Final:
17485 // If an interface implementation, then we can set Final.
17486 if (((flags & MethodAttributes.Abstract) == 0) &&
17487 implementing.DeclaringType.IsInterface)
17488 flags |= MethodAttributes.Final;
17490 I do not know what I was smoking when I used that.
17493 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17494 step into fixing the name resolution issues for delegates and
17495 unifying the toplevel name resolution.
17497 2002-03-28 Martin Baulig <martin@gnome.org>
17499 * class.cs (Method.Emit): If we have a symbol writer, call its
17500 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17501 tell it about the current method.
17503 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17504 writer that we're going to emit the first byte of IL code for a new
17505 statement (a new source line).
17506 (EmitContext.EmitTopBlock): If we have a symbol writer, call
17507 EmitContext.Mark() before emitting any code.
17509 * location.cs (SymbolDocument): Return null when we're Null.
17511 * statement.cs (Statement): Moved the `Location loc' variable here.
17512 (Statement.EmitBoolExpression): If we have a symbol writer, call
17513 ec.Mark() before emitting any code to tell it that we're at the
17514 beginning of a new statement.
17515 (StatementExpression): Added `Location' argument to the constructor.
17516 (Block): Added public readonly variable `StartLocation' and public
17517 variable `EndLocation'. The latter is to be set using SetEndLocation().
17518 (Block): Added constructor which takes a start and end location.
17519 (Block.SetEndLocation): New method. This sets the end location.
17520 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17521 local variables we create.
17522 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17523 each statement and do also mark the begin and end of the block.
17525 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17526 tell it the current lexer.Location, use Location.Null for the end of the
17528 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17529 current block, set its end location using SetEndLocation().
17530 (statement_expression): StatementExpression constructor now takes the
17531 lexer.Location as additional argument.
17532 (for_statement, declare_local_variables): Likewise.
17533 (declare_local_variables): When creating a new implicit block, use the
17534 new Block constructor and pass it the lexer.Location.
17536 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17538 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17539 members also on the parent interfaces recursively.
17541 2002-03-27 Miguel de Icaza <miguel@ximian.com>
17543 * report.cs: Use new formats, since Gonzalo finished the missing
17546 * expression.cs (Binary.ResolveOperator): added missing operator|
17547 operator& and operator^ for bool/bool.
17549 * cs-parser.jay: CheckDef now takes a Location argument that is
17550 used to report errors more precisly (instead of reporting the end
17551 of a definition, we try to track something which is a lot closer
17552 to the source of the problem).
17554 * cs-tokenizer.cs: Track global token use, so we can properly flag
17555 the use of #define/#undef after the first token has been seen.
17557 Also, rename the reportXXXX to Error_DescriptiveName
17559 * decl.cs (DeclSpace.IsTopLevel): Move property here from
17560 TypeContainer, so that Enum and Interface can use this too.
17562 * class.cs (TypeContainer.LookupInterfaceOrClass,
17563 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17564 `builder' argument. Typically this was used to pass the parent
17565 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17568 The problem is that a nested class could trigger the definition of
17569 a toplevel class, and the builder would be obviously wrong in that
17572 So we drop this argument, and we compute dynamically the
17573 TypeBuilder/ModuleBuilder (the correct information was available
17574 to us anyways from DeclSpace.Parent)
17576 * interface.cs (Interface.DefineInterface): Drop builder
17577 parameter cleanup like class.cs
17579 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
17582 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17585 (Try.Emit): Propagate the returns value from the statement.
17587 (Return.Emit): Even if we are leavning
17589 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17591 * modifiers.cs: Fix the computation of MethodAttributes flags.
17593 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17595 * driver.cs: allow compilation of files that start with '/'.
17596 Add a default case when checking the argument of --target.
17598 2002-03-25 Miguel de Icaza <miguel@ximian.com>
17600 * interface.cs: Implement the same search algorithm for types in
17601 the interface code.
17603 * delegate.cs: Do not allow multiple definition.
17605 * Recovered ChangeLog that got accidentally amputated
17607 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17609 * rootcontext.cs: Load manually enum to allow core classes to
17610 contain enumerations.
17612 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17613 Update to new static methods in TypeManager.
17615 * typemanager.cs (GetMethod, GetConstructor): Use our
17616 implementation of FindMembers to find the members, since during
17617 corlib compilation, the types are TypeBuilders and GetMethod and
17618 GetConstructor do not work.
17620 Make all methods in TypeManager static.
17622 (InitCodeHelpers): Split the functionality from
17623 the InitCodeTypes function.
17625 * driver.cs: Call InitCodeHelpers after we have populated the
17628 * cs-parser.jay (delegate_declaration): we did not used to compute
17629 the delegate name correctly for void delegates.
17631 2002-03-24 Miguel de Icaza <miguel@ximian.com>
17633 * rootcontext.cs (RootContext): Init the interface_resolve_order
17634 and type_container_resolve_order always.
17636 (ResolveCore, BootstrapCorlib_ResolveClass,
17637 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17638 compiler when compiling with --nostdlib
17640 * class.cs (TypeContainer.DefineType): Check that our parent is
17641 not null. This test is most important when we are bootstraping
17644 * codegen.cs: Split out the symbol writing code.
17646 2002-03-25 Martin Baulig <martin@gnome.org>
17648 * driver.cs (-g): Made -g an alias for --debug.
17650 2002-03-24 Martin Baulig <martin@gnome.org>
17652 * codegen.cs (SymbolWriter): New public variable. Returns the
17653 current symbol writer.
17654 (CodeGen): Added `bool want_debugging_support' argument to the
17655 constructor. If true, tell the ModuleBuild that we want debugging
17656 support and ask it for the ISymbolWriter.
17657 (Save): If we have a symbol writer, call it's Close() method after
17658 saving the assembly.
17660 * driver.c (--debug): New command line argument to create a
17661 debugger information file.
17663 * location.cs (SymbolDocument): New public property. Returns an
17664 ISymbolDocumentWriter object for the current source file or null
17665 if we don't have a symbol writer.
17667 2002-03-21 Miguel de Icaza <miguel@ximian.com>
17669 * driver.cs (LoadAssembly): Correctly return when all the paths
17670 have been tried and not before.
17672 * statement.cs (Switch.Emit): return the actual coverage for this
17673 statement (returns/not-returns)
17675 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17676 switch of the statement if we are the last switch section. That
17677 kills two problems: try/catch problems (we used to emit an empty
17678 nop at the end) and switch statements where all branches would
17681 2002-03-19 Miguel de Icaza <miguel@ximian.com>
17683 * driver.cs: Add default assemblies (the equivalent to the
17684 Microsoft CSC.RSP file)
17686 * cs-tokenizer.cs: When updating `cols and setting it to zero,
17687 also update tokens_seen and set it to false.
17689 * driver.cs: Implement --recurse for Mike.
17691 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17692 correctly splitting out the paths.
17694 2002-03-18 Miguel de Icaza <miguel@ximian.com>
17696 * interface.cs (Interface.PopulateProperty): Instead of using
17697 `parent' as the declaration space for the set parameters, use
17700 * support.cs (InternalParameters): InternalParameters constructor
17701 takes a DeclSpace instead of a TypeContainer.
17703 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17704 types are being initialized, load the address of it before calling
17707 (New): Provide a mechanism to disable the generation of local
17708 value type temporaries when the caller will be providing us with
17709 an address to store it.
17711 (ArrayCreation.EmitDynamicInitializers): Use it.
17713 2002-03-17 Miguel de Icaza <miguel@ximian.com>
17715 * expression.cs (Invocation.EmitArguments): Only probe for array
17716 property if there is more than one argument. Sorry about that.
17718 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17719 empty param arrays.
17721 * class.cs (Method.LabelParameters): Fix incorrect code path that
17722 prevented the `ParamArrayAttribute' from being applied to the
17725 2002-03-16 Miguel de Icaza <miguel@ximian.com>
17727 * support.cs (ReflectionParameters): Correctly compute whether the
17728 last argument is a params array. Fixes the problem with
17731 * typemanager.cs: Make the assemblies array always be non-null
17732 (empty, but non-null)
17734 * tree.cs (RecordDecl): New function that abstracts the recording
17735 of names. This reports error 101, and provides a pointer to the
17736 previous declaration. Fixes a crash in the compiler.
17738 * cs-parser.jay (constructor_declaration): Update to new grammar,
17739 and provide a constructor_body that can be empty.
17741 2002-03-15 Miguel de Icaza <miguel@ximian.com>
17743 * driver.cs: Add support for --resources.
17745 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17746 Make all types for the various array helper methods be integer.
17748 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17749 CheckState to ConvCast.
17751 (ConvCast): Now it takes a `checked' state argument, to avoid
17752 depending on the emit context for the conversion, and just using
17753 the resolve time setting.
17755 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17756 instead of Invocation.EmitArguments. We do not emit the original
17757 arguments, instead we emit those which have been converted to
17758 unsigned int expressions.
17760 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17762 * codegen.cs: ditto.
17764 * expression.cs (LocalVariableReference): Drop the use of the
17765 Store function that depended on the variable index.
17767 * statement.cs (VariableInfo): Drop the `Idx' property from this
17768 class, as this is not taking into account the indexes for
17769 temporaries tat we generate during the execution, getting the
17772 * class.cs: First emit class initializers, then call the parent
17775 * expression.cs (Binary): Fix opcode emision.
17776 (UnaryMutator.EmitCode): Support checked code generation
17778 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17779 matches for events for both the Static and Instance scans,
17780 pointing to the same element. Fix that.
17782 2002-03-14 Miguel de Icaza <miguel@ximian.com>
17784 * rootcontext.cs (ResolveTree): Always set the
17785 interface_resolve_order, because nested interfaces will be calling
17788 * class.cs (GetInterfaceOrClass): Track the same resolution
17789 process used by TypeManager.LookupType. This fixes the nested
17790 type lookups in class declarations (separate path from
17793 (TypeContainer.DefineType): Also define nested interfaces.
17794 (TypeContainer.RegisterOrder): New public function used to
17795 register the order in which child interfaces need to be closed.
17797 Nested interfaces need to be closed after their parents have been
17800 * interface.cs (InterfaceAttr): Put all the logic for computing
17801 the interface attribute here.
17803 (DefineInterface): Register our interface order with the
17804 RootContext or with the TypeContainer depending on the case.
17806 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17808 * cs-parser.jay: rework foreach statement to work with the new
17809 changes to the policy on SimpleNames.
17811 * report.cs: support Stacktrace on warnings as well.
17813 * makefile: drop --unsafe and /unsafe from the compile.
17815 2002-03-13 Ravi Pratap <ravi@ximian.com>
17817 * ecore.cs (StandardConversionExists): Modify to take an Expression
17818 as the first parameter. Ensure we do null -> reference type conversion
17821 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17822 temporary Expression objects.
17824 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17826 * interface.cs: workaround bug in method overloading resolution
17827 (there is already a bugzilla bug for it).
17829 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17831 We could also solve this problem by having a separate path for
17832 performing type lookups, instead of DoResolve, we could have a
17833 ResolveType entry point, and only participating pieces of the
17834 production (simplename, deref, array) would implement this.
17836 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17837 signal SimpleName to only resolve type names and not attempt to
17838 resolve anything else.
17840 * expression.cs (Cast): Set the flag.
17842 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17844 * class.cs: Only report 108 if there is no `new' modifier.
17846 * cs-parser.jay: rework foreach statement to work with the new
17847 changes to the policy on SimpleNames.
17849 * report.cs: support Stacktrace on warnings as well.
17851 * makefile: drop --unsafe and /unsafe from the compile.
17853 2002-03-11 Miguel de Icaza <miguel@ximian.com>
17855 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17856 lookups here, instead of doing that at parse time. This means
17857 that our grammar will not introduce `LocalVariableReferences' as
17858 expressions at this point. That solves the problem of code like
17862 static void Main ()
17866 This is only half the fix. The full fix requires parameters to
17867 also be handled in this way.
17869 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17870 makes the use more obvious of the DeclSpace. The
17871 ec.TypeContainer.TypeBuilder is now only used to pull the
17872 TypeBuilder for it.
17874 My theory is that I can get rid of the TypeBuilder completely from
17875 the EmitContext, and have typecasts where it is used (from
17876 DeclSpace to where it matters).
17878 The only pending problem is that the code that implements Aliases
17879 is on TypeContainer, and probably should go in DeclSpace.
17881 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17882 lookups here, instead of doing that at parse time. This means
17883 that our grammar will not introduce `LocalVariableReferences' as
17884 expressions at this point. That solves the problem of code like
17888 static void Main ()
17892 This is only half the fix. The full fix requires parameters to
17893 also be handled in this way.
17895 * class.cs (Property.DefineMethod): When implementing an interface
17896 method, set newslot, when implementing an abstract method, do not
17897 set the flag (before we tried never setting it, or always setting
17898 it, which is the difference).
17899 (Indexer.DefineMethod): same.
17900 (Method.DefineMethod): same.
17902 * ecore.cs: Only set the status used flag if we get back a Field.
17904 * attribute.cs: Temporary hack, so Paolo can keep working.
17906 2002-03-08 Ravi Pratap <ravi@ximian.com>
17908 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17909 the unmanaged type in the case we have a MarshalAs attribute.
17911 (Resolve): Handle the case when we are parsing the special MarshalAs
17912 attribute [we need to store the unmanaged type to use later]
17914 * typemanager.cs (marshal_as_attr_type): Built in type for the
17915 MarshalAs Attribute.
17917 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
17918 on parameters and accordingly set the marshalling info.
17920 2002-03-09 Miguel de Icaza <miguel@ximian.com>
17922 * class.cs: Optimizing slightly by removing redundant code after
17923 we switched to the `NoTypes' return value.
17924 (Property.DefineMethod): use NoTypes here too.
17926 This fixes the bug I introduced in my last batch of changes.
17928 2002-03-05 Ravi Pratap <ravi@ximian.com>
17930 * tree.cs (RecordEnum): Add. We now keep track of enums too.
17932 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17933 Enums since those are types too.
17935 * cs-parser.jay (enum_declaration): Record enums as we parse them.
17937 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
17938 thanks to a call during the lookup process.
17940 2002-03-07 Miguel de Icaza <miguel@ximian.com>
17942 * statement.cs (Foreach): Lots of work to accomodate a particular
17943 kind of foreach statement that I had not kept in mind. It is
17944 possible to have foreachs on classes that provide a GetEnumerator
17945 method that return objects that implement the "pattern" for using
17946 a foreach, there is no need to support GetEnumerator
17949 This is needed to compile nant.
17951 * decl.cs: Only report 114 if the member is not `Finalize' and if
17952 the warning level is at least 2.
17954 * class.cs: Moved the compare function from Method to
17957 (MethodSignature.InheritableMemberSignatureCompare): Add new
17958 filter function that is used to extract inheritable methods from a
17961 (Method.Define): Use the new `inheritable_method_signature_filter'
17964 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17967 2002-03-06 Miguel de Icaza <miguel@ximian.com>
17969 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17971 * cs-parser.jay: Add opt_semicolon to the interface declaration.
17973 * expression.cs: Pass location information to
17974 ConvertImplicitStandard.
17976 * class.cs: Added debugging code to track return values from
17979 2002-03-05 Miguel de Icaza <miguel@ximian.com>
17981 * expression.cs (Is.DoResolve): If either side of the `is' is an
17982 interface, do not flag the warning.
17984 * ecore.cs (ImplicitReferenceConversion): We need a separate test
17987 * report.cs: Allow for --fatal to be used with --probe.
17989 * typemanager.cs (NoTypes): Move the definition for the empty Type
17992 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17994 (TypeContainer.DefineProxy): New function used to proxy to parent
17995 implementations when implementing interfaces.
17996 (TypeContainer.ParentImplements): used to lookup if our parent
17997 implements a public function that is required by an interface.
17998 (TypeContainer.VerifyPendingMethods): Hook this up.
18000 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18001 `modules' and `assemblies' arraylists into arrays. We only grow
18002 these are the very early start up of the program, so this improves
18003 the speedof LookupType (nicely measured).
18005 * expression.cs (MakeByteBlob): Replaced unsafe code with
18006 BitConverter, as suggested by Paolo.
18008 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18009 folding of string concatenation, but if either side is a string,
18010 and the other is not, then return null, and let the runtime use
18011 the concatenation on the string plus the object (using
18012 `Object.ToString').
18014 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18016 Constant Folding has been implemented now.
18018 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18019 the error instead on types that are not supported in one's
18022 * constant.cs (Constant and all children): New set of functions to
18023 perform implict and explicit conversions.
18025 * ecore.cs (EnumConstant): Implement the new functions to perform
18026 conversion by proxying to the child expression.
18028 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18029 own separate setting that can not be turned off from the command
18030 line using --unchecked or --checked and is only controlled using
18031 the checked/unchecked statements and expressions. This setting is
18032 used by the constant folder to flag errors.
18034 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18035 ConstantCheckState as well.
18037 During Resolve, they also have to flag the state, because the
18038 constant folder runs completely in the Resolve phase.
18040 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18043 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18045 * cfold.cs: New file, this file contains the constant folder.
18047 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18048 argument to track whether we are using the resulting address to
18049 load or store a value and provide better error messages.
18051 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18052 new AddressOf arguments.
18054 * statement.cs (Foreach.EmitCollectionForeach): Update
18056 * expression.cs (Argument.Emit): Call AddressOf with proper
18057 arguments to track usage.
18059 (New.DoEmit): Call AddressOf with new arguments.
18061 (Unary.Emit): Adjust AddressOf call.
18063 2002-03-01 Ravi Pratap <ravi@ximian.com>
18065 * cs-parser.jay (member_access): Change the case for pre-defined types
18066 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
18069 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18072 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18073 essentially like methods and apply attributes like MethodImplOptions to them too.
18075 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18078 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18079 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18082 * Update code everywhere accordingly.
18084 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18086 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18088 2002-02-28 Ravi Pratap <ravi@ximian.com>
18090 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18091 try performing lookups against those instead of jumping straight into using
18092 the 'using' clauses.
18094 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18096 (LookupType): Perform lookups in implicit parents too.
18098 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18099 sequence as RootContext.LookupType.
18101 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18102 the various cases of namespace lookups into this method.
18104 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18106 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18107 in positional arguments)
18109 * class.cs (Operator): Update the AllowedModifiers to contain
18112 * cs-parser.jay: Update operator declaration to allow for the
18113 operator body to be empty.
18115 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18118 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18120 * class.cs (Method.Emit): Label parameters.
18122 * driver.cs: Return 1 or 0 as the program exit code.
18124 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18126 * expression.cs: Special case the `null' object when trying to
18127 auto-compute the type, as anything can be explicitly converted to
18130 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18131 spotting this Paolo.
18133 (Expression.ImplicitNumericConversion): Perform comparissions of
18134 the type using the underlying type in the case of an enumeration
18135 rather than using the enumeration type for the compare.
18137 Cope with the underlying == type case, which is not possible to
18140 (Expression.ConvertNumericExplicit): Perform comparissions of
18141 the type using the underlying type in the case of an enumeration
18142 rather than using the enumeration type for the compare.
18144 * driver.cs: If the user does not supply an extension, assume .exe
18146 * cs-parser.jay (if_statement): Rewrote so that we can track the
18147 location for the if statement.
18149 * expression.cs (Binary.ConstantFold): Only concat strings when
18150 the operation is "+", not everything ;-)
18152 * statement.cs (Statement.EmitBoolExpression): Take a location
18154 (If, While, Do): Track location.
18156 * expression.cs (Binary.ResolveOperator): In the object + string
18157 case, I was missing a call to ConvertImplicit
18159 2002-02-25 Ravi Pratap <ravi@ximian.com>
18161 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18162 Location arguments. Ensure we use RootContext.LookupType to do our work
18163 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18165 * interface.cs (PopulateMethod): Handle the type of the parameter being
18168 * expression.cs (Invocation.BetterFunction): Handle the case when we
18169 have a params method with no fixed arguments and a call is made with no
18172 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18174 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18175 the verbatim-string-literal
18177 * support.cs (InternalParameters.ParameterModifier): handle null
18179 (InternalParameters.ParameterType): ditto.
18181 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18182 duplicating the name of the variable parameter.
18183 (GetParameterByName): Fix bug where we were not looking up array
18184 paramters if they were the only present (thanks Paolo!).
18185 (GetParameterInfo): We only have an empty set of types if both
18186 fixed and array are set to null.
18187 (GetParameterInfo-idx): Handle FixedParameter == null
18189 * cs-parser.jay: Handle the case where there is no catch
18190 statements (missing null test).
18192 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18194 * driver.cs (MainDriver): Be conservative on our command line
18197 Catch DirectoryNotFoundException when calling GetFiles.
18199 (SplitPathAndPattern): Used to split the input specification into
18200 a path and a pattern that we can feed to Directory.GetFiles.
18202 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18204 * statement.cs (Fixed): Implement the last case of the Fixed
18205 statement (string handling).
18207 * expression.cs (StringPtr): New class used to return a char * to
18208 a string; Used by the Fixed statement.
18210 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18212 * expression.cs (Binary.ResolveOperator): Remove redundant
18213 MemberLookup pn parent type.
18214 Optimize union call, we do not need a union if the types are the same.
18215 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18218 Specialize the use of MemberLookup everywhere, instead of using
18219 the default settings.
18221 (StackAlloc): Implement stackalloc keyword.
18223 * cs-parser.jay: Add rule to parse stackalloc.
18225 * driver.cs: Handle /h, /help, /?
18227 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18228 before we supported unsafe code.
18230 * makefile: add --unsafe to the self compilation of mcs.
18232 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18234 * expression.cs (PointerArithmetic): New class that is used to
18235 perform pointer arithmetic.
18236 (Binary.Resolve): Handle pointer arithmetic
18237 Handle pointer comparission.
18238 (ArrayPtr): Utility expression class that is used to take the
18239 address of an array.
18241 (ElementAccess): Implement array access for pointers
18243 * statement.cs (Fixed): Implement fixed statement for arrays, we
18244 are missing one more case before we are done.
18246 * expression.cs (Indirection): Implement EmitAssign and set the
18247 ExprClass to Variable. This allows pointer dereferences to be
18248 treated as variables, and to have values assigned to them.
18250 * ecore.cs (Expression.StoreFromPtr): New utility function to
18251 store values dereferencing.
18253 2002-02-20 Ravi Pratap <ravi@ximian.com>
18255 * expression.cs (Binary.ResolveOperator): Ensure that we are
18256 not trying to operate on a void type - this fixes the reported
18259 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18260 the parent implementation is sealed.
18262 * ../errors/cs0239.cs : Add.
18264 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18266 * typemanager.cs (unverifiable_code_type): Corresponds to
18267 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18268 which have unsafe code in them.
18270 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18273 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18275 * cs-tokenizer.cs: Add support for @"litreal strings"
18277 Make tokenizer accept pre-processor directives
18278 on any column (remove the old C-like limitation).
18280 * rootcontext.cs (EmitCode): Emit any global attributes.
18281 (AddGlobalAttributes): Used to keep track of assembly attributes.
18283 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18285 * cs-parser.jay: Add support for global attributes.
18287 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18289 * expression.cs (Indirection): New helper class. Unary will
18290 create Indirection classes to be able to implement the
18291 IMemoryLocation interface on it.
18293 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18295 * cs-parser.jay (fixed_statement): reference the right statement.
18297 * statement.cs (Fixed.Emit): Finish implementing the fixed
18298 statement for the &x case.
18300 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18302 * class.cs (Property.Define, Method.Define): Remove newslot when
18305 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18306 wrong. NewSlot should only be used if the `new' keyword is present.
18308 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18309 locating our system dir. Sorry about this.
18311 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18313 * driver.cs (GetSystemDir): Compute correctly the location of our
18314 system assemblies. I was using the compiler directory instead of
18315 the library directory.
18317 2002-02-13 Ravi Pratap <ravi@ximian.com>
18319 * expression.cs (BetterFunction): Put back in what Miguel commented out
18320 since it is the correct fix. The problem is elsewhere ;-)
18322 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18323 parameters of the parms method are themselves compatible or not !
18325 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18326 to check that a class implements an interface before saying that an implicit
18327 conversion was allowed. Use ImplementsInterface to do the checking.
18329 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18331 * class.cs (Method.Define): Track whether we are an explicit
18332 implementation or not. And only call DefineMethodOverride if we
18333 are an explicit implementation.
18335 (Property.DefineMethod): Ditto.
18337 2002-02-11 Ravi Pratap <ravi@ximian.com>
18339 * expression.cs (BetterFunction): Catch hideous bug which was
18340 preventing us from detecting ambiguous calls due to implicit casts i.e
18343 2002-01-29 Miguel de Icaza <miguel@ximian.com>
18345 * support.cs (Pair): Remove un-needed method. I figured why I was
18346 getting the error in cs-parser.jay, the variable in a foreach loop
18347 is readonly, and the compiler does not really treat this as a variable.
18349 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
18350 instead of EQUALS in grammar.
18352 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18354 * expression.cs (Unary.DoResolve): Check whether the argument is
18357 2002-01-28 Miguel de Icaza <miguel@ximian.com>
18359 * support.cs: Api for Pair to set a value. Despite the fact that
18360 the variables are public the MS C# compiler refuses to compile
18361 code that accesses the field if the variable is part of a foreach
18364 * statement.cs (Fixed): Begin implementation of the fixed
18367 (Block.AddVariable): Return the VariableInfo on success and null
18368 on failure instead of true/false.
18370 * cs-parser.jay (foreach): Catch errors on variables already
18371 defined (we were ignoring this value before) and properly unwind
18372 the block hierarchy
18374 (fixed_statement): grammar for the fixed statement.
18376 2002-01-25 Miguel de Icaza <miguel@ximian.com>
18378 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18379 pointer types to be incretemented.
18381 (SizeOf): Implement.
18383 * cs-parser.jay (pointer_member_access): Implement
18384 expr->IDENTIFIER production.
18386 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18387 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18390 (Unary): Implement indirection.
18392 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18393 use in non-unsafe context).
18395 (SimpleName.DoResolve): Check for pointers in field access on safe
18398 (Expression.LoadFromPtr): Factor the load-indirect code in this
18399 function. This was duplicated in UnboxCast and ParameterReference
18401 2002-01-24 Miguel de Icaza <miguel@ximian.com>
18403 * expression.cs (ComposedCast): report an error if a pointer cast
18404 is used in a safe region.
18406 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18407 pointer type casts in unsafe context.
18409 * codegen.cs (EmitContext): Set up IsUnsafe.
18411 * cs-parser.jay (non_expression_type): Add productions for pointer
18414 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18415 code. We should not use force into static mode if the method is
18416 not virtual. Fixes bug in MIS
18418 * statement.cs (Do.Emit, While.Emit, For.Emit,
18419 Statement.EmitBoolExpression): Add support to Do and While to
18420 propagate infinite loop as `I do return' semantics.
18422 Improve the For case to also test for boolean constants.
18424 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18425 to the list of attributes we can add.
18427 Remove `EmitContext' argument.
18429 * class.cs (Method.Define): Apply parameter attributes.
18430 (Constructor.Define): Apply parameter attributes.
18431 (MethodCore.LabelParameters): Move here the core of labeling
18434 * support.cs (ReflectionParameters.ParameterModifier,
18435 InternalParameters.ParameterModifier): Use IsByRef on the type and
18436 only return the OUT bit for these parameters instead of in/out/ref
18439 This is because I miss-understood things. The ParameterInfo.IsIn
18440 and IsOut represent whether the parameter has the [In] and [Out]
18443 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18445 * ecore.cs (FieldExpr.Emit): Release temporaries.
18447 * assign.cs (LocalTemporary.Release): new function.
18449 * codegen.cs (EmitContext.GetTemporaryStorage,
18450 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18451 temporary storage. Now we can "put back" localbuilders when we
18454 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18456 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18457 need to make a copy of the variable to generate verifiable code.
18459 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18461 * driver.cs: Compute dynamically the system directory.
18463 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18464 Slower, but more generally useful. Used by the abstract
18465 registering implementation.
18467 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18468 the rules for the special rule on Type/instances. First check if
18469 we have the same name, and if so, try that special static path
18470 rather than the instance path.
18472 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18474 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18477 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18478 Enum, ValueType, Delegate or Array for non-corlib compiles.
18480 * cs-tokenizer.cs: Catch long identifiers (645)
18482 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18485 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18486 fix, we were returning too early, so we were not registering
18487 pending methods from abstract classes.
18489 Do not register pending methods if the class is abstract.
18491 * expression.cs (Conditional.DoResolve): Report circular implicit
18492 conversions when we neecd to compute it for conditional
18495 (Is.DoResolve): If the expression is always of the provided type,
18496 flag warning 183. If the expression can not ever be of the
18497 provided type flag warning 184.
18499 * class.cs: Catch 169 as well.
18501 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18504 2002-01-18 Nick Drochak <ndrochak@gol.com>
18506 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
18508 2002-01-17 Miguel de Icaza <miguel@ximian.com>
18510 * interface.cs: (PopulateMethod): Check for pointers being defined
18511 only if the unsafe context is active.
18512 (PopulateProperty): ditto.
18513 (PopulateIndexer): ditto.
18515 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18516 specified. If pointers are present, make sure that they are
18517 present in an unsafe context.
18518 (Constructor, Constructor.Define): ditto.
18519 (Field, Field.Define): ditto.
18520 (Property, Property.Define): ditto.
18521 (Event, Event.Define): ditto.
18523 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18524 hashtable if there are classes or structs defined.
18526 * expression.cs (LocalVariableReference.DoResolve): Simplify this
18527 code, as the constant resolution moved.
18529 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18530 the metadata, so we can flag error 133.
18532 * decl.cs (MemberCore.UnsafeOK): New function to test that a
18533 pointer is being declared in an unsafe context.
18535 2002-01-16 Miguel de Icaza <miguel@ximian.com>
18537 * modifiers.cs (Modifiers.Check): Require a Location argument.
18538 Report error 227 for Unsafe use.
18540 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18542 * statement.cs (For.Emit): If the test is null, then report that
18543 we do `return', as we wont reach anything afterwards.
18545 (Switch.SwitchGoverningType): Track the expression that matched
18548 * driver.cs: Allow negative numbers as an error code to flag.
18550 * cs-parser.jay: Handle 1551.
18552 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18554 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18556 * cs-parser.jay: Report 1518 (type declaration can only contain
18557 class, struct, interface, enum or delegate)
18559 (switch_label): Report 1523 (keywords `case' or `default' must
18562 (opt_switch_sections): Report 1522 (empty switch)
18564 * driver.cs: Report 1515 (response file specified multiple times)
18565 Report 1516 (Source file specified multiple times).
18567 * expression.cs (Argument.Resolve): Signal 1510
18569 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18570 access not allowed in static code)
18572 2002-01-11 Ravi Pratap <ravi@ximian.com>
18574 * typemanager.cs (IsPointerType): Utility method which we are going
18577 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18578 the object type, so we take care of that.
18580 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18582 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18583 added to non-params parameters :-)
18585 * typemanager.cs (CSharpName): Include 'void' type too.
18587 (void_ptr_type): Include in the set of core types.
18589 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
18592 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
18595 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
18596 completely forgotten about it.
18598 2002-01-10 Ravi Pratap <ravi@ximian.com>
18600 * cs-parser.jay (pointer_type): Add. This begins our implementation
18601 of parsing rules for unsafe code.
18603 (unsafe_statement): Implement.
18605 (embedded_statement): Modify to include the above.
18607 * statement.cs (Unsafe): Implement new class for unsafe blocks.
18609 * codegen.cs (EmitContext.InUnsafe): Add. This determines
18610 if the current context is an unsafe one.
18612 * cs-parser.jay (local_variable_pointer_type): Since local variable types
18613 are handled differently, we need separate rules for them.
18615 (local_variable_declaration): Update to use local_variable_pointer_type
18616 to allow variable declarations of unmanaged pointer types.
18618 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18619 in unsafe contexts.
18621 * ../errors/cs0214.cs : Add.
18623 2002-01-16 Nick Drochak <ndrochak@gol.com>
18625 * makefile: remove 'response' file when cleaning.
18627 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18629 * cs-parser.jay: Report 1524.
18631 2002-01-14 Miguel de Icaza <miguel@ximian.com>
18633 * typemanager.cs (RegisterMethod): drop checking if we have
18634 registered this from here
18636 2002-01-12 Miguel de Icaza <miguel@ximian.com>
18638 * class.cs (Method.EmitDestructor): Implement calling our base
18641 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18642 value of InFinally.
18644 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18645 this routine and will wrap the call in a try/catch block. Deal
18648 2002-01-11 Miguel de Icaza <miguel@ximian.com>
18650 * ecore.cs (Expression.MemberLookup): instead of taking a
18651 parameter `same_type' that was used to tell whether we could
18652 access private members we compute our containing type from the
18655 (FieldExpr): Added partial support for volatile fields. This does
18656 not work for volatile fields exposed from assemblies, as I can not
18657 figure out how to extract the modreq from it.
18659 Updated all the source files to use this.
18661 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18662 because it is referenced by MemberLookup very often.
18664 2002-01-09 Ravi Pratap <ravi@ximian.com>
18666 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18667 TypeBuilder.GetCustomAttributes to retrieve what we need.
18669 Get rid of redundant default_member_attr_type as this is the same as
18670 default_member_type which already exists.
18672 * interface.cs, attribute.cs : Update accordingly.
18674 2002-01-08 Miguel de Icaza <miguel@ximian.com>
18676 * typemanager.cs: Enable IndexerPropertyName again. It does not
18677 work for TYpeBuilders though. Ravi, can you please fix this?
18679 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18681 * expression.cs (Argument.Emit): Handle the case of ref objects
18682 being passed to ref functions;
18684 (ParameterReference.EmitLoad): Loads the content of the pointer
18685 without dereferencing.
18687 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18689 * cs-tokenizer.cs: Implemented the pre-processing expressions.
18691 2002-01-08 Ravi Pratap <ravi@ximian.com>
18693 * class.cs (Indexer.DefineMethod): Incorporate the interface
18694 type in the name of the method if we are doing explicit interface
18697 * expression.cs (ConversionExists): Remove as it is completely obsolete.
18699 (BetterConversion): Fix extremely trivial bug where we were referring to
18700 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18703 * ../errors/bug16.cs : Add although we have fixed it.
18705 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18707 * expression.cs (BaseIndexer): Begin implementation.
18709 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18711 * cs-parser.jay (indexer_declarator): Use qualified_identifier
18712 production directly to remove a shift/reduce, and implement
18713 explicit interface implementation.
18715 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18716 after a floating point suffix.
18718 * expression.cs (DoNumericPromotions): Improved the conversion for
18719 uint/uint. If we have a constant, we avoid doing a typecast to a
18722 * class.cs (Indexer): Implement explicit interface implementation
18725 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18727 * class.cs: make the default instance constructor public and hidebysig.
18729 2001-01-03 Ravi Pratap <ravi@ximian.com>
18731 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18732 so we can call it from elsewhere.
18734 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18735 we emit it internally if the class has a defined indexer; otherwise the user
18736 emits it by decorating the class definition with the DefaultMemberAttribute.
18738 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18739 attribute is not used on a type which defines an indexer.
18741 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18742 character when we skip whitespace.
18744 * ../errors/cs0646.cs : Add.
18746 2002-01-03 Miguel de Icaza <miguel@ximian.com>
18748 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18751 * makefile: Add practical target `mcs3.exe' which builds the third
18752 generation compiler.
18754 * expression.cs (New): Fix structures constructor calling.
18756 * class.cs (Property, Method, Indexer): Emit Final flag on the
18757 method if we are an interface implementation and we are not
18760 * ecore.cs (PropertyExpr): New public field `IsBase', tells
18761 whether this property is referencing a `base' method.
18763 * expression.cs (Invocation.EmitCall): take an extra argument:
18764 is_base, this is used to determine whether the `call' or
18765 `callvirt' opcode should be used.
18768 * delegate.cs: update EmitCall.
18770 * class.cs (Method.Define): Set NewSlot for the cases where we are
18771 not implementing an interface method.
18773 (Property.Define): ditto.
18775 2002-01-02 Miguel de Icaza <miguel@ximian.com>
18777 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18778 'r'. Allows mcs to parse itself fully.
18780 2002-01-02 Ravi Pratap <ravi@ximian.com>
18782 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18783 of the number of initializers that require the InitializeArray method.
18785 (CheckIndices): Store the Expression in all cases - not the plain value. Also
18786 update the above field where necessary.
18788 (MakeByteBlob): Update accordingly.
18790 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
18793 (EmitDynamicInitializers): Update in accordance with the new optimization.
18795 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18796 same OpCode applies.
18798 * cs-parser.jay : Fix some glaring errors I introduced.
18800 2002-01-01 Ravi Pratap <ravi@ximian.com>
18802 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18803 so that we can check for name clashes there too.
18805 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18806 for interface indexers.
18808 * interfaces.cs (Define): Emit the default member attribute.
18810 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18811 variable was being referred to while setting the value ;-)
18813 2002-01-01 Miguel de Icaza <miguel@ximian.com>
18815 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18816 byte-by-byte information when we know the data is zero.
18818 Make the block always a multiple of 4, because
18819 DefineInitializedData has a bug.
18821 * assign.cs: Fix, we should assign from the temporary, not from
18824 * expression.cs (MakeByteBlob): Fix my incorrect code.
18826 2001-12-31 Miguel de Icaza <miguel@ximian.com>
18828 * typemanager.cs (EnumToUnderlying): This function is used to get
18829 the underlying type from an enumeration, because it does not
18832 * constant.cs: Use the I4_S form for values between -128 and 127.
18834 * statement.cs (Block.LookupLabel): Looks up a label.
18835 (Block): Drop support for labeled blocks.
18837 (LabeledStatement): New kind of statement that represents a label
18840 (Goto): Finally implement this bad boy.
18842 * cs-parser.jay: Update to reflect new mechanism to implement
18845 2001-12-30 Miguel de Icaza <miguel@ximian.com>
18847 * codegen.cs (EmitContext.This): a codegen property that keeps the
18848 a single instance of this instead of creating many different this
18851 * delegate.cs (Delegate.DoResolve): Update to use the property;
18853 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18855 * expression.cs (BaseAccess.DoResolve): Ditto.
18857 2001-12-29 Ravi Pratap <ravi@ximian.com>
18859 * typemanager.cs (methodimpl_attr_type): Add to hold the type
18860 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18862 (InitCoreTypes): Update accordingly.
18864 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18865 so we can quickly store the state.
18867 (ApplyAttributes): Set the correct implementation flags
18868 for InternalCall methods.
18870 2001-12-29 Miguel de Icaza <miguel@ximian.com>
18872 * expression.cs (EmitCall): if a method is not virtual, then do
18873 not use callvirt on it.
18875 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18876 user defined stuff) requires the use of stobj, which takes an
18877 address on the stack instead of an array and an index. So emit
18878 the Ldelema operation for it.
18880 (EmitStoreOpcode): Use stobj for valuetypes.
18882 (UnaryMutator.EmitCode): Use the right 1 value depending on
18883 whether we are dealing with int64/uint64, float or doubles.
18885 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18886 constructors that I implemented last night.
18888 (Constructor.IsDefault): Fix to work properly for static
18891 * cs-parser.jay (CheckDef): report method signature errors.
18892 Update error number 103 to be 132.
18894 * decl.cs: New AdditionResult enumeration value: MethodExists.
18895 Although we do this check for methods later on in the semantic
18896 analysis, catching repeated default constructors is so easy that
18897 we catch these here.
18899 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18902 (ParameterReference.EmitAssign, Emit): handle
18905 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18906 (ArrayAccess.EmitStoreOpcode): ditto.
18908 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18910 * expression.cs (MakeByteBlob): Complete all the missing types
18911 (uint, short, ushort, byte, sbyte)
18913 * class.cs: Only init instance field initializers on instance
18916 Rename `constructors' to instance_constructors.
18918 (TypeContainer.AddConstructor): Only add constructors to the list
18919 if it is not static.
18921 Make sure that we handle default_static_constructor independently
18922 everywhere where we handle instance_constructors
18924 2001-12-28 Miguel de Icaza <miguel@ximian.com>
18926 * class.cs: Do not lookup or create a base initializer for a
18927 static constructor.
18929 (ConstructorInitializer.Resolve): use the proper type to lookup
18932 * cs-parser.jay: Report error 1585 (modifiers between type and name).
18934 * enum.cs, interface.cs: Remove CloseType, this is taken care by
18937 * decl.cs: CloseType is now an virtual method, the default
18938 implementation just closes this type.
18940 2001-12-28 Ravi Pratap <ravi@ximian.com>
18942 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18943 to PreserveSig by default. Also emit HideBySig on such methods.
18945 Basically, set the defaults to standard values.
18947 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18948 argument, if candidate is better, it can't be worse than the best !
18950 (Invocation): Re-write bits to differentiate between methods being
18951 applicable in their expanded form and their normal form - for params
18954 Get rid of use_standard everywhere as only standard conversions are allowed
18955 in overload resolution.
18957 More spec conformance.
18959 2001-12-27 Miguel de Icaza <miguel@ximian.com>
18961 * driver.cs: Add --timestamp, to see where the compiler spends
18964 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18965 `this' in static code.
18967 (SimpleName.DoResolve): Implement in terms of a helper function
18968 that allows static-references to be passed upstream to
18971 (Expression.ResolveWithSimpleName): Resolve specially simple
18972 names when called by MemberAccess to implement the special
18975 (Expression.ImplicitReferenceConversion): Handle conversions from
18976 Null to reference types before others, as Null's type is
18979 * expression.cs (Invocation.EmitCall): Handle the special case of
18980 calling methods declared on a reference type from a ValueType
18981 (Base classes System.Object and System.Enum)
18983 (MemberAccess.Resolve): Only perform lookups on Enumerations if
18984 the left hand side is a TypeExpr, not on every enumeration.
18986 (Binary.Resolve): If types are reference types, then do a cast to
18987 object on operators != and == of both arguments.
18989 * typemanager.cs (FindMembers): Extract instance and static
18990 members if requested.
18992 * interface.cs (PopulateProperty): Use void_type instead of null
18993 as the return type for the setter method.
18995 (PopulateIndexer): ditto.
18997 2001-12-27 Ravi Pratap <ravi@ximian.com>
18999 * support.cs (ReflectionParameters): Fix minor bug where we
19000 were examining the wrong parameter for the ParamArray attribute.
19002 Cope with requests for the type of the parameter at position
19003 greater than the params parameter's. We now return the element
19004 type of the params array as that makes more sense.
19006 * expression.cs (Invocation.IsParamsMethodApplicable): Update
19007 accordingly as we no longer have to extract the element type
19010 (Invocation.OverloadResolve): Update.
19012 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19014 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19015 against IEnumerator, test whether the return value is a descendant
19016 of the IEnumerator interface.
19018 * class.cs (Indexer.Define): Use an auxiliary method to implement
19019 the other bits of the method definition. Begin support for
19020 explicit interface implementation.
19022 (Property.DefineMethod): Use TypeManager.void_type instead of null
19023 for an empty return value.
19025 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19027 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19028 dealing with a FieldExpr which is composed of a FieldBuilder, in
19029 the code path we did extract the constant, but we should have
19030 obtained the underlying value to be able to cast it (otherwise we
19031 end up in an infinite loop, this is what Ravi was running into).
19033 (ArrayCreation.UpdateIndices): Arrays might be empty.
19035 (MemberAccess.ResolveMemberAccess): Add support for section
19036 14.5.4.1 that deals with the special case of E.I when E is a type
19037 and something else, that I can be a reference to a static member.
19039 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19040 handle a particular array type to create byte blobs, it is just
19041 something we dont generate byteblobs for.
19043 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19046 * location.cs (Push): remove the key from the hashtable that we
19047 are about to add. This happens for empty files.
19049 * driver.cs: Dispose files after we have parsed them.
19051 (tokenize): new function that only runs the tokenizer on its
19052 input, for speed testing.
19054 2001-12-26 Ravi Pratap <ravi@ximian.com>
19056 * class.cs (Event.Define): Define the private field only if there
19057 are no accessors defined.
19059 * expression.cs (ResolveMemberAccess): If there is no associated
19060 field with the event, that means we have an event defined with its
19061 own accessors and we should flag error cs0070 since transforming
19062 ourselves into a field is not valid in that case.
19064 * ecore.cs (SimpleName.DoResolve): Same as above.
19066 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19067 and charset to sane values.
19069 2001-12-25 Ravi Pratap <ravi@ximian.com>
19071 * assign.cs (DoResolve): Perform check on events only if they
19072 are being accessed outside the declaring type.
19074 * cs-parser.jay (event_declarations): Update rules to correctly
19075 set the type of the implicit parameter etc.
19077 (add_accessor, remove_accessor): Set current local parameters.
19079 * expression.cs (Binary): For delegate addition and subtraction,
19080 cast the return value from the method into the appropriate delegate
19083 2001-12-24 Ravi Pratap <ravi@ximian.com>
19085 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19086 of these as the workaround is unnecessary.
19088 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19089 delegate data - none of that is needed at all.
19091 Re-write bits to extract the instance expression and the delegate method
19094 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19097 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19098 of attaching attributes instead of duplicating code everywhere.
19100 * everywhere : Update code to do attribute emission using the above method.
19102 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19104 * expression.cs (IsParamsMethodApplicable): if there are not
19105 parameters, return immediately.
19107 * ecore.cs: The 0 literal can be implicity converted to an enum
19110 (SimpleName.DoResolve): First lookup the type, then lookup the
19113 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19114 want to get its address. If the InstanceExpression is not
19115 addressable, store the result in a temporary variable, then get
19118 * codegen.cs: Only display 219 errors on warning level or above.
19120 * expression.cs (ArrayAccess): Make it implement the
19121 IMemoryLocation interface.
19123 (Binary.DoResolve): handle the operator == (object a, object b)
19124 and operator != (object a, object b) without incurring into a
19125 BoxedCast (because 5 != o should never be performed).
19127 Handle binary enumerator operators.
19129 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19130 value type, otherwise use Ldelem_ref.
19132 Use precomputed names;
19134 (AddressOf): Implement address of
19136 * cs-parser.jay (labeled_statement): Fix recursive block
19137 addition by reworking the production.
19139 * expression.cs (New.DoEmit): New has a special case:
19141 If we are dealing with a ValueType, we have a few
19142 situations to deal with:
19144 * The target of New is a ValueType variable, that is
19145 easy, we just pass this as the variable reference
19147 * The target of New is being passed as an argument,
19148 to a boxing operation or a function that takes a
19151 In this case, we need to create a temporary variable
19152 that is the argument of New.
19155 2001-12-23 Ravi Pratap <ravi@ximian.com>
19157 * rootcontext.cs (LookupType): Check that current_type is not null before
19158 going about looking at nested types.
19160 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19161 not implement the IAssignMethod interface any more.
19163 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19164 where we tranform them into FieldExprs if they are being resolved from within
19165 the declaring type.
19167 * ecore.cs (SimpleName.DoResolve): Do the same here.
19169 * assign.cs (DoResolve, Emit): Clean up code considerably.
19171 * ../errors/bug10.cs : Add.
19173 * ../errors/cs0070.cs : Add.
19175 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19177 * assign.cs : Get rid of EventIsLocal everywhere.
19179 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19181 * ecore.cs (ConvertIntLiteral): finished the implementation.
19183 * statement.cs (SwitchLabel): Convert the value we are using as a
19184 key before looking up the table.
19186 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19188 * codegen.cs (EmitTopBlock): Require a Location argument now.
19190 * cs-parser.jay (constructor_declarator): We need to setup
19191 current_local_parameters before we parse the
19192 opt_constructor_initializer, to allow the variables to be bound
19193 to the constructor arguments.
19195 * rootcontext.cs (LookupType): First lookup nested classes in our
19196 class and our parents before we go looking outside our class.
19198 * expression.cs (ConstantFold): Extract/debox the values at the
19201 * rootcontext.cs (EmitCode): Resolve the constants first before we
19202 resolve the types. This is not really needed, but it helps debugging.
19204 * statement.cs: report location.
19206 * cs-parser.jay: pass location to throw statement.
19208 * driver.cs: Small bug fix.
19210 * report.cs: Updated format to be 4-zero filled digits.
19212 2001-12-22 Ravi Pratap <ravi@ximian.com>
19214 * expression.cs (CheckIndices): Fix minor bug where the wrong
19215 variable was being referred to ;-)
19217 (DoEmit): Do not call EmitStaticInitializers when the
19218 underlying type is System.Object.
19220 2001-12-21 Ravi Pratap <ravi@ximian.com>
19222 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19223 and do the usual workaround for SRE.
19225 * class.cs (MyEventBuilder.EventType): New member to get at the type
19226 of the event, quickly.
19228 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19230 * assign.cs (Assign.DoResolve): Handle the case when the target
19231 is an EventExpr and perform the necessary checks.
19233 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19236 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19238 (EventExpr): Set the type in the constructor itself since we
19239 are meant to be born fully resolved.
19241 (EventExpr.Define): Revert code I wrote earlier.
19243 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19244 instance expression is null. The instance expression is a This in that case
19245 or a null, depending on whether it is a static method or not.
19247 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19248 refers to more than one method.
19250 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19251 and accordingly flag errors.
19253 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19255 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19257 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19259 * location.cs (ToString): Provide useful rutine.
19261 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19263 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19264 objects, return the actual integral boxed.
19266 * statement.cs (SwitchLabel): define an ILLabel for each
19269 (Switch.CheckSwitch): If the value is a Literal, extract
19270 the underlying literal.
19272 Also in the unused hashtable we had, add the SwitchLabel so we can
19273 quickly look this value up.
19275 * constant.cs: Implement a bunch of new constants. Rewrite
19276 Literal based on this. Made changes everywhere to adapt to this.
19278 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19279 dereferencing array only once, and also copes with enumrations.
19281 bytes are two bytes wide, not one.
19283 (Cast): Perform constant conversions.
19285 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19286 wrappers to the literals here.
19288 * expression.cs (DoNumericPromotions): long literals can converted
19289 to ulong implicity (this is taken care of elsewhere, but I was
19290 missing this spot).
19292 * ecore.cs (Expression.Literalize): Make the return type Literal,
19293 to improve type checking.
19295 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19297 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19299 * literal.cs: Revert code from ravi that checked the bounds. The
19300 bounds are sane by the definition of the type itself.
19302 * typemanager.cs: Fix implementation of ImplementsInterface. We
19303 need to actually look up in our parent hierarchy for interfaces
19306 * const.cs: Use the underlying type for enumerations
19308 * delegate.cs: Compute the basename for the delegate creation,
19309 that should fix the delegate test case, and restore the correct
19310 Type Lookup semantics in rootcontext
19312 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19313 referencing a nested type with the Reflection API is using the "+"
19316 * cs-parser.jay: Do not require EOF token at the end.
19318 2001-12-20 Ravi Pratap <ravi@ximian.com>
19320 * rootcontext.cs (LookupType): Concatenate type names with
19321 a '.' instead of a '+' The test suite passes again.
19323 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19324 field of the enumeration.
19326 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19327 the case when the member is an EventExpr.
19329 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19330 static has an associated instance expression.
19332 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19334 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19336 * class.cs (Event.Define): Register event and perform appropriate checks
19339 We define the Add and Remove methods even if the use provides none because
19340 in that case, we provide default implementations ourselves.
19342 Define a private field of the type of the event. This is done by the CSC compiler
19343 and we should be doing it too ;-)
19345 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19346 More methods we use in code we generate.
19348 (multicast_delegate_type, delegate_type): Two separate types since the distinction
19351 (InitCoreTypes): Update accordingly for the above.
19353 * class.cs (Event.Emit): Generate code for default accessors that we provide
19355 (EmitDefaultMethod): Do the job in the above.
19357 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
19360 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19362 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19363 builders even if we were missing one.
19365 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19366 pass the Basename as our class name instead of the Name. The
19367 basename will be correctly composed for us.
19369 * parameter.cs (Paramters): Now takes a Location argument.
19371 * decl.cs (DeclSpace.LookupType): Removed convenience function and
19372 make all the code call directly LookupType in RootContext and take
19373 this chance to pass the Location information everywhere.
19375 * Everywhere: pass Location information.
19377 2001-12-19 Miguel de Icaza <miguel@ximian.com>
19379 * class.cs (Constructor.Define): Updated way of detecting the
19380 length of the parameters.
19382 (TypeContainer.DefineType): Use basename as the type name for
19385 (TypeContainer.Define): Do not recursively define types here, as
19386 definition is taken care in order by the RootContext.
19388 * tree.cs: Keep track of namespaces in a per-file basis.
19390 * parameter.cs (Parameter.ComputeSignature): Update to use
19393 (Parameters.GetSignature): ditto.
19395 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19396 instead of a TypeContainer.
19398 (Interface.SemanticAnalysis): Use `this' instead of our parent to
19399 resolve names. Because we need to be resolve in our context, not
19402 * driver.cs: Implement response files.
19404 * class.cs (TypeContainer.DefineType): If we are defined, do not
19405 redefine ourselves.
19407 (Event.Emit): Emit the code for add/remove handlers.
19408 (Event.Define): Save the MethodBuilders for add/remove.
19410 * typemanager.cs: Use pair here too.
19412 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19413 DictionaryEntry requires the first argument to be non-null.
19415 (enum_declaration): Compute full name for registering the
19418 (delegate_declaration): Instead of using
19419 formal_parameter_list, use opt_formal_parameter_list as the list
19422 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19423 (EventParsing): New property that controls whether `add' and
19424 `remove' are returned as tokens or identifiers (for events);
19426 2001-12-19 Ravi Pratap <ravi@ximian.com>
19428 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19429 use MyEventBuilder only and let it wrap the real builder for us.
19431 (MyEventBuilder): Revamp constructor etc.
19433 Implement all operations that we perform on EventBuilder in precisely the same
19436 (FindMembers): Update to use the EventBuilder member.
19438 (Event.Emit): Update accordingly.
19440 2001-12-18 Ravi Pratap <ravi@ximian.com>
19442 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19443 by calling the appropriate methods.
19445 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19448 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19450 2001-12-17 Ravi Pratap <ravi@ximian.com>
19452 * delegate.cs (Delegate.Populate): Check that the return type
19453 and various parameters types are indeed accessible.
19455 * class.cs (Constructor.Define): Same here.
19457 (Field.Define): Ditto.
19459 (Event.Define): Ditto.
19461 (Operator.Define): Check that the underlying Method defined itself
19462 correctly - so it's MethodBuilder should not be null.
19464 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19465 expression happens to be null.
19467 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19468 members but as of now we don't seem to be able to do anything really useful with it.
19470 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19471 not the EventBuilder.
19473 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19475 * cs-tokenizer.cs: Add support for defines.
19476 Add support for #if, #elif, #else, #endif
19478 (eval_var): evaluates a variable.
19479 (eval): stubbed for evaluating functions.
19481 * cs-parser.jay: Pass the defines information
19483 * driver.cs: Add --define command line option.
19485 * decl.cs: Move MemberCore here.
19487 Make it the base class for DeclSpace. This allows us to catch and
19488 report 108 and 109 for everything now.
19490 * class.cs (TypeContainer.Define): Extract all the members
19491 before populating and emit the warning 108 (new keyword required
19492 to override) instead of having each member implement this.
19494 (MemberCore.Define): New abstract method, we will be using this in
19495 the warning reporting engine in Populate.
19497 (Operator.Define): Adjust to new MemberCore protocol.
19499 * const.cs (Const): This does not derive from Expression, it is a
19500 temporary object we use to create fields, it is a MemberCore.
19502 * class.cs (Method.Define): Allow the entry point to be in a
19505 * driver.cs: Rewrite the argument handler to clean it up a bit.
19507 * rootcontext.cs: Made it just an auxiliary namespace feature by
19508 making everything static.
19510 * driver.cs: Adapt code to use RootContext type name instead of
19513 * delegate.cs: Remove RootContext argument.
19515 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19518 * class.cs (Event.Define): The lookup can fail.
19520 * cs-tokenizer.cs: Begin implementation of pre-procesor.
19522 * expression.cs: Resolve the this instance before invoking the code.
19524 2001-12-17 Miguel de Icaza <miguel@ximian.com>
19526 * cs-parser.jay: Add a production in element_access that allows
19527 the thing to become a "type" reference. This way we can parse
19528 things like "(string [])" as a type.
19530 Note that this still does not handle the more complex rules of
19534 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
19536 * ecore.cs: (CopyNewMethods): new utility function used to
19537 assemble the list of methods from running FindMembers.
19539 (MemberLookup): Rework FindMembers so that
19541 2001-12-16 Miguel de Icaza <miguel@ximian.com>
19543 * class.cs (TypeContainer): Remove Delegates who fail to be
19546 * delegate.cs (Populate): Verify that we dont get null return
19547 values. TODO: Check for AsAccessible.
19549 * cs-parser.jay: Use basename to emit error 574 (destructor should
19550 have the same name as container class), not the full name.
19552 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19553 possible representation.
19555 Also implements integer type suffixes U and L.
19557 2001-12-15 Miguel de Icaza <miguel@ximian.com>
19559 * expression.cs (ArrayCreation.DoResolve): We need to do the
19560 argument resolution *always*.
19562 * decl.cs: Make this hold the namespace. Hold the root context as
19564 (LookupType): Move here.
19566 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19568 * location.cs (Row, Name): Fixed the code, it was always returning
19569 references to the first file.
19571 * interface.cs: Register properties defined through interfaces.
19573 * driver.cs: Add support for globbing on the command line
19575 * class.cs (Field): Make it derive from MemberCore as well.
19578 2001-12-15 Ravi Pratap <ravi@ximian.com>
19580 * class.cs (Event::Define): Check that the type of the event is a delegate
19581 type else flag error #66.
19583 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19586 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19587 values of EntryPoint, CharSet etc etc.
19589 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19591 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19592 be null and we should ignore this. I am not sure if this is really clean. Apparently,
19593 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19594 which needs this to do its work.
19596 * ../errors/cs0066.cs : Add.
19598 2001-12-14 Miguel de Icaza <miguel@ximian.com>
19600 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19603 * class.cs: (MethodSignature.MethodSignature): Removed hack that
19604 clears out the parameters field.
19605 (MemberSignatureCompare): Cleanup
19607 (MemberCore): New base class used to share code between MethodCore
19610 (RegisterRequiredImplementations) BindingFlags.Public requires
19611 either BindingFlags.Instace or Static. Use instance here.
19613 (Property): Refactored code to cope better with the full spec.
19615 * parameter.cs (GetParameterInfo): Return an empty array instead
19618 * class.cs (Property): Abstract or extern properties have no bodies.
19620 * parameter.cs (GetParameterInfo): return a zero-sized array.
19622 * class.cs (TypeContainer.MethodModifiersValid): Move all the
19623 method modifier validation to the typecontainer so we can reuse
19624 this on properties.
19626 (MethodCore.ParameterTypes): return an empty sized array of types.
19628 (Property.Define): Test property modifier validity.
19630 Add tests for sealed/override too.
19632 (Method.Emit): abstract or extern methods have no bodies.
19634 2001-12-14 Ravi Pratap <ravi@ximian.com>
19636 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19639 (Method::Define, ::Emit): Modify accordingly.
19641 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19643 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19645 * makefile: Pass in /unsafe.
19647 2001-12-13 Miguel de Icaza <miguel@ximian.com>
19649 * class.cs (MakeKey): Kill routine.
19651 * class.cs (TypeContainer.Define): Correctly define explicit
19652 method implementations (they require the full interface name plus
19655 * typemanager.cs: Deply the PtrHashtable here and stop using the
19656 lame keys. Things work so much better.
19658 This of course broke everyone who depended on `RegisterMethod' to
19659 do the `test for existance' test. This has to be done elsewhere.
19661 * support.cs (PtrHashtable): A hashtable that avoid comparing with
19662 the object stupid Equals method (because, that like fails all over
19663 the place). We still do not use it.
19665 * class.cs (TypeContainer.SetRequiredInterface,
19666 TypeContainer.RequireMethods): Killed these two routines and moved
19667 all the functionality to RegisterRequiredImplementations.
19669 (TypeContainer.RegisterRequiredImplementations): This routine now
19670 registers all the implementations required in an array for the
19671 interfaces and abstract methods. We use an array of structures
19672 which can be computed ahead of time to reduce memory usage and we
19673 also assume that lookups are cheap as most classes will not
19674 implement too many interfaces.
19676 We also avoid creating too many MethodSignatures.
19678 (TypeContainer.IsInterfaceMethod): Update and optionally does not
19679 clear the "pending" bit if we find that there are problems with
19682 (TypeContainer.VerifyPendingMethods): Update to report errors of
19683 methods that look like implementations but are not.
19685 (TypeContainer.Define): Add support for explicit interface method
19688 2001-12-12 Miguel de Icaza <miguel@ximian.com>
19690 * typemanager.cs: Keep track of the parameters here instead of
19691 being a feature of the TypeContainer.
19693 * class.cs: Drop the registration of parameters here, as
19694 InterfaceMethods are also interface declarations.
19696 * delegate.cs: Register methods with the TypeManager not only with
19697 the TypeContainer. This code was buggy.
19699 * interface.cs: Full registation here.
19701 2001-12-11 Miguel de Icaza <miguel@ximian.com>
19703 * expression.cs: Remove reducer for binary expressions, it can not
19706 * const.cs: Put here the code that used to go into constant.cs
19708 * constant.cs: Put here the code for constants, this is a new base
19709 class for Literals.
19711 * literal.cs: Make Literal derive from Constant.
19713 2001-12-09 Miguel de Icaza <miguel@ximian.com>
19715 * statement.cs (Return.Emit): Report error 157 if the user
19716 attempts to return from a finally block.
19718 (Return.Emit): Instead of emitting a return, jump to the end of
19721 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19722 LocalBuilder to store the result of the function. ReturnLabel is
19723 the target where we jump.
19726 2001-12-09 Radek Doulik <rodo@ximian.com>
19728 * cs-parser.jay: remember alias in current namespace
19730 * ecore.cs (SimpleName::DoResolve): use aliases for types or
19733 * class.cs (LookupAlias): lookup alias in my_namespace
19735 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19737 (LookupAlias): lookup alias in this and if needed in parent
19740 2001-12-08 Miguel de Icaza <miguel@ximian.com>
19744 * rootcontext.cs: (ModuleBuilder) Made static, first step into
19745 making things static. I need this to avoid passing the
19746 TypeContainer when calling ParameterType.
19748 * support.cs (InternalParameters.ParameterType): Remove ugly hack
19749 that did string manipulation to compute the type and then call
19750 GetType. Use Parameter.ParameterType instead.
19752 * cs-tokenizer.cs: Consume the suffix for floating values.
19754 * expression.cs (ParameterReference): figure out whether this is a
19755 reference parameter or not. Kill an extra variable by computing
19756 the arg_idx during emission.
19758 * parameter.cs (Parameters.GetParameterInfo): New overloaded
19759 function that returns whether a parameter is an out/ref value or not.
19761 (Parameter.ParameterType): The type of the parameter (base,
19762 without ref/out applied).
19764 (Parameter.Resolve): Perform resolution here.
19765 (Parameter.ExternalType): The full type (with ref/out applied).
19767 * statement.cs (Using.Emit, Using.EmitExpression): Implement
19768 support for expressions on the using statement.
19770 2001-12-07 Miguel de Icaza <miguel@ximian.com>
19772 * statement.cs (Using.EmitLocalVariableDecls): Split the
19773 localvariable handling of the using statement.
19775 (Block.EmitMeta): Keep track of variable count across blocks. We
19776 were reusing slots on separate branches of blocks.
19778 (Try.Emit): Emit the general code block, we were not emitting it.
19780 Check the type of the declaration to be an IDisposable or
19781 something that can be implicity converted to it.
19783 Emit conversions if required.
19785 * ecore.cs (EmptyExpression): New utility class.
19786 (Expression.ImplicitConversionExists): New utility function.
19788 2001-12-06 Miguel de Icaza <miguel@ximian.com>
19790 * statement.cs (Using): Implement.
19792 * expression.cs (LocalVariableReference): Support read only variables.
19794 * statement.cs: Remove the explicit emit for the Leave opcode.
19795 (VariableInfo): Add a readonly field.
19797 2001-12-05 Miguel de Icaza <miguel@ximian.com>
19799 * ecore.cs (ConvCast): new class used to encapsulate the various
19800 explicit integer conversions that works in both checked and
19801 unchecked contexts.
19803 (Expression.ConvertNumericExplicit): Use new ConvCast class to
19804 properly generate the overflow opcodes.
19806 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19808 * statement.cs: The correct type for the EmptyExpression is the
19809 element_type, not the variable type. Ravi pointed this out.
19811 2001-12-04 Ravi Pratap <ravi@ximian.com>
19813 * class.cs (Method::Define): Handle PInvoke methods specially
19814 by using DefinePInvokeMethod instead of the usual one.
19816 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19817 above to do the task of extracting information and defining the method.
19819 2001-12-04 Ravi Pratap <ravi@ximian.com>
19821 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19822 of the condition for string type.
19824 (Emit): Move that here.
19826 (ArrayCreation::CheckIndices): Keep string literals in their expression
19829 (EmitDynamicInitializers): Handle strings appropriately.
19831 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19833 * codegen.cs (EmitContext): Replace multiple variables with a
19834 single pointer to the current Switch statement.
19836 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19839 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19843 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19846 (Foreach.Emit): Foreach on arrays was not setting
19847 up the loop variables (for break/continue).
19849 (GotoCase): Semi-implented.
19851 2001-12-03 Ravi Pratap <ravi@ximian.com>
19853 * attribute.cs (CheckAttribute): Handle system attributes by using
19854 Attribute.GetAttributes to examine information we need.
19856 (GetValidPlaces): Same here.
19858 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19860 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19862 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19864 (Method::Define): Set appropriate flags if we have a DllImport attribute.
19866 (Method::Emit): Handle the case when we are a PInvoke method.
19868 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19870 * expression.cs: Use ResolveWithSimpleName on compound names.
19872 2001-12-02 Ravi Pratap <ravi@ximian.com>
19874 * constant.cs (EmitConstant): Make sure we resolve the associated expression
19875 before trying to reduce it.
19877 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19879 * constant.cs (LookupConstantValue): Implement.
19881 (EmitConstant): Use the above in emitting the constant.
19883 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19884 that are user-defined by doing a LookupConstantValue on them.
19886 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19889 2001-11-29 Miguel de Icaza <miguel@ximian.com>
19891 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19893 (BaseAccess.DoResolve): Implement.
19895 (MemberAccess.DoResolve): Split this routine into a
19896 ResolveMemberAccess routine that can be used independently
19898 2001-11-28 Miguel de Icaza <miguel@ximian.com>
19900 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19901 As that share bits of the implementation. Is returns a boolean,
19902 while As returns the Type that is being probed.
19904 2001-12-01 Ravi Pratap <ravi@ximian.com>
19906 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19907 instead of a Literal - much easier.
19909 (EnumInTransit): Remove - utterly useless :-)
19911 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19913 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19915 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19916 chain when we have no associated expression.
19918 2001-11-30 Ravi Pratap <ravi@ximian.com>
19920 * constant.cs (Define): Use Location while reporting the errror.
19922 Also emit a warning when 'new' is used and there is no inherited
19925 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
19928 (LookupEnumValue): Implement to lookup an enum member's value and define it
19931 (Populate): Re-write accordingly to use the above routine.
19933 2001-11-27 Miguel de Icaza <miguel@ximian.com>
19935 * expression.cs (This): Fix prototype for DoResolveLValue to
19936 override the base class DoResolveLValue.
19938 * cs-parser.cs: Report errors cs574 and cs575 (destructor
19941 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19942 (we need to load the address of the field here). This fixes
19945 (FieldExpr.DoResolveLValue): Call the DoResolve
19946 function to initialize the Instance expression.
19948 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19949 correctly the GetEnumerator operation on a value type.
19951 * cs-parser.jay: Add more simple parsing error catches.
19953 * statement.cs (Switch): Add support for string switches.
19954 Handle null specially.
19956 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
19958 2001-11-28 Ravi Pratap <ravi@ximian.com>
19960 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19962 (declare_local_constant): New helper function.
19964 * statement.cs (AddConstant): Keep a separate record of constants
19966 (IsConstant): Implement to determine if a variable is a constant.
19968 (GetConstantExpression): Implement.
19970 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19972 * statement.cs (IsVariableDefined): Re-write.
19974 2001-11-27 Ravi Pratap <ravi@ximian.com>
19976 * class.cs (TypeContainer::FindMembers): Look for constants
19977 in the case when we are looking for MemberTypes.Field
19979 * expression.cs (MemberAccess::DoResolve): Check that in the
19980 case we are a FieldExpr and a Literal, we are not being accessed
19981 by an instance reference.
19983 * cs-parser.jay (local_constant_declaration): Implement.
19985 (declaration_statement): Implement for constant declarations.
19987 2001-11-26 Miguel de Icaza <miguel@ximian.com>
19989 * statement.cs (Switch): Catch double defaults.
19991 (Switch): More work on the switch() statement
19992 implementation. It works for integral values now, need to finish
19996 2001-11-24 Miguel de Icaza <miguel@ximian.com>
19998 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19999 integer literals into other integer literals. To be used by
20002 2001-11-24 Ravi Pratap <ravi@ximian.com>
20004 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20007 (EmitDynamicInitializers): Cope with the above since we extract data
20008 directly from ArrayData now.
20010 (ExpectInitializers): Keep track of whether initializers are mandatory
20013 (Bounds): Make it a hashtable to prevent the same dimension being
20014 recorded for every element in that dimension.
20016 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20019 Also fix bug which was causing the indices to be emitted in the reverse
20022 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20024 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20025 unfinished. They do not work, because the underlying code is
20028 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20030 * cs-parser.jay: Remove bogus fixme.
20032 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20033 on Switch statement.
20035 2001-11-23 Ravi Pratap <ravi@ximian.com>
20037 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20040 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20041 parameter. Apparently, any expression is allowed.
20043 (ValidateInitializers): Update accordingly.
20045 (CheckIndices): Fix some tricky bugs thanks to recursion.
20047 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
20048 I was being completely brain-dead.
20050 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20051 and re-write acordingly.
20053 (DelegateInvocation): Re-write accordingly.
20055 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20057 (MakeByteBlob): Handle types more correctly.
20059 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20060 initialization from expressions but it is incomplete because I am a complete
20063 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20065 * statement.cs (If.Emit): Fix a bug that generated incorrect code
20066 on If. Basically, we have to return `true' (ie, we do return to
20067 our caller) only if both branches of the if return.
20069 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20070 short-circuit operators, handle them as short circuit operators.
20072 (Cast.DoResolve): Resolve type.
20073 (Cast.Cast): Take an expression as the target type.
20075 * cs-parser.jay (cast_expression): Remove old hack that only
20076 allowed a limited set of types to be handled. Now we take a
20077 unary_expression and we resolve to a type during semantic
20080 Use the grammar productions from Rhys to handle casts (this is
20081 not complete like Rhys syntax yet, we fail to handle that corner
20082 case that C# has regarding (-x), but we will get there.
20084 2001-11-22 Ravi Pratap <ravi@ximian.com>
20086 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20087 field which is an array type.
20089 * cs-parser.jay (declare_local_variables): Support array initialization too.
20091 * typemanager.cs (MakeKey): Implement.
20093 (everywhere): Use the above appropriately.
20095 * cs-parser.jay (for_statement): Update for array initialization while
20096 declaring variables.
20098 * ecore.cs : The error message was correct, it's the variable's names that
20099 were misleading ;-) Make the code more readable.
20101 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20102 the correct type etc.
20104 (ConvertExplicit): Handle Enum types by examining the underlying type.
20106 2001-11-21 Ravi Pratap <ravi@ximian.com>
20108 * parameter.cs (GetCallingConvention): Always return
20109 CallingConventions.Standard for now.
20111 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20113 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20114 and `r' after calling DoNumericPromotions.
20116 * ecore.cs: Fix error message (the types were in the wrong order).
20118 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20119 BindingFlags.Instance as well
20121 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20122 implicit int literal conversion in an empty cast so that we
20123 propagate the right type upstream.
20125 (UnboxCast): new class used to unbox value types.
20126 (Expression.ConvertExplicit): Add explicit type conversions done
20129 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20130 the target type before applying the implicit LongLiterals to ULong
20133 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20135 * cs-parser.jay (for_statement): Reworked the way For works: now
20136 we declare manually any variables that are introduced in
20137 for_initializer to solve the problem of having out-of-band code
20138 emition (that is what got for broken).
20140 (declaration_statement): Perform the actual variable declaration
20141 that used to be done in local_variable_declaration here.
20143 (local_variable_declaration): Do not declare anything, just pass
20144 the information on a DictionaryEntry
20146 2001-11-20 Ravi Pratap <ravi@ximian.com>
20148 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20149 re-write of the logic to now make it recursive.
20151 (UpdateIndices): Re-write accordingly.
20153 Store element data in a separate ArrayData list in the above methods.
20155 (MakeByteBlob): Implement to dump the array data into a byte array.
20157 2001-11-19 Ravi Pratap <ravi@ximian.com>
20159 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20162 * constant.cs (Define): Implement.
20164 (EmitConstant): Re-write fully.
20166 Pass in location info.
20168 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20171 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20172 DictionaryEntry since we need location info too.
20174 (constant_declaration): Update accordingly.
20176 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20177 code into another method : UpdateIndices.
20179 2001-11-18 Ravi Pratap <ravi@ximian.com>
20181 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20182 some type checking etc.
20184 2001-11-17 Ravi Pratap <ravi@ximian.com>
20186 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20187 bits to provide dimension info if the user skips doing that.
20189 Update second constructor to store the rank correctly.
20191 2001-11-16 Ravi Pratap <ravi@ximian.com>
20193 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20194 and try to implement.
20196 * ../errors/cs0150.cs : Add.
20198 * ../errors/cs0178.cs : Add.
20200 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20202 * statement.cs: Implement foreach on multi-dimensional arrays.
20204 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20205 name of the params argument.
20207 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20208 initializing the array.
20210 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20211 we can use this elsewhere.
20213 * statement.cs: Finish implementation of foreach for single
20216 * cs-parser.jay: Use an out-of-band stack to pass information
20217 around, I wonder why I need this.
20219 foreach_block: Make the new foreach_block the current_block.
20221 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20222 function used to return a static Parameters structure. Used for
20223 empty parameters, as those are created very frequently.
20225 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20227 2001-11-15 Ravi Pratap <ravi@ximian.com>
20229 * interface.cs : Default modifier is private, not public. The
20230 make verify test passes again.
20232 2001-11-15 Ravi Pratap <ravi@ximian.com>
20234 * support.cs (ReflectionParameters): Fix logic to determine
20235 whether the last parameter is a params one. Test 9 passes again.
20237 * delegate.cs (Populate): Register the builders we define with
20238 RegisterParameterForBuilder. Test 19 passes again.
20240 * cs-parser.jay (property_declaration): Reference $6 instead
20241 of $$ to get at the location.
20243 (indexer_declaration): Similar stuff.
20245 (attribute): Ditto.
20247 * class.cs (Property): Register parameters for the Get and Set methods
20248 if they exist. Test 23 passes again.
20250 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20251 call to EmitArguments as we are sure there aren't any params arguments.
20252 Test 32 passes again.
20254 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20255 IndexOutOfRangeException.
20257 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20258 Test 33 now passes again.
20260 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20262 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20263 broke a bunch of things. Will have to come up with a better way
20264 of tracking locations.
20266 * statement.cs: Implemented foreach for single dimension arrays.
20268 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20270 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20271 an error. This removes the lookup from the critical path.
20273 * cs-parser.jay: Removed use of temporary_loc, which is completely
20276 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20278 * support.cs (ReflectionParameters.ParameterModifier): Report
20279 whether the argument is a PARAMS argument or not.
20281 * class.cs: Set the attribute `ParamArrayAttribute' on the
20282 parameter argument.
20284 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20285 and cons_param_array_attribute (ConstructorInfo for
20286 ParamArrayAttribute).,
20288 * codegen.cs: Emit the return using the `Return' statement, that
20289 way we can report the error correctly for missing return values.
20291 * class.cs (Method.Emit): Clean up.
20293 * expression.cs (Argument.Resolve): Take another argument: the
20294 location where this argument is used. Notice that this is not
20295 part of the "Argument" class as to reduce the size of the
20296 structure (we know the approximate location anyways).
20298 Test if the argument is a variable-reference, if not, then
20299 complain with a 206.
20301 (Argument.Emit): Emit addresses of variables.
20303 (Argument.FullDesc): Simplify.
20305 (Invocation.DoResolve): Update for Argument.Resolve.
20307 (ElementAccess.DoResolve): ditto.
20309 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20310 method should be virtual, as this method is always virtual.
20312 (NewDelegate.DoResolve): Update for Argument.Resolve.
20314 * class.cs (ConstructorInitializer.DoResolve): ditto.
20316 * attribute.cs (Attribute.Resolve): ditto.
20318 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20320 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20322 * expression.cs (ParameterReference): Drop IStackStorage and implement
20323 IAssignMethod instead.
20325 (LocalVariableReference): ditto.
20327 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20328 IAssignMethod instead.
20330 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20332 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20333 enumerations that are used in heavily used structures derive from
20334 byte in a laughable and pathetic attempt to reduce memory usage.
20335 This is the kind of pre-optimzations that you should not do at
20336 home without adult supervision.
20338 * expression.cs (UnaryMutator): New class, used to handle ++ and
20339 -- separatedly from the other unary operators. Cleans up the
20340 code, and kills the ExpressionStatement dependency in Unary.
20342 (Unary): Removed `method' and `Arguments' from this class, making
20343 it smaller, and moving it all to SimpleCall, so I can reuse this
20344 code in other locations and avoid creating a lot of transient data
20345 strucutres when not required.
20347 * cs-parser.jay: Adjust for new changes.
20349 2001-11-11 Miguel de Icaza <miguel@ximian.com>
20351 * enum.cs (Enum.Populate): If there is a failure during
20354 * cs-parser.jay (opt_enum_base): we used to catch type errors
20355 here, but this is really incorrect. The type error should be
20356 catched during semantic analysis.
20358 2001-12-11 Ravi Pratap <ravi@ximian.com>
20360 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20361 current_local_parameters as expected since I, in my stupidity, had forgotten
20364 * attribute.cs (GetValidPlaces): Fix stupid bug.
20366 * class.cs (Method::Emit): Perform check on applicability of attributes.
20368 (Constructor::Emit): Ditto.
20370 (Field::Emit): Ditto.
20372 (Field.Location): Store location information.
20374 (Property, Event, Indexer, Operator): Ditto.
20376 * cs-parser.jay (field_declaration): Pass in location for each field.
20378 * ../errors/cs0592.cs : Add.
20380 2001-11-12 Ravi Pratap <ravi@ximian.com>
20382 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20384 (InitCoreTypes): Update accordingly.
20386 (RegisterAttrType, LookupAttr): Implement.
20388 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20389 info about the same.
20391 (Resolve): Update to populate the above as necessary.
20393 (Error592): Helper.
20395 (GetValidPlaces): Helper to the above.
20397 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20399 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20401 2001-11-12 Ravi Pratap <ravi@ximian.com>
20403 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20405 * ../errors/cs0617.cs : Add.
20407 2001-11-11 Ravi Pratap <ravi@ximian.com>
20409 * enum.cs (Emit): Rename to Populate to be more consistent with what
20410 we expect it to do and when exactly it is called.
20412 * class.cs, rootcontext.cs : Update accordingly.
20414 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20415 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20417 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20419 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20420 of a fieldinfo using the above, when dealing with a FieldBuilder.
20422 2001-11-10 Ravi Pratap <ravi@ximian.com>
20424 * ../errors/cs0031.cs : Add.
20426 * ../errors/cs1008.cs : Add.
20428 * ../errrors/cs0543.cs : Add.
20430 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20433 (FindMembers): Implement.
20435 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20436 enums and delegates too.
20438 (enum_types): Rename to builder_to_enum.
20440 (delegate_types): Rename to builder_to_delegate.
20442 * delegate.cs (FindMembers): Implement.
20444 2001-11-09 Ravi Pratap <ravi@ximian.com>
20446 * typemanager.cs (IsEnumType): Implement.
20448 * enum.cs (Emit): Re-write parts to account for the underlying type
20449 better and perform checking etc.
20451 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20452 of the underlying type.
20454 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20457 * enum.cs (error31): Helper to report error #31.
20459 * cs-parser.jay (enum_declaration): Store location of each member too.
20461 * enum.cs (member_to_location): New hashtable.
20463 (AddEnumMember): Update location hashtable.
20465 (Emit): Use the location of each member while reporting errors.
20467 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20469 * cs-parser.jay: A for_initializer if is a
20470 local_variable_declaration really ammount to have an implicit
20471 block with the variable declaration and no initializer for for.
20473 * statement.cs (For.Emit): Cope with null initializers.
20475 This fixes the infinite loop on for initializers.
20477 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20479 * enum.cs: More cleanup.
20481 * ecore.cs: Remove dead code.
20483 * class.cs (Property.Emit): More simplification.
20484 (Event.Emit): ditto.
20486 Reworked to have less levels of indentation.
20488 2001-11-08 Ravi Pratap <ravi@ximian.com>
20490 * class.cs (Property): Emit attributes.
20500 * enum.cs (Emit): Ditto.
20502 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20505 * class.cs (Field, Event, etc.): Move attribute generation into the
20506 Emit method everywhere.
20508 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20509 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20510 as we had no way of defining nested enums !
20512 * rootcontext.cs : Adjust code accordingly.
20514 * typemanager.cs (AddEnumType): To keep track of enum types separately.
20516 2001-11-07 Ravi Pratap <ravi@ximian.com>
20518 * expression.cs (EvalConstantExpression): Move into ecore.cs
20520 * enum.cs (Enum): Rename some members and make them public and readonly
20521 according to our convention.
20523 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20526 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20528 (Enum::Emit): Write a simple version for now which doesn't try to compute
20529 expressions. I shall modify this to be more robust in just a while.
20531 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20533 (TypeContainer::CloseType): Create the Enum types too.
20535 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20537 * expression.cs (EvalConstantExpression): Get rid of completely.
20539 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20540 user-defined values and other cases.
20542 (IsValidEnumLiteral): Helper function.
20544 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
20545 out there in the case we had a literal FieldExpr.
20547 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20549 (Literalize): Revamp a bit to take two arguments.
20551 (EnumLiteral): New class which derives from Literal to wrap enum literals.
20553 2001-11-06 Ravi Pratap <ravi@ximian.com>
20555 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20557 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20559 (Resolve): Use the above to ensure we have proper initializers.
20561 2001-11-05 Ravi Pratap <ravi@ximian.com>
20563 * expression.cs (Expression::EvalConstantExpression): New method to
20564 evaluate constant expressions.
20566 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20568 2001-11-07 Miguel de Icaza <miguel@ximian.com>
20570 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20573 (Binary.ResolveOperator): Handle operator != (object a, object b)
20574 and operator == (object a, object b);
20576 (Binary.DoNumericPromotions): Indicate whether the numeric
20577 promotion was possible.
20579 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20582 Made the ArrayAccess implement interface IAssignMethod instead of
20583 IStackStore as the order in which arguments are passed reflects
20586 * assign.cs: Instead of using expr.ExprClass to select the way of
20587 assinging, probe for the IStackStore/IAssignMethod interfaces.
20589 * typemanager.cs: Load InitializeArray definition.
20591 * rootcontext.cs (RootContext.MakeStaticData): Used to define
20592 static data that can be used to initialize arrays.
20594 2001-11-05 Miguel de Icaza <miguel@ximian.com>
20596 * expression.cs: Handle operator== and operator!= for booleans.
20598 (Conditioal.Reduce): Implement reducer for the ?: operator.
20600 (Conditional.Resolve): Implement dead code elimination.
20602 (Binary.Resolve): Catch string literals and return a new
20603 concatenated string.
20605 (Unary.Reduce): Implement reduction of unary expressions.
20607 * ecore.cs: Split out the expression core handling here.
20609 (Expression.Reduce): New method used to perform constant folding
20610 and CSE. This is needed to support constant-expressions.
20612 * statement.cs (Statement.EmitBoolExpression): Pass true and false
20613 targets, and optimize for !x.
20615 2001-11-04 Ravi Pratap <ravi@ximian.com>
20617 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20618 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20619 set custom atttributes.
20621 * literal.cs (Literal::GetValue): New abstract method to return the actual
20622 value of the literal, cast as an object.
20624 (*Literal): Implement GetValue method.
20626 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20627 expressions to the arraylist but objects of type Argument.
20629 * class.cs (TypeContainer::Emit): Emit our attributes too.
20631 (Method::Emit, Constructor::Emit): Ditto.
20633 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20634 to be ignoring earlier.
20636 2001-11-03 Ravi Pratap <ravi@ximian.com>
20638 * attribute.cs (AttributeSection::Define): Implement to do the business
20639 of constructing a CustomAttributeBuilder.
20641 (Attribute): New trivial class. Increases readability of code.
20643 * cs-parser.jay : Update accordingly.
20645 (positional_argument_list, named_argument_list, named_argument): New rules
20647 (attribute_arguments): Use the above so that we are more correct.
20649 2001-11-02 Ravi Pratap <ravi@ximian.com>
20651 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20652 to perform all checks for a method with a params parameter.
20654 (Invocation::OverloadResolve): Update to use the above method and therefore
20655 cope correctly with params method invocations.
20657 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
20660 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20661 constructors in our parent too because we can't afford to miss out on
20664 * attribute.cs (AttributeSection): New name for the class Attribute
20666 Other trivial changes to improve readability.
20668 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20669 use the new class names.
20671 2001-11-01 Ravi Pratap <ravi@ximian.com>
20673 * class.cs (Method::Define): Complete definition for params types too
20675 (Indexer::Define): Ditto.
20677 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20678 Cope everywhere with a request for info about the array parameter.
20680 2001-11-01 Ravi Pratap <ravi@ximian.com>
20682 * tree.cs (RecordNamespace): Fix up to check for the correct key.
20684 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
20685 local_variable_type to extract the string corresponding to the type.
20687 (local_variable_type): Fixup the action to use the new helper method.
20689 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
20692 * expression.cs : Clean out code which uses the above.
20694 2001-10-31 Ravi Pratap <ravi@ximian.com>
20696 * typemanager.cs (RegisterMethod): Check if we already have an existing key
20697 and bale out if necessary by returning a false.
20699 (RegisterProperty): Ditto.
20701 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20702 and print out appropriate error messages.
20704 * interface.cs (everywhere): Ditto.
20706 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20707 location to constructor.
20709 * class.cs (Property, Event, Indexer): Update accordingly.
20711 * ../errors/cs111.cs : Added.
20713 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20714 of a method, as laid down by the spec.
20716 (Invocation::OverloadResolve): Use the above method.
20718 2001-10-31 Ravi Pratap <ravi@ximian.com>
20720 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20721 now take a TypeContainer and a Parameters object.
20723 (ParameterData): Modify return type of ParameterModifier method to be
20724 Parameter.Modifier and not a string.
20726 (ReflectionParameters, InternalParameters): Update accordingly.
20728 * expression.cs (Argument::GetParameterModifier): Same here.
20730 * support.cs (InternalParameters::ParameterType): Find a better way of determining
20731 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20732 symbol in it at all so maybe this is only for now.
20734 2001-10-30 Ravi Pratap <ravi@ximian.com>
20736 * support.cs (InternalParameters): Constructor now takes an extra argument
20737 which is the actual Parameters class.
20739 (ParameterDesc): Update to provide info on ref/out modifiers.
20741 * class.cs (everywhere): Update call to InternalParameters to pass in
20742 the second argument too.
20744 * support.cs (ParameterData): Add ParameterModifier, which is a method
20745 to return the modifier info [ref/out etc]
20747 (InternalParameters, ReflectionParameters): Implement the above.
20749 * expression.cs (Argument::ParameterModifier): Similar function to return
20750 info about the argument's modifiers.
20752 (Invocation::OverloadResolve): Update to take into account matching modifiers
20755 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20756 a new SetFormalParameters object which we pass to InternalParameters.
20758 2001-10-30 Ravi Pratap <ravi@ximian.com>
20760 * expression.cs (NewArray): Merge into the ArrayCreation class.
20762 2001-10-29 Ravi Pratap <ravi@ximian.com>
20764 * expression.cs (NewArray): Merge classes NewBuiltinArray and
20765 NewUserdefinedArray into one as there wasn't much of a use in having
20768 * expression.cs (Argument): Change field's name to ArgType from Type.
20770 (Type): New readonly property which returns the proper type, taking into
20771 account ref/out modifiers.
20773 (everywhere): Adjust code accordingly for the above.
20775 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20776 whether we are emitting for a ref or out parameter.
20778 * expression.cs (Argument::Emit): Use the above field to set the state.
20780 (LocalVariableReference::Emit): Update to honour the flag and emit the
20783 * parameter.cs (Attributes): Set the correct flags for ref parameters.
20785 * expression.cs (Argument::FullDesc): New function to provide a full desc.
20787 * support.cs (ParameterData): Add method ParameterDesc to the interface.
20789 (ReflectionParameters, InternalParameters): Implement the above method.
20791 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20794 (Invocation::FullMethodDesc): Ditto.
20796 2001-10-29 Miguel de Icaza <miguel@ximian.com>
20798 * cs-parser.jay: Add extra production for the second form of array
20801 * expression.cs (ArrayCreation): Update to reflect the above
20804 * Small changes to prepare for Array initialization.
20806 2001-10-28 Miguel de Icaza <miguel@ximian.com>
20808 * typemanager.cs (ImplementsInterface): interface might be null;
20809 Deal with this problem;
20811 Also, we do store negative hits on the cache (null values), so use
20812 this instead of calling t.GetInterfaces on the type everytime.
20814 2001-10-28 Ravi Pratap <ravi@ximian.com>
20816 * typemanager.cs (IsBuiltinType): New method to help determine the same.
20818 * expression.cs (New::DoResolve): Get rid of array creation code and instead
20819 split functionality out into different classes.
20821 (New::FormArrayType): Move into NewBuiltinArray.
20823 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20826 (NewBuiltinArray): New class to handle creation of built-in arrays.
20828 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20829 account creation of one-dimensional arrays.
20831 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20833 (NewUserdefinedArray::DoResolve): Implement.
20835 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20837 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20838 we maintain inside the TypeManager. This is necessary to perform lookups on the
20841 (LookupType): Update to perform GetType on the module builders too.
20843 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20845 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20847 2001-10-23 Ravi Pratap <ravi@ximian.com>
20849 * expression.cs (New::DoResolve): Implement guts of array creation.
20851 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20853 2001-10-27 Miguel de Icaza <miguel@ximian.com>
20855 * expression.cs: Fix bug I introduced lsat night that broke
20858 (Expression.Resolve): Report a 246 error (can not resolve name)
20859 if we find a SimpleName in the stream.
20861 (Expression.ResolveLValue): Ditto.
20863 (Expression.ResolveWithSimpleName): This function is a variant of
20864 ResolveName, this one allows SimpleNames to be returned without a
20865 warning. The only consumer of SimpleNames is MemberAccess
20867 2001-10-26 Miguel de Icaza <miguel@ximian.com>
20869 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20870 might arrive here. I have my doubts that this is correct.
20872 * statement.cs (Lock): Implement lock statement.
20874 * cs-parser.jay: Small fixes to support `lock' and `using'
20876 * cs-tokenizer.cs: Remove extra space
20878 * driver.cs: New flag --checked, allows to turn on integer math
20881 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20882 Threading.Monitor.Exit
20884 2001-10-23 Miguel de Icaza <miguel@ximian.com>
20886 * expression.cs (IndexerAccess::DoResolveLValue): Set the
20887 Expression Class to be IndexerAccess.
20889 Notice that Indexer::DoResolve sets the eclass to Value.
20891 2001-10-22 Miguel de Icaza <miguel@ximian.com>
20893 * class.cs (TypeContainer::Emit): Emit code for indexers.
20895 * assign.cs (IAssignMethod): New interface implemented by Indexers
20896 and Properties for handling assignment.
20898 (Assign::Emit): Simplify and reuse code.
20900 * expression.cs (IndexerAccess, PropertyExpr): Implement
20901 IAssignMethod, clean up old code.
20903 2001-10-22 Ravi Pratap <ravi@ximian.com>
20905 * typemanager.cs (ImplementsInterface): New method to determine if a type
20906 implements a given interface. Provides a nice cache too.
20908 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20911 (ConvertReferenceExplicit): Ditto.
20913 * delegate.cs (Delegate::Populate): Update to define the parameters on the
20914 various methods, with correct names etc.
20916 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
20917 Operator.UnaryNegation.
20919 * cs-parser.jay (operator_declarator): Be a little clever in the case where
20920 we have a unary plus or minus operator.
20922 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
20925 * everywhere : update accordingly.
20927 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20930 * class.cs (Method::Define): For the case where we are implementing a method
20931 inherited from an interface, we need to set the MethodAttributes.Final flag too.
20932 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20934 2001-10-21 Ravi Pratap <ravi@ximian.com>
20936 * interface.cs (FindMembers): Implement to work around S.R.E
20939 * typemanager.cs (IsInterfaceType): Implement.
20941 (FindMembers): Update to handle interface types too.
20943 * expression.cs (ImplicitReferenceConversion): Re-write bits which
20944 use IsAssignableFrom as that is not correct - it doesn't work.
20946 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20947 and accordingly override EmitStatement.
20949 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20950 using the correct logic :-)
20952 2001-10-19 Ravi Pratap <ravi@ximian.com>
20954 * ../errors/cs-11.cs : Add to demonstrate error -11
20956 2001-10-17 Miguel de Icaza <miguel@ximian.com>
20958 * assign.cs (Assign::Resolve): Resolve right hand side first, and
20959 then pass this as a hint to ResolveLValue.
20961 * expression.cs (FieldExpr): Add Location information
20963 (FieldExpr::LValueResolve): Report assignment to readonly
20966 (Expression::ExprClassFromMemberInfo): Pass location information.
20968 (Expression::ResolveLValue): Add new method that resolves an
20971 (Expression::DoResolveLValue): Default invocation calls
20974 (Indexers): New class used to keep track of indexers in a given
20977 (IStackStore): Renamed from LValue, as it did not really describe
20978 what this did. Also ResolveLValue is gone from this interface and
20979 now is part of Expression.
20981 (ElementAccess): Depending on the element access type
20983 * typemanager.cs: Add `indexer_name_type' as a Core type
20984 (System.Runtime.CompilerServices.IndexerNameAttribute)
20986 * statement.cs (Goto): Take a location.
20988 2001-10-18 Ravi Pratap <ravi@ximian.com>
20990 * delegate.cs (Delegate::VerifyDelegate): New method to verify
20991 if two delegates are compatible.
20993 (NewDelegate::DoResolve): Update to take care of the case when
20994 we instantiate a delegate from another delegate.
20996 * typemanager.cs (FindMembers): Don't even try to look up members
20997 of Delegate types for now.
20999 2001-10-18 Ravi Pratap <ravi@ximian.com>
21001 * delegate.cs (NewDelegate): New class to take care of delegate
21004 * expression.cs (New): Split the delegate related code out into
21005 the NewDelegate class.
21007 * delegate.cs (DelegateInvocation): New class to handle delegate
21010 * expression.cs (Invocation): Split out delegate related code into
21011 the DelegateInvocation class.
21013 2001-10-17 Ravi Pratap <ravi@ximian.com>
21015 * expression.cs (New::DoResolve): Implement delegate creation fully
21016 and according to the spec.
21018 (New::DoEmit): Update to handle delegates differently.
21020 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21021 because of which we were printing out arguments in reverse order !
21023 * delegate.cs (VerifyMethod): Implement to check if the given method
21024 matches the delegate.
21026 (FullDelegateDesc): Implement.
21028 (VerifyApplicability): Implement.
21030 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21031 delegate invocations too.
21033 (Invocation::Emit): Ditto.
21035 * ../errors/cs1593.cs : Added.
21037 * ../errors/cs1594.cs : Added.
21039 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21041 2001-10-16 Ravi Pratap <ravi@ximian.com>
21043 * typemanager.cs (intptr_type): Core type for System.IntPtr
21045 (InitCoreTypes): Update for the same.
21047 (iasyncresult_type, asynccallback_type): Ditto.
21049 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21052 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21055 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21056 the builders for the 4 members of a delegate type :-)
21058 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21061 * expression.cs (New::DoResolve): Implement guts for delegate creation.
21063 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21065 2001-10-15 Miguel de Icaza <miguel@ximian.com>
21067 * statement.cs (Break::Emit): Implement.
21068 (Continue::Emit): Implement.
21070 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
21071 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
21072 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
21073 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
21076 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21077 properties that track the label for the current loop (begin of the
21078 loop and end of the loop).
21080 2001-10-15 Ravi Pratap <ravi@ximian.com>
21082 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21083 use of emitting anything at all.
21085 * class.cs, rootcontext.cs : Get rid of calls to the same.
21087 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21089 (Populate): Define the constructor correctly and set the implementation
21092 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21095 (AddDelegateType): Implement.
21097 (IsDelegateType): Implement helper method.
21099 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21101 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21102 and accordingly handle it.
21104 * delegate.cs (Populate): Take TypeContainer argument.
21105 Implement bits to define the Invoke method. However, I still haven't figured out
21106 how to take care of the native int bit :-(
21108 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21109 Qualify the name of the delegate, not its return type !
21111 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21114 (StandardConversionExists): Checking for array types turns out to be recursive.
21116 (ConvertReferenceExplicit): Implement array conversion.
21118 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21120 2001-10-12 Ravi Pratap <ravi@ximian.com>
21122 * cs-parser.jay (delegate_declaration): Store the fully qualified
21123 name as it is a type declaration.
21125 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21128 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21129 as TypeContainer::DefineType.
21131 (Populate): Method in which all the definition of the various methods (Invoke)
21134 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21137 (CloseDelegate): Finally creates the delegate.
21139 * class.cs (TypeContainer::DefineType): Update to define delegates.
21140 (Populate, Emit and CloseType): Do the same thing here too.
21142 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21143 delegates in all these operations.
21145 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21147 * expression.cs: LocalTemporary: a new expression used to
21148 reference a temporary that has been created.
21150 * assign.cs: Handle PropertyAccess back here, so that we can
21151 provide the proper semantic access to properties.
21153 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21154 a few more explicit conversions.
21156 * modifiers.cs: `NEW' modifier maps to HideBySig.
21158 * expression.cs (PropertyExpr): Make this into an
21159 ExpressionStatement, and support the EmitStatement code path.
21161 Perform get/set error checking, clean up the interface.
21163 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21164 them into toplevel access objects.
21166 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21168 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21171 * typemanager.cs: Keep track here of our PropertyBuilders again to
21172 work around lameness in SRE.
21174 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21176 * expression.cs (LValue::LValueResolve): New method in the
21177 interface, used to perform a second resolution pass for LValues.
21179 (This::DoResolve): Catch the use of this in static methods.
21181 (This::LValueResolve): Implement.
21183 (This::Store): Remove warning, assigning to `this' in structures
21186 (Invocation::Emit): Deal with invocation of
21187 methods on value types. We need to pass the address to structure
21188 methods rather than the object itself. (The equivalent code to
21189 emit "this" for structures leaves the entire structure on the
21190 stack instead of a pointer to it).
21192 (ParameterReference::DoResolve): Compute the real index for the
21193 argument based on whether the method takes or not a `this' pointer
21194 (ie, the method is static).
21196 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21197 value types returned from functions when we need to invoke a
21198 method on the sturcture.
21201 2001-10-11 Ravi Pratap <ravi@ximian.com>
21203 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21204 defining the type in the Modulebuilder or Typebuilder. This is to take
21205 care of nested types which need to be defined on the TypeBuilder using
21206 DefineNestedMethod.
21208 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21209 methods in RootContext, only ported to be part of TypeContainer.
21211 (TypeContainer::GetInterfaceOrClass): Ditto.
21213 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21215 * interface.cs (Interface::DefineInterface): New method. Does exactly
21216 what RootContext.CreateInterface did earlier, only it takes care of nested types
21219 (Interface::GetInterfaces): Move from RootContext here and port.
21221 (Interface::GetInterfaceByName): Same here.
21223 * rootcontext.cs (ResolveTree): Re-write.
21225 (PopulateTypes): Re-write.
21227 * class.cs (TypeContainer::Populate): Populate nested types too.
21228 (TypeContainer::Emit): Emit nested members too.
21230 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21231 instead just use the name argument passed in as it is already fully
21234 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21235 to TypeContainer mapping to see if a type is user-defined.
21237 * class.cs (TypeContainer::CloseType): Implement.
21239 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21240 the default constructor.
21242 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21245 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21247 * interface.cs (CloseType): Create the type here.
21249 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21252 Remove all the methods which are now in TypeContainer.
21254 2001-10-10 Ravi Pratap <ravi@ximian.com>
21256 * delegate.cs (Define): Re-write bits to define the delegate
21259 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21261 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21263 * expression.cs (ImplicitReferenceConversion): handle null as well
21264 as a source to convert to any reference type.
21266 * statement.cs (Return): Perform any implicit conversions to
21267 expected return type.
21269 Validate use of return statement.
21271 * codegen.cs (EmitContext): Pass the expected return type here.
21273 * class.cs (Method, Constructor, Property): Pass expected return
21274 type to EmitContext.
21276 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21278 * expression.cs: Make DoResolve take an EmitContext instead of a
21281 Replaced `l' and `location' for `loc', for consistency.
21283 (Error, Warning): Remove unneeded Tc argument.
21285 * assign.cs, literal.cs, constant.cs: Update to new calling
21288 * codegen.cs: EmitContext now contains a flag indicating whether
21289 code is being generated in a static method or not.
21291 * cs-parser.jay: DecomposeQI, new function that replaces the old
21292 QualifiedIdentifier. Now we always decompose the assembled
21293 strings from qualified_identifier productions into a group of
21296 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21298 * rootcontext.cs: Deal with field-less struct types correctly now
21299 by passing the size option to Define Type.
21301 * class.cs: Removed hack that created one static field.
21303 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21305 * statement.cs: Moved most of the code generation here.
21307 2001-10-09 Ravi Pratap <ravi@ximian.com>
21309 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21312 (ElementAccess): Remove useless bits for now - keep checks as the spec
21315 2001-10-08 Ravi Pratap <ravi@ximian.com>
21317 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21318 and start performing checks according to the spec.
21320 2001-10-07 Ravi Pratap <ravi@ximian.com>
21322 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21323 rank_specifiers instead.
21325 (rank_specifiers): Change the order in which the rank specifiers are stored
21327 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21329 * expression.cs (ElementAccess): Implement the LValue interface too.
21331 2001-10-06 Ravi Pratap <ravi@ximian.com>
21333 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21334 except that user defined conversions are not included.
21336 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
21337 perform the conversion of the return type, if necessary.
21339 (New::DoResolve): Check whether we are creating an array or an object
21340 and accordingly do the needful.
21342 (New::Emit): Same here.
21344 (New::DoResolve): Implement guts of array creation.
21346 (New::FormLookupType): Helper function.
21348 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21350 * codegen.cs: Removed most of the code generation here, and move the
21351 corresponding code generation bits to the statement classes.
21353 Added support for try/catch/finalize and throw.
21355 * cs-parser.jay: Added support for try/catch/finalize.
21357 * class.cs: Catch static methods having the flags override,
21358 virtual or abstract.
21360 * expression.cs (UserCast): This user cast was not really doing
21361 what it was supposed to do. Which is to be born in fully resolved
21362 state. Parts of the resolution were being performed at Emit time!
21366 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21368 * expression.cs: Implicity convert the result from UserCast.
21370 2001-10-05 Ravi Pratap <ravi@ximian.com>
21372 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21373 prevented it from working correctly.
21375 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21376 merely ConvertImplicit.
21378 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21380 * typemanager.cs: Make the LookupTypeContainer function static,
21381 and not per-instance.
21383 * class.cs: Make static FindMembers (the one that takes a Type
21386 * codegen.cs: Add EmitForeach here.
21388 * cs-parser.jay: Make foreach a toplevel object instead of the
21389 inline expansion, as we need to perform semantic analysis on it.
21391 2001-10-05 Ravi Pratap <ravi@ximian.com>
21393 * expression.cs (Expression::ImplicitUserConversion): Rename to
21394 UserDefinedConversion.
21396 (Expression::UserDefinedConversion): Take an extra argument specifying
21397 whether we look for explicit user conversions too.
21399 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21401 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21403 (ExplicitUserConversion): Make it a call to UserDefinedConversion
21404 with the appropriate arguments.
21406 * cs-parser.jay (cast_expression): Record location too.
21408 * expression.cs (Cast): Record location info.
21410 (Expression::ConvertExplicit): Take location argument.
21412 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21413 to determine if we are doing explicit conversions.
21415 (UserCast::Emit): Update accordingly.
21417 (Expression::ConvertExplicit): Report an error if everything fails.
21419 * ../errors/cs0030.cs : Add.
21421 2001-10-04 Miguel de Icaza <miguel@ximian.com>
21423 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21424 virtual and newslot bits.
21426 * class.cs (TypeContainer::RegisterRequiredImplementations):
21427 Record methods we need.
21429 (TypeContainer::MakeKey): Helper function to make keys for
21430 MethodBases, since the Methodbase key is useless.
21432 (TypeContainer::Populate): Call RegisterRequiredImplementations
21433 before defining the methods.
21435 Create a mapping for method_builders_to_methods ahead of time
21436 instead of inside a tight loop.
21438 (::RequireMethods): Accept an object as the data to set into the
21439 hashtable so we can report interface vs abstract method mismatch.
21441 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21443 * report.cs: Make all of it static.
21445 * rootcontext.cs: Drop object_type and value_type computations, as
21446 we have those in the TypeManager anyways.
21448 Drop report instance variable too, now it is a global.
21450 * driver.cs: Use try/catch on command line handling.
21452 Add --probe option to debug the error reporting system with a test
21455 * report.cs: Add support for exiting program when a probe
21456 condition is reached.
21458 2001-10-03 Ravi Pratap <ravi@ximian.com>
21460 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21461 we do a forcible conversion regardless of type, to check if
21462 ForceConversion returns a null.
21464 (Binary::error19): Use location to report error.
21466 (Unary::error23): Use location here too.
21468 * ../errors/cs0019.cs : Check in.
21470 * ../errors/cs0023.cs : Check in.
21472 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21473 case of a non-null MethodInfo object with a length of 0 !
21475 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21476 an applicable member - according to the spec :-)
21477 Also fix logic to find members in base types.
21479 (Unary::ResolveOperator): Same here.
21481 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21482 as I was getting thoroughly confused between this and error19 :-)
21484 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21485 (::FindMostEncompassedType): Implement.
21486 (::FindMostEncompassingType): Implement.
21487 (::StandardConversionExists): Implement.
21489 (UserImplicitCast): Re-vamp. We now need info about most specific
21490 source and target types so that we can do the necessary conversions.
21492 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21493 mathematical union with no duplicates.
21495 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21497 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21498 in order from base classes to child classes, so that we can in
21499 child classes look up in our parent for method names and
21500 attributes (required for handling abstract, virtual, new, override
21501 constructs: we need to instrospect our base class, and if we dont
21502 populate the classes in order, the introspection might be
21503 incorrect. For example, a method could query its parent before
21504 the parent has any methods and would determine that the parent has
21505 no abstract methods (while it could have had them)).
21507 (RootContext::CreateType): Record the order in which we define the
21510 2001-10-02 Miguel de Icaza <miguel@ximian.com>
21512 * class.cs (TypeContainer::Populate): Also method definitions can
21513 fail now, keep track of this.
21515 (TypeContainer::FindMembers): Implement support for
21516 DeclaredOnly/noDeclaredOnly flag.
21518 (Constructor::Emit) Return the ConstructorBuilder.
21520 (Method::Emit) Return the MethodBuilder.
21521 Check for abstract or virtual methods to be public.
21523 * rootcontext.cs (RootContext::CreateType): Register all the
21524 abstract methods required for the class to be complete and the
21525 interface methods that must be implemented.
21527 * cs-parser.jay: Report error 501 (method requires body if it is
21528 not marked abstract or extern).
21530 * expression.cs (TypeOf::Emit): Implement.
21532 * typemanager.cs: runtime_handle_type, new global type.
21534 * class.cs (Property::Emit): Generate code for properties.
21536 2001-10-02 Ravi Pratap <ravi@ximian.com>
21538 * expression.cs (Unary::ResolveOperator): Find operators on base type
21539 too - we now conform exactly to the spec.
21541 (Binary::ResolveOperator): Same here.
21543 * class.cs (Operator::Define): Fix minor quirk in the tests.
21545 * ../errors/cs0215.cs : Added.
21547 * ../errors/cs0556.cs : Added.
21549 * ../errors/cs0555.cs : Added.
21551 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21553 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21554 single integer which is really efficient
21556 2001-10-01 Ravi Pratap <ravi@ximian.com>
21558 * expression.cs (Expression::ImplicitUserConversion): Use location
21559 even in the case when we are examining True operators.
21561 * class.cs (Operator::Define): Perform extensive checks to conform
21562 with the rules for operator overloading in the spec.
21564 * expression.cs (Expression::ImplicitReferenceConversion): Implement
21565 some of the other conversions mentioned in the spec.
21567 * typemanager.cs (array_type): New static member for the System.Array built-in
21570 (cloneable_interface): For System.ICloneable interface.
21572 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21573 we start resolving the tree and populating types.
21575 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21577 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21579 * expression.cs (Expression::ExprClassFromMemberInfo,
21580 Expression::Literalize): Create literal expressions from
21581 FieldInfos which are literals.
21583 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21584 type casts, because they were wrong. The test suite in tests
21587 (ImplicitNumericConversion): ushort to ulong requires a widening
21590 Int32 constant to long requires widening cast as well.
21592 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21593 for integers because the type on the stack is not i4.
21595 2001-09-30 Miguel de Icaza <miguel@ximian.com>
21597 * expression.cs (report118): require location argument.
21599 * parameter.cs: Do not dereference potential null value.
21601 * class.cs: Catch methods that lack the `new' keyword when
21602 overriding a name. Report warnings when `new' is used without
21603 anything being there to override.
21605 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21607 * class.cs: Only add constructor to hashtable if it is non-null
21608 (as now constructors can fail on define).
21610 (TypeManager, Class, Struct): Take location arguments.
21612 Catch field instance initialization in structs as errors.
21614 accepting_filter: a new filter for FindMembers that is static so
21615 that we dont create an instance per invocation.
21617 (Constructor::Define): Catch errors where a struct constructor is
21620 * cs-parser.jay: Pass location information for various new
21623 * delegate.cs (Delegate): take a location argument.
21625 * driver.cs: Do not call EmitCode if there were problesm in the
21626 Definition of the types, as many Builders wont be there.
21628 * decl.cs (Decl::Decl): Require a location argument.
21630 * cs-tokenizer.cs: Handle properly hex constants that can not fit
21631 into integers, and find the most appropiate integer for it.
21633 * literal.cs: Implement ULongLiteral.
21635 * rootcontext.cs: Provide better information about the location of
21636 failure when CreateType fails.
21638 2001-09-29 Miguel de Icaza <miguel@ximian.com>
21640 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21643 * expression.cs (Binary::CheckShiftArguments): Add missing type
21645 (Binary::ResolveOperator): Add type to the logical and and logical
21646 or, Bitwise And/Or and Exclusive Or code paths, it was missing
21649 (Binary::DoNumericPromotions): In the case where either argument
21650 is ulong (and most signed types combined with ulong cause an
21651 error) perform implicit integer constant conversions as well.
21653 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21655 * expression.cs (UserImplicitCast): Method should always be
21657 (Invocation::BetterConversion): Simplified test for IntLiteral.
21659 (Expression::ImplicitNumericConversion): Split this routine out.
21660 Put the code that performs implicit constant integer conversions
21663 (Expression::Resolve): Become a wrapper around DoResolve so we can
21664 check eclass and type being set after resolve.
21666 (Invocation::Badness): Remove this dead function
21668 (Binary::ResolveOperator): Do not compute the expensive argumnets
21669 unless we have a union for it.
21671 (Probe::Emit): Is needs to do an isinst and then
21672 compare against null.
21674 (::CanConvert): Added Location argument. If the Location argument
21675 is null (Location.Null), then we do not report errors. This is
21676 used by the `probe' mechanism of the Explicit conversion. We do
21677 not want to generate an error for something that the user
21678 explicitly requested to be casted. But the pipeline for an
21679 explicit cast first tests for potential implicit casts.
21681 So for now, if the Location is null, it means `Probe only' to
21682 avoid adding another argument. Might have to revise this
21685 (ClassCast): New class used to type cast objects into arbitrary
21686 classes (used in Explicit Reference Conversions).
21688 Implement `as' as well.
21690 Reverted all the patches from Ravi below: they were broken:
21692 * The use of `level' as a mechanism to stop recursive
21693 invocations is wrong. That was there just to catch the
21694 bug with a strack trace but not as a way of addressing
21697 To fix the problem we have to *understand* what is going
21698 on and the interactions and come up with a plan, not
21699 just get things going.
21701 * The use of the type conversion cache that I proposed
21702 last night had an open topic: How does this work across
21703 protection domains. A user defined conversion might not
21704 be public in the location where we are applying the
21705 conversion, a different conversion might be selected
21706 (ie, private A->B (better) but public B->A (worse),
21707 inside A, A->B applies, but outside it, B->A will
21710 * On top of that (ie, even if the above is solved),
21711 conversions in a cache need to be abstract. Ie, `To
21712 convert from an Int to a Short use an OpcodeCast', not
21713 `To convert from an Int to a Short use the OpcodeCast on
21714 the variable 5' (which is what this patch was doing).
21716 2001-09-28 Ravi Pratap <ravi@ximian.com>
21718 * expression.cs (Invocation::ConversionExists): Re-write to use
21719 the conversion cache
21721 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21722 cache all conversions done, not just user-defined ones.
21724 (Invocation::BetterConversion): The real culprit. Use ConversionExists
21725 to determine if a conversion exists instead of acutually trying to
21726 perform the conversion. It's faster too.
21728 (Expression::ConvertExplicit): Modify to use ConversionExists to check
21729 and only then attempt the implicit conversion.
21731 2001-09-28 Ravi Pratap <ravi@ximian.com>
21733 * expression.cs (ConvertImplicit): Use a cache for conversions
21734 already found. Check level of recursion and bail out if necessary.
21736 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21738 * typemanager.cs (string_concat_string_string, string_concat_object_object):
21739 Export standard methods that we expect for string operations.
21741 * statement.cs (Block::UsageWarning): Track usage of variables and
21742 report the errors for not used variables.
21744 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21747 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21749 * codegen.cs: remove unnneded code
21751 * expression.cs: Removed BuiltinTypeAccess class
21753 Fix the order in which implicit conversions are
21756 The previous fixed dropped support for boxed conversions (adding a
21757 test to the test suite now)
21759 (UserImplicitCast::CanConvert): Remove test for source being null,
21760 that code is broken. We should not feed a null to begin with, if
21761 we do, then we should track the bug where the problem originates
21762 and not try to cover it up here.
21764 Return a resolved expression of type UserImplicitCast on success
21765 rather than true/false. Ravi: this is what I was talking about,
21766 the pattern is to use a static method as a "constructor" for
21769 Also, do not create arguments until the very last minute,
21770 otherwise we always create the arguments even for lookups that
21771 will never be performed.
21773 (UserImplicitCast::Resolve): Eliminate, objects of type
21774 UserImplicitCast are born in a fully resolved state.
21776 * typemanager.cs (InitCoreTypes): Init also value_type
21777 (System.ValueType).
21779 * expression.cs (Cast::Resolve): First resolve the child expression.
21781 (LValue): Add new method AddressOf to be used by
21784 Change the argument of Store to take an EmitContext instead of an
21785 ILGenerator, because things like FieldExpr need to be able to call
21786 their children expression to generate the instance code.
21788 (Expression::Error, Expression::Warning): Sugar functions for
21791 (Expression::MemberLookup): Accept a TypeContainer instead of a
21792 Report as the first argument.
21794 (Expression::ResolvePrimary): Killed. I still want to improve
21795 this as currently the code is just not right.
21797 (Expression::ResolveMemberAccess): Simplify, but it is still
21800 (Unary::Resolve): Catch errors in AddressOf operators.
21802 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21803 index to a byte for the short-version, or the compiler will choose
21804 the wrong Emit call, which generates the wrong data.
21806 (ParameterReference::Emit, ::Store): same.
21808 (FieldExpr::AddressOf): Implement.
21810 * typemanager.cs: TypeManager: made public variable instead of
21813 * driver.cs: document --fatal.
21815 * report.cs (ErrorMessage, WarningMessage): new names for the old
21816 Error and Warning classes.
21818 * cs-parser.jay (member_access): Turn built-in access to types
21819 into a normal simplename
21821 2001-09-27 Ravi Pratap <ravi@ximian.com>
21823 * expression.cs (Invocation::BetterConversion): Fix to cope
21824 with q being null, since this was introducing a bug.
21826 * expression.cs (ConvertImplicit): Do built-in conversions first.
21828 2001-09-27 Ravi Pratap <ravi@ximian.com>
21830 * expression.cs (UserImplicitCast::Resolve): Fix bug.
21832 2001-09-27 Ravi Pratap <ravi@ximian.com>
21834 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21835 I had introduced long ago (what's new ?).
21837 * expression.cs (UserImplicitCast::CanConvert): Static method to do
21838 the work of all the checking.
21839 (ConvertImplicit): Call CanConvert and only then create object if necessary.
21840 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21842 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21843 that is the right way.
21845 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
21846 overloading resolution. Use everywhere instead of cutting and pasting code.
21848 (Binary::ResolveOperator): Use MakeUnionSet.
21850 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
21851 we have to convert to bool types. Not complete yet.
21853 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21855 * typemanager.cs (TypeManager::CSharpName): support ushort.
21857 * expression.cs (Expression::TryImplicitIntConversion): Attempts
21858 to provide an expression that performsn an implicit constant int
21859 conversion (section 6.1.6).
21860 (Expression::ConvertImplicitRequired): Reworked to include
21861 implicit constant expression conversions.
21863 (Expression::ConvertNumericExplicit): Finished.
21865 (Invocation::Emit): If InstanceExpression is null, then it means
21866 that we perform a call on this.
21868 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21870 * expression.cs (Unary::Emit): Remove some dead code.
21871 (Probe): Implement Resolve and Emit for `is'.
21872 (Expression::ConvertImplicitRequired): Attempt to do constant
21873 expression conversions here. Maybe should be moved to
21874 ConvertImplicit, but I am not sure.
21875 (Expression::ImplicitLongConstantConversionPossible,
21876 Expression::ImplicitIntConstantConversionPossible): New functions
21877 that tell whether is it possible to apply an implicit constant
21878 expression conversion.
21880 (ConvertNumericExplicit): Started work on explicit numeric
21883 * cs-parser.jay: Update operator constants.
21885 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21886 (Parameters::GetSignature): Hook up VerifyArgs here.
21887 (Parameters::VerifyArgs): Verifies that no two arguments have the
21890 * class.cs (Operator): Update the operator names to reflect the
21891 ones that the spec expects (as we are just stringizing the
21894 * expression.cs (Unary::ResolveOperator): Fix bug: Use
21895 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21896 previous usage did only work for our methods.
21897 (Expression::ConvertImplicit): Handle decimal implicit numeric
21898 conversions as well.
21899 (Expression::InternalTypeConstructor): Used to invoke constructors
21900 on internal types for default promotions.
21902 (Unary::Emit): Implement special handling for the pre/post
21903 increment/decrement for overloaded operators, as they need to have
21904 the same semantics as the other operators.
21906 (Binary::ResolveOperator): ditto.
21907 (Invocation::ConversionExists): ditto.
21908 (UserImplicitCast::Resolve): ditto.
21910 2001-09-26 Ravi Pratap <ravi@ximian.com>
21912 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21913 operator, return after emitting body. Regression tests pass again !
21915 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21916 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21917 (Invocation::OverloadResolve): Ditto.
21918 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21920 * everywhere : update calls to the above methods accordingly.
21922 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21924 * assign.cs (Assign): Make it inherit from ExpressionStatement.
21926 * expression.cs (ExpressionStatement): New base class used for
21927 expressions that can appear in statements, so that we can provide
21928 an alternate path to generate expression that do not leave a value
21931 (Expression::Emit, and all the derivatives): We no longer return
21932 whether a value is left on the stack or not. Every expression
21933 after being emitted leaves a single value on the stack.
21935 * codegen.cs (EmitContext::EmitStatementExpression): Use the
21936 facilties of ExpressionStatement if possible.
21938 * cs-parser.jay: Update statement_expression.
21940 2001-09-25 Miguel de Icaza <miguel@ximian.com>
21942 * driver.cs: Change the wording of message
21944 2001-09-25 Ravi Pratap <ravi@ximian.com>
21946 * expression.cs (Binary::ResolveOperator): Had forgottten to set
21947 the type of the expression to the return type of the method if
21948 we have an overloaded operator match ! The regression tests pass again !
21949 (Unary::ResolveOperator): Ditto.
21951 * expression.cs (Invocation::ConversionExists): Correct the member lookup
21952 to find "op_Implicit", not "implicit" ;-)
21953 (UserImplicitCast): New class to take care of user-defined implicit conversions.
21954 (ConvertImplicit, ForceConversion): Take TypeContainer argument
21956 * everywhere : Correct calls to the above accordingly.
21958 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21959 (ConvertImplicit): Do user-defined conversion if it exists.
21961 2001-09-24 Miguel de Icaza <miguel@ximian.com>
21963 * assign.cs: track location.
21964 (Resolve): Use implicit conversions on assignment.
21966 * literal.cs: Oops. Not good, Emit of short access values should
21967 pass (Bytes) or the wrong argument will be selected.
21969 * expression.cs (Unary::Emit): Emit code for -expr.
21971 (Unary::ResolveOperator): Handle `Substract' for non-constants
21972 (substract from zero from the non-constants).
21973 Deal with Doubles as well.
21975 (Expression::ConvertImplicitRequired): New routine that reports an
21976 error if no implicit conversion exists.
21978 (Invocation::OverloadResolve): Store the converted implicit
21979 expressions if we make them
21981 2001-09-24 Ravi Pratap <ravi@ximian.com>
21983 * class.cs (ConstructorInitializer): Take a Location argument.
21984 (ConstructorBaseInitializer): Same here.
21985 (ConstructorThisInitializer): Same here.
21987 * cs-parser.jay : Update all calls accordingly.
21989 * expression.cs (Unary, Binary, New): Take location argument.
21990 Update accordingly everywhere.
21992 * cs-parser.jay : Update all calls to the above to take a location
21995 * class.cs : Ditto.
21997 2001-09-24 Ravi Pratap <ravi@ximian.com>
21999 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22000 (Invocation::BetterConversion): Same here
22001 (Invocation::ConversionExists): Ditto.
22003 (Invocation::ConversionExists): Implement.
22005 2001-09-22 Ravi Pratap <ravi@ximian.com>
22007 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22008 Also take an additional TypeContainer argument.
22010 * All over : Pass in TypeContainer as argument to OverloadResolve.
22012 * typemanager.cs (CSharpName): Update to check for the string type and return
22015 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22018 2001-09-21 Ravi Pratap <ravi@ximian.com>
22020 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22021 (Invocation::BetterFunction): Implement.
22022 (Invocation::BetterConversion): Implement.
22023 (Invocation::ConversionExists): Skeleton, no implementation yet.
22025 Okay, things work fine !
22027 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22029 * typemanager.cs: declare and load enum_type, delegate_type and
22032 * expression.cs (Expression::Emit): Now emit returns a value that
22033 tells whether a value is left on the stack or not. This strategy
22034 might be reveted tomorrow with a mechanism that would address
22035 multiple assignments.
22036 (Expression::report118): Utility routine to report mismatches on
22039 (Unary::Report23): Report impossible type/operator combination
22042 (Unary::IsIncrementableNumber): Whether the type can be
22043 incremented or decremented with add.
22044 (Unary::ResolveOperator): Also allow enumerations to be bitwise
22046 (Unary::ResolveOperator): Implement ++, !, ~,
22048 (Invocation::Emit): Deal with new Emit convetion.
22050 * All Expression derivatives: Updated their Emit method to return
22051 whether they leave values on the stack or not.
22053 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22054 stack for expressions that are statements.
22056 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22058 * expression.cs (LValue): New interface. Must be implemented by
22060 (LocalVariableReference, ParameterReference, FieldExpr): Implement
22063 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22064 interface for generating code, simplifies the code.
22066 2001-09-20 Ravi Pratap <ravi@ximian.com>
22068 * expression.cs (everywhere): Comment out return statements in ::Resolve
22069 methods to avoid the warnings.
22071 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22073 * driver.cs (parse): Report error 2001 if we can not open the
22076 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22079 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22082 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22083 otherwise nested blocks end up with the same index.
22085 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22087 * expression.cs: Instead of having FIXMEs in the Resolve
22088 functions, throw exceptions so it is obvious that we are facing a
22091 * cs-parser.jay (invocation_expression): Pass Location information.
22093 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22094 Use a basename for those routines because .NET does not like paths
22097 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22100 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22102 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22103 are loading the correct data types (throws an exception if not).
22104 (TypeManager::InitCoreTypes): Use CoreLookupType
22106 * expression.cs (Unary::ResolveOperator): return the child
22107 expression for expressions which are just +expr.
22108 (Unary::ResolveOperator): Return negative literals for -LITERAL
22109 expressions (otherwise they are Unary {Literal}).
22110 (Invocation::Badness): Take into account `Implicit constant
22111 expression conversions'.
22113 * literal.cs (LongLiteral): Implement long literal class.
22114 (IntLiteral): export the `Value' of the intliteral.
22116 2001-09-19 Ravi Pratap <ravi@ximian.com>
22118 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22120 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22121 instead of 'Operator'
22123 * expression.cs (Binary::ResolveOperator): Update accordingly.
22124 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22127 * cs-parser.jay (unary_expression): Update to use the new names.
22129 * gen-treedump.cs (GetUnary): Same here.
22131 * expression.cs (Unary::Resolve): Implement.
22132 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22133 operators are found instead of making noise ;-)
22134 (Unary::ResolveOperator): New method to do precisely the same thing which
22135 Binary::ResolveOperator does for Binary expressions.
22136 (Unary.method, .Arguments): Add.
22137 (Unary::OperName): Implement.
22138 (Unary::ForceConversion): Copy and Paste !
22140 * class.cs (Operator::Define): Fix a small bug for the case when we have
22143 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22144 for the inbuilt operators. Only overloading works for now ;-)
22146 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22148 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22149 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22151 * expression.cs (This::Emit): Implement.
22152 (This::Resolve): Implement.
22153 (TypeOf:Resolve): Implement.
22154 (Expression::ResolveSimpleName): Add an implicit this to instance
22156 (MemberAccess::Resolve): Deal with Parameters and Fields.
22157 Bind instance variable to Field expressions.
22158 (FieldExpr::Instance): New field used to track the expression that
22159 represents the object instance.
22160 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22162 (FieldExpr::Emit): Implement.
22164 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22165 the last instruction contains a return opcode to avoid generating
22166 the last `ret' instruction (this generates correct code, and it is
22167 nice to pass the peverify output).
22169 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22170 initializer for static and instance variables.
22171 (Constructor::Emit): Allow initializer to be null in the case of
22172 static constructors. Only emit initializer for instance
22175 (TypeContainer::FindMembers): Return a null array if there are no
22178 Also fix the code for the MemberTypes.Method branch, as it was not
22179 scanning that for operators (or tried to access null variables before).
22181 * assign.cs (Assign::Emit): Handle instance and static fields.
22185 * driver.cs: Stop compilation if there are parse errors.
22187 * cs-parser.jay (constructor_declaration): Provide default base
22188 initializer for non-static constructors.
22189 (constructor_declarator): Do not provide a default base
22190 initializers if none was specified.
22191 Catch the fact that constructors should not have parameters.
22193 * class.cs: Do not emit parent class initializers for static
22194 constructors, that should be flagged as an error.
22196 2001-09-18 Ravi Pratap <ravi@ximian.com>
22198 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22199 Move back code into TypeContainer::Populate.
22201 2001-09-18 Ravi Pratap <ravi@ximian.com>
22203 * class.cs (TypeContainer::AddConstructor): Fix the check to
22204 compare against Name, not Basename.
22205 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22207 * cs-parser.jay : Update accordingly.
22209 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22210 for methods, don't forget to look into the operators too.
22211 (RegisterMethodBuilder): Helper method to take care of this for
22212 methods, constructors and operators.
22213 (Operator::Define): Completely revamp.
22214 (Operator.OperatorMethod, MethodName): New fields.
22215 (TypeContainer::Populate): Move the registering of builders into
22216 RegisterMethodBuilder.
22217 (Operator::Emit): Re-write.
22219 * expression.cs (Binary::Emit): Comment out code path to emit method
22220 invocation stuff for the case when we have a user defined operator. I am
22221 just not able to get it right !
22223 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22225 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22228 (Expression::MemberLookup): Provide a version that allows to
22229 specify the MemberTypes and BindingFlags.
22231 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22232 so it was not fetching variable information from outer blocks.
22234 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22235 Beforefieldinit as it was buggy.
22237 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22238 that Ravi put here.
22240 * class.cs (Constructor::Emit): Only emit if block is not null.
22241 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22242 deal with this by semantically definining it as if the user had
22245 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22246 constructors as we now "emit" them at a higher level.
22248 (TypeContainer::DefineDefaultConstructor): Used to define the
22249 default constructors if none was provided.
22251 (ConstructorInitializer): Add methods Resolve and Emit.
22253 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22255 2001-09-17 Ravi Pratap <ravi@ximian.com>
22257 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22258 the default constructor builder with our hashtable for methodbuilders
22261 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22262 and argument_count is 0 in which case we have a match.
22263 (Binary::ResolveOperator): More null checking and miscellaneous coding
22266 2001-09-17 Ravi Pratap <ravi@ximian.com>
22268 * rootcontext.cs (IsNameSpace): Compare against null.
22270 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22272 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22273 and Unary::Operator.
22275 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22278 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22279 we have overloaded operators.
22280 (Binary::ResolveOperator): Implement the part which does the operator overload
22283 * class.cs (Operator::Emit): Implement.
22284 (TypeContainer::Emit): Emit the operators we have too.
22286 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22287 the case when we have a user-defined operator.
22289 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22291 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22293 2001-09-16 Ravi Pratap <ravi@ximian.com>
22295 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22296 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22297 (Constructor::Emit): Implement.
22298 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22299 if we have no work to do.
22300 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22303 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22304 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22306 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22309 2001-09-15 Ravi Pratap <ravi@ximian.com>
22311 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22313 (Tree::RecordNamespace): Method to do what the name says ;-)
22314 (Tree::Namespaces): Property to get at the namespaces hashtable.
22316 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22319 * rootcontext.cs (IsNamespace): Fixed it :-)
22321 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22323 * class.cs (TypeContainer::FindMembers): Add support for
22325 (MethodCore): New class that encapsulates both the shared aspects
22326 of a Constructor and a Method.
22327 (Method, Constructor): Factored pieces into MethodCore.
22329 * driver.cs: Added --fatal which makes errors throw exceptions.
22330 Load System assembly as well as part of the standard library.
22332 * report.cs: Allow throwing exceptions on errors for debugging.
22334 * modifiers.cs: Do not use `parent', instead use the real type
22335 container to evaluate permission settings.
22337 * class.cs: Put Ravi's patch back in. He is right, and we will
22338 have to cope with the
22340 2001-09-14 Ravi Pratap <ravi@ximian.com>
22342 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22343 FamORAssem, not FamANDAssem.
22345 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22347 * driver.cs: Added --parse option that only parses its input files
22350 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
22351 incorrect. IsTopLevel is not used to tell whether an object is
22352 root_types or not (that can be achieved by testing this ==
22353 root_types). But to see if this is a top-level *class* (not
22354 necessarly our "toplevel" container).
22356 2001-09-14 Ravi Pratap <ravi@ximian.com>
22358 * enum.cs (Enum::Define): Modify to call the Lookup method on the
22359 parent instead of a direct call to GetType.
22361 2001-09-14 Ravi Pratap <ravi@ximian.com>
22363 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22364 Modifiers.TypeAttr. This should just be a call to that method.
22366 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22367 object so that we can determine if we are top-level or not.
22369 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
22372 * enum.cs (Enum::Define): Ditto.
22374 * modifiers.cs (FieldAttr): Re-write.
22376 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22377 (TypeContainer::HaveStaticConstructor): New property to provide access
22378 to precisely that info.
22380 * modifiers.cs (MethodAttr): Re-write.
22381 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22383 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22384 of top-level types as claimed.
22386 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22388 * expression.cs (MemberLookup): Fruitless attempt to lookup
22389 constructors. Maybe I need to emit default constructors? That
22390 might be it (currently .NET emits this for me automatically).
22391 (Invocation::OverloadResolve): Cope with Arguments == null.
22392 (Invocation::EmitArguments): new function, shared by the new
22393 constructor and us.
22394 (Invocation::Emit): Handle static and instance methods. Emit
22395 proper call instruction for virtual or non-virtual invocations.
22396 (New::Emit): Implement.
22397 (New::Resolve): Implement.
22398 (MemberAccess:Resolve): Implement.
22399 (MethodGroupExpr::InstanceExpression): used conforming to the spec
22400 to track instances.
22401 (FieldExpr::Resolve): Set type.
22403 * support.cs: Handle empty arguments.
22405 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22406 SimpleLookup): Auxiliary routines to help parse a qualifier
22409 Update qualifier_identifier rule.
22411 * codegen.cs: Removed debugging messages.
22413 * class.cs: Make this a global thing, this acts just as a "key" to
22414 objects that we might have around.
22416 (Populate): Only initialize method_builders_to_methods once.
22418 * expression.cs (PropertyExpr): Initialize type from the
22421 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22422 Resolve pattern. Attempt to implicitly convert value to boolean.
22425 * expression.cs: Set the type for the int32/int32 argument case.
22426 (Binary::ResolveOperator): Set the return type to boolean for
22427 comparission operators
22429 * typemanager.cs: Remove debugging print code.
22431 (Invocation::Resolve): resolve type.
22433 * class.cs: Allocate a MemberInfo of the correct size, as the code
22434 elsewhere depends on the test to reflect the correct contents.
22436 (Method::) Keep track of parameters, due to System.Reflection holes
22438 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22441 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22442 of the exact size and return that.
22444 (Class::LookupMethodByBuilder): New function that maps
22445 MethodBuilders to its methods. Required to locate the information
22446 on methods because System.Reflection bit us again.
22448 * support.cs: New file, contains an interface ParameterData and
22449 two implementations: ReflectionParameters and InternalParameters
22450 used to access Parameter information. We will need to grow this
22453 * expression.cs (Invocation::GetParameterData): implement a cache
22454 and a wrapper around the ParameterData creation for methods.
22455 (Invocation::OverloadResolve): Use new code.
22457 2001-09-13 Ravi Pratap <ravi@ximian.com>
22459 * class.cs (TypeContainer::EmitField): Remove and move into
22460 (Field::Define): here and modify accordingly.
22461 (Field.FieldBuilder): New member.
22462 (TypeContainer::Populate): Update accordingly.
22463 (TypeContainer::FindMembers): Implement.
22465 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22467 * statement.cs: (VariableInfo::VariableType): New field to be
22468 initialized with the full type once it is resolved.
22470 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22472 * parameter.cs (GetParameterInfo): Use a type cache to compute
22473 things only once, and to reuse this information
22475 * expression.cs (LocalVariableReference::Emit): Implement.
22476 (OpcodeCast::Emit): fix.
22478 (ParameterReference::Resolve): Implement.
22479 (ParameterReference::Emit): Implement.
22481 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22482 that are expressions need to stay as Expressions.
22484 * typemanager.cs (CSharpName): Returns the C# name of a type if
22487 * expression.cs (Expression::ConvertImplicit): New function that
22488 implements implicit type conversions.
22490 (Expression::ImplicitReferenceConversion): Implements implicit
22491 reference conversions.
22493 (EmptyCast): New type for transparent casts.
22495 (OpcodeCast): New type for casts of types that are performed with
22496 a sequence of bytecodes.
22498 (BoxedCast): New type used for casting value types into reference
22499 types. Emits a box opcode.
22501 (Binary::DoNumericPromotions): Implements numeric promotions of
22502 and computation of the Binary::Type.
22504 (Binary::EmitBranchable): Optimization.
22506 (Binary::Emit): Implement code emission for expressions.
22508 * typemanager.cs (TypeManager): Added two new core types: sbyte
22511 2001-09-12 Ravi Pratap <ravi@ximian.com>
22513 * class.cs (TypeContainer::FindMembers): Method which does exactly
22514 what Type.FindMembers does, only we don't have to use reflection. No
22515 implementation yet.
22517 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22518 typecontainer objects as we need to get at them.
22519 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22521 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22522 typecontainer object.
22524 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22525 of just a Report object.
22527 2001-09-11 Ravi Pratap <ravi@ximian.com>
22529 * class.cs (Event::Define): Go back to using the prefixes "add_" and
22531 (TypeContainer::Populate): Now define the delegates of the type too.
22532 (TypeContainer.Delegates): Property to access the list of delegates defined
22535 * delegates.cs (Delegate::Define): Implement partially.
22537 * modifiers.cs (TypeAttr): Handle more flags.
22539 2001-09-11 Ravi Pratap <ravi@ximian.com>
22541 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22543 (Operator::Define): Re-write logic to get types by using the LookupType method
22544 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22545 (Indexer::Define): Ditto.
22546 (Event::Define): Ditto.
22547 (Property::Define): Ditto.
22549 2001-09-10 Ravi Pratap <ravi@ximian.com>
22551 * class.cs (TypeContainer::Populate): Now define operators too.
22552 (TypeContainer.Operators): New property to access the list of operators
22554 (Operator.OperatorMethodBuilder): New member to hold the method builder
22555 for the operator we are defining.
22556 (Operator::Define): Implement.
22558 2001-09-10 Ravi Pratap <ravi@ximian.com>
22560 * class.cs (Event::Define): Make the prefixes of the accessor methods
22561 addOn_ and removeOn_
22563 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22564 of the location being passed in too. Ideally, this should go later since all
22565 error reporting should be done through the Report object.
22567 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22568 (Populate): Iterate thru the indexers we have and define them too.
22569 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22570 for the get and set accessors.
22571 (Indexer::Define): Implement.
22573 2001-09-09 Miguel de Icaza <miguel@ximian.com>
22575 * expression.cs (Binary::Resolve): Beginning of it. I scratched
22576 my previous implementation, did not work.
22578 * typemanager.cs: Add a couple of missing types (the longs).
22580 * literal.cs: Use TypeManager.bool_type instead of getting it.
22582 * expression.cs (EventExpr): New kind of expressions.
22583 (Expressio::ExprClassFromMemberInfo): finish
22585 2001-09-08 Miguel de Icaza <miguel@ximian.com>
22587 * assign.cs: Emit stores to static fields differently.
22589 2001-09-08 Ravi Pratap <ravi@ximian.com>
22591 * Merge in changes and adjust code to tackle conflicts. Backed out my
22592 code in Assign::Resolve ;-)
22594 2001-09-08 Ravi Pratap <ravi@ximian.com>
22596 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22597 instead Report.Error and also pass in the location.
22598 (CSharpParser::Lexer): New readonly property to return the reference
22599 to the Tokenizer object.
22600 (declare_local_variables): Use Report.Error with location instead of plain
22604 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22605 (Operator.CheckBinaryOperator): Ditto.
22607 * cs-parser.jay (operator_declarator): Update accordingly.
22609 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22610 (CheckBinaryOperator): Same here.
22612 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22613 on the name without any prefixes of namespace names etc. This is because we
22614 already might have something already fully qualified like
22615 'System.Console.WriteLine'
22617 * assign.cs (Resolve): Begin implementation. Stuck ;-)
22619 2001-09-07 Ravi Pratap <ravi@ximian.com>
22621 * cs-tokenizer.cs (location): Return a string which also contains
22624 * expression.cs (ElementAccess): New class for expressions of the
22625 type 'element access.'
22626 (BaseAccess): New class for expressions of the type 'base access.'
22627 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22630 * cs-parser.jay (element_access): Implement action.
22631 (base_access): Implement actions.
22632 (checked_expression, unchecked_expression): Implement.
22634 * cs-parser.jay (local_variable_type): Correct and implement.
22635 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22637 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22639 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22640 name and the specifiers.
22642 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22644 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
22645 making them all public ;-)
22647 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22650 2001-09-07 Miguel de Icaza <miguel@ximian.com>
22652 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22654 (FieldExpr, PropertyExprs): New resolved expressions.
22655 (SimpleName::MemberStaticCheck): Perform static checks for access
22656 to non-static fields on static methods. Maybe this should be
22657 generalized for MemberAccesses.
22658 (SimpleName::ResolveSimpleName): More work on simple name
22661 * cs-parser.jay (primary_expression/qualified_identifier): track
22662 the parameter index.
22664 * codegen.cs (CodeGen::Save): Catch save exception, report error.
22665 (EmitContext::EmitBoolExpression): Chain to expression generation
22666 instead of temporary hack.
22667 (::EmitStatementExpression): Put generic expression code generation.
22669 * assign.cs (Assign::Emit): Implement variable assignments to
22670 local variables, parameters and fields.
22672 2001-09-06 Miguel de Icaza <miguel@ximian.com>
22674 * statement.cs (Block::GetVariableInfo): New method, returns the
22675 VariableInfo for a variable name in a block.
22676 (Block::GetVariableType): Implement in terms of GetVariableInfo
22678 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22679 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22681 2001-09-06 Ravi Pratap <ravi@ximian.com>
22683 * cs-parser.jay (operator_declaration): Continue on my quest : update
22684 to take attributes argument.
22685 (event_declaration): Ditto.
22686 (enum_declaration): Ditto.
22687 (indexer_declaration): Ditto.
22689 * class.cs (Operator::Operator): Update constructor accordingly.
22690 (Event::Event): Ditto.
22692 * delegate.cs (Delegate::Delegate): Same here.
22694 * enum.cs (Enum::Enum): Same here.
22696 2001-09-05 Ravi Pratap <ravi@ximian.com>
22698 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22700 * ../tests/cs0658.cs : New file to demonstrate error 0658.
22702 * attribute.cs (Attributes): New class to encapsulate all attributes which were
22703 being passed around as an arraylist.
22704 (Attributes::AddAttribute): Method to add attribute sections.
22706 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22707 (struct_declaration): Update accordingly.
22708 (constant_declaration): Update.
22709 (field_declaration): Update.
22710 (method_header): Update.
22711 (fixed_parameter): Update.
22712 (parameter_array): Ditto.
22713 (property_declaration): Ditto.
22714 (destructor_declaration): Ditto.
22716 * class.cs (Struct::Struct): Update constructors accordingly.
22717 (Class::Class): Ditto.
22718 (Field::Field): Ditto.
22719 (Method::Method): Ditto.
22720 (Property::Property): Ditto.
22721 (TypeContainer::OptAttribute): update property's return type.
22723 * interface.cs (Interface.opt_attributes): New member.
22724 (Interface::Interface): Update to take the extra Attributes argument.
22726 * parameter.cs (Parameter::Parameter): Ditto.
22728 * constant.cs (Constant::Constant): Ditto.
22730 * interface.cs (InterfaceMemberBase): New OptAttributes field.
22731 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
22732 the attributes as a parameter.
22733 (InterfaceProperty): Update constructor call.
22734 (InterfaceEvent): Ditto.
22735 (InterfaceMethod): Ditto.
22736 (InterfaceIndexer): Ditto.
22738 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
22739 pass the attributes too.
22740 (interface_event_declaration): Ditto.
22741 (interface_property_declaration): Ditto.
22742 (interface_method_declaration): Ditto.
22743 (interface_declaration): Ditto.
22745 2001-09-05 Miguel de Icaza <miguel@ximian.com>
22747 * class.cs (Method::Define): Track the "static Main" definition to
22748 create an entry point.
22750 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22751 EntryPoint if we find it.
22753 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22754 (EmitContext::ig): Make this variable public.
22756 * driver.cs: Make the default output file be the first file name
22757 with the .exe extension.
22759 Detect empty compilations
22761 Handle various kinds of output targets. Handle --target and
22762 rename -t to --dumper.
22764 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22765 methods inherited from Expression return now an Expression. This
22766 will is used during the tree rewriting as we resolve them during
22769 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22770 the spec. Missing entirely is the information about
22771 accessability of elements of it.
22773 (Expression::ExprClassFromMemberInfo): New constructor for
22774 Expressions that creates a fully initialized Expression based on
22775 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22778 (Invocation::Resolve): Begin implementing resolution of invocations.
22780 * literal.cs (StringLiteral): Implement Emit.
22782 2001-09-05 Ravi Pratap <ravi@ximian.com>
22784 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22787 2001-09-04 Ravi Pratap <ravi@ximian.com>
22789 * cs-parser.jay (attribute_arguments): Implement actions.
22790 (attribute): Fix bug in production. Implement action.
22791 (attribute_list): Implement.
22792 (attribute_target): Implement.
22793 (attribute_target_specifier, opt_target_specifier): Implement
22794 (CheckAttributeTarget): New method to check if the attribute target
22796 (attribute_section): Implement.
22797 (opt_attributes): Implement.
22799 * attribute.cs : New file to handle attributes.
22800 (Attribute): Class to hold attribute info.
22802 * cs-parser.jay (opt_attribute_target_specifier): Remove production
22803 (attribute_section): Modify production to use 2 different rules to
22804 achieve the same thing. 1 s/r conflict down !
22805 Clean out commented, useless, non-reducing dimension_separator rules.
22807 * class.cs (TypeContainer.attributes): New member to hold list
22808 of attributes for a type.
22809 (Struct::Struct): Modify to take one more argument, the attribute list.
22810 (Class::Class): Ditto.
22811 (Field::Field): Ditto.
22812 (Method::Method): Ditto.
22813 (Property::Property): Ditto.
22815 * cs-parser.jay (struct_declaration): Update constructor call to
22816 pass in the attributes too.
22817 (class_declaration): Ditto.
22818 (constant_declaration): Ditto.
22819 (field_declaration): Ditto.
22820 (method_header): Ditto.
22821 (fixed_parameter): Ditto.
22822 (parameter_array): Ditto.
22823 (property_declaration): Ditto.
22825 * constant.cs (Constant::Constant): Update constructor similarly.
22826 Use System.Collections.
22828 * parameter.cs (Parameter::Parameter): Update as above.
22830 2001-09-02 Ravi Pratap <ravi@ximian.com>
22832 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22833 (TypeContainer.delegates): New member to hold list of delegates.
22835 * cs-parser.jay (delegate_declaration): Implement the action correctly
22836 this time as I seem to be on crack ;-)
22838 2001-09-02 Miguel de Icaza <miguel@ximian.com>
22840 * rootcontext.cs (RootContext::IsNamespace): new function, used to
22841 tell whether an identifier represents a namespace.
22843 * expression.cs (NamespaceExpr): A namespace expression, used only
22844 temporarly during expression resolution.
22845 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22846 utility functions to resolve names on expressions.
22848 2001-09-01 Miguel de Icaza <miguel@ximian.com>
22850 * codegen.cs: Add hook for StatementExpressions.
22852 * class.cs: Fix inverted test for static flag in methods.
22854 2001-09-02 Ravi Pratap <ravi@ximian.com>
22856 * class.cs (Operator::CheckUnaryOperator): Correct error number used
22857 to make it coincide with MS' number.
22858 (Operator::CheckBinaryOperator): Ditto.
22860 * ../errors/errors.txt : Remove error numbers added earlier.
22862 * ../errors/cs1019.cs : Test case for error # 1019
22864 * ../errros/cs1020.cs : Test case for error # 1020
22866 * cs-parser.jay : Clean out commented cruft.
22867 (dimension_separators, dimension_separator): Comment out. Ostensibly not
22868 used anywhere - non-reducing rule.
22869 (namespace_declarations): Non-reducing rule - comment out.
22871 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22872 with TypeContainer::AddEnum.
22874 * delegate.cs : New file for delegate handling classes.
22875 (Delegate): Class for declaring delegates.
22877 * makefile : Update.
22879 * cs-parser.jay (delegate_declaration): Implement.
22881 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
22883 * class.cs (Event::Define): Implement.
22884 (Event.EventBuilder): New member.
22886 * class.cs (TypeContainer::Populate): Update to define all enums and events
22888 (Events): New property for the events arraylist we hold. Shouldn't we move to using
22889 readonly fields for all these cases ?
22891 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22893 * class.cs (Property): Revamp to use the convention of making fields readonly.
22894 Accordingly modify code elsewhere.
22896 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22897 the Define method of the Property class.
22899 * class.cs : Clean up applied patch and update references to variables etc. Fix
22901 (TypeContainer::Populate): Update to define all the properties we have. Also
22902 define all enumerations.
22904 * enum.cs (Define): Implement.
22906 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22908 * cs-parser.jay (overloadable_operator): The semantic value is an
22909 enum of the Operator class.
22910 (operator_declarator): Implement actions.
22911 (operator_declaration): Implement.
22913 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22914 validity of definitions.
22915 (Operator::CheckBinaryOperator): Static method to check for binary operators
22916 (TypeContainer::AddOperator): New method to add an operator to a type.
22918 * cs-parser.jay (indexer_declaration): Added line to actually call the
22919 AddIndexer method so it gets added ;-)
22921 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
22922 already taken care of by the MS compiler ?
22924 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
22926 * class.cs (Operator): New class for operator declarations.
22927 (Operator::OpType): Enum for the various operators.
22929 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
22931 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22932 ostensibly handle this in semantic analysis.
22934 * cs-parser.jay (general_catch_clause): Comment out
22935 (specific_catch_clauses, specific_catch_clause): Ditto.
22936 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22937 (catch_args, opt_catch_args): New productions.
22938 (catch_clause): Rewrite to use the new productions above
22939 (catch_clauses): Modify accordingly.
22940 (opt_catch_clauses): New production to use in try_statement
22941 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22942 and re-write the code in the actions to extract the specific and
22943 general catch clauses by being a little smart ;-)
22945 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22946 Hooray, try and catch statements parse fine !
22948 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22950 * statement.cs (Block::GetVariableType): Fix logic to extract the type
22951 string from the hashtable of variables.
22953 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22954 I end up making that mistake ;-)
22955 (catch_clauses): Fixed gross error which made Key and Value of the
22956 DictionaryEntry the same : $1 !!
22958 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22960 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22962 * cs-parser.jay (event_declaration): Correct to remove the semicolon
22963 when the add and remove accessors are specified.
22965 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22967 * cs-parser.jay (IndexerDeclaration): New helper class to hold
22968 information about indexer_declarator.
22969 (indexer_declarator): Implement actions.
22970 (parsing_indexer): New local boolean used to keep track of whether
22971 we are parsing indexers or properties. This is necessary because
22972 implicit_parameters come into picture even for the get accessor in the
22973 case of an indexer.
22974 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22976 * class.cs (Indexer): New class for indexer declarations.
22977 (TypeContainer::AddIndexer): New method to add an indexer to a type.
22978 (TypeContainer::indexers): New member to hold list of indexers for the
22981 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22983 * cs-parser.jay (add_accessor_declaration): Implement action.
22984 (remove_accessor_declaration): Implement action.
22985 (event_accessors_declaration): Implement
22986 (variable_declarators): swap statements for first rule - trivial.
22988 * class.cs (Event): New class to hold information about event
22990 (TypeContainer::AddEvent): New method to add an event to a type
22991 (TypeContainer::events): New member to hold list of events.
22993 * cs-parser.jay (event_declaration): Implement actions.
22995 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22997 * cs-parser.jay (dim_separators): Implement. Make it a string
22998 concatenating all the commas together, just as they appear.
22999 (opt_dim_separators): Modify accordingly
23000 (rank_specifiers): Update accordingly. Basically do the same
23001 thing - instead, collect the brackets here.
23002 (opt_rank_sepcifiers): Modify accordingly.
23003 (array_type): Modify to actually return the complete type string
23004 instead of ignoring the rank_specifiers.
23005 (expression_list): Implement to collect the expressions
23006 (variable_initializer): Implement. We make it a list of expressions
23007 essentially so that we can handle the array_initializer case neatly too.
23008 (variable_initializer_list): Implement.
23009 (array_initializer): Make it a list of variable_initializers
23010 (opt_array_initializer): Modify accordingly.
23012 * expression.cs (New::NType): Add enumeration to help us
23013 keep track of whether we have an object/delegate creation
23014 or an array creation.
23015 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23016 members to hold data about array creation.
23017 (New:New): Modify to update NewType
23018 (New:New): New Overloaded contructor for the array creation
23021 * cs-parser.jay (array_creation_expression): Implement to call
23022 the overloaded New constructor.
23024 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23026 * class.cs (TypeContainer::Constructors): Return member
23027 constructors instead of returning null.
23029 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23031 * typemanager.cs (InitCoreTypes): Initialize the various core
23032 types after we have populated the type manager with the user
23033 defined types (this distinction will be important later while
23034 compiling corlib.dll)
23036 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23037 on Expression Classification. Now all expressions have a method
23038 `Resolve' and a method `Emit'.
23040 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23041 generation from working. Also add some temporary debugging
23044 2001-08-24 Miguel de Icaza <miguel@ximian.com>
23046 * codegen.cs: Lots of code generation pieces. This is only the
23047 beginning, will continue tomorrow with more touches of polish. We
23048 handle the fundamentals of if, while, do, for, return. Others are
23049 trickier and I need to start working on invocations soon.
23051 * gen-treedump.cs: Bug fix, use s.Increment here instead of
23054 * codegen.cs (EmitContext): New struct, used during code
23055 emission to keep a context. Most of the code generation will be
23058 * cs-parser.jay: Add embedded blocks to the list of statements of
23059 this block. So code generation proceeds in a top down fashion.
23061 2001-08-23 Miguel de Icaza <miguel@ximian.com>
23063 * statement.cs: Add support for multiple child blocks.
23065 2001-08-22 Miguel de Icaza <miguel@ximian.com>
23067 * codegen.cs (EmitCode): New function, will emit the code for a
23068 Block of code given a TypeContainer and its ILGenerator.
23070 * statement.cs (Block): Standard public readonly optimization.
23071 (Block::Block constructors): Link children.
23072 (Block::Child): Child Linker.
23073 (Block::EmitVariables): Emits IL variable declarations.
23075 * class.cs: Drop support for MethodGroups here, delay until
23077 (Method::): Applied the same simplification that I did before, and
23078 move from Properties to public readonly fields.
23079 (Method::ParameterTypes): Returns the parameter types for the
23080 function, and implements a cache that will be useful later when I
23081 do error checking and the semantic analysis on the methods is
23083 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23084 and made a method, optional argument tells whether this is a class
23085 or a structure to apply the `has-this' bit.
23086 (Method::GetCallingConvention): Implement, returns the calling
23088 (Method::Define): Defines the type, a second pass is performed
23089 later to populate the methods.
23091 (Constructor::ParameterTypes): implement a cache similar to the
23092 one on Method::ParameterTypes, useful later when we do semantic
23095 (TypeContainer::EmitMethod): New method. Emits methods.
23097 * expression.cs: Removed MethodGroup class from here.
23099 * parameter.cs (Parameters::GetCallingConvention): new method.
23101 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23103 * class.cs (TypeContainer::Populate): Drop RootContext from the
23106 (Constructor::CallingConvention): Returns the calling convention.
23107 (Constructor::ParameterTypes): Returns the constructor parameter
23110 (TypeContainer::AddConstructor): Keep track of default constructor
23111 and the default static constructor.
23113 (Constructor::) Another class that starts using `public readonly'
23114 instead of properties.
23116 (Constructor::IsDefault): Whether this is a default constructor.
23118 (Field::) use readonly public fields instead of properties also.
23120 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23121 track of static constructors; If none is used, turn on
23122 BeforeFieldInit in the TypeAttributes.
23124 * cs-parser.jay (opt_argument_list): now the return can be null
23125 for the cases where there are no arguments.
23127 (constructor_declarator): If there is no implicit `base' or
23128 `this', then invoke the default parent constructor.
23130 * modifiers.cs (MethodAttr): New static function maps a set of
23131 modifiers flags into a MethodAttributes enum
23132 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23133 MethodAttr, TypeAttr to represent the various mappings where the
23134 modifiers are used.
23135 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23137 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23139 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23142 * interface.cs (PopulateIndexer): Implemented the code generator
23143 for interface indexers.
23145 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23147 * interface.cs (InterfaceMemberBase): Now we track the new status
23150 (PopulateProperty): Implement property population. Woohoo! Got
23151 Methods and Properties going today.
23153 Removed all the properties for interfaces, and replaced them with
23154 `public readonly' fields.
23156 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23158 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23159 initialize their hashtables/arraylists only when they are needed
23160 instead of doing this always.
23162 * parameter.cs: Handle refs and out parameters.
23164 * cs-parser.jay: Use an ArrayList to construct the arguments
23165 instead of the ParameterCollection, and then cast that to a
23168 * parameter.cs: Drop the use of ParameterCollection and use
23169 instead arrays of Parameters.
23171 (GetParameterInfo): Use the Type, not the Name when resolving
23174 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23176 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23177 and instead use public readonly fields.
23179 * class.cs: Put back walking code for type containers.
23181 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23183 * class.cs (MakeConstant): Code to define constants.
23185 * rootcontext.cs (LookupType): New function. Used to locate types
23188 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23190 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23191 this System.Reflection code is. Kudos to Microsoft
23193 * typemanager.cs: Implement a type cache and avoid loading all
23194 types at boot time. Wrap in LookupType the internals. This made
23195 the compiler so much faster. Wow. I rule!
23197 * driver.cs: Make sure we always load mscorlib first (for
23198 debugging purposes, nothing really important).
23200 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23201 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23203 * rootcontext.cs: Lookup types on their namespace; Lookup types
23204 on namespaces that have been imported using the `using' keyword.
23206 * class.cs (TypeContainer::TypeAttr): Virtualize.
23207 (Class::TypeAttr): Return attributes suitable for this bad boy.
23208 (Struct::TypeAttr): ditto.
23209 Handle nested classes.
23210 (TypeContainer::) Remove all the type visiting code, it is now
23211 replaced with the rootcontext.cs code
23213 * rootcontext.cs (GetClassBases): Added support for structs.
23215 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23217 * interface.cs, statement.cs, class.cs, parameter.cs,
23218 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23219 Drop use of TypeRefs, and use strings instead.
23221 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23225 * class.cs (Struct::Struct): set the SEALED flags after
23226 checking the modifiers.
23227 (TypeContainer::TypeAttr): new property, returns the
23228 TypeAttributes for a class.
23230 * cs-parser.jay (type_list): Oops, list production was creating a
23231 new list of base types.
23233 * rootcontext.cs (StdLib): New property.
23234 (GetInterfaceTypeByName): returns an interface by type name, and
23235 encapsulates error handling here.
23236 (GetInterfaces): simplified.
23237 (ResolveTree): Encapsulated all the tree resolution here.
23238 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23241 * driver.cs: Add support for --nostdlib, to avoid loading the
23242 default assemblies.
23243 (Main): Do not put tree resolution here.
23245 * rootcontext.cs: Beginning of the class resolution.
23247 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23249 * rootcontext.cs: Provide better error reporting.
23251 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23253 * rootcontext.cs (CreateInterface): Handle the case where there
23254 are no parent interfaces.
23256 (CloseTypes): Routine to flush types at the end.
23257 (CreateInterface): Track types.
23258 (GetInterfaces): Returns an array of Types from the list of
23259 defined interfaces.
23261 * typemanager.c (AddUserType): Mechanism to track user types (puts
23262 the type on the global type hash, and allows us to close it at the
23265 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23267 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23268 RecordInterface instead.
23270 * cs-parser.jay: Updated to reflect changes above.
23272 * decl.cs (Definition): Keep track of the TypeBuilder type that
23273 represents this type here. Not sure we will use it in the long
23274 run, but wont hurt for now.
23276 * driver.cs: Smaller changes to accomodate the new code.
23278 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23281 * rootcontext.cs (CreateInterface): New method, used to create
23282 the System.TypeBuilder type for interfaces.
23283 (ResolveInterfaces): new entry point to resolve the interface
23285 (CodeGen): Property, used to keep track of the code generator.
23287 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23289 * cs-parser.jay: Add a second production for delegate_declaration
23292 (enum_body): Put an opt_comma here instead of putting it on
23293 enum_body or enum_member_declarations so we can handle trailing
23294 commas on enumeration members. Gets rid of a shift/reduce.
23296 (type_list): Need a COMMA in the middle.
23298 (indexer_declaration): Tell tokenizer to recognize get/set
23300 * Remove old targets.
23302 * Re-add the parser target.
23304 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23306 * cs-parser.jay: Add precendence rules for a number of operators
23307 ot reduce the number of shift/reduce conflicts in the grammar.
23309 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23311 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23314 Get rid of old crufty code.
23316 * rootcontext.cs: Use this to keep track of the parsed
23317 representation and the defined types available to the program.
23319 * gen-treedump.cs: adjust for new convention.
23321 * type.cs: Split out the type manager, and the assembly builder
23324 * typemanager.cs: the type manager will live here now.
23326 * cil-codegen.cs: And the code generator here.
23328 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23330 * makefile: Fixed up for easy making.
23332 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23334 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23337 (unary_expression): Expand pre_increment_expression and
23338 post_decrement_expression to reduce a shift/reduce.
23340 2001-07-11 Simon Cozens
23342 * cs-tokenizer.cs: Hex numbers should begin with a 0.
23344 Improve allow_keyword_as_indent name.
23346 2001-06-19 Miguel de Icaza <miguel@ximian.com>
23348 * Adjustments for Beta2.
23350 2001-06-13 Miguel de Icaza <miguel@ximian.com>
23352 * decl.cs: Added `Define' abstract method.
23353 (InTransit): new property, used to catch recursive definitions.
23355 * interface.cs: Implement `Define'.
23357 * modifiers.cs: Map Modifiers.constants to
23358 System.Reflection.TypeAttribute flags.
23360 * class.cs: Keep track of types and user-defined types.
23361 (BuilderInit): New method for creating an assembly
23362 (ResolveType): New function to launch the resolution process, only
23363 used by interfaces for now.
23365 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23366 that are inserted into the name space.
23368 2001-06-08 Miguel de Icaza <miguel@ximian.com>
23370 * ARGH. I have screwed up my tree so many times due to the use of
23371 rsync rather than using CVS. Going to fix this at once.
23373 * driver.cs: Objetify driver. Load assemblies, use assemblies to
23376 2001-06-07 Miguel de Icaza <miguel@ximian.com>
23378 * Experiment successful: Use System.Type rather that our own
23381 2001-05-25 Miguel de Icaza <miguel@ximian.com>
23383 * cs-parser.jay: Removed nsAliases from here.
23385 Use new namespaces, handle `using XXX;'
23387 * namespace.cs: Reimplemented namespace handling, use a recursive
23388 definition of the class. Now we can keep track of using clauses
23389 and catch invalid using clauses.
23391 2001-05-24 Miguel de Icaza <miguel@ximian.com>
23393 * gen-treedump.cs: Adapted for all the renaming.
23395 * expression.cs (Expression): this class now has a Type property
23396 which returns an expression Type.
23398 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23399 `Type', as this has a different meaning now in the base
23401 2001-05-22 Miguel de Icaza <miguel@ximian.com>
23403 * interface.cs, class.cs: Removed from all the sources the
23404 references to signature computation, as we can not do method
23405 signature computation during the parsing time, as we are not
23406 trying to solve at that point distinguishing:
23410 void a (NS.Blah x) {}
23413 Which depending on the context might be valid or not, as we do not
23414 know if Blah is the same thing as NS.Blah at that point.
23416 * Redid everything so the code uses TypeRefs now instead of
23417 Types. TypeRefs are just temporary type placeholders, that need
23418 to be resolved. They initially have a pointer to a string and the
23419 current scope in which they are used. This is used later by the
23420 compiler to resolve the reference to an actual Type.
23422 * DeclSpace is no longer a CIR.Type, and neither are
23423 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23424 are all DeclSpaces, but no Types.
23426 * type.cs (TypeRefManager): This implements the TypeRef manager,
23427 which keeps track of all the types that need to be resolved after
23428 the parsing has finished.
23430 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23432 * ARGH. We are going to have to store `foreach' as a class rather
23433 than resolving it, as we need to verify error 1579 after name
23434 resolution. *OR* we could keep a flag that says `This request to
23435 IEnumerator comes from a foreach statement' which we can then use
23436 to generate the error.
23438 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23440 * class.cs (TypeContainer.AddMethod): we now add methods to the
23441 MethodGroup instead of the method hashtable.
23443 * expression.cs: Add MethodGroup abstraction, which gets us one
23444 step closer to the specification in the way we handle method
23447 * cs-parser.jay (primary_expression): qualified_identifier now
23448 tried to match up an identifier to a local variable reference or
23449 to a parameter reference.
23451 current_local_parameters is now a parser global variable that
23452 points to the current parameters for the block, used during name
23455 (property_declaration): Now creates an implicit `value' argument to
23458 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23460 * parameter.cs: Do not use `param' arguments as part of the
23461 signature, per the spec.
23463 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23465 * decl.cs: Base class for classes, structs and interfaces. This
23466 is the "Declaration Space"
23468 * cs-parser.jay: Use CheckDef for checking declaration errors
23469 instead of having one on each function.
23471 * class.cs: Factor out some code for handling error handling in
23472 accordance to the "Declarations" section in the "Basic Concepts"
23473 chapter in the ECMA C# spec.
23475 * interface.cs: Make all interface member classes derive from
23476 InterfaceMemberBase.
23478 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23480 * Many things: all interfaces are parsed and generated in
23481 gen-treedump. Support for member variables, constructors,
23482 destructors, properties, constants is there.
23484 Beginning of the IL backend, but very little done, just there for
23487 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23489 * cs-parser.jay: Fix labeled statement.
23491 * cs-tokenizer.cs (escape): Escape " and ' always.
23492 ref_line, ref_name: keep track of the line/filename as instructed
23493 by #line by the compiler.
23496 2001-04-27 Miguel de Icaza <miguel@ximian.com>
23498 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23499 to match the values in System.CodeDOM.
23501 Divid renamed to Divide.
23503 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23505 (Statements.set): remove.
23507 * System.CodeDOM/CodeCatchClause.cs: always have a valid
23510 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23511 falseStatements always have valid values.
23513 * cs-parser.jay: Use System.CodeDOM now.