1 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3 * anonymous.cs: Implemented ExprClassName.
5 * assign.cs (Assign.DoResolve): Don't chrash when type is not
8 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
11 * class.cs (StaticClass.DefineContainerMembers): Report protected
14 * codegen.cs: if(ed) PRODUCTION.
16 * convert.cs (Error_CannotImplicitConversion): Better error
19 * cs-parser.jay: More error checks.
21 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
23 * driver.cs (CSCParseOption): Enabled wrong option check.
25 * ecore.cs (Expression.ExprClassName): Turned to property.
26 (MemberExpr.CheckIntermediateModification): For checking boxed
27 value types modification.
29 * statement.cs (Fixed.Resolve): Expression type must be
30 convertible to fixed type.
31 (CollectionForeach.GetEnumeratorFilter,TryType):
32 Small refactoring for easier error checking.
34 2005-09-26 Marek Safar <marek.safar@seznam.cz>
36 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
39 * class.cs (GeneratedBaseInitializer): New class for customization
40 compiler generated initializers.
41 (MemberBase.DoDefine): Check Obsolete attribute here.
42 (FieldMember.DoDefine): Ditto.
44 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
47 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
48 (MemberCore.GetObsoleteAttribute): Removed argument.
49 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
50 (MemberCore.CheckObsoleteType): New helper.
54 * statement.cs: Updates after MemberCore changes.
56 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
57 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
59 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
60 obsolete attribute for compiler construct.
61 (As.DoResolve): Cache result.
63 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
65 2005-10-01 Miguel de Icaza <miguel@novell.com>
67 * expression.cs (Probe): instead of having a "Type probe_type"
68 keep the extra information as a TypeExpr probe_type_expr since the
69 "As" operator needs to perform some type checks.
71 * (As.DoResolve): If the type is a type parameter, ensure that it
72 is constrained by a class.
74 2005-09-22 Miguel de Icaza <miguel@novell.com>
76 * statement.cs (Lock): Use the TemporaryVariable class instead of
77 manually using local variables as those do not work when variables
80 * ecore.cs: Moved the TemporaryVariable class from being a nested
81 class inside Foreach to be a public class that can be employed in
84 2005-09-19 Marek Safar <marek.safar@seznam.cz>
86 * cs-parser.jay: interface_accessors replaced by
87 accessor_declarations.
89 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
92 * statement.cs (GotoCase.Resolve): Convert null constant to
94 (SwitchLabel.ResolveAndReduce): Ditto.
95 (SwitchLabel.NullStringCase): Custom null stamp.
96 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
98 typemanager.cs (CSharpSignature): Don't skip first argument
101 2005-09-16 Marek Safar <marek.safar@seznam.cz>
103 * cfold.cs, constant.cs, convert.cs, ecore.cs,
104 expression.cs, iterators.cs, literal.cs: Store constants and
107 * class.cs (MemberBase.ShortName): Pass location.
109 * cs-parser.jay: Some location fixes.
111 * ecore.cs (Expression.Location): Made virtual.
113 2005-09-27 Marek Safar <marek.safar@seznam.cz>
116 * const.cs (Const.ResolveValue): Check for assigning non-null
117 value to reference type.
119 2005-09-26 Raja R Harinath <rharinath@novell.com>
122 * expression.cs (This.VerifyFixed): In a value type T, the type of
123 'this' is T&, iow, 'this' is either an out or ref parameter. In a
124 value type R, 'this' is treated as a value parameter.
126 2005-09-05 Miguel de Icaza <miguel@novell.com>
128 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
129 if the underlying types are the same, otherwise we need to produce
130 code that will do the proper cast.
132 This was exposed by Marek's constant rewrite which produced
133 invalid code for the call site:
140 This fixes test-49.cs
142 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
144 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
145 Type/Object should be allowed as well. Fixed bug #75968.
147 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
149 * expression.cs : (Binary.DoResolve): when one is enum constant and
150 another is constant 0, then return enum one *as enum type*.
153 2005-10-04 Martin Baulig <martin@ximian.com>
155 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
156 `SetMemberIsUsed()' work for generics, too.
158 2005-10-04 Martin Baulig <martin@ximian.com>
160 * expression.cs (DelegateInvocation.EmitStatement): Make this work
161 for corlib. Fixes #75691.
163 2005-09-28 Marek Safar <marek.safar@seznam.cz>
166 * driver.cs: Fix compilation files with full root path.
168 2005-09-25 Miguel de Icaza <miguel@novell.com>
170 * report.cs (SymbolRelatedToPreviousError): Format the output so
171 it does not use an open parenthesis that is never closed.
173 * driver.cs: Follow coding guidelines
175 2005-09-18 Miguel de Icaza <miguel@novell.com>
177 * driver.cs: Set InEmacs based on the environment variable EMACS.
179 * location.cs (InEmacs): in this mode, do not report column
180 location as it confuses Emacs.
182 2005-10-03 Raja R Harinath <rharinath@novell.com>
184 * support.cs (SeekableStreamReader.Position): Don't error out when
185 the requested position is just beyond the end of the current
188 2005-09-28 Raja R Harinath <rharinath@novell.com>
190 * support.cs (SeekableStreamReader): Simplify drastically. Don't
191 try to keep in sync with the byte count of the underlying Stream.
192 However, this limits us to a window size of 2048 characters: i.e.,
193 the maximum lookahead of our lexer/parser can be 2048 characters.
195 2005-09-22 Martin Baulig <martin@ximian.com>
197 * driver.cs: Removed a debugging FIXME.
199 2005-09-21 Raja R Harinath <rharinath@novell.com>
201 * cs-parser.jay (type_arguments): Add CS1644 check.
202 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
204 2005-09-15 Raja R Harinath <rharinath@novell.com>
206 * Makefile (PROGRAM): Make profile specific.
207 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
208 the current directory.
211 * expression.cs (Invocation.EmitCall): Remove optimization on
212 this_call since it doesn't handle 'this' being a value type.
214 2005-09-05 Geoff Norton <gnorton@customerdna.com>
216 * driver.cs: Ensure file handles are closed after parsing
218 2005-09-05 Miguel de Icaza <miguel@novell.com>
220 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
221 if the underlying types are the same, otherwise we need to produce
222 code that will do the proper cast.
224 This was exposed by Marek's constant rewrite which produced
225 invalid code for the call site:
232 This fixes test-49.cs
234 2005-09-05 Martin Baulig <martin@ximian.com>
236 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
237 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
239 * cs-parser.jay (delegate_declaration): Small fix for #75852.
241 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
243 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
244 to be a pointer type due to the spec 25.2, so check if declaring
245 type is generic type definition. Fixed bug #75772.
247 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
250 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
251 both types are not defined by methods.
252 * expression.cs : (Invocation.IsApplicable): it should work when
253 the argument type is equal to the parameter type, not only when
254 ImplicitConversionExists() returns true.
256 2005-09-02 Raja R Harinath <rharinath@novell.com>
258 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
262 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
263 flow-branching for LocalVariableReferences in case we were invoked
265 * expression.cs (LocalVariableReference.VerifyAssigned): New.
267 (LocalVariableReference.DoResolveBase): ... this.
268 (MemberAccess.Resolve): Do the check that was disabled during
271 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
274 (PartialContainer.Create): check abstract/sealed/static strictly
275 but abstract/sealed can exist only at one side. Fixed bug #75883.
277 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
280 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
281 specified, don't default to UnmanagedType.I4.
283 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
285 * expression.cs : conditional operator should check possibly
286 incorrect assign expression. Fixed bug #75946.
288 2005-08-30 Raja R Harinath <rharinath@novell.com>
291 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
292 (ScopeInfo.EmitScopeType): Use it to construct field names from
293 names of captured locals.
296 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
297 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
298 Pass 'target_type' to BoxedCast. Don't default to 'object'.
299 (ExplicitConversion): Remove enum cases already handled by
300 implicit conversion. Move implicit conversion check to the beginning.
301 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
302 * expression.cs (ArrayCreation.EmitDynamicInitializers):
303 Don't treat System.Enum as a struct.
305 2005-08-30 Jb Evain <jbevain@gmail.com>
307 * attribute.cs: handles as expression in parameters.
309 2005-08-30 Raja R Harinath <rharinath@novell.com>
312 * class.cs (TypeContainer.VerifyClsName): Don't use a
313 PartialContainer when verifying CLS compliance.
314 (AbstractPropertyEventMethod): Set Parent here, ...
315 (PropertyMethod): ... not here.
317 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
319 * attribute.cs : escaped attribute name should not be allowed to be
320 resolved (e.g. @class as classAttribute). Fixed bug #75930.
322 2005-08-29 Raja R Harinath <rharinath@novell.com>
325 * convert.cs (ImplicitStandardConversionExists): Allow zero also
326 when converting a long constant to unsigned long.
327 * expression.cs (Invocation.OverloadResolve): Add sanity check to
328 detect where IsApplicable and VerifyArgumentsCompat disagree.
330 2005-08-29 Raja R Harinath <rharinath@novell.com>
331 and Carlos Alberto Cortez <carlos@unixmexico.org>
334 * class.cs (TypeContainer.CanElideInitializer): New helper.
335 (TypeContainer.EmitFieldInitializers): Use it to determine if we
336 can safely emitting the initializer of a field.
338 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
340 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
341 allowed inside a switch (without loop). Fixed bug #75433.
343 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
345 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
346 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
348 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
350 * driver.cs : kinda reverting the default encoding changes (not exact
351 revert since I noticed that "codepage:reset" might not work fine).
353 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
355 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
356 Location. Now getter and setter store location correctly.
357 (errors/cs0111-12.cs now reports the expected location.)
359 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
361 * driver.cs : Use default encoding on the environment.
362 Removed (now that) extra parameter for SeekableStreamReader.
363 * support.cs : (SeekableStreamReader) third .ctor() argument for
364 StreamReader is not required (always true). preamble size could
365 be acquired in simpler and safe way.
367 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
369 * cs-parser.jay: report CS0642 at warning level 3
370 and report CS0642 for an if else statement also
371 fixes bug #74745. Patch by John Luke (and a bit
373 Removed extra CS0642 warning check for "while",
375 * statement.cs: In Block.Resolve(), CS0642 check
376 is reimplemented to check a sequence of an empty
377 statement and a block.
381 2005-08-24 Marek Safar <marek.safar@seznam.cz>
383 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
384 detection until I fix it.
386 * cs-tokenizer.cs: Changed error message.
388 * cs-parser.jay: Fixed 2 error locations.
390 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
391 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
394 * enum.cs (GetSignatureForError): Fixed.
396 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
400 * typemanager.cs (RegisterProperty): Removed.
402 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
404 2005-08-24 Raja R Harinath <rharinath@novell.com>
407 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
408 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
410 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
412 * expression.cs : tiny fix is required for not warning positive ulong.
415 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
417 * expression.cs : add CS0652 check for constant and integral
418 expression. Fixed bug #53974.
420 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
422 * expression.cs : in DoNumericPromotions(), check if there is implicit
423 conversion overload for string (to check CS0034). Fixed bug #52492.
425 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
427 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
429 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
431 * ecore.cs : report location when it is *not* Null.
433 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
439 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
440 correctly. Fixed bug #75721.
442 2005-08-23 Raja R Harinath <rharinath@novell.com>
444 * support.cs (SeekableStreamReader.Position): Avoid an expensive
445 loop that performs 'min (pos, char_count)'.
448 * expression.cs (Unary.ResolveOperator): Don't discard implicit
449 converted value in Operator.OnesComplement.
451 2005-08-22 Ben Maurer <bmaurer@ximian.com>
453 * anonymous.cs: If the anon method is pulled into a helper class,
454 it needs to be `internal' not `private'. Fixes runtime behavior on
457 2005-08-17 Marek Safar <marek.safar@seznam.cz>
460 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
463 2005-08-16 Marek Safar <marek.safar@seznam.cz>
465 The big constants rewrite
466 Fix #75746, #75685 and more
467 As a side effect saved 1MB for MWF ;-)
469 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
470 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
471 enum based for corlib compilation.
473 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
476 * class.cs (FixedField.Define): Use ResolveAsConstant.
478 * const.cs (IConstant): Interface constants and enums.
479 (Const.ResolveValue): New method for constant resolvning.
480 (ExternalConstant): Constants from imported assemblies.
482 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
483 conversion; like enums.
484 (Constant.ToType): Converts this constant to different type.
485 (Constant.Increment): Adds 1.
487 * convert.cs (ImplicitConversionRequired): Simplified.
489 * cs-parser.jay: Create EnumMember directly.
491 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
493 * doc.cs (GenerateEnumDocComment): Removed.
495 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
496 (ConvertIntLiteral): Removed.
497 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
499 * enum.cs (EnumMember): Implement IConstant.
500 (Enum.IsValidEnumConstant): Removed.
501 (Enum.GetNextDefaultValue): Removed.
502 (Enum.FindMembers): Updated.
503 (Enum.GenerateDocComment): Iterate enum members.
505 * expression.cs (Cast.TryReduce): Handle enums correctly.
506 (New.Constantify): Made public.
507 (MemberAccess.DoResolve): Removed contant specific if(s).
509 * literal.cs (NullLiteral): Implement new abstract methods.
511 * statement.cs (GotoCase.Resolve): Use new constant methods.
512 (SwitchLabel.ResolveAndReduce): Use new constant methods.
514 * typemanager.cs (LookupEnum): Removed.
515 (IsEnumType): Fixed to work with corlib.
516 (RegisterConstant): Removed.
517 (LookupConstant): Removed.
518 (GetConstant): Changed to work with IConstant.
520 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
522 * location.cs : Fixed overflown (>255) column number.
524 2005-08-03 Raja R Harinath <rharinath@novell.com>
526 First cut of the qualified-alias-member feature.
527 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
529 * cs-parser.jay (DOUBLE_COLON): New token.
530 (namespace_or_type_name): Add rule for recognizing
531 qualified-alias-members.
532 (primary_expression): Likewise.
533 (element_access): Allow QualifiedAliasMember as a possible
534 type-bearing expression.
535 (local_variable_type, local_variable_pointer_type): Likewise.
536 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
537 aliases in the current and enclosing namespace declarations.
538 (NamespaceEntry.UsingAlias): Add CS0440 warning.
539 * decl.cs (MemberName.is_double_colon): New.
540 (MemberName.MemberName): Add new constructor for alias-member.
541 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
542 * expression.cs (QualifiedAliasMember): New expression type.
544 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
546 * location.cs : it borked when no argument was specified.
548 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
550 * location.cs : tiny ToString() format fix.
552 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
554 * statement.cs : oops, it was missing.
556 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
558 A set of fixes for precise line/column location.
561 "token" field now holds a file/line "delta", a line number offset
562 from the segment, and a column number. See also:
563 http://lists.ximian.com/pipermail/mono-devel-list/2004-
565 Removed static IsNull. Use instance IsNull property instead.
567 For some tokens it stores Location. For Identifier it stores
568 LocatedToken which is a pair of string name and location.
569 Column numbers are adjusted only at getChar().
571 Use Location.ToString() for reporting (it now contains column).
573 Largely modified to use LocatedToken instead of
574 string (IDENTIFIER), and to acquire Location from some tokens.
575 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
576 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
578 Now MemberName holds Location. DeclSpace.ctor() receives Location
579 as a parameter. Removed extra parameters to all derived classes.
580 Replaced Location.IsNull() with instance property.
581 * assign.cs, expression.cs :
582 Added .ctor() overload that omits Location.
584 Added "nameEscaped" flag that indicates the identifier was escaped
585 in the source file. This fixes bug #57047.
587 2005-09-02 Martin Baulig <martin@ximian.com>
589 * class.cs: Make CS3005 a warning, not an error.
591 2005-08-02 Marek Safar <marek.safar@seznam.cz>
593 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
594 New method, looking for lo-case imported cls type.
596 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
599 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
601 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
603 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
605 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
607 Optimized to save 3.5 MB for SWF compilation.
609 2005-08-01 Marek Safar <marek.safar@seznam.cz>
611 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
612 (PartialContainer.Create): Moved logic AddToContainer.
613 (PartialContainer.MarkForDuplicationCheck): Shares name.
615 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
618 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
620 (Namespace.GetSignatureForError): New method.
622 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
623 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
625 2005-08-01 Raja R Harinath <rharinath@novell.com>
628 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
629 member lookup rather than qualifier_type, since qualifier_type can
632 2005-08-01 Marek Safar <marek.safar@seznam.cz>
634 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
637 2005-07-31 Miguel de Icaza <miguel@novell.com>
639 * statement.cs: Copy the local exception into the exception
640 captured local. Fixes 75674
642 2005-07-31 Raja R Harinath <harinath@gmail.com>
645 * expression.cs (Invocation.OverloadResolve): Don't report error
646 CS1501 if error CS1502 has been reported.
647 (New.DoResolve): Delegate CS1501 reporting to
648 Invocation.OverloadResolve.
651 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
652 invariant-meaning-in-block property in an enclosing block if
655 2005-07-29 Marek Safar <marek.safar@seznam.cz>
657 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
658 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
659 (Switch.CheckSwitch): Just save 50kb for SWF.
661 2005-07-27 Martin Baulig <martin@ximian.com>
663 * anonymous.cs (CaptureContext.AddField): Added
664 `AnonymousContainer am' argument; compute its toplevel scope if
665 it's not already computed. Fixes #75649.
667 2005-07-26 Raja R Harinath <rharinath@novell.com>
670 * class.cs (Constructor.Emit): Reset block to null if the block
673 2005-07-25 Marek Safar <marek.safar@seznam.cz>
675 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
677 2005-07-25 Marek Safar <marek.safar@seznam.cz>
679 * class.cs (MethodData.Define): Check whether accessor implementing
682 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
684 2005-07-22 Marek Safar <marek.safar@seznam.cz>
687 * namespace.cs (LookupType): Moved same type check to...
689 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
692 2005-07-21 Raja R Harinath <rharinath@novell.com>
694 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
695 already found a typebuilder.
696 * class.cs (MethodCore.IsDuplicateImplementation): Compare
697 MemberNames, not strings.
699 * const.cs (Error_ExpressionMustBeConst):
700 Rename from Error_EpressionMustBeConst.
701 * const.cs, class.cs, statement.cd: Update.
703 2005-07-21 Marek Safar <marek.safar@seznam.cz>
707 * const.cs (Const.LookupConstantValue): Report missing contant expression
709 (Error_EpressionMustBeConstant): Only one error method.
711 * class.cs, statement.c: Updated.
713 2005-07-20 Raja R Harinath <rharinath@novell.com>
715 * statement.cs (Block.Flags): Add back HasVarargs.
716 (Block.flags): Make protected.
717 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
719 * typemanager.cs (types, typecontainers, user_types): Remove.
720 (UserTypes, TypeContainers): Likewise.
721 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
722 (CleanUp, Reset): Update.
723 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
724 (GetNestedType): Use Type.GetNestedType.
725 (CoreLookupType): Take two arguments, the namespace and the
726 basename of the type. Update to use the Namespace.Lookup
728 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
729 (RealMemberLookup): Use IsNestedChildOf instead of playing with
730 string concatenation and substring matches.
731 * class.cs, enum.cs, delegate.cs: Update to changes.
733 2005-07-20 Marek Safar <marek.safar@seznam.cz>
735 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
736 Expression and made virtual.
738 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
739 (ImplicitStandardConversionExists): Fixed `byte' typo ?
741 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
743 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
746 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
749 2005-07-18 Marek Safar <marek.safar@seznam.cz>
752 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
753 AssemblyCultureAttribute is not used on executable.
756 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
758 2005-07-16 Raja R Harinath <rharinath@novell.com>
761 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
762 New. Reports CS0252/CS0253.
763 Mostly taken from preliminary patch by Duncak Mak.
764 (Binary.DoResolveOperator): Store results of operator lookup.
765 Use them to detect if we need to warn about unintended reference
768 2005-07-15 Raja R Harinath <rharinath@novell.com>
771 * namespace.cs (Namespace.Lookup): Add back location parameter.
772 (Namespace.LookupType): Add CS0436 report. Add location parameter.
773 * delegate.cs, ecore.cs, expression.cs: Update to changes.
775 * codegen.cs (EmitContext.DeclSpace): Make readonly.
776 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
777 (Namespace.LookupType): ... this.
778 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
780 * typemanager.cs (LookupTypeReflection): Remove buggy code that
781 purported to handle pointers.
782 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
785 2005-07-15 Marek Safar <marek.safar@seznam.cz>
787 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
790 2005-07-15 Raja R Harinath <rharinath@novell.com>
792 * namespace.cs (Namespace.Lookup): Drop location parameter.
793 (NamespaceEntry.LookupAlias): Remove. Merge into ...
794 (NamespaceEntry.Lookup): ... this.
795 (NamespaceEntry.Error_AmbiguousTypeReference):
796 Move here from DeclSpace.
797 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
799 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
800 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
801 Move to NamespaceEntry.
802 * delegate.cs, expression.cs: Update to changes.
804 2005-08-31 Martin Baulig <martin@ximian.com>
806 Committing a patch from Atsushi Enomoto for #75850.
808 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
809 Prefer a generic enumerator over a non-generic one.
811 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
813 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
814 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
816 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
818 * driver.cs : reverting default encoding change as well as mcs.
820 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
822 * driver.cs, support.cs : merged r48826.
824 > could you integrate your mcs changes to gmcs otherwise
825 > gmcs cannot compile some files.
827 2005-08-20 Martin Baulig <martin@ximian.com>
829 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
830 scope if we don't already have it.
832 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
833 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
836 2005-07-31 Miguel de Icaza <miguel@novell.com>
838 * statement.cs: Copy the local exception into the exception
839 captured local. Fixes 75674
841 2005-07-15 Marek Safar <marek.safar@seznam.cz>
843 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
846 2005-08-12 Martin Baulig <martin@ximian.com>
848 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
849 for nested types here to avoid hitting the cache too early.
851 2005-08-09 Miguel de Icaza <miguel@novell.com>
853 * enum.cs: On the new compiler CLS error 3005 is now a warning not
856 2005-08-03 Martin Baulig <martin@ximian.com>
858 Make iterators in generic methods work; see gtest-191.cs.
861 (Constraints.Resolve): Protect against being called twice.
864 (TypeContainer.GetClassBases): Make this `protected virtual'.
866 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
867 (Iterator.GetClassBases): Override this and compute the base
869 (Iterator.DefineNestedTypes): If we're a generic method, all our
870 method type parameters become class type parameters on the proxy
874 (ToplevelBlock.Parameters): Make this a property, not a field.
875 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
877 2005-08-03 Martin Baulig <martin@ximian.com>
879 * typemanager.cs (TypeManager.IsSubclassOf): Use
880 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
881 (TypeManager.GetFullName_recursed): Improved.
883 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
886 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
887 Private accessor case, using TypeManager.IsPrivateAccessible instead of
888 invocation_type == mi.DeclaringType, since the first one also checks
889 other condition used by generic instances.
891 2005-07-27 Martin Baulig <martin@ximian.com>
893 * anonymous.cs (CaptureContext.AddField): Added
894 `AnonymousContainer am' argument; compute its toplevel scope if
895 it's not already computed. Fixes #75649.
897 2005-07-14 Marek Safar <marek.safar@seznam.cz>
899 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
900 CheckAttributeType and refactored.
901 (Attribute.ResolvePossibleAttributeType): Changed to reuse
902 ResolveAsTypeTerminal error handling.
903 (ResolveAsTypeTerminal): Introduced because of global attributes extra
905 (GetSignatureForError): Print errors in same way.
908 * codegen.cs: Reflect attribute GetSignatureForError change.
911 * expression.cs: Add silent parameter to ResolveAsTypeStep.
913 * namespace.cs (UsingEntry): Refactored to make fields private.
916 statement.cs: Error_UnexpectedKind has extra parameter.
918 2005-07-14 Raja R Harinath <rharinath@novell.com>
920 * ecore.cs (IAlias): Remove.
921 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
922 that implement the interface.
923 * namespace.cs (Namespace): Likewise.
924 (Namespace.declspaces): Renamed from 'defined_names'.
925 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
926 DeclSpace instead of an IAlias.
927 * tree.cs (Tree.AddDecl): Update.
929 2005-07-12 Raja R Harinath <rharinath@novell.com>
931 * statement.cs (Block.Flags); Remove HasVarargs.
932 (Block.HasVarargs): Move to ToplevelBlock.
933 (Block.ThisVariable, Block.AddThisVariable): Likewise.
934 (Block.Variables): Make protected. Initialize variable hashtable
936 (Block.AddVariable): Update.
937 (Block.Resolve): Update to changes.
938 (ToplevelBlock.HasVarargs): New boolean.
939 (ToplevelBlock.ThisVariable): Move here from Block.
940 (ToplevelBlock.AddThisVariable): Likewise.
941 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
942 * expression.cs (This.ResolveBase): Update to changes.
943 (ArglistAccess.DoResolve): Likewise.
945 2005-07-11 Marek Safar <marek.safar@seznam.cz>
948 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
950 * class.cs (TypeContainer.VerifyMembers): Distinguish between
951 not used and not used & assigned.
952 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
954 2005-07-11 Marek Safar <marek.safar@seznam.cz>
957 * expression.cs (Is.DoResolve): null is never provided type.
959 2005-07-08 Marek Safar <marek.safar@seznam.cz>
962 * cs-parser.jay: Less strict event error rule to catch more errors.
964 2005-07-11 Martin Baulig <martin@ximian.com>
966 * generic.cs (ConstructedType.CheckConstraints): Improve the check
967 for the constructor constraint: we do not only have to check
968 whether the class has a public constructor, but also ensure that
969 it's parameterless. Fixes #75492.
971 2005-07-11 Martin Baulig <martin@ximian.com>
973 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
974 between type parameters if they either have the reference type
975 constraint or the class constraint.
977 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
979 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
981 2005-07-07 Marek Safar <marek.safar@seznam.cz>
984 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
985 (ExtractSecurityPermissionSet): Cope with self referencing security
988 * driver.cs (SetOutputFile): Made public property OutputFile.
990 2005-07-07 Raja R Harinath <rharinath@novell.com>
993 * class.cs (TypeContainer.first_nonstatic_field): Rename from
994 has_nonstatic_fields. Make into a FieldBase pointer.
995 (TypeContainer.AddField): Add CS0282 check.
996 (TypeContainer.EmitType): Update.
998 2005-07-06 Miguel de Icaza <miguel@novell.com>
1000 * cs-tokenizer.cs (consume_identifier): Do not create strings to
1001 compare if they start with __.
1003 2005-07-06 Raja R Harinath <rharinath@novell.com>
1005 * statement.cs (Switch.SwitchGoverningType): Only look at
1006 UserCasts that don't need implicit standard conversions to one of
1007 the allowed switch types (Fixes test-322.cs).
1008 (LocalInfo.Resolve): Re-enable sanity-test.
1010 2005-07-06 Marek Safar <marek.safar@seznam.cz>
1012 * cs-tokenizer.cs (consume_identifier): Detect double undescores
1014 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1016 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1018 2005-07-06 Raja R Harinath <rharinath@novell.com>
1021 * ecore.cs (SimpleName.GetSignatureForError): Add.
1022 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1023 (MemberAccess.GetSignatureForError): Add.
1025 2005-07-05 Marek Safar <marek.safar@seznam.cz>
1027 The big error and warning messages review.
1057 * typemanager.cs: Updated.
1059 * class.cs: (MethodCore.SetYields): Moved here to share.
1060 (PropertyMethod.Define): Moved iterator setup here.
1062 * iterators.cs: Add orig_method to have full access to parent
1065 2005-07-05 Raja R Harinath <rharinath@novell.com>
1067 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1068 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1069 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1070 variable of struct type.
1071 * expression.cs (Unary.ResolveOperator): Update to change.
1072 (Indirection.VerifyFixed): Likewise.
1073 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1074 (ParameterReference.VerifyFixed): Value parameters are fixed.
1075 (This.VerifyFixed): Treat 'this' as a value parameter.
1076 * statement.cs (LocalInfo.IsFixed): Remove.
1078 2005-07-01 Martin Baulig <martin@ximian.com>
1080 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1081 `ec.EmitThis ()' to get the correct scope.
1083 2005-07-01 Martin Baulig <martin@ximian.com>
1085 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1086 instance is a ParameterReference; fixes #75299.
1088 2005-06-30 Raja R Harinath <rharinath@novell.com>
1091 * expression.cs (Indexers.map): Remove.
1092 (Indexers.Append): Filter out inaccessible setters and getters.
1093 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1096 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
1098 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1099 (FieldExpr.Emit, PropertyExpr.Emit): Update.
1100 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1101 * expression.cs (Invocation.EmitCall): Add CS0120 check.
1103 2005-06-30 Marek Safar <marek.safar@seznam.cz>
1106 * class.cs (FieldBase.GetInitializerExpression): One more field
1109 2005-06-28 Miguel de Icaza <miguel@novell.com>
1111 * pending.cs: Do not define a proxy if the base method is virtual,
1112 it will be picked up by the runtime (bug 75270).
1114 2005-07-08 Martin Baulig <martin@ximian.com>
1116 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1117 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1119 2005-07-07 Martin Baulig <martin@ximian.com>
1121 * generic.cs (ConstructedType.CheckConstraint): Use
1122 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
1123 called recursively; fixes #75329.
1125 2005-07-06 Martin Baulig <martin@ximian.com>
1127 * generic.cs (TypeManager.InferTypeArguments): Added support for
1128 anonymous methods; fixes #75461.
1130 2005-07-01 Martin Baulig <martin@ximian.com>
1132 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1133 `ec.EmitThis ()' to get the correct scope.
1135 2005-07-01 Martin Baulig <martin@ximian.com>
1137 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
1138 instance is `This'; fixes #75299.
1140 2005-06-30 Martin Baulig <martin@ximian.com>
1142 * class.cs (Indexer): Implement IIteratorContainer; added support
1143 for iterators in indexers.
1146 (EmitContext.CurrentIterator): Make this a property, not a field.
1148 * anonymous.cs (AnonymousContainer.Iterator): New public property.
1150 2005-06-28 Miguel de Icaza <miguel@novell.com>
1152 * pending.cs: Do not define a proxy if the base method is virtual,
1153 it will be picked up by the runtime (bug 75270).
1155 2005-06-28 Martin Baulig <martin@ximian.com>
1157 * cs-parser.jay (interface_method_declaration): Avoid a
1158 reduce/reduce conflict by moving some of the code into a separate
1159 `interface_method_declaration_body' rule; fixes #75368.
1161 2005-06-28 Martin Baulig <martin@ximian.com>
1163 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
1164 array check after the check for TypeBuilder's.
1166 2005-06-21 Raja R Harinath <rharinath@novell.com>
1168 * convert.cs (FindMostEncompassedType): Add two trivial special
1169 cases (number_of_types == 0 || number_of_types == 1).
1170 (FindMostEncompasingType): Likewise.
1172 2005-06-17 Raja R Harinath <rharinath@novell.com>
1174 Some cleanups preparing for the fix of #75283.
1175 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1177 (EventExpr.InstanceResolve): Likewise.
1178 (EventExpr.DoResolve): Remove redundant checks.
1180 2005-06-08 Miguel de Icaza <miguel@novell.com>
1182 * class.cs: Small fix.
1184 2005-06-08 Raja R Harinath <rharinath@novell.com>
1187 * class.cs (GetPartialBases): Fix return value check of
1190 2005-06-07 Raja R Harinath <rharinath@novell.com>
1192 Ensure that partial classes are registered in their enclosing
1193 namespace. Initial part of fix of #75160.
1194 * tree.cs (Tree.RecordDecl): Add new namespace argument.
1195 Register declspace with namespace here, not in
1196 DeclSpace.RecordDecl.
1197 * cs-parser.jay: Pass namespace to RecordDecl.
1198 * class.cs (PartialContainer.Create): Likewise.
1199 (ClassPart.DefineType): New sanity-check. Throws an exception if
1201 * decl.cs (Declspace.RecordDecl): Remove.
1202 * namespace.cs (NamespaceEntry.DefineName): Remove.
1204 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1206 * rootcontext.cs: Reset TargetExt as well.
1208 2005-06-03 Raja R Harinath <rharinath@novell.com>
1210 * ecore.cs (Expression.Resolve): Emit CS0654 error when
1213 2005-06-02 Raja R Harinath <rharinath@novell.com>
1215 Fix #75080, cs0119.cs.
1216 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
1218 (Expression.Resolve): ... this. Use it. Remove bogus code
1219 allowing ExprClass.Type and ExprClass.Namespace for
1220 ResolveFlags.VariableOrValue.
1221 (Expression.Resolve) [1-argument variant]: Change default resolve
1222 flags based on language version.
1223 (Expression.Error_UnexpectedKind): Use a simple string array
1224 rather than an ArrayList.
1225 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1227 (TypeOfVoid.DoResolve): Likewise.
1228 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
1229 flags argument -- it always has the same value.
1231 2005-05-31 Raja R Harinath <rharinath@novell.com>
1234 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1235 Use it in the error message.
1236 * assign.cs, expression.cs, statement.cs: Update.
1238 2005-05-30 Raja R Harinath <rharinath@novell.com>
1241 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1242 the "almostMatchedMember" case too.
1243 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1244 that failed the accessibility checks to 'almost_match'.
1246 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
1248 * attribute.cs: Use internal MethodBuilder methods to set
1249 ExactSpelling and SetLastError on PInvoke methods, instead
1250 of passing them via charset. Fixes #75060.
1252 2005-05-27 Raja R Harinath <rharinath@novell.com>
1254 * parameter.cs (Parameter): Remove TODO comment.
1255 (Parameter.DefineParameter): Remove Location parameter.
1256 (Parameters.LabelParameters): Likewise.
1257 * class.cs (Constructor.Emit): Update to change.
1258 (MethodData.Emit): Likewise.
1259 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
1260 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1262 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
1265 Removed Parameters.Location and added Parameter.Location instead.
1266 Removed Location parameter from Emit() and GetSignature().
1273 Modified all related calls.
1275 2005-06-21 Martin Baulig <martin@ximian.com>
1277 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
1278 left-hand side is not a nullable type; fixes #75328.
1280 2005-06-21 Martin Baulig <martin@ximian.com>
1283 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
1284 (TypeManager.GetFullNameSignature): Likewise.
1286 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
1287 `source.FullName' and `target.FullName' to check whether there are
1288 two conflicting definitions.
1290 2005-06-21 Martin Baulig <martin@ximian.com>
1292 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
1293 a BoxedCast - also for reference types - to be compatible with csc.
1295 2005-06-21 Martin Baulig <martin@ximian.com>
1297 * expression.cs (MemberAccess.DoResolve): Add support for nested
1298 types in a generic instance; fixes #75320.
1300 2005-06-20 Martin Baulig <martin@ximian.com>
1302 * generic.cs (TypeManager.InferType): Also walk the class
1303 hierarchy for generic instances; fixes #75261.
1305 2005-06-17 Martin Baulig <martin@ximian.com>
1307 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
1308 to make things work for corlib.
1310 2005-06-15 Martin Baulig <martin@ximian.com>
1312 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
1313 obsolete `SecurityAction' values.
1315 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1317 * rootcontext.cs: Reset TargetExt as well.
1319 2005-06-09 Martin Baulig <martin@ximian.com>
1321 * delegate.cs (Delegate.VerifyMethod): Added
1322 `MethodGroupExpr old_mg' argument; inherit its
1323 `HasTypeParameters'; fix #75085.
1325 2005-06-09 Martin Baulig <martin@ximian.com>
1327 * expression.cs (Invocation.OverloadResolve): Correctly handle
1328 generic methods for the SetMemberIsUsed(); fix #75064.
1330 2005-06-09 Martin Baulig <martin@ximian.com>
1332 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
1335 2005-06-08 Martin Baulig <martin@ximian.com>
1337 * cs-parser.jay (nullable_type_or_conditional): If we put the
1338 nullable back and our `type' is a `ComposedCast', remove the
1339 nullable from it. Fixes #75156.
1341 * expression.cs (ComposedCast.RemoveNullable): New public method.
1343 2005-06-08 Martin Baulig <martin@ximian.com>
1345 The big Iterators rewrite :-)
1347 * iterators.cs: Rewrite this to use the anonymous methods framework.
1349 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1350 before the TypeContainers; see 2test-21.cs.
1353 (TypeContainer.DefineType): Don't create a new EmitContext if we
1354 already have one (this only happens if we're an Iterator).
1355 (TypeContainer.Define): Also call Define() on all our iterators.
1356 (Method.CreateEmitContext): Added support for iterators.
1359 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1360 (AnonymousContainer.CreateMethodHost): Moved here from
1361 AnonymousMethod and made abstract.
1362 (AnonymousContainer.CreateScopeType): New abstract method.
1363 (AnonymousContainer.IsIterator): New public property.
1364 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1365 get the ScopeTypeBuilder rather than manually defining it here.
1366 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1369 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1370 before RootContext.DefineTypes().
1372 * codegen.cs (EmitContext.RemapToProxy): Removed.
1373 (EmitContext.CurrentAnonymousMethod): Changed type from
1374 AnonymousMethod -> AnonymousContainer.
1375 (EmitContext.ResolveTopBlock): Protect from being called twice.
1376 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1377 (EmitContext.EmitThis): Removed the iterators hacks; use the
1378 anonymous methods framework for that.
1381 (ToplevelBlock.Container): Make this a property, not a field.
1382 (ToplevelBlock.ReParent): New public method; move the
1383 ToplevelBlock into a new container.
1384 (Foreach.TemporaryVariable): Simplify.
1386 2005-06-05 Martin Baulig <martin@ximian.com>
1388 * statement.cs (LocalInfo.CompilerGenerated): New flag.
1389 (Block.AddTemporaryVariable): New public method; creates a new
1390 `LocalInfo' for a temporary variable.
1391 (Block.EmitMeta): Create the LocalBuilders for all the temporary
1393 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1394 non-iterator variables.
1396 2005-06-05 Martin Baulig <martin@ximian.com>
1398 * statement.cs (Foreach.TemporaryVariable): Create the
1399 LocalBuilder in the Emit phase and not in Resolve since in some
1400 situations, we don't have an ILGenerator during Resolve; see
1401 2test-19.cs for an example.
1403 2005-06-04 Martin Baulig <martin@ximian.com>
1405 The big Foreach rewrite - Part II.
1407 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1408 with `PropertyInfo ienumerator_getcurrent'.
1410 * codegen.cs (VariableStorage): Removed.
1413 (Foreach): Derive from Statement, not ExceptionStatement.
1414 (Foreach.CollectionForeach): New nested class. Moved all the code
1415 dealing with collection foreach here.
1416 (Foreach.ForeachHelperMethods): Removed.
1417 (Foreach.TemporaryVariable): Implement IMemoryLocation.
1419 2005-05-23 Martin Baulig <martin@ximian.com>
1421 * statement.cs (Try.DoResolve): Don't create a `finally' if we
1422 don't need to. Fix #75014.
1424 2005-05-26 Raja R Harinath <rharinath@novell.com>
1426 Improve user-defined conversion handling.
1427 * convert.cs (GetConversionOperators): Rewrite. Return only the
1428 applicable operators.
1429 (AddConversionOperators): New. Helper for GetConversionOperators.
1430 (FindMostEncompassedType, FindMostEncompassingType): Verify that
1431 there is only one most encompassed/encompassing type.
1432 (FindMostSpecificSource, FindMostSpecificTarget): Remove
1433 "applicable operator" handling.
1434 (UserConversion): Move cache here from GetConversionOperators.
1435 Directly cache the chosen operator, rather than the whole
1437 (ExplicitNumericConversion): Fix buggy implementation of Decimal
1438 case. Allow conversion of decimal to sbyte and byte too.
1439 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1440 New static methods. Used to avoid allocating EmptyExpressions in
1443 2005-05-24 Duncan Mak <duncan@novell.com>
1445 * ecore.cs (CastFromDecimal): New class for casting a decimal to
1446 another class, used in Convert.ExplicitNumericConversion.
1447 (CastToDecimal): New class, similar to above, but casts to
1448 System.Decimal, used in Convert.ImplicitNumericConversion and also
1449 in explicit convesion from double/float to decimal.
1451 * convert.cs (ImplicitNumericConversion): Handle implicit
1452 conversions to System.Decimal.
1453 (ExplicitNumericConversion): handle explicit conversions to
1458 2005-05-20 Miguel de Icaza <miguel@novell.com>
1460 * typemanager.cs: Do not throw an exception in the TypeBuilder
1461 case, we take care of it on the TypeCode.
1463 2005-05-17 Marek Safar <marek.safar@seznam.cz>
1465 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1468 * cs-parser.jay: Catch more lexical errors.
1470 * report.cs: Add one more Error method.
1473 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1475 2005-05-20 Martin Baulig <martin@ximian.com>
1477 * class.cs (TypeContainer.CircularDepException): Removed.
1478 (TypeContainer.DefineType): Removed the `InTransit' stuff.
1479 (TypeContainer.CheckRecursiveDefinition): Check for circular class
1480 (CS0146) and interface (CS0529) dependencies here.
1482 2005-05-20 Martin Baulig <martin@ximian.com>
1484 * expression.cs (New.DoResolve): Move the CS0712 check above the
1485 CS0144 check; otherwise it can never be reached.
1487 2005-05-20 Martin Baulig <martin@ximian.com>
1489 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
1491 2005-05-20 Martin Baulig <martin@ximian.com>
1493 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
1495 * typemanager.cs (TypeManager.IsAttributeType): New public method.
1497 2005-05-19 Martin Baulig <martin@ximian.com>
1500 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1501 to disable error reporting.
1503 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1504 here since we don't want to report an error; see the new test-336.cs.
1506 2005-05-19 Raja R Harinath <rharinath@novell.com>
1508 * statement.cs (ToplevelBlock.GetParameterReference)
1509 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1510 Move here from class Block.
1511 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1512 * expression.cs (ParameterReference.DoResolveBase): Likewise.
1514 2005-05-18 Martin Baulig <martin@ximian.com>
1519 (FlowBranching.Reachability): Add non-static public And() and Or()
1521 (FlowBranchingSwitch): New class; do the `break_origins' thing
1522 like in FlowBranchingLoop.
1523 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1524 reachability, not just locals and parameters.
1525 (FlowBranching.MergeChild): Remove some of the hacks for loop and
1526 switch; MergeBreakOrigins() now takes care of that.
1528 2005-05-18 Martin Baulig <martin@ximian.com>
1530 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1531 a loop and may leave it, reset the barrier; fixes #74974.
1533 2005-05-16 Raja R Harinath <rharinath@novell.com>
1535 Fix test-382.cs. Emit values of decimal constants.
1536 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1538 (TypeContainer.AddField): ... this.
1539 (TypeContainer.EmitFieldInitializers): Allow the list of fields
1540 with initializers to include 'Const's.
1541 (ClassPart.RegisterFieldForInitialization): Forward to
1543 * const.cs (Const.Const): Pass initializer to base class.
1544 (Const.Define): In case of decimal constants, register them for
1545 initialization in a static constructor.
1547 2005-05-14 Martin Baulig <martin@ximian.com>
1549 * statement.cs (Block.Resolve): Correctly handle unreachable code;
1550 do not call ResolveUnreachable() on unreachable statements in
1551 here, see the comment in the source code.
1553 2005-05-13 Raja R Harinath <rharinath@novell.com>
1556 * expression.cs (BinaryResolveOperator): If one of the operands of
1557 an equality comparison is 'null' and the other is a pointer type,
1558 convert the null to a NullPointer.
1559 * convert.cs (ImplicitReferenceConversion): If the expression is a
1560 NullLiteral and the target type is a pointer type, return a
1561 NullPointer instead.
1562 (ImplicitConversionStandard): Likewise.
1564 2005-05-13 Marek Safar <marek.safar@seznam.cz>
1566 * cs-parser.jay: Set readonly context based on special constructs.
1568 * expression.cs (LocalVariableReference.DoResolveBase): Improved
1569 readonly variable error handling.
1571 * rootcontext.cs (EmitCode): Don't verify members when error
1574 * statement.cs (LocalInfo): Add reaodnly context information.
1575 (SetReadOnlyContext, GetReadOnlyContext): New methods.
1577 2005-05-17 Martin Baulig <martin@ximian.com>
1579 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1582 2005-05-13 Martin Baulig <martin@ximian.com>
1584 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
1585 handle unreachable blocks.
1587 2005-05-13 Martin Baulig <martin@ximian.com>
1590 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1591 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1594 2005-05-13 Martin Baulig <martin@ximian.com>
1596 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1597 instance variable, not a local. Fix #74873.
1598 (Block.ResolveUnreachable): Set it to true here.
1600 2005-05-12 Martin Baulig <martin@ximian.com>
1602 * cs-parser.jay (property_declaration): Pass the `current_class',
1603 not the `current_container' to Property's .ctor. Fixes #74912.
1605 2005-05-11 Martin Baulig <martin@ximian.com>
1607 * typemanager.cs (Closure): Copy this from MCS and merge all the
1608 GMCS-specific changes into it.
1610 2005-05-12 Raja R Harinath <harinath@gmail.com>
1613 * typemanager.cs (unmanaged_enclosing_types): New.
1614 (IsUnmanagedType): Avoid infloops by using
1615 'unmanaged_enclosing_types' to talk with recursive invocations.
1617 2005-05-11 Duncan Mak <duncan@novell.com>
1619 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1620 continuing to process for 'arg'.
1621 (handle_preprocessing_directive): Check the argument of the #endif
1622 directive and report error CS1025 if there are any trailing
1625 According to the C# spec, having even whitespace after the #endif
1626 directive is illegal; however, because we call arg.TrimEnd ()
1627 beforehand, we have the same behavior as csc, allowing whitespace
1628 after the directive.
1632 2005-05-11 Marek Safar <marek.safar@seznam.cz>
1636 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1637 (Constructor.GetObsoleteAttribute): Implemented correctly.
1639 2005-05-10 Martin Baulig <martin@ximian.com>
1641 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1642 resolve the type; fixes #74864.
1643 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1644 in DoResolve(); fixes #74862.
1646 2005-05-10 Martin Baulig <martin@ximian.com>
1648 * support.cs (ReflectionParameters.ParameterModifier): Use
1649 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1650 and `ParameterAttributes.In'. Fixes #74884.
1652 2005-05-10 Martin Baulig <martin@ximian.com>
1654 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1655 the cache if we're just looking for `MemberTypes.NestedType' in a
1658 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1659 constraints if we're still resolving the type tree.
1660 (Expression.MemberLookup): If we're resolving the type tree, only
1661 look for `MemberTypes.NestedType' since we're only interested in
1664 * class.cs (TypeContainer.DefineType): Don't resolve the type
1665 parameters here; do this later in ResolveType() after the type
1666 tree has been resolved.
1667 (TypeContainer.ResolveType): New public method; this is called
1668 after the type tree is resolved and before the types are being
1669 populated. We resolve the generic constraints here.
1670 (TypeContainer.DoDefineMember): Check the constraints on our base
1671 class and interfaces.
1673 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1674 set the `ResolvingTypeTree' flag on the EmitContext.
1676 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1678 2005-05-10 Marek Safar <marek.safar@seznam.cz>
1680 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1682 * expression.cs (Argument.GetParameterModifier): Turned to property.
1683 (Invocation.Error_InvalidArguments): Add more descriptive errors.
1685 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1688 2005-05-09 Raja R Harinath <rharinath@novell.com>
1691 * decl.cs (MemberCache.AddMethods): Register override methods,
1692 rather than non-override methods.
1693 * typemanager.cs (RegisterOverride): New.
1694 (IsOverride): Update.
1696 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1698 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1700 2005-05-06 Martin Baulig <martin@ximian.com>
1703 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1704 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1706 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1710 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1711 recursive declaration.
1713 * statement.cs (Block.ResolveMeta): Report any error in resolving.
1715 2005-05-06 Marek Safar <marek.safar@seznam.cz>
1717 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1719 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1721 2005-05-05 Raja R Harinath <rharinath@novell.com>
1724 * decl.cs (DeclSpace.FamilyAccessible):
1725 Use TypeManager.IsNestedFamilyAccessible.
1727 Fix reopened #64812.
1728 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1731 2005-05-04 Raja R Harinath <rharinath@novell.com>
1732 Abin Thomas <projectmonokochi@rediffmail.com>
1733 Anoob V E <projectmonokochi@rediffmail.com>
1734 Harilal P R <projectmonokochi@rediffmail.com>
1737 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1738 allow access to all static members.
1740 2005-05-04 Martin Baulig <martin@ximian.com>
1742 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1744 2005-05-04 Martin Baulig <martin@ximian.com>
1748 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1749 section at the end; make things work if `default' is not the last
1752 2005-05-04 Martin Baulig <martin@ximian.com>
1756 * statement.cs (Switch): Replaced the `got_default' field with a
1757 `default_section' one.
1758 (Switch.CheckSwitch): Set `default_section' here.
1759 (Switch.Resolve): If we're a constant switch and the constant is
1760 not found, use the default section.
1762 2005-05-03 Martin Baulig <martin@ximian.com>
1764 * expression.cs (ArrayAccess.EmitGetLength): New public method.
1766 * statement.cs (Foreach.ArrayForeach): New nested class.
1767 (Foreach.TemporaryVariable): New nested class.
1768 (Foreach.EmitArrayForeach): Removed; this is now in the new
1771 2005-05-03 Raja R Harinath <rharinath@novell.com>
1773 * pending.cs (BaseImplements): Move the #74773 fix here. This is
1775 (VerifyPendingMethods): Revert change below.
1777 * typemanager.cs (IsOverride, RegisterNonOverride): New.
1778 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1779 that used to trigger warning -28. Remove warning -28.
1780 * expression.cs (Invocation.OverloadResolve): Use
1781 TypeManager.IsOverride to distinguish override methods.
1784 * pending.cs (VerifyPendingMethods): If a base type implements the
1785 requested interface, don't bother checking individual methods of
1786 the base type. As a side-effect, this prevents the creation of
1787 unnecessary proxies.
1789 2005-05-02 Martin Baulig <martin@ximian.com>
1793 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1794 Also `And' the locals if the old vector is null.
1795 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1796 null; in this case we basically reset all the variables.
1798 2005-05-02 Martin Baulig <martin@ximian.com>
1802 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1803 Added `FlowBranching branching' argument; always `and' the
1804 variables instead of `or'ing them unless we're an infinite loop.
1806 * statement.cs (While.Resolve): Create a new sibling unless we're
1809 2005-05-02 Martin Baulig <martin@ximian.com>
1813 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1814 arguments; use it instead of creating a new TopLevelBlock.
1815 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1816 our ConstructorInitializer.
1819 (TopLevelBlock.TopLevelBranching): New public property.
1820 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1821 and create our `TopLevelBranching'.
1823 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1824 anonymous method host, use `block.TopLevelBranching' rather than
1825 creating a new branching.
1827 2005-04-20 Miguel de Icaza <miguel@novell.com>
1829 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1830 a ScopeInfo, if any of the current children is a child of the new
1831 entry, move those children there.
1833 2005-04-30 Martin Baulig <martin@ximian.com>
1835 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1836 at the beginning of a SwitchSection. Fix #73335.
1838 2005-04-27 Marek Safar <marek.safar@seznam.cz>
1841 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1843 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1844 (FieldExpr.DoResolve): Obsolete members are ignored for field
1847 2005-04-26 Marek Safar <marek.safar@seznam.cz>
1849 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1850 of arrays detection.
1852 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1854 (Field.VerifyClsCompliance): Volatile fields are not compliant.
1856 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1859 2005-04-25 Ben Maurer <bmaurer@ximian.com>
1861 * cs-parser.jay: Use the prefered version of -unsafe in error
1864 2005-04-22 Marek Safar <marek.safar@seznam.cz>
1866 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1869 2005-04-20 John Luke <john.luke@gmail.com>
1871 * driver.cs: fix typo in error message, --outout to --output
1873 2005-04-30 Martin Baulig <martin@ximian.com>
1875 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1876 handle the .NET 2.x security attributes.
1878 2005-04-30 Martin Baulig <martin@ximian.com>
1881 (TypeManager.ExpandInterfaces): Don't add things twice.
1884 (TypeContainer.VerifyClsCompliance): Allow generic instances.
1886 2005-04-29 Martin Baulig <martin@ximian.com>
1888 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1890 * anonymous.cs: Added support for anonymous generic methods.
1892 2005-04-29 Martin Baulig <martin@ximian.com>
1894 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1897 2005-04-29 Martin Baulig <martin@ximian.com>
1899 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1901 * expression.cs (New.DoResolve): Fix the CS0304 check.
1903 2005-04-29 Martin Baulig <martin@ximian.com>
1905 * typemanager.cs (TypeManager.GetFullName): Updated to the new
1908 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1909 explicit interface implementation, compare the interface types.
1910 (MethodData.Define): Use the new naming scheme from the latest
1912 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1914 * decl.cs (MemberName.GetMemberName): Removed.
1915 (MemberName.MethodName, FullName): New properties.
1917 2005-04-25 Raja R Harinath <rharinath@novell.com>
1919 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
1921 2005-04-22 Martin Baulig <martin@ximian.com>
1923 * generic.cs (GenericMethod): Create the EmitContext in the
1924 `Define()'; in `Define(MethodBuilder)', create the type parameters
1925 before calling `Define()'. Fixes #73933.
1927 2005-04-22 Martin Baulig <martin@ximian.com>
1930 (Constraints.Resolve): Make things work wrt. the new type lookup system.
1931 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
1933 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
1934 ConstructedType, check its constraints.
1936 2005-04-20 Marek Safar <marek.safar@seznam.cz>
1938 * codegen.cs (InRefOutArgumentResolving): New field.
1940 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1941 fields outside contructor.
1943 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1945 2005-04-19 Miguel de Icaza <miguel@novell.com>
1947 * anonymous.cs (CaptureContext.EmitParameterInstance): The
1948 parameter code was not completed ever, so it was not as up-to-date
1949 as local variables. Must finish it.
1951 The bug fix was to compare the Toplevel of the block, not the
1952 current block. Thanks for Ben for pointing this out.
1954 2005-04-19 Raja R Harinath <rharinath@novell.com>
1956 * decl.cs (AddMethods): Use the declaring type of the problem
1957 method to determine if we want to squash a warning.
1959 2005-04-19 Marek Safar <marek.safar@seznam.cz>
1961 * attribute.cs: Removed debug output.
1963 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1965 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1968 2005-04-18 Raja R Harinath <rharinath@novell.com>
1971 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1972 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1973 all null comparisons against reference types.
1975 2005-04-18 Marek Safar <marek.safar@seznam.cz>
1978 * class.cs (TypeContainer.CircularDepException) New nested
1980 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1981 (TypeContainer.DefineType): Removed error, reset InTransit before
1983 (Class.DefineType): Throw exception when is in Transit.
1984 Catch exception and report error.
1985 (Struct.DefineType): Throw exception when is in Transit.
1986 Catch exception and report error.
1987 (Interface.DefineType): Throw exception when is in Transit.
1988 Catch exception and report error.
1990 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1991 handle nested exception handlers.
1993 * flowanalysis.cs (InTryWithCatch): New method, search for try with
1996 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1997 InFinally and InCatch storage.
1999 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2000 (Catch.Resolve): Set and Restore ec.InCatch.
2001 (Try.Resolve): Set and Restore ec.InFinally.
2002 (Try.HasCatch): True when try has catch.
2004 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
2006 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2007 for the same event member, so exclude such cases from warning 419.
2010 2005-04-16 Miguel de Icaza <miguel@novell.com>
2012 * expression.cs (Binary.ResolveOperator): Apply patch from John
2013 Luke to fix bug 59864: operators &, | and ^ on enumerations
2014 require that the same enum type on both sides.
2016 * driver.cs: Add warnings to old flag usage, this is to assist
2017 people who produce Makefiles and hope that the Makefiles will be
2020 * class.cs (TypeContainer.EmitType): Moved the definition of the
2021 special $PRIVATE$ field from the resolve phase to the Emit phase.
2022 During resolve we do not know if we are a struct with
2023 HasExplicitLayout, we know this only after the attributes for the
2026 Set the FieldOffset to zero on the dummy field that we create for
2027 the class. Fixes 74590.
2029 2005-04-16 Raja R Harinath <rharinath@novell.com>
2032 * ecore.cs (PropertyExpr.resolved): New.
2033 (DoResolve): Use it to handle a case of double resolution here.
2034 Handle a case of identical-name-and-type-name.
2035 * expression.cs (ArrayCreation.CheckIndices): Avoid double
2036 resolution by storing the results of expression resolution back
2037 into the "probes" array.
2039 2005-04-15 Raja R Harinath <rharinath@novell.com>
2041 Fix cs0208-7.cs and cs0208-8.cs.
2042 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2043 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
2044 error reporting to point out the reason a struct is not unmanaged.
2046 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2048 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
2049 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2051 2005-04-13 Raja R Harinath <rharinath@novell.com>
2054 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2055 IdenticalNameAndTypeName here.
2056 (EventExpr.InstanceResolve): Likewise.
2058 2005-04-13 Marek Safar <marek.safar@seznam.cz>
2060 C# 2.0 DefaultCharSetAttribute implementation
2062 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2063 which allows us to set GlobalNamespace for every resolve.
2064 (Attribute.ResolveArguments): Cut from Resolve.
2065 (Attribute.GetCharSetValue): Returns CharSet named argument.
2066 (Attribute.DefinePInvokeMethod): Gets default charset from
2068 (GlobalAttribute.ResolveAsTypeStep): Override.
2069 (GlobalAttribute.ResolveArguments): Override.
2071 * class.cs (TypeAttr): Is protected.
2073 * codegen.cs (ModuleClass.DefaultCharSet): New member.
2074 (ModuleClass.DefaultCharSetType): New memeber.
2075 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2077 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2078 charset from module.
2080 * delegate.cs (TypeAttr): Override.
2081 (Delegate.DefineType): Use this TypeAttr.
2083 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2084 at very early stage (before types are defined) to resolve model
2085 module attributes. It will probably not work with corlib but it
2088 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2089 charset from module.
2091 * typemanager.cs (default_charset_type): New type.
2093 2005-04-13 Raja R Harinath <rharinath@novell.com>
2095 * decl.cs (MemberCache.AddMethods): Don't warn if
2096 System.Object.Finalize has buggy MethodAttributes.
2098 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2101 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2103 * doc.cs : detect ambiguous reference to overloaded members.
2104 Fixed bug #71603. MS 1.1 csc does not detect it.
2106 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
2108 * doc.cs : delegates must not be referenced with parameters.
2111 2005-04-12 Miguel de Icaza <miguel@novell.com>
2113 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2115 2005-04-10 Miguel de Icaza <miguel@novell.com>
2117 * driver.cs (MainDriver): Stop processing if the CLS stage found
2120 (CompilerCallableEntryPoint.InvokeCompiler): Always
2121 reset after execution; Take a TextWriter argument for the
2124 * report.cs: Use the error stream instead of hardcoding stderr.
2126 2005-04-09 Miguel de Icaza <miguel@novell.com>
2128 * class.cs: Reduce code paths to test, too small of an
2129 optimization to make it worth the extra testing. Always perform
2132 2005-04-08 Raja R Harinath <rharinath@novell.com>
2135 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2136 operators that had errors reported on them.
2138 2005-04-08 Marek Safar <marek.safar@seznam.cz>
2140 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2142 (Attribute.Resolve): Add named argument type checking.
2144 * class.cs (FixedField.Define): Use IsPrimitiveType
2146 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2148 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2149 unsafe parameter types.
2151 * statement.cs (Using.ResolveExpression): Add better error description.
2153 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2155 2005-04-08 Raja R Harinath <rharinath@novell.com>
2158 * attribute.cs (Attribute.GetAttributeUsage): Resolve
2159 AttributeUsageAttribute in the emitcontext of the attribute class,
2160 not in the emitcontext of the attributable entity it was attached to.
2161 * cs-parser.jay: Use 'current_class', not 'current_container',
2162 when creating a GlobalAttribute.
2164 2005-04-08 Alp Toker <alp@atoker.com>
2166 * pending.cs: The fix to #58413 failed to compile methods implementing
2167 interfaces with/without params modifiers and vice versa, even though
2168 params modifiers aren't part of the signature. Make the modifier check
2169 less strict as in csc.
2171 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
2172 Anoob V E <projectmonokochi@rediffmail.com>
2173 Harilal P R <projectmonokochi@rediffmail.com>
2176 * pending.cs (TypeAndMethods.mods): New. Store the parameter
2177 modifiers of pending methods.
2178 (PendingImplementation.PendingImplementation): Initialize it.
2179 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2180 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2181 with ParameterData. Add check for modifiers.
2182 * class.cs (MethodData.Define): Update to changes.
2184 2005-04-07 Raja R Harinath <rharinath@novell.com>
2186 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2188 2005-04-07 Marek Safar <marek.safar@seznam.cz>
2190 * class.cs (PropertyMethod.Define): Check private accessor in abstract
2193 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2196 * typemanager.cs: Registered RequiredAttributeAttribute.
2198 2005-04-06 Marek Safar <marek.safar@seznam.cz>
2200 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2201 Warning CS0169 is back at level 3.
2202 (IMethodData.SetMemberIsUsed): New method.
2204 * decl.cs (IsUsed): New value; moved from FieldBase.Status
2205 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2207 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2209 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2211 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2214 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2217 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2218 to avoid the problems with nested types.
2220 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
2221 Anoob V.E <projectmonokochi@rediffmail.com>
2222 Harilal P.R <projectmonokochi@rediffmail.com>
2223 Raja R Harinath <rharinath@novell.com>
2226 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2228 * typemanager (GetConstructor): Make public.
2230 2005-04-05 John Luke <john.luke@gmail.com>
2231 Raja R Harinath <rharinath@novell.com>
2234 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2235 struct too. Return false quicker in a few cases.
2236 (VerifyUnManaged): Use it.
2238 2005-04-05 Raja R Harinath <rharinath@novell.com>
2241 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2242 not 'unreachable_seen'.
2244 2005-04-04 Marek Safar <marek.safar@seznam.cz>
2246 * attribute.cs (Attribute.GetValue): Removed unused.
2248 * codegen.cs (CodeGen.TrimExt): Removed unused.
2250 * cs-parser.jay (output): Removed unused.
2252 * cs-tokenizer.cs (hex_digits): Removed unused.
2254 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2256 * expression.cs (Indirection.LoadExprValue): Removed unused.
2257 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2259 * iterators.cs (Iterator.param_types): Removed unused.
2261 * statement.cs (Goto.block): Removed unused.
2262 (ToplevelBlock.did): Removed unused.
2263 (Switch.ResolveConstantSwitch): Removed unused.
2265 2005-04-01 Ben Maurer <bmaurer@ximian.com>
2267 * rootcontext.cs: Allow mcs to bootstrap with the compilation
2270 2005-04-19 Martin Baulig <martin@ximian.com>
2272 Merged r42462 from MCS and made it work for GMCS.
2274 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
2276 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
2278 2005-04-01 Raja R Harinath <rharinath@novell.com>
2280 Fix #74232 and cs0208-3.cs.
2281 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2282 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2283 unmanaged type. Don't use FieldBuilders when 't' is a
2284 TypeBuilder. Use ModFlags and MemberType fields.
2285 * class.cs (MemberBase.member_type): Rename from MemberType.
2286 (MemberBase.MemberType): New property. Determines member_type on
2288 (MemberBase.DoDefine): Don't initialize MemberType here.
2289 (FieldMember.Define): Likewise.
2291 2005-04-01 Marek Safar <marek.safar@seznam.cz>
2294 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2295 Attributes are emitted there.
2297 2005-04-01 Raja R Harinath <rharinath@novell.com>
2299 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2300 keyword in 'partial enum' too.
2301 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2303 Report from Kamil Skalski <nazgul@omega.pl>.
2306 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2307 have partial containers too.
2309 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2310 in block' checks to Block.CheckInvariantMeaningInBlock.
2311 * statement.cs (Block.GetKnownVariableInfo): Make private.
2312 (Block.IsVariableUsedInChildBlock): Remove.
2313 (Block.IsVariableUsedInBlock): Likewise.
2314 (Block.CheckInvariantMeaningInBlock): New. Show location of
2315 conflicting declaration.
2316 (Block.AddVariable): Make error messages less long-winded and more
2317 specific. Show location of conflicting declaration.
2318 * parameter.cs (Parameters.Location): New readonly property.
2320 2005-03-31 Raja R Harinath <rharinath@novell.com>
2322 Clean up semantics of invoking ResolveMemberAccess.
2323 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2324 can have an instance, ensure that we pass in a non-TypeExpression
2325 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
2326 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2327 argument. Update to changes and simplify.
2328 (FieldExpr.Emitinstance): Remove CS0120 check.
2329 (PropertyExpr.EmitInstance): Likewise.
2330 * expression.cs (Argument.Resolve): Likewise.
2331 (Invocation.DoResolve): Update to changes in semantics of
2334 2005-03-31 Marek Safar <marek.safar@seznam.cz>
2337 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2340 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2342 2005-03-31 Raja R Harinath <rharinath@novell.com>
2344 Fix difference in behaviour with commandline invocation.
2345 * driver.cs (Driver.Reset): New.
2346 (CompilerCallableEntryPoint): Call it.
2348 * statement.cs (If.Resolve): Avoid spurious "uninitialized
2349 variable" warnings if the boolean expression failed to resolve.
2351 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
2353 * attribute.cs: Fix the union of several permissions when some of them
2354 are unrestricted (so the result isn't an unrestricted permission set).
2357 2005-03-30 Raja R Harinath <rharinath@novell.com>
2359 * ecore.cs (MemberExpr): New class. Convert from interface
2361 (MemberExpr.ResolveMemberAccess): Refactor and move here from
2362 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
2364 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2365 (MethodGroupExpr.IsExplicitImpl): Remove.
2366 (Expression.GetFieldFromEvent): Remove.
2367 (SimpleName.MemberStaticCheck): Remove.
2368 (SimpleName.DoSimpleNameResolve): Update to changes.
2369 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2370 (MemberAccess.IdenticalNameAndTypeName): Remove.
2371 (MemberAccess.error176): Move to MemberExpr.
2372 (MemberAccess.DoResolve): Update to changes.
2373 (BaseAccess.DoResolve): Likewise.
2375 2005-03-30 Marek Safar <marek.safar@seznam.cz>
2377 C# 2.0 Conditional attribute class implementation
2379 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2380 Analyzes class whether it has attribute which has ConditionalAttribute
2381 and its condition is not defined.
2383 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2384 (Class.IsExcluded): New method. Search for at least one defined
2385 condition in ConditionalAttribute of attribute class.
2387 2005-03-30 Raja R Harinath <rharinath@novell.com>
2389 * ecore.cs (PropertyExpr): Derive from Expression, not
2390 ExpressionStatement.
2391 (PropertyExpr.EmitStatement): Remove.
2393 2005-03-29 Raja R Harinath <rharinath@novell.com>
2396 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2397 internal field "value__" of an enum be private. The examples for
2398 "value__" that I found on MSDN all used FieldAttributes.Private.
2400 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2401 Don't mention IL method attribute names.
2403 Fix #47991. Remove a TODO.
2404 * statement.cs (Block.Toplevel): Make into a field.
2405 (Block.Parameters): Move into ToplevelBlock.
2406 (Block.known_variables): Rename from child_variable_names.
2407 (Block.Block): Remove variants that take Parameters. Initialize
2408 'Toplevel' with the immediately surrounding toplevel block.
2409 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
2410 LocalInfo parameter.
2411 (Block.GetKnownVariableInfo): New.
2412 (Block.IsVariableNameUsedInChildBlock): Update.
2413 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
2414 the block, even though it may not be in scope.
2415 (Block.AddVariable): Remove Parameters parameter. Use
2416 Toplevel.Parameters instead.
2417 (Block.AddConstant): Remove Parameters parameter.
2418 (Block.GetParameterReference): Update to use Toplevel.Parameters.
2419 (Block.IsParamaterReference): Likewise.
2420 (Block.IsLocalParameter): Likewise. Simplify a lot.
2421 (ToplevelBlock.Parameters): New. Moved from Block.
2422 (ToplevelBlock.ToplevelBlock): Update to changes. Always
2423 initialize Parameters to a non-null value.
2424 * cs-parser.jay: Update to changes.
2425 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2426 simple names that mean different things in the same block. Use
2427 Block.IsVariableNameUsedInBlock.
2429 2005-03-28 Raja R Harinath <rharinath@novell.com>
2431 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2433 2005-03-26 Raja R Harinath <harinath@acm.org>
2436 * assign.cs (Assign.DoResolve): When the RHS of an assignment
2437 fails to resolve, ensure that the LHS is still resolved as an
2440 2005-03-25 Raja R Harinath <harinath@acm.org>
2442 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2444 (Enum.current_ec): Remove.
2445 (Enum.LookupEnumValue): Remove EmitContext argument.
2446 Just uses the one created during DefineType.
2447 (Enum.FindMembers): Update.
2448 * expression.cs (MemberAccess.DoResolve): Update.
2450 2005-03-22 Marek Safar <marek.safar@seznam.cz>
2452 * assign.cs (Assign.DoResolve): Check for CS1717 when
2453 source and target are same (uses Equals).
2455 * expression.cs (LocalVariableReference, ParameterReference,
2456 This): Implemented Equals, GetHashCode.
2458 * statement.cs (Block.GetParameterReference): Removed useless
2461 2005-03-22 Raja R Harinath <rharinath@novell.com>
2464 * statement.cs (Block.AddVariable): Ensure that we skip implicit
2465 blocks before deciding whether the error is cs0136 or cs0128.
2467 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2468 (using_alias_directive, using_namespace_directive): Pass
2469 MemberName, not an expression to Namespace.UsingAlias and
2471 (MakeName): Use the MemberName of the namespace.
2472 * namespace.cs (Namespace.MemberName): New.
2473 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2474 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2476 * decl.cs (MemberName.Name): Make readonly.
2477 (MemberName.FromDotted): New "constructor".
2478 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2479 (MemberCore.Name): Compute from MemberName on demand.
2480 (MemberCore.SetMemberName): Provide a way to change the
2482 (MemberCore.AddToContainer): Don't take a fullname parameter.
2483 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2484 fully qualified name of the container to the member name.
2485 (TypeContainer.AddToTypeContainer): Use a fully qualified name
2486 only if the type is a member of the root container.
2487 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2488 MemberName.Left rather than searching for an embedded ".".
2489 (PartialContainer.CreatePart): Update to changes in RootContext.
2490 (MemberBase.ShortName): Turn into a property. Use
2491 MemberCore.SetMemberName.
2492 (MemberBase.ExplicitInterfaceName): Remove.
2493 (MemberBase.UpdateMemberName): Remove.
2494 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2495 (PropertyBase.SetMemberName): New override.
2496 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2497 (Tree.GetDecl): New.
2498 (Tree.AllDecls): Rename from Decls.
2499 * attribute.cs, enum.cs, report.cs: Update to changes.
2500 * driver.cs (MainDriver): Use MemberName.FromDotted on
2501 RootContext.MainClass.
2503 2005-03-21 Marek Safar <marek.safar@seznam.cz>
2505 * class.cs (FixedField.Define): Check for CS1664 and more sanity
2508 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2510 2005-03-18 Marek Safar <marek.safar@seznam.cz>
2512 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2513 property accessor modifiers.
2515 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2516 fixed buffer attribute (CS1716).
2517 (PropertyMethod.HasCustomAccessModifier): When property accessor
2518 has custom modifier.
2520 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2522 (PropertyExpr.DoResolveLValue): Add CS0272.
2524 2005-03-17 Miguel de Icaza <miguel@novell.com>
2526 * convert.cs: When converting to a pointer, use the proper Conv.U
2527 or Conv.I depending on the source data type.
2529 * cs-tokenizer.cs: Make the size for large decimal constants,
2532 2005-03-17 Martin Baulig <martin@ximian.com>
2534 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2535 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
2537 2005-03-17 Martin Baulig <martin@ximian.com>
2539 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2540 to bool so we can return an error condition.
2541 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2544 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
2546 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2549 2005-03-16 Raja R Harinath <rharinath@novell.com>
2551 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2552 Refactor to avoid traversing the list of assemblies, and to avoid
2553 string concatenation.
2554 * typemanager.cs (guid_attr_type): Remove.
2555 (negative_hits, pointers, references): Remove hashes.
2557 (GetConstructedType): New. Uses type_hash to handle constructed
2558 types (arrays, references, pointers).
2559 (GetReferenceType, GetPointerType): Use it.
2560 (GetNestedType): New. Uses type_hash to handle nested types of
2562 (LookupType, LookupTypeDirect): Remove.
2563 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
2564 'types' hash and LookupTypeReflection directly.
2565 (params_string, params_object): Use GetConstructedType.
2566 * namespace.cs (Namespace.cached_types): New. Cache of reflected
2568 (Namespace.Lookup): Use cached_types.
2569 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2570 provided by old TypeManager.LookupType.
2571 * rootcontext.cs (MakeFQN): Remove.
2572 * decl.cs (DeclSpace.MakeFQN): Likewise.
2573 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2574 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2575 TypeManager.GetConstructedType.
2576 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2578 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
2580 * cs-parser.jay: Fix build.
2582 2005-03-15 Marek Safar <marek.safar@seznam.cz>
2584 * class.cs (TypeContainer.CircularDepException) New nested
2585 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
2587 * cs-parser.jay: Reports CS1527 for any namespace element.
2589 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2592 * expression.cs (ParameterReference.IsAssigned): Changed error to
2594 (Error_WrongNumArguments): Moved CS0245 detection here.
2596 * statement.cs (Return.Resolve): Add CS1622 report.
2598 2005-03-11 Marek Safar <marek.safar@seznam.cz>
2600 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2602 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
2604 * attribute.cs expression.cs: Get rid of some allocations.
2606 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
2608 * doc.cs : just eliminate the latest change.
2610 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2612 * doc.cs : commented out the latest change. It breaks xml-030.cs
2614 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2616 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2617 fail. So invoke CreateType() in FindDocumentedType().
2619 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2621 * cs-tokenizer.cs : added IsKeyword().
2622 * doc.cs : Detect keyword incorrectly used as identifier.
2623 Allow identifiers prefixed by @.
2625 2005-03-10 Marek Safar <marek.safar@seznam.cz>
2627 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2628 It caused exception in namespace resolving (again!).
2630 * class.cs (Class.ctor): Removed exit.
2631 (PropertyMethod.ctor): ditto.
2633 * codegen.cs (Codegen.Reset): Reset static data.
2634 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2636 * cs-tokenizer.cs (Cleanup): Removed.
2638 * driver.cs (GetSystemDir): Rewrote to one line command.
2639 It caused problem with unloaded dynamic modules.
2640 (UnixParseOption): Removed Exit.
2641 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2642 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2643 Now can be mcs used as library.
2645 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2648 * location.cs (Reset): Reset static data.
2650 * namespace.cs (Reset): Reset static data.
2652 * report.cs (Report.Reset): Reset static data.
2654 * rootcontext.cs (RootContext.Reset): Reset static data.
2656 * tree.cs (RootTypes.ctor): Use Location.Null
2658 * typemanager.cs (TypeManager.Reset): Reset static data.
2659 (CoreLookupType): Removed Exit.
2660 (TypeHandle.Reset): Reset static data.
2662 2005-03-10 Raja R Harinath <rharinath@novell.com>
2665 * typemanager.cs (ComputeNamespaces): Import namespaces from
2666 referenced modules too.
2668 2005-03-09 Raja R Harinath <rharinath@novell.com>
2670 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2673 2005-03-09 Raja R Harinath <rharinath@novell.com>
2675 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2676 enclosing DeclSpace. This ensures that a name-lookup populates
2677 more caches and there are fewer 'TypeExpression's. Carve out
2678 nested type lookup into ...
2679 (LookupNestedTypeInHierarchy): ... this.
2681 2005-04-15 Martin Baulig <martin@ximian.com>
2683 Merged r41590 from MCS and make it work in the generics land.
2685 * generic.cs (TypeParameter.UpdateConstraints): Removed the
2688 * class.cs (PartialContainer.UpdateConstraints): Removed.
2689 (PartialContainer.CheckConstraints): Removed.
2690 (PartialContainer.SetParameterInfo): Store the constraints here.
2691 (PartialContainer.DefineTypeParameters): New public method;
2692 resolve the type parameter's constraints here. Note that the
2693 PartialContainer doesn't have an EmitContext anymore, so we must
2694 do this in the ClassPart.
2696 2005-03-09 Raja R Harinath <rharinath@novell.com>
2698 Clean up a few partial-class semantics.
2699 Fixes test-357.cs and cs1618-2.cs.
2700 * cs-parser.jay (struct_declaration): Use 'current_class' as
2701 parent of newly-created struct. Remove call to Register ().
2702 Use 'pop_current_class' to complete handing the current struct.
2703 (interface_declaration): Likewise.
2704 (class_declaration): Likewise.
2705 (enum_declaration): Use 'current_class' as parent of newly created
2707 (delegate_declaration): Likewise.
2708 (pop_current_class): New function. This is used to handle closing
2709 up the 'current_class' and 'current_container', and pointing them
2710 to the enclosing class/container.
2711 (CSharpParser): Initialize 'current_class' too.
2712 * decl.cs (MemberCore): Add check for invariant: a partial
2713 container is not a parsed entity, and thus does not enclose any
2715 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2716 (DeclSpace.BaseTypeExpr): Use it.
2717 (DeclSpace.LookupType): Add check for invariant.
2718 * class.cs (TypeContainer): Add check for invariant: a nested
2719 class should have the same NamespaceEntry as its enclosing class.
2720 (TypeContainer.EmitFieldInitializers): Make virtual.
2721 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2723 (TypeContainer.Register): Remove.
2724 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2725 null. Use TypeResolveEmitContext for resolving base types and
2726 interfaces. Move initialization of Parts.TypeBuilder here from
2728 (TypeContainer.DefineNestedTypes): ... here.
2729 (PartialContainer): Take a Namespace not a NamespaceEntry.
2730 (PartialContainer.Create): Don't use Register. Call the
2731 appropriate Add... function directly.
2732 (ClassPart): Take both the PartialContainer and the enclosing
2733 class as constructor arguments.
2734 (ClassPart.EmitFieldInitializers): Override.
2735 (ClassPart.PartFindNestedTypes): Remove.
2736 (FieldBase.GetInitializerExpression): Resolve the initializer
2737 expression in the emit context of the enclosing class.
2738 * tree.cs (RootTypes): Remove Register ().
2740 2005-03-08 Marek Safar <marek.safar@seznam.cz>
2742 * cs-parser.jay: Removed CS0134.
2744 * driver.cs: Removed CS1901.
2746 * expression.cs (SizeOf.DoResolve): Don't report CS0233
2747 for predefined types.
2749 2005-03-07 Duncan Mak <duncan@novell.com>
2751 * codegen.cs (Save): Catch UnauthorizedAccessException as
2752 well. Fixes bug #73454.
2754 2005-03-07 Marek Safar <marek.safar@seznam.cz>
2756 * cs-tokenizer.cs (xtoken): Add CS1035.
2758 * class.cs (MethodData.Define): Add CS0683.
2759 (FieldMember.ctor): Add CS0681.
2761 2005-03-07 Raja R Harinath <rharinath@novell.com>
2763 * ecore.cs (SimpleName.DoResolve): Rename from
2764 SimpleName.DoResolveAllowStatic.
2765 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2766 Pass 'intermediate' flag to MemberStaticCheck.
2767 (SimpleName.MemberStaticCheck): Skip "static check" only in case
2768 of "intermediate" lookups via MemberAccess.
2769 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
2770 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2772 2005-03-07 Raja R Harinath <rharinath@novell.com>
2775 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2776 slipped in because of variable names that are identical to a
2777 builtin type's BCL equivalent ('string String;', 'int Int32;').
2778 (PropertyExpr.EmitInstance): Likewise.
2780 2005-03-04 Marek Safar <marek.safar@seznam.cz>
2782 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2784 * report.cs (warning_ignore_table): Made public.
2786 2005-03-04 Raja R Harinath <rharinath@novell.com>
2789 * class.cs (MethodData.Emit): Pass 'container' to
2790 container.GetObsoleteAttribute instead of 'container.Parent'.
2792 2005-03-03 Marek Safar <marek.safar@seznam.cz>
2794 * cs-parser.jay: Add 1534 error test.
2796 * iterators.cs (Yield.CheckContext): Add error 1629.
2797 (Iterator.ctor): Save unsafe modifier.
2798 (MoveNextMethod.DoEmit): Restore unsafe context.
2800 * namespace.cs (UsingAlias): Better error message.
2802 2005-03-03 Dan Winship <danw@novell.com>
2804 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2805 the warning message [#73219]
2807 2005-03-03 Raja R Harinath <rharinath@novell.com>
2809 Fix compile with MCS 1.0.0.0.
2810 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2811 w_restore to not depend on string constant folding.
2813 2005-03-03 Raja R Harinath <rharinath@novell.com>
2815 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
2816 CS0246 check to users who passed 'silent = false'.
2817 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2819 (SimpleName.SimpleNameResolve): Update.
2820 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2821 (MemberAccess.IdenticalNameAndTypeName): Update.
2822 * doc.cs (FindDocumentedTypeNonArray): Update.
2824 2005-03-03 Raja R Harinath <rharinath@novell.com>
2826 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2827 * parameters.cs (ComputeAndDefineParameters): Remove.
2828 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2829 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2830 Use GetParameterInfo.
2832 2005-03-02 Marek Safar <marek.safar@seznam.cz>
2834 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2836 2005-03-02 Raja R Harinath <rharinath@novell.com>
2838 Unify DeclSpace.LookupType and DeclSpace.FindType.
2839 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
2840 is in charge of defining nested types on demand.
2841 (DeclSpace.LookupType): Use it when the current_type is a
2842 TypeBuilder. Use LookupTypeDirect for reflected types.
2843 (DeclSpace.FindType): Remove.
2844 (DeclSpace.LookupInterfaceOrClass): Likewise.
2845 (DeclSpace.DefineTypeAndParents): Likewise.
2846 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2847 DeclSpace.LookupType.
2848 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2849 * typemanager.cs (LookupType): Simplify.
2850 (AddUserType): Remove type from negative_hits.
2851 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2852 * class.cs (TypeContainer.FindMembers): Move handling of nested
2854 (TypeContainer.FindMembers_NestedTypes): ... here.
2855 (TypeContainer.FindNestedType): Implement override.
2856 (ClassPart.FindNestedType): Delegate to PartialContainer.
2857 (ClassPart.PartFindNestedType): Looks up the nested types of the
2860 2005-04-14 Martin Baulig <martin@ximian.com>
2862 * generic.cs (ConstructedType): Moved all the type lookup and
2863 nested class logic into SimpleName.
2864 (ConstructedType.ResolveConstructedType): Our underlying type is
2865 already fully resolved; all the type lookup stuff is in
2868 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2869 constructed types here instead of in ConstructedType.
2871 * decl.cs (MemberName.GetTypeExpression): Always create a
2872 SimpleName, not a ConstructedType.
2873 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2875 2005-03-02 Martin Baulig <martin@ximian.com>
2877 * class.cs (TypeContainer.DoDefineMembers): We also need a default
2878 static constructor in static classes.
2880 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
2882 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2883 sizeParamIndex is not specified.
2885 2005-03-01 Marek Safar <marek.safar@seznam.cz>
2888 * report.cs (WarningMessage.IsEnabled): Missing null check.
2890 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2892 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2893 in the fields and not in the properties.
2895 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
2897 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
2900 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2902 * attribute.cs: Small refactoring (improved robustness).
2903 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2904 (ValidateGuid): Removed.
2905 (Resolve): Removed referenced to above mentioned.
2906 (GetAttributeUsage): Made private and changed to work without
2908 (GetIndexerAttributeValue): Don't crash.
2909 (GetConditionalAttributeValue): Ditto.
2910 (GetClsCompliantAttributeValue): Ditto.
2911 (ExtractSecurityPermissionSet): All attributes exceptions are
2913 (GetPropertyValue): New helper.
2914 (GetMethodImplOptions): New method.
2915 (DefinePInvokeMethod): Reuse common code. Implemented handling of
2916 some missing properties.
2918 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2919 (Method.ApplyAttributeBuilder): Updated.
2921 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2924 2005-02-28 Raja R Harinath <rharinath@novell.com>
2927 * report.cs (Report.SymbolRelatedToPreviousError): Handle
2928 non-simple types (array, pointer, reference).
2930 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2932 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2934 * class.cs (MethodCore.IsDuplicateImplementation): Special error
2936 (Method.CheckBase): Catch wrong destructor here.
2937 (MethodData.Define): Add errors 550, 668.
2939 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2941 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2943 * pending.cs (VerifyPendingMethods): Add error 551.
2945 * typemanager.cs (CSharpName): Next error report helper.
2947 2005-02-25 Marek Safar <marek.safar@seznam.cz>
2949 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2950 attributes. Removed useless attribute double check.
2951 It saves almost 2MBs for corlib.
2953 2005-02-25 Raja R Harinath <rharinath@novell.com>
2956 * statement.cs (ExpressionStatement.Resolve): Make robust to being
2957 called twice in case of error.
2959 2005-02-23 Chris Toshok <toshok@ximian.com>
2961 Fix compiler portions of #72827.
2962 * statement.cs (Block.Emit): call Begin/EndScope on the
2963 EmitContext instead of the ILGenerator.
2965 * codegen.cs (EmitContext.BeginScope): new method, call
2966 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2968 (EmitContext.BeginScope): same, but EndScope and CloseScope
2970 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2971 offset and call the superclass's OpenScope(int) with it.
2972 (SymbolWriter.CloseScope): get the current il
2973 offset and call superclass's CloseScope(int) with it.
2975 2005-02-23 Marek Safar <marek.safar@seznam.cz>
2977 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2978 CS1677 for out and ref as well.
2980 * class.cs (Method.Define): Add error CS1599 detection.
2982 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2984 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2986 * delegate.cs (Delegate.Define): Add error CS1599 detection.
2988 * support.cs.cs (ModifierDesc): New helper method.
2990 2005-02-23 Raja R Harinath <rharinath@novell.com>
2991 Abin Thomas <projectmonokochi@rediffmail.com>
2992 Anoob V E <projectmonokochi@rediffmail.com>
2993 Harilal P R <projectmonokochi@rediffmail.com>
2996 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2997 MemberLookup (used for error reporting) actually returns a result.
2998 Fix error report number (122, not 112).
3000 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
3001 Anoob V E <projectmonokochi@rediffmail.com>
3002 Harilal P R <projectmonokochi@rediffmail.com>
3005 * pending.cs (PendingImplementation.GetAbstractMethods):
3006 Find NonPublic members too.
3008 2005-02-22 Marek Safar <marek.safar@seznam.cz>
3010 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3013 * class.cs (MethodCore.CheckMethodAgainstBase):
3014 Add error 239 report.
3016 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3018 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3020 * class.cs (Operator.Define): Add error 217 report.
3022 2005-02-21 Raja R Harinath <rharinath@novell.com>
3025 * expression.cs (Invocation.IsApplicable): Make public.
3026 (Invocation.IsParamsMethodApplicable): Likewise.
3027 * delegate.cs (Delegate.VerifyApplicability): Don't use
3028 Invocation.VerifyArgumentCompat for parameter applicability
3029 testing. Use Invocation.IsApplicable and
3030 Invocation.IsParamsMethodApplicable.
3032 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3034 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3036 * class.cs (Operator.Define): Add error 217 report.
3038 2005-02-21 Raja R Harinath <rharinath@novell.com>
3040 * namespace.cs (UsingEntry.Resolve): Undo change below.
3042 2005-02-21 Raja R Harinath <rharinath@novell.com>
3045 * ecore.cs (Expression.MemberLookupFailed): Add argument to
3046 disable the error message when the extended MemberLookup also
3048 (Expression.MemberLookupFinal): Update.
3049 (SimpleName.DoSimpleNameResolve): Update.
3050 * expression.cs (MemberAccess.ResolveNamespaceOrType):
3051 Don't use MemberLookupFinal.
3052 (New.DoResolve): Update.
3053 (BaseAccess.CommonResolve): Update.
3055 2005-02-21 Raja R Harinath <rharinath@novell.com>
3058 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3059 occured previously, don't resolve again.
3061 2005-02-21 Marek Safar <marek.safar@seznam.cz>
3064 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3065 argument. Call ResolveAttributeUsage for unresolved.
3066 when types doesn't match ctor arguments.
3068 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3069 for nested attribute classes.
3070 (Class.attribute_usage): Removed.
3071 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3072 for attribute class.
3074 * ecore.cs (IsAttribute): Removed.
3076 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3078 * rootcontext.cs (RegisterAttribute): Removed, attributes are
3080 (attribute_types): Removed.
3081 (EmitCode): Global attributes are emited as the latest.
3083 2005-02-18 Marek Safar <marek.safar@seznam.cz>
3085 * class.cs (EmitFieldInitializers): Don't emit field initializer
3086 for default values when optimilization is on.
3088 * constant.cs (Constant.IsDefaultValue): New property.
3090 * driver.cs: Add /optimize handling.
3094 * literal.cs: Implement new IsDefaultValue property.
3096 * rootcontext.cs (Optimize): New field, holds /optimize option.
3098 2005-02-18 Raja R Harinath <rharinath@novell.com>
3100 Fix crasher in re-opened #72347.
3101 * namespace.cs (Namespace.Lookup): Return null if
3102 DeclSpace.DefineType returns null.
3105 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3107 2005-02-18 Raja R Harinath <rharinath@novell.com>
3109 Fix remainder of #63202. Change semantics of DoResolveLValue: it
3110 now returns null if it cannot resolve to an lvalue.
3111 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3112 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3113 returned null. Remove check for SimpleName.
3114 (EventExpr.DoResolveLValue): New.
3115 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3116 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
3118 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
3120 (Unary.ResolveOperator): Move CS0211 check ...
3121 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
3123 (Unary.DoResolveLValue): Simplify.
3124 (AddressOf.DoResolveLValue): New.
3125 (ArrayAccess.DoResolveLValue): New.
3127 2005-02-16 Marek Safar <marek.safar@seznam.cz>
3129 * attribute.cs (Attribute.Resolve): Add arguments casting for
3130 when types doesn't match ctor arguments.
3132 2005-02-16 Raja R Harinath <rharinath@novell.com>
3134 Fix parts of #63202.
3135 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3136 lookup of operator in base type. Ensure that all checks happen
3137 when the operator resolves to an "op_..." method.
3139 2005-02-15 Raja R Harinath <rharinath@novell.com>
3142 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3143 'ignore_cs0104' parameter. Pass it to ...
3144 (NamespaceEntry.Lookup): ... this.
3145 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3146 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3147 (TypeLookupExpression.DoResolveAsTypeStep): Update.
3148 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3149 Update. Request that cs0104 errors be ignored.
3150 (ComposedCast.ResolveAsTypeStep): Update.
3152 2005-02-14 Raja R Harinath <rharinath@novell.com>
3155 * expression.cs (Invocation.BetterFunction): Remove support for
3156 comparing virtual functions and their overrides.
3157 (Invocation.IsOverride): New.
3158 (Invocation.OverloadResolve): Don't consider 'override' functions
3159 during candidate selection. Store them in a lookaside list.
3160 If the selected method is a 'virtual' function, use the list to
3161 find any overrides that are closer to the LHS type.
3163 2005-02-14 Marek Safar <marek.safar@seznam.cz>
3165 * expression.cs (New.DoResolve): Add complex core type reduction.
3166 (New.Constantify): Converts complex core type syntax like 'new int ()'
3169 2005-02-14 Raja R Harinath <rharinath@novell.com>
3171 * decl.cs (EntryType.EntryType): New constructor to create an
3172 updated copy of a cache entry.
3173 (MemberCache.AddMethods): Use it.
3174 (MemberCache.ClearDeclaredOnly): Remove.
3175 (MemberCache.MemberCache): Update.
3177 2005-02-11 Miguel de Icaza <miguel@novell.com>
3179 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3180 variable. This one is represents the actual low-level declaration
3181 of the method, as opposed to the semantic level `IsStatic'.
3183 An anonymous method which is hosted into a static method might be
3184 actually an instance method. IsStatic would reflect the
3185 container, while MethodIsStatic represents the actual code
3188 * expression.cs (ParameterReference): Use the new MethodIsStatic
3189 instead of IsStatic.
3191 * anonymous.cs (AnonymousMethod.Compatible): Pass the
3192 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3193 set on the current EmitContext.
3195 * expression.cs (Cast): Overload DoResolveLValue so we can pass
3196 resolve our casted expression as an LValue. This triggers the
3197 proper LValue processing that is later required by Assign.
3201 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3203 2005-02-11 Marek Safar <marek.safar@seznam.cz>
3205 C# 2.0 Fixed buffer implementation
3207 * anonymous.cs: Update after RegisterHelperClass renaming.
3209 * attribute.cs (AttributeTester.fixed_buffer_cache):
3210 Cache of external fixed buffers.
3211 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3212 implementation if field is fixed buffer else null.
3215 (TypeContainer.AddField): Accept FieldMember instead of Field.
3216 (FieldBase.IsFieldClsCompliant): Extracted code from
3217 VerifyClsCompliance descendant customization.
3218 (FixedField): New class handles fixed buffer fields.
3219 (FixedFieldExternal): Keeps information about imported fixed
3221 (IFixedField): Make access to internal or external fixed buffer
3224 * cs-parser.jay: Add fixed buffer parsing.
3226 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3229 * expression.cs (Indirection): Extended implementation to accept
3231 (PointerArithmetic.Emit): Get element from fixed buffer as well.
3232 (ElementAccess.MakePointerAccess): Get type as parameter.
3233 (DoResolve): Add fixed buffer field expression conversion.
3234 (DoResolveLValue): Ditto.
3235 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3236 (ArrayPtr): Derives from FixedBufferPtr.
3237 (ArrayPtr.Emit): Add extra emit for array elements.
3239 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3241 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3242 for compiler generated types.
3243 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3245 * statement.cs (Fixed): Refactored to be easier add fixed buffer
3246 and consume less memory.
3247 (Fixed.Resolve): Add fixed buffer case.
3249 * typemanager.cs (compiler_generated_attr_ctor,
3250 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3251 (HasElementType): Add our own implementation to work on every
3254 2005-02-11 Miguel de Icaza <miguel@novell.com>
3256 * anonymous.cs (CaptureContext): Track whether `this' has been
3259 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
3260 only captured `this' if it was implicitly done (instance
3261 methods/variables were used).
3263 * codegen.cs (EmitContext.CaptureThis): New method to flag that
3264 `this' must be captured.
3266 2005-01-30 Miguel de Icaza <miguel@novell.com>
3268 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3269 is null it means that there has been no need to capture anything,
3270 so we just create a sibling.
3272 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3274 Just a partial fix. The other half is fairly elusive.
3276 2005-02-10 Raja R Harinath <rharinath@novell.com>
3278 Fix #52586, cs0121-4.cs.
3279 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
3280 and return a hashtable.
3281 (MemberCache.ClearDeclaredOnly): New.
3282 (MemberCache.MemberCache): Update to change. Make a deep copy of
3283 the method_hash of a base type too.
3284 (MemberCache.AddMethods): Adapt to having a deep copy of the base
3285 type methods. Overwrite entries with the same MethodHandle so
3286 that the ReflectedType is correct. The process leaves in base
3287 virtual functions and their overrides as distinct entries.
3288 (CacheEntry): Now a class instead of a struct. It shouldn't alter
3289 matters since it was boxed in a ArrayList before.
3290 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3292 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
3293 case of a virtual function and its override (choose the overload
3295 (Invocation.OverloadResolve): Avoid 'override' members during
3296 'applicable_type' calculation.
3298 2005-03-28 Raja R Harinath <rharinath@novell.com>
3300 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3301 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3302 GetTypeHandle. It is possible for a reflected type to derive from
3303 a TypeBuilder (e.g., int[] derives from the TypeBuilder
3304 System.Array during mscorlib compilation).
3305 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3306 contain a method_hash, don't create one either. Don't create a
3307 deep copy of the base cache's method_hash.
3308 (MemberCache.SetupCache): Rename back from DeepCopy.
3309 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3310 already initialized. If we see an override function, add its
3311 underlying base virtual function to the member_hash too.
3313 2005-02-09 Raja R Harinath <rharinath@novell.com>
3315 Combine two near-redundant caches.
3316 * typemanager.cs (method_params): Rename from method_internal_params.
3317 (TypeManager.GetParameterData): New. Replace
3318 Invocation.GetParameterData.
3319 (TypeManager.LookupParametersByBuilder): Remove.
3320 * expression.cs (Invocation.method_parameter_cache): Remove.
3321 (Invocation.GetParameterData): Remove.
3323 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3326 2005-02-08 Raja R Harinath <rharinath@novell.com>
3329 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3330 TypeManager.multicast_delegate_type is null, resolve it by looking
3331 up "System.MulticastDelegate".
3332 * rootcontext.cs (RootContext.ResolveCore): Simplify.
3334 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
3335 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
3336 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
3339 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3340 (LabeledStatement.AddReference): New. Set 'referenced'.
3341 (Goto.Resolve): Use it.
3343 2005-02-05 John Luke <john.luke@gmail.com>
3345 * driver.cs: remove duplicate -doc line in Usage ()
3347 2005-02-04 Raja R Harinath <rharinath@novell.com>
3349 * location.cs (Location.AddFile): Fix CS2002 error report.
3351 2005-02-02 Martin Baulig <martin@ximian.com>
3353 * delegate.cs (Delegate.DefineType): Report an internal error if
3354 TypeManager.multicast_delegate_type is null. See bug #72015 for
3357 2005-02-02 Raja R Harinath <rharinath@novell.com>
3359 Fix a crasher in a variant of #31984.
3360 * const.cs (Constant.CheckBase): New override that defers the
3361 new-or-override check in case the base type hasn't been populated
3363 (Constant.Define): Ensure the new-or-override check is performed.
3365 2005-02-01 Duncan Mak <duncan@ximian.com>
3367 * const.cs (LookupConstantValue): Check that `ce' is not null
3368 before calling GetValue ().
3370 2005-02-01 Raja R Harinath <rharinath@novell.com>
3372 Fix test-334.cs (#69519).
3373 * cs-parser.jay (using_alias_directive): Pass in an expression to
3374 NamespaceEntry.UsingAlias.
3375 (using_namespace_directive): Pass in an expression to
3376 NamespaceEntry.Using.
3377 (namespace_name): Don't flatten to a string.
3378 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3379 (NamespaceEntry.AliasEntry.Resolve): Lookup using
3381 (NamespaceEntry.UsingEntry): Likewise.
3382 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3384 (NamespaceEntry.LookupForUsing): Remove.
3385 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3387 (NamespaceEntry.Lookup): Remove support for dotted names.
3389 2005-02-01 Raja R Harinath <rharinath@novell.com>
3391 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3393 (NamespaceEntry.ImplicitParent): Compute on demand.
3394 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3395 parallels the current.
3396 (NamespaceEntry.LookupForUsing): Use it.
3397 (NamespaceEntry.Lookup): If the current namespace-entry is
3398 implicit, don't search aliases and using tables.
3400 2005-02-01 Raja R Harinath <rharinath@novell.com>
3403 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3405 (TypeContainer.BaseCache): Compute on demand.
3406 (TypeContainer.FindMembers): Define constants and types if they're
3407 not already created.
3408 (FieldMember.Define): Move resetting of ec.InUnsafe before error
3410 * const.cs (Constant.Define): Make idempotent.
3412 2005-01-29 Miguel de Icaza <miguel@novell.com>
3414 * pending.cs: Produce better code (no nops produced by using Ldarg
3417 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3418 i - 1' it should be arg + 1.
3422 2005-01-28 Raja R Harinath <rharinath@novell.com>
3424 * attribute.cs (Attribute.CheckAttributeType): Make private
3426 (Attribute.ResolveType): Make virtual.
3427 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3428 handling of RootContext.Tree.Types.
3430 2005-01-27 Raja R Harinath <rharinath@novell.com>
3432 Update attribute-handling to use the SimpleName/MemberAccess
3434 * cs-parser.jay (attribute): Pass in an expression to the
3435 constructors of Attribute and GlobalAttribute.
3436 * attribute.cs (Attribute): Take an expression for the name.
3437 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
3438 passed in attribute name expression.
3439 (Attribute.CheckAttributeType): Use it.
3440 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3441 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3442 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
3443 argument to prevent error messages if the lookup fails.
3445 2005-01-27 Marek Safar <marek.safar@seznam.cz>
3447 * expression.cs (Indirection): Implemented IVariable interface
3448 to support indirection in AddressOf operator.
3449 (PointerArithmetic.Emit): Add optimalization for case where
3450 result can be precomputed.
3452 2005-01-26 Martin Baulig <martin@ximian.com>
3454 * class.cs (TypeContainer.AttributeTargets): Return the correct
3455 AttributeTargets depending on our `Kind' instead of throwing an
3456 exception; fixes #71632.
3458 2005-01-26 Marek Safar <marek.safar@seznam.cz>
3461 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3464 2005-03-17 Martin Baulig <martin@ximian.com>
3466 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3467 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
3469 2005-03-17 Martin Baulig <martin@ximian.com>
3471 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3472 to bool so we can return an error condition.
3473 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3476 2005-03-17 Martin Baulig <martin@ximian.com>
3478 * generic.cs (TypeMananager.IsIEnumerable): New public method.
3480 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
3481 converting from an array-type of T to `IEnumerable<T>'.
3483 2005-03-16 Martin Baulig <martin@ximian.com>
3485 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
3486 (Nullable.LiftedUnaryMutator): New public class.
3488 * expression.cs (UnaryMutator.DoResolve): Added support for
3491 2005-03-14 Martin Baulig <martin@ximian.com>
3493 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
3495 2005-03-14 Martin Baulig <martin@ximian.com>
3497 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
3498 the comparision operators `<', `>', `<=' and `>='.
3500 2005-03-13 Martin Baulig <martin@ximian.com>
3503 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
3504 avoid confusion with the `NullLiteral'.
3505 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
3507 2005-03-13 Martin Baulig <martin@ximian.com>
3509 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
3510 comparing arbitrary types with the null literal.
3512 2005-03-13 Martin Baulig <martin@ximian.com>
3514 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
3515 boolean operators '&&', '||', '&' and '|'.
3516 (Nullable.OperatorTrueOrFalse): New public class.
3518 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
3519 instead of a `StaticCallExpr'; added support for nullables.
3521 2005-03-10 Martin Baulig <martin@ximian.com>
3524 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
3525 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
3527 2005-03-07 Martin Baulig <martin@ximian.com>
3529 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
3530 it work if `expr' is not an IMemoryLocation.
3531 (Nullable.Lifted): Implement IMemoryLocation.
3532 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
3535 2005-03-05 Martin Baulig <martin@ximian.com>
3537 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
3538 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
3539 (Nullable): Added support for lifted unary and binary operators.
3541 * expression.cs (Unary.DoResolve): Added support for nullable types.
3542 (Binary.DoResolve): Likewise.
3543 (Conditional.DoResolve): Likewise.
3545 2005-03-02 Martin Baulig <martin@ximian.com>
3547 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
3549 * class.cs (ClassPart.SetParameterInfo): Override this.
3550 (PartialContainer.SetParameterInfo): Override this.
3551 (TypeContainer.CheckConstraints): New protected method.
3552 (PartialContainer.CheckConstraints): Override this and check
3553 whether the same contraints were specified in all parts of a
3554 partial generic type definition.
3555 (PartialContainer.UpdateConstraints): New public method.
3557 * generic.cs (TypeParameter.UpdateConstraints): New public method.
3559 2005-03-02 Martin Baulig <martin@ximian.com>
3561 Committing a patch from Carlos Alberto Cortez to fix #72887.
3563 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
3564 casts from `T []' to `int []'.
3566 2005-03-02 Martin Baulig <martin@ximian.com>
3568 * generic.cs (TypeManager.IsEqual): Make this symmetric.
3570 * expression.cs (Binary.ResolveOperator): When resolving a
3571 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
3572 `=='. Fixes #71866. See gen-127.cs.
3574 2005-03-02 Martin Baulig <martin@ximian.com>
3576 * class.cs (TypeContainer.DoDefineMembers): We also need a default
3577 static constructor in static classes.
3579 2005-03-02 Martin Baulig <martin@ximian.com>
3582 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
3583 (Nullable.LiftedConversion): Added support for user-defined
3586 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
3588 * cs-parser.jay: Use ComposedCast everywhere instead of
3589 NullableType, so we don't need to check for NullableType
3591 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3592 case where we'll be resolved into a `parenthesized_expression_0'
3596 (Convert.UserDefinedConversion): Added nullable conversions.
3598 2005-02-28 Martin Baulig <martin@ximian.com>
3600 * generic.cs (TypeManager.IsNullableType): New static method.
3601 (Nullable): New abstract class.
3602 (Nullable.NullLiteral): New public class.
3603 (Nullable.LiftedConversion): New public class.
3605 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3606 `builtin_types opt_nullable'.
3609 (Convert.ImplicitConversionStandard): Added nullable conversions.
3610 (Convert.ExplicitConversionStandard): Likewise.
3611 (Convert.ExplicitConversion): Likewise.
3613 2005-02-26 Martin Baulig <martin@ximian.com>
3615 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3616 begin with a "?", for instance "?[]". Don't do a type lookup if
3619 2005-02-25 Martin Baulig <martin@ximian.com>
3621 The first part of Nullable Types :-)
3623 * generic.cs (NullableType): New public class.
3624 (NullCoalescingOperator): New public class.
3625 (TypeArguments.Resolve): Add a CS0306 check.
3627 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3628 (opt_nullable): New rule.
3629 (type): Added `opt_nullable' to `namespace_or_type_name',
3630 `builtin_types' and `pointer_type'.
3631 (array_type): Added `opt_nullable'.
3632 (opt_rank_specifier_or_nullable): New rule; this is the
3633 combination of `opt_rank_specifier' and `opt_nullable'.
3634 (opt_error): New rule; catch errors here.
3635 (nullable_type_or_conditional): New rule; we use this to check for
3636 nullable and still detect the conditional operator.
3637 (local_variable_type): Use `opt_rank_specifier_or_nullable'
3638 instead `opt_rank_specifier'.
3640 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3643 2005-02-24 Martin Baulig <martin@ximian.com>
3645 * README, README.Changes: Removed; they're old and obsolete.
3647 2005-02-22 Martin Baulig <martin@ximian.com>
3649 * generic.cs (TypeParameter.Resolve): If resolving the constraints
3650 returned an error, set `constraints' to null to avoid a crash
3652 (TypeParameter.ResolveType): Likewise.
3654 2005-02-22 Martin Baulig <martin@ximian.com>
3657 (Constraints.ResolveTypes): Protect against being called twice.
3658 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3659 (TypeParameter.ResolveType): New public method; calls
3660 constraints.ResolveTypes().
3661 (TypeParameter.DefineType): Moved constraints.ResolveType() out
3662 into the new ResolveType().
3663 (GenericMethod.Define): Call ResolveType() on all our
3666 2005-02-21 Martin Baulig <martin@ximian.com>
3669 (TypeManager.generic_nullable_type): New static public field.
3670 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3673 (RootContext.ResolveCore): Resolve "System.Nullable`1".
3675 2005-02-15 Martin Baulig <martin@ximian.com>
3677 * generic.cs (ConstructedType.Constraints): Correctly check
3678 constraints if the argument type is a type parameter; fixes
3681 2005-02-02 Martin Baulig <martin@ximian.com>
3683 * delegate.cs (Delegate.DefineType): Report an internal error if
3684 TypeManager.multicast_delegate_type is null. See bug #72015 for
3687 2005-01-29 Miguel de Icaza <miguel@novell.com>
3689 * pending.cs: Produce better code (no nops produced by using Ldarg
3692 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3693 i - 1' it should be arg + 1.
3697 2005-01-26 Martin Baulig <martin@ximian.com>
3699 * cs-parser.jay (indexer_declarator): Don't report an error if we
3700 have type parameters since we can be an explicit interface
3701 implementation; fixes #71449.
3703 2005-01-26 Martin Baulig <martin@ximian.com>
3705 * class.cs (TypeContainer.AttributeTargets): Return the correct
3706 AttributeTargets depending on our `Kind' instead of throwing an
3707 exception; fixes #71632.
3709 2005-01-26 Martin Baulig <martin@ximian.com>
3711 * delegate.cs (Delegate.DefineType): Correctly define our type
3712 parameters. Fixes #71483.
3714 2005-01-25 Raja R Harinath <rharinath@novell.com>
3717 * expression.cs (MemberAccess.DoResolve): Don't complain with
3718 cs0572 when the LHS of a member access has identical name and type
3721 2005-01-25 Marek Safar <marek.safar@seznam.cz>
3724 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3726 Create custom PermissionSet only for PermissionSetAttribute.
3728 2005-01-24 Marek Safar <marek.safar@seznam.cz>
3731 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3732 delegates in static class.
3734 2005-01-24 Martin Baulig <martin@ximian.com>
3736 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3737 merging an implicit block, just use its reachability.
3739 * statement.cs (Block.Resolve): Make the unreachable code check
3740 work wrt. implicit blocks; see test-337 from #63842.
3742 2005-01-21 Alp Toker <alp@atoker.com>
3744 * cs-parser.jay: destructor_declaration's container is PartialContainer
3745 not Class when partial types are used, so use Kind prop instead of
3748 2005-01-22 Miguel de Icaza <miguel@ximian.com>
3750 * cs-parser.jay: Improve error reporting when an interface
3753 2005-01-20 Dick Porter <dick@ximian.com>
3755 * support.cs: SeekableStreamReader fix from Sandor Dobos
3756 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3757 chars are read. Fixes bug 70369.
3759 2005-01-20 Raja R Harinath <rharinath@novell.com>
3761 * cs-parser.jay (catch_clause): Simplify current_block handling
3764 2005-01-17 Miguel de Icaza <miguel@ximian.com>
3766 * convert.cs (ImplicitStandardConversionExists): Synchronize the
3767 code with ImplicitStandardConversion to handle the implicit
3768 conversion of method groups into valid delegate invocations.
3770 The problem is that in parameter handling we were using this code
3771 path. Fixes bug #64698
3773 2005-01-19 Raja R Harinath <rharinath@novell.com>
3775 * cs-parser.jay: Fix several infelicities.
3776 - Avoid assigning to the parser value stack. Code like
3777 '$3 = null' is unclean. Synthesize a value for the code block
3779 - Avoid using oob_stack for storing location information. Use ...
3780 (_mark_): ... this. New (empty) rule. Saves the current location
3782 (foreach_statement): Avoid using oob_stack for current_block
3783 handling. Use technique used in for_statement and
3784 using_statement. Synthesize a value for the code block to store
3785 additional intermediate information.
3787 2005-01-13 Miguel de Icaza <miguel@ximian.com>
3789 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3790 of a different type is only allowed to private fields of a
3791 containing type, not on fields of a base class.
3793 See test-174.cs and error cs0122-9.cs
3795 2005-01-13 Raja R Harinath <rharinath@novell.com>
3797 Fix test-335.cs (bug #58126).
3798 * cs-parser.jay (argument): Split out non-expression parts of the
3799 rule into 'non_simple_argument'.
3800 (invocation_expression): Support parenthesized invocations with
3801 multiple arguments, and with single non-simple arguments.
3803 2005-01-13 Raja R Harinath <rharinath@novell.com>
3805 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3808 2005-01-12 Raja R Harinath <rharinath@novell.com>
3810 Fix cs0038-1.cs, cs1640-6.cs.
3811 * ecore.cs (Expression.Resolve): Remove special-case for
3812 SimpleName in error-handling.
3813 (Expression.almostMatchedMembers): Relax access permission to
3815 (Expression.MemberLookupFailed): Handle duplicates in
3816 almostMatchedMembers list.
3817 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3818 * expression.cs (New.DoResolve): Report CS1540 for more cases.
3819 * typemanager.cs (GetFullNameSignature): Use the MethodBase
3820 overload if the passed in MemberInfo is a MethodBase.
3822 2005-01-25 Martin Baulig <martin@ximian.com>
3825 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
3827 2005-01-12 Marek Safar <marek.safar@seznam.cz>
3830 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3831 for non-CAS & merge permission sets properly.
3833 2005-01-11 Raja R Harinath <rharinath@novell.com>
3835 Improve standard-compliance of simple name and member access
3836 resolution. Fixes bugs #52697, #57200, #67520, #69519.
3837 * ecore.cs (FullNamedExpression): New abstract base class
3838 for Namespaces and TypeExpressions.
3839 (ResolveFlags.SimpleName): Remove.
3840 (SimpleName): Remove support for dotted names.
3841 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
3842 DeclSpace.FindType and DeclSpace.LookupType.
3843 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3844 (Expression.ExprClassName): Make member function.
3845 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3846 a namespace. Remove creation of dotted "SimpleName"s.
3847 (MemberAccess.DoResolve): Likewise.
3848 * decl.cs (DeclSpace.Cache): Make private.
3849 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3850 (DeclSpace.FindType): Update.
3851 (DeclSpace.LookupType): Move here from RootContext. Return a
3852 FullNamedExpression.
3853 * namespace.cs (Namespace): Derive from FullNamedExpression
3854 so that it can be part of expression resolution.
3855 (Namespace.Lookup): Return an FullNamedExpression.
3856 (NamespaceEntry.LookupAlias): Lookup aliases only in current
3858 * rootcontext.cs (NamespaceLookup): Remove.
3859 (LookupType): Move to DeclSpace.
3860 * attribute.cs (CheckAttributeType): Update.
3861 * doc.cs (FindDocumentedType): Remove allowAlias argument.
3862 (FindDocumentedTypeNonArray): Likewise.
3864 2005-01-11 Raja R Harinath <rharinath@novell.com>
3866 Fix cs0509.cs, cs1632.cs.
3867 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3868 is the same as IsInterface.
3869 (TypeContainer.GetClassBases): Likewise.
3870 * statement.cs (LabeledStatement.ig): New field.
3871 (LabeledStatement.LabelTarget): Save ILGenerator which created the
3873 (LabeledStatement.DoEmit): Check that the label was created with
3874 the same ILGenerator.
3876 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3879 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3880 accessors to its properties.
3882 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3883 from accessors to property.
3885 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3888 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3891 2005-01-08 Miguel de Icaza <miguel@ximian.com>
3893 * attribute.cs: Check for null and empty strings.
3895 I have lost another battle to Paolo.
3897 2005-01-07 Marek Safar <marek.safar@seznam.cz>
3900 * class.cs (PropertyMethod): Set Parent field in ctors.
3901 (SetMethod.InternalParameters): Add unsafe switch hack.
3902 Override MarkForDuplicationCheck where it is appropriate.
3904 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3905 It says whether container allows members with the same name.
3907 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3908 Removed is_method parameter.
3910 2005-01-06 Duncan Mak <duncan@ximian.com>
3912 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3913 because the previous change led to incorrect reporting of CS1032
3914 ("Cannot define/undefine preprocessor symbols after first token in
3915 file"). Instead of using `tokens_seen' as the only flag that
3916 triggers CS1040, introduce `comments_seen'. This new flag is used
3917 to signify having seen comments on the current line, so it is
3918 unset after a newline.
3920 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
3922 * doc.cs : When searching for a type, find nested type too.
3923 This fixes bug #71040.
3925 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
3928 - Warn missing member comment on those classes which also does not
3929 have doc comments. Fixed bug #71041.
3930 - Don't warn missing doc comment on default constructor.
3933 2005-01-06 Duncan Mak <duncan@ximian.com>
3935 * cs-tokenizer.cs (xtoken): After handling traditional C-style
3936 comments, set `tokens_seen' to true. This allows us to detect
3937 misplaced preprocessor directives (i.e. not at the beginning of
3938 the a line, nor after whitespaces). In that case, report error
3939 CS1040. This fixes bug #56460.
3941 * cs-parser.jay (interface_member_declaration): Add checks for
3942 IsExplicitImpl, and report CS0541 error if an interface member is
3943 defined as an explicit interface declaration.
3945 2005-01-06 Marek Safar <marek.safar@seznam.cz>
3948 * class.cs (PropertyMethod): Set Parent field in ctors.
3949 (SetMethod.InternalParameters): Add unsafe switch hack.
3951 * decl.cs (MemberCore.Parent): Cannot be readonly.
3953 2005-01-06 Raja R Harinath <rharinath@novell.com>
3955 * decl.cs (DeclSpace.ResolveType): Remove.
3956 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3957 Merge in code from ...
3958 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
3959 * class.cs, enum.cs: Update to changes.
3961 2005-01-06 Miguel de Icaza <miguel@ximian.com>
3963 * anonymous.cs: Ensure that we init the scope of our parent if it
3964 has not been initialized yet.
3966 2004-12-30 Duncan Mak <duncan@ximian.com>
3968 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3969 if field.FieldBuilder is null. Fixes #70758.
3971 * convert.cs: Fixed some typos and updated some of the comments.
3972 (ImplicitStandardConversionExists):
3973 (TryImplicitIntConversion): If `target_type' is an interface and
3974 the type of `ic' implements this interface, return true or a new
3975 BoxedCast instead of null. This fixes #70468.
3977 2004-12-29 Duncan Mak <duncan@ximian.com>
3979 * expression.cs (Argument.Emit): Check that Expr is
3980 IMemoryLocation before casting to it, and report CS1510 otherwise.
3984 2004-12-21 Ben Maurer <bmaurer@ximian.com>
3986 * statement.cs (Block.ThisVariable): remove the recursion here, to
3987 make the --profile more sane.
3989 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
3991 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3992 assembly, by JB Evain.
3994 2004-12-17 Raja R Harinath <rharinath@novell.com>
3996 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
3997 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3998 "parent" refers to enclosing type/class. "base" refers to superclass.
4000 2004-12-17 Raja R Harinath <rharinath@novell.com>
4002 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4003 Ensure that we only have GlobalAttributes.
4004 * attribute.cs (Attribute.Emit): Make non-virtual.
4005 (GlobalAttribute.Emit): Remove.
4006 (Attribute.Resolve): Make virtual.
4007 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
4008 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4009 the argument. Don't create one.
4010 (Attribute.GetObsoleteAttribute): Likewise.
4011 (Attribute.GetClsCompliantAttributeValue): Likewise.
4012 * class.cs, decl.cs: Update to changes.
4014 2004-12-17 Marek Safar <marek.safar@seznam.cz>
4016 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4018 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4020 * statement.cs (Foreach.Resolve): Add error 186 report.
4022 2004-12-16 Marek Safar <marek.safar@seznam.cz>
4024 * expression.cs (Conditional.DoResolve): Add warning 429.
4026 * statement.cs (If.Resolve): Add warning 665.
4028 2004-12-16 Raja R Harinath <rharinath@novell.com>
4030 New invariant: RootContext.Tree.Types.NamespaceEntry == null
4031 except when in the parser, and in GlobalAttribute.
4032 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4033 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4034 RootContext.Tree.Types.NamespaceEntry once work is done.
4035 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
4036 and resets RootContext.Tree.Types.NamespaceEntry.
4038 2004-12-15 Marek Safar <marek.safar@seznam.cz>
4040 * cs-parser.jay: Don't create a block for every variable.
4042 2004-12-14 Miguel de Icaza <miguel@ximian.com>
4044 * location.cs: Provide extra information.
4046 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4047 variables from the captured environment, it is the ldarg_0.
4049 2004-12-14 Marek Safar <marek.safar@seznam.cz>
4051 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4054 * class.cs: Changed warning level for 169 to avoid developer
4055 displeasure from warning flooding. It will be changed back when they
4056 fix most of current BCL warnings.
4058 * RootContext.cs: Pushed default WarningLevel to 3.
4060 * statement.cs: Removed unused variable.
4062 2004-12-14 Marek Safar <marek.safar@seznam.cz>
4064 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4065 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4066 Add error 502 report.
4067 (StaticClass.DefineType): Add error 441 report.
4068 (Class.AllowedModifiersProp): New virtual property as temporary
4069 extension to AllowedModifiers.
4070 (Class.DefineType): Add error 418 report. Moved ModFlags check here
4071 to share implementation with StaticClass and don't call virtual
4074 * driver.cs (MainDriver): Add error 1558 test.
4076 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4077 report. Moved error 36 test here.
4079 * statement.cs (Throw.Resolve): Add error 724 report.
4081 * typemanager.cs: Add out_attribute_type core type.
4083 2004-12-13 Marek Safar <marek.safar@seznam.cz>
4085 * class.cs (TypeContainer.VerifyClsCompliance): Add error
4087 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4089 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4092 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4094 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
4095 Add error 3023 report.
4096 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4098 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4101 2004-12-12 John Luke <john.luke@gmail.com>
4103 * driver.cs (AddArgs): take -- into account when
4104 adding arguments, fixes bug 65710
4106 2004-12-12 Martin Baulig <martin@ximian.com>
4108 * expression.cs (Unary.TryReduceNegative): Added support for
4109 SByteConstant and ByteConstant.
4110 (Unary.Reduce): Check error values from TryReduceNegative().
4112 2004-12-10 Marek Safar <marek.safar@seznam.cz>
4114 * attributes.cs (Attribute.Resolve): Avoid multiple error report
4115 and report exception as error 182.
4117 2004-12-10 Raja R Harinath <rharinath@novell.com>
4119 * driver.cs (Main): Fix message when there are warnings.
4121 2004-12-09 Miguel de Icaza <miguel@ximian.com>
4123 * delegate.cs: Fixed my fix from yesterday, sorry about that.
4125 2004-12-09 Marek Safar <marek.safar@seznam.cz>
4127 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
4128 Reduced number of warnings.
4130 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4132 2004-12-08 Miguel de Icaza <miguel@ximian.com>
4134 * driver.cs: Removed message.
4136 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4138 2004-12-08 <vargaz@freemail.hu>
4140 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4142 2004-12-08 Martin Baulig <martin@ximian.com>
4144 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4145 instead of a CS3002 for properties and indexer.
4147 2004-12-08 Martin Baulig <martin@ximian.com>
4149 * decl.cs (MemberName.ToString): Make this work again.
4151 2004-12-08 Marek Safar <marek.safar@seznam.cz>
4153 * attribute.cs (Resolve): Add error 591 detection.
4155 * class.cs (FieldMember.Define): Add error 1547 detection.
4156 (Indexer.Define): Add error 620 detection.
4157 (Operator.Define): Add error 590 detection.
4159 * ecore.cs: Missing argument for error 79.
4161 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4164 2004-12-07 Marek Safar <marek.safar@seznam.cz>
4167 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4170 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4172 * cs-parser.jay : handle doc comments on implicit/explicit operators.
4173 Some operator comments were suppressed.
4174 * doc.cs : Implicit/explicit operator name in doc comments are like
4175 "op_Explicit(type)~returnType", so added suffix handling.
4177 2005-01-21 Alp Toker <alp@atoker.com>
4179 * cs-parser.jay: destructor_declaration's container is PartialContainer
4180 not Class when partial types are used, so use Kind prop instead of 'is'.
4182 2004-12-12 Martin Baulig <martin@ximian.com>
4184 * expression.cs (Unary.TryReduceNegative): Added support for
4185 SByteConstant and ByteConstant.
4186 (Unary.Reduce): Check error values from TryReduceNegative().
4188 2004-12-11 Martin Baulig <martin@ximian.com>
4190 * support.cs (ReflectionParameters.ParameterName): If we have a
4191 `gpd', call `ParameterName' on it.
4193 * parameter.cs (Parameter.GetParameterAttributes): New static method.
4195 * pending.cs (PendingImplementation.DefineProxy): Call
4196 DefineParameter() for all of the MethodBuilder's arguments.
4198 2004-12-09 Martin Baulig <martin@ximian.com>
4200 * doc.cs (DocUtil): Make this a static class.
4202 2004-12-09 Martin Baulig <martin@ximian.com>
4204 * expression.cs (Invocation.InferType): Moved the type inference
4205 implementation into TypeManager.
4207 * generics.cs (TypeManager): Moved the type inference
4208 implementation here.
4210 2004-12-09 Martin Baulig <martin@ximian.com>
4212 * typemanager.cs (TypeManager): Make this a partial class.
4215 (TypeManager): Move the generics part of `TypeManager' here.
4217 2004-12-08 Martin Baulig <martin@ximian.com>
4219 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4220 instead of a CS3002 for properties and indexer. Added CS3024
4221 check for generic interfaces.
4223 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
4224 instances are not CLS-compliant.
4226 2004-12-08 Martin Baulig <martin@ximian.com>
4229 (void_pointer_expression): New rule for `void*', `void**' etc.
4230 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
4232 2004-12-08 Martin Baulig <martin@ximian.com>
4234 * expression.cs (Invocation.InferType): Removed the hack for
4235 MethodCore.MayUnify().
4237 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4240 * class.cs (MethodCore.MayUnify): Use
4241 TypeManager.MayBecomeEqualGenericTypes().
4243 2004-12-08 Martin Baulig <martin@ximian.com>
4245 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
4246 parameter, box it. Fixes #69233.
4248 2004-12-08 Martin Baulig <martin@ximian.com>
4250 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
4251 have the ctor constraint. Fixes #68326.
4253 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
4255 * cs-parser.jay : interface comment was not consumed because of
4256 extra opt_semicolon before doc handling.
4258 2004-12-03 Raja R Harinath <rharinath@novell.com>
4260 Fix test-327.cs, test-328.cs, and put in early infrastructure
4261 for eventually fixing #52697.
4262 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4263 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4265 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4266 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4267 (VerifyUsing, error246): Update.
4268 * rootcontext.cs (RootContext.NamespaceLookup): Just use
4269 'NamespaceEntry.LookupNamespaceOrType'.
4271 2004-12-07 Martin Baulig <martin@ximian.com>
4273 * driver.cs: Call it "BETA SOFTWARE" :-)
4275 2004-12-06 Raja R Harinath <rharinath@novell.com>
4277 Fix crash on cs0657-17.cs.
4278 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4279 Use RootContext.Tree.Types, not 'new RootTypes ()'.
4280 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4281 the case where the NamespaceEntry gets overwritten.
4283 2004-12-06 Marek Safar <marek.safar@seznam.cz>
4285 Fixed #69195, #56821
4286 * ecore.cs (ResolveBoolean): Tiny refactoring.
4288 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4289 of right expression resolving when left is false constant and
4290 operator is LogicalAnd OR true constant and operator is LogicalOr.
4292 * statement.cs (ResolveUnreachable): Always reports warning.
4294 2004-12-05 Miguel de Icaza <miguel@ximian.com>
4296 * class.cs: Distinguish between 1721 and 1722 (just a little help
4297 for the programmer).
4299 2004-12-03 Miguel de Icaza <miguel@ximian.com>
4301 * delegate.cs: Only allow this on new versions of the language.
4303 2004-12-02 Duncan Mak <duncan@ximian.com>
4305 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4307 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4308 here as a static method. Take an additional bool out parameter
4309 `must_do_cs1540_check' for signaling to InstanceResolve.
4310 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4311 member field from PropertyExpr class and made it an argument of
4313 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4314 check for MarshalByRefObject, and report CS0122 instead of CS1540.
4315 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4316 and `remove_accessor' as well as InstanceResolve: report CS0122
4321 2004-12-07 Martin Baulig <martin@ximian.com>
4323 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
4324 and CS0692 where appropriate.
4326 2004-12-06 Martin Baulig <martin@ximian.com>
4328 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
4329 IsDuplicateImplementation() and improved it.
4331 * expression.cs (Invocation.InferTypeArguments): Added
4332 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
4333 and removed the "ref" modifier from `infered_types'.
4335 * decl.cs (MemberName.ToString): Removed the exception.
4337 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
4339 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4340 comments are allowed.
4342 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4344 * delegate.cs: Add checks for subtypes in paramaters and return values
4345 in VerifyMethod () to add support for Covariance/Contravariance
4348 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4350 * report.cs: Remove extra closing parenthesis.
4352 * convert.cs (Error_CannotImplicitConversion): If the name of the
4353 types are the same, provide some extra information.
4355 2004-12-02 Marek Safar <marek.safar@seznam.cz>
4358 * attribute.cs (Resolve): Improved implementation of params
4359 attribute arguments.
4361 * support.cs (ParameterData): Add HasParams to be faster.
4363 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
4365 all things are for /doc support:
4367 * doc.cs: new file that supports XML documentation generation.
4368 * mcs.exe.sources: added doc.cs.
4370 Handle /doc command line option.
4371 Report error 2006 instead of 5 for missing file name for /doc.
4372 Generate XML documentation when required, after type resolution.
4374 Added support for picking up documentation (/// and /** ... */),
4375 including a new XmlCommentState enumeration.
4377 Added lines to fill Documentation element for field, constant,
4378 property, indexer, method, constructor, destructor, operator, event
4379 and class, struct, interface, delegate, enum.
4380 Added lines to warn incorrect comment.
4382 Added Documentation field (passed only when /doc was specified).
4384 Added DocComment, DocCommentHeader, GenerateDocComment() and
4385 OnGenerateDocComment() and some supporting private members for
4386 /doc feature to MemberCore.
4388 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4390 Added overriden DocCommentHeader.
4392 Added overriden DocCommentHeader and GenerateDocComment().
4394 2004-12-01 Miguel de Icaza <miguel@ximian.com>
4396 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4397 unwrapping the enumeration values, chain to
4398 DoConstantNumericPromotions again, so we can promote things to the
4399 fundamental types (takes care of enums that are bytes, sbytes).
4403 2004-12-01 Raja R Harinath <rharinath@novell.com>
4405 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4406 Fix long-standing bug in type-lookup. Use FindType instead of
4407 LookupType when ec.ResolvingTypeTree.
4408 (Attribute.ResolveType, Attribute.Resolve)
4409 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4411 (Attributes.Search): Remove internal version. Update.
4412 (Attributes.SearchMulti): Update.
4413 (Attributes.GetClsCompliantAttribute): Remove.
4414 (Attributes.GetIndexerNameAttribute): Remove.
4415 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4416 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4417 * class.cs (Indexer.Define): Likewise.
4419 2004-12-01 Marek Safar <marek.safar@seznam.cz>
4422 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4423 MarshallByReference members access.
4425 * expression.cs: Use CheckMarshallByRefAccess;
4426 Better error CS0197 message.
4428 * report.cs: Print whole related error message.
4430 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4432 * class (GetClassBases): Better error 60 report.
4433 (EventProperty): Disabled warning 67 detection.
4435 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4438 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4440 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4443 2004-11-29 Marek Safar <marek.safar@seznam.cz>
4446 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4448 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4450 2004-11-26 Miguel de Icaza <miguel@ximian.com>
4452 * attribute.cs (Attribute.Resolve): Refine error reporting and
4453 report a cs0117 if the identifier does not exist, to distinguish
4454 from 0617 which is a miss-use of the actual identifier.
4456 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4457 between cs0070 and cs0079.
4459 * class.cs (MemberBase.DoDefine): When reporting a wrong
4460 accessibility level, we use MethodCore to compare instead of
4461 Method (this was a regression in some refactoring effort).
4463 So now we correctly report cs0056 again.
4465 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4466 testing the target_type (which was known to be object_type) and
4467 not the source type (which is anonymous_method).
4469 Fixed reporting of error cs1660.
4471 * expression.cs (UserCast.Source): Expose the underlying cast.
4473 * statement.cs (Switch.SwitchGoverningType): Sort the list of
4474 allowed types to find a match to int32 first (most common).
4476 In addition, it ignores any ImplicitUserConversions that did an
4477 internal implicit conversion (as the switch statement allows only
4478 one integral conversion to exist).
4480 * class.cs (PartialContainer.Create): rename `name' to
4481 `member_name' for clarity. Then replace the string calls with a
4482 call to MemberName.GetPartialName, as now using
4483 MemberName.ToString is an error (this is due to the side effects
4484 it had, that were fixed in the past).
4486 This will restore the error reporting on a number of partial class
4487 errors that were missusing this (and getting an exception as a
4488 results, which is now just a plain textual warning, because
4489 yyparse debug output would crash otherwise).
4491 2004-11-26 Raja R Harinath <rharinath@novell.com>
4493 * Makefile (PROGRAM_INSTALL_DIR): Remove.
4495 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4497 * rootcontext.cs (LookupType): Make sure to cache lookups that
4498 don't give us a negative result. This saves about 5% of corlib
4501 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4503 * report.cs (AbstractMessage.Print): messages are sent to stderr
4505 * class.cs (TypeContainer.GetClassBases): It is an error to have a
4506 non-interface in the list of interfaces (at this point, either
4507 parent was properly set, or a base class is being listed in the
4508 interfaces section).
4510 This flags error 1722, and resolves the crash from bug 69259.
4512 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4514 * statement.cs (Using.EmitExpressionFinally): make this work right
4515 for valuetypes. Fixes 69926.
4517 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4519 * const.cs (Const.ChangeType): Cope with the "0 literal can be
4520 converted to an enum" here, before we try to change the underlying
4521 type. This code exists, but it is a different code path than the
4522 one used while encoding constants.
4524 (ImplicitReferenceConversionExists): In addition, resynchronized
4525 the code here, so it matches the same code in
4526 ImplicitReferenceConversionExists for the `from any class-type S
4527 to any interface-type T'.
4529 2004-11-25 Marek Safar <marek.safar@seznam.cz>
4531 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4533 2004-11-24 Miguel de Icaza <miguel@ximian.com>
4535 * cs-parser.jay: Use verbosity accordingly.
4537 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4539 * expression.cs (Unary.ResolveOperator): Do not report warning;
4540 AddressOf reads from variable.
4542 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4544 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4548 * attribute.cs (Attributable): Removed CheckTargets.
4549 (Attributes.Emit): Explicit attribute targets are tested here.
4551 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4552 not enabled for interfaces.
4554 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4555 (GetAssemblyName): Ouch next bug there.
4557 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4559 * expression.cs: Error 275 added.
4561 2004-11-23 Marek Safar <marek.safar@seznam.cz>
4563 Fix bug #69177 (Implemented decimal constant support)
4565 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4566 (BinaryFold): Add DecimalConstant.
4568 * const.cs (Define): Decimal constant
4570 (ChangeType): Add decimal type handling.
4571 (LookupConstantValue): Don't set value for decimal type but
4572 emit DecimalConstantAttribute. Needed for constant optimization.
4574 * constant.cs (ToDecimal): New method.
4575 (ConvertToDecimal): New method.
4576 (IntConstant): Implemented ConvertToDecimal.
4577 (DecimalConstant.Emit): Emit optimized version for decimals in
4580 * expression.cs (ResolveOperator): Changed order of constant
4581 reduction to work correctly with native types which have
4582 overloaded operators.
4583 (ResolveMemberAccess): Extract constant value from attribute
4586 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4588 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4589 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4590 (ChangeType): Decimal is special.
4591 (TypeToCoreType): Add decimal type.
4593 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4595 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4598 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4600 * class.cs (EventField.ApplyAttributeBuilder): Fix error
4603 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4605 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4607 * pending.cs (PendingImplementation): Grab only interfaces.
4609 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4611 * statement.cs (ForeachHelperMethods): Add location member and
4612 error 202 detection.
4614 2004-11-18 Marek Safar <marek.safar@seznam.cz>
4616 * expression.cs (DoResolveBase): Fixed wrong warning for out
4619 2004-12-04 Martin Baulig <martin@ximian.com>
4621 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4622 to check whether the conversion is ok.
4624 * typemanager.cs (TypeManager.GetTypeArguments): Just return
4625 `Type.EmptyTypes' if we're not a generic TypeContainer.
4627 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4629 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4630 old bug: when converting from the null literal to a pointer,
4631 return an EmptyCast, not the NullLiteral.
4633 This fixes #69921, the recent null_type changes probably made this
4636 2004-12-03 Martin Baulig <martin@ximian.com>
4638 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4639 method as our child, call AnonymousMethod.Compatible() on it.
4641 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4643 * class.cs (FieldBase): Use an unused bit field from the field to
4644 encode the `has_offset' property from the FieldMember. This saves
4645 a couple of Ks on bootstrap compilation.
4647 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4648 method as our child, return the AnonymousMethod resolved
4651 * expression.cs (New.DoResolve): Allow return values from
4652 NewDelegate to also include AnonymousMethods.
4656 2004-11-29 Raja R Harinath <rharinath@novell.com>
4658 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4660 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4661 System.Runtime.InteropServices._Exception, since it's a base
4662 interface of the core type System.Exception in the net_2_0 profile.
4664 2004-11-27 Martin Baulig <martin@ximian.com>
4666 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4668 2004-11-26 Raja R Harinath <rharinath@novell.com>
4670 * Makefile: Convert to use executable.make.
4671 * gmcs.exe.sources: New.
4673 2004-11-25 Martin Baulig <martin@ximian.com>
4675 * expression.cs (Invocation.InferType): Added support for byref types.
4677 2004-11-25 Martin Baulig <martin@ximian.com>
4679 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4680 in TypeManager.TypeToCoreType().
4682 2004-11-25 Martin Baulig <martin@ximian.com>
4684 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4685 "Dispose" method from the `current_type'.
4686 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4687 DoDefineMembers() instead of using the MethodBuilder; this is
4688 required for generic iterators.
4690 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4692 2004-11-24 Martin Baulig <martin@ximian.com>
4694 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4696 2004-11-20 Martin Baulig <martin@ximian.com>
4698 * expression.cs (Invocation.InferType): Correctly infer generic
4699 instances; see gen-103.cs.
4700 (Invocation.InferTypeArguments): If a generic method doesn't have
4701 any unbound type parameters, we don't need to infer anything.
4703 2004-11-19 Raja R Harinath <rharinath@novell.com>
4705 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4707 2004-11-17 Raja R Harinath <rharinath@novell.com>
4709 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4710 (TypeHandle.GetMemberCache): New.
4711 (TypeHandle.TypeHandle): Update.
4712 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4713 (TypeManager.LookupParentInterfacesCache):
4714 Rename from LookupInterfaceCache. Optimize slightly.
4715 (TypeManager.MemberLookup_FindMembers): Update.
4716 * decl.cs (MemberCache.MemberCache): Set Container to null in the
4718 (AddCacheContents): Rename from AddHashtable.
4719 * class.cs (TypeContainer.parent_container): Remove.
4720 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4721 (TypeContainer.DoDefineMembers): Don't initialize it.
4722 Update to name changes.
4724 2004-11-17 Miguel de Icaza <miguel@ximian.com>
4726 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4727 that factors the code to check access modifiers on override.
4729 (PropertyBase): Use the code here.
4731 Patch from Lluis S'anchez, fixes bug #69361.
4733 2004-11-15 Miguel de Icaza <miguel@ximian.com>
4735 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4736 routine that is used to report the use of a captured variable
4737 whose address has been taken.
4739 There are two checks: one when variables are being captured and
4740 the other check is when the address of a variable is taken.
4742 (because an anonymous methods might be resolved before *or* after
4743 the address has been taken) and
4745 * expression.cs (Conditional.DoResolve): Remove the special
4746 casing that Martin added to trueExpr and falseExpr being both
4747 NullLiteral. We get the right behavior now just by introducing
4748 the null_type into the compiler.
4750 * convert.cs (ExplicitConversion): Change the code to use
4751 null_type instead of testing `expr is NullLiteral'.
4752 (ImplicitConversionStandard): use null_type too.
4753 (ImplicitReferenceConversionExists): use null_type too.
4754 (ImplicitReferenceConversion): use null_type too.
4756 * literal.cs: The type of `NullLiteral' is now null_type instead
4758 (Resolve): Set the type here.
4760 * typemanager.cs: Introduce null_type.
4762 2004-11-18 Martin Baulig <martin@ximian.com>
4765 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
4767 2004-11-18 Martin Baulig <martin@ximian.com>
4769 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
4771 2004-11-18 Martin Baulig <martin@ximian.com>
4773 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
4774 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
4775 call ResolveConstructedType() on it to resolve it without checking
4777 (Constraints.ResolveTypes): Check them here.
4778 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
4779 but don't check constraints.
4780 (ConstructedType.ResolveAsTypeTerminal): Override this and also
4781 check constraints here.
4782 (ConstructedType.ResolveConstructedType): New public method. This
4783 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
4784 resolve ourselves without checking constraints.
4786 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
4788 2004-11-18 Martin Baulig <martin@ximian.com>
4791 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
4793 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
4795 2004-11-18 Martin Baulig <martin@ximian.com>
4797 * ecore.cs (TypeExpr.ResolveType): Removed.
4798 (Expression.ResolveAsTypeTerminal): We always return a fully
4799 resolved `TypeExpr', so we can just access its `Type'.
4801 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
4803 2004-11-17 Martin Baulig <martin@ximian.com>
4805 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
4806 sure we don't return any unresolved TypeExpr's.
4807 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
4809 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
4811 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
4812 unresolved `ConstructedType's.
4814 2004-11-17 Martin Baulig <martin@ximian.com>
4816 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
4818 2004-11-17 Martin Baulig <martin@ximian.com>
4821 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
4823 * decl.cs (DeclSpace.ResolveType): Removed.
4824 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
4826 2004-11-17 Martin Baulig <martin@ximian.com>
4828 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4829 direction, like FindMembers() does. Fixes #69546, testcase is in
4832 2004-11-16 Martin Baulig <martin@ximian.com>
4834 This is based on a patch from Marek Safar, see bug #69082.
4835 Fixes bugs #63705 and #67130.
4837 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4838 method; create a MemberCache for an interface type and cache the
4841 * decl.cs (IMemberContainer.ParentContainer): Removed.
4842 (IMemberContainer.ParentCache): New property.
4843 (MemberCache.SetupCacheForInterface): Removed.
4844 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4845 to create a cache for an interface's "parent".
4847 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4850 2004-11-14 Ben Maurer <bmaurer@ximian.com>
4852 * statement.cs: Avoid adding bools to a hashtable.
4854 2004-11-15 Martin Baulig <martin@ximian.com>
4856 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
4858 2004-11-11 Martin Baulig <martin@ximian.com>
4860 * typemanager.cs (TypeManager.GetMethodName): New method.
4862 * class.cs (MethodData.Define): Include the generic arity in the
4863 name of an explicit interface; also add it to the method name.
4865 * pending.cs (PendingImplementation.InterfaceMethod): The method
4866 name now includes the generic arity.
4868 2004-11-07 Miguel de Icaza <miguel@ximian.com>
4870 * expression.cs (Invocation.OverloadResolve): Flag error if we are
4871 calling an unsafe method from a safe location.
4873 2004-11-06 Marek Safar <marek.safar@seznam.cz>
4876 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4878 2004-11-06 Miguel de Icaza <miguel@ximian.com>
4880 * namespace.cs (VerifyUsing): use GetPartialName instead of
4883 2004-11-05 Miguel de Icaza <miguel@ximian.com>
4885 * statement.cs (Return.Resolve): Fix regression in typo: if
4886 `in_exc', we have to request a NeedReturnLabel, this was a typo
4887 introduced in the anonymous method check-in. Fixes #69131.
4889 * Indexers were using the ShortName when defining themselves,
4890 causing a regression in the compiler bootstrap when applying the
4891 patch from 2004-11-02 (first part), now they use their full name
4892 and the bug is gone.
4894 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
4896 * driver.cs: Strip the path from the names of embedded resources. Fixes
4899 2004-11-04 Raja R Harinath <rharinath@novell.com>
4901 Fix error message regression: cs0104-2.cs.
4902 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4903 (AliasEntry.Resolve): Update.
4904 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
4906 (RootContext.LookupType): Update.
4908 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
4910 * cs-parser.jay: Add support for handling accessor modifiers
4911 * class: Add support port accessor modifiers and error checking,
4912 define PropertyMethod.Define as virtual (not abstract anymore)
4913 * ecore.cs: Add checking for proeprties access with access modifiers
4914 * iterators.cs: Modify Accessor constructor call based in the modified
4916 2004-11-02 Ben Maurer <bmaurer@ximian.com>
4918 * expression.cs (StringConcat): Handle being called twice,
4919 as when we have a concat in a field init with more than two
4922 2004-11-02 Miguel de Icaza <miguel@ximian.com>
4924 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4925 special case explicit implementations, we should always produce
4926 the .property or .event declaration.
4928 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4929 since it will not return correct data if people use this
4930 unresolved in the presence of using statements (see test-313).
4932 * class.cs (MethodData.Define): If we are an explicit interface
4933 implementation, set the method name to the full name of the
4934 interface plus the name of the method.
4936 Notice that using the method.MethodName.GetFullName() does not
4937 work, as it will only contain the name as declared on the source
4938 file (it can be a shorthand in the presence of using statements)
4939 and not the fully qualifed type name, for example:
4943 class D : ICloneable {
4944 object ICloneable.Clone () {
4948 Would produce a method called `ICloneable.Clone' instead of
4949 `System.ICloneable.Clone'.
4951 * namespace.cs (Alias.Resolve): Use GetPartialName.
4953 2004-11-01 Marek Safar <marek.safar@seznam.cz>
4955 * cs-parser.jay: Add error 1055 report.
4957 2004-11-01 Miguel de Icaza <miguel@ximian.com>
4959 * assign.cs (Assign.DoResolve): Only do the transform of
4960 assignment into a New if the types are compatible, if not, fall
4961 through and let the implicit code deal with the errors and with
4962 the necessary conversions.
4964 2004-11-01 Marek Safar <marek.safar@seznam.cz>
4966 * cs-parser.jay: Add error 1031 report.
4968 * cs-tokenizer.cs: Add location for error 1038.
4970 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4972 * cs-parser.jay: Add error 1016 report.
4974 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4976 * cs-parser.jay: Add errors 1575,1611 report.
4978 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4980 * cs-parser.jay: Add error 1001 report.
4982 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4985 * attribute.cs (GetMarshal): Add method argument for
4986 caller identification.
4988 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4989 agument for GetMarshal and RuntimeMissingSupport.
4991 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4993 * attribute.cs (ExtractSecurityPermissionSet): Removed
4994 TypeManager.code_access_permission_type.
4996 * typemanager.cs: Removed TypeManager.code_access_permission_type.
4998 2004-10-27 Miguel de Icaza <miguel@ximian.com>
5000 * expression.cs (LocalVariableReference.DoResolveLValue): Check
5001 for obsolete use of a variable here. Fixes regression on errors
5002 cs0619-25 and cs0619-26.
5004 2004-10-27 Marek Safar <marek.safar@seznam.cz>
5006 Fix #62358, implemented security attribute encoding.
5008 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5009 Tests permitted SecurityAction for assembly or other types.
5010 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5011 data from SecurityPermissionAttribute to PermisionSet class.
5013 * class.cs (ApplyAttributeBuilder): Added special handling
5014 for System.Security.Permissions.SecurityAttribute based types.
5016 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5017 special handling for System.Security.Permissions.SecurityAttribute
5020 * enum.cs (ApplyAttributeBuilder): Added special handling
5021 for System.Security.Permissions.SecurityAttribute based types.
5023 * parameter.cs (ApplyAttributeBuilder): Added special handling
5024 for System.Security.Permissions.SecurityAttribute based types.
5026 * rootcontext.cs: Next 2 core types.
5028 * typemanager.cs (TypeManager.security_permission_attr_type):
5029 Built in type for the SecurityPermission Attribute.
5030 (code_access_permission_type): Build in type.
5032 2004-10-17 Miguel de Icaza <miguel@ximian.com>
5034 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5035 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5036 all of this information into
5037 EmitContext.EmitCapturedVariableInstance.
5039 * codegen.cs (EmitCapturedVariableInstance): move here the
5040 funcionality of emitting an ldarg.0 in the presence of a
5041 remapping. This centralizes the instance emit code.
5043 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5044 then emit a load of this: it means that we have reached the
5045 topmost ScopeInfo: the one that contains the pointer to the
5046 instance of the class hosting the anonymous method.
5048 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5049 captures to the topmost CaptureContext.
5051 2004-10-12 Miguel de Icaza <miguel@ximian.com>
5053 * expression.cs (LocalVariableReference): Move the knowledge about
5054 the iterators into codegen's EmitCapturedVariableInstance.
5056 2004-10-11 Miguel de Icaza <miguel@ximian.com>
5058 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5059 all code paths return a value from an anonymous method (it is the
5060 same as the 161 error, but for anonymous methods).
5062 2004-10-08 Miguel de Icaza <miguel@ximian.com>
5064 The introduction of anonymous methods in the compiler changed
5065 various ways of doing things in the compiler. The most
5066 significant one is the hard split between the resolution phase
5067 and the emission phases of the compiler.
5069 For instance, routines that referenced local variables no
5070 longer can safely create temporary variables during the
5071 resolution phase: they must do so from the emission phase,
5072 since the variable might have been "captured", hence access to
5073 it can not be done with the local-variable operations from the runtime.
5077 (Block.Flags): New flag `IsTopLevel' to indicate that this block
5078 is a toplevel block.
5080 (ToplevelBlock): A new kind of Block, these are the blocks that
5081 are created by the parser for all toplevel method bodies. These
5082 include methods, accessors and anonymous methods.
5084 These contain some extra information not found in regular blocks:
5085 A pointer to an optional CaptureContext (for tracking captured
5086 local variables and parameters). A pointer to the parent
5089 (Return.Resolve): Catch missmatches when returning a value from an
5090 anonymous method (error 1662).
5091 Invoke NeedReturnLabel from the Resolve phase instead of the emit
5094 (Break.Resolve): ditto.
5096 (SwitchLabel): instead of defining the labels during the
5097 resolution phase, we now turned the public ILLabel and ILLabelCode
5098 labels into methods called GetILLabelCode() and GetILLabel() that
5099 only define the label during the Emit phase.
5101 (GotoCase): Track the SwitchLabel instead of the computed label
5102 (its contained therein). Emit the code by using
5103 SwitchLabel.GetILLabelCode ().
5105 (LocalInfo.Flags.Captured): A new flag has been introduce to track
5106 whether the Local has been captured or not.
5108 (LocalInfo.IsCaptured): New property, used to tell whether the
5109 local has been captured.
5111 * anonymous.cs: Vastly updated to contain the anonymous method
5114 The main classes here are: CaptureContext which tracks any
5115 captured information for a toplevel block and ScopeInfo used to
5116 track the activation frames for various local variables.
5118 Each toplevel block has an optional capture context associated
5119 with it. When a method contains an anonymous method both the
5120 toplevel method and the anonymous method will create a capture
5121 context. When variables or parameters are captured, they are
5122 recorded on the CaptureContext that owns them, for example:
5126 MyDelegate d = delegate {
5131 Here `a' will be recorded as captured on the toplevel
5132 CapturedContext, the inner captured context will not have anything
5133 (it will only have data if local variables or parameters from it
5134 are captured in a nested anonymous method.
5136 The ScopeInfo is used to track the activation frames for local
5137 variables, for example:
5139 for (int i = 0; i < 10; i++)
5140 for (int j = 0; j < 10; j++){
5141 MyDelegate d = delegate {
5146 At runtime this captures a single captured variable `i', but it
5147 captures 10 different versions of the variable `j'. The variable
5148 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5149 recorded on a child.
5151 The toplevel ScopeInfo will also track information like the `this'
5152 pointer if instance variables were referenced (this is necessary
5153 as the anonymous method lives inside a nested class in the host
5154 type of the method).
5156 (AnonymousMethod): Expanded to track the Toplevel, implement
5157 `AnonymousMethod.Compatible' to tell whether an anonymous method
5158 can be converted to a target delegate type.
5160 The routine now also produces the anonymous method content
5162 (AnonymousDelegate): A helper class that derives from
5163 DelegateCreation, this is used to generate the code necessary to
5164 produce the delegate for the anonymous method that was created.
5166 * assign.cs: API adjustments for new changes in
5167 Convert.ImplicitStandardConversionExists.
5169 * class.cs: Adjustments to cope with the fact that now toplevel
5170 blocks are of type `ToplevelBlock'.
5172 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5173 insteda of standard blocks.
5175 Flag errors if params arguments are passed to anonymous methods.
5177 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5178 `CurrentAnonymousMethod' which points to the current Anonymous
5179 Method. The variable points to the AnonymousMethod class that
5180 holds the code being compiled. It is set in the new EmitContext
5181 created for the anonymous method.
5183 (EmitContext.Phase): Introduce a variable and an enumeration to
5184 assist in enforcing some rules about when and where we are allowed
5185 to invoke certain methods (EmitContext.NeedsReturnLabel is the
5186 only one that enfonces this right now).
5188 (EmitContext.HaveCaptureInfo): new helper method that returns
5189 whether we have a CapturedContext initialized.
5191 (EmitContext.CaptureVariable): New method used to register that a
5192 LocalInfo must be flagged for capturing.
5194 (EmitContext.CapturedParameter): New method used to register that a
5195 parameters must be flagged for capturing.
5197 (EmitContext.CapturedField): New method used to register that a
5198 field must be flagged for capturing.
5200 (EmitContext.HaveCapturedVariables,
5201 EmitContext.HaveCapturedFields): Return whether there are captured
5202 variables or fields.
5204 (EmitContext.EmitMethodHostInstance): This is used to emit the
5205 instance for the anonymous method. The instance might be null
5206 (static methods), this (for anonymous methods that capture nothing
5207 and happen to live side-by-side with the current method body) or a
5208 more complicated expression if the method has a CaptureContext.
5210 (EmitContext.EmitTopBlock): Routine that drives the emission of
5211 code: it will first resolve the top block, then emit any metadata
5212 and then emit the code. The split is done so that we can extract
5213 any anonymous methods and flag any captured variables/parameters.
5215 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5216 during this phase, the ILGenerator should not be used as labels
5217 and local variables declared here might not be accessible to any
5218 code that is part of an anonymous method.
5220 Exceptions to this include the temporary variables that are
5221 created by some statements internally for holding temporary
5224 (EmitContext.EmitMeta): New routine, in charge of emitting all the
5227 (EmitContext.TemporaryReturn): This method is typically called
5228 from the Emit phase, and its the only place where we allow the
5229 ReturnLabel to be defined other than the EmitMeta. The reason is
5230 that otherwise we would have to duplicate a lot of logic in the
5231 Resolve phases of various methods that today is on the Emit
5234 (EmitContext.NeedReturnLabel): This no longer creates the label,
5235 as the ILGenerator is not valid during the resolve phase.
5237 (EmitContext.EmitThis): Extended the knowledge in this class to
5238 work in anonymous methods in addition to iterators.
5240 (EmitContext.EmitCapturedVariableInstance): This emits whatever
5241 code is necessary on the stack to access the instance to a local
5242 variable (the variable will be accessed as a field).
5244 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5245 EmitContext.EmitAddressOfParameter): Routines to support
5246 parameters (not completed at this point).
5248 Removals: Removed RemapLocal and RemapLocalLValue. We probably
5249 will also remove the parameters.
5251 * convert.cs (Convert): Define a `ConstantEC' which points to a
5252 null. This is just to prefity some code that uses
5253 ImplicitStandardConversion code and do not have an EmitContext
5256 The idea is to flag explicitly that at that point in time, it is
5257 known that the conversion will not trigger the delegate checking
5258 code in implicit conversions (which requires a valid
5261 Everywhere: pass new EmitContext parameter since
5262 ImplicitStandardConversionExists now requires it to check for
5263 anonymous method conversions.
5265 (Convert.ImplicitStandardConversionExists): If the type of an
5266 expression is the anonymous_method_type, and the type is a
5267 delegate, we invoke the AnonymousMethod.Compatible method to check
5268 whether an implicit conversion is possible.
5270 (Convert.ImplicitConversionStandard): Only do implicit method
5271 group conversions if the language level is not ISO_1.
5273 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5274 MethodInfo for the Invoke method. used by Delegate and
5277 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5278 method conversions if the target type is a delegate.
5280 Removed extra debugging nops.
5282 (LocalVariableReference): Turn the `local_info' into a public
5285 Add `prepared' field, the same hack used for FieldExprs to cope
5286 with composed assignments, as Local variables do not necessarily
5287 operate purely on the stack as they used to: they can be captured
5290 Add `temp' for a temporary result, like fields.
5292 Refactor DoResolve and DoResolveLValue into DoResolveBase.
5294 It now copes with Local variables that are captured and emits the
5295 proper instance variable to load it from a field in the captured
5298 (ParameterReference.DoResolveBase): During the resolve phase,
5299 capture parameters if we are in an anonymous method.
5301 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5302 anonymous method, use the EmitContext helper routines to emit the
5303 parameter reference.
5305 * iterators.cs: Set RemapToProxy to true/false during the
5308 * parameters.cs (GetParameterByName): New helper method.
5310 * typemanager.cs (anonymous_method_type) a new type that
5311 represents an anonyous method. This is always an internal type,
5312 used as a fencepost to test against the anonymous-methodness of an
5315 2004-10-20 Marek Safar <marek.safar@seznam.cz>
5317 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5319 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5321 2004-11-10 Martin Baulig <martin@ximian.com>
5323 * expression.cs (Invocation.BetterFunction): If two methods have
5324 equal parameter types, but only one of them is generic, the
5325 non-generic one wins.
5326 (New.DoResolve): Don't set `is_struct' to false if we're a generic
5327 instance; just use `Type.IsValueType' to determine whether
5328 something is a struct or not.
5329 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
5330 so we can be called multiple times.
5332 2004-11-10 Martin Baulig <martin@ximian.com>
5334 * generic.cs (TypeParameter.DefineConstraints): New public method.
5335 (TypeParameter.CheckAccessLevel): Override this and return true.
5336 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
5337 override ResolveType() anymore.
5338 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
5340 2004-11-10 Martin Baulig <martin@ximian.com>
5342 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
5343 call DeclSpace.ResolveNestedType() on it.
5345 2004-11-10 Martin Baulig <martin@ximian.com>
5347 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
5348 non-null, call ParameterModifier() on it.
5350 2004-11-10 Martin Baulig <martin@ximian.com>
5353 (Iterators): Added `current_type' and `this_type' fields.
5354 (Iterators.DefineIterator): Create a new EmitContext and store it
5355 in `ec'; compute `this_type'.
5357 2004-11-10 Martin Baulig <martin@ximian.com>
5360 (TypeManager.IsPrivateAccessible): New public method.
5361 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
5363 2004-11-10 Martin Baulig <martin@ximian.com>
5365 * class.cs (TypeContainer.DefineType): Call
5366 TypeBuilder.DefineGenericParameters() before resolving the type
5368 (MethodData.parent_method): New protected field.
5369 (MethodData..ctor): Added `MethodInfo parent_method' argument.
5370 (MethodData.Define): Compute `parent_method'.
5373 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5374 (MemberCore.GetClsCompliantAttributeValue): Likewise.
5375 (DeclSpace.ec): New protected field; store the EmitContext here.
5376 (DeclSpace.EmitContext): New public property.
5377 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
5378 (DeclSpace.ResolveNestedType): New public method.
5379 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
5380 (DeclSpace.NestedAccessible): Added `Type tb' argument.
5381 (DeclSpace.FamilyAccessible): Likewise.
5382 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
5383 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5386 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
5389 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5390 (Enum.Emit): Don't create a new EmitContext.
5392 2004-10-18 Martin Baulig <martin@ximian.com>
5394 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5395 `Type' directly, but call ResolveType() on it.
5396 (Catch.Resolve): Likewise.
5397 (Foreach.Resolve): Likewise.
5399 2004-10-18 Martin Baulig <martin@ximian.com>
5401 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5402 `Type' directly, but call ResolveType() on it.
5403 (Probe.DoResolve): Likewise.
5404 (ArrayCreation.LookupType): Likewise.
5405 (TypeOf.DoResolve): Likewise.
5406 (SizeOf.DoResolve): Likewise.
5408 2004-10-18 Raja R Harinath <rharinath@novell.com>
5410 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5413 2004-10-17 John Luke <john.luke@gmail.com>
5415 * class.cs (Operator.GetSignatureForError): use CSharpName
5417 * parameter.cs (Parameter.GetSignatureForError): Returns
5418 correct name even if was not defined.
5420 2004-10-13 Raja R Harinath <rharinath@novell.com>
5423 * class.cs (TypeContainer.EmitContext): New property.
5424 (DefineNestedTypes): Create an emitcontext for each part.
5425 (MethodCore.DoDefineParameters): Use container's emitcontext.
5426 Pass type array to InternalParameters.
5427 (MemberBase.DoDefine): Use container's emitcontext.
5428 (FieldMember.Define): Likewise.
5429 (Event.Define): Likewise.
5430 (SetMethod.GetParameterInfo): Change argument to EmitContext.
5431 Pass type array to InternalParameters.
5432 (SetIndexerMethod.GetParameterInfo): Likewise.
5433 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5434 * delegate.cs (Define): Pass emitcontext to
5435 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
5436 array to InternalParameters.
5437 * expression.cs (ParameterReference.DoResolveBase): Pass
5438 emitcontext to GetParameterInfo.
5439 (ComposedCast.DoResolveAsTypeStep): Remove check on
5440 ec.ResolvingTypeTree.
5441 * parameter.cs (Parameter.Resolve): Change argument to
5442 EmitContext. Use ResolveAsTypeTerminal.
5443 (Parameter.GetSignature): Change argument to EmitContext.
5444 (Parameters.ComputeSignature): Likewise.
5445 (Parameters.ComputeParameterTypes): Likewise.
5446 (Parameters.GetParameterInfo): Likewise.
5447 (Parameters.ComputeAndDefineParameterTypes): Likewise.
5448 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
5449 * support.cs (InternalParameters..ctor): Remove variant that takes
5451 * typemanager.cs (system_intptr_expr): New.
5452 (InitExpressionTypes): Initialize it.
5454 2004-10-12 Chris Toshok <toshok@ximian.com>
5456 * cs-parser.jay: fix location for try_statement and catch_clause.
5458 2004-10-18 Martin Baulig <martin@ximian.com>
5460 * class.cs (FieldMember.Define): Don't access the TypeExpr's
5461 `Type' directly, but call ResolveType() on it.
5462 (MemberBase.DoDefine): Likewise.
5464 * expression.cs (New.DoResolve): Don't access the TypeExpr's
5465 `Type' directly, but call ResolveType() on it.
5466 (ComposedCast.DoResolveAsTypeStep): Likewise.
5468 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5469 `Type' directly, but call ResolveType() on it.
5471 2004-10-17 John Luke <john.luke@gmail.com>
5473 * class.cs (Operator.GetSignatureForError): use CSharpName
5475 * parameter.cs (Parameter.GetSignatureForError): Returns
5476 correct name even if was not defined.
5478 2004-10-13 Raja R Harinath <rharinath@novell.com>
5481 * class.cs (TypeContainer.EmitContext): New property.
5482 (DefineNestedTypes): Create an emitcontext for each part.
5483 (MethodCore.DoDefineParameters): Use container's emitcontext.
5484 Pass type array to InternalParameters.
5485 (MemberBase.DoDefine): Use container's emitcontext.
5486 (FieldMember.Define): Likewise.
5487 (Event.Define): Likewise.
5488 (SetMethod.GetParameterInfo): Change argument to EmitContext.
5489 Pass type array to InternalParameters.
5490 (SetIndexerMethod.GetParameterInfo): Likewise.
5491 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5492 * delegate.cs (Define): Pass emitcontext to
5493 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
5494 array to InternalParameters.
5495 * expression.cs (ParameterReference.DoResolveBase): Pass
5496 emitcontext to GetParameterInfo.
5497 (ComposedCast.DoResolveAsTypeStep): Remove check on
5498 ec.ResolvingTypeTree.
5499 * parameter.cs (Parameter.Resolve): Change argument to
5500 EmitContext. Use ResolveAsTypeTerminal.
5501 (Parameter.GetSignature): Change argument to EmitContext.
5502 (Parameters.ComputeSignature): Likewise.
5503 (Parameters.ComputeParameterTypes): Likewise.
5504 (Parameters.GetParameterInfo): Likewise.
5505 (Parameters.ComputeAndDefineParameterTypes): Likewise.
5506 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
5507 * support.cs (InternalParameters..ctor): Remove variant that takes
5509 * typemanager.cs (system_intptr_expr): New.
5510 (InitExpressionTypes): Initialize it.
5512 2004-10-12 Chris Toshok <toshok@ximian.com>
5514 * cs-parser.jay: fix location for try_statement and catch_clause.
5516 2004-10-07 Raja R Harinath <rharinath@novell.com>
5518 More DeclSpace.ResolveType avoidance.
5519 * decl.cs (MemberCore.InUnsafe): New property.
5520 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
5521 with newly created EmitContext.
5522 (FieldMember.Define): Likewise.
5523 * delegate.cs (Delegate.Define): Likewise.
5524 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5525 only if normal name-lookup fails.
5526 (TypeExpr.DoResolve): Enable error-checking.
5527 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5528 (SizeOf.DoResolve): Likewise.
5529 (ComposedCast.DoResolveAsTypeStep): Likewise.
5530 (StackAlloc.DoResolve): Likewise.
5531 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5532 (Block.Unsafe): New property.
5533 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5534 (Unsafe): Set 'unsafe' flag of contained block.
5535 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5536 (Fixed.Resolve): Likewise.
5537 (Catch.Resolve): Likewise.
5538 (Using.ResolveLocalVariableDecls): Likewise.
5539 (Foreach.Resolve): Likewise.
5541 2004-10-05 John Luke <john.luke@gmail.com>
5543 * cs-parser.jay: add location to error CS0175
5545 2004-10-04 Miguel de Icaza <miguel@ximian.com>
5547 * ecore.cs (Expression.Constantity): Add support for turning null
5550 * const.cs (Const.Define): Allow constants to be reference types
5551 as long as the value is Null.
5553 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
5555 * namespace.cs (NamespaceEntry.Using): No matter which warning
5556 level is set, check if this namespace name has already been added.
5558 2004-10-03 Ben Maurer <bmaurer@ximian.com>
5560 * expression.cs: reftype [!=]= null should always use br[true,false].
5563 2004-10-03 Marek Safar <marek.safar@seznam.cz>
5566 * attribute.cs: Enum conversion moved to
5567 GetAttributeArgumentExpression to be applied to the all
5570 2004-10-01 Raja R Harinath <rharinath@novell.com>
5572 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5573 * class.c (TypeContainer.DefineType): Flag error if
5574 base types aren't accessible due to access permissions.
5575 * decl.cs (DeclSpace.ResolveType): Move logic to
5576 Expression.ResolveAsTypeTerminal.
5577 (DeclSpace.ResolveTypeExpr): Thin layer over
5578 Expression.ResolveAsTypeTerminal.
5579 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5580 Refactor code into NestedAccess. Use it.
5581 (DeclSpace.NestedAccess): New.
5582 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5583 argument to silence errors. Check access permissions.
5584 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5585 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5586 (Cast.DoResolve): Likewise.
5587 (New.DoResolve): Likewise.
5588 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5589 (TypeOf.DoResolve): Likewise.
5591 * expression.cs (Invocation.BetterConversion): Return the Type of
5592 the better conversion. Implement section 14.4.2.3 more faithfully.
5593 (Invocation.BetterFunction): Make boolean. Make correspondence to
5594 section 14.4.2.2 explicit.
5595 (Invocation.OverloadResolve): Update.
5596 (Invocation): Remove is_base field.
5597 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
5598 (Invocation.Emit): Likewise.
5600 2004-09-24 Marek Safar <marek.safar@seznam.cz>
5602 * cs-parser.jay: Reverted 642 warning fix.
5604 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5607 * decl.cs (FindMemberWithSameName): Indexer can have more than
5610 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5612 * expression.cs (LocalVariableReference.DoResolveLValue):
5613 Do not report warning 219 for out values.
5614 (EmptyExpression.Null): New member to avoid extra allocations.
5616 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5618 * cs-parser.jay: Fix wrong warning 642 report.
5620 * cs-tokenizer.cs (CheckNextToken): New helper;
5621 Inspect next character if is same as expected.
5623 2004-09-23 Martin Baulig <martin@ximian.com>
5625 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5626 (Convert.ImplicitReferenceConversionExists): Likewise.
5628 2004-11-09 Raja R Harinath <rharinath@novell.com>
5630 * Makefile (DISTFILES): Comment out a few missing files.
5632 2004-10-29 Raja R Harinath <rharinath@novell.com>
5634 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5635 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
5636 (gmcs.exe): Invoke bootstrap-libs.
5637 (clean-local): Clean the net_2_0_bootstrap profile too.
5638 (PROGRAM_INSTALL_DIR): New.
5639 (install-local): Use it.
5641 2004-10-13 Martin Baulig <martin@ximian.com>
5643 * generic.cs (TypeManager.InflatedConstraints): New nested class.
5644 (TypeParameter.DefineType): If we're a method type parameter and
5645 that method is overriding something, "inflate" its constraints.
5647 2004-10-12 Martin Baulig <martin@ximian.com>
5649 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5650 and have type arguments, create and resolve a ConstructedType.
5652 2004-10-12 Martin Baulig <martin@ximian.com>
5654 * decl.cs (MemberCache.FindMemberToOverride): Use
5655 TypeManager.IsEqual() to compare the parameters and Type.Equals()
5656 to compare the invocationType.
5658 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5659 When comparing two type parameters, only do the signature-only
5660 comparision for method type parameters.
5662 2004-10-11 Martin Baulig <martin@ximian.com>
5664 * report.cs: Don't make --fatal abort on warnings, we have
5665 -warnaserror for that.
5667 2004-10-11 Martin Baulig <martin@ximian.com>
5670 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5671 (TypeManager.IsEqual): Call ourself recursively instead of using
5674 2004-10-11 Martin Baulig <martin@ximian.com>
5676 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5677 on our own type parameters, not on the ones we inherit from a containing
5680 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5683 * generic.cs (TypeParameter.Define): We may only be called once.
5685 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5686 instead of TypeManager.IsEqual().
5688 2004-09-28 Martin Baulig <martin@ximian.com>
5691 (GenericConstraints.EffectiveBaseClass): New public property.
5692 (TypeParameter.GenericConstraints): New public property.
5693 (ConstructedType.CheckConstraints): Improved.
5695 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5696 (Convert.TypeParameterConversion): New private method; use this in
5697 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5698 for all conversions related to type parameters.
5700 2004-09-24 Martin Baulig <martin@ximian.com>
5702 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5703 type parameter conversions for type parameters which are known to
5706 2004-09-24 Martin Baulig <martin@ximian.com>
5708 * generic.cs (GenericConstraints): Added `IsReferenceType' and
5709 `IsValueType' properties.
5711 * support.cs (ReflectionConstraints): Use
5712 Type.GetGenericParameterConstraints() instead of the old hack.
5714 2004-09-24 Martin Baulig <martin@ximian.com>
5716 * generic.cs (GenericConstraints): Moved here and made it an
5719 * support.cs (GenericConstraints): Moved to generic.cs.
5721 2004-09-24 Martin Baulig <martin@ximian.com>
5724 (ReflectionConstraints): Un-nested this class and made it public.
5727 (TypeManager.GetTypeParameterConstraints): New public method.
5728 (TypeManager.HasConstructorConstraint): Use the attributes.
5730 2004-09-24 Martin Baulig <martin@ximian.com>
5732 * support.cs (GenericConstraints): Replaced `HasConstructor',
5733 `IsReferenceType' and `IsValueType' with `Attributes'.
5734 (ReflectionParameters.ReflectionConstraints): Removed the Create()
5735 method and made the .ctor public.
5737 * generic.cs (Constraints.Attributes): New public property.
5738 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5739 `IsReferenceType' -> `HasReferenceTypeConstraint' and
5740 `IsValueType' -> `HasValueTypeConstraint'.
5742 2004-09-23 Martin Baulig <martin@ximian.com>
5744 * generic.cs (Constraints): Reflect latest runtime changes.
5746 2004-09-23 Martin Baulig <martin@ximian.com>
5748 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5749 (Convert.ImplicitReferenceConversionExists): Likewise.
5751 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5753 * class.cs (Operator.Define): Add error 448 and 559 report.
5755 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5757 * class.cs (MemberBase.IsTypePermitted): New protected
5758 method for checking error CS0610.
5760 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5762 * class.cs (TypeContainer.HasExplicitLayout): New property
5763 Returns whether container has StructLayout attribute set Explicit.
5764 (FieldMember): New abstract class for consts and fields.
5765 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5766 (Field): Reuse FieldMember.
5768 * const.cs (Const): Reuse FieldMember.
5770 * rootcontext.cs: EmitConstants call moved to class.
5772 2004-09-22 Martin Baulig <martin@ximian.com>
5774 Marek and me just fixed one of our oldest bugs: #28562 :-)
5776 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5778 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5779 we're an EnumConstant, just return that.
5780 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5781 an EnumConstant. In this case, we need to use GetValueAsEnumType()
5782 to get the value which'll actually be written into the attribute.
5783 However, we have to use GetValue() to access the attribute's value
5786 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5788 * constant.cs (Constant.IsNegative): New abstract property
5791 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5792 (StackAlloc.DoResolve): Reused IsNegative.
5794 2004-09-22 Martin Baulig <martin@ximian.com>
5796 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
5797 public method; like LookupTypeContainer, but also works for
5800 * report.cs (Report.SymbolRelatedToPreviousError): Use
5801 TypeManager.LookupGenericTypeContainer().
5803 2004-09-22 Martin Baulig <martin@ximian.com>
5805 Thanks to Peter Sestoft for this bug report.
5807 * expression.cs (Conditional): If both the `trueExpr' and the
5808 `falseExpr' is a NullLiteral, return a NullLiteral.
5810 2004-09-22 Martin Baulig <martin@ximian.com>
5812 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5813 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5814 for the "get_Current" call.
5816 2004-09-21 Martin Baulig <martin@ximian.com>
5818 * convert.cs (Convert.ImplicitReferenceConversion): When
5819 converting to an interface type, first check whether we're
5820 converting from a reference type.
5822 2004-09-14 Martin Baulig <martin@ximian.com>
5824 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5826 2004-09-14 Marek Safar <marek.safar@seznam.cz>
5829 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5830 called and is obsolete then this member suppress message
5831 when call is inside next [Obsolete] method or type.
5833 * expression.cs: Use TestObsoleteMethodUsage member.
5835 2004-09-14 Martin Baulig <martin@ximian.com>
5837 * genericparser.cs: Removed.
5839 2004-09-13 Marek Safar <marek.safar@seznam.cz>
5841 * class.cs (MethodCore.CheckBase): Fix bug #65757.
5843 2004-09-12 Marek Safar <marek.safar@seznam.cz>
5845 * attribute.cs (Attribute.Resolve): Add error 653 report.
5847 * class.cs (Class.ApplyAttributeBuilder): Add error 641
5849 (Method.ApplyAttributeBuilder): Add error 685 report.
5850 (Operator.Define): Add error 564 report.
5852 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5854 * expression.cs (Invocation.DoResolve): Add error
5857 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5860 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5862 * class.cs (ConstructorInitializer.Resolve):
5863 Wrong error number (515->516).
5865 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5867 * class.cs (Indexer.Define): Add error 631 report.
5869 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5871 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5873 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5875 * expression.cs (Probe.DoResolve): Add error CS0241 report.
5877 2004-09-10 Marek Safar <marek.safar@seznam.cz>
5879 * cs-parser.jay: Added error CS0241 report.
5881 2004-09-10 Raja R Harinath <rharinath@novell.com>
5883 * cs-parser.jay (fixed_statement): Introduce a scope for the
5884 declaration in the 'fixed' statement.
5886 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5888 * cs-parser.jay: Added CS0230 error report.
5890 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5892 * cs-parser.jay: Added errors CS0231 and CS0257 report.
5894 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5896 * expression.cs (Argument.Resolve): Added error CS0192 and
5899 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5901 C# 2.0 #pragma warning feature
5903 * cs-tokenizer.cs (PreProcessPragma): New method;
5904 Handles #pragma directive.
5906 * report.cs (WarningRegions): New class; Support
5907 class for #pragma warning directive. It tests whether
5908 warning is enabled for a given line.
5910 2004-09-08 Miguel de Icaza <miguel@ximian.com>
5912 * const.cs: Add more descriptive error report, tahnks to
5915 2004-09-08 Marek Safar <marek.safar@seznam.cz>
5917 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5919 2004-09-07 Miguel de Icaza <miguel@ximian.com>
5921 * expression.cs: Apply patch from Ben: Remove dead code from
5922 ArrayCreation, and remove the TurnintoConstant call in const.cs,
5923 as that code just threw an exception anwyays.
5925 * const.cs: Remove the call to the turnintoconstant, for details
5928 * literal.cs: The type of the null-literal is the null type; So
5929 we use a placeholder type (literal.cs:System.Null, defined here)
5932 * expression.cs (Conditional.DoResolve): Remove some old code that
5933 is no longer needed, conversions have been fixed.
5935 (ArrayCreationExpression.DoResolve): Return false if we fail to
5936 resolve the inner expression.
5938 2004-09-07 Raja R Harinath <rharinath@novell.com>
5941 * cs-parser.jay (delegate_declaration): Record a delegate
5942 declaration as a type declaration.
5943 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5945 2004-09-06 Miguel de Icaza <miguel@ximian.com>
5947 * parameter.cs: Do not crash if the type can not be resolved.
5949 * expression.cs: Report errors with unsafe pointers, fixes #64896
5951 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
5953 * expression.cs: Pointer arith always needs to do a conv.i
5954 if the operand is a long. fix 65320
5956 2004-09-04 Marek Safar <marek.safar@seznam.cz>
5958 Fixed cs0619-37.cs, cs0619-38.cs
5960 * enum.cs (GetObsoleteAttribute): Removed.
5962 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5963 on Enum member is double staged. The first is tested member
5966 2004-09-04 Marek Safar <marek.safar@seznam.cz>
5968 Fixed #56986, #63631, #65231
5970 * class.cs: (TypeContainer.AddToMemberContainer): New method,
5971 adds member to name container.
5972 (TypeContainer.AddToTypeContainer): New method, adds type to
5974 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5975 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5976 AddOperator): Simplified by reusing AddToMemberContainer.
5977 (TypeContainer.UserDefinedStaticConstructor): Changed to property
5979 (Method.CheckForDuplications): Fixed implementation to test all
5981 (MemberBase): Detection whether member is explicit interface
5982 implementation is now in constructor.
5983 (MemberBase.UpdateMemberName): Handles IndexerName.
5984 (Accessor): Changed to keep also location information.
5985 (AbstractPropertyEventMethod): Is derived from MemberCore.
5986 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5987 will be emited or not.
5988 (PropertyBase.AreAccessorsDuplicateImplementation):
5989 Tests whether accessors are not in collision with some method.
5990 (Operator): Is derived from MethodCore to simplify common
5993 * decl.cs (Flags.TestMethodDuplication): Test for duplication
5995 (DeclSpace.AddToContainer): Adds the member to defined_names
5996 table. It tests for duplications and enclosing name conflicts.
5998 * enum.cs (EnumMember): Clean up to reuse the base structures
6000 2004-09-03 Martin Baulig <martin@ximian.com>
6002 Merged latest changes into gmcs. Please keep this comment in
6003 here, it makes it easier for me to see what changed in MCS since
6004 the last time I merged.
6006 2004-09-03 Martin Baulig <martin@ximian.com>
6008 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6009 into TypeContainer, to make partial classes work again.
6011 2004-09-03 Martin Baulig <martin@ximian.com>
6013 * rootcontext.cs (RootContext.V2): Removed.
6015 2004-03-23 Martin Baulig <martin@ximian.com>
6017 * expression.cs (Invocation.OverloadResolve): Added `bool
6018 may_fail' argument and use it instead of the Location.IsNull() hack.
6020 2004-09-09 Martin Baulig <martin@ximian.com>
6022 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
6024 2004-09-09 Martin Baulig <martin@ximian.com>
6026 * generic.cs (TypeParameter.DefineType): Added support for
6027 explicit interface methods.
6029 2004-09-09 Martin Baulig <martin@ximian.com>
6031 * README.Changes: New document. Started to list important changes
6032 between MCS and GMCS here.
6034 2004-09-08 Martin Baulig <martin@ximian.com>
6037 (TypeContainer.CheckRecursiveDefinition): New protected method.
6038 (TypeContainer.DefineType): Move the CS0146 check into
6039 CheckRecursiveDefinition().
6041 2004-09-06 Martin Baulig <martin@ximian.com>
6043 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
6044 types for the constructor constraint.
6046 2004-09-03 Martin Baulig <martin@ximian.com>
6048 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6049 into TypeContainer, to make partial classes work again.
6051 2004-09-03 Martin Baulig <martin@ximian.com>
6053 * rootcontext.cs (RootContext.V2): Removed.
6055 2004-03-23 Martin Baulig <martin@ximian.com>
6057 * expression.cs (Invocation.OverloadResolve): Added `bool
6058 may_fail' argument and use it instead of the Location.IsNull() hack.
6060 2004-09-03 Martin Baulig <martin@ximian.com>
6062 Merged latest changes into gmcs. Please keep this comment in
6063 here, it makes it easier for me to see what changed in MCS since
6064 the last time I merged.
6066 2004-09-03 Raja R Harinath <rharinath@novell.com>
6069 * expression.cs (BetterConversion): Don't allow either conversion
6070 to be null. Remove redundant implicit conversion test when 'q ==
6071 null' -- when this function is invoked, we already know that the
6072 implicit conversion exists.
6073 (BetterFunction): Assume that 'best' is non-null. Remove
6074 redundant reimplementation of IsApplicable when 'best' is null.
6075 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6076 number of arguments.
6077 (IsAncestralType): Extract from OverloadResolve.
6078 (OverloadResolve): Make robust to the MethodGroupExpr being
6079 unsorted. Implement all the logic of Section 14.5.5.1, and
6080 support overloading of methods from multiple applicable types.
6081 Clean up logic somewhat. Don't pass null methods to BetterFunction.
6083 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6084 (RealError, Warning): Append type of report to related symbol.
6086 2004-09-03 Marek Safar <marek.safar@seznam.cz>
6088 * enum.cs: Fixed CLS-Compliance checks for enum members.
6089 Error tests cs3008-8.cs, cs3014-8.cs
6091 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6093 Fixed bug #62342, #63102
6094 * class.cs: ImplementIndexer uses member.IsExplicitImpl
6095 like ImplementMethod.
6097 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6099 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6102 2004-09-02 Martin Baulig <martin@ximian.com>
6104 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6105 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6108 2004-09-01 Marek Safar <marek.safar@seznam.cz>
6110 C# 2.0 Static classes implemented
6112 * class.cs (TypeContainer): instance_constructors,
6113 initialized_fields, initialized_static_fields,
6114 default_constructor, base_inteface_types are protected to be
6115 accessible from StaticClass.
6116 (TypeContainer.DefineDefaultConstructor): New virtual method
6117 for custom default constructor generating
6118 (StaticClass): New class to handle "Static classes" feature.
6120 * cs-parser.jay: Handle static keyword on class like instance
6123 * driver.cs: Added "/langversion" command line switch with two
6124 options (iso-1, default).
6126 2004-08-31 Marek Safar <marek.safar@seznam.cz>
6128 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6130 2004-08-31 Miguel de Icaza <miguel@ximian.com>
6132 * delegate.cs: Style.
6134 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
6136 * delegate.cs: Add seperate instance expr field for miguel.
6138 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6140 * PointerArithmetic (Resolve): make sure we are not doing
6141 pointer arith on void*. Also, make sure we are resolved
6142 by not setting eclass until resolve.
6144 All callers: Make sure that PointerArithmetic gets resolved.
6146 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6148 * ArrayCreation (LookupType): If the type does not resolve
6149 to an array, give an error.
6151 2004-08-27 Marek Safar <marek.safar@seznam.cz>
6153 * statement.cs (Try.Resolve): Fixed bug #64222
6155 2004-08-27 Martin Baulig <martin@ximian.com>
6158 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6161 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6163 * ecore.cs (Constantify): Get underlying type via
6164 System.Enum.GetUnderlyingType to avoid StackOverflow on the
6165 Windows in special cases.
6167 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6169 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6170 for obtaining also private methods.
6171 (GetRemoveMethod): Used GetRemoveMethod (true)
6172 for obtaining also private methods.
6174 2004-09-02 Martin Baulig <martin@ximian.com>
6176 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6177 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6180 2004-08-27 Martin Baulig <martin@ximian.com>
6183 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6186 2004-08-25 Martin Baulig <martin@ximian.com>
6188 * support.cs (ReflectionParameters..ctor): If this is a generic
6189 method, retrieve and store its type parameters.
6190 (InternalParameters..ctor): Added `TypeParameter[]' argument.
6191 (ReflectionParameters.GenericConstraints): The argument specifies
6192 the type parameter, not the method parameter.
6193 (InternalParameters.GenericConstraints): Likewise.
6195 * generic.cs (TypeParameter.DefineType): Correctly handle
6196 constraints wrt. generic methods in interfaces and their
6199 2004-08-24 Martin Baulig <martin@ximian.com>
6201 * generic.cs (TypeParameter.IsSubclassOf): New public method.
6202 (Constraints.IsSubclassOf): New internal method.
6204 * typemanager.cs (TypeManager.FindMembers): Added special support
6205 for GenericTypeParameterBuilder's.
6206 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
6209 2004-08-24 Martin Baulig <martin@ximian.com>
6212 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6213 this for accessibility checks.
6214 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6215 IsNestedFamilyAccessible.
6216 (TypeManager.IsSubclassOf): New method, do what the name actually
6219 2004-08-24 Martin Baulig <martin@ximian.com>
6221 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
6222 as a SimpleName, include the generic arity.
6224 2004-08-24 Martin Baulig <martin@ximian.com>
6226 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6227 MethodAttributes.HideBySig for operators.
6229 2004-08-23 Martin Baulig <martin@ximian.com>
6231 Back to the old error reporting system :-)
6233 * report.cs (Message): Removed.
6234 (Report.MessageData, ErrorData, WarningData): Removed.
6235 (Report.Error, Warning): Back to the old system.
6237 2004-08-23 Martin Baulig <martin@ximian.com>
6239 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6241 * class.cs (TypeContainer.ParentContainer): New public virtual
6242 method; replaces the explicit interface implementation.
6243 (ClassPart.ParentContainer): Override.
6245 2004-08-23 Martin Baulig <martin@ximian.com>
6247 * statement.cs (Switch): Added support for constant switches; see
6248 #59428 or test-285.cs.
6250 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6253 * statement.cs (GetEnumeratorFilter): Removed useless
6254 logic because C# specs is strict. GetEnumerator must be
6257 2004-08-22 Martin Baulig <martin@ximian.com>
6259 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6260 a switch and may break, reset the barrier. Fixes #59867.
6262 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6264 CLS-Compliance speed up (~5% for corlib)
6266 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6267 New method. Tests container for CLS-Compliant names
6269 * class.cs (TypeContainer.VerifyClsName): New method.
6270 Checks whether container name is CLS Compliant.
6271 (Constructor): Implements IMethodData.
6273 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6274 low-case table for CLS Compliance test.
6275 (MemberCache.VerifyClsParameterConflict): New method.
6276 Checks method parameters for CS3006 error.
6278 * enum.cs (EnumMember): Is derived from MemberCore.
6279 (Enum.VerifyClsName): Optimized for better performance.
6281 2004-08-06 Marek Safar <marek.safar@seznam.cz>
6283 * report.cs: Renamed Error_T to Error and changed all
6286 2004-08-06 Marek Safar <marek.safar@seznam.cz>
6288 * class.cs (TypeContainer.IndexerArrayList): New inner class
6289 container for indexers.
6290 (TypeContainer.DefaultIndexerName): New constant for default
6291 indexer name. Replaced all "Item" with this constant.
6292 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6294 * typemanager.cs (TypeManager.default_member_ctor): Cache here
6295 DefaultMemberAttribute constructor.
6297 2004-08-05 Martin Baulig <martin@ximian.com>
6299 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6302 2004-08-05 Marek Safar <marek.safar@seznam.cz>
6304 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6305 multi platforms problem.
6307 * compiler.csproj: Included shared files.
6309 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6311 Fix bug 60333, 55971 in the more general way
6312 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6313 Added arg_type argument for constant conversion.
6314 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6316 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6319 * class.cs (TypeContainer ): New inner classes MethodArrayList,
6320 OperatorArrayList, MethodCoreArrayList for typecontainer
6321 containers. Changed class member types to these new types.
6322 (MethodArrayList.DefineMembers): Added test for CS0659.
6324 2004-08-04 Miguel de Icaza <miguel@ximian.com>
6326 * cfold.cs: Synchronize the folding with the code in expression.cs
6327 Binary.DoNumericPromotions for uint operands.
6329 * attribute.cs: Revert patch from Raja, it introduced a regression
6330 while building Blam-1.2.1 (hard to isolate a test case).
6332 2004-08-04 Marek Safar <marek.safar@seznam.cz>
6336 (TypeContainer.Define): Renamed to DefineContainerMembers because of
6338 (MethodCore.parent_method): New member. The method we're overriding
6339 if this is an override method.
6340 (MethodCore.CheckBase): Moved from Method class and made common.
6341 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6343 (MethodCore.CheckForDuplications): New abstract method. For custom
6344 member duplication search in a container
6345 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6346 method and its return type.
6347 (Event.conflict_symbol): New member. Symbol with same name in the
6351 (MemberCache.FindMemberWithSameName): New method. The method
6352 is looking for conflict with inherited symbols.
6354 2004-08-04 Martin Baulig <martin@ximian.com>
6356 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6358 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6360 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6362 * report.cs (Message): New enum for better error, warning reference in
6364 (MessageData): New inner abstract class. It generally handles printing of
6365 error and warning messages.
6366 Removed unused Error, Warning, Message methods.
6368 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6370 Fix for cs0592-8.cs test
6372 (Attributable.ValidAttributeTargets): Made public.
6373 (Attribute.ExplicitTarget): New member for explicit target value.
6374 (Attribute.CheckTargets): Now we translate explicit attribute
6375 target to Target here.
6377 2004-08-03 Ben Maurer <bmaurer@ximian.com>
6379 * ecore.cs (MethodGroupExpr): new IsBase property.
6381 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6383 * delegate.cs (DelegateCreation): store a MethodGroupExpr
6384 rather than an instance expr.
6386 (DelegateCreation.Emit): Use the method group rather than
6387 the instance expression. Also, if you have base.Foo as the
6388 method for a delegate, make sure to emit ldftn, not ldftnvirt.
6390 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
6392 (NewDelegate.DoResolve): Only check for the existance of Invoke
6393 if the method is going to be needed. Use MethodGroupExpr.
6395 (NewDelegate.Emit): Remove, DelegateCreation implements this.
6397 * expression.cs: For pointer arith., make sure to use
6398 the size of the type, not the size of the pointer to
6401 2004-08-03 Marek Safar <marek.safar@seznam.cz>
6404 * class.cs (Class): Added error CS0502 test.
6406 2004-08-03 John Luke <jluke@cfl.rr.com>
6407 Raja R Harinath <rharinath@novell.com>
6410 * attribute.cs (Attribute.complained_before): New flag.
6411 (Attribute.ResolveType, Attribute.Resolve),
6412 (Attribute.DefinePInvokeMethod): Set it.
6413 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6415 2004-08-03 Martin Baulig <martin@ximian.com>
6417 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6418 use a user-defined operator; we still need to do numeric
6419 promotions in case one argument is a builtin type and the other
6420 one has an implicit conversion to that type. Fixes #62322.
6422 2004-08-18 Martin Baulig <martin@ximian.com>
6424 * class.cs (Method.Define): Use the correct method name when
6425 creating the MethodBuilder for a generic method.
6427 2004-08-17 Martin Baulig <martin@ximian.com>
6429 * generic.cs (Constraints): Support type parameter constraints.
6431 2004-08-16 Martin Baulig <martin@ximian.com>
6433 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
6434 (Token.GENERIC_DIMENSION): New token; this is returned if we
6435 encounter an unbound generic type in a typeof() expression.
6437 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
6438 this token is only generated while parsing a typeof() expression.
6439 (typeof_expression): Removed the old unbound_type hack.
6441 * generic.cs (TypeArguments.IsUnbound): New public property.
6443 * decl.cs (MemberName): Added support for unbound types.
6445 2004-08-14 Martin Baulig <martin@ximian.com>
6448 (TypeManager.IsEqualGenericInstance): New static method.
6449 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
6450 just used to check accessibility, so follow the rules of 26.1.6.
6452 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
6453 ConstructedType instead of a TypeExpression if we have type arguments.
6455 * cs-parser.jay (typeof_expression): Support unbound generic types.
6457 * ecore.cs (UnboundTypeExpression): New public class.
6459 2004-08-12 Martin Baulig <martin@ximian.com>
6461 * typemanager.cs (TypeManager.IsNestedChildOf): Use
6462 TypeManager.IsEqual() rather than `=='.
6464 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
6465 generic instances as well.
6467 2004-08-12 Martin Baulig <martin@ximian.com>
6469 * expression.cs (Invocation.InferType): We can only infer method
6470 type parameters. Fixes #62647.
6472 2004-08-11 Martin Baulig <martin@ximian.com>
6474 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
6475 before resolving the base classes.
6477 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6479 * Makefile: install .mdb file too.
6481 2004-08-05 Martin Baulig <martin@ximian.com>
6483 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
6484 initializer, the current type is just the TypeBuilder, not the
6485 instantiated generic type.
6486 (FieldExpr.IsFieldInitializer): New public property.
6488 2004-08-04 Martin Baulig <martin@ximian.com>
6490 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6492 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6494 2004-08-03 Martin Baulig <martin@ximian.com>
6496 * class.cs (MethodData.Define): If we're an explicit
6497 implementation, remove the generic arity from the type name.
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-02 Martin Baulig <martin@ximian.com>
6508 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
6510 (TypeContainer.GetClassBases): Return the unexpanded list of
6511 interfaces; we expand them later.
6512 (TypeContainer.DefineType): After creating the TypeBuilder, call
6513 TypeManager.ExpandInterfaces() to get an expanded and resolved
6516 * ecore.cs (TypeExpr.GetInterfaces): Removed
6518 * generics.cs (Constraints.InterfaceConstraints): Remove.
6519 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
6520 register the interface constraints.
6523 (TypeManager.AddUserType): Removed the `ifaces' argument.
6524 (TypeManager.AddTypeParameter): Likewise.
6525 (TypeManager.AddUserInterface): Removed, was unused.
6526 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
6527 `TypeExpr[]' array for the interfaces.
6528 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
6529 has been defined, returns a list of the resolved interfaces types.
6530 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
6531 (TypeManager.GetExplicitInterfaces): Likewise.
6533 2004-08-02 Martin Baulig <martin@ximian.com>
6535 * expression.cs (Invocation.EmitCall): If we're invoking a method
6536 on a type parameter, use the new `Constrained' prefix opcode.
6538 2004-08-02 Martin Baulig <martin@ximian.com>
6540 * statement.cs (LocalInfo.Flags): Added `IsThis'.
6541 (LocalInfo.IsThis): New public property.
6542 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6544 2004-08-01 Martin Baulig <martin@ximian.com>
6546 * class.cs (TypeContainer.GetClassBases): Don't set the default
6547 here since we may get called from GetPartialBases().
6548 (TypeContainer.DefineType): If GetClassBases() didn't return a
6549 parent, use the default one.
6551 2004-07-30 Martin Baulig <martin@ximian.com>
6553 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6555 * class.cs (SourceMethod): New public class, derive from the
6556 symbol writer's ISourceMethod.
6557 (Method): Use the new symbol writer API.
6559 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6560 as argument and use the new symbol writer.
6563 (SourceFile): Implement the symbol writer's ISourceFile.
6564 (Location.SymbolDocument): Removed.
6565 (Location.SourceFile): New public property.
6567 * symbolwriter.cs: Use the new symbol writer API.
6569 2004-07-30 Raja R Harinath <rharinath@novell.com>
6571 * Makefile (install-local): Remove. Functionality moved to
6574 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
6576 * Makefile: Install mcs.exe.config file together with mcs.exe.
6577 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6578 correct runtime version.
6580 2004-07-25 Martin Baulig <martin@ximian.com>
6583 (TypeContainer.RegisterOrder): Removed, this was unused.
6584 (TypeContainer, interface_order): Removed.
6585 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6586 TypeContainer as argument since we can also be called with a
6587 `PartialContainer' for a partial class/struct/interface.
6588 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6589 of checking whether we're an `Interface' - we could be a
6591 (PartialContainer.Register): Override; call
6592 AddClass()/AddStruct()/AddInterface() on our parent.
6594 * cs-parser.jay (interface_member_declaration): Add things to the
6595 `current_container', not the `current_class'.
6597 * rootcontext.cs (RegisterOrder): The overloaded version which
6598 takes an `Interface' was unused, removed.
6600 * typemanager.cs (TypeManager.LookupInterface): Return a
6601 `TypeContainer', not an `Interface'.
6602 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6603 contain a `PartialContainer' for an interface, so check it's
6604 `Kind' to figure out what it is.
6606 2004-07-25 Martin Baulig <martin@ximian.com>
6608 * class.cs (Class.DefaultTypeAttributes): New public constant.
6609 (Struct.DefaultTypeAttributes): Likewise.
6610 (Interface.DefaultTypeAttributes): Likewise.
6611 (PartialContainer.TypeAttr): Override this and add the
6612 DefaultTypeAttributes.
6614 2004-07-25 Martin Baulig <martin@ximian.com>
6616 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6617 we can just use the `Parent' field instead.
6619 2004-07-25 Martin Baulig <martin@ximian.com>
6621 * class.cs (TypeContainer.Emit): Renamed to EmitType().
6623 2004-07-25 Martin Baulig <martin@ximian.com>
6625 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6626 our parts before defining any methods.
6627 (TypeContainer.VerifyImplements): Make this virtual.
6628 (ClassPart.VerifyImplements): Override and call VerifyImplements()
6629 on our PartialContainer.
6631 2004-07-25 Martin Baulig <martin@ximian.com>
6633 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6635 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6636 argument, we can just use the `Parent' field instead.
6639 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
6640 (MemberBase.DoDefine): Likewise.
6642 2004-07-24 Martin Baulig <martin@ximian.com>
6644 * decl.cs (MemberCore.Parent): New public field.
6645 (DeclSpace.Parent): Moved to MemberCore.
6647 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6648 (MemberBase.ctor): Added TypeContainer argument, pass it to our
6650 (FieldBase, Field, Operator): Likewise.
6651 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6652 (EventField, Event): Likewise.
6654 2004-07-23 Martin Baulig <martin@ximian.com>
6656 * class.cs (PartialContainer): New public class.
6657 (ClassPart): New public class.
6658 (TypeContainer): Added support for partial classes.
6659 (TypeContainer.GetClassBases): Splitted some of the functionality
6660 out into GetNormalBases() and GetPartialBases().
6662 * cs-tokenizer.cs (Token.PARTIAL): New token.
6663 (Tokenizer.consume_identifier): Added some hacks to recognize
6664 `partial', but only if it's immediately followed by `class',
6665 `struct' or `interface'.
6667 * cs-parser.jay: Added support for partial clases.
6669 2004-07-23 Martin Baulig <martin@ximian.com>
6671 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6672 a `DeclSpace' and also made it readonly.
6673 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6674 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6675 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6677 * cs-parser.jay: Pass the `current_class', not the
6678 `current_container' (at the moment, this is still the same thing)
6679 to a new Method, Property, Event, Indexer or Constructor.
6681 2004-07-23 Martin Baulig <martin@ximian.com>
6683 * cs-parser.jay (CSharpParser): Added a new `current_class' field
6684 and removed the `current_interface' one.
6685 (struct_declaration, class_declaration, interface_declaration):
6686 Set `current_class' to the newly created class/struct/interface;
6687 set their `Bases' and call Register() before parsing their body.
6689 2004-07-23 Martin Baulig <martin@ximian.com>
6691 * class.cs (Kind): New public enum.
6692 (TypeContainer): Made this class abstract.
6693 (TypeContainer.Kind): New public readonly field.
6694 (TypeContainer.CheckDef): New public method; moved here from
6696 (TypeContainer.Register): New public abstract method.
6697 (TypeContainer.GetPendingImplementations): New public abstract
6699 (TypeContainer.GetClassBases): Removed the `is_class' and
6700 `is_iface' parameters.
6701 (TypeContainer.DefineNestedTypes): Formerly known as
6703 (ClassOrStruct): Made this class abstract.
6705 * tree.cs (RootTypes): New public type.
6707 2004-07-20 Martin Baulig <martin@ximian.com>
6709 * tree.cs (Tree.RecordNamespace): Removed.
6710 (Tree.Namespaces): Removed.
6712 * rootcontext.cs (RootContext.IsNamespace): Removed.
6714 * cs-parser.jay (namespace_declaration): Just create a new
6715 NamespaceEntry here.
6717 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
6719 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6720 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6721 entry to make sure it runs in the correct runtime version.
6723 2004-07-18 Martin Baulig <martin@ximian.com>
6725 * generic.cs (ConstructedType.CheckConstraints): Improved
6726 constraints checking.
6728 2004-07-18 Martin Baulig <martin@ximian.com>
6730 * expression.cs (Invocation.BetterMethod): Call
6731 TypeManager.TypeToCoreType() on all types and removed my previous
6732 hack; we're already doig the right thing here.
6734 2004-07-17 Martin Baulig <martin@ximian.com>
6736 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6738 2004-07-16 Martin Baulig <martin@ximian.com>
6740 * iterators.cs: Added generics support.
6742 2004-07-16 Martin Baulig <martin@ximian.com>
6744 * iterators.cs: Rewrote this. We're now using one single Proxy
6745 class for both the IEnumerable and the IEnumerator interface and
6746 `Iterator' derives from Class so we can use the high-level API.
6748 * class.cs (TypeContainer.AddIterator): New method.
6749 (TypeContainer.DoDefineType): New protected virtual method, which
6750 is called from DefineType().
6751 (TypeContainer.DoDefineMembers): Call DefineType() and
6752 DefineMembers() on all our iterators.
6753 (TypeContainer.Emit): Call Emit() on all our iterators.
6754 (TypeContainer.CloseType): Call CloseType() on all our iterators.
6756 * codegen.cs (EmitContext.CurrentIterator): New public field.
6758 2004-07-15 Martin Baulig <martin@ximian.com>
6761 (TypeManager.not_supported_exception_type): New type.
6763 2004-07-14 Martin Baulig <martin@ximian.com>
6766 (TypeManager.generic_ienumerable_type): New type.
6767 (TypeManager.generic_ienumerator_type): New type.
6770 (RootContext.interfaces_first_stage): Added
6771 "System.Collections.Generic.IEnumerator`1" and
6772 "System.Collections.Generic.IEnumerable`1".
6774 2004-07-14 Martin Baulig <martin@ximian.com>
6776 * iterators.cs: Use real error numbers.
6778 2004-07-14 Martin Baulig <martin@ximian.com>
6780 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6781 requires this to be a System.Collection.IEnumerable and not a
6782 class implementing that interface.
6783 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
6785 2004-07-13 Marek Safar <marek.safar@seznam.cz>
6787 * class.cs: Fixed previous fix, it broke some error tests.
6789 2004-07-12 Martin Baulig <martin@ximian.com>
6791 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6794 2004-07-14 Martin Baulig <martin@ximian.com>
6796 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
6797 an exclamation mark (!) for the generic arity to reflect the
6798 latest spec changes; ie. use "System.Collections.Generic.IList`1".
6800 2004-07-13 Martin Baulig <martin@ximian.com>
6802 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
6803 specifiers being part of a type argument.
6805 2004-07-13 Martin Baulig <martin@ximian.com>
6807 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
6808 name for generic types.
6810 2004-07-13 Martin Baulig <martin@ximian.com>
6812 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
6815 2004-07-09 Miguel de Icaza <miguel@ximian.com>
6817 * assign.cs (LocalTemporary): Add new argument: is_address,If
6818 `is_address' is true, then the value that we store is the address
6819 to the real value, and not the value itself.
6821 * ecore.cs (PropertyExpr): use the new local temporary
6822 stuff to allow us to handle X.Y += z (where X is a struct)
6824 2004-07-08 Martin Baulig <martin@ximian.com>
6826 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6827 not always return, just like we're doing in Using.Resolve().
6829 2004-07-07 Miguel de Icaza <miguel@ximian.com>
6831 * cs-parser.jay (fixed_statement): flag this as Pinned.
6833 2004-07-06 Miguel de Icaza <miguel@ximian.com>
6835 * typemanager.cs (TypeManager): Removed MakePinned method, this
6836 mechanism is replaced with the .NET 2.x compatible mechanism of
6837 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6839 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
6840 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6841 `IsFixed' property which has a different meaning.
6843 2004-07-02 Raja R Harinath <rharinath@novell.com>
6845 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6846 visible from inside a nested class, not just the names of the
6847 immediately enclosing class.
6850 2004-06-24 Raja R Harinath <rharinath@novell.com>
6852 * expression.cs (BetterConversion): Remove buggy special-case
6853 handling of "implicit constant expression conversions". At this
6854 point, we already know that the conversion is possible -- we're
6855 only checking to see which is better.
6857 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6859 * cs-parser.jay: Added error CS0210 test.
6861 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6863 * cs-parser.jay: Added error CS0134 test.
6865 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6868 * cs-parser.jay: Added error CS0145 test.
6870 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6872 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6874 2004-06-23 Ben Maurer <bmaurer@ximian.com>
6876 * expression.cs (StackAlloc.Resolve): The argument may not
6877 be a constant; deal with this case.
6879 2004-06-23 Marek Safar <marek.safar@seznam.cz>
6881 * attribute.cs (IndexerName_GetIndexerName): Renamed to
6882 GetIndexerAttributeValue.
6883 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6885 * class.cs (Indexer.Define): Added error tests for CS0415,
6888 2004-06-23 Miguel de Icaza <miguel@ximian.com>
6890 * attribute.cs (Attribute.Resolve): Keep field code in sync with
6893 2004-06-23 Martin Baulig <martin@ximian.com>
6895 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6896 neither return nor throw, reset the barrier as well. Fixes #60457.
6898 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
6900 * class.cs : EventAttributes is now set to None by default.
6901 This fixes bug #60459.
6903 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6906 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6907 Don't throw exception but return null (it's sufficient now).
6909 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6911 * typemanager.cs (GetArgumentTypes): Faster implementation.
6913 2004-06-18 Martin Baulig <martin@ximian.com>
6915 * attribute.cs (Attribute.Resolve): Check whether we're an
6916 EmptyCast which a Constant child. Fixes #60333.
6918 2004-06-17 Ben Maurer <bmaurer@ximian.com>
6920 * statement.cs (EmitCollectionForeach): Account for the fact that
6921 not all valuetypes are in areas which we can take the address of.
6922 For these variables, we store to a temporary variable. Also, make
6923 sure that we dont emit a `callvirt' on a valuetype method.
6925 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6927 * expression.cs (StackAlloc.DoReSolve): Added test for
6928 negative parameter (CS0247).
6930 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6933 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6935 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6938 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6941 2004-06-14 Marek Safar <marek.safar@seznam.cz>
6943 Fix bug #58254 & cs1555.cs, cs1556.cs
6944 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6946 2004-06-14 Marek Safar <marek.safar@seznam.cz>
6948 * cs-parser.jay: Added error CS1669 test for indexers.
6950 2004-06-18 Martin Baulig <martin@ximian.com>
6952 * generics.cs (GenericMethod.ctor): Don't take an Attributes
6953 argument. Fixes #60441.
6955 2004-06-16 Ben Maurer <bmaurer@ximian.com>
6956 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
6957 The name needs to have the actual name of the method in order
6958 for other tests (such as the one in OverloadResolve for Invoke
6959 on a delegate) to work. As well, it does not really help
6960 error reporting because the method group had multiple methods.
6961 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
6962 Make profiling work.
6964 2004-06-13 Martin Baulig <martin@ximian.com>
6966 * cs-parser.jay: Don't allow generic attributes.
6968 2004-06-13 Martin Baulig <martin@ximian.com>
6970 * class.cs (MemberBase.DoDefineBase): New protected method.
6971 (MemberBase.DoDefine): Compute the `flags' in the new
6972 DoDefineBase() which must be called first.
6973 (Method.Define): Call DoDefineBase() first so we have the flags
6974 when defining the generic method.
6976 * cs-parser.jay (interface_method_declaration): Support generic methods.
6978 2004-06-13 Martin Baulig <martin@ximian.com>
6980 * decl.cs (TypeName): Removed.
6981 (MemberName): Removed TypeName and MemberNow; now we just have
6984 * cs-parser.jay: Don't distinguish between type arguments and type
6985 parameters in the grammar and simplified the rules a bit. The
6986 reduce/reduce conflicts are now gone (except the one we inherited
6989 2004-06-11 Martin Baulig <martin@ximian.com>
6991 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6992 call this twice: for params and varargs methods.
6994 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6997 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6999 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7001 * attribute.cs (Attribute.GetValidTargets): Made public.
7004 (AbstractPropertyEventMethod): New class for better code sharing.
7005 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7007 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7009 2004-06-09 Martin Baulig <martin@ximian.com>
7011 * cs-parser.jay: Removed a reduce/reduce conflict.
7013 2004-06-03 Martin Baulig <martin@ximian.com>
7015 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
7016 GetSimpleName() and return a SimpleName.
7018 * ecore.cs (SimpleName.Arguments): New public field.
7019 (SimpleName): Added overloaded ctor which takes an additional
7020 TypeArguments argument.
7021 (SimpleName.SimpleNameResolve): Added support for generic methods.
7022 (MethodGroupExpr.ResolveGeneric): New public method. The code was
7023 formerly in MemberAccess.DoResolve(), but we also need it in
7024 SimpleNameResolve().
7026 * expression.cs (MemberAccess.DoResolve): Use the new
7027 MethodGroupExpr.ResolveGeneric().
7029 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7031 * decl.cs: If possible, use lookuptypedirect here. We can only do
7032 this if there is no `.' after the namespace. Avoids using
7033 LookupType, which does lots of slow processing.
7034 (FindNestedType) New method, does what it says :-).
7035 * namespace.cs: use LookupTypeDirect.
7036 * rootcontext.cs: use membercache, if possible.
7037 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7039 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7042 According to the spec,
7044 In a member access of the form E.I, if E is a single identifier,
7045 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7046 field, property, localvariable, or parameter with the same type as
7047 the meaning of E as a type-name (§3.8), then both possible
7048 meanings of E are permitted.
7050 We did not check that E as a simple-name had the same type as E as
7053 This trivial check gives us 5-7% on bootstrap time.
7055 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7057 * expression.cs (Invocation.OverloadResolve): Avoid the
7058 use of hashtables and boxing here by allocating on demand.
7060 2004-05-30 Martin Baulig <martin@ximian.com>
7062 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7063 we're doing a silent lookup. Don't try to lookup nested types in
7064 TypeManager.object_type (thanks to Ben Maurer).
7066 2004-05-30 Martin Baulig <martin@ximian.com>
7068 Committing a patch from Ben Maurer.
7070 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7072 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7074 * convert.cs: add a trivial cache for overload operator resolution.
7076 2004-05-31 Marek Safar <marek.safar@seznam.cz>
7079 (AttributeTester.GetObsoleteAttribute): Returns instance of
7080 ObsoleteAttribute when type is obsolete.
7083 (TypeContainer.VerifyObsoleteAttribute): Override.
7084 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7085 (MethodCode.VerifyObsoleteAttribute): Override.
7086 (MemberBase.VerifyObsoleteAttribute): Override.
7089 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7090 and report proper error.
7093 (Delegate.VerifyObsoleteAttribute): Override.
7096 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7097 and report proper error.
7098 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7101 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7105 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7106 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7107 Added test for ObsoleteAttribute.
7110 (Catch): Derived from Statement.
7112 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7114 * decl.cs: If possible, use lookuptypedirect here. We can only do
7115 this if there is no `.' after the namespace. Avoids using
7116 LookupType, which does lots of slow processing.
7117 (FindNestedType) New method, does what it says :-).
7118 * namespace.cs: use LookupTypeDirect.
7119 * rootcontext.cs: use membercache, if possible.
7120 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7122 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7125 According to the spec,
7127 In a member access of the form E.I, if E is a single identifier,
7128 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7129 field, property, localvariable, or parameter with the same type as
7130 the meaning of E as a type-name (§3.8), then both possible
7131 meanings of E are permitted.
7133 We did not check that E as a simple-name had the same type as E as
7136 This trivial check gives us 5-7% on bootstrap time.
7138 2004-05-30 Marek Safar <marek.safar@seznam.cz>
7140 Fixed bug #59071 & cs0160.cs
7141 * statement.cs (Try.Resolve): Check here whether order of catch
7142 clauses matches their dependencies.
7144 2004-05-30 Marek Safar <marek.safar@seznam.cz>
7147 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
7150 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7152 * expression.cs (Invocation.OverloadResolve): Avoid the
7153 use of hashtables and boxing here by allocating on demand.
7155 2004-05-30 Martin Baulig <martin@ximian.com>
7157 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7158 we're doing a silent lookup. Don't try to lookup nested types in
7159 TypeManager.object_type (thanks to Ben Maurer).
7161 2004-05-30 Martin Baulig <martin@ximian.com>
7163 Committing a patch from Ben Maurer.
7165 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7167 2004-05-29 Martin Baulig <martin@ximian.com>
7169 * class.cs (IMethodData.ShouldIgnore): New method.
7171 * typemanager.cs (TypeManager.MethodFlags): Don't take a
7172 `Location' argument, we don't need it anywhere. Use
7173 `IMethodData.ShouldIgnore ()' instead of
7174 `MethodData.GetMethodFlags ()'.
7175 (TypeManager.AddMethod): Removed.
7176 (TypeManager.AddMethod2): Renamed to AddMethod.
7178 2004-05-29 Martin Baulig <martin@ximian.com>
7180 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7182 * convert.cs (Convert.ImplicitReferenceConversion): If we're
7183 converting from a class type S to an interface type and we already
7184 have an object on the stack, don't box it again. Fixes #52578.
7186 2004-05-29 Martin Baulig <martin@ximian.com>
7188 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7189 Added support for `params' parameters. Fixes #59267.
7191 2004-05-29 Martin Baulig <martin@ximian.com>
7193 * literal.cs (NullPointer): Provide a private .ctor which sets
7194 `type' to TypeManager.object_type. Fixes #59048.
7196 2004-05-29 Martin Baulig <martin@ximian.com>
7198 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7199 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
7201 * ecore.cs (EventExpr.instance_expr): Make the field private.
7203 2004-05-26 Marek Safar <marek.safar@seznam.cz>
7205 Fixed bug #50080 & cs0214-2.cs
7206 * expression.cs (Cast.DoResolve): Check unsafe context here.
7208 * statement.cs (Resolve.DoResolve): Likewise.
7210 2004-05-26 Martin Baulig <martin@ximian.com>
7212 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7214 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7215 (RootContext.LookupType): Pass down the `silent' flag.
7217 2004-05-25 Martin Baulig <martin@ximian.com>
7220 (MethodGroupExpr.IdenticalTypeName): New public property.
7221 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7222 expression actually refers to a type.
7224 2004-05-25 Martin Baulig <martin@ximian.com>
7226 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7227 for #56176 and made it actually work.
7229 2004-05-25 Martin Baulig <martin@ximian.com>
7231 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7232 (FieldExpr, PropertyExpr): Override and implement
7233 CacheTemporaries. Fixes #52279.
7235 2004-05-25 Miguel de Icaza <miguel@ximian.com>
7237 * location.cs: In the new compiler listing a file twice is a
7238 warning, not an error.
7240 2004-05-24 Martin Baulig <martin@ximian.com>
7242 * enum.cs (Enum.DefineType): For the `BaseType' to be a
7243 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
7245 2004-05-24 Martin Baulig <martin@ximian.com>
7247 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7248 walking the `using' list. Fixes #53921.
7250 2004-05-24 Martin Baulig <martin@ximian.com>
7252 * const.cs (Const.LookupConstantValue): Added support for
7253 EmptyCast's; fixes #55251.
7255 2004-05-24 Martin Baulig <martin@ximian.com>
7257 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7258 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7259 which does the CS0135 check. The reason is that we first need to
7260 check whether the variable actually exists.
7262 2004-05-24 Martin Baulig <martin@ximian.com>
7264 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7265 than RootContext.LookupType() to find the explicit interface
7268 2004-05-24 Raja R Harinath <rharinath@novell.com>
7270 * Makefile: Simplify. Use executable.make.
7271 * mcs.exe.sources: New file. List of sources of mcs.exe.
7273 2004-05-24 Anders Carlsson <andersca@gnome.org>
7277 Use the invariant culture when doing String.Compare for CLS case
7280 2004-05-23 Martin Baulig <martin@ximian.com>
7282 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7283 don't have any dots. Fixes #52622, added cs0246-8.cs.
7285 * namespace.cs (NamespaceEntry.Lookup): Likewise.
7287 2004-05-23 Marek Safar <marek.safar@seznam.cz>
7289 * class.cs (MemberBase.Define): Reuse MemberType member for
7290 resolved type. Other methods can use it too.
7292 2004-05-23 Martin Baulig <martin@ximian.com>
7294 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7295 the variable also exists in the current block (otherwise, we need
7296 to report a CS0103). Fixes #58670.
7298 2004-05-23 Martin Baulig <martin@ximian.com>
7300 * flowanalysis.cs (Reachability.Reachable): Compute this
7301 on-the-fly rather than storing it as a field.
7303 2004-05-23 Martin Baulig <martin@ximian.com>
7305 * flowanalysis.cs (Reachability.And): Manually compute the
7306 resulting `barrier' from the reachability.
7308 2004-05-23 Marek Safar <marek.safar@seznam.cz>
7311 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7312 instance of ObsoleteAttribute when symbol is obsolete.
7315 (IMethodData): Extended interface for ObsoleteAttribute support.
7317 2004-05-22 Marek Safar <marek.safar@seznam.cz>
7319 * attribute.cs: Fix bug #55970
7321 2004-05-22 Marek Safar <marek.safar@seznam.cz>
7325 (GetObsoleteAttribute): New method. Creates the instance of
7327 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7328 ObsoleteAttribute when member is obsolete.
7329 (AttributeTester.Report_ObsoleteMessage): Common method for
7330 Obsolete error/warning reporting.
7333 (TypeContainer.base_classs_type): New member for storing parent type.
7336 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7337 for this MemberCore.
7339 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7341 * attribute.cs, const.cs: Fix bug #58590
7343 2004-05-21 Martin Baulig <martin@ximian.com>
7345 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7346 out parameters if the end of the method is unreachable. Fixes
7349 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7351 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7352 Hari was right, why extra method.
7354 2004-05-21 Marek Safar <marek.safar@seznam.cz>
7356 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7358 2004-05-20 Martin Baulig <martin@ximian.com>
7360 * delegate.cs: Convert this file to Unix mode - like the original
7363 2004-05-20 Martin Baulig <martin@ximian.com>
7365 * attribute.cs: Convert this file to Unix mode - like the original
7368 2004-05-19 Marek Safar <marek.safar@seznam.cz>
7370 Fix bug #58688 (MCS does not report error when the same attribute
7373 * attribute.cs (Attribute.Emit): Distinction between null and default.
7375 2004-05-19 Raja R Harinath <rharinath@novell.com>
7377 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7378 of a top-level attribute without an attribute target.
7379 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
7381 (Attribute.Conditional_GetConditionName),
7382 (Attribute.Obsolete_GetObsoleteMessage): Update.
7383 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
7384 part of ScanForIndexerName.
7385 (Attribute.CanIgnoreInvalidAttribute): New function.
7386 (Attribute.ScanForIndexerName): Move to ...
7387 (Attributes.ScanForIndexerName): ... here.
7388 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7389 (Attributes.Search): New internal variant that can choose not to
7390 complain if types aren't resolved. The original signature now
7392 (Attributes.GetClsCompliantAttribute): Use internal variant, with
7393 complaints suppressed.
7394 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7395 only if it not useful.
7396 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7397 top-level for attributes that are shared between the assembly
7398 and a top-level class.
7399 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7400 * class.cs: Update to reflect changes.
7401 (DefineIndexers): Fuse loops.
7402 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
7403 a couple more variants of attribute names.
7405 2004-05-18 Marek Safar <marek.safar@seznam.cz>
7407 Fix bug #52585 (Implemented explicit attribute declaration)
7410 (Attributable.ValidAttributeTargets): New abstract method. It gets
7411 list of valid attribute targets for explicit target declaration.
7412 (Attribute.Target): It holds target itself.
7413 (AttributeSection): Removed.
7414 (Attribute.CheckTargets): New method. It checks whether attribute
7415 target is valid for the current element.
7418 (EventProperty): New class. For events that are declared like
7419 property (with add and remove accessors).
7420 (EventField): New class. For events that are declared like field.
7423 * cs-parser.jay: Implemented explicit attribute target declaration.
7425 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
7426 Override ValidAttributeTargets.
7429 (ReturnParameter): Class for applying custom attributes on
7431 (ParameterAtribute): New class. Class for applying custom
7432 attributes on the parameter type.
7434 2004-05-17 Miguel de Icaza <miguel@ximian.com>
7436 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7439 (Method): Allow UNSAFE here.
7441 * modifiers.cs: Support unsafe reporting.
7443 2004-05-17 Marek Safar <marek.safar@seznam.cz>
7445 * decl.cs: Fix bug #58478.
7447 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7449 * statement.cs: When checking for unreachable code on an EmptyStatement,
7450 set the location. Fixes bug #58488.
7452 2004-05-13 Miguel de Icaza <miguel@ximian.com>
7454 * driver.cs: Add -pkg handling.
7456 From Gonzalo: UseShelLExecute=false
7458 2004-05-12 Marek Safar <marek.safar@seznam.cz>
7461 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7463 (Attribute.IsClsCompliaceRequired): Moved to base for better
7465 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7466 when attribute is AttributeUsageAttribute.
7467 (Attribute.GetValidTargets): Simplified.
7468 (Attribute.GetAttributeUsage): New method returns AttributeUsage
7469 attribute for this type.
7470 (Attribute.ApplyAttributes): Method renamed to Emit and make
7472 (GlobalAttributeSection): New class for special handling of global
7473 attributes (assembly, module).
7474 (AttributeSection.Emit): New method.
7476 * class.cs: Implemented Attributable abstract methods.
7477 (MethodCore.LabelParameters): Moved to Parameter class.
7478 (Accessor): Is back simple class.
7479 (PropertyMethod): Implemented Attributable abstract class.
7480 (DelegateMethod): Implemented Attributable abstract class.
7481 (Event): New constructor for disctintion between normal Event
7482 and Event with accessors.
7484 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7486 * codegen.cs, const.cs, decl.cs, delegate.cs:
7487 (CommonAssemblyModulClass): Implemented Attributable abstract class
7490 * enum.cs: Implement IAttributeSupport interface.
7491 (EnumMember): New class for emum members. Implemented Attributable
7495 (ParameterBase): Is abstract.
7496 (ReturnParameter): New class for easier [return:] attribute handling.
7498 * typemanager.cs: Removed builder_to_attr.
7500 2004-05-11 Raja R Harinath <rharinath@novell.com>
7503 * attribute.cs (Attribute.GetPositionalValue): New function.
7504 * class.cs (TypeContainer.VerifyMembers): New function.
7505 (TypeContainer.Emit): Use it.
7506 (ClassOrStruct): New base class for Class and Struct.
7507 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
7508 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7510 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7511 then each non-static field should have a FieldOffset attribute.
7512 Otherwise, none of the fields should have a FieldOffset attribute.
7513 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
7514 and FieldOffset attributes.
7515 * typemanager.cs (TypeManager.struct_layout_attribute_type)
7516 (TypeManager.field_offset_attribute_type): New core types.
7517 (TypeManager.InitCoreTypes): Initialize them.
7519 2004-05-11 Michal Moskal <malekith@pld-linux.org>
7521 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7522 Return correct type.
7525 2004-05-09 Miguel de Icaza <miguel@ximian.com>
7527 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7528 be implicitly converted to ulong.
7530 * expression.cs: The logic for allowing operator &, | and ^ worked
7531 was wrong, it worked before because we did not report an error in
7532 an else branch. Fixes 57895.
7534 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7535 allow volatile fields to be reference types.
7537 2004-05-07 Miguel de Icaza <miguel@ximian.com>
7539 * driver.cs: Add support for /debug-
7541 2004-05-07 Raja R Harinath <rharinath@novell.com>
7543 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
7544 Add a 'complain' parameter to silence errors.
7545 (Attribute.Resolve): Update to changes. Put in sanity check to catch
7546 silently overlooked type-resolutions.
7547 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7549 (Attributes.Search): New function.
7550 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7551 (Attributes.GetAttributeFullName): Remove hack.
7552 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
7553 Update to reflect changes.
7554 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7555 Use Attributes.Search instead of nested loops.
7557 2004-05-07 Marek Safar <marek.safar@seznam.cz>
7560 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7561 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7562 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7564 * report.cs: (Report.Warning): Renamed to Warning_T because of
7565 parameter collision.
7567 2004-05-05 Raja R Harinath <rharinath@novell.com>
7569 * expression.cs (MemberAccess.ResolveMemberAccess):
7570 Exit with non-zero status after Report.Error.
7571 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7573 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7575 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7577 * support.cs: Don't hang when the file is empty.
7579 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7581 * support.cs: In SeekableStreamReader, compute the preamble size of the
7582 underlying stream. Position changes should take into account that initial
7585 2004-05-03 Todd Berman <tberman@sevenl.net>
7587 * driver.cs: remove unused GetSysVersion function.
7589 2004-05-03 Todd Berman <tberman@sevenl.net>
7591 * driver.cs: Remove the hack from saturday, as well as the hack
7592 from jackson (LoadAssemblyFromGac), also adds the CWD to the
7593 link_paths to get that bit proper.
7595 2004-05-01 Todd Berman <tberman@sevenl.net>
7597 * driver.cs: Try a LoadFrom before a Load, this checks the current
7598 path. This is currently a bug in mono that is be fixed, however, this
7599 provides a workaround for now. This will be removed when the bug
7602 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
7604 * CryptoConvert.cs: Updated to latest version. Fix issue with
7605 incomplete key pairs (#57941).
7607 2004-05-01 Todd Berman <tberman@sevenl.net>
7609 * driver.cs: Remove '.' from path_chars, now System.* loads properly
7612 2004-04-30 Jackson Harper <jackson@ximian.com>
7614 * codegen.cs: Open keys readonly.
7616 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7618 * typemanager.cs: don't report cyclic struct layout when a struct
7619 contains 2 or more fields of the same type. Failed for Pango.AttrShape
7620 which has 2 Pango.Rectangle fields.
7622 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
7624 * expression.cs: Handle IntPtr comparisons with IL code
7625 rather than a method call.
7627 2004-04-29 Martin Baulig <martin@ximian.com>
7629 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
7630 the list of PropertyInfo's in class hierarchy and find the
7631 accessor. Fixes #56013.
7633 2004-04-29 Martin Baulig <martin@ximian.com>
7635 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7637 2004-04-29 Martin Baulig <martin@ximian.com>
7639 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7641 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7643 2004-04-29 Martin Baulig <martin@ximian.com>
7645 * class.cs (ConstructorInitializer.Resolve): Check whether the
7646 parent .ctor is accessible. Fixes #52146.
7648 2004-04-29 Martin Baulig <martin@ximian.com>
7650 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7652 * statement.cs (Using.EmitLocalVariableDecls): Use
7653 TypeManager.idisposable_type, not typeof (IDisposable).
7654 (Foreach.EmitCollectionForeach): Added support for valuetypes.
7656 2004-04-29 Martin Baulig <martin@ximian.com>
7658 * class.cs (Event.Define): Don't emit the field and don't set
7659 RTSpecialName and SpecialName for events on interfaces. Fixes
7662 2004-04-29 Raja R Harinath <rharinath@novell.com>
7664 Refactor Attribute.ApplyAttributes.
7665 * attribute.cs (Attributable): New base class for objects that can
7666 have Attributes applied on them.
7667 (Attribute): Make AttributeUsage fields public.
7668 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7669 (Attribute.IsInternalCall): New property.
7670 (Attribute.UsageAttr): Convert to a public read-only property.
7671 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7672 (Attribute.ResolveType, Attribute.Resolve)
7673 (Attribute.ScanForIndexerName): Update to reflect changes.
7674 (Attribute.CheckAttributeTarget): Re-format.
7675 (Attribute.ApplyAttributes): Refactor, to various
7676 Attributable.ApplyAttributeBuilder methods.
7677 * decl.cs (MemberCore): Make Attributable.
7678 * class.cs (Accessor): Make Attributable.
7679 (MethodData.ApplyAttributes): Use proper attribute types, not
7681 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7682 (TypeContainer.ApplyAttributeBuilder)
7683 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7684 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
7685 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7686 (Operator.ApplyAttributeBuilder): New factored-out methods.
7687 * const.cs (Const.ApplyAttributeBuilder): Likewise.
7688 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7689 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7690 * parameter.cs (ParameterBase): New Attributable base class
7691 that can also represent Return types.
7692 (Parameter): Update to the changes.
7694 2004-04-29 Jackson Harper <jackson@ximian.com>
7696 * driver.cs: Prefer the corlib system version when looking for
7697 assemblies in the GAC. This is still a hack, but its a better hack
7700 2004-04-29 Marek Safar <marek.safar@seznam.cz>
7702 * decl.cs, enum.cs: Improved error 3005 reporting.
7704 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7705 (related_symbols): New private member for list of symbols
7706 related to reported error/warning.
7708 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7710 2004-04-29 Martin Baulig <martin@ximian.com>
7712 * ecore.cs (Expression.Constantify): If we're an enum and
7713 TypeManager.TypeToCoreType() doesn't give us another type, use
7714 t.UnderlyingSystemType. Fixes #56178.
7716 2004-04-29 Martin Baulig <martin@ximian.com>
7718 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7719 interfaces and for each interface, only add members directly
7720 declared in that interface. Fixes #53255.
7722 2004-04-28 Martin Baulig <martin@ximian.com>
7724 * expression.cs (ConditionalLogicalOperator): Use a temporary
7725 variable for `left' to avoid that we evaluate it more than once;
7728 2004-04-28 Martin Baulig <martin@ximian.com>
7730 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7733 2004-04-28 Martin Baulig <martin@ximian.com>
7735 * statement.cs (LocalInfo.Resolve): Check whether the type is not
7738 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7739 whether the type is not void (CS1547).
7741 2004-04-28 Martin Baulig <martin@ximian.com>
7743 * expression.cs (Unary.DoResolveLValue): Override this and report
7744 CS0131 for anything but Operator.Indirection.
7746 2004-04-28 Martin Baulig <martin@ximian.com>
7748 Committing a patch from Ben Maurer; see bug #50820.
7750 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7753 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7756 2004-04-28 Martin Baulig <martin@ximian.com>
7758 Committing a patch from Ben Maurer; see bug #50820.
7760 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7763 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7766 2004-04-28 Martin Baulig <martin@ximian.com>
7768 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7769 (Block.AddLabel): Call DoLookupLabel() to only search in the
7772 2004-04-28 Martin Baulig <martin@ximian.com>
7774 * cfold.cs (ConstantFold.BinaryFold): Added special support for
7775 comparing StringConstants and NullLiterals in Equality and Inequality.
7777 2004-04-28 Jackson Harper <jackson@ximian.com>
7779 * driver.cs: Attempt to load referenced assemblies from the
7780 GAC. This is the quick and dirty version of this method that
7781 doesnt take into account versions and just takes the first
7782 canidate found. Will be good enough for now as we will not have more
7783 then one version installed into the GAC until I update this method.
7785 2004-04-28 Martin Baulig <martin@ximian.com>
7787 * typemanager.cs (TypeManager.CheckStructCycles): New public
7788 static method to check for cycles in the struct layout.
7790 * rootcontext.cs (RootContext.PopulateTypes): Call
7791 TypeManager.CheckStructCycles() for each TypeContainer.
7792 [Note: We only need to visit each type once.]
7794 2004-04-28 Martin Baulig <martin@ximian.com>
7796 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7798 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7799 success and added `out object value'. Use a `bool resolved' field
7800 to check whether we've already been called rather than
7801 `ConstantValue != null' since this breaks for NullLiterals.
7803 2004-04-28 Raja R Harinath <rharinath@novell.com>
7805 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7806 setting of this flag, since the 'set' method may be non-public.
7808 2004-04-28 Raja R Harinath <rharinath@novell.com>
7810 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7811 check on current_vector.Block.
7813 2004-04-27 Martin Baulig <martin@ximian.com>
7815 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7816 a field initializer. Fixes #56459.
7818 2004-04-27 Martin Baulig <martin@ximian.com>
7820 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7821 we're not attempting to use an indexer. Fixes #52154.
7823 2004-04-27 Martin Baulig <martin@ximian.com>
7825 * statement.cs (Return): Don't create a return label if we don't
7826 need it; reverts my change from January 20th. Thanks to Ben
7829 2004-04-27 Martin Baulig <martin@ximian.com>
7831 According to the spec, `goto' can only leave a nested scope, but
7834 * statement.cs (Block.LookupLabel): Only lookup in the current
7835 block, don't recurse into parent or child blocks.
7836 (Block.AddLabel): Check in parent and child blocks, report
7837 CS0140/CS0158 if we find a duplicate.
7838 (Block): Removed this indexer for label lookups.
7839 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7840 this already does the error reporting for us.
7843 (FlowBranching.UsageVector.Block): New public variable; may be null.
7844 (FlowBranching.CreateSibling): Added `Block' argument.
7845 (FlowBranching.LookupLabel): New public virtual method. Lookup a
7846 label for the target of a `goto' and check whether we're not
7847 leaving a `finally'.
7849 2004-04-27 Martin Baulig <martin@ximian.com>
7851 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7852 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7855 2004-04-27 Martin Baulig <martin@ximian.com>
7857 * statement.cs (Block.AddLabel): Also check for implicit blocks
7858 and added a CS0158 check.
7860 2004-04-27 Martin Baulig <martin@ximian.com>
7862 * flowanalysis.cs (FlowBranchingLoop): New class.
7863 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7864 UsageVector's instead of an ArrayList.
7865 (FlowBranching.Label): Likewise.
7866 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7867 (FlowBranching.AddBreakVector): New method.
7869 2004-04-27 Miguel de Icaza <miguel@ximian.com>
7871 * attribute.cs: Small regression fix: only convert the type if we
7872 the type is different, fixes System.Drawing build.
7874 2004-04-27 Martin Baulig <martin@ximian.com>
7876 * attribute.cs (Attribute.Resolve): If we have a constant value
7877 for a named field or property, implicity convert it to the correct
7880 2004-04-27 Raja R Harinath <rharinath@novell.com>
7882 * statement.cs (Block.Block): Implicit blocks share
7883 'child_variable_names' fields with parent blocks.
7884 (Block.AddChildVariableNames): Remove.
7885 (Block.AddVariable): Mark variable as "used by a child block" in
7886 every surrounding block.
7887 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7888 been used in a child block, complain about violation of "Invariant
7889 meaning in blocks" rule.
7890 * cs-parser.jay (declare_local_variables): Don't use
7891 AddChildVariableNames.
7892 (foreach_statement): Don't create an implicit block: 'foreach'
7895 2004-04-23 Miguel de Icaza <miguel@ximian.com>
7897 * convert.cs (ImplicitNumericConversion): 0 is also positive when
7898 converting from 0L to ulong. Fixes 57522.
7900 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7902 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7903 derived class hides via 'new' keyword field from base class (test-242.cs).
7904 TODO: Handle this in the more general way.
7906 * class.cs (CheckBase): Ditto.
7908 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7910 * decl.cs (caching_flags): New member for storing cached values
7912 (MemberCore.Flags): New enum where bit flags for caching_flags
7914 (MemberCore.cls_compliance): Moved to caching_flags.
7915 (DeclSpace.Created): Moved to caching_flags.
7917 * class.cs: Use caching_flags instead of DeclSpace.Created
7919 2004-04-21 Miguel de Icaza <miguel@ximian.com>
7921 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7922 if we are only a derived class, not a nested class.
7924 * typemanager.cs: Same as above, but do this at the MemberLookup
7925 level (used by field and methods, properties are handled in
7926 PropertyExpr). Allow for the qualified access if we are a nested
7929 2004-04-21 Marek Safar <marek.safar@seznam.cz>
7931 * class.cs: Refactoring.
7932 (IMethodData): New inteface; Holds links to parent members
7933 to avoid member duplication (reduced memory allocation).
7934 (Method): Implemented IMethodData interface.
7935 (PropertyBase): New inner classes for get/set methods.
7936 (PropertyBase.PropertyMethod): Implemented IMethodData interface
7937 (Event): New inner classes for add/remove methods.
7938 (Event.DelegateMethod): Implemented IMethodData interface.
7940 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7941 EmitContext (related to class.cs refactoring).
7943 2004-04-21 Raja R Harinath <rharinath@novell.com>
7945 * delegate.cs (Delegate.VerifyApplicability): If the number of
7946 arguments are the same as the number of parameters, first try to
7947 verify applicability ignoring any 'params' modifier on the last
7951 2004-04-08 Martin Baulig <martin@ximian.com>
7953 Merged latest changes into gmcs. Please keep this comment in
7954 here, it makes it easier for me to see what changed in MCS since
7955 the last time I merged.
7957 2004-04-16 Raja R Harinath <rharinath@novell.com>
7959 * class.cs (TypeContainer.AddIndexer): Use
7960 'ExplicitInterfaceName' to determine if interface name was
7961 explicitly specified. 'InterfaceType' is not initialized at this time.
7962 (TypeContainer.DefineIndexers): Remove use of temporary list. The
7963 Indexers array is already in the required order. Initialize
7964 'IndexerName' only if there are normal indexers.
7965 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7966 (TypeContainer.Emit): Emit DefaultMember attribute only if
7967 IndexerName is initialized.
7970 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
7972 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7975 2004-04-15 Raja R Harinath <rharinath@novell.com>
7977 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7981 * attribute.cs (Attribute.Resolve): Check for duplicate named
7985 2004-04-15 Miguel de Icaza <miguel@ximian.com>
7987 * iterators.cs (MarkYield): track whether we are in an exception,
7988 and generate code accordingly. Use a temporary value to store the
7989 result for our state.
7991 I had ignored a bit the interaction of try/catch with iterators
7992 since their behavior was not entirely obvious, but now it is
7993 possible to verify that our behavior is the same as MS .NET 2.0
7997 2004-04-14 Miguel de Icaza <miguel@ximian.com>
7999 * iterators.cs: Avoid creating temporaries if there is no work to
8002 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8003 Enumerations, use TypeManager.EnumToUnderlying and call
8006 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8009 (This.Emit): Use EmitContext.EmitThis to emit our
8012 (This.EmitAssign): Ditto.
8014 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8015 codepaths, we will move all the functionality into
8018 (FieldExpr.EmitAssign): Ditto.
8020 This fixes several hidden bugs that I uncovered while doing a code
8021 review of this today.
8023 * codegen.cs (EmitThis): reworked so the semantics are more clear
8024 and also support value types "this" instances.
8026 * iterators.cs: Changed so that for iterators in value types, we
8027 do not pass the value type as a parameter.
8029 Initialization of the enumerator helpers is now done in the caller
8030 instead of passing the parameters to the constructors and having
8031 the constructor set the fields.
8033 The fields have now `assembly' visibility instead of private.
8035 2004-04-11 Miguel de Icaza <miguel@ximian.com>
8037 * expression.cs (Argument.Resolve): Check if fields passed as ref
8038 or out are contained in a MarshalByRefObject.
8040 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8041 another compiler type.
8043 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
8045 * class.cs (Indexer.Define): use the new name checking method.
8046 Also, return false on an error.
8047 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8048 (is_identifier_[start/part]_character): make static.
8050 2004-04-10 Miguel de Icaza <miguel@ximian.com>
8052 * expression.cs (Binary.ResolveOperator): Do no append strings
8053 twice: since we can be invoked more than once (array evaluation)
8054 on the same concatenation, take care of this here. Based on a fix
8055 from Ben (bug #56454)
8057 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8059 * codegen.cs: Fix another case where CS1548 must be reported (when
8060 delay-sign isn't specified and no private is available #56564). Fix
8061 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8062 error when MCS is used on the MS runtime and we need to delay-sign
8063 (which seems unsupported by AssemblyBuilder - see #56621).
8065 2004-04-08 Marek Safar <marek.safar@seznam.cz>
8067 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8068 (TypeManager.ComputeNamespaces): Faster implementation for
8071 * compiler.csproj: Updated AssemblyName to mcs.
8073 2004-05-11 Jackson Harper <jackson@ximian.com>
8075 * Makefile: Preserve MONO_PATH
8077 2004-05-11 Jackson Harper <jackson@ximian.com>
8079 * Makefile: Use mono and mcs to build gmcs
8081 2004-05-03 Miguel de Icaza <miguel@ximian.com>
8083 * codegen.cs: Add patch from Robert Shade
8084 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
8087 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
8089 * CryptoConvert.cs: Updated to latest version. Fix issue with
8090 incomplete key pairs (#57941).
8092 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8094 * codegen.cs: Fix another case where CS1548 must be reported (when
8095 delay-sign isn't specified and no private is available #56564). Fix
8096 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8097 error when MCS is used on the MS runtime and we need to delay-sign
8098 (which seems unsupported by AssemblyBuilder - see #56621).
8100 2004-04-29 Jackson Harper <jackson@ximian.com>
8102 * Makefile: Set MONO_PATH to use the bootstrap corlib
8103 * driver.cs: Check the GAC for referenced assemblies.
8105 2004-04-29 Martin Baulig <martin@ximian.com>
8107 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
8109 2004-04-07 Martin Baulig <martin@ximian.com>
8111 * expression.cs (Binary.ResolveOperator): Added special case for
8112 Equality/Inequality between a type parameter and a null literal.
8114 2004-04-07 Martin Baulig <martin@ximian.com>
8116 * convert.cs: Check null literal -> type parameter conversions.
8118 2004-04-07 Martin Baulig <martin@ximian.com>
8120 * generic.cs (ConstructedType.CheckConstraints): Enforce the
8121 `class' and `struct' constraints.
8123 2004-04-07 Martin Baulig <martin@ximian.com>
8125 * generic.cs (SpecialConstraint): New public enum.
8126 (Constraints.Resolve): Added support for the `class' and `struct'
8129 * cs-parser.jay (type_parameter_constraint): Added support for the
8130 `class' and `struct' constraints.
8132 2004-04-07 Martin Baulig <martin@ximian.com>
8134 * support.cs (GenericConstraints): Replaced `Types' by
8135 `ClassConstraint' and `InterfaceConstraints'; added
8136 `HasClassConstraint'.
8138 2004-04-07 Martin Baulig <martin@ximian.com>
8141 (Constraints.InterfaceConstraints): New public property.
8142 (Constraints.Types): Make this property public
8143 (TypeParameter): Implement IMemberContainer.
8144 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
8145 instead of a TypeBuilder/MethodBuilder; pass the interface
8146 constraints to TypeManager.AddTypeParameter().
8147 (TypeParameter.DefineType): Just take an EmitContext and no
8148 TypeBuilder/MethodBuilder. Use the new public API.
8150 * typemanager.cs (TypeManager.AddTypeParameter): Added
8151 `TypeExpr[]' argument; add the interfaces to the
8152 `builder_to_ifaces' hash.
8153 (TypeManager.LookupMemberContainer): For
8154 GenericTypeParameterBuilders, get the TypeParameter from the
8155 `builder_to_type_param'.
8156 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
8157 the TypeParameter and call FindMembers on it.
8159 2004-04-07 Martin Baulig <martin@ximian.com>
8162 (MethodCore.GenericMethod): Moved this field here from Method.
8163 (MethodCore.IsDuplicateImplementation): Take the number of type
8164 parameters into account if we're a generic method.
8166 * expression.cs (Invocation.InferTypeArguments): Don't return true
8167 if `arguments' is null; we still need to check whether we actually
8168 don't need to infer anything in this case.
8169 (MemberAccess): Merged the functionality from GenericMemberAccess
8172 * generic.cs (GenericMemberAccess): Removed.
8174 2004-04-05 Martin Baulig <martin@ximian.com>
8176 * decl.cs (MemberCore): For generic classes, interfaces and
8177 structs, `Name' now includes the number of type parameters
8179 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
8180 encode the number of type arguments in the type name.
8182 * expression.cs (Expression.MemberLookup): Removed the
8183 `num_type_args' argument; we now encode the number of type
8184 arguments in the type name.
8186 * ecore.cs (SimpleName): Encode the number of type arguments in
8187 the type name itself.
8189 * generic.cs (ConstructedType): Likewise.
8191 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
8192 `MemberName'; we now include the number of type parameters in the
8195 * typemanager.cs (TypeManager.CheckGeneric): Removed.
8196 (TypeManager.MemberLookup): Removed the
8197 `num_type_args' argument; we now encode the number of type
8198 arguments in the type name.
8200 2004-04-03 Martin Baulig <martin@ximian.com>
8202 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
8203 (MemberCore.MemberName): Moved here from MemberBase.
8204 (DeclSpace.SetParameterInfo): Just take the constraints as an
8205 ArrayList; we already have the type parameters in our
8206 `MemberName'; also do the CS0080 reporting here.
8208 * cs-parser.jay (struct_declaration): Use `member_name' instead of
8209 `IDENTIFIER opt_type_parameter_list'; when constructing our
8210 `MemberName', it'll already include our type parameters.
8211 (class_declaration, interface_declaration): Likewise.
8212 (delegate_declaration): Likewise.
8213 (MakeName): Take a MemberName and return a MemberName.
8214 The following two changes are required to avoid shift/reduce conflicts:
8215 (member_name): Don't include a TypeName anymore; ie. this is now
8216 just 'IDENTIFIER opt_type_parameter_list'.
8217 (property_declaration, event_declaration): Use a
8218 `namespace_or_type_name' instead of a `member_name'.
8220 2004-04-03 Martin Baulig <martin@ximian.com>
8222 * decl.cs (MemberName): Renamed to `TypeName' and created a new
8224 (TypeName): Formerly known as MemberName.
8226 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
8227 instead of a `MemberName'.
8229 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
8230 (member_name): New rule; create a MemberName.
8232 2004-04-02 Martin Baulig <martin@ximian.com>
8234 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
8235 (CS0305 and CS0308).
8237 2004-04-02 Martin Baulig <martin@ximian.com>
8239 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
8240 support for nested types.
8242 2004-04-02 Martin Baulig <martin@ximian.com>
8244 * ecore.cs (IAlias): New public interface.
8245 (TypeExpr, TypeExpression): Implement IAlias.
8246 (TypeAliasExpression): New public class.
8248 * namespace.cs (Namespace): Implement IAlias.
8249 (Namespace.Lookup): Return an IAlias instead on an object.
8250 (Namespace.DefineName): Take an IAlias instead of an object.
8251 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
8253 (NamespaceEntry.UsingAlias): Take a Membername instead of an
8255 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
8257 (NamespaceEntry.Lookup): Likewise.
8259 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
8262 * decl.cs (DeclSpace): Implement IAlias.
8263 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
8265 * generic.cs (ConstructedType): Improved error checking.
8267 2004-04-02 Martin Baulig <martin@ximian.com>
8269 * convert.cs: Added type parameter conversions.
8272 (UnboxCast.Emit): Emit an `unbox.any' for type params.
8273 (ClassCast.Emit): If the source type is a type parameter, box it.
8274 If the target type is a type parameter, emit an `unbox.any'
8275 instead of a `classcast'.1
8277 2004-04-01 Martin Baulig <martin@ximian.com>
8279 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
8281 2004-04-01 Martin Baulig <martin@ximian.com>
8283 * generic.cs (ConstructedType.CheckConstraints): Use
8284 Convert.ImplicitStandardConversionExists(); user-defined implicit
8285 conversions are not allowed according to the spec.
8287 2004-03-30 Martin Baulig <martin@ximian.com>
8289 * expression.cs (New): Added support for type parameters.
8292 (TypeManager.activator_type): New public static field.
8293 (TypeManager.activator_create_instance): Likewise.
8295 2004-03-30 Martin Baulig <martin@ximian.com>
8297 * typemanager.cs (TypeManager.HasConstructorConstraint): New
8300 2004-03-30 Martin Baulig <martin@ximian.com>
8302 * generic.cs (ConstructedType.CheckConstraints): Actually follow
8303 the spec here: the argument type must be convertible to the
8306 2004-03-30 Martin Baulig <martin@ximian.com>
8309 (TypeParameter.Define, TypeParameter.DefineMethod): Call
8310 TypeManager.AddTypeParameter().
8311 (ConstructedType.CheckConstraints): Re-enable this and actually
8312 check whether we have a constructor constraint.
8315 (TypeManager.builder_to_type_param): New static field.
8316 (TypeManager.AddTypeParameter): New static method.
8317 (TypeManager.LookupTypeParameter): New public method.
8319 2004-03-30 Martin Baulig <martin@ximian.com>
8321 * generic.cs (TypeParameter.DefineType): Return a boolean and use
8322 the new API to actually define the constructor constraint.
8325 (TypeManager.new_constraint_attr_type): New static field.
8326 (TypeManager.InitCoreTypes): Initialize it.
8328 2004-03-30 Martin Baulig <martin@ximian.com>
8330 * generic.cs (Constraints): Completed error checking, use correct
8333 2004-03-29 Martin Baulig <martin@ximian.com>
8335 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
8337 * expression.cs (Invocation.InferTypeArguments): Added overloaded
8338 public version which takes a `ParameterData pd' instead of an
8341 2004-03-29 Martin Baulig <martin@ximian.com>
8343 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
8346 2004-03-29 Martin Baulig <martin@ximian.com>
8348 * expression.cs (Argument.ResolveMethodGroup): If we're a
8349 ConstructedType, call GetMemberAccess() on it.
8351 2004-03-29 Martin Baulig <martin@ximian.com>
8353 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
8354 (MethodCore.CheckGenericOverride): When overriding a generic
8355 method, check whether the constraints match.
8357 * support.cs (GenericConstraints): New public interface.
8358 (ParameterData.GenericConstraints): New public method.
8360 * parameter.cs (Parameter.Resolve): Check whether we're a generic
8361 method parameter and compute our constraints if appropriate.
8362 (Parameter.GenericConstraints): New public property.
8364 * generic.cs (Constraints): Implement GenericConstraints.
8366 2004-03-29 Martin Baulig <martin@ximian.com>
8368 * decl.cs (MemberCache.FindMemberToOverride): Use
8369 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
8371 2004-03-29 Martin Baulig <martin@ximian.com>
8373 * generic.cs (GenericMethod.Define): Resolve our type parameters.
8375 2004-03-29 Martin Baulig <martin@ximian.com>
8377 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
8378 not allowed on non-generic declarations").
8380 2004-03-29 Martin Baulig <martin@ximian.com>
8382 * expression.cs (Invocation.InferTypeArguments): Added overloaded
8383 public version of this method.
8385 * class.cs (MethodCore.IsDuplicateImplementation): Use
8386 Invocation.InferTypeArguments() to check this.
8388 2004-03-29 Martin Baulig <martin@ximian.com>
8390 * convert.cs: Use TypeManager.IsDelegateType() instead of
8391 comparing types correctly.
8393 2004-03-29 Martin Baulig <martin@ximian.com>
8395 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
8396 types directly to make it work for generic instances.
8398 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
8400 2004-03-29 Martin Baulig <martin@ximian.com>
8402 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
8405 2004-03-24 Martin Baulig <martin@ximian.com>
8407 * decl.cs (DeclSpace.FindType): Also use
8408 TypeManager.CheckGeneric() for types from the using clauses.
8410 2004-03-23 Martin Baulig <martin@ximian.com>
8412 * expression.cs (Invocation.OverloadResolve): Added `bool
8413 may_fail' argument and use it instead of the Location.IsNull() hack.
8415 2004-03-23 Martin Baulig <martin@ximian.com>
8417 * expression.cs (Invocation.InferType): Use correct type inference
8420 2004-03-23 Martin Baulig <martin@ximian.com>
8422 * ecore.cs (MethodGroupExpr.Name): Use
8423 TypeManager.CSharpSignature() instead of just the name.
8425 * expression.cs (Invocation.OverloadResolve): Provide better error
8427 (Invocation.DoResolve): OverloadResolve() never returns null
8428 without reporting an error, so removed the error -6 reporting here.
8430 2004-03-23 Martin Baulig <martin@ximian.com>
8432 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
8435 * cs-parser.jay (delegate_declaration): Support generic delegates.
8437 * delegate.cs: Support generic delegates.
8439 2004-03-22 Martin Baulig <martin@ximian.com>
8441 * expression.cs (Invocation.InferParamsTypeArguments): New static
8442 method; does type inference for params arguments.
8444 2004-03-21 Martin Baulig <martin@ximian.com>
8446 * typemanager.cs (TypeManager.IsGenericMethod): New public static
8447 method; checks whether a method is a generic method.
8449 * expression.cs (Invocation.InferTypeArguments): New static method;
8450 infer type arguments for generic method invocation.
8452 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
8453 property; we set this to true if we're resolving a generic method
8454 invocation and the user specified type arguments, ie. we're not
8455 doing type inference.
8457 2004-03-20 Martin Baulig <martin@ximian.com>
8459 * class.cs (MethodData.DeclaringType): New public property.
8460 (MethodData.Define): Set DeclaringType here.
8461 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
8462 instead of OperatorMethodBuilder.DeclaringType.
8464 2004-03-20 Martin Baulig <martin@ximian.com>
8466 * cs-tokenizer.cs (xtoken): Return a special
8467 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
8469 * cs-parser.jay (default_value_expression): Switch to the new
8472 2004-03-19 Martin Baulig <martin@ximian.com>
8474 * decl.cs (MemberName): New class. We use this to "construct"
8475 namespace_or_type_name's.
8477 * generics.cs (TypeArguments.GetDeclarations): New public method;
8478 returns the type arguments as a string[] and reports a CS0081 if
8479 one of them is not an identifier.
8481 * class.cs (MemberBase): The .ctor now takes the name as a
8482 MemberName instead of a string.
8483 (MemberBase.ExplicitInterfaceName): Changed type from string to
8485 (MemberBase.DoDefine): If we're an explicit implementation, the
8486 InterfaceType may be a generic instance.
8488 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
8489 (namespace_name): Call MemberName.GetName () to transform the
8490 MemberName into a string and ensure we don't have any type
8492 (type_name): Call MemberName.GetTypeExpression() to transfrom the
8493 MemberName into an expression.
8494 (method_header): Use namespace_or_type_name instead of member_name.
8496 2004-04-07 Miguel de Icaza <miguel@ximian.com>
8498 * rootcontext.cs: Add new types to the boot resolution.
8500 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8501 MulticastDelegate is not allowed.
8503 * typemanager.cs: Add new types to lookup: System.TypedReference
8506 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8507 check for TypedReference or ArgIterator, they are not allowed.
8509 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8510 makes us properly catch 1510 in some conditions (see bug 56016 for
8513 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
8515 * CryptoConvert.cs: update from corlib version
8518 2004-04-05 Miguel de Icaza <miguel@ximian.com>
8520 * class.cs (Indexer.Define): Check indexername declaration
8522 2004-04-05 Marek Safar <marek.safar@seznam.cz>
8524 * attribute.cs (IsClsCompliant): Fixed problem with handling
8525 all three states (compliant, not-compliant, undetected).
8527 2004-03-30 Marek Safar <marek.safar@seznam.cz>
8529 * attribute.cs (Attribute): Location is now public.
8530 (Resolve): Store resolved arguments (pos_values) in attribute class.
8531 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8532 (GetClsCompliantAttributeValue): New method that gets
8533 CLSCompliantAttribute value.
8534 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8535 if exists else null.
8536 (AttributeTester): New class for CLS-Compliant verification routines.
8538 * class.cs (Emit): Add CLS-Compliant verification.
8539 (Method.GetSignatureForError): Implemented.
8540 (Constructor.GetSignatureForError): Implemented
8541 (Constructor.HasCompliantArgs): Returns if constructor has
8542 CLS-Compliant arguments.
8543 (Constructor.Emit): Override.
8544 (Construcor.IsIdentifierClsCompliant): New method; For constructors
8545 is needed to test only parameters.
8546 (FieldBase.GetSignatureForError): Implemented.
8547 (TypeContainer): New member for storing base interfaces.
8548 (TypeContainer.FindMembers): Search in base interfaces too.
8550 * codegen.cs (GetClsComplianceAttribute): New method that gets
8551 assembly or module CLSCompliantAttribute value.
8552 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8554 (ModuleClass.Emit): Add error 3012 test.
8556 * const.cs (Emit): Override and call base for CLS-Compliant tests.
8558 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8559 state for all decl types.
8560 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8561 if CLS-Compliant tests are required.
8562 (IsClsCompliaceRequired): New method. Analyze whether code
8563 must be CLS-Compliant.
8564 (IsExposedFromAssembly): New method. Returns true when MemberCore
8565 is exposed from assembly.
8566 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8567 value or gets cached value.
8568 (HasClsCompliantAttribute): New method. Returns true if MemberCore
8569 is explicitly marked with CLSCompliantAttribute.
8570 (IsIdentifierClsCompliant): New abstract method. This method is
8571 used to testing error 3005.
8572 (IsIdentifierAndParamClsCompliant): New method. Common helper method
8573 for identifier and parameters CLS-Compliant testing.
8574 (VerifyClsCompliance): New method. The main virtual method for
8575 CLS-Compliant verifications.
8576 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8577 null. I don't know why is null (too many public members !).
8578 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8579 and get value of first CLSCompliantAttribute that found.
8581 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8582 (VerifyClsCompliance): Override and add extra tests.
8584 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8585 clscheck- disable CLS-Compliant verification event if assembly is has
8586 CLSCompliantAttribute(true).
8588 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8589 ApllyAttribute is now called in emit section as in the other cases.
8590 Possible future Emit integration.
8591 (IsIdentifierClsCompliant): New override.
8592 (VerifyClsCompliance): New override.
8593 (GetEnumeratorName): Returns full enum name.
8595 * parameter.cs (GetSignatureForError): Implemented.
8597 * report.cs (WarningData): New struct for Warning message information.
8598 (LocationOfPreviousError): New method.
8599 (Warning): New method. Reports warning based on the warning table.
8600 (Error_T): New method. Reports error based on the error table.
8602 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8603 verifications are done here.
8605 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8607 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8608 CLSCompliantAttribute.
8609 (all_imported_types): New member holds all imported types from other
8611 (LoadAllImportedTypes): New method fills static table with exported types
8612 from all referenced assemblies.
8613 (Modules): New property returns all assembly modules.
8615 2004-03-30 Miguel de Icaza <miguel@ximian.com>
8617 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8618 throwing a parser error.
8620 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8621 which removes the hardcoded get_/set_ prefixes for properties, as
8622 IL allows for the properties to be named something else.
8626 * expression.cs: Do not override operand before we know if it is
8629 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8631 * typemanager.cs: support for pinned variables.
8633 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8635 * decl.cs, typemanager.cs: Avoid using an arraylist
8636 as a buffer if there is only one result set.
8638 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8640 * expression.cs: Make sure you cant call a static method
8641 with an instance expression, bug #56174.
8643 2004-03-29 Miguel de Icaza <miguel@ximian.com>
8645 * class.cs (IsDuplicateImplementation): Improve error reporting to
8646 flag 663 (method only differs in parameter modifier).
8648 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8649 in preprocessor directives.
8651 * location.cs (LookupFile): Allow for the empty path.
8653 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
8654 better approach for some of that patch, but its failing with the
8655 CharSet enumeration. For now try/catch will do.
8657 * typemanager.cs: Do not crash if a struct does not have fields.
8660 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8662 * expression.cs: cs0213, cant fix a fixed expression.
8665 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8667 * cs-parser.jay: detect invalid embeded statements gracefully.
8670 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8672 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8675 the invocation type may not be a subclass of the tye of the item/
8676 The type of the item must be a subclass of the invocation item.
8681 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
8683 * attribute.cs: Added methods to get a string and a bool from an
8684 attribute. Required to information from AssemblyKeyFileAttribute,
8685 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8686 * codegen.cs: Modified AssemblyName creation to include support for
8687 strongnames. Catch additional exceptions to report them as CS1548.
8688 * compiler.csproj: Updated include CryptoConvert.cs.
8689 * compiler.csproj.user: Removed file - user specific configuration.
8690 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
8691 Mono.Security assembly. The original class is maintained and tested in
8692 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8693 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8694 like CSC 8.0 (C# v2) supports.
8695 * Makefile: Added CryptoConvert.cs to mcs sources.
8696 * rootcontext.cs: Added new options for strongnames.
8698 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
8700 * driver.cs: For --expect-error, report error code `2'
8701 if the program compiled with no errors, error code `1' if
8702 it compiled with an error other than the one expected.
8704 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
8706 * compiler.csproj: Updated for Visual Studio .NET 2003.
8707 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8708 * compiler.sln: Updated for Visual Studio .NET 2003.
8710 2004-03-24 Ravi Pratap M <ravi@ximian.com>
8712 * expression.cs: Fix bug #47234. We basically need to apply the
8713 rule that we prefer the conversion of null to a reference type
8714 when faced with a conversion to 'object' (csc behaviour).
8716 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8718 * statement.cs: Shorter form for foreach, eliminates
8719 a local variable. r=Martin.
8721 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8723 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8724 checks if we can use brtrue/brfalse to test for 0.
8725 * expression.cs: use the above in the test for using brtrue/brfalse.
8728 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8730 * expression.cs: Rewrite string concat stuff. Benefits:
8732 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8733 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8734 rather than a concat chain.
8736 * typemanager.cs: Add lookups for more concat overloads.
8738 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8740 * expression.cs: Emit shorter il code for array init.
8757 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
8759 * statement.cs: Before, two switch blocks would be merged if the
8760 total size of the blocks (end_item - begin_item + 1) was less than
8761 two times the combined sizes of the blocks.
8763 Now, it will only merge if after the merge at least half of the
8768 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
8770 * class.cs : csc build fix for GetMethods(). See bug #52503.
8772 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
8774 * expression.cs: Make sure fp comparisons work with NaN.
8775 This fixes bug #54303. Mig approved this patch a long
8776 time ago, but we were not able to test b/c the runtime
8779 2004-03-19 Miguel de Icaza <miguel@ximian.com>
8781 * ecore.cs (TypExpr.GetHashCode): implement this overload.
8783 2004-03-19 Martin Baulig <martin@ximian.com>
8785 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
8786 two overloads may unify for some type parameter substitutions and
8787 report a CS0408 if appropriate.
8789 2004-03-19 Martin Baulig <martin@ximian.com>
8791 * class.cs (MemberCore.IsDuplicateImplementation): Report the
8792 error here and not in our caller.
8794 2004-03-19 Martin Baulig <martin@ximian.com>
8796 * interface.cs: Completely killed this file.
8797 (Interface): We're now a TypeContainer and live in class.cs.
8799 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8800 argument; we're now also called for interfaces.
8801 (TypeContainer.DefineMembers): Allow this method being called
8803 (TypeContainer.GetMethods): New public method; formerly known as
8804 Interface.GetMethod(). This is used by PendingImplementation.
8805 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8806 it's now private and non-static.
8807 (Interface): Moved this here; it's now implemented similar to
8809 (Method, Property, Event, Indexer): Added `bool is_interface'
8810 argument to their .ctor's.
8811 (MemberBase.IsInterface): New public field.
8813 * cs-parser.jay: Create normal Method, Property, Event, Indexer
8814 instances instead of InterfaceMethod, InterfaceProperty, etc.
8815 (opt_interface_base): Removed; we now use `opt_class_base' instead.
8816 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8818 2004-03-19 Martin Baulig <martin@ximian.com>
8820 * class.cs (MethodCore.IsDuplicateImplementation): New private
8821 method which does the CS0111 checking.
8822 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8823 Use IsDuplicateImplementation().
8825 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
8827 * decl.cs (FindMemberToOverride): New method to find the correct
8828 method or property to override in the base class.
8830 - Make Method/Property use the above method to find the
8831 version in the base class.
8832 - Remove the InheritableMemberSignatureCompare as it is now
8835 This patch makes large code bases much faster to compile, as it is
8836 O(n) rather than O(n^2) to do this validation.
8838 Also, it fixes bug 52458 which is that nested classes are not
8839 taken into account when finding the base class member.
8841 Reviewed/Approved by Martin.
8843 2004-03-17 Martin Baulig <martin@ximian.com>
8845 * expression.cs (MemberAccess.DoResolve): Take the parent's number
8846 of type arguments into account; use the `real_num_type_args'
8847 approach like in DoResolveAsTypeStep().
8849 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
8852 2004-03-17 Marek Safar <marek.safar@seznam.cz>
8854 * interface.cs: In all interface classes removed redundant
8855 member initialization.
8857 2004-03-16 Martin Baulig <martin@ximian.com>
8859 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8861 2004-03-15 Miguel de Icaza <miguel@ximian.com>
8863 * decl.cs (DefineTypeAndParents): New helper method to define a
8864 type's containers before the type itself is defined; This is a
8865 bug exposed by the recent changes to Windows.Forms when an
8866 implemented interface was defined inside a class that had not been
8869 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8871 (Check): Loop correctly to report errors modifiers
8872 (UNSAFE was not in the loop, since it was the same as TOP).
8874 * interface.cs: Every interface member now takes a ModFlags,
8875 instead of a "is_new" bool, which we set on the base MemberCore.
8877 Every place where we called "UnsafeOk" in the interface, now we
8878 call the proper member (InterfaceMethod.UnsafeOK) instead to get
8879 the unsafe settings from the member declaration instead of the
8880 container interface.
8882 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
8884 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8885 `set_indexer_name' to the pending bits (one per type).
8887 We fixed a bug today that was picking the wrong method to
8888 override, since for properties the existing InterfaceMethod code
8889 basically ignored the method name. Now we make sure that the
8890 method name is one of the valid indexer names.
8892 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
8894 * support.cs (SeekableStreamReader): Keep track of stream byte
8895 positions and don't mix them with character offsets to the buffer.
8897 Patch from Gustavo Giráldez
8899 2004-03-15 Marek Safar <marek.safar@seznam.cz>
8901 * interface.cs (InterfaceSetGetBase): Removed double member
8902 initialization, base class does it as well.
8904 2004-03-13 Martin Baulig <martin@ximian.com>
8906 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8907 when compiling corlib.
8909 2004-03-13 Miguel de Icaza <miguel@ximian.com>
8911 * convert.cs (ExplicitConversion): We were reporting an error on
8912 certain conversions (object_type source to a value type, when the
8913 expression was `null') before we had a chance to pass it through
8914 the user defined conversions.
8916 * driver.cs: Replace / and \ in resource specifications to dots.
8919 * class.cs: Add check for duplicate operators. Fixes 52477
8921 2004-03-11 Miguel de Icaza <miguel@ximian.com>
8923 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8924 that are in the middle of the statements, not only at the end.
8927 * class.cs (TypeContainer.AddField): No longer set the
8928 `HaveStaticConstructor' flag, now we call it
8929 `UserDefineStaticConstructor' to diferentiate the slightly
8930 semantic difference.
8932 The situation is that we were not adding BeforeFieldInit (from
8933 Modifiers.TypeAttr) to classes that could have it.
8934 BeforeFieldInit should be set to classes that have no static
8939 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8941 And most importantly Zoltan's comment:
8943 http://bugzilla.ximian.com/show_bug.cgi?id=44229
8945 "I think beforefieldinit means 'it's ok to initialize the type sometime
8946 before its static fields are used', i.e. initialization does not need
8947 to be triggered by the first access to the type. Setting this flag
8948 helps the JIT to compile better code, since it can run the static
8949 constructor at JIT time, and does not need to generate code to call it
8950 (possibly lots of times) at runtime. Unfortunately, mcs does not set
8951 this flag for lots of classes like String.
8953 csc sets this flag if the type does not have an explicit static
8954 constructor. The reasoning seems to be that if there are only static
8955 initalizers for a type, and no static constructor, then the programmer
8956 does not care when this initialization happens, so beforefieldinit
8959 This bug prevents the AOT compiler from being usable, since it
8960 generates so many calls to mono_runtime_class_init that the AOT code
8961 is much slower than the JITted code. The JITted code is faster,
8962 because it does not generate these calls if the vtable is type is
8963 already initialized, which is true in the majority of cases. But the
8964 AOT compiler can't do this."
8966 2004-03-10 Miguel de Icaza <miguel@ximian.com>
8968 * class.cs (MethodData.Emit): Refactor the code so symbolic
8969 information is generated for destructors; For some reasons we
8970 were taking a code path that did not generate symbolic information
8973 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
8975 * class.cs: Create a Constructor.CheckBase method that
8976 takes care of all validation type code. The method
8977 contains some code that was moved from Define.
8979 It also includes new code that checks for duplicate ctors.
8980 This fixes bug #55148.
8982 2004-03-09 Joshua Tauberer <tauberer@for.net>
8984 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8985 a { ... }-style array creation invokes EmitStaticInitializers
8986 which is not good for reference-type arrays. String, decimal
8987 and now null constants (NullCast) are not counted toward
8988 static initializers.
8990 2004-03-05 Martin Baulig <martin@ximian.com>
8992 * location.cs (SourceFile.HasLineDirective): New public field;
8993 specifies whether the file contains or is referenced by a "#line"
8995 (Location.DefineSymbolDocuments): Ignore source files which
8996 either contain or are referenced by a "#line" directive.
8998 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
9000 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9001 direct access to our parent, so check the method inline there.
9003 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
9005 * expression.cs (Invocation.EmitCall): Miguel's last commit
9006 caused a regression. If you had:
9011 In Foo the implict this would be null.
9013 2004-02-27 Miguel de Icaza <miguel@ximian.com>
9015 * expression.cs (Invocation.EmitCall): If the method is not
9016 virtual, do not emit a CallVirt to it, use Call.
9018 * typemanager.cs (GetFullNameSignature): Improve the method to
9019 cope with ".ctor" and replace it with the type name.
9021 * class.cs (ConstructorInitializer.Resolve): Now the method takes
9022 as an argument the ConstructorBuilder where it is being defined,
9023 to catch the recursive constructor invocations.
9025 2004-03-16 Martin Baulig <martin@ximian.com>
9027 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
9028 ConstructedType, call ResolveType() on it to get the type rather
9029 than just using `expr.Type'.
9031 2004-03-16 Martin Baulig <martin@ximian.com>
9033 * generics.cs (ConstructedType.GetMemberAccess): Take the
9034 EmitContext instead on the TypeExpr and use
9035 ec.TypeContainer.CurrentType/ec.ContainerType.
9037 2004-03-16 Martin Baulig <martin@ximian.com>
9039 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
9040 parameters before aliases.
9042 2004-03-16 Martin Baulig <martin@ximian.com>
9044 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
9045 New oublic function; checks whether two generic instances may become
9046 equal under some instantiations (26.3.1).
9048 * class.cs (TypeContainer.Define): Call
9049 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
9052 2004-03-16 Martin Baulig <martin@ximian.com>
9054 * class.cs (TypeContainer.GetClassBases): Moved
9055 Error_TypeParameterAsBase() here and also check whether the base
9056 class is not an attribute.
9058 2004-03-16 Martin Baulig <martin@ximian.com>
9060 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9062 2004-03-16 Martin Baulig <martin@ximian.com>
9064 * class.cs (Error_TypeParameterAsBase): Use correct error number
9067 2004-03-16 Martin Baulig <martin@ximian.com>
9069 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
9072 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
9075 2004-03-15 Martin Baulig <martin@ximian.com>
9077 * typemanager.cs (TypeManager.GetFullName): New public method.
9078 (TypeManager.MemberLookup): Added `int_num_type_arguments'
9079 argument; only return members with the correct number of type
9081 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
9082 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
9083 whether the number of type arguments matches.
9085 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
9086 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
9088 * expression.cs (MemberAccess): Added public `NumTypeArguments'
9089 field; it's set by the protected .ctor when we're actually a
9090 GenericMemberAccess.
9091 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
9092 arguments and pass it to MemberLookupFinal ().
9094 * ecore.cs (Expression.MemberLookup): Added `int
9095 num_type_arguments' argument; only return members with the correct
9096 number of type arguments.
9097 (Expression.MemberLookupFailed): Check whether the MemberLookup
9098 failed because we did not have the correct number of type
9099 arguments; report CS0305 in this case.
9101 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
9102 `e.ResolveAsTypeTerminal()' already did so.
9104 2004-03-15 Martin Baulig <martin@ximian.com>
9106 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
9107 we're a ConstructedType; in this case, the caller must report an
9108 error (for instance CS0131).
9110 * generic.cs (TypeArguments): Added Location argument to the .ctor.
9111 (TypeArguments.Resolve): Actually report errors here.
9113 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9115 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9116 `set_indexer_name' to the pending bits (one per type).
9118 We fixed a bug today that was picking the wrong method to
9119 override, since for properties the existing InterfaceMethod code
9120 basically ignored the method name. Now we make sure that the
9121 method name is one of the valid indexer names.
9123 2004-03-15 Martin Baulig <martin@ximian.com>
9125 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
9126 for generic instances.
9128 2004-03-13 Martin Baulig <martin@ximian.com>
9130 * class.cs (TypeContainer.DefineType): Call
9131 TypeManager.AddUserType() immediately after creating the
9132 TypeBuilder; pass all type parameters when creating the
9135 * decl.cs (DeclSpace.FindNestedType): New public method.
9136 (DeclSpace.FindType): Added `int num_type_args' argument; only
9137 return types with the correct number of type parameters.
9138 (DeclSpace.CountTypeParams): New public property.
9140 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
9141 the number of type parameters; defaults to zero.
9143 * generic.cs (TypeArguments.Count): New public property.
9144 (ConstructedType.DoResolveAsTypeStep): First call
9145 ds.FindNestedType() to find out whether we're nested in the
9146 current generic type; in this case, we inherit all type parameters
9147 from the current class.
9149 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
9150 num_type_args' argument.
9151 (RootContext.LookupType): Added overloaded version which takes the
9152 number of type arguments; only return types with the correct
9153 number of type arguments.
9155 * typemanager.cs (TypeManager.CheckGeneric): New public function;
9156 checks whether `Type t' has `int num_type_args'.
9158 2004-03-13 Martin Baulig <martin@ximian.com>
9160 * generic.cs (GenericMethod.DefineType): New method; calls
9161 DefineType() on all the type parameters.
9163 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
9164 (MethodData.Define): If we're a generic method, call
9165 GenericMethod.DefineType() to define the type parameters.
9167 2004-03-10 Martin Baulig <martin@ximian.com>
9169 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
9170 instead of IsAssignableFrom.
9172 2004-03-10 Martin Baulig <martin@ximian.com>
9174 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
9176 * support.cs (ParameterData.HasArrayParameter): New property.
9177 (ReflectionParameters.ctor): Take a MethodBase instead of a
9178 ParameterInfo[]. If we have any type parameters, get the generic
9179 method definition and ask it whether we have variable arguments.
9181 2004-02-26 Miguel de Icaza <miguel@ximian.com>
9183 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9184 routines to check if a type is an enumerable/enumerator allow
9185 classes that implement the IEnumerable or IEnumerator interfaces.
9187 * class.cs (Property, Operator): Implement IIteratorContainer, and
9188 implement SetYields.
9190 (Property.Define): Do the block swapping for get_methods in the
9191 context of iterators. We need to check if Properties also
9192 include indexers or not.
9194 (Operator): Assign the Block before invoking the
9195 OperatorMethod.Define, so we can trigger the Iterator code
9198 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
9199 Property and Operator classes are not created when we parse the
9200 declarator but until we have the block completed, so we use a
9201 singleton SimpleIteratorContainer.Simple to flag whether the
9202 SetYields has been invoked.
9204 We propagate this setting then to the Property or the Operator to
9205 allow the `yield' to function.
9207 2004-02-25 Marek Safar <marek.safar@seznam.cz>
9209 * codegen.cs: Implemented attribute support for modules.
9210 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9211 Assembly/Module functionality.
9213 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9214 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9215 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9217 2004-02-16 Marek Safar <marek.safar@seznam.cz>
9219 * interface.cs (FindMembers): The operation is performed on all base
9220 interfaces and not only on the first. It is required for future CLS Compliance patch.
9222 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
9224 * statement.cs, codegen.cs:
9225 This patch deals with patterns such as:
9227 public class List : IEnumerable {
9229 public MyEnumerator GetEnumerator () {
9230 return new MyEnumerator(this);
9233 IEnumerator IEnumerable.GetEnumerator () {
9237 public struct MyEnumerator : IEnumerator {
9242 Before, there were a few things we did wrong:
9243 1) we would emit callvirt on a struct, which is illegal
9244 2) we emited ldarg when we needed to emit ldarga
9245 3) we would mistakenly call the interface methods on an enumerator
9246 type that derived from IEnumerator and was in another assembly. For example:
9248 public class MyEnumerator : IEnumerator
9250 Would have the interface methods called, even if there were public impls of the
9251 method. In a struct, this lead to invalid IL code.
9253 2004-02-11 Marek Safar <marek.safar@seznam.cz>
9255 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9258 * delegate.cs (Define): Fixed crash when delegate type is undefined.
9260 2004-02-11 Miguel de Icaza <miguel@ximian.com>
9262 * cs-parser.jay: Fix small regression: we were not testing V2
9263 compiler features correctly.
9265 * interface.cs: If the emit context is null, then create one
9267 2004-02-09 Marek Safar <marek.safar@seznam.cz>
9269 * decl.cs (GetSignatureForError): New virtual method to get full name
9272 * attribute.cs (IAttributeSupport): New interface for attribute setting.
9273 Now it is possible to rewrite ApplyAttributes method to be less if/else.
9275 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9276 Duplicated members and code in these classes has been removed.
9277 Better encapsulation in these classes.
9279 2004-02-07 Miguel de Icaza <miguel@ximian.com>
9281 * assign.cs (Assign.DoResolve): When dealing with compound
9282 assignments, there is a new rule in ECMA C# 2.4 (might have been
9283 there before, but it is documented here) that states that in:
9287 If b is of type int, and the `op' is a shift-operator, then the
9288 above is evaluated as:
9292 * expression.cs (Binary.ResolveOperator): Instead of testing for
9293 int/uint/long/ulong, try to implicitly convert to any of those
9294 types and use that in pointer arithmetic.
9296 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9297 method to print information for from the type, not from the
9298 null-method we were given.
9300 2004-02-01 Duncan Mak <duncan@ximian.com>
9302 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9303 parsing for cmd, fixes bug #53694.
9305 2004-02-04 Marek Safar <marek.safar@seznam.cz>
9307 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9308 in the member name duplication tests. Property and operator name duplication
9309 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9311 2004-02-03 Marek Safar <marek.safar@seznam.cz>
9313 * interface.cs (PopulateMethod): Fixed crash when interface method
9314 returns not existing type (error test cs0246-3.cs).
9316 2004-02-02 Ravi Pratap M <ravi@ximian.com>
9318 * cs-parser.jay (interface_accessors): Re-write actions to also
9319 store attributes attached to get and set methods. Fix spelling
9322 (inteface_property_declaration): Modify accordingly.
9324 (InterfaceAccessorInfo): New helper class to store information to pass
9325 around between rules that use interface_accessors.
9327 * interface.cs (Emit): Apply attributes on the get and set
9328 accessors of properties and indexers too.
9330 * attribute.cs (ApplyAttributes): Modify accordingly to use the
9331 right MethodBuilder when applying attributes to the get and set accessors.
9333 2004-01-31 Miguel de Icaza <miguel@ximian.com>
9335 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9337 2004-01-26 Miguel de Icaza <miguel@ximian.com>
9339 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9341 2004-01-25 Miguel de Icaza <miguel@ximian.com>
9343 * cs-parser.jay: Remove YIELD token, instead use the new grammar
9344 changes that treat `yield' specially when present before `break'
9347 * cs-tokenizer.cs: yield is no longer a keyword.
9349 2004-01-23 Marek Safar <marek.safar@seznam.cz>
9351 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9352 setting for default constructors.
9353 For default constructors are almost every time set wrong Modifier. The
9354 generated IL code has been alright. But inside mcs this values was
9355 wrong and this was reason why several of my CLS Compliance tests
9358 2004-02-27 Martin Baulig <martin@ximian.com>
9360 * generics.cs (ConstructedType.ResolveType): Make the nested type
9361 stuff actually work.
9363 2004-02-25 Martin Baulig <martin@ximian.com>
9365 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
9366 property; returns the type parameters just from the current type,
9367 ie. with the ones from outer classes.
9368 (DeclSpace.LookupGeneric): First search in the current class, then
9370 (DeclSpace.initialize_type_params): When hiding a type parameter
9371 from an outer class, put it into the `type_param_list' anyways.
9373 * expression.cs (MemberAccess.expr): Made this field protected.
9375 * class.cs (TypeContainer.Define): The `CurrentType' just contains
9376 the type parameters from the current class.
9378 * generic.cs (ConstructedType.ResolveType): Support nested generic
9379 types by taking the type parameters which we inherit from outer
9380 classes into account.
9381 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
9382 support for nested generic types.
9384 2004-02-23 Martin Baulig <martin@ximian.com>
9386 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
9387 field and check whether we're nested inside a generic type.
9388 (DeclSpace.ResolveType): If we're resolving to a generic type
9389 definition, create a ConstructedType and return its resolved type.
9390 (DeclSpace.initialize_type_params): New private method;
9391 initializes the `type_param_list' field from the type parameters
9392 from this and all enclosing classes.
9393 (DeclSpace.TypeParameters): Call initialize_type_params() unless
9394 we're already initialized.
9396 2004-02-23 Martin Baulig <martin@ximian.com>
9398 * class.cs (Method.Define): Create the generic method before
9400 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
9401 the TypeContainer one); we use this for generic methods.
9403 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
9404 parent's TypeBuilder.
9406 2004-02-18 Martin Baulig <martin@ximian.com>
9408 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
9409 to check for equality.
9411 2004-02-05 Martin Baulig <martin@ximian.com>
9413 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
9414 `ec.TypeContainer.CurrentType', use it instead of
9415 `ec.ContainerType' to check whether we're in the type's ctor.
9417 2004-01-29 Martin Baulig <martin@ximian.com>
9419 * expression.cs (Invocation.DoResolve): If we're a
9420 `ConstructedType', then we're actually a generic method, so
9421 rewrite the expr as a GenericMemberAccess.
9423 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
9424 here; manually parse it into a string.
9426 2004-01-28 Martin Baulig <martin@ximian.com>
9428 * typemanager.cs (TypeManager.IsEqual): New static method.
9429 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
9430 check for equality instead of using `=='.
9432 2004-01-26 Martin Baulig <martin@ximian.com>
9434 * decl.cs (DeclSpace.CurrentType): New public field.
9436 * expression.cs (This.ResolveBase): If we have an
9437 `ec.TypeContainer.CurrentType', use it instead of
9440 * class.cs (TypeContainer.DefineType): If we're a generic type,
9441 create the `CurrentType' (unresolved).
9442 (TypeContainer.GenericType): New private field.
9443 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
9444 it and store it in `GenericType' before creating the MemberCache.
9445 (TypeContainer.GetMembers): If we have a `GenericType', call
9446 TypeManager.FindMembers() on it.
9448 * interface.cs (Interface.GenericType): New private field.
9449 (Interface.DefineType): If we're a generic type, create the
9450 `CurrentType' (unresolved).
9451 (Interface.DefineMembers): If we have a `CurrentType', resolve it
9452 and store it in `GenericType' before creating the MemberCache.
9453 (Interface.GetMembers): If we have a `GenericType', call
9454 TypeManager.FindMembers() on it.
9456 2004-01-22 Martin Baulig <martin@ximian.com>
9458 * cs-parser.jay (namespace_or_type_name): Return an Expression,
9459 not a QualifiedIdentifier. This is what `type_name_expression'
9460 was previously doing.
9461 (type_name_expression): Removed; the code is now in
9462 `namespace_or_type_name'.
9463 (qualified_identifier): Removed, use `namespace_or_type_name'
9465 (QualifiedIdentifier): Removed this class.
9467 2004-01-22 Martin Baulig <martin@ximian.com>
9469 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9470 not a string as alias name.
9472 2004-01-21 Miguel de Icaza <miguel@ximian.com>
9474 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9475 #52730 bug, and instead compute correctly the need to use a
9476 temporary variable when requesting an address based on the
9477 static/instace modified of the field and the constructor.
9479 2004-01-21 Martin Baulig <martin@ximian.com>
9481 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9482 class and namespace before looking up aliases. Fixes #52517.
9484 2004-01-21 Martin Baulig <martin@ximian.com>
9486 * flowanalysis.cs (UsageVector.Merge): Allow variables being
9487 assinged in a 'try'; fixes exception4.cs.
9489 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9490 * class.cs : Implemented parameter-less constructor for TypeContainer
9492 * decl.cs: Attributes are now stored here. New property OptAttributes
9494 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9496 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9498 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9500 * typemanager.cs (CSharpSignature): Now reports also inner class name.
9501 (CSharpSignature): New method for indexer and property signature.
9503 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9505 * pending.cs (IsVirtualFilter): Faster implementation.
9507 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9509 * typemanager.cs: Avoid inclusion of same assembly more than once.
9511 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9513 * cs-parser.jay: Fixed problem where the last assembly attribute
9514 has been applied also to following declaration (class, struct, etc.)
9516 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9518 * class.cs: Added error CS0538, CS0539 reporting.
9519 Fixed crash on Microsoft runtime when field type is void.
9521 * cs-parser.jay: Added error CS0537 reporting.
9523 * pending.cs: Added error CS0535 reporting.
9524 Improved error report for errors CS0536, CS0534.
9526 2004-01-20 Miguel de Icaza <miguel@ximian.com>
9528 Merge a few bits from the Anonymous Method MCS tree.
9530 * statement.cs (ToplevelBlock): New class for toplevel methods,
9531 will hold anonymous methods, lifted variables.
9533 * cs-parser.jay: Create toplevel blocks for delegates and for
9534 regular blocks of code.
9536 2004-01-20 Martin Baulig <martin@ximian.com>
9538 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9539 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9540 and `NeedExplicitReturn'; added `IsLastStatement'.
9541 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9542 have a `ReturnLabel' or we're not unreachable.
9544 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9545 child's reachability; don't just override ours with it. Fixes
9546 #58058 (lluis's example).
9547 (FlowBranching): Added public InTryOrCatch(), InCatch(),
9548 InFinally(), InLoop(), InSwitch() and
9549 BreakCrossesTryCatchBoundary() methods.
9551 * statement.cs (Return): Do all error checking in Resolve().
9552 Unless we are the last statement in a top-level block, always
9553 create a return label and jump to it.
9554 (Break, Continue): Do all error checking in Resolve(); also make
9555 sure we aren't leaving a `finally'.
9556 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9557 statement in a top-level block.
9558 (Block.Flags): Added `IsDestructor'.
9559 (Block.IsDestructor): New public property.
9561 2004-01-20 Martin Baulig <martin@ximian.com>
9563 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9565 2004-01-20 Martin Baulig <martin@ximian.com>
9567 * statement.cs (Statement.ResolveUnreachable): New public method.
9568 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9569 (Block.Resolve): Resolve unreachable statements.
9571 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9573 * expression.cs: We need to fix the case where we do
9574 not have a temp variable here.
9576 * assign.cs: Only expression compound assignments need
9577 temporary variables.
9579 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9581 * flowanalysis.cs: Reduce memory allocation in a few ways:
9582 - A block with no variables should not allocate a bit
9584 - A method with no out parameters does not need any tracking
9585 for assignment of the parameters, so we need not allocate
9588 public readonly Type[] VariableTypes;
9589 public readonly string[] VariableNames;
9590 Are redundant. The data is already stored in the variable
9591 map, so we need not allocate another array for it.
9592 - We need to add alot of checks for if (params | locals) == null
9593 due to the first two changes.
9595 2004-01-18 Miguel de Icaza <miguel@ximian.com>
9597 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9598 implement IMemoryLocation, we store a copy on a local variable and
9599 take the address of it. Patch from Benjamin Jemlich
9601 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9602 to use a special "type_name_expression" rule which reduces the
9603 number of "QualifiedIdentifier" classes created, and instead
9604 directly creates MemberAccess expressions.
9606 2004-01-17 Miguel de Icaza <miguel@ximian.com>
9608 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9609 that fixes #52853. Null literal assignment to ValueType
9611 * class.cs (MethodData.Emit): Instead of checking the name of the
9612 method to determine if its a destructor, create a new derived
9613 class from Method called Destructor, and test for that.
9615 * cs-parser.jay: Create a Destructor object instead of a Method.
9617 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9621 2004-01-16 Miguel de Icaza <miguel@ximian.com>
9623 * expression.cs (Binary.ResolveOperator): Perform an implicit
9624 conversion from MethodGroups to their delegate types on the
9627 * delegate.cs: Introduce a new class DelegateCreation that is the
9628 base class for `NewDelegate' and `ImplicitDelegateCreation',
9629 factor some code in here.
9631 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9632 conversion from MethodGroups to compatible delegate types.
9634 * ecore.cs (Expression.Resolve): Do not flag error 654
9635 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9636 we allow conversions from MethodGroups to delegate types now.
9638 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9639 assignments in v2 either.
9641 2004-01-10 Miguel de Icaza <miguel@ximian.com>
9643 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9644 static read-only fields in ctors.
9646 Applied patch from Benjamin Jemlich
9648 * expression.cs (UnaryMutator): Avoid leaking local variables.
9650 2004-01-09 Miguel de Icaza <miguel@ximian.com>
9652 * cs-tokenizer.cs (IsCastToken): Allow the various native types
9653 here to return true, as they can be used like this:
9657 Fixed 49836 and all the other dups
9659 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
9661 * driver.cs: Implement /win32res and /win32icon.
9663 2004-01-08 Miguel de Icaza <miguel@ximian.com>
9665 * cs-parser.jay: Add a rule to improve error handling for the
9666 common mistake of placing modifiers after the type.
9668 2004-01-07 Miguel de Icaza <miguel@ximian.com>
9670 * cs-parser.jay (interface_event_declaration): Catch
9671 initialization of events on interfaces, and report cs0068
9673 * cs-parser.jay (interface_event_declaration): Catch
9674 initialization of events.
9676 * ecore.cs: Better report missing constructors.
9678 * expression.cs (Binary.ResolveOperator): My previous bug fix had
9679 the error reporting done in the wrong place. Fix.
9681 * expression.cs (Binary.ResolveOperator): Catch the
9682 operator + (E x, E y) error earlier, and later allow for implicit
9683 conversions in operator +/- (E e, U x) from U to the underlying
9686 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9687 52596, if the container class is abstract, the default constructor
9688 is protected otherwise its public (before, we were always public).
9690 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9693 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9694 Jemlich that fixes bug #52597, MCS was generating invalid code for
9695 idisposable structs. Thanks to Ben for following up with this
9698 2004-01-06 Miguel de Icaza <miguel@ximian.com>
9700 * driver.cs: Allow assemblies without code to be generated, fixes
9703 2004-01-07 Nick Drochak <ndrochak@gol.com>
9705 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9707 2004-01-05 Miguel de Icaza <miguel@ximian.com>
9709 * cs-parser.jay: Add rules to improve error reporting if fields or
9710 methods are declared at the namespace level (error 116)
9712 * Add rules to catch event add/remove
9714 2004-01-04 David Sheldon <dave-mono@earth.li>
9716 * expression.cs: Added matching ")" to error message for
9719 2004-01-03 Todd Berman <tberman@gentoo.org>
9721 * ecore.cs, attribute.cs:
9722 Applying fix from #52429.
9724 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9726 * ecore.cs, expression.cs, statement.cs:
9727 Total rewrite of how we handle branching. We
9728 now handle complex boolean expressions with fewer
9729 jumps. As well if (x == 0) no longer emits a ceq.
9731 if (x is Foo) is much faster now, because we generate
9734 Overall, we get a pretty big improvement on our benchmark
9735 tests. The code we generate is smaller and more readable.
9737 I did a full two-stage bootstrap. The patch was reviewed
9738 by Martin and Miguel.
9740 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9742 * cs-parser.jay: Make primary_expression not take a QI.
9743 we dont need this because the member_access rule covers
9744 us here. So we replace the rule with just IDENTIFIER.
9746 This has two good effects. First, we remove a s/r conflict.
9747 Second, we allocate many fewer QualifiedIdentifier objects.
9749 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9751 * attribute.cs: Handle MarshalAs attributes as pseudo, and
9752 set the correct information via SRE. This prevents
9753 hanging on the MS runtime. Fixes #29374.
9755 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9757 * convert.cs: correctly handle conversions to value types
9758 from Enum and ValueType as unboxing conversions.
9760 Fixes bug #52569. Patch by Benjamin Jemlich.
9762 2004-01-02 Ravi Pratap <ravi@ximian.com>
9764 * expression.cs (BetterConversion): Prefer int -> uint
9765 over int -> ulong (csc's behaviour). This fixed bug #52046.
9767 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
9769 * decl.cs (MemberCache.FindMembers): now returns a
9772 * typemanager.cs: In general, go with with ^^.
9773 (CopyNewMethods): take an IList.
9774 (RealMemberLookup): Only allocate an arraylist
9775 if we copy from two sets of methods.
9777 This change basically does two things:
9778 1) Fewer array lists allocated due to CopyNewMethods.
9779 2) the explicit cast in MemberList costed ALOT.
9781 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
9783 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9784 a hashtable to avoid needless string allocations when an identifier is
9785 used more than once (the common case).
9787 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
9789 * pending.cs: MS's TypeBuilder.GetInterfaces ()
9790 is broken, it will not return anything. So, we
9791 have to use the information we have in mcs to
9794 * typemanager.cs: Add a cache for GetInterfaces,
9795 since this will now be used more often (due to ^^)
9797 (GetExplicitInterfaces) New method that gets the
9798 declared, not effective, interfaces on a type
9799 builder (eg, if you have interface IFoo, interface
9800 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9803 This patch makes MCS able to bootstrap itself on
9806 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
9808 * expression.cs: Remove the Nop's that Miguel put
9811 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9813 * report.cs, codegen.cs: Give the real stack trace to
9814 the error when an exception is thrown.
9816 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9818 * decl.cs: only allocate hashtables for ifaces if
9821 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9823 * expression.cs: fix the error from cs0121-2.cs
9824 (a parent interface has two child interfaces that
9825 have a function with the same name and 0 params
9826 and the function is called through the parent).
9828 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
9830 * class.cs, rootcontext.cs, typmanager.cs: do not
9833 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
9835 * codegen.cs: remove stack for the ec flow branching.
9836 It is already a linked list, so no need.
9838 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
9840 * Makefile: Allow custom profiler here.
9842 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
9844 * typemanager.cs (LookupType):
9845 - Use a static char [], because split takes
9846 a param array for args, so it was allocating
9848 - Do not store true in a hashtable, it boxes.
9850 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
9852 * flowanalysis.cs: bytify common enums.
9854 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9856 * modifiers.cs: Add a new set of flags for the
9857 flags allowed on explicit interface impls.
9858 * cs-parser.jay: catch the use of modifiers in
9859 interfaces correctly.
9860 * class.cs: catch private void IFoo.Blah ().
9862 All related to bug #50572.
9864 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9866 * decl.cs: Rewrite the consistant accessability checking.
9867 Accessability is not linear, it must be implemented in
9868 a tableish way. Fixes #49704.
9870 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9872 * expression.cs: Handle negation in a checked context.
9873 We must use subtraction from zero. Fixes #38674.
9875 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
9877 * class.cs: Ignore static void main in DLLs.
9878 * rootcontext.cs: Handle the target type here,
9879 since we are have to access it from class.cs
9880 * driver.cs: account for the above.
9882 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
9884 * report.cs: Give line numbers and files if available.
9886 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
9888 * driver.cs: Implement /addmodule.
9890 * typemanager.cs: Change 'modules' field so it now contains Modules not
9893 2003-12-20 Martin Baulig <martin@ximian.com>
9895 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9896 (FieldBase.IsAssigned): Removed this field.
9897 (FieldBase.SetAssigned): New public method.
9898 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9900 2003-12-20 Martin Baulig <martin@ximian.com>
9902 * expression.cs (LocalVariableReference.DoResolve): Don't set
9903 `vi.Used' if we're called from DoResolveLValue().
9905 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9906 returns the usage vector it just merged into the current one -
9907 pass this one to UsageWarning().
9908 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9909 of the `EmitContext', don't call this recursively on our children.
9911 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
9913 * driver.cs: Implement /target:module.
9915 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
9917 * support.cs (CharArrayHashtable): New helper class.
9919 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
9920 char arrays, not strings, so we can avoid creating a string in
9921 consume_identifier if the identifier is a keyword.
9923 2003-12-16 Martin Baulig <martin@ximian.com>
9925 * statement.cs (LocalInfo.Assigned): Removed this property.
9926 (LocalInfo.Flags): Removed `Assigned'.
9927 (LocalInfo.IsAssigned): New public method; takes the EmitContext
9928 and uses flow analysis.
9929 (Block.UsageWarning): Made this method private.
9930 (Block.Resolve): Call UsageWarning() if appropriate.
9932 * expression.cs (LocalVariableReference.DoResolve): Always set
9933 LocalInfo.Used here.
9935 2003-12-13 Martin Baulig <martin@ximian.com>
9937 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9938 any value here; we're now using flow analysis to figure out
9939 whether a statement/block returns a value.
9941 2003-12-13 Martin Baulig <martin@ximian.com>
9943 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9945 (FlowBranching.MergeFinally): Don't call
9946 `branching.CheckOutParameters()' here, this is called in
9948 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9949 when adding the `finally' vector.
9951 2003-12-13 Martin Baulig <martin@ximian.com>
9954 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9955 actually work and also fix #48962.
9957 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
9959 * decl.cs: Do not check System.Object for nested types,
9960 since we know it does not have any. Big bang for buck:
9965 corlib: 17.99 seconds
9969 corlib: 17.39 seconds
9971 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
9973 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9974 time we are returning 0 members, so we save alot here.
9976 2003-12-11 Martin Baulig <martin@ximian.com>
9978 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9979 `MergeChild()', also just take the `FlowBranching' as argument;
9980 call Merge() on it and return the result.
9981 (FlowBranching.Merge): We don't need to do anything if we just
9984 2003-12-11 Martin Baulig <martin@ximian.com>
9986 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9987 them in an `ArrayList' to reduce memory usage. Thanks to Ben
9988 Maurer for this idea.
9990 2003-12-11 Martin Baulig <martin@ximian.com>
9992 * flowanalysis.cs (MergeResult): This class is now gone; we now
9993 use the `UsageVector' for this. The reason for this is that if a
9994 branching just has one sibling, we don't need to "merge" them at
9995 all - that's the next step to do.
9996 (FlowBranching.Merge): We now return a `UsageVector' instead of a
9999 2003-12-11 Martin Baulig <martin@ximian.com>
10001 Reworked flow analyis and made it more precise and bug-free. The
10002 most important change is that we're now using a special `Reachability'
10003 class instead of having "magic" meanings of `FlowReturns'. I'll
10004 do some more cleanups and optimizations and also add some more
10005 documentation this week.
10007 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10008 largely reworked this class.
10009 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10010 the new `Reachability' class instead of having "magic" values here.
10011 (FlowBranching): We're now using an instance of `Reachability'
10012 instead of having separate `Returns', `Breaks' etc. fields.
10014 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10015 based on flow analysis; ignore the return value of block.Emit ().
10017 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10019 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10020 if they are private.
10022 2003-12-09 Martin Baulig <martin@ximian.com>
10024 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10025 call them directly on the UsageVector.
10027 2003-12-09 Martin Baulig <martin@ximian.com>
10029 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10030 Changed return type from `FlowReturns' to `Reachability'.
10032 2003-12-09 Martin Baulig <martin@ximian.com>
10034 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10035 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10036 `Reachable' fields with a single `Reachability' one.
10038 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10040 * class.cs (FindMembers): Remove foreach's.
10045 Run 1: 8.74 seconds
10046 Run 2: 8.71 seconds
10049 Run 1: 8.64 seconds
10050 Run 2: 8.58 seconds
10053 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10058 This patch does a few things:
10059 1. EmptyStatement is now a singleton, so it is never reallocated.
10060 2. All blah is EmptyStatement constructs have been changed to
10061 blah == EmptyStatement.Value, which is much faster and valid
10062 now that EmptyStatement is a singleton.
10063 3. When resolving a block, rather than allocating a new array for
10064 the non-empty statements, empty statements are replaced with
10065 EmptyStatement.Value
10066 4. Some recursive functions have been made non-recursive.
10067 Mainly the performance impact is from (3), however (1) and (2) are needed for
10068 this to work. (4) does not make a big difference in normal situations, however
10069 it makes the profile look saner.
10074 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10075 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10076 Total memory allocated: 56397 KB
10079 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10080 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10081 Total memory allocated: 55666 KB
10083 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10085 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10086 than the hashtable in a hashtable version
10088 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10089 we always end up concating a string. This results in a huge perf
10090 loss, because many strings have to be tracked by the GC. In this
10091 patch, we first use a hashtable that works with two keys, so that
10092 the strings do not need to be concat'ed.
10096 Run 1: 8.74 seconds
10097 Run 2: 8.71 seconds
10100 Run 1: 8.65 seconds
10101 Run 2: 8.56 seconds
10103 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10105 * Makefile: Add a new target `do-time' that does a quick and simple
10106 profile, leaving easy to parse output.
10108 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
10110 * codegen.cs (Init): Create the dynamic assembly with
10111 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10113 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
10115 * support.cs: Make the PtrHashtable use only one
10116 instance of its comparer.
10118 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
10120 * typemanager.cs: Fix lookup of GetNamespaces.
10122 2003-11-29 Miguel de Icaza <miguel@ximian.com>
10124 * expression.cs: Removed redundant line.
10126 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10127 ArrayLists, use for loops with bounds.
10129 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10132 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10133 arraylists, use for loop with bounds.
10135 The above three changes give us a 0.071 second performance
10136 improvement out of 3.294 seconds down to 3.223. On my machine
10137 the above changes reduced the memory usage by 1,387 KB during
10138 compiler bootstrap.
10140 * cs-parser.jay (QualifiedIdentifier): New class used to represent
10141 QualifiedIdentifiers. Before we created a new string through
10142 concatenation, and mostly later on, the result would be
10143 manipulated by DecomposeQI through string manipulation.
10145 This reduced the compiler memory usage for bootstrapping from
10146 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10147 compile times in 0.05 seconds.
10149 2003-11-28 Dick Porter <dick@ximian.com>
10151 * support.cs: Do string compares with the Invariant culture.
10159 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10160 the comparison is done with the Invariant culture.
10162 2003-11-27 Miguel de Icaza <miguel@ximian.com>
10164 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10165 GetEnumerator method.
10167 (ProbeCollectionType): Iterate starting at the most specific type
10168 upwards looking for a GetEnumerator
10170 * expression.cs: Shift count can be up to 31 for int/uint and 63
10173 2003-11-26 Miguel de Icaza <miguel@ximian.com>
10175 * statement.cs (Block.LookupLabel): Also look for the label on the
10176 children blocks. Use a hash table to keep track of visited
10179 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10180 we actually did transform the other operand, otherwise fall back
10181 to the common codepath that casts to long.
10183 * cs-tokenizer.cs: Use the same code pattern as the int case.
10184 Maybe I should do the parsing myself, and avoid depending on the
10185 Parse routines to get this done.
10187 2003-11-25 Miguel de Icaza <miguel@ximian.com>
10189 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10190 which fixes bug 51347. This time test it.
10192 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10193 attributes for example can not tell the difference between these.
10194 The difference was only a syntax feature of the language.
10196 * attribute.cs: Apply attributes to delegates.
10198 * delegate.cs: Call the apply attributes method.
10200 2003-11-24 Miguel de Icaza <miguel@ximian.com>
10202 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10203 comparing 0 vs Byte.MinValue, not the value
10205 (ImplicitConversionRequired): When reporting a conversion error,
10206 use error 31 to print out the constant error instead of the
10209 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10210 which fixes bug 51347.
10212 2003-11-22 Miguel de Icaza <miguel@ximian.com>
10214 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
10215 which fixes the -warnaserror command line option.
10217 2003-11-21 Miguel de Icaza <miguel@ximian.com>
10219 * cfold.cs (DoNumericPromotions): During constant folding of
10220 additions on UIntConstant, special case intconstants with
10221 IntConstants like we do on the expression binary operator.
10223 2003-11-12 Miguel de Icaza <miguel@ximian.com>
10225 * convert.cs (ImplicitReferenceConversion): We were missing a case
10226 (System.Enum are not value types or class types, so we need to
10227 classify them separatedly).
10229 * driver.cs: We do not support error 2007.
10231 2003-11-12 Jackson Harper <jackson@ximian.com>
10233 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10234 system directory. Also use the full file name so users can
10235 libraries names mscorlib-o-tron.dll in a non system dir.
10237 2004-01-04 David Sheldon <dave-mono@earth.li>
10239 * expression.cs: Added matching ")" to error message for CS0077.
10241 2003-12-19 Martin Baulig <martin@ximian.com>
10243 * typemanager.cs (TypeManager.IsEqualGenericType): New public
10244 static method; see documentation in the method.
10245 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
10247 * convert.cs (Convert.ImplicitReferenceConversion,
10248 Convert.ImplicitReferenceConversionExists): Add support for
10249 generic type declarations; see gen-36.cs.
10251 2003-12-19 Martin Baulig <martin@ximian.com>
10253 * pending.cs (Pending.InterfaceMethod): Use
10254 `Type.IsAssignableFrom()' instead of `=='.
10256 2003-12-18 Martin Baulig <martin@ximian.com>
10258 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
10261 * convert.cs (Convert.ImplicitStandardConversionExists): Use
10262 `expr_type.Equals (target_type)' instead of `=='.
10264 2003-12-08 Martin Baulig <martin@ximian.com>
10266 * generics.cs (Constraints.Types): Removed.
10267 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
10269 (Constraints.ResolveTypes): New public method; resolves the
10270 TypeExpr's to Type's.
10271 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
10272 longer takes the constraints.
10273 (TypeParameter.DefineMethod): Likewise.
10274 (TypeParameter.DefineType): New public method. Calls
10275 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
10278 2003-12-08 Martin Baulig <martin@ximian.com>
10280 * convert.cs (Convert.ImplicitConversionStandard): Use
10281 `expr_type.Equals (target_type)' instead of `=='.
10283 2003-12-08 Martin Baulig <martin@ximian.com>
10285 * typemanager.cs (TypeManager.GetReferenceType): Call
10286 `Type.MakeByRefType ()'.
10288 2003-12-08 Martin Baulig <martin@ximian.com>
10290 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
10291 just has some special meaning in some situations. For instance,
10292 it is allowed to use `where' as the name of a variable etc.
10294 2003-12-04 Martin Baulig <martin@ximian.com>
10296 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10297 `Type.MakeArrayType()' for array types.
10299 2003-11-18 Miguel de Icaza <miguel@ximian.com>
10301 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
10304 (SizeOf.DoResolve): assign the `type_queried' field. This gets
10307 2003-11-16 Martin Baulig <martin@ximian.com>
10309 * codegen.cs (EmitContext.IsGeneric): Removed.
10311 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
10312 ResolveGeneric() on the DeclSpace.
10314 2003-11-16 Martin Baulig <martin@ximian.com>
10316 * generic.cs (TypeArguments.Resolve):
10317 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
10318 `ResolveType()' on it to get the Type.
10320 2003-11-15 Martin Baulig <martin@ximian.com>
10322 * generic.cs (ConstructedType.GetInterfaces): Override this.
10324 2003-11-14 Martin Baulig <martin@ximian.com>
10326 * interface.cs (Interface.DefineType): Define all type parameters
10327 before adding the interfaces we inherit.
10329 2003-11-11 Martin Baulig <martin@ximian.com>
10331 * generic.cs (ConstructedType.ResolveType): Always call
10332 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
10334 2003-11-10 Martin Baulig <martin@ximian.com>
10336 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10337 (TypeManager.InitCoreTypes): Initialize them here, but instead of
10338 calling `ResolveType()' on them, directly assign their `Type'.
10340 2003-11-08 Martin Baulig <martin@ximian.com>
10342 * generic.cs (ConstructedType): Override `IsClass' etc.
10344 2003-11-08 Martin Baulig <martin@ximian.com>
10346 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10347 return value and the `out parent' parameter.
10348 (TypeContainer.DefineType): Moved the CS0644 check into
10349 GetClassBases(). Don't pass the interface types to the
10350 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10351 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10353 * ecore.cs (TypeExpr.IsAttribute): New property.
10354 (TypeExpr.GetInterfaces): New method.
10356 * interface.cs (Interface.GetInterfaceTypeByName): Return a
10357 TypeExpr instead of a Type.
10358 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10359 (Interface.DefineType): Don't pass the interface types to the
10360 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10361 them later and then call `TypeBulider.AddInterfaceImplementation()'.
10363 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10364 instead of a `Type[]'.
10365 (TypeManager.RegisterBuilder): Likewise.
10366 (TypeManager.AddUserInterface): Likewise.
10367 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10368 `Type[]' and also return a `TypeExpr[]'.
10369 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10371 2003-11-08 Martin Baulig <martin@ximian.com>
10373 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10376 2003-11-08 Martin Baulig <martin@ximian.com>
10378 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10379 TypeManager.ResolveExpressionTypes().
10381 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10382 instead of an Expression.
10383 (TypeExpr): This is now an abstract base class for `TypeExpression'.
10384 (TypeExpression): New public class; formerly known as `TypeExpr'.
10386 * expression.cs (ComposedCast): Derive from TypeExpr.
10388 * typemanager.cs (TypeManager.system_*_expr): These are now
10389 TypExpr's instead of Expression's.
10390 (TypeManager.ResolveExpressionTypes): New public static function;
10391 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10394 2003-11-06 Miguel de Icaza <miguel@ximian.com>
10396 * expression.cs (New.DoResolve): Do not dereference value that
10397 might be a null return.
10399 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10400 sure that the constant value has the right type. Fixes an
10401 unreported bug, similar to 50425.
10403 * const.cs (Const.LookupConstantValue): Call
10404 ImplicitStandardConversionExists before doing a conversion to
10405 avoid havng the TypeManager.ChangeType do conversions.
10407 Reduced the number of casts used
10409 (Const.ChangeType): New routine to enable reuse of the constant
10410 type changing code from statement.
10412 * typemanager.cs (ChangeType): Move common initialization to
10413 static global variables.
10417 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10418 every value type to go through, even if it was void. Fix that.
10420 * cs-tokenizer.cs: Use is_identifier_start_character on the start
10421 character of the define, and the is_identifier_part_character for
10422 the rest of the string.
10424 2003-11-05 Miguel de Icaza <miguel@ximian.com>
10426 * expression.cs (UnaryMutator.EmitCode): When I updated
10427 LocalVariableReference.DoResolve, I overdid it, and dropped an
10428 optimization done on local variable references.
10430 2003-11-04 Miguel de Icaza <miguel@ximian.com>
10432 * ecore.cs: Convert the return from Ldlen into an int.
10434 2003-10-20 Miguel de Icaza <miguel@ximian.com>
10436 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10437 the accessibility, this is a special case for toplevel non-public
10438 classes (internal for instance).
10440 2003-10-20 Nick Drochak <ndrochak@gol.com>
10442 * ecore.cs: Fix typo and build. Needed another right paren.
10444 2003-10-19 Miguel de Icaza <miguel@ximian.com>
10446 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
10447 `internal' case regular and protected, but not allowing protected
10448 to be evaluated later. Bug 49840
10450 2003-10-15 Miguel de Icaza <miguel@ximian.com>
10452 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10453 to kb.Nlast, and not the kb.nFirst to isolate the switch
10456 Extract the underlying type, so enumerations of long/ulong are
10457 treated like long/ulong.
10459 2003-10-14 Miguel de Icaza <miguel@ximian.com>
10461 * expression.cs (New): Overload the meaning of RequestedType to
10462 track the possible creation of the NewDelegate type, since
10463 DoResolve is invoked more than once for new constructors on field
10466 See bugs: #48800 and #37014
10468 * cs-parser.jay (declare_local_constants): Take an arraylist
10469 instead of a single constant.
10471 (local_constant_declaration): It should take a
10472 constant_declarators, not a constant_declarator. Fixes 49487
10474 * convert.cs: Fix error report.
10476 2003-10-13 Jackson Harper <jackson@ximian.com>
10478 * typemanager.cs (TypeToCoreType): Add float and double this fixes
10481 2003-11-03 Martin Baulig <martin@ximian.com>
10483 * expression.cs (ArrayAccess.GetStoreOpcode): Added
10484 `out bool has_type_arg'; if set, we need to pass the type to
10486 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
10487 Stelem_Any/Ldelem_Any for generic parameters.
10489 2003-11-02 Martin Baulig <martin@ximian.com>
10491 * expression.cs (Invocation.EmitCall): Use
10492 `TypeManager.IsValueType()' to check whether it's a value type.
10493 Don't set `struct_call' when calling a method on a type parameter.
10495 2003-11-02 Martin Baulig <martin@ximian.com>
10497 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
10498 and removed the TypeBuilder argument.
10500 * typemanager.cs (TypeManager.IsValueType): Return
10501 `t.IsGenericParameter || t.IsValueType'.
10503 2003-10-25 Martin Baulig <martin@ximian.com>
10505 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
10506 call ConstructedType.Resolve() on it.
10508 * generic.cs (ConstructedType.Resolve): Set `type' on success.
10510 2003-10-25 Martin Baulig <martin@ximian.com>
10512 * class.cs (TypeContainer.GetClassBases): Changed
10513 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
10514 CS8214 reporting here.
10515 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
10516 instead of a `Type' for our parent. In case of a recursive
10517 declaration (see tests/gen-23.cs for an example), our parent is a
10518 ConstructedType and it doesn't have its type set. So, first
10519 create our own TypeBuilder, then call constructed.Resolve() to get
10520 the parent's type and finally TypeBuilder.SetParent() it.
10522 * ecore.cs (TypeExpr.Name): New public virtual property.
10525 (ConstructedType): We're now a TypeExpr and not just an Expression.
10526 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
10527 arguments here; this is done later.
10528 (ConstructedType.Resolve): New public method to resolve the type
10529 arguments and bind them.
10531 2003-10-21 Martin Baulig <martin@ximian.com>
10533 * convert.cs: Use `TypeManager.IsValueType' instead of
10534 'type.IsValueType' everywhere.
10536 * typemanager.cs (TypeManager.IsValueType): Return true for type
10537 parameters. The reason for this is that we need to box a type
10538 parameter when converting it to a reference type.
10540 * cs-parser.jay: Added support for default value expressions.
10542 * generics.cs (DefaultValueExpression): New public class.
10544 2003-10-17 Martin Baulig <martin@ximian.com>
10546 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
10547 TypeContainer so we can also use this for Interfaces.
10548 (TypeParameter.Resolve): Likewise.
10550 * interface.cs (Interface.DefineType): Added support for generic
10553 * cs-parser.jay: Added support for generic structs and interfaces.
10555 2003-10-17 Martin Baulig <martin@ximian.com>
10557 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
10558 call generic methods :-)
10560 2003-10-16 Martin Baulig <martin@ximian.com>
10562 * cs-parser.jay (namespace_or_type_name): Only create a
10563 GenericMemberAccess if we actually have type arguments.
10565 2003-10-13 Martin Baulig <martin@ximian.com>
10567 * class.cs (Method.Define): If we're a generic method, call
10568 TypeBuilder.DefineGenericMethod () before resolving
10570 (MethodData): Added .ctor which takes an additional MethodBuilder
10571 argument; this is used for generic methods.
10572 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
10573 we already have a MethodBuilder.
10575 2003-10-10 Martin Baulig <martin@ximian.com>
10577 * class.cs (Method): Added .ctor which takes a `GenericMethod'
10578 instead of a `DeclSpace'. This is used for generic methods.
10580 * cs-parser.jay (method_header): Added support for generic
10581 methods; create a `GenericMethod' instance and pass it to the
10582 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
10583 parameters and locals.
10585 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
10586 since we already have the location. Check whether we're a generic
10587 type declaration or a generic method and create the correct type
10590 * generic.cs (TypeParameter.DefineMethod): New public method.
10591 (GenericMethod): New public class; derives from DeclSpace and is
10592 used for generic methods.
10594 2003-10-09 Martin Baulig <martin@ximian.com>
10596 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10598 (MethodCore.DoDefineParameters): Removed the TypeContainer
10599 argument; use the DeclSpace which was passed to the .ctor instead.
10600 (MethodCore.CheckParameter): Take a DeclSpace instead of a
10601 TypeContainer; we only need a DeclSpace here.
10603 2003-10-09 Martin Baulig <martin@ximian.com>
10605 * class.cs (MethodData): Added additional `DeclSpace ds' argument
10607 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10608 EmitContext's .ctor.
10610 2003-10-09 Martin Baulig <martin@ximian.com>
10612 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10613 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10614 AsAccessible(), moved them as well.
10616 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10618 2003-10-07 Miguel de Icaza <miguel@ximian.com>
10620 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10621 generation for >=, as spotted by Paolo, bug 48679.
10622 Patch from David Waite.
10624 * cs-tokenizer.cs: Add handling for #pragma.
10626 * cs-parser.jay: Allow for both yield and yield return in the
10627 syntax. The anti-cobolization of C# fight will go on!
10629 * class.cs (TypeBuilder.DefineType): Catch error condition here
10630 (Parent.DefineType erroring out and returning null).
10632 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10633 coping with enumerations variables, we were mistakenly processing
10634 them as a regular value type instead of built-in types. Fixes the
10637 * typemanager.cs (IsBuiltinOrEnum): New method.
10639 2003-09-30 Miguel de Icaza <miguel@ximian.com>
10641 * cs-parser.jay: Upgrade: yield now needs the return clause.
10643 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10645 * cs-parser.jay : Renamed yyName to yyNames related to jay.
10647 2003-09-29 Martin Baulig <martin@ximian.com>
10649 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10650 inflated generic methods.
10652 * generics.cs (ConstructedType): Distinguish between open and
10653 closed constructed types; correctly resolve the arguments.
10655 2003-09-22 Martin Baulig <martin@ximian.com>
10657 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10658 all type arguments meet their constraints.
10660 2003-09-19 Martin Baulig <martin@ximian.com>
10662 * decl.cs (MemberCache.SetupCacheForInterface): Take a
10663 `MemberCache parent' argument. Normally, an interface doesn't
10664 have a parent type except System.Object, but we use this in gmcs
10665 for generic type parameters.
10667 2003-09-18 Martin Baulig <martin@ximian.com>
10669 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10670 on `type.IsInterface'; don't check whether the type has a parent
10671 to determine whether it's an interface.
10673 2003-09-17 Martin Baulig <martin@ximian.com>
10675 * generic.cs (ConstructedType.ToString): Always use `name' as the
10678 2003-09-15 Martin Baulig <martin@ximian.com>
10680 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10682 * generic.cs (Constraints.Resolve): New public method; this is
10683 called to resolve the constraint types and to check whether all
10684 the constraints are correct.
10685 (Constraints.Types): New public property.
10686 (TypeParameter.Resolve): New public method; resolves all the
10687 type's constraints.
10689 * class.cs (TypeContainer.DefineType): Call
10690 TypeParameter.Resolve() before actually defining the type.
10692 2003-09-15 Martin Baulig <martin@ximian.com>
10694 * class.cs (TypeContainer.DefineType): Added an error flag to
10695 avoid reporting duplicate CS0146's ("class definition is
10698 * driver.cs (Driver.MainDriver): Abort if
10699 RootContext.ResolveTree() reported any errors.
10701 2003-09-07 Martin Baulig <martin@ximian.com>
10703 * report.cs (Error, Warning): Added overloaded versions which take
10704 a `params object[] args' and call String.Format().
10706 2003-09-07 Martin Baulig <martin@ximian.com>
10708 * decl.cs (DeclSpace..ctor): Don't call
10709 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10710 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
10711 (DeclSpace.RecordDecl): New method.
10713 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10715 2003-09-02 Ravi Pratap <ravi@ximian.com>
10717 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10718 value attributes to be applied to ParameterBuilders.
10720 * class.cs (MethodCore.LabelParameters): Make static and more
10721 generic so that it can be used from other places - like interface
10722 methods, for instance.
10724 * interface.cs (Interface.Emit): Call LabelParameters before
10725 emitting attributes on the InterfaceMethod.
10727 2003-09-07 Martin Baulig <martin@ximian.com>
10729 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10730 if the number of type parameters doesn't match.
10732 2003-09-04 Martin Baulig <martin@ximian.com>
10734 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10735 for arrays of generic type params (ie. `!0[]').
10737 2003-09-04 Martin Baulig <martin@ximian.com>
10739 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10742 2003-09-04 Martin Baulig <martin@ximian.com>
10744 * decl.cs (DeclSpace.LookupGeneric): New method.
10745 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10748 * generic.cs (TypeParameterExpr): Take a TypeParameter as
10749 argument, not just a string.
10750 (TypeParameter.Define): New public method; this is called to
10751 actually define the generic parameter; after this, you can use the
10752 new `Type' property to get the type.
10754 2003-09-04 Martin Baulig <martin@ximian.com>
10756 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
10757 is now an ArrayList; initialize the result of the `TypeParameters'
10759 (DeclSpace.GetGenericData): Removed.
10760 (DeclSpace.LookupGeneric): Temporarily removed; we need to
10761 implement this in a different way.
10762 (DeclSpace.GetTypeParameters): Removed; there's now a
10763 `TypeParameters' property.
10764 (DeclSpace.TypeParameters): New public property.
10766 * generic.cs (Constraints): Make this class public.
10767 (TypeParameter): New public class.
10769 2003-09-04 Martin Baulig <martin@ximian.com>
10771 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
10772 generic parameters.
10774 * class.cs (TypeContainer.DefineType): Call
10775 TypeBuilder.DefineGenericParameter () on all generic parameters if
10776 this is a generic type.
10778 2003-08-28 Martin Baulig <martin@ximian.com>
10780 * sample-stack.il: Compile this with ilasm: "ilasm /dll
10783 * sample-hello.cs: Compile this with gmcs: "gmcs
10784 /r:sample-stack.dll sample-hello.cs".
10786 2003-08-28 Martin Baulig <martin@ximian.com>
10788 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
10789 the parameters to the generic type.
10791 2003-08-28 Martin Baulig <martin@ximian.com>
10793 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
10795 2003-08-28 Martin Baulig <martin@ximian.com>
10797 * cs-parser.jay (opt_type_argument_list): Use
10798 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
10799 (primary_expression): Replace `qualified_identifier' with `type_name'.
10800 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
10802 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
10803 parser to check whether it is syntactically a type parameter list;
10804 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
10807 2003-08-26 Martin Baulig <martin@ximian.com>
10809 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10810 resolving aliases; fixes #47927.
10812 2003-08-26 Martin Baulig <martin@ximian.com>
10814 * statement.cs (Using.DoResolve): This is internally emitting a
10815 try/finally clause, so we need to set ec.NeedExplicitReturn if we
10816 do not always return. Fixes #47681.
10818 2003-08-26 Martin Baulig <martin@ximian.com>
10820 * decl.cs (MemberCore): Moved WarningNotHiding(),
10821 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10823 (AdditionResult): Make this nested in DeclSpace.
10824 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10825 argument; call NamespaceEntry.Define() unless we're nested in a
10828 * namespace.cs (Namespace.DefineName): New public function. This
10829 is called from DeclSpace's .ctor to add
10830 (Namespace.Lookup): Include DeclSpaces in the lookup.
10832 * class.cs (Operator): Derive from MemberBase, not MemberCore.
10834 * const.cs (Const): Derive from MemberBase, not MemberCore.
10836 2003-08-25 Martin Baulig <martin@ximian.com>
10838 * convert.cs (Convert.ExplicitReferenceConversion): When
10839 converting from an interface type to a class, unbox if the target
10840 type is a struct type. Fixes #47822.
10842 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10844 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10847 2003-08-22 Martin Baulig <martin@ximian.com>
10849 * class.cs (TypeManager.DefineType): When defining a nested type,
10850 call DefineType() on our parent; fixes #47801.
10852 2003-08-22 Martin Baulig <martin@ximian.com>
10854 * class.cs (MethodData.Define): While checking if a method is an
10855 interface implementation, improve the test a bit more to fix #47654.
10857 2003-08-22 Martin Baulig <martin@ximian.com>
10859 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10860 correctly; fixes #47722.
10862 2003-08-22 Martin Baulig <martin@ximian.com>
10864 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10865 LocalVariableReference, ensure it's not read-only. Fixes #47536.
10867 * statement.cs (Fixed.DoResolve): Make all variables read-only.
10869 2003-08-22 Martin Baulig <martin@ximian.com>
10871 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10872 can only be assigned in static constructors. Fixes #47161.
10874 2003-08-22 Martin Baulig <martin@ximian.com>
10876 Rewrote and improved the flow analysis code.
10878 * flowbranching.cs (FlowBranching): Make this class abstract.
10879 (FlowBranching.CreateBranching): New static function to create a
10880 new flow branching.
10881 (FlowBranchingBlock, FlowBranchingException): New classes.
10882 (FlowBranching.UsageVector.Type): New public readonly field.
10883 (FlowBranching.UsageVector.Breaks): Removed the setter.
10884 (FlowBranching.UsageVector.Returns): Removed the setter.
10885 (FlowBranching.UsageVector): Added Break(), Return(),
10886 NeverReachable() and Throw() methods to modify the reachability.
10887 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10888 done by FlowBranching.Merge().
10889 (FlowBranching.UsageVector.MergeChild): New method; merges the
10890 merge result into the current vector.
10891 (FlowBranching.Merge): New abstract method to merge a branching.
10893 2003-08-12 Martin Baulig <martin@ximian.com>
10895 * expression.cs (Indirection.CacheTemporaries): Create the
10896 LocalTemporary with the pointer type, not its element type.
10898 2003-08-10 Miguel de Icaza <miguel@ximian.com>
10900 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10901 token was a keyword or not.
10903 Add `error' options where an IDENTIFIER was expected; Provide
10904 CheckToken and CheckIdentifierToken convenience error reporting
10907 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10909 * decl.cs: Rename `NamespaceEntry Namespace' public field into
10910 NameSpaceEntry NameSpaceEntry.
10912 (LookupInterfaceOrClass): Avoid creating a full qualified name
10913 from namespace and name: avoid doing lookups when we know the
10914 namespace is non-existant. Use new Tree.LookupByNamespace which
10915 looks up DeclSpaces based on their namespace, name pair.
10917 * driver.cs: Provide a new `parser verbose' to display the
10918 exception thrown during parsing. This is turned off by default
10919 now, so the output of a failure from mcs is more graceful.
10921 * namespace.cs: Track all the namespaces defined in a hashtable
10924 (IsNamespace): New method
10926 2003-08-09 Miguel de Icaza <miguel@ximian.com>
10928 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
10929 we know that we need to concatenate (full typename can never be
10934 * statement.cs: Use a bitfield; Do not initialize to null things
10935 which are done by the constructor by default.
10937 * cs-parser.jay: bug fix, parameter was 4, not 3.
10939 * expression.cs: Just use the property;
10941 * statement.cs: No need for GetVariableInfo method.
10943 2003-08-08 Martin Baulig <martin@ximian.com>
10945 * flowanalysis.cs (FlowReturns): This is now nested in the
10946 `FlowBranching' class.
10947 (MyBitVector): Moved this here from statement.cs.
10948 (FlowBranching.SiblingType): New enum type.
10949 (FlowBranching.CreateSibling): Added `SiblingType' argument.
10951 2003-08-07 Martin Baulig <martin@ximian.com>
10953 * flowanalysis.cs (FlowBranchingType): This is now nested in the
10954 `FlowBranching' class and called `BranchingType'.
10956 2003-08-07 Martin Baulig <martin@ximian.com>
10958 * flowanalysis.cs: Moved all the control flow analysis code into
10961 2003-08-07 Martin Baulig <martin@ximian.com>
10963 * assign.cs (Assign.DoResolve): `target' must either be an
10964 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
10967 2003-08-07 Miguel de Icaza <miguel@ximian.com>
10969 * expression.cs (BinaryMethod): This kind of expression is created by the
10970 Binary class if it determines that the operator has to be handled
10973 (BinaryDelegate): This kind of expression is created if we are
10974 dealing with a + or - operator on delegates.
10976 (Binary): remove method, argumetns, and DelegateOperator: when
10977 dealing with methods,
10979 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10981 * statement.cs (Block): use bitfields for the three extra booleans
10982 we had in use. Remove unused topblock parameter.
10984 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10986 * assign.cs: Drop extra unneeded tests.
10988 2003-08-06 Miguel de Icaza <miguel@ximian.com>
10990 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10992 * statement.cs (Foreach): Use VariableStorage instead of
10995 * codegen.cs (VariableStorage): New class used by clients that
10996 require a variable stored: locals or fields for variables that
10997 need to live across yield.
10999 Maybe provide a convenience api for EmitThis+EmitLoad?
11001 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11004 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11006 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11007 RemapParameterLValue): New methods that are used to turn a
11008 precomputed FieldInfo into an expression like this:
11012 The idea is to use this instead of making LocalVariableReference
11013 have more than one meaning.
11015 * cs-parser.jay: Add error production to BASE.
11017 * ecore.cs: Deal with TypeManager.GetField returning null, which
11018 is now a valid return value.
11020 (FieldExprNoAddress): New expression for Fields whose address can
11023 * expression.cs (LocalVariableReference): During the resolve
11024 phases, create new expressions if we are in a remapping context.
11025 Remove code that dealt with remapping here.
11027 (ParameterReference): same.
11029 (ProxyInstance): New expression, like the `This' expression, but
11030 it is born fully resolved. We know what we are doing, so remove
11031 the errors that are targeted to user-provided uses of `this'.
11033 * statement.cs (Foreach): our variable is now stored as an
11034 Expression; During resolution, follow the protocol, dont just
11035 assume it will return this.
11037 2003-08-06 Martin Baulig <martin@ximian.com>
11039 * support.cs (SeekableStreamReader.cs): New public class.
11041 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11042 SeekableStreamReader instead of the normal StreamReader.
11044 2003-08-04 Martin Baulig <martin@ximian.com>
11046 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11047 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11048 deambiguate casts and delegate invocations.
11049 (parenthesized_expression): Use the new tokens to ensure this is
11050 not a cast of method invocation.
11052 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11053 when reading a `)' and Deambiguate_CloseParens () was previously
11056 * expression.cs (ParenthesizedExpression): New class. This is
11057 just used for the CS0075 test.
11058 (Binary.DoResolve): Check for CS0075.
11060 2003-07-29 Ravi Pratap <ravi@ximian.com>
11062 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11063 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11064 reference comparison.
11066 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11067 examine the ReturnType for equality - this is necessary in the
11068 cases of implicit and explicit operators whose signature also
11069 includes the return type.
11071 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11073 * namespace.cs: Cache the result of the namespace computation,
11074 instead of computing it every time.
11076 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11078 * decl.cs: Use a global arraylist that we reuse over invocations
11079 to avoid excesive memory consumption. Reduces memory usage on an
11080 mcs compile by one meg (45 average).
11082 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11083 private, work around that.
11085 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11087 * literal.cs (IntLiteral): Define Zero and One static literals.
11089 * cs-parser.jay (integer_literal): use static literals to reduce
11090 memory usage for the most used literals (0, 1 and -1). 211kb
11091 reduced in memory usage.
11093 Replace all calls to `new ArrayList' with `new
11094 ArrayList(4)' which is a good average number for most allocations,
11095 and also requires only 16 bytes of memory for its buffer by
11098 This reduced MCS memory usage in seven megabytes for the RSS after
11101 2003-07-28 Ravi Pratap <ravi@ximian.com>
11103 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11104 handle params methods the correct way by forming only one
11105 applicable set with params and normal methods in them. Earlier we
11106 were looking at params methods only if we found no normal methods
11107 which was not the correct thing to do.
11109 (Invocation.BetterFunction): Take separate arguments indicating
11110 when candidate and the best method are params methods in their
11113 This fixes bugs #43367 and #46199.
11115 * attribute.cs: Documentation updates.
11117 (CheckAttribute): Rename to CheckAttributeTarget.
11118 (GetValidPlaces): Rename to GetValidTargets.
11120 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11121 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11125 2003-07-28 Miguel de Icaza <miguel@ximian.com>
11127 * codegen.cs: Compute IsGeneric correctly.
11129 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
11132 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
11133 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
11134 regressions, and I was chasing more bugs than I required.
11136 * interface.cs: Use expressions for base type names (like classes
11137 and structs have been doing for a while now), and resolve that.
11138 This patch should probably go into head as well.
11140 This makes it one less user of FindType.
11142 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11144 This compiler can not self host currently. Need to fix that.
11146 * Makefile: compile to `gmcs.exe'
11148 * driver.cs: Turn on v2 by default on gmcs.
11150 * generic.cs (ConstructedType): Does no longer take a container
11151 type argument; That will be taken care of later.
11153 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
11154 Use SimpleName to resolve for now, so we can continue the work on
11155 the parser, until we get Type.GetType that understands generics.
11157 (ConstructedType.ToString): Implement
11159 (TypeArguments.Resolve): Resolve the child expressions as types.
11161 * cs-parser.jay: Rename interface_constraints to
11162 type_parameter_constraints
11164 (namespace_or_type_name): Only use constructed types for the basic
11165 construction, we will deal with identifier<...> later.
11167 (type/type_name): No longer call DecomposeQI, as
11168 namespace_or_type_name is always decoded now.
11170 2003-07-22 Ravi Pratap <ravi@ximian.com>
11172 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11173 closely: we eliminate methods in base types when we have an
11174 applicable method in a top-level type.
11176 Please see section 14.5.5.1 for an exact description of what goes
11179 This fixes bug #45127 and a host of other related to corlib compilation.
11181 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11182 array is the method corresponding to the top-level type (this is
11183 because of the changes made to icall.c) so we change this
11186 (MethodGroupExpr.Name): This too.
11188 * typemanager.cs (GetElementType): New method which does the right
11189 thing when compiling corlib.
11191 * everywhere: Make use of the above in the relevant places.
11193 2003-07-22 Martin Baulig <martin@ximian.com>
11195 * cs-parser.jay (invocation_expression): Moved
11196 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11197 `cast_expression', but create a InvocationOrCast which later
11198 resolves to either an Invocation or a Cast.
11200 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11201 method; call this before EmitStatement() to make sure that this
11202 expression can be used as a statement.
11204 * expression.cs (InvocationOrCast): New class; resolves to either
11205 an Invocation or a Cast.
11207 * statement.cs (StatementExpression): Call ResolveStatement() on
11208 the ExpressionStatement before emitting it.
11210 2003-07-21 Martin Baulig <martin@ximian.com>
11212 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11213 `ref' and `out' attributes match; fixes #46220.
11214 (MemberAccess.ResolveMemberAccess): You can't reference a type
11215 through an expression; fixes #33180.
11216 (Indexers.GetIndexersForType): Don't return the indexers from
11217 interfaces the class implements; fixes #46502.
11219 2003-07-21 Martin Baulig <martin@ximian.com>
11221 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11222 CS0661 checks; fixes bug #30442.
11224 2003-07-21 Martin Baulig <martin@ximian.com>
11226 * decl.cs (AdditionResult): Added `Error'.
11228 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11230 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
11231 cs0031.cs actually work.
11233 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11235 * cs-parser.jay (namespace_name): do not use
11236 namespace_or_type_name, use qualified_identifier, because
11237 namespace_or_type_name will soon return a composed expression
11238 instead of a string.
11240 (namespace_or_type_name): Instead of returning a string, now this
11241 production returns an expression.
11243 * codegen.cs (EmitContext): Setup IsGeneric property based on
11244 whether our DeclSpace is generic, our the method is generic.
11246 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
11247 the method is generic.
11249 * cs-parser.jay (type_arguments, opt_type_argument_list,
11250 type_parameters, type_parameter_list, opt_type_parameter_list,
11251 type_parameter,, opt_type_parameter_constraints_clauses,
11252 type_parameter_constraints_clauses,
11253 type_parameter_constraint_clause, type_parameter_constraint,
11254 interface_constraints): Add new production
11256 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
11257 DeclSpace is generic or not.
11259 (DeclSpace.SetParameterInfo): New routine, used to set the
11260 parameter info for a type.
11262 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
11263 returns a GenericTypeExpr
11265 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
11266 generic, lookup the generic argument.
11268 * attribute.cs: Do not allow TypeParameterExpressions in
11271 * class.cs: Do not allow the Main method to be defined in a
11274 * expression.cs (SizeOf): Do not allow generic types to be used as
11275 arguments to sizeof.
11277 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
11278 it: whether a type is generic or not. Only works for types we are
11279 currently building for now.
11281 2003-07-20 Martin Baulig <martin@ximian.com>
11283 * namespace.cs: Fixed that bug which caused a crash when compiling
11284 the debugger's GUI.
11286 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11288 * typemanager.cs (LookupTypeReflection): Never expose types which
11289 are NotPublic, NestedPrivate, NestedAssembly, or
11290 NestedFamANDAssem. We used to return these, and later do a check
11291 that would report a meaningful error, but the problem is that we
11292 would not get the real match, if there was a name override.
11294 2003-07-18 Miguel de Icaza <miguel@ximian.com>
11296 * namespace.cs (Namespace, Name): Do not compute the namespace
11297 name dynamically, compute it in the constructor. This reduced
11298 memory usage by 1697 KB.
11300 * driver.cs: Use --pause to pause at the end.
11302 2003-07-17 Peter Williams <peter@newton.cx>
11304 * Makefile: Change the name of the test target so that it doesn't
11305 conflict with the recursive test target.
11307 2003-07-17 Miguel de Icaza <miguel@ximian.com>
11309 * expression.cs (LocalVariableReference.Emit, EmitAssign,
11310 AddressOf): Do not use EmitThis, that was wrong, use the actual
11313 2003-07-15 Miguel de Icaza <miguel@ximian.com>
11315 * class.cs (MethodData.Define): While checking if a method is an
11316 interface implementation, improve the test: If we are not public
11317 (use new test here: use the computed MethodAttributes directly,
11318 instead of the parsed modifier flags) check if the `implementing'
11319 method comes from an interface or not.
11321 * pending.cs (VerifyPendingMethods): Slightly better error
11324 * makefile: add test target that does the mcs bootstrap.
11326 2003-07-16 Ravi Pratap <ravi@ximian.com>
11328 * interface.cs (Define): Do nothing here since there are no
11329 members to populate etc. Move the attribute emission out of here
11330 since this was just totally the wrong place to put it. Attribute
11331 application happens during the 'Emit' phase, not in the 'Define'
11334 (Emit): Add this method and move the attribute emission here
11336 * rootcontext.cs (EmitCode): Call the Emit method on interface
11339 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11341 * expression.cs (OverloadResolve): Report error only if Location
11342 is not 'Null' which means that there was a probe going on.
11344 2003-07-14 Martin Baulig <martin@ximian.com>
11346 * expression.cs (ConditionalLogicalOperator): New public class to
11347 implement user defined conditional logical operators.
11348 This is section 14.11.2 in the spec and bug #40505.
11350 2003-07-14 Martin Baulig <martin@ximian.com>
11352 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11354 2003-07-14 Martin Baulig <martin@ximian.com>
11356 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11358 * ecore.cs (IVariable.VerifyFixed): New interface method.
11360 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11361 operator, check whether the variable is actually fixed. Fixes bug
11362 #36055. Set a variable definitely assigned when taking its
11363 address as required by the spec.
11365 * statement.cs (LocalInfo.IsFixed): New field.
11366 (LocalInfo.MakePinned): Set `IsFixed' to true.
11368 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11370 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11371 for .ctors, ensure that we only ask for members declared in the
11372 attribute type (BindingFlags.DeclaredOnly).
11376 * expression.cs (Error_WrongNumArguments): Report error 1501
11377 correctly the way CSC does.
11379 2003-07-13 Martin Baulig <martin@ximian.com>
11381 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11382 lookup on the fully qualified name, to make things like "X.X" work
11383 where "X.X" is a fully qualified type name, but we also have a
11384 namespace "X" in the using list. Fixes #41975.
11386 2003-07-13 Martin Baulig <martin@ximian.com>
11388 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11389 function. If we're a CompoundAssign, we need to create an embedded
11390 CompoundAssign, not an embedded Assign.
11391 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11394 2003-07-13 Martin Baulig <martin@ximian.com>
11396 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11397 work to fix bug #46088.
11399 2003-07-13 Ravi Pratap <ravi@ximian.com>
11401 * class.cs (Operator.Emit): Do not emit attributes here - it is
11402 taken care of by the Method class that we delegate too. This takes
11403 care of bug #45876.
11405 2003-07-10 Martin Baulig <martin@ximian.com>
11407 * expression.cs (TypeOfVoid): New class.
11408 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
11410 2003-07-10 Martin Baulig <martin@ximian.com>
11412 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11415 2003-07-10 Martin Baulig <martin@ximian.com>
11417 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11418 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11420 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11422 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11424 2003-07-10 Martin Baulig <martin@ximian.com>
11426 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11427 of decimal. Fixes #42850.
11429 NOTE: I also fixed the created byte blob, but this doesn't work on
11430 the MS runtime and csc never produces any byte blobs for decimal
11433 2003-07-10 Martin Baulig <martin@ximian.com>
11435 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11436 structs; fixes #32068.
11437 (Block.AddChildVariableNames): Fixed #44302.
11439 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11441 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11443 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11445 * attribute.cs: And this test is onger needed.
11447 2003-07-08 Martin Baulig <martin@ximian.com>
11449 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11450 inaccessible types. Fixes #36313.
11452 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11454 * namespace.cs (NamespaceEntry): Create implicit entries for all
11455 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11456 implicit entries for N1.N2 and N1.
11458 2003-07-08 Martin Baulig <martin@ximian.com>
11460 Rewrote the handling of namespaces to fix a lot of the issues
11461 wrt. `using' aliases etc.
11463 * namespace.cs (Namespace): Splitted this class into a
11464 per-assembly `Namespace' and a per-file `NamespaceEntry'.
11466 * typemanager.cs (TypeManager.IsNamespace): Removed.
11467 (TypeManager.ComputeNamespaces): Only compute namespaces from
11468 loaded assemblies here, not the namespaces from the assembly we're
11469 currently compiling.
11471 2003-07-08 Martin Baulig <martin@ximian.com>
11473 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11475 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11477 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11480 I thought about the memory savings here, but LookupTypeReflection
11481 is used under already very constrained scenarios. Compiling
11482 corlib or mcs only exposes one hit, so it would not really reduce
11483 any memory consumption.
11485 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11487 * typemanager.cs: fixes bug #45889 by only adding public types from
11488 other assemblies to the list of known types.
11490 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11492 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11493 on the type we resolved.
11495 2003-07-05 Martin Baulig <martin@ximian.com>
11497 * pending.cs (PendingImplementation.ParentImplements): Don't
11498 create the proxy if the parent is abstract.
11500 * class.cs (TypeContainer.DefineIndexers): Process explicit
11501 interface implementations first. Fixes #37714.
11503 2003-07-04 Miguel de Icaza <miguel@ximian.com>
11505 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11506 defined recursively; but since we modify the input parameters
11507 (left is set to `this' temporarily), we reset this value if the
11508 left_is_explicit is false, which gives the original semantics to
11511 * literal.cs (NullPointer): new class used to represent a null
11512 literal in a pointer context.
11514 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11515 type is a pointer, use a NullPointer object instead of a
11516 NullLiteral. Closes 43687
11518 (ExplicitConversion): Convert pointer values using
11519 the conv opcode to the proper type.
11521 * ecore.cs (New): change ValueTypeVariable property into a method,
11522 that returns whether the valuetype is suitable for being used.
11524 * expression.cs (Binary.DoNumericPromotions): Only return if we
11525 the int constant was a valid uint, and we can return both left and
11526 right as uints. If not, we continue processing, to trigger the
11527 type conversion. This fixes 39018.
11529 * statement.cs (Block.EmitMeta): During constant resolution, set
11530 the CurrentBlock property on the emitcontext, so that we resolve
11531 constants propertly.
11533 2003-07-02 Martin Baulig <martin@ximian.com>
11535 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11536 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11538 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11539 than emitting it here.
11541 * statement.cs: Fixed some more flow analysis bugs.
11543 2003-07-02 Martin Baulig <martin@ximian.com>
11545 * class.cs (MethodData.Define): When implementing interface
11546 methods, set Final unless we're Virtual.
11548 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11549 check work for interface methods.
11551 2003-07-01 Martin Baulig <martin@ximian.com>
11553 * ecore.cs (EmitContext.This): Replaced this property with a
11554 GetThis() method which takes a Location argument. This ensures
11555 that we get the correct error location for a CS0188.
11557 2003-07-01 Miguel de Icaza <miguel@ximian.com>
11559 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11560 ImplicitStandardConversion.
11562 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11564 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
11566 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11569 2003-06-30 Miguel de Icaza <miguel@ximian.com>
11571 * class.cs (Constructor.Define): Turn off initlocals for unsafe
11574 (MethodData.Define): Turn off initlocals for unsafe methods.
11576 2003-06-29 Miguel de Icaza <miguel@ximian.com>
11578 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11579 complete; Fixes #37521.
11581 * delegate.cs: Use Modifiers.TypeAttr to compute the
11582 TypeAttributes, instead of rolling our own. This makes the flags
11583 correct for the delegates.
11585 2003-06-28 Miguel de Icaza <miguel@ximian.com>
11587 * class.cs (Constructor.Define): Set the private flag for static
11588 constructors as well.
11590 * cs-parser.jay (statement_expression): Set the return value to
11591 null, to avoid a crash when we catch an error.
11593 2003-06-24 Miguel de Icaza <miguel@ximian.com>
11595 * cs-parser.jay: Applied patch from Jackson that adds support for
11596 extern and unsafe modifiers to destructor declarations.
11598 * expression.cs: Report error 21 if the user is trying to index a
11601 * driver.cs: Add an error message, suggested by the bug report.
11603 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11604 if we do not have a ": this ()" constructor initializer. Fixes 45149
11606 2003-06-14 Miguel de Icaza <miguel@ximian.com>
11608 * namespace.cs: Add some information to reduce FAQs.
11610 2003-06-13 Miguel de Icaza <miguel@ximian.com>
11612 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11613 underlying enumeration types. Fixes #43915.
11615 * expression.cs: Treat ushort/short as legal values to be used in
11616 bitwise operations.
11618 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11620 * delegate.cs: transfer custom attributes for paramenters from
11621 the delegate declaration to Invoke and BeginInvoke.
11623 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11625 * attribute.cs: handle custom marshalers and emit marshal info
11628 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
11630 * makefile.gnu: Added anonymous.cs to the compiler sources.
11632 2003-05-28 Miguel de Icaza <miguel@ximian.com>
11634 * iterators.cs: Change the name of the proxy class to include two
11637 * cs-parser.jay: Update grammar to include anonymous methods.
11639 * anonymous.cs: new file.
11641 2003-05-27 Miguel de Icaza <miguel@ximian.com>
11643 * class.cs (Field.Define): Add missing test for pointers and
11646 2003-05-27 Ravi Pratap <ravi@ximian.com>
11648 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11649 we use the stobj opcode.
11651 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11652 since it wasn't the correct fix.
11654 It still is puzzling that we are required to use stobj for IntPtr
11655 which seems to be a ValueType.
11657 2003-05-26 Miguel de Icaza <miguel@ximian.com>
11659 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11660 during regular simple name resolution. Now, the trick is that
11661 instead of returning for processing the simplename, we do a
11662 TypeManager.LookupType (ie, a rooted lookup as opposed to a
11663 contextual lookup type). If a match is found, return that, if
11664 not, return for further composition.
11666 This fixes long-standing 30485.
11668 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11669 using the address to initialize an object, do an Stobj instead of
11670 using the regular Stelem.
11672 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11673 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11674 Because if we are a BaseIndexerAccess that value will be true.
11677 * statement.cs (GotoCase.Resolve): Return after reporting an
11678 error, do not attempt to continue.
11680 * expression.cs (PointerArithmetic.Emit): If our operand is a
11681 long, convert our constants to match the operand before
11682 multiplying. Convert to I type before adding. Fixes 43670.
11684 2003-05-14 Ravi Pratap <ravi@ximian.com>
11686 * enum.cs (ImplicitConversionExists) : Rename to
11687 ImplicitEnumConversionExists to remove ambiguity.
11689 * ecore.cs (NullCast): New type of cast expression class which
11690 basically is very similar to EmptyCast with the difference being
11691 it still is a constant since it is used only to cast a null to
11693 (eg. (string) null)
11695 * convert.cs (ImplicitReferenceConversion): When casting a null
11696 literal, we return a NullCast.
11698 * literal.cs (NullLiteralTyped): Remove - I don't see why this
11699 should be around anymore.
11701 The renaming (reported was slightly wrong). Corrections:
11703 ConvertImplicitStandard -> ImplicitConversionStandard
11704 ConvertExplicitStandard -> ExplicitConversionStandard
11706 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11707 before passing them in !
11709 * convert.cs (ImplicitConversionStandard): When comparing for
11710 equal expr and target types, ensure that expr is not a
11713 In general, we must not be checking (expr_type ==
11714 target_type) in the top level conversion methods
11715 (ImplicitConversion, ExplicitConversion etc). This checking is
11716 done in the methods that they delegate to.
11718 2003-05-20 Miguel de Icaza <miguel@ximian.com>
11720 * convert.cs: Move Error_CannotConvertType,
11721 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11722 ImplicitNumericConversion, ImplicitConversionExists,
11723 ImplicitUserConversionExists, StandardConversionExists,
11724 FindMostEncompassedType, FindMostSpecificSource,
11725 FindMostSpecificTarget, ImplicitUserConversion,
11726 ExplicitUserConversion, GetConversionOperators,
11727 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11728 TryImplicitIntConversion, Error_CannotConvertImplicit,
11729 ConvertImplicitRequired, ConvertNumericExplicit,
11730 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11731 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11734 Perform the following renames:
11736 StandardConversionExists -> ImplicitStandardConversionExists
11737 ConvertImplicit -> ImplicitConversion
11738 ConvertImplicitStandard -> ImplicitStandardConversion
11739 TryImplicitIntConversion -> ImplicitIntConversion
11740 ConvertImplicitRequired -> ImplicitConversionRequired
11741 ConvertNumericExplicit -> ExplicitNumericConversion
11742 ConvertReferenceExplicit -> ExplicitReferenceConversion
11743 ConvertExplicit -> ExplicitConversion
11744 ConvertExplicitStandard -> ExplicitStandardConversion
11746 2003-05-19 Martin Baulig <martin@ximian.com>
11748 * statement.cs (TypeInfo.StructInfo): Made this type protected.
11749 (TypeInfo): Added support for structs having structs as fields.
11751 * ecore.cs (FieldExpr): Implement IVariable.
11752 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11753 VariableInfo for the field.
11755 2003-05-18 Martin Baulig <martin@ximian.com>
11757 * expression.cs (This.DoResolve): Report a CS0027 if we're
11758 emitting a field initializer.
11760 2003-05-18 Martin Baulig <martin@ximian.com>
11762 * expression.cs (This.ResolveBase): New public function.
11763 (This.DoResolve): Check for CS0188.
11765 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11768 * ecore.cs (MethodGroupExpr.DoResolve): Set the
11769 `instance_expression' to null if we don't have any non-static
11772 2003-05-18 Martin Baulig <martin@ximian.com>
11774 Reworked the way how local variables and parameters are handled by
11775 the flow analysis code.
11777 * statement.cs (TypeInfo, VariableMap): New public classes.
11778 (VariableInfo): New public class. This is now responsible for
11779 checking whether a variable has been assigned. It is used for
11780 parameters and local variables.
11781 (Block.EmitMeta): Take the InternalParameters as argument; compute
11782 the layout of the flow vectors here.
11783 (Block.LocalMap, Block.ParameterMap): New public properties.
11784 (FlowBranching): The .ctor doesn't get the InternalParameters
11785 anymore since Block.EmitMeta() now computes the layout of the flow
11787 (MyStructInfo): This class is now known as `StructInfo' and nested
11788 in `TypeInfo'; we don't access this directly anymore.
11790 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11791 property and removed IsAssigned(), IsFieldAssigned(),
11792 SetAssigned() and SetFieldAssigned(); we now call them on the
11793 VariableInfo so we don't need to duplicate this code everywhere.
11795 * expression.cs (ParameterReference): Added `Block block' argument
11797 (LocalVariableReference, ParameterReference, This): The new
11798 VariableInfo class is now responsible for all the definite
11801 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11802 IsParameterAssigned, SetParameterAssigned): Removed.
11804 2003-05-18 Martin Baulig <martin@ximian.com>
11806 * typemanager.cs (InitCoreTypes): Try calling
11807 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11808 the 3-args-version. Corlib now also needs our `void_type'.
11809 (GetMethod): Added overloaded version which takes an optional
11810 `bool report_errors' to allow lookups of optional methods.
11812 2003-05-12 Martin Baulig <martin@ximian.com>
11814 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11815 only used for locals and not for parameters.
11817 2003-05-12 Miguel de Icaza <miguel@ximian.com>
11819 * support.cs (InternalParameters.ParameterType): Return the
11820 ExternalType of the parameter.
11822 * parameter.cs (Parameter.ExternalType): drop the two arguments,
11825 2003-05-11 Miguel de Icaza <miguel@ximian.com>
11827 * class.cs (MethodData.Define): Do not set the `newslot' on
11828 interface members, if they are also flagged as "override".
11830 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11831 better code for ++i and i++. This only works for static fields
11832 and local variables.
11834 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11835 want to pull the DeclSpace out of the builder_to_declspace instead
11836 of the TypeBuilder (like in TypeContainer.FindMembers).
11838 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11839 instead of LookupTypeContainer. Fixes the crash on .NET for
11840 looking up interface members.
11842 * const.cs: Create our own emit context during the Definition
11843 stage, so that constants are evaluated in the proper context, when
11844 a recursive definition happens.
11846 2003-05-11 Martin Baulig <martin@ximian.com>
11848 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
11849 new block for a switch section.
11850 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11851 the adding/lookup in the switch block. Fixes #39828.
11853 2003-05-09 Miguel de Icaza <miguel@ximian.com>
11855 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11856 functionality: I needed to convert the data after I had performed
11857 the add/sub operation into the operands type size.
11859 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11860 pass the type for the box operation, otherwise the resulting
11861 object would have been of type object.
11863 (BoxedCast): Add constructor to specify the type to box as.
11865 2003-05-07 Miguel de Icaza <miguel@ximian.com>
11867 * iterators.cs: I was reusing the `count' variable inadvertently,
11868 take steps to not allow this to happen.
11870 2003-05-06 Miguel de Icaza <miguel@ximian.com>
11872 * attribute.cs (Attribute.Resolve): Params attributes are encoded
11873 by creating an array at the point where the params starts and
11874 putting all those arguments there, then adjusting the size of the
11877 2003-05-05 Miguel de Icaza <miguel@ximian.com>
11879 * expression.cs (New.AddressOf): Implement interface
11880 IMemoryLocation. This is used when the `new' operator is used in
11881 the context of an invocation to a method on a value type.
11883 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11886 * namespace.cs: Also check the using aliases here.
11888 * driver.cs: Move the test for using validity after the types have
11889 been entered, so we do a single pass that also includes the using
11892 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11893 in the regular case. CreateSiblingForFinally is doing extra
11896 * attribute.cs (GetAttributeArgumentExpression): Store the result
11897 on an out value, and use the return value to indicate failure
11898 instead of using null (which is a valid return for Constant.GetValue).
11900 * statement.cs: Perform the analysis flow for the increment
11901 portion after the statement, because this will be the real flow of
11902 execution. Fixes #42385
11904 * codegen.cs (EmitContext.EmitArgument,
11905 EmitContext.EmitStoreArgument): New helper functions when the
11906 RemapToProxy flag is set.
11908 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11911 Add support for remapping parameters.
11913 * iterators.cs: Propagate parameter values; Store parameter
11914 values in the proxy classes.
11916 2003-05-04 Miguel de Icaza <miguel@ximian.com>
11918 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
11919 need a proxy reference; I do not know what I was thinking
11921 * cs-parser.jay (constructor_initializer): catch another error,
11922 and display nice message.
11924 (field_declaration): catch void field declaration
11925 to flag a better error.
11927 * class.cs (MemberBase.CheckBase): Report an error instead of a
11928 warning if a new protected member is declared in a struct.
11929 (Field.Define): catch the error of readonly/volatile.
11931 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11933 (FieldExpr.AddressOf): ditto. Catch error where the address of a
11934 volatile variable is taken
11936 2003-05-02 Miguel de Icaza <miguel@ximian.com>
11938 * statement.cs (Fixed.Resolve): Report an error if we are not in
11941 2003-05-01 Miguel de Icaza <miguel@ximian.com>
11943 * typemanager.cs: reuse the code that handles type clashes for
11944 delegates and enumerations.
11946 * class.cs (Report28): Always report.
11948 * expression.cs (EncodeAsAttribute): Allow nulls here.
11950 2003-04-28 Miguel de Icaza <miguel@ximian.com>
11952 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11953 the functionality for testing whether an expression is valid for
11954 an attribute here. Also handle the case of arrays of elements
11957 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11958 encoding a linear array into an array of objects that are suitable
11959 to be passed to an CustomAttributeBuilder.
11961 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11963 * ecore.cs: (FieldExpr): Handle field remapping here.
11965 * iteratators.cs: Pass the instance variable (if the method is an
11966 instance method) to the constructors, so we can access the field
11967 variables on the class.
11969 TODO: Test this with structs. I think the THIS variable on
11970 structs might have to be a pointer, and not a refenrece
11972 2003-04-27 Miguel de Icaza <miguel@ximian.com>
11974 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11975 local variables to fields in a proxy class.
11977 * iterators.cs (PopulateProxy): Rename our internal fields to
11979 Create a <THIS> field if we are an instance method, so we can
11980 reference our parent container variables.
11981 (MapVariable): Called back from the EmitContext code to enter a
11982 new variable to field mapping into the proxy class (we just create
11986 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11987 for using the remapped locals to fields.
11989 I placed the code here, because that gives the same semantics to
11990 local variables, and only changes the Emit code.
11992 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11993 statements inside iterators.
11994 (VariableInfo): Add a FieldBuilder for the cases when we are
11995 remapping local variables to fields in a proxy class
11997 * ecore.cs (SimpleNameResolve): Avoid testing two times for
11998 current_block != null.
12000 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12001 not cope with strings, as it has been moved to the
12002 TableSwitchEmit. Fixed bug in switch generation.
12004 * expression.cs (New.DoResolve): Provide more context for the user
12005 when reporting an error.
12007 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12010 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12011 check the permissions for it. Note than in a type-resolution
12012 context the check was already present in DeclSpace.ResolveType,
12013 but was missing from the MemberAccess.
12015 (ArrayCreation.CheckIndices): warn if the user has
12016 more nested levels of expressions, but there are no more
12017 dimensions specified. Avoids crash on bug 41906.
12019 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12021 * statement.cs (Block): replace Implicit bool, for a generic
12023 New flag: `Unchecked'. This is used during the EmitMeta phase
12024 (which is out-of-line with the regular Resolve/Emit process for a
12025 statement, as this is done ahead of time, but still gets a chance
12026 to call constant resolve).
12028 (Block.Flags): new enum for adding a new flag.
12030 (Block.EmitMeta): track the state of unchecked.
12032 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12033 to enable constant resolution to work there as well.
12035 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12037 * typemanager.cs (ienumerable_type): Also look up
12038 System.Collections.IEnumerable.
12040 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12042 TODO: Test more than one conditional per method.
12044 * class.cs (Indexer.Define): Report the location where the user is
12045 referencing the unsupported feature.
12047 (MethodData): Overload the use of `conditionals' to
12048 minimize the creation of needless ArrayLists. This saves roughly
12049 212kb on my machine.
12051 (Method): Implement the new IIteratorContainer interface.
12052 (Method.SetYields): Implement the method by setting the ModFlags
12053 to contain METHOD_YIELDS.
12055 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12056 which just got set to null.
12058 * iterators.cs: New file.
12060 (Yield, YieldBreak): New statements.
12062 * statement.cs (Return.Resolve): Flag an error if we are used in
12063 an iterator method.
12065 * codegen.cs (InIterator): New flag set if the code is being
12066 compiled in an iterator method.
12068 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12069 internal modifier, and we just use it to avoid adding extra
12070 fields, as this is seldom used.
12072 * cs-parser.jay: Add yield_statement (yield and yield break).
12074 * driver.cs: New flag -v2 to turn on version 2 features.
12076 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12077 hashtable when v2 is enabled.
12079 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12081 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12082 there is already a namespace defined with this name.
12084 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12085 people upgraded their corlibs.
12087 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12088 always use fully qualified types, no need to use the compiler
12091 (TypeManager.IsNamespace): Use binarysearch.
12093 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12094 AddDelegate): I did not quite use the new IsValid API properly: I
12095 have to pass the short-name and the fullname. I was passing only
12096 the basename instead of the fullname sometimes.
12098 (TypeContainer.DefineType): call NamespaceClash.
12100 * interface.cs (Interface.DefineType): use NamespaceClash before
12103 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12106 * enum.cs: (Enum.DefineType): use NamespaceClash before
12109 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12110 speed increase. First, use the negative_hits cache when we get a
12111 negative. Second, add the type with its full original name
12112 instead of the new . and + encoded name (reflection uses + to
12113 separate type from a nested type). Use LookupTypeReflection
12114 directly which bypasses the type->name hashtable (that we already
12115 know does not contain the type.
12117 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12118 location/container type.
12120 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12122 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12124 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12126 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12127 method is being referenced in the method group from a static
12128 context, and report error 120 if so.
12130 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12133 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12134 is created, we create the A namespace).
12136 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12139 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12141 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12142 invocation to ModuleBuilder.GetType with the same values will
12143 return a new type instance, so we need to cache its return
12146 * expression.cs (Binary.ResolveOperator): Only allow the compare
12147 operators on enums if they are of the same type.
12149 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12150 types of ValueType on their own case. Before we were giving them
12151 the same treatment as objects.
12153 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12154 fullname. Short name is used to compare against container name.
12155 Fullname is used to check against defined namespace names.
12157 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12158 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12160 (Method.CheckBase): Call parent.
12161 (MemberBase.CheckBase): Check for protected members on sealed
12163 (PropertyBase.CheckBase): Call parent.
12164 (Field.Define): Call parent.
12166 * report.cs: Negative error codes are now mapped to 8000 - code,
12167 so that the display is render more nicely.
12169 * typemanager.cs: Do not use try/catch, instead report a regular
12172 (GetPointerType, GetReferenceType): These methods provide
12173 mechanisms to obtain the T* and T& from a T. We had the code
12174 previously scattered around the code base, and it also used
12175 TypeManager.LookupType that would go through plenty of caches.
12176 This one goes directly to the type source.
12178 In some places we did the Type.GetType followed by
12179 ModuleBuilder.GetType, but not in others, so this unifies the
12180 processing as well.
12182 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12183 statements now that we have namespace information.
12185 * typemanager.cs (IsNamespace): New method, returns whether the
12186 string presented is a namespace or not.
12188 (ComputeNamespaces): New public entry point, computes the list of
12189 available namespaces, using the GetNamespaces API call in Mono, or
12190 the slower version in MS.NET.
12192 Now before we start the semantic analysis phase, we have a
12193 complete list of namespaces including everything that the user has
12196 Deleted old code to cache namespaces in .nsc files.
12198 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12200 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12201 class/struct location definition Location for the implicit
12202 constructor location.
12204 (Operator.Define): Use the location of the operator for the
12205 implicit Method definition.
12207 (Constructor.Emit): use the constructor location for the implicit
12208 base initializer constructor.
12210 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12211 and the Expression class now contains two new methods:
12213 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12214 isolate type lookup from the rest of the resolution process.
12216 Since we use Expressions to hold type definitions due to the way
12217 we parse the input we have historically overloaded Resolve to
12218 perform the Type lookups if a special flag is passed. Now this is
12219 eliminated and two methods take their place.
12221 The differences in the two methods between xStep and xTerminal is
12222 that xStep is involved in our current lookup system that uses
12223 SimpleNames to compose a name, while xTerminal is used just to
12224 catch the case where the simplename lookup failed.
12226 2003-04-16 Miguel de Icaza <miguel@ximian.com>
12228 * expression.cs (ResolveMemberAccess): Remove redundant code.
12229 TypeExpr expressions are always born fully resolved.
12231 * interface.cs (PopulateMethod): Do not lookup the types twice.
12232 We were doing it once during SemanticAnalysis and once during
12235 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12236 in local variable type definitions, were being returned as a
12237 SimpleName (we decomposed everything into a string), that is
12238 because primary_expression was being used instead of a type in the
12239 grammar (reduce/reduce conflicts).
12241 The part that was wrong is that we converted the expression into a
12242 string (an oversimplification in one hand, compounded with primary
12243 expressions doing string concatenation).
12249 Would return "A.B.C[]" as a SimpleName. This stopped things like
12250 using clauses from working on this particular context. And a type
12251 was being matched directly against "A.B.C[]".
12253 We now use the correct approach, and allow for ComposedCast to be
12254 part of the unary expression. So the "A.B.C []" become a composed
12255 cast of "A.B.C" (as a nested group of MemberAccess with a
12256 SimpleName at the end) plus the rank composition "[]".
12260 2003-04-10 Miguel de Icaza <miguel@ximian.com>
12262 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12263 for the access level checking.
12265 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
12266 `TypeContainer container', because I kept getting confused when I
12267 was debugging this code.
12269 * expression.cs (Indexers): Instead of tracking getters/setters,
12270 we now track them in parallel. We create one arraylist less, but
12271 most importantly it is possible now for the LValue code to find a
12272 matching get for a set.
12274 (IndexerAccess.DoResolveLValue): Update the code.
12275 GetIndexersForType has been modified already to extract all the
12276 indexers from a type. The code assumed it did not.
12278 Also make the code set the correct return type for the indexer.
12279 This was fixed a long time ago for properties, but was missing for
12280 indexers. It used to be void_type.
12282 (Binary.Emit): Test first for doubles instead of
12283 floats, as they are more common.
12285 (Binary.EmitBranchable): Use the .un version of the branch opcodes
12286 when dealing with floats and the <=, >= operators. This fixes bug
12289 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12290 to load the array value by emitting a load on the foreach variable
12291 type. This was incorrect.
12293 We now emit the code to load an element using the the array
12294 variable type, and then we emit the conversion operator.
12298 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
12300 * attribute.cs: Avoid allocation of ArrayLists in the common case.
12302 2003-04-09 Miguel de Icaza <miguel@ximian.com>
12304 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12305 test for protection before we test for signatures.
12307 (MethodSignature.ToString): implement.
12309 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12310 to the case where we reduced into a LongConstant.
12312 * decl.cs (CheckAccessLevel): If the type is an array, we can not
12313 depend on whether the information is acurrate, because the
12314 Microsoft runtime will always claim that the array type is public,
12315 regardless of the real state.
12317 If the type is a pointer, another problem happens: the type is
12318 reported as non-public in Microsoft.
12320 In both cases we have to call CheckAccessLevel recursively with
12321 the underlying type as the argument to be tested.
12323 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12325 * assign.cs (Assign.Emit): If we are dealing with a compound
12326 assignment expression, we should use the code path that stores the
12327 intermediate result in a temporary value. This fixes #40903.
12329 *expression.cs (Indirection.ToString): Provide ToString method for
12332 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12334 * class.cs: Null out fields holding references to Block objects so
12335 they can be garbage collected.
12337 * expression.cs (OverloadResolve): Remove unused local.
12339 2003-04-07 Martin Baulig <martin@ximian.com>
12341 * codegen.cs (EmitContext.CurrentFile): New public field.
12342 (EmitContext.Mark): Use the CurrentFile to check whether the
12343 location is in the correct file.
12344 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12346 2003-04-07 Martin Baulig <martin@ximian.com>
12348 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12350 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12351 location. [FIXME: The location argument which gets passed to this
12352 method is sometimes wrong!]
12354 2003-04-07 Nick Drochak <ndrochak@gol.com>
12356 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12358 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12360 * expression.cs (Indirection.EmitAssign): We were using the
12361 temporary, but returning immediately instead of continuing the
12364 2003-04-06 Martin Baulig <martin@ximian.com>
12366 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12367 if it's a nested child, but also deriving from the outer class.
12370 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12371 nested child, but also deriving from the outer class. See
12373 (FilterWithClosure): We may access private members of the outer
12374 class if we're a nested child and deriving from the outer class.
12375 (RealMemberLookup): Only set `closure_private_ok' if the
12376 `original_bf' contained BindingFlags.NonPublic.
12378 2003-04-05 Martin Baulig <martin@ximian.com>
12380 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
12381 probe if its a type parameter, and if so, flag an error.
12383 * decl.cs: Move here the SetParameterInfo code from class.cs.
12384 Handle IsGeneric here.
12386 Handle a variety of errors in the parameter info definition.
12388 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
12389 type parameters here.
12391 * cs-parser.jay (class_declaration): report errors for parameters
12394 2003-01-21 Miguel de Icaza <miguel@ximian.com>
12396 * generic.cs: New file, contains support code for generics.
12398 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
12399 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
12401 Update parser for the above removals.
12403 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
12404 now taken care of in the parser.
12406 2003-04-02 Miguel de Icaza <miguel@ximian.com>
12408 * class.cs (Event.Define): Do not allow abstract events to have
12411 2003-04-01 Miguel de Icaza <miguel@ximian.com>
12413 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12414 block in event declarations.
12416 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12417 value type, get its address.
12419 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12420 leaving a class on the stack instead of a boolean value (int
12421 0/1). Change the code so we compare against null, and then the
12422 result against zero.
12424 * class.cs (TypeContainer.GetClassBases): We were checking for the
12425 parent class being sealed too late.
12427 * expression.cs (Binary.Emit): For <= and >= when dealing with
12428 floating point values, use cgt.un and clt.un instead of cgt and
12431 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
12433 * statement.cs: Apply the same optimization as MS: skip the
12434 GetEnumerator returning an IEnumerator, and use the one returning a
12435 CharEnumerator instead. This allows us to avoid the try-finally block
12438 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
12440 * cs-parser.jay: Attributes cannot be applied to
12441 namespaces. Fixes #40473
12443 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12446 (Add*): check if the name is valid using the full name for constants,
12447 fields, properties and events.
12449 2003-03-28 Miguel de Icaza <miguel@ximian.com>
12451 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12452 char constants to be part of the enumeration.
12454 * expression.cs (Conditional.DoResolve): Add support for operator
12455 true. Implements the missing functionality from 14.12
12457 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12458 operator true/false as required by the spec.
12460 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12461 implicit conversion to boolean.
12463 * statement.cs (Statement.ResolveBoolean): A boolean expression is
12464 also one where the type implements `operator true'.
12466 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12467 get an expression that will invoke operator true based on an
12470 (GetConversionOperators): Removed the hack that called op_True
12473 (Expression.ResolveBoolean): Move this from Statement.
12475 2003-03-17 Miguel de Icaza <miguel@ximian.com>
12477 * ecore.cs (FieldExpr): do not allow initialization of initonly
12478 fields on derived classes
12480 2003-03-13 Martin Baulig <martin@ximian.com>
12482 * statement.cs (Block.Emit): Call ig.BeginScope() and
12483 ig.EndScope() when compiling with debugging info; call
12484 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12486 2003-03-08 Miguel de Icaza <miguel@ximian.com>
12488 * expression.cs (Indexers): Do not construct immediately, allow
12489 for new members to be appended as we go. Fixes 38143
12491 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12493 * expression.cs: save/restore context when resolving an unchecked
12496 2003-03-05 Miguel de Icaza <miguel@ximian.com>
12498 * cfold.cs: Catch division by zero in modulus operator during
12501 2003-03-03 Miguel de Icaza <miguel@ximian.com>
12503 * interface.cs (Interface.DefineMembers): Avoid defining members
12506 2003-02-27 Miguel de Icaza <miguel@ximian.com>
12508 * driver.cs: handle the +/- options for -noconfig
12510 * statement.cs (Unckeched.Resolve): Also track the state of
12511 unchecked in the Resolve phase.
12513 2003-02-27 Martin Baulig <martin@ximian.com>
12515 * ecore.cs (Expression.MemberLookup): Don't create a
12516 MethodGroupExpr for something which is not a method. Fixes #38291.
12518 2003-02-25 Miguel de Icaza <miguel@ximian.com>
12520 * class.cs (MemberBase.CheckParameters): Also check that the type
12521 is unmanaged if it is a pointer.
12523 * expression.cs (SizeOf.Resolve): Add location information.
12525 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12526 a managed type is declared.
12528 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12529 parameter modifiers as well. Fixes bug 38606
12531 * class.cs: Very sad. Am backing out the speed up changes
12532 introduced by the ArrayList -> Array in the TypeContainer, as they
12533 were not actually that much faster, and introduced a bug (no error
12534 reports on duplicated methods).
12536 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12537 source first, this will guarantee that we have a valid expression
12538 before calling in lower levels functions that will require a
12539 resolved object. Then use this original_source in the
12540 target.ResolveLValue instead of the original source that was
12543 Another change. Use target.Resolve instead of LValueResolve.
12544 Although we are resolving for LValues, we will let the Assign code
12545 take care of that (it will be called again from Resolve). This
12546 basically allows code like this:
12548 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12549 class Y { void A (X x) { x [0] += o; }
12551 The problem was that the indexer was trying to resolve for
12552 set_Item (idx, object o) and never finding one. The real set_Item
12553 was set_Item (idx, X). By delaying the process we get the right
12558 2003-02-23 Martin Baulig <martin@ximian.com>
12560 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12561 while calling DoEmit ().
12563 * codegen.cs (EmitContext.Mark): Don't mark locations in other
12564 source files; if you use the #line directive inside a method, the
12565 compiler stops emitting line numbers for the debugger until it
12566 reaches the end of the method or another #line directive which
12567 restores the original file.
12569 2003-02-23 Martin Baulig <martin@ximian.com>
12571 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12573 2003-02-23 Martin Baulig <martin@ximian.com>
12575 * statement.cs (Block.AddChildVariableNames): We need to call this
12576 recursively, not just for our immediate children.
12578 2003-02-23 Martin Baulig <martin@ximian.com>
12580 * class.cs (Event.Define): Always make the field private, like csc does.
12582 * typemanager.cs (TypeManager.RealMemberLookup): Make events
12583 actually work, fixes bug #37521.
12585 2003-02-23 Miguel de Icaza <miguel@ximian.com>
12587 * delegate.cs: When creating the various temporary "Parameters"
12588 classes, make sure that we call the ComputeAndDefineParameterTypes
12589 on those new parameters (just like we do with the formal ones), to
12590 allow them to be resolved in the context of the DeclSpace.
12592 This fixes the bug that Dick observed in Bugzilla #38530.
12594 2003-02-22 Miguel de Icaza <miguel@ximian.com>
12596 * expression.cs (ResolveMemberAccess): When resolving a constant,
12597 do not attempt to pull a constant if the value was not able to
12598 generate a valid constant.
12600 * const.cs (LookupConstantValue): Do not report more errors than required.
12602 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12604 * expression.cs: fixes bug #38328.
12606 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12608 * class.cs: Changed all the various members that can be part of a
12609 class from being an ArrayList to be an Array of the right type.
12610 During the DefineType type_list, interface_list, delegate_list and
12611 enum_list are turned into types, interfaces, delegates and enums
12614 And during the member population, indexer_list, event_list,
12615 constant_list, field_list, instance_constructor_list, method_list,
12616 operator_list and property_list are turned into their real arrays.
12618 Although we could probably perform this operation earlier, for
12619 good error reporting we need to keep the lists and remove the
12620 lists for longer than required.
12622 This optimization was triggered by Paolo profiling the compiler
12623 speed on the output of `gen-sample-program.pl' perl script.
12625 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12626 not crash in methods like MemberLookupFailed that use this field.
12628 This problem arises when the compiler fails to resolve a type
12629 during interface type definition for example.
12631 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12633 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12634 inherit from System.Object, so we have to stop at null, not only
12635 when reaching System.Object.
12637 2003-02-17 Miguel de Icaza <miguel@ximian.com>
12639 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12640 DeclaredOnly because the parent indexer might have had a different
12641 name, but did not loop until the top of the hierarchy was reached.
12643 The problem this one fixes is 35492: when a class implemented an
12644 indexer from an interface, we were getting the interface method
12645 (which was abstract) and we were flagging an error (can not invoke
12648 This also keeps bug 33089 functioning, and test-148 functioning.
12650 * typemanager.cs (IsSpecialMethod): The correct way of figuring
12651 out if a method is special is to see if it is declared in a
12652 property or event, or whether it is one of the predefined operator
12653 names. This should fix correctly #36804.
12655 2003-02-15 Miguel de Icaza <miguel@ximian.com>
12657 The goal here is to remove the dependency on EmptyCast.Peel ().
12658 Killing it completely.
12660 The problem is that currently in a number of places where
12661 constants are expected, we have to "probe" for an EmptyCast, and
12662 Peel, which is not the correct thing to do, as this will be
12663 repetitive and will likely lead to errors.
12665 The idea is to remove any EmptyCasts that are used in casts that
12666 can be reduced to constants, so we only have to cope with
12669 This bug hunt was triggered by Bug 37363 and the desire to remove
12670 the duplicate pattern where we were "peeling" emptycasts to check
12671 whether they were constants. Now constants will always be
12674 * ecore.cs: Use an enumconstant here instead of wrapping with
12677 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12678 throwing me off. By handling this we can get rid of a few hacks.
12680 * statement.cs (Switch): Removed Peel() code.
12682 2003-02-14 Miguel de Icaza <miguel@ximian.com>
12684 * class.cs: Location information for error 508
12686 * expression.cs (New.DoResolve): Add a guard against double
12687 resolution of an expression.
12689 The New DoResolve might be called twice when initializing field
12690 expressions (see EmitFieldInitializers, the call to
12691 GetInitializerExpression will perform a resolve on the expression,
12692 and later the assign will trigger another resolution
12694 This leads to bugs (#37014)
12696 * delegate.cs: The signature for EndInvoke should contain any ref
12697 or out parameters as well. We were not doing this in the past.
12699 * class.cs (Field.Define): Do not overwrite the type definition
12700 inside the `volatile' group. Turns out that volatile enumerations
12701 were changing the type here to perform a validity test, which
12704 2003-02-12 Miguel de Icaza <miguel@ximian.com>
12706 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12707 and structs, we do not want to load the instance variable
12709 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12710 enum_type has to be handled like an object reference (implicit
12711 conversions exists from this to object), but the regular IsClass
12712 and IsValueType tests will never return true for this one.
12714 Also we use TypeManager.IsValueType instead of type.IsValueType,
12715 just for consistency with the rest of the code (this is only
12716 needed if we ever use the construct exposed by test-180.cs inside
12717 corlib, which we dont today).
12719 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
12721 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12724 2003-02-09 Martin Baulig <martin@ximian.com>
12726 * namespace.cs (Namespace..ctor): Added SourceFile argument.
12727 (Namespace.DefineNamespaces): New static public method; this is
12728 called when we're compiling with debugging to add all namespaces
12729 to the symbol file.
12731 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12732 pass it to the Namespace's .ctor.
12734 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12735 and MethodBase arguments; pass the namespace ID to the symwriter;
12736 pass the MethodBase instead of the token to the symwriter.
12737 (SymbolWriter.DefineNamespace): New method to add a namespace to
12740 2003-02-09 Martin Baulig <martin@ximian.com>
12742 * symbolwriter.cs: New file. This is a wrapper around
12743 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
12744 methods here in near future.
12746 2003-02-09 Martin Baulig <martin@ximian.com>
12748 * codegen.cs (EmitContext.Mark): Just pass the arguments to
12749 ILGenerator.MarkSequencePoint() which are actually used by the
12752 2003-02-09 Martin Baulig <martin@ximian.com>
12754 * location.cs (SourceFile): New public sealed class. This
12755 contains the name and an index which is used in the location's token.
12756 (Location): Reserve an appropriate number of bits in the token for
12757 the source file instead of walking over that list, this gives us a
12758 really huge performance improvement when compiling with debugging.
12760 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12761 `SourceFile' argument instead of a string.
12762 (Driver.ProcessFile): Add all the files via Location.AddFile(),
12763 but don't parse/tokenize here, we need to generate the list of all
12764 source files before we do that.
12765 (Driver.ProcessFiles): New static function. Parses/tokenizes all
12768 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12769 instead of a string.
12771 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12774 2003-02-09 Martin Baulig <martin@ximian.com>
12776 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12777 filename on `#line default'.
12779 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12781 * statement.cs: don't clear the pinned var when the fixed statement
12782 returns from the method (fixes bug#37752).
12784 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12786 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
12789 2003-02-07 Martin Baulig <martin@ximian.com>
12791 * driver.cs: Removed the `--debug-args' command line argument.
12793 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12794 automatically by the AsssemblyBuilder.
12795 (CodeGen.InitializeSymbolWriter): We don't need to call any
12796 initialization function on the symbol writer anymore. This method
12797 doesn't take any arguments.
12799 2003-02-03 Miguel de Icaza <miguel@ximian.com>
12801 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12802 from referenced assemblies as well.
12804 2003-02-02 Martin Baulig <martin@ximian.com>
12806 * class.cs (MethodData.Emit): Generate debugging info for external methods.
12808 2003-02-02 Martin Baulig <martin@ximian.com>
12810 * class.cs (Constructor.Emit): Open the symbol writer before
12811 emitting the constructor initializer.
12812 (ConstructorInitializer.Emit): Call ec.Mark() to allow
12813 single-stepping through constructor initializers.
12815 2003-01-30 Miguel de Icaza <miguel@ximian.com>
12817 * class.cs: Handle error 549: do not allow virtual methods in
12820 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12822 * decl.cs: Check access levels when resolving types
12824 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12826 * statement.cs: Add parameters and locals set in catch blocks that might
12827 return to set vector
12829 2003-01-29 Miguel de Icaza <miguel@ximian.com>
12831 * class.cs (Operator): Set the SpecialName flags for operators.
12833 * expression.cs (Invocation.DoResolve): Only block calls to
12834 accessors and operators on SpecialName methods.
12836 (Cast.TryReduce): Handle conversions from char constants.
12839 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12841 * statement.cs: small memory and time optimization in FlowBranching.
12843 2003-01-28 Pedro Mart <yoros@wanadoo.es>
12845 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12846 problem that the last fix but in the other sid (Set).
12848 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12849 access when there is no indexer in the hierarchy.
12851 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12853 * class.cs: Combine some if statements.
12855 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12857 * driver.cs: fixed bug #37187.
12859 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
12861 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12862 any indexer, it's needed to build a list with all the indexers in the
12863 hierarchy (AllGetters), else we have problems. Fixes #35653.
12865 2003-01-23 Miguel de Icaza <miguel@ximian.com>
12867 * class.cs (MethodData.Define): It is wrong for an interface
12868 implementation to be static in both cases: explicit and implicit.
12869 We were only handling this in one case.
12871 Improve the if situation there to not have negations.
12873 * class.cs (Field.Define): Turns out that we do not need to check
12874 the unsafe bit on field definition, only on usage. Remove the test.
12876 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12878 * driver.cs: use assembly.Location instead of Codebase (the latest
12879 patch made mcs fail when using MS assemblies).
12881 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
12883 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12884 get the path to *corlib.dll.
12886 2003-01-21 Nick Drochak <ndrochak@gol.com>
12890 * typemanager.cs: Remove compiler warnings
12892 2003-01-20 Duncan Mak <duncan@ximian.com>
12894 * AssemblyInfo.cs: Bump the version number to 0.19.
12896 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12898 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12900 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
12902 * class.cs (Constructor::Emit): Emit debugging info for constructors.
12904 2003-01-17 Miguel de Icaza <miguel@ximian.com>
12906 * cs-parser.jay: Small fix: we were not comparing the constructor
12907 name correctly. Thanks to Zoltan for the initial pointer.
12909 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12911 * cs-tokenizer.cs: Set file name when specified with #line
12913 2003-01-15 Miguel de Icaza <miguel@ximian.com>
12915 * cs-parser.jay: Only perform the constructor checks here if we
12916 are named like the class; This will help provider a better
12917 error. The constructor path is taken when a type definition is
12918 not found, but most likely the user forgot to add the type, so
12919 report that rather than the constructor error.
12921 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12923 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12926 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12928 * cs-parser.jay: Add cleanup call.
12930 2003-01-13 Duncan Mak <duncan@ximian.com>
12932 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12933 consistent with other methods.
12935 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12937 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12939 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12941 * attribute.cs: only set GuidAttr to true when we have a
12944 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12948 * typemanager.cs: fixes to allow mcs compile corlib with the new
12949 Type.IsSubclassOf fix.
12951 2003-01-08 Miguel de Icaza <miguel@ximian.com>
12953 * expression.cs (LocalVariableReference.DoResolve): Classify a
12954 constant as a value, not as a variable. Also, set the type for
12957 * cs-parser.jay (fixed_statement): take a type instead of a
12958 pointer_type, so we can produce a better error message later.
12960 * statement.cs (Fixed.Resolve): Flag types that are not pointers
12963 (For.DoEmit): Make inifinite loops have a
12964 non-conditional branch back.
12966 (Fixed.DoEmit): First populate the pinned variables, then emit the
12967 statement, then clear the variables. Before I was emitting the
12968 code once for each fixed piece.
12971 2003-01-08 Martin Baulig <martin@ximian.com>
12973 * statement.cs (FlowBranching.MergeChild): A break in a
12974 SWITCH_SECTION does not leave a loop. Fixes #36155.
12976 2003-01-08 Martin Baulig <martin@ximian.com>
12978 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12979 lives in the same number space than `param_map'. Fixes #36154.
12981 2003-01-07 Miguel de Icaza <miguel@ximian.com>
12983 * cs-parser.jay (constructor_declaration): Set the
12984 Constructor.ModFlags before probing for it. This makes the
12985 compiler report 514, 515 and 132 (the code was there, but got
12988 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12989 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12990 (GotoCase.Resolve): Set `Returns' to ALWAYS.
12992 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12994 * enum.cs: create the enum static fields using the enum type.
12996 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12998 * class.cs: don't try to create the ParamBuilder for the return
12999 type if it's not needed (and handle it breaking for the ms runtime
13002 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13004 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13006 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13008 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13009 the command. This showed up while compiling the JANET source
13010 code, which used \r as its only newline separator.
13012 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13014 * class.cs (Method.Define): If we are an operator (because it
13015 reuses our code), then set the SpecialName and HideBySig. #36128
13017 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13019 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13020 exception, report error 120 `object reference required'.
13022 * driver.cs: Add --pause option, used during to measure the size
13023 of the process as it goes with --timestamp.
13025 * expression.cs (Invocation.DoResolve): Do not allow methods with
13026 SpecialName to be invoked.
13028 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13030 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13031 number before adding it.
13033 2002-12-21 Ravi Pratap <ravi@ximian.com>
13035 * ecore.cs (StandardImplicitConversion): When in an unsafe
13036 context, we allow conversion between void * to any other pointer
13037 type. This fixes bug #35973.
13039 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13041 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13042 is not thrown when extensionless outputs are used
13044 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13046 * rootcontext.cs: fixed compilation of corlib.
13048 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13050 * attribute.cs (Attributes.Contains): Add new method.
13052 * class.cs (MethodCore.LabelParameters): if the parameter is an
13053 `out' parameter, check that no attribute `[In]' has been passed.
13055 * enum.cs: Handle the `value__' name in an enumeration.
13057 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13059 * decl.cs: Added special case to allow overrides on "protected
13062 2002-12-18 Ravi Pratap <ravi@ximian.com>
13064 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13065 since it makes much more sense.
13067 (Attributes.ctor): Don't require a Location parameter.
13069 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13071 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13072 since we already have that information per attribute.
13074 * everywhere : make appropriate changes.
13076 * class.cs (LabelParameters): Write the code which actually
13077 applies attributes to the return type. We can't do this on the MS
13078 .NET runtime so we flag a warning in the case an exception is
13081 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13083 * const.cs: Handle implicit null conversions here too.
13085 2002-12-17 Ravi Pratap <ravi@ximian.com>
13087 * class.cs (MethodCore.LabelParameters): Remove the extra
13088 Type [] parameter since it is completely unnecessary. Instead
13089 pass in the method's attributes so that we can extract
13090 the "return" attribute.
13092 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13094 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13095 of ignoring it and letting the compile continue.
13097 * typemanager.cs (ChangeType): use an extra argument to return an
13098 error condition instead of throwing an exception.
13100 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13102 * expression.cs (Unary.TryReduce): mimic the code for the regular
13103 code path. Perform an implicit cast in the cases where we can
13104 implicitly convert to one of the integral types, and then reduce
13105 based on that constant. This fixes bug #35483.
13107 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13109 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13111 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13113 * namespace.cs: fixed bug #35489.
13115 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13117 * class.cs: Remove some dead code.
13119 * cs-parser.jay: Estimate the number of methods needed
13120 (RootContext.MethodCount);
13122 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13123 numbers instead of StringBuilders.
13125 * support.cs (PtrHashtable): Add constructor with initial size;
13126 We can now reduce reallocations of the method table.
13128 2002-12-10 Ravi Pratap <ravi@ximian.com>
13130 * attribute.cs (ApplyAttributes): Keep track of the emitted
13131 attributes on a per-target basis. This fixes bug #35413.
13133 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13135 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13136 default to the Windows 1252 encoding.
13138 (UnixParseOption): Support version, thanks to Alp for the missing
13141 * AssemblyInfo.cs: Add nice assembly information.
13143 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13146 * cs-parser.jay: Allow a trailing comma before the close bracked
13147 in the attribute_section production.
13149 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13150 address of the instance was being taken, I will take this out,
13151 because we take the address of the object immediately here.
13153 2002-12-09 Ravi Pratap <ravi@ximian.com>
13155 * typemanager.cs (AreMultipleAllowed): Take care of the most
13156 obvious case where attribute type is not in the current assembly -
13159 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13161 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13162 definitions, instead of doing that afterwards.
13164 Also we use a nice little hack, depending on the constructor, we
13165 know if we are a "composed" name or a simple name. Hence, we
13166 avoid the IndexOf test, and we avoid
13168 * codegen.cs: Add code to assist in a bug reporter to track down
13169 the source of a compiler crash.
13171 2002-12-07 Ravi Pratap <ravi@ximian.com>
13173 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13174 types have been emitted for a given element and flag an error
13175 if something which does not have AllowMultiple set is used more
13178 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13179 attribute types and their corresponding AllowMultiple properties
13181 (AreMultipleAllowed): Check the property for a given type.
13183 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13184 property in the case we have a TypeContainer.
13186 (Attributes.AddAttribute): Detect duplicates and just skip on
13187 adding them. This trivial fix catches a pretty gross error in our
13188 attribute emission - global attributes were being emitted twice!
13190 Bugzilla bug #33187 is now fixed.
13192 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13194 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13195 instead of pp_and).
13197 * expression.cs (Binary.ResolveOperator): I can only use the
13198 Concat (string, string, string) and Concat (string, string,
13199 string, string) if the child is actually a concatenation of
13202 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13204 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13205 context where we need a 2-character lookahead.
13207 * pending.cs (PendingImplementation): Rework so we can keep track
13208 of interface types all the time, and flag those which were
13209 implemented by parents as optional.
13211 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13213 * expression.cs (Binary.ResolveOperator): Use
13214 String.Concat(string,string,string) or
13215 String.Concat(string,string,string,string) when possible.
13217 * typemanager: More helper methods.
13220 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13222 * pending.cs: remove the bogus return from GetMissingInterfaces()
13223 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13225 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13227 * namespace.cs: avoid duplicated 'using xxx' being added to
13228 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13229 when we get more than one 'using' statement for the same namespace.
13230 Report a CS0105 warning for it.
13232 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13234 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13235 of calling getChar/putback, uses internal knowledge of it.
13237 (xtoken): Reorder tokenizer so most common patterns are checked
13238 first. This reduces the compilation time in another 5% (from 8.11s
13239 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13241 The parsing time is 22% of the compilation in mcs, and from that
13242 64% is spent on the tokenization process.
13244 I tried using a binary search for keywords, but this is slower
13245 than the hashtable. Another option would be to do a couple of
13248 * Not use a StringBuilder, instead use an array of chars,
13249 with a set value. Notice that this way we could catch
13250 the 645 error without having to do it *afterwards*.
13252 * We could write a hand-parser to avoid the hashtable
13253 compares altogether.
13255 The identifier consumption process takes 37% of the tokenization
13256 time. Another 15% is spent on is_number. 56% of the time spent
13257 on is_number is spent on Int64.Parse:
13259 * We could probably choose based on the string length to
13260 use Int32.Parse or Int64.Parse and avoid all the 64-bit
13263 Another 3% is spend on wrapping `xtoken' in the `token' function.
13265 Handle 0xa0 as whitespace (#34752)
13267 2002-11-26 Miguel de Icaza <miguel@ximian.com>
13269 * typemanager.cs (IsCLRType): New routine to tell whether a type
13270 is one of the builtin types.
13272 Maybe it needs to use TypeCodes to be faster. Maybe we could use
13273 typecode in more places instead of doing pointer comparissions.
13274 We could leverage some knowledge about the way the typecodes are
13277 New code to cache namespaces in assemblies, it is currently not
13278 invoked, to be used soon.
13280 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13282 * expression.cs (Binary.ResolveOperator): specially handle
13283 strings, and do not perform user-defined operator overloading for
13286 2002-11-24 Miguel de Icaza <miguel@ximian.com>
13288 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13289 internalcall as it is a pretty simple operation; Avoid whenever
13290 possible to call Char.IsLetter.
13292 (consume_identifier): Cut by half the number of
13293 hashtable calls by merging the is_keyword and GetKeyword behavior.
13295 Do not short-circuit, because if we do, we
13296 report errors (ie, #if false && true would produce an invalid
13300 2002-11-24 Martin Baulig <martin@ximian.com>
13302 * expression.cs (Cast.TryReduce): If we're in checked syntax,
13303 check constant ranges and report a CS0221. Fixes #33186.
13305 2002-11-24 Martin Baulig <martin@ximian.com>
13307 * cs-parser.jay: Make this work for uninitialized variable
13308 declarations in the `for' initializer. Fixes #32416.
13310 2002-11-24 Martin Baulig <martin@ximian.com>
13312 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13313 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
13315 2002-11-24 Martin Baulig <martin@ximian.com>
13317 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13318 argument; if true, we also check for user-defined conversions.
13319 This is only needed if both arguments are of a user-defined type.
13320 Fixes #30443, added test-175.cs.
13321 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13323 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13325 2002-11-24 Martin Baulig <martin@ximian.com>
13327 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13328 function to get the store opcode.
13329 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13330 only emit the Ldelema if the store opcode is Stobj. You must run
13331 both test-34 and test-167 to test this. Fixes #34529.
13333 2002-11-23 Martin Baulig <martin@ximian.com>
13335 * ecore.cs (Expression.MemberLookup): Added additional
13336 `qualifier_type' argument which is used when we're being called
13337 from MemberAccess.DoResolve() and null if we're called from a
13339 (Expression.MemberLookupFailed): New method to report errors; this
13340 does the CS1540 check and reports the correct error message.
13342 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13343 argument for the CS1540 check and redone the way how we're dealing
13344 with private members. See the comment in the source code for details.
13345 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13346 `closure_start_type' to `closure_qualifier_type' and check whether
13347 it's not null. It was not this filter being broken, it was just
13348 being called with the wrong arguments.
13350 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13351 and pass it the correct `qualifier_type'; this also does the error
13354 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13356 * expression.cs (Invocation.EmitParams): If the we are dealing
13357 with a non-built-in value type, load its address as well.
13359 (ArrayCreation): Use a a pretty constant instead
13360 of the hardcoded value 2. Use 6 instead of 2 for the number of
13361 static initializers.
13363 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13364 because they are not really value types, just glorified integers.
13366 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13368 * ecore.cs: Remove redundant code for enumerations, make them use
13369 the same code path as everything else, fixes the casting issue
13370 with enumerations in Windows.Forms.
13372 * attribute.cs: Do only cast to string if it is a string, the
13373 validation happens later.
13375 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13376 people upgrade their corlibs.
13378 * ecore.cs: Oops, enumerations were not following the entire code path
13380 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13382 * typemanager.cs (FilterWithClosure): Commented out the test for
13383 1540 in typemanager.cs, as it has problems when accessing
13384 protected methods from a parent class (see test-174.cs).
13386 * attribute.cs (Attribute.ValidateGuid): new method.
13387 (Attribute.Resolve): Use above.
13389 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13391 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13393 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13394 handling for enumerations, as we only needed the TypeContainer
13395 functionality to begin with (this is required for the fix below to
13396 work for enums that reference constants in a container class for
13399 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13401 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13402 a valid TypeBuilder to perform lookups on.o
13404 * class.cs (InheritableMemberSignatureCompare): Use true in the
13405 call to GetGetMethod and GetSetMethod, because we are comparing
13406 the signature, and we need to get the methods *even* if they are
13409 (PropertyBase.CheckBase): ditto.
13411 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13412 GotoCase.Resolve): Use Peel on EmpytCasts.
13414 * ecore.cs (EmptyCast): drop child, add Peel method.
13416 2002-11-17 Martin Baulig <martin@ximian.com>
13418 * ecore.cs (EmptyCast.Child): New public property.
13420 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13421 label resolved to an EmptyCast. Fixes #34162.
13422 (GotoCase.Resolve): Likewise.
13423 (Block.EmitMeta): Likewise.
13425 2002-11-17 Martin Baulig <martin@ximian.com>
13427 * expression.cs (Invocation.BetterConversion): Prefer int over
13428 uint; short over ushort; long over ulong for integer literals.
13429 Use ImplicitConversionExists instead of StandardConversionExists
13430 since we also need to check for user-defined implicit conversions.
13431 Fixes #34165. Added test-173.cs.
13433 2002-11-16 Martin Baulig <martin@ximian.com>
13435 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13436 with the `true' and `false' literals. Fixes #33151.
13438 2002-11-16 Martin Baulig <martin@ximian.com>
13440 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13441 October 22nd; don't do the cs1540 check for static members.
13443 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13444 now using our own filter here and doing the cs1540 check again.
13446 2002-11-16 Martin Baulig <martin@ximian.com>
13448 * support.cs (InternalParameters): Don't crash if we don't have
13449 any fixed parameters. Fixes #33532.
13451 2002-11-16 Martin Baulig <martin@ximian.com>
13453 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13454 when looking up static methods to make this work on Windows.
13457 2002-11-16 Martin Baulig <martin@ximian.com>
13459 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13460 a setter rather than using PropertyInfo.CanWrite.
13462 2002-11-15 Nick Drochak <ndrochak@gol.com>
13464 * class.cs: Allow acces to block member by subclasses. Fixes build
13467 2002-11-14 Martin Baulig <martin@ximian.com>
13469 * class.cs (Constructor.Emit): Added the extern/block check.
13472 2002-11-14 Martin Baulig <martin@ximian.com>
13474 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13475 iteration while looking for indexers, this is needed because the
13476 indexer may have a different name in our base classes. Fixed the
13477 error reporting (no indexers at all, not get accessor, no
13478 overloaded match). Fixes bug #33089.
13479 (IndexerAccess.DoResolveLValue): Likewise.
13481 2002-11-14 Martin Baulig <martin@ximian.com>
13483 * class.cs (PropertyBase.CheckBase): Make this work for multiple
13484 indexers. Fixes the first part of bug #33089.
13485 (MethodSignature.InheritableMemberSignatureCompare): Added support
13488 2002-11-13 Ravi Pratap <ravi@ximian.com>
13490 * attribute.cs (Attribute.Resolve): Catch the
13491 NullReferenceException and report it since it isn't supposed to
13494 2002-11-12 Miguel de Icaza <miguel@ximian.com>
13496 * expression.cs (Binary.EmitBranchable): Also handle the cases for
13497 LogicalOr and LogicalAnd that can benefit from recursively
13498 handling EmitBranchable. The code now should be nice for Paolo.
13500 2002-11-08 Miguel de Icaza <miguel@ximian.com>
13502 * typemanager.cs (LookupType): Added a negative-hit hashtable for
13503 the Type lookups, as we perform quite a number of lookups on
13504 non-Types. This can be removed once we can deterministically tell
13505 whether we have a type or a namespace in advance.
13507 But this might require special hacks from our corlib.
13511 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13512 and double which avoids a conversion from an integer to a double.
13514 * expression.cs: tiny optimization, avoid calling IsConstant,
13515 because it effectively performs the lookup twice.
13517 2002-11-06 Miguel de Icaza <miguel@ximian.com>
13519 But a bogus return here to keep the semantics of the old code
13520 until the Mono runtime is fixed.
13522 * pending.cs (GetMissingInterfaces): New method used to remove all
13523 the interfaces that are already implemented by our parent
13524 classes from the list of pending methods.
13526 * interface.cs: Add checks for calls after ResolveTypeExpr.
13528 2002-11-05 Miguel de Icaza <miguel@ximian.com>
13530 * class.cs (Class.Emit): Report warning 67: event not used if the
13531 warning level is beyond 3.
13533 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13534 being a NullLiteral.
13536 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13539 * class.cs (TypeContainer.GetClassBases): Cover a missing code
13540 path that might fail if a type can not be resolved.
13542 * expression.cs (Binary.Emit): Emit unsigned versions of the
13545 * driver.cs: use error 5.
13547 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13549 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13551 2002-11-01 Miguel de Icaza <miguel@ximian.com>
13553 * cs-parser.jay (switch_section): A beautiful patch from Martin
13554 Baulig that fixed 33094.
13556 2002-10-31 Miguel de Icaza <miguel@ximian.com>
13558 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13559 Check whether the base is abstract and report an error if so.
13561 * expression.cs (IndexerAccess.DoResolveLValue,
13562 IndexerAccess.DoResolve): ditto.
13564 (Invocation.DoResolve): ditto.
13566 (Invocation.FullMethodDesc): Improve the report string.
13568 * statement.cs (Block): Eliminate IsVariableDefined as it is
13569 basically just a wrapper for GetVariableInfo.
13571 * ecore.cs (SimpleName): Use new
13573 * support.cs (ReflectionParamter.ParameterType): We unwrap the
13574 type, as we return the actual parameter ref/unref state on a
13577 2002-10-30 Miguel de Icaza <miguel@ximian.com>
13579 * support.cs: Return proper flags REF/OUT fixing the previous
13582 * expression.cs: Reverted last patch, that was wrong. Is_ref is
13583 not used to mean `ref' but `ref or out' in ParameterReference
13585 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13586 full type signature instead of calling TypeManger.CSharpName
13589 * support.cs (InternalParameters.ParameterDesc): Do not compare
13590 directly to the modflags, because REF/OUT will actually be bitsets
13593 * delegate.cs (VerifyMethod): Check also the modifiers.
13595 * cs-tokenizer.cs: Fix bug where floating point values with an
13596 exponent where a sign was missing was ignored.
13598 * driver.cs: Allow multiple assemblies to be specified in a single
13601 2002-10-28 Miguel de Icaza <miguel@ximian.com>
13603 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
13604 because identifiers after a parenthesis would end up in this kind
13605 of production, and we needed to desamiguate it for having casts
13608 (UserDefinedType *) xxx
13610 2002-10-24 Miguel de Icaza <miguel@ximian.com>
13612 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13613 we should set on the Bindingflags.NonPublic, but not turn on
13614 private_ok. private_ok controls whether a Private member is
13615 returned (this is chekced on the filter routine), while the
13616 BindingFlags.NonPublic just controls whether private/protected
13617 will be allowed. This fixes the problem part of the problem of
13618 private properties being allowed to be used in derived classes.
13620 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13621 so we can call the children DoResolveLValue method (this will
13622 properly signal errors on lvalue assignments to base properties)
13624 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13625 getter are null, and we have a property info, we know that this
13626 happened because the lookup failed, so we report an error 122 for
13627 protection level violation.
13629 We also silently return if setter and getter are null in the
13630 resolve functions, this condition only happens if we have flagged
13631 the error before. This is the other half of the problem.
13633 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13634 not have accessibility information, that is why we were returning
13635 true in the filter function in typemanager.cs.
13637 To properly report 122 (property is inaccessible because of its
13638 protection level) correctly, we report this error in ResolveAccess
13639 by failing if both the setter and the getter are lacking (ie, the
13642 DoResolve and DoLResolve have been modified to check for both
13643 setter/getter being null and returning silently, the reason being
13644 that I did not want to put the knowledge about this error in upper
13647 int old = Report.Errors;
13648 x = new PropertyExpr (...);
13649 if (old != Report.Errors)
13654 So the property expr is returned, but it is invalid, so the error
13655 will be flagged during the resolve process.
13657 * class.cs: Remove InheritablePropertySignatureCompare from the
13658 class, as we no longer depend on the property signature to compute
13659 whether it is possible to implement a method or not.
13661 The reason is that calling PropertyInfo.GetGetMethod will return
13662 null (in .NET, in Mono it works, and we should change this), in
13663 cases where the Get Method does not exist in that particular
13668 class X { public virtual int A { get { return 1; } } }
13670 class Z : Y { public override int A { get { return 2; } } }
13672 Would fail in Z because the parent (Y) would not have the property
13673 defined. So we avoid this completely now (because the alternative
13674 fix was ugly and slow), and we now depend exclusively on the
13677 (PropertyBase.CheckBase): Use a method-base mechanism to find our
13678 reference method, instead of using the property.
13680 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13681 routines are gone now.
13683 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13684 names, they were incorrectly named.
13686 * cs-tokenizer.cs: Return are more gentle token on failure.
13688 * pending.cs (PendingImplementation.InterfaceMethod): This routine
13689 had an out-of-sync index variable, which caused it to remove from
13690 the list of pending methods the wrong method sometimes.
13692 2002-10-22 Miguel de Icaza <miguel@ximian.com>
13694 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13695 CanWrite, because those refer to this particular instance of the
13696 property, and do not take into account the fact that we can
13697 override single members of a property.
13699 Constructor requires an EmitContext. The resolution process does
13700 not happen here, but we need to compute the accessors before,
13701 because the resolution does not always happen for properties.
13703 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13704 subclass, before we did not update this flag, but we did update
13707 (GetAccessors): Drop this routine, as it did not work in the
13708 presence of partially overwritten set/get methods.
13710 Notice that this broke the cs1540 detection, but that will require
13713 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13717 * driver.cs: issue a warning instead of an error if we don't support
13718 debugging for the platform. Also ignore a couple of errors that may
13719 arise when trying to write the symbols. Undo my previous patch.
13721 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13723 * driver.cs: ignore /debug switch except for Unix platforms.
13725 2002-10-23 Nick Drochak <ndrochak@gol.com>
13727 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13729 2002-10-21 Miguel de Icaza <miguel@ximian.com>
13731 * driver.cs: Do not make mcs-debug conditional, so we do not break
13732 builds that use it.
13734 * statement.cs (UsageVector.MergeChildren): I would like Martin to
13735 review this patch. But basically after all the children variables
13736 have been merged, the value of "Breaks" was not being set to
13737 new_breaks for Switch blocks. I think that it should be set after
13738 it has executed. Currently I set this to the value of new_breaks,
13739 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13740 conservative, but I do not understand this code very well.
13742 I did not break anything in the build, so that is good ;-)
13744 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13746 2002-10-20 Mark Crichton <crichton@gimp.org>
13748 * cfold.cs: Fixed compile blocker. Really fixed it this time.
13750 2002-10-20 Nick Drochak <ndrochak@gol.com>
13752 * cfold.cs: Fixed compile blocker.
13754 2002-10-20 Miguel de Icaza <miguel@ximian.com>
13756 * driver.cs: I was chekcing the key, not the file.
13758 2002-10-19 Ravi Pratap <ravi@ximian.com>
13760 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13761 message that we were generating - we just need to silently return
13764 2002-10-19 Miguel de Icaza <miguel@ximian.com>
13766 * class.cs (Event.Define): Change my previous commit, as this
13767 breaks the debugger. This is a temporary hack, as it seems like
13768 the compiler is generating events incorrectly to begin with.
13770 * expression.cs (Binary.ResolveOperator): Added support for
13771 "U operator - (E x, E y)"
13773 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13776 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13777 init-only variables, but this path did not take into account that
13778 there might be also instance readonly variables. Correct this
13781 This fixes bug 32253
13783 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13786 * driver.cs: Change the extension for modules to `netmodule'
13788 * cs-parser.jay: Improved slightly the location tracking for
13789 the debugger symbols.
13791 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13792 modifiers that were specified instead of the hardcoded value
13793 (FamAndAssem). This was basically ignoring the static modifier,
13794 and others. Fixes 32429.
13796 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13797 fixed a bug in the process (32476)
13799 * expression.cs (ArrayAccess.EmitAssign): Patch from
13800 hwang_rob@yahoo.ca that fixes bug 31834.3
13802 2002-10-18 Miguel de Icaza <miguel@ximian.com>
13804 * driver.cs: Make the module extension .netmodule.
13806 2002-10-16 Miguel de Icaza <miguel@ximian.com>
13808 * driver.cs: Report an error if the resource file is not found
13809 instead of crashing.
13811 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13812 false, like Emit does.
13814 2002-10-16 Nick Drochak <ndrochak@gol.com>
13816 * typemanager.cs: Remove unused private member. Also reported mcs
13817 bug to report this as a warning like csc.
13819 2002-10-15 Martin Baulig <martin@gnome.org>
13821 * statement.cs (Statement.Emit): Made this a virtual method; emits
13822 the line number info and calls DoEmit().
13823 (Statement.DoEmit): New protected abstract method, formerly knows
13824 as Statement.Emit().
13826 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13828 2002-10-11 Miguel de Icaza <miguel@ximian.com>
13830 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13831 have fixed a remaining problem: not every AddXXXX was adding a
13832 fully qualified name.
13834 Now everyone registers a fully qualified name in the DeclSpace as
13835 being defined instead of the partial name.
13837 Downsides: we are slower than we need to be due to the excess
13838 copies and the names being registered this way.
13840 The reason for this is that we currently depend (on the corlib
13841 bootstrap for instance) that types are fully qualified, because
13842 we dump all the types in the namespace, and we should really have
13843 types inserted into the proper namespace, so we can only store the
13844 basenames in the defined_names array.
13846 2002-10-10 Martin Baulig <martin@gnome.org>
13848 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13849 from bug #31834, see the bug report for a testcase which is
13852 2002-10-10 Martin Baulig <martin@gnome.org>
13854 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13855 flow analysis code for this.
13857 * statement.cs (Do, While, For): Tell the flow analysis code about
13859 (FlowBranching.UsageVector): Added support for infinite loops.
13860 (Block.Resolve): Moved the dead code elimination here and use flow
13863 2002-10-09 Miguel de Icaza <miguel@ximian.com>
13865 * class.cs (Field.Define): Catch cycles on struct type
13868 * typemanager.cs (IsUnmanagedtype): Do not recursively check
13869 fields if the fields are static. We only need to check instance
13872 * expression.cs (As.DoResolve): Test for reference type.
13874 * statement.cs (Using.ResolveExpression): Use
13875 ConvertImplicitRequired, not ConvertImplicit which reports an
13877 (Using.ResolveLocalVariableDecls): ditto.
13879 * expression.cs (Binary.ResolveOperator): Report errors in a few
13880 places where we had to.
13882 * typemanager.cs (IsUnmanagedtype): Finish implementation.
13884 2002-10-08 Miguel de Icaza <miguel@ximian.com>
13886 * expression.cs: Use StoreFromPtr instead of extracting the type
13887 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
13889 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13890 an enumeration value to a System.Enum, but System.Enum is not a
13891 value type, but an class type, so we need to box.
13893 (Expression.ConvertExplicit): One codepath could return
13894 errors but not flag them. Fix this. Fixes #31853
13896 * parameter.cs (Resolve): Do not allow void as a parameter type.
13898 2002-10-06 Martin Baulig <martin@gnome.org>
13900 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13901 if it's a class type and not a struct. Fixes #31815.
13903 2002-10-06 Martin Baulig <martin@gnome.org>
13905 * statement.cs: Reworked the flow analysis code a bit to make it
13906 usable for dead code elimination.
13908 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13910 * cs-parser.jay: allow empty source files. Fixes bug #31781.
13912 2002-10-04 Miguel de Icaza <miguel@ximian.com>
13914 * expression.cs (ComposedCast.DoResolveType): A quick workaround
13915 to fix the test 165, will investigate deeper.
13917 2002-10-04 Martin Baulig <martin@gnome.org>
13919 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13920 finally blocks actually work.
13921 (Try.Resolve): We don't need to create a sibling for `finally' if
13922 there is no finally block.
13924 2002-10-04 Martin Baulig <martin@gnome.org>
13926 * class.cs (Constructor.Define): The default accessibility for a
13927 non-default constructor is private, not public.
13929 2002-10-04 Miguel de Icaza <miguel@ximian.com>
13931 * class.cs (Constructor): Make AllowedModifiers public, add
13934 * cs-parser.jay: Perform the modifiers test here, as the
13935 constructor for the Constructor class usually receives a zero
13936 because of the way we create it (first we create, later we
13937 customize, and we were never checking the modifiers).
13939 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13940 is a version of LookupTypeReflection that includes the type-name
13941 cache. This can be used as a fast path for functions that know
13942 the fully qualified name and are only calling into *.GetType() to
13943 obtain a composed type.
13945 This is also used by TypeManager.LookupType during its type
13948 (LookupType): We now also track the real type name, as sometimes
13949 we can get a quey for the real type name from things like
13950 ComposedCast. This fixes bug 31422.
13952 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13953 complete type fullname, it does not have to go through the type
13954 resolution system to obtain the composed version of the type (for
13955 obtaining arrays or pointers).
13957 (Conditional.Emit): Use the EmitBoolExpression to
13958 generate nicer code, as requested by Paolo.
13960 (ArrayCreation.CheckIndices): Use the patch from
13961 hwang_rob@yahoo.ca to validate the array initializers.
13963 2002-10-03 Miguel de Icaza <miguel@ximian.com>
13965 * class.cs (ConstructorInitializer.Emit): simplify code by using
13966 Invocation.EmitCall, and at the same time, fix the bugs in calling
13967 parent constructors that took variable arguments.
13969 * ecore.cs (Expression.ConvertNumericExplicit,
13970 Expression.ImplicitNumericConversion): Remove the code that
13971 manually wrapped decimal (InternalTypeConstructor call is now gone
13974 * expression.cs (Cast.TryReduce): Also handle decimal types when
13975 trying to perform a constant fold on the type.
13977 * typemanager.cs (IsUnmanagedtype): Partially implemented.
13979 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13980 that only turned off an error report, and did nothing else.
13982 2002-10-02 Miguel de Icaza <miguel@ximian.com>
13984 * driver.cs: Handle and ignore /fullpaths
13986 2002-10-01 Miguel de Icaza <miguel@ximian.com>
13988 * expression.cs (Binary.ResolveOperator): Catch the case where
13989 DoNumericPromotions returns true,
13991 (Binary.DoNumericPromotions): Simplify the code, and the tests.
13993 2002-09-27 Miguel de Icaza <miguel@ximian.com>
13995 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13998 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14000 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14001 conversion exists, but it is also required that the conversion be
14002 performed. This manifested in "(Type64Enum) 2".
14004 * class.cs (TypeManager.AddMethod): The fix is not to change
14005 AddEnum, because that one was using a fully qualified name (every
14006 DeclSpace derivative does), but to change the AddMethod routine
14007 that was using an un-namespaced name. This now correctly reports
14008 the duplicated name.
14010 Revert patch until I can properly fix it. The issue
14011 is that we have a shared Type space across all namespaces
14012 currently, which is wrong.
14014 Options include making the Namespace a DeclSpace, and merge
14015 current_namespace/current_container in the parser.
14017 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14019 * cs-parser.jay: Improve error reporting when we get a different
14020 kind of expression in local_variable_type and
14021 local_variable_pointer_type.
14023 Propagate this to avoid missleading errors being reported.
14025 * ecore.cs (ImplicitReferenceConversion): treat
14026 TypeManager.value_type as a target just like object_type. As
14031 Is valid, and needs to result in the int 1 being boxed before it
14032 is assigned to the value type v.
14034 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14035 to validate the enumeration name.
14037 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14038 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14039 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14041 * ecore.cs (TryImplicitIntConversion): When doing an
14042 implicit-enumeration-conversion, check if the type is 64-bits and
14043 perform a conversion before passing to EnumConstant.
14045 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14047 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14048 report ambiguous type references. Unlike the MS version, we
14049 report what the ambiguity is. Innovation at work ;-)
14051 (DeclSpace.FindType): Require a location argument to
14052 display when we display an ambiguous error.
14054 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14056 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14058 * expression.cs (EmitDynamicInitializers): Apply patch from
14059 hwang_rob@yahoo.ca that fixes the order in which we emit our
14062 2002-09-21 Martin Baulig <martin@gnome.org>
14064 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14065 delegate takes no arguments.
14067 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14069 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14072 * expression.cs: Extract the underlying type.
14074 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14076 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14078 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14080 * class.cs (TypeContainer.DefineType): We can not use the nice
14081 PackingSize with the size set to 1 DefineType method, because it
14082 will not allow us to define the interfaces that the struct
14085 This completes the fixing of bug 27287
14087 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14088 means also structs. This fixes part of the problem.
14089 (Expresion.ImplicitReferenceConversionExists): ditto.
14091 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14092 error if there were no errors reported during the type lookup
14093 process, to avoid duplicates or redundant errors. Without this
14094 you would get an ambiguous errors plus a type not found. We have
14095 beaten the user enough with the first error.
14097 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14100 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14101 during the resolution process, stop the lookup, this avoids
14102 repeated error reports (same error twice).
14104 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14106 * typemanager.cs (LookupType): Redo the type lookup code to match
14107 the needs of System.Reflection.
14109 The issue is that System.Reflection requires references to nested
14110 types to begin with a "+" sign instead of a dot. So toplevel
14111 types look like: "NameSpace.TopLevelClass", and nested ones look
14112 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14115 2002-09-19 Martin Baulig <martin@gnome.org>
14117 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14118 says that a method always returns or always throws an exception,
14119 don't report the CS0161.
14121 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14122 set `Returns = new_returns'.
14124 2002-09-19 Martin Baulig <martin@gnome.org>
14126 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14127 to an enum constant, check for a CS0176.
14129 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14131 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14132 for operators that must be in pairs and report errors.
14134 * ecore.cs (SimpleName.DoResolveType): During the initial type
14135 resolution process, when we define types recursively, we must
14136 check first for types in our current scope before we perform
14137 lookups in the enclosing scopes.
14139 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14141 (Invocation.VerifyArgumentsCompat): Call
14142 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14143 I thought we were supposed to always call this, but there are a
14144 few places in the code where we dont do it.
14146 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14148 * driver.cs: Add support in -linkres and -resource to specify the
14149 name of the identifier.
14151 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14153 * ecore.cs (StandardConversionExists): Sync with the conversion
14154 code: allow anything-* to void* conversions.
14156 (FindMostSpecificSource): Use an Expression argument
14157 instead of a Type, because we might be handed over a Literal which
14158 gets a few more implicit conversions that plain types do not. So
14159 this information was being lost.
14161 Also, we drop the temporary type-holder expression when not
14164 2002-09-17 Martin Baulig <martin@gnome.org>
14166 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14167 this is an explicit interface implementation.
14169 2002-09-17 Martin Baulig <martin@gnome.org>
14171 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14172 different `IndexerName' attributes.
14174 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14175 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14176 virtual CommonResolve().
14178 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14180 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14181 and convert that to the UnderlyingType.
14183 * statement.cs (Foreach.Resolve): Indexers are just like variables
14184 or PropertyAccesses.
14186 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14187 inside quoted strings, we were not doing this before.
14189 2002-09-16 Martin Baulig <martin@gnome.org>
14191 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14192 resolve it. This is needed for the definite assignment check of the
14193 instance expression, fixes bug #29846.
14194 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14196 2002-09-16 Nick Drochak <ndrochak@gol.com>
14198 * parameter.cs: Fix compile error. Cannot reference static member
14199 from an instance object. Is this an mcs bug?
14201 2002-09-14 Martin Baulig <martin@gnome.org>
14203 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14204 multiple times. Fixes bug #30295, added test-166.cs.
14206 2002-09-14 Martin Baulig <martin@gnome.org>
14208 * statement.cs (Block.Emit): Don't emit unreachable code.
14209 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14210 `break' statements.
14211 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14213 2002-09-14 Martin Baulig <martin@gnome.org>
14215 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14218 2002-09-14 Martin Baulig <martin@gnome.org>
14220 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14221 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14222 be false on the ms runtime.
14224 2002-09-13 Martin Baulig <martin@gnome.org>
14226 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14227 the CS0038 error message.
14229 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14231 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14232 constant inside, return it.
14234 2002-09-12 Martin Baulig <martin@gnome.org>
14236 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14237 implicit conversion can be done between enum types.
14239 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14240 check whether an implicit conversion to the current enum's UnderlyingType
14241 exists and report an error if not.
14243 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14244 without debugging support.
14246 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14247 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14249 2002-09-12 Martin Baulig <martin@gnome.org>
14251 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14253 * ecore.cs (IMemberExpr.DeclaringType): New property.
14254 (SimpleName.SimpleNameResolve): Check whether we're accessing a
14255 nonstatic member of an outer type (CS0038).
14257 2002-09-11 Miguel de Icaza <miguel@ximian.com>
14259 * driver.cs: Activate the using-error detector at warning level
14260 4 (at least for MS-compatible APIs).
14262 * namespace.cs (VerifyUsing): Small buglett fix.
14264 * pending.cs (PendingImplementation): pass the container pointer.
14266 * interface.cs (GetMethods): Allow for recursive definition. Long
14267 term, I would like to move every type to support recursive
14268 definitions, not the current ordering mechanism that we have right
14271 The situation is this: Attributes are handled before interfaces,
14272 so we can apply attributes to interfaces. But some attributes
14273 implement interfaces, we will now handle the simple cases
14274 (recursive definitions will just get an error).
14276 * parameter.cs: Only invalidate types at the end if we fail to
14279 2002-09-09 Martin Baulig <martin@gnome.org>
14281 * ecore.cs (PropertyExpr.Emit): Also check for
14282 TypeManager.system_int_array_get_length so this'll also work when
14283 compiling corlib. Fixes #30003.
14285 2002-09-09 Martin Baulig <martin@gnome.org>
14287 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14288 and throw an exception if we can't get the type's size. Fixed #30040,
14291 2002-09-09 Martin Baulig <martin@gnome.org>
14293 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14295 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14296 context. Fixes bug #30027.
14298 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14299 virtual functions. Fixes bug #30043, added test-164.cs.
14301 2002-09-08 Ravi Pratap <ravi@ximian.com>
14303 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14305 2002-09-08 Nick Drochak <ndrochak@gol.com>
14307 * driver.cs: Use an object to get the windows codepage since it's not a
14310 2002-09-08 Miguel de Icaza <miguel@ximian.com>
14312 * statement.cs (For.Emit): for infinite loops (test == null)
14313 return whether there is a break inside, not always "true".
14315 * namespace.cs (UsingEntry): New struct to hold the name of the
14316 using definition, the location where it is defined, and whether it
14317 has been used in a successful type lookup.
14319 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14324 2002-09-06 Ravi Pratap <ravi@ximian.com>
14326 * attribute.cs : Fix incorrect code which relied on catching
14327 a NullReferenceException to detect a null being passed in
14328 where an object was expected.
14330 2002-09-06 Miguel de Icaza <miguel@ximian.com>
14332 * statement.cs (Try): flag the catch variable as assigned
14334 * expression.cs (Cast): Simplified by using ResolveType instead of
14335 manually resolving.
14337 * statement.cs (Catch): Fix bug by using ResolveType.
14339 2002-09-06 Ravi Pratap <ravi@ximian.com>
14341 * expression.cs (BetterConversion): Special case for when we have
14342 a NullLiteral as the argument and we have to choose between string
14343 and object types - we choose string the way csc does.
14345 * attribute.cs (Attribute.Resolve): Catch the
14346 NullReferenceException and report error #182 since the Mono
14347 runtime no more has the bug and having this exception raised means
14348 we tried to select a constructor which takes an object and is
14351 2002-09-05 Ravi Pratap <ravi@ximian.com>
14353 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14354 message (1502, 1503) when we can't locate a method after overload
14355 resolution. This is much more informative and closes the bug
14358 * interface.cs (PopulateMethod): Return if there are no argument
14359 types. Fixes a NullReferenceException bug.
14361 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14362 expressions too. Previously we were checking only in one place for
14363 positional arguments leaving out named arguments.
14365 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14366 type to the enum type is not allowed. Remove code corresponding to
14369 (ConvertNumericExplicit): Allow explicit conversions from
14370 the underlying type to enum type. This precisely follows the spec
14371 and closes a bug filed by Gonzalo.
14373 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14376 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14378 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14380 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14381 it was important that we stored the right value after the
14382 reduction in `converted'.
14384 2002-09-04 Martin Baulig <martin@gnome.org>
14386 * location.cs (Location.SymbolDocument): Use full pathnames for the
14389 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14391 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14392 of the expression resolve mechanism, because that will catch the
14393 SimpleName error failures.
14395 (Conditional): If we can not resolve the
14396 expression, return, do not crash.
14398 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14401 (location): display token name instead of its number.
14403 2002-08-28 Martin Baulig <martin@gnome.org>
14405 * expression.cs (Binary.ResolveOperator): Don't silently return
14406 but return an error if an operator cannot be applied between two
14409 2002-08-28 Martin Baulig <martin@gnome.org>
14411 * class.cs (Constructor.Define): Set the permission attributes
14412 correctly instead of making all constructors public.
14414 2002-08-28 Martin Baulig <martin@gnome.org>
14416 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14417 for private members before reporting a CS0103; if we find anything,
14420 2002-08-28 Martin Baulig <martin@gnome.org>
14422 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14423 to check whether `closure_start_type == closure_invocation_type',
14424 we also need to check whether `m.DeclaringType == closure_invocation_type'
14425 before bypassing the permission checks. We might be accessing
14426 protected/private members from the base class.
14427 (TypeManager.RealMemberLookup): Only set private_ok if private
14428 members were requested via BindingFlags.NonPublic.
14430 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14432 * expression.cs (MemberAccess.ResolveMemberAccess): Set
14433 MethodGroupExpr.IsExplicitImpl if appropriate.
14434 (Invocation.DoResolve): Don't report the CS0120 for explicit
14435 interface implementations.
14437 2002-08-27 Martin Baulig <martin@gnome.org>
14439 * expression.cs (Invocation.DoResolve): If this is a static
14440 method and we don't have an InstanceExpression, we must report
14443 2002-08-25 Martin Baulig <martin@gnome.org>
14445 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14446 `==' between a valuetype and an object.
14448 2002-08-25 Miguel de Icaza <miguel@ximian.com>
14450 * ecore.cs (TypeExpr): Provide a ToString method.
14452 2002-08-24 Martin Baulig <martin@gnome.org>
14454 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14455 now called proggie.dbg and it's a binary file.
14457 2002-08-23 Martin Baulig <martin@gnome.org>
14459 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14461 2002-08-23 Martin Baulig <martin@gnome.org>
14463 * struct.cs (MyStructInfo.ctor): Make this work with empty
14464 structs; it's not allowed to use foreach() on null.
14466 2002-08-23 Martin Baulig <martin@gnome.org>
14468 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14469 writer the full pathname of the generated assembly.
14471 2002-08-23 Martin Baulig <martin@gnome.org>
14473 * statements.cs (FlowBranching.UsageVector.MergeChildren):
14474 A `finally' block never returns or breaks; improved handling of
14477 2002-08-23 Martin Baulig <martin@gnome.org>
14479 * statement.cs (Throw.Resolve): Allow `throw null'.
14481 2002-08-23 Martin Baulig <martin@gnome.org>
14483 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14484 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14485 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
14486 MemberLookup would return a wrong event if this is an explicit
14487 interface implementation and the class has an event with the same
14490 2002-08-23 Martin Baulig <martin@gnome.org>
14492 * statement.cs (Block.AddChildVariableNames): New public method.
14493 (Block.AddChildVariableName): Likewise.
14494 (Block.IsVariableNameUsedInChildBlock): Likewise.
14495 (Block.AddVariable): Check whether a variable name has already
14496 been used in a child block.
14498 * cs-parser.jay (declare_local_variables): Mark all variable names
14499 from the current block as being used in a child block in the
14502 2002-08-23 Martin Baulig <martin@gnome.org>
14504 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14505 find the symbol writer.
14507 * driver.cs: csc also allows the arguments to /define being
14508 separated by commas, not only by semicolons.
14510 2002-08-23 Martin Baulig <martin@gnome.org>
14512 * interface.cs (Interface.GetMembers): Added static check for events.
14514 2002-08-15 Martin Baulig <martin@gnome.org>
14516 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14517 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14519 * ecore.cs (Expression.MemberLookup): Added documentation and explained
14520 why the MethodData.EmitDestructor() change was necessary.
14522 2002-08-20 Martin Baulig <martin@gnome.org>
14524 * class.cs (TypeContainer.FindMembers): Added static check for events.
14526 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14528 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14529 use Type.GetEvents(), not Type.FindMembers().
14531 2002-08-20 Martin Baulig <martin@gnome.org>
14533 * decl.cs (MemberCache): Added a special method cache which will
14534 be used for method-only searched. This ensures that a method
14535 search will return a MethodInfo with the correct ReflectedType for
14538 2002-08-20 Martin Baulig <martin@gnome.org>
14540 * decl.cs (DeclSpace.FindMembers): Made this public.
14542 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14544 * delegate.cs: fixed build on windows.
14545 [FIXME: Filed as bug #29150: MCS must report these errors.]
14547 2002-08-19 Ravi Pratap <ravi@ximian.com>
14549 * ecore.cs (StandardConversionExists): Return a false
14550 if we are trying to convert the void type to anything else
14551 since that is not allowed.
14553 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14554 we flag error 70 in the event an event is trying to be accessed
14555 directly from outside the declaring type.
14557 2002-08-20 Martin Baulig <martin@gnome.org>
14559 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14560 MemberCache from typemanager.cs to decl.cs.
14562 2002-08-19 Martin Baulig <martin@gnome.org>
14564 * class.cs (TypeContainer): Implement IMemberContainer.
14565 (TypeContainer.DefineMembers): Create the MemberCache.
14566 (TypeContainer.FindMembers): Do better BindingFlags checking; only
14567 return public members if BindingFlags.Public was given, check
14568 whether members are static.
14570 2002-08-16 Martin Baulig <martin@gnome.org>
14572 * decl.cs (DeclSpace.Define): Splitted this in Define and
14573 DefineMembers. DefineMembers is called first and initializes the
14576 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
14577 DefineMembers() on all our DeclSpaces.
14579 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14580 but call DefineMembers() on all nested interfaces. We call their
14581 Define() in our new Define() function.
14583 * interface.cs (Interface): Implement IMemberContainer.
14584 (Interface.Define): Moved all code except the attribute stuf to
14586 (Interface.DefineMembers): Initialize the member cache.
14588 * typemanager.cs (IMemberFinder): Removed this interface, we don't
14589 need this anymore since we can use MemberCache.FindMembers directly.
14591 2002-08-19 Martin Baulig <martin@gnome.org>
14593 * typemanager.cs (MemberCache): When creating the cache for an
14594 interface type, add all inherited members.
14595 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14596 to `out bool used_cache' and documented it.
14597 (TypeManager.MemberLookup): If we already used the cache in the first
14598 iteration, we don't need to do the interfaces check.
14600 2002-08-19 Martin Baulig <martin@gnome.org>
14602 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
14603 here from IMemberFinder and don't implement this interface anymore.
14604 (DeclSpace.MemberCache): Moved here from IMemberFinder.
14606 * typemanager.cs (IMemberFinder): This interface is now only used by
14607 classes which actually support the member cache.
14608 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14609 since we only put DeclSpaces into this Hashtable.
14610 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14611 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14613 2002-08-16 Martin Baulig <martin@gnome.org>
14615 * typemanager.cs (ICachingMemberFinder): Removed.
14616 (IMemberFinder.MemberCache): New property.
14617 (TypeManager.FindMembers): Merged this with RealFindMembers().
14618 This function will never be called from TypeManager.MemberLookup()
14619 so we can't use the cache here, just the IMemberFinder.
14620 (TypeManager.MemberLookup_FindMembers): Check whether the
14621 IMemberFinder has a MemberCache and call the cache's FindMembers
14623 (MemberCache): Rewrote larger parts of this yet another time and
14624 cleaned it up a bit.
14626 2002-08-15 Miguel de Icaza <miguel@ximian.com>
14628 * driver.cs (LoadArgs): Support quoting.
14630 (Usage): Show the CSC-like command line arguments.
14632 Improved a few error messages.
14634 2002-08-15 Martin Baulig <martin@gnome.org>
14636 * typemanager.cs (IMemberContainer.Type): New property.
14637 (IMemberContainer.IsInterface): New property.
14639 The following changes are conditional to BROKEN_RUNTIME, which is
14640 defined at the top of the file.
14642 * typemanager.cs (MemberCache.MemberCache): Don't add the base
14643 class'es members, but add all members from TypeHandle.ObjectType
14644 if we're an interface.
14645 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14646 is the current type.
14647 (MemberCache.CacheEntry.Container): Removed this field.
14648 (TypeHandle.GetMembers): Include inherited members.
14650 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14652 * typemanager.cs: fixed compilation and added a comment on a field that
14655 2002-08-15 Martin Baulig <martin@gnome.org>
14657 * class.cs (ConstructorInitializer.Resolve): In the
14658 Expression.MemberLookup call, use the queried_type as
14661 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14662 declared' attribute, it's always true.
14663 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14664 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14665 temporary wrapper for FindMembers which tells MemberLookup whether
14666 members from the base classes are included in the return value.
14667 This will go away soon.
14668 (TypeManager.MemberLookup): Use this temporary hack here; once the
14669 new MemberCache is completed, we don't need to do the DeclaredOnly
14670 looping here anymore since the MemberCache will take care of this.
14671 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14672 (MemberCache): When creating the MemberCache for a class, get
14673 members from the current class and all its base classes.
14674 (MemberCache.CacheEntry.Container): New field. This is a
14675 temporary hack until the Mono runtime is fixed to distinguish
14676 between ReflectedType and DeclaringType. It allows us to use MCS
14677 with both the MS runtime and the unfixed Mono runtime without
14678 problems and without accecting performance.
14679 (MemberCache.SearchMembers): The DeclaredOnly looping from
14680 TypeManager.MemberLookup is now done here.
14682 2002-08-14 Martin Baulig <martin@gnome.org>
14684 * statement.cs (MyStructInfo.MyStructInfo): Don't call
14685 Type.GetFields on dynamic types but get the fields from the
14686 corresponding TypeContainer.
14687 (MyStructInfo.GetStructInfo): Added check for enum types.
14689 * typemanager.cs (MemberList.IsSynchronized): Implemented.
14690 (MemberList.SyncRoot): Implemented.
14691 (TypeManager.FilterWithClosure): No need to check permissions if
14692 closure_start_type == closure_invocation_type, don't crash if
14693 closure_invocation_type is null.
14695 2002-08-13 Martin Baulig <martin@gnome.org>
14697 Rewrote TypeContainer.FindMembers to use a member cache. This
14698 gives us a speed increase of about 35% for the self-hosting MCS
14699 build and of about 15-20% for the class libs (both on GNU/Linux).
14701 * report.cs (Timer): New class to get enhanced profiling. This
14702 whole class is "TIMER" conditional since it remarkably slows down
14705 * class.cs (MemberList): New class. This is an IList wrapper
14706 which we're now using instead of passing MemberInfo[]'s around to
14707 avoid copying this array unnecessarily.
14708 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14709 (ICachingMemberFinder, IMemberContainer): New interface.
14710 (TypeManager.FilterWithClosure): If `criteria' is null, the name
14711 has already been checked, otherwise use it for the name comparision.
14712 (TypeManager.FindMembers): Renamed to RealMemberFinder and
14713 provided wrapper which tries to use ICachingMemberFinder.FindMembers
14714 if possible. Returns a MemberList, not a MemberInfo [].
14715 (TypeHandle): New class, implements IMemberContainer. We create
14716 one instance of this class per type, it contains a MemberCache
14717 which is used to do the member lookups.
14718 (MemberCache): New class. Each instance of this class contains
14719 all members of a type and a name-based hash table.
14720 (MemberCache.FindMembers): This is our new member lookup
14721 function. First, it looks up all members of the requested name in
14722 the hash table. Then, it walks this list and sorts out all
14723 applicable members and returns them.
14725 2002-08-13 Martin Baulig <martin@gnome.org>
14727 In addition to a nice code cleanup, this gives us a performance
14728 increase of about 1.4% on GNU/Linux - not much, but it's already
14729 half a second for the self-hosting MCS compilation.
14731 * typemanager.cs (IMemberFinder): New interface. It is used by
14732 TypeManager.FindMembers to call FindMembers on a TypeContainer,
14733 Enum, Delegate or Interface.
14734 (TypeManager.finder_to_member_finder): New PtrHashtable.
14735 (TypeManager.finder_to_container): Removed.
14736 (TypeManager.finder_to_delegate): Removed.
14737 (TypeManager.finder_to_interface): Removed.
14738 (TypeManager.finder_to_enum): Removed.
14740 * interface.cs (Interface): Implement IMemberFinder.
14742 * delegate.cs (Delegate): Implement IMemberFinder.
14744 * enum.cs (Enum): Implement IMemberFinder.
14746 * class.cs (TypeContainer): Implement IMemberFinder.
14748 2002-08-12 Martin Baulig <martin@gnome.org>
14750 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14752 2002-08-12 Martin Baulig <martin@gnome.org>
14754 * ecore.cs (ITypeExpression): New interface for expressions which
14756 (TypeExpression): Renamed to TypeLookupExpression.
14757 (Expression.DoResolve): If we're doing a types-only lookup, the
14758 expression must implement the ITypeExpression interface and we
14759 call DoResolveType() on it.
14760 (SimpleName): Implement the new ITypeExpression interface.
14761 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14762 hack, the situation that we're only looking up types can't happen
14763 anymore when this method is called. Moved the type lookup code to
14764 DoResolveType() and call it.
14765 (SimpleName.DoResolveType): This ITypeExpression interface method
14766 is now doing the types-only lookup.
14767 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14768 (ResolveFlags): Added MaskExprClass.
14770 * expression.cs (MemberAccess): Implement the ITypeExpression
14772 (MemberAccess.DoResolve): Added support for a types-only lookup
14773 when we're called via ITypeExpression.DoResolveType().
14774 (ComposedCast): Implement the ITypeExpression interface.
14776 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
14777 Expression.Resolve() with ResolveFlags.Type instead.
14779 2002-08-12 Martin Baulig <martin@gnome.org>
14781 * interface.cs (Interface.Define): Apply attributes.
14783 * attribute.cs (Attribute.ApplyAttributes): Added support for
14784 interface attributes.
14786 2002-08-11 Martin Baulig <martin@gnome.org>
14788 * statement.cs (Block.Emit): Only check the "this" variable if we
14789 do not always throw an exception.
14791 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14792 whether the property has a set accessor.
14794 2002-08-11 Martin Baulig <martin@gnome.org>
14796 Added control flow analysis support for structs.
14798 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14799 with control flow analysis turned off.
14800 (IVariable): New interface.
14801 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14802 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14803 (FieldExpr.DoResolve): Resolve the instance expression with flow
14804 analysis turned off and do the definite assignment check after the
14805 resolving when we know what the expression will resolve to.
14807 * expression.cs (LocalVariableReference, ParameterReference):
14808 Implement the new IVariable interface, only call the flow analysis
14809 code if ec.DoFlowAnalysis is true.
14810 (This): Added constructor which takes a Block argument. Implement
14811 the new IVariable interface.
14812 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14813 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14814 This does the definite assignment checks for struct members.
14816 * class.cs (Constructor.Emit): If this is a non-static `struct'
14817 constructor which doesn't have any initializer, call
14818 Block.AddThisVariable() to tell the flow analysis code that all
14819 struct elements must be initialized before control returns from
14822 * statement.cs (MyStructInfo): New public class.
14823 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14824 argument to this indexer. If non-zero, check an individual struct
14825 member, not the whole struct.
14826 (FlowBranching.CheckOutParameters): Check struct members.
14827 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14828 overloaded versions of these methods which take an additional
14829 `int field_idx' argument to check struct members.
14830 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14831 overloaded versions of these methods which take an additional
14832 `string field_name' argument to check struct member.s
14833 (VariableInfo): Implement the IVariable interface.
14834 (VariableInfo.StructInfo): New public property. Returns the
14835 MyStructInfo instance of the variable if it's a struct or null.
14836 (Block.AddThisVariable): New public method. This is called from
14837 Constructor.Emit() for non-static `struct' constructor which do
14838 not have any initializer. It creates a special variable for the
14839 "this" instance variable which will be checked by the flow
14840 analysis code to ensure that all of the struct's fields are
14841 initialized before control returns from the constructor.
14842 (UsageVector): Added support for struct members. If a
14843 variable/parameter is a struct with N members, we reserve a slot
14844 in the usage vector for each member. A struct is considered fully
14845 initialized if either the struct itself (slot 0) or all its
14846 members are initialized.
14848 2002-08-08 Martin Baulig <martin@gnome.org>
14850 * driver.cs (Driver.MainDriver): Only report an error CS5001
14851 if there were no compilation errors.
14853 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14854 `UnsafeContext' property to determine whether the parent is in
14855 unsafe context rather than checking the parent's ModFlags:
14856 classes nested in an unsafe class are unsafe as well.
14858 2002-08-08 Martin Baulig <martin@gnome.org>
14860 * statement.cs (UsageVector.MergeChildren): Distinguish between
14861 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14862 we return. Added test17() and test18() to test-154.cs.
14864 2002-08-08 Martin Baulig <martin@gnome.org>
14866 * typemanager.cs (TypeManager.FilterWithClosure): If we have
14867 Family access, make sure the invoking type isn't a subclass of the
14868 queried type (that'd be a CS1540).
14870 * ecore.cs (Expression.MemberLookup): Added overloaded version of
14871 this method which takes an additional `Type invocation_type'.
14873 * expression.cs (BaseAccess.DoResolve): Use the base type as
14874 invocation and query type.
14875 (MemberAccess.DoResolve): If the lookup failed and we're about to
14876 report a CS0122, try a lookup with the ec.ContainerType - if this
14877 succeeds, we must report a CS1540.
14879 2002-08-08 Martin Baulig <martin@gnome.org>
14881 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14882 (MethodGroupExpr): Implement the IMemberExpr interface.
14884 * expression (MemberAccess.ResolveMemberAccess): No need to have
14885 any special code for MethodGroupExprs anymore, they're now
14888 2002-08-08 Martin Baulig <martin@gnome.org>
14890 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14891 Family, FamANDAssem and FamORAssem permissions.
14892 (TypeManager.IsSubclassOrNestedChildOf): New public method.
14894 2002-08-08 Martin Baulig <martin@gnome.org>
14896 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14897 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14900 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14902 * driver.cs: implemented /resource option to embed managed resources.
14904 2002-08-07 Martin Baulig <martin@gnome.org>
14906 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14907 (FieldBase.HasFieldInitializer): New public property.
14908 (FieldBase.GetInitializerExpression): New public method. Resolves and
14909 returns the field initializer and makes sure it is only resolved once.
14910 (TypeContainer.EmitFieldInitializers): Call
14911 FieldBase.GetInitializerExpression to get the initializer, this ensures
14912 that it isn't resolved multiple times.
14914 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
14915 the resolving process (SimpleName/MemberLookup) that we're currently
14916 emitting a field initializer (which must not access any instance members,
14917 this is an error CS0236).
14919 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14920 argument, if the `IsFieldInitializer' flag is set, we must report and
14921 error CS0236 and not an error CS0120.
14923 2002-08-07 Martin Baulig <martin@gnome.org>
14925 * ecore.cs (IMemberExpr): New public interface.
14926 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14927 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14928 if the expression is an IMemberExpr.
14930 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14931 to be null, implicitly default to `this' if we're non-static in
14932 this case. Simplified the code a lot by using the new IMemberExpr
14933 interface. Also fixed bug #28176 here.
14935 2002-08-06 Martin Baulig <martin@gnome.org>
14937 * cs-parser.jay (SimpleLookup): Removed. We need to create
14938 ParameterReferences during semantic analysis so that we can do a
14939 type-only search when resolving Cast, TypeOf and SizeOf.
14940 (block): Pass the `current_local_parameters' to the Block's
14943 * class.cs (ConstructorInitializer): Added `Parameters parameters'
14944 argument to the constructor.
14945 (ConstructorInitializer.Resolve): Create a temporary implicit
14946 block with the parameters.
14948 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14949 references here if we aren't doing a type-only search.
14951 * statement.cs (Block): Added constructor which takes a
14952 `Parameters parameters' argument.
14953 (Block.Parameters): New public property.
14955 * support.cs (InternalParameters.Parameters): Renamed `parameters'
14956 to `Parameters' and made it public readonly.
14958 2002-08-06 Martin Baulig <martin@gnome.org>
14960 * ecore.cs (Expression.Warning): Made this public as well.
14962 * report.cs (Report.Debug): Print the contents of collections.
14964 2002-08-06 Martin Baulig <martin@gnome.org>
14966 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
14967 used to tell Resolve() which kinds of expressions it may return.
14968 (Expression.Resolve): Added overloaded version of this method which
14969 takes a `ResolveFlags flags' argument. This can be used to tell
14970 Resolve() which kinds of expressions it may return. Reports a
14972 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14973 ResolveFlags.SimpleName.
14974 (Expression.Error118): Added overloaded version of this method which
14975 takes a `ResolveFlags flags' argument. It uses the flags to determine
14976 which kinds of expressions are allowed.
14978 * expression.cs (Argument.ResolveMethodGroup): New public method.
14979 Resolves an argument, but allows a MethodGroup to be returned.
14980 This is used when invoking a delegate.
14982 * TODO: Updated a bit.
14984 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14986 Fixed compilation with csc.
14988 * ecore.cs: Expression.Error made public. Is this correct? Should
14989 Warning be made public too?
14991 * expression.cs: use ea.Location instead of ea.loc.
14992 [FIXME: Filed as bug #28607: MCS must report these errors.]
14994 2002-08-06 Martin Baulig <martin@gnome.org>
14996 * ecore.cs (Expression.loc): Moved the location here instead of
14997 duplicating it in all derived classes.
14998 (Expression.Location): New public property.
14999 (Expression.Error, Expression.Warning): Made them non-static and
15000 removed the location argument.
15001 (Expression.Warning): Added overloaded version which takes an
15002 `int level' argument.
15003 (Expression.Error118): Make this non-static and removed the
15004 expression and location arguments.
15005 (TypeExpr): Added location argument to the constructor.
15007 * expression.cs (StaticCallExpr): Added location argument to
15009 (Indirection, PointerArithmetic): Likewise.
15010 (CheckedExpr, UnCheckedExpr): Likewise.
15011 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15012 (StringPtr): Likewise.
15015 2002-08-05 Martin Baulig <martin@gnome.org>
15017 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15019 * assign.cs (Assign.DoResolve): Check whether the source
15020 expression is a value or variable.
15022 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15023 while resolving the corresponding blocks.
15025 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15026 an error, don't silently return null.
15028 * statement.cs (Block.AddVariable): Do the error reporting here
15029 and distinguish between CS0128 and CS0136.
15030 (Block.DoResolve): Report all unused labels (warning CS0164).
15031 (LabeledStatement): Pass the location to the constructor.
15032 (LabeledStatement.HasBeenReferenced): New property.
15033 (LabeledStatement.Resolve): Set it to true here.
15035 * statement.cs (Return.Emit): Return success even after reporting
15036 a type mismatch error (CS0126 or CS0127), this is what csc does and
15037 it avoids confusing the users with any consecutive errors.
15039 2002-08-05 Martin Baulig <martin@gnome.org>
15041 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15043 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15045 * expression.cs (MemberAccess.DoResolve): Silently return if an
15046 error has already been reported.
15048 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15049 error has already been reported.
15051 2002-08-05 Martin Baulig <martin@gnome.org>
15053 * statement.cs (UsageVector): Only initialize the `parameters'
15054 vector if we actually have any "out" parameters.
15056 2002-08-05 Martin Baulig <martin@gnome.org>
15058 * expression.cs (Binary.ResolveOperator): When combining delegates,
15059 they must have the same type.
15061 2002-08-05 Martin Baulig <martin@gnome.org>
15063 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15064 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15065 work with the ms runtime and we also don't need it: if we're a
15066 PropertyBuilder and not in the `indexer_arguments' hash, then we
15067 are a property and not an indexer.
15069 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15070 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15071 since the latter one doesn't work with the ms runtime.
15073 2002-08-03 Martin Baulig <martin@gnome.org>
15075 Fixed bugs #27998 and #22735.
15077 * class.cs (Method.IsOperator): New public field.
15078 (Method.CheckBase): Report CS0111 if there's already a method
15079 with the same parameters in the current class. Report CS0508 when
15080 attempting to change the return type of an inherited method.
15081 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15082 and it's not marked abstract or extern.
15083 (PropertyBase): New abstract base class for Property and Indexer.
15084 (PropertyBase.CheckBase): Moved here from Property and made it work
15086 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15087 the same so we can reuse it there.
15088 (Property, Indexer): Derive from PropertyBase.
15089 (MethodSignature.inheritable_property_signature_filter): New delegate
15090 to find properties and indexers.
15092 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15093 argument and improved error reporting.
15095 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15096 EmptyReadOnlyParameters and made it a property.
15098 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15099 version of this method which takes a `PropertyInfo indexer'.
15100 (TypeManager.RegisterIndexer): New method.
15102 * class.cs: Added myself as author of this file :-)
15104 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15106 * class.cs: fixed compilation on windoze.
15108 2002-08-03 Martin Baulig <martin@gnome.org>
15110 * interface.cs (Interface.GetInterfaceBases): Check whether all
15111 base interfaces are at least as accessible than the current one.
15113 * class.cs (TypeContainer.GetClassBases): Check whether base types
15114 are at least as accessible than the current type.
15115 (TypeContainer.AsAccessible): Implemented and made non-static.
15116 (MemberBase.CheckParameters): Report errors if the accessibility
15119 * delegate.cs (Delegate.Delegate): The default visibility is
15120 internal for top-level types and private for nested types.
15121 (Delegate.Define): Report errors if the accessibility checks fail.
15123 * enum.cs (Enum.Enum): The default visibility is internal for
15124 top-level types and private for nested types.
15125 (Enum.DefineType): Compute the correct visibility.
15127 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15128 function which takes a `bool is_toplevel' instead of a TypeContainer.
15130 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15133 2002-08-02 Martin Baulig <martin@gnome.org>
15135 * expression.cs (LocalVariableReferenc): Added constructor which
15136 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15137 (LocalVariableReference.IsReadOnly): New property.
15138 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15139 variable is readonly, use our own readonly flag to do this; you can
15140 use the new constructor to get a writable reference to a read-only
15143 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15144 reference to the local variable.
15146 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15148 * rootcontext.cs (ResolveCore): Also include System.Exception
15150 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15151 we reach an EmptyStatement.
15153 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15156 * expression.cs (Binary.ResolveOperator): Check error result in
15159 use brtrue/brfalse directly and avoid compares to null.
15161 2002-08-02 Martin Baulig <martin@gnome.org>
15163 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15164 Fixes bug #28407, added test-155.cs.
15166 2002-08-01 Martin Baulig <martin@gnome.org>
15168 * class.cs (Event.EmitDefaultMethod): Make this work with static
15169 events. Fixes #28311, added verify-3.cs.
15171 2002-08-01 Martin Baulig <martin@gnome.org>
15173 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15174 `is_disposable' fields.
15175 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15176 `hm.is_disposable' if we're using the collection pattern.
15177 (Foreach.EmitCollectionForeach): Use the correct type for the
15178 enumerator's local variable, only emit the try/finally block if
15179 necessary (fixes #27713).
15181 2002-08-01 Martin Baulig <martin@gnome.org>
15183 * ecore.cs (Expression.report118): Renamed to Error118 and made
15186 * statement.cs (Throw.Resolve): Check whether the expression is of
15187 the correct type (CS0118) and whether the type derives from
15188 System.Exception (CS0155).
15189 (Catch.Resolve): New method. Do the type lookup here and check
15190 whether it derives from System.Exception (CS0155).
15191 (Catch.CatchType, Catch.IsGeneral): New public properties.
15193 * typemanager.cs (TypeManager.exception_type): Added.
15195 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15197 * driver.cs: Updated About function.
15199 2002-07-31 Martin Baulig <martin@gnome.org>
15201 Implemented Control Flow Analysis.
15203 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15204 (EmitContext.CurrentBranching): Added.
15205 (EmitContext.StartFlowBranching): Added.
15206 (EmitContext.EndFlowBranching): Added.
15207 (EmitContext.KillFlowBranching): Added.
15208 (EmitContext.IsVariableAssigned): Added.
15209 (EmitContext.SetVariableAssigned): Added.
15210 (EmitContext.IsParameterAssigned): Added.
15211 (EmitContext.SetParameterAssigned): Added.
15212 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15213 Added control flow analysis stuff here.
15215 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15216 resolve the expression as lvalue.
15217 (LocalVariableReference.DoResolve): Check whether the variable has
15218 already been assigned.
15219 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15220 the parameter as assigned here.
15221 (ParameterReference.DoResolve): Check whether the parameter has already
15223 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15224 expression as lvalue.
15226 * statement.cs (FlowBranching): New class for the flow analysis code.
15227 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15228 (LabeledStatement.IsDefined): New public property.
15229 (LabeledStatement.AddUsageVector): New public method to tell flow
15230 analyis that the label may be reached via a forward jump.
15231 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15233 (VariableInfo.Number): New public field. This is used by flow analysis
15234 to number all locals of a block.
15235 (Block.CountVariables): New public property. This is the number of
15236 local variables in this block (including the locals from all parent
15238 (Block.EmitMeta): Number all the variables.
15240 * statement.cs: Added flow analysis support to all classes.
15242 2002-07-31 Martin Baulig <martin@gnome.org>
15244 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15245 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15246 then use this argument.
15248 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15250 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15251 use this to specify /define options.
15253 2002-07-29 Martin Baulig <martin@gnome.org>
15255 * statement.cs (Fixed): Moved all code that does variable lookups
15256 and resolvings from Emit to Resolve.
15258 * statement.cs (For): Moved all code that does variable lookups
15259 and resolvings from Emit to Resolve.
15261 * statement.cs (Using): Moved all code that does variable lookups
15262 and resolvings from Emit to Resolve.
15264 2002-07-29 Martin Baulig <martin@gnome.org>
15266 * attribute.cs (Attribute.Resolve): Explicitly catch a
15267 System.NullReferenceException when creating the
15268 CustromAttributeBuilder and report a different warning message.
15270 2002-07-29 Martin Baulig <martin@gnome.org>
15272 * support.cs (ParameterData.ParameterName): Added method to
15273 get the name of a parameter.
15275 * typemanager.cs (TypeManager.IsValueType): New public method.
15277 2002-07-29 Martin Baulig <martin@gnome.org>
15279 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
15280 is a flag which specifies that it's either ref or out.
15281 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15282 the out parameter to `out Parameter.Modifier mod', also set the
15283 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15285 * support.cs (InternalParameters.ParameterModifier): Distinguish
15286 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15287 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15289 * expression.cs (Argument.GetParameterModifier): Distinguish
15290 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15291 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15293 2002-07-29 Martin Baulig <martin@gnome.org>
15295 * expression.cs (ParameterReference.ParameterReference): Added
15296 `Location loc' argument to the constructor.
15298 * cs-parser.jay: Pass location to ParameterReference.
15300 2002-07-28 Miguel de Icaza <miguel@ximian.com>
15302 * statement.cs (Try): Initialize the location.
15304 * cs-parser.jay: pass location to Try.
15306 * expression.cs (Unary.Reduce): Change the prototype to return
15307 whether a constant fold could be performed or not. The result is
15308 returned in an out parameters. In the case of Indirection and
15309 AddressOf, we want to perform the full tests.
15311 2002-07-26 Miguel de Icaza <miguel@ximian.com>
15313 * statement.cs (Statement.Emit): Flag dead code.
15315 2002-07-27 Andrew Birkett <andy@nobugs.org>
15317 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15319 2002-07-27 Martin Baulig <martin@gnome.org>
15321 * class.cs (MethodData.Define): Put back call to
15322 TypeManager.AddMethod(), accidentally commented this out.
15324 * report.cs (Debug): New public method to print debugging information,
15325 this is `[Conditional ("DEBUG")]'.
15327 2002-07-26 Martin Baulig <martin@gnome.org>
15329 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15330 (switch_statement): Push the current_block to the switch_stack and
15331 pop it again when we're done with the switch.
15332 (switch_section): The new block is a child of the current_block.
15333 Fixes bug #24007, added test-152.cs.
15335 2002-07-27 Martin Baulig <martin@gnome.org>
15337 * expression.cs (Invocation.EmitArguments): When calling a varargs
15338 function with only its fixed arguments, we need to pass an empty
15341 2002-07-27 Martin Baulig <martin@gnome.org>
15343 Mono 0.13 has been released.
15345 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15347 * driver.cs: Rename --resource to --linkres, because that is what
15348 we do currently, we dont support --resource yet.
15350 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15352 2002-07-25 Martin Baulig <martin@gnome.org>
15354 * class.cs (MethodData): New public class. This is a `method builder'
15355 class for a method or one accessor of a Property/Indexer/Event.
15356 (MethodData.GetMethodFlags): Moved here from MemberBase.
15357 (MethodData.ApplyAttributes): Likewise.
15358 (MethodData.ApplyObsoleteAttribute): Likewise.
15359 (MethodData.ApplyConditionalAttribute): Likewise.
15360 (MethodData.ApplyDllImportAttribute): Likewise.
15361 (MethodData.CheckAbstractAndExternal): Likewise.
15362 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15363 (MethodData.Emit): Formerly known as Method.Emit().
15364 (MemberBase): Moved everything which was specific to a single
15365 accessor/method to MethodData.
15366 (Method): Create a new MethodData and call Define() and Emit() on it.
15367 (Property, Indexer, Event): Create a new MethodData objects for each
15368 accessor and call Define() and Emit() on them.
15370 2002-07-25 Martin Baulig <martin@gnome.org>
15372 Made MethodCore derive from MemberBase to reuse the code from there.
15373 MemberBase now also checks for attributes.
15375 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15376 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15378 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15379 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15380 (MemberBase.ApplyAttributes): New virtual method; applies the
15381 attributes to a method or accessor.
15382 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15383 (MemberBase.ApplyConditionalAttribute): Likewise.
15384 (MemberBase.ApplyDllImportAttribute): Likewise.
15385 (MemberBase.CheckAbstractAndExternal): Likewise.
15386 (MethodCore.ParameterTypes): This is now a property instead of a
15387 method, it's initialized from DoDefineParameters().
15388 (MethodCore.ParameterInfo): Removed the set accessor.
15389 (MethodCore.DoDefineParameters): New protected virtual method to
15390 initialize ParameterTypes and ParameterInfo.
15391 (Method.GetReturnType): We can now simply return the MemberType.
15392 (Method.GetMethodFlags): Override the MemberBase version and add
15393 the conditional flags.
15394 (Method.CheckBase): Moved some code from Define() here, call
15395 DoDefineParameters() here.
15396 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15397 here to avoid some larger code duplication.
15398 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15399 ensure that abstract and external accessors don't declare a body.
15401 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15402 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15403 lookup in the attribute's parent classes, so we need to abort as soon
15404 as we found the first match.
15405 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15406 the attribute has no arguments.
15408 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15411 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15413 * cs-parser.jay: reverted previous patch.
15415 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15417 * cs-parser.jay: fixed bug #22119.
15419 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15421 * attribute.cs: fixed compilation. The error was:
15422 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
15423 be assigned to before control leaves the current method."
15424 [FIXME: Filed as bug #28186: MCS must report this error.]
15426 2002-07-25 Martin Baulig <martin@gnome.org>
15428 * attribute.cs (Attribute.Conditional_GetConditionName): New static
15429 method to pull the condition name ouf of a Conditional attribute.
15430 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15431 the obsolete message and error flag out of an Obsolete attribute.
15433 * class.cs (Method.GetMethodFlags): New public method to get the
15434 TypeManager.MethodFlags for this method.
15435 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15437 (Method.Define): Get and apply the Obsolete and Conditional attributes;
15438 if we're overriding a virtual function, set the new private variable
15439 `parent_method'; call the new TypeManager.AddMethod().
15441 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
15442 the MethodBuilder and the Method in a PtrHashtable.
15443 (TypeManager.builder_to_method): Added for this purpose.
15444 (TypeManager.MethodFlags): Added IsObsoleteError.
15445 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
15446 Obsolete and Conditional arguments in MethodBuilders. If we discover
15447 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15448 the message from the attribute.
15450 2002-07-24 Martin Baulig <martin@gnome.org>
15452 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15453 preprocessor directives, ensure that the argument to #define/#undef is
15454 exactly one identifier and that it's actually an identifier.
15456 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15459 2002-07-24 Martin Baulig <martin@gnome.org>
15461 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15462 initialize it to TypeManager.object_type in the constructor.
15463 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15464 of the `hm.get_current' method if we're using the collection pattern.
15465 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15466 for the explicit conversion to make it work when we're using the collection
15467 pattern and the `Current' property has a different return type than `object'.
15470 2002-07-24 Martin Baulig <martin@gnome.org>
15472 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15473 does not match, but don't report any errors. This method is called in
15474 order for all methods in a MethodGroupExpr until a matching method is
15475 found, so we don't want to bail out if the first method doesn't match.
15476 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15477 matches, report the 123. Fixes #28070.
15479 2002-07-24 Martin Baulig <martin@gnome.org>
15481 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15482 TypeManager.TypeToCoreType() to the top of the method so the
15483 following equality checks will work. Fixes #28107.
15485 2002-07-24 Martin Baulig <martin@gnome.org>
15487 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15488 operand is of type uint, and the other operand is of type sbyte,
15489 short or int, the operands are converted to type long." -
15490 Actually do what this comment already told us. Fixes bug #28106,
15493 2002-07-24 Martin Baulig <martin@gnome.org>
15495 * class.cs (MethodBase): New abstract class. This is now a base
15496 class for Property, Indexer and Event to avoid some code duplication
15497 in their Define() and DefineMethods() methods.
15498 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15499 generic methods for Define() and DefineMethods().
15500 (FieldBase): Derive from MemberBase, not MemberCore.
15501 (Property): Derive from MemberBase, not MemberCore.
15502 (Property.DefineMethod): Moved all the code from this method to the
15503 new MethodBase.DefineAccessor(), just call it with appropriate
15505 (Property.Define): Call the new Property.DoDefine(), this does some
15506 sanity checks and we don't need to duplicate the code everywhere.
15507 (Event): Derive from MemberBase, not MemberCore.
15508 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15509 accessors, this will also make them work with interface events.
15510 (Indexer): Derive from MemberBase, not MemberCore.
15511 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15512 (Indexer.Define): Use the new MethodBase functions.
15514 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15515 argument to the constructor.
15516 (Interface.FindMembers): Added support for interface events.
15517 (Interface.PopluateEvent): Implemented.
15519 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
15521 2002-07-22 Miguel de Icaza <miguel@ximian.com>
15523 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15524 but this is required to check for a method name being the same as
15525 the containing class.
15529 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15531 * interface.cs: initialize variable.
15533 2002-07-23 Martin Baulig <martin@gnome.org>
15535 Implemented the IndexerName attribute in interfaces.
15537 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15538 name if this is an explicit interface implementation.
15539 (Indexer.InterfaceIndexerName): New public variable. If we're
15540 implementing an interface indexer, this is the IndexerName in that
15541 interface. Otherwise, it's the IndexerName.
15542 (Indexer.DefineMethod): If we're implementing interface indexer,
15543 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
15544 and Pending.ImplementIndexer methods.
15545 (Indexer.Define): Also define the PropertyBuilder if we're
15546 implementing an interface indexer and this is neither an explicit
15547 interface implementation nor do the IndexerName match the one in
15550 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15551 If a method is defined here, then we always need to create a proxy
15552 for it. This is used when implementing interface indexers.
15553 (Pending.IsInterfaceIndexer): New public method.
15554 (Pending.ImplementIndexer): New public method.
15555 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15556 This is used when implementing interface indexers to define a proxy
15558 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15559 define a proxy if necessary.
15561 * interface.cs (Interface.IndexerName): New public variable.
15562 (Interface.PopulateIndexer): Set the IndexerName.
15563 (Interface.DefineIndexers): New private method. Populate all the
15564 indexers and make sure their IndexerNames match.
15566 * typemanager.cs (IndexerPropertyName): Added support for interface
15569 2002-07-22 Martin Baulig <martin@gnome.org>
15571 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15572 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15573 ret if HasReturnLabel.
15574 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15577 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15578 and set the ec.LoopBeginTryCatchLevel.
15579 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15580 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15581 the current ec.TryCatchLevel, the branch goes out of an exception
15582 block. In this case, we need to use Leave and not Br.
15584 2002-07-22 Martin Baulig <martin@gnome.org>
15586 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15587 block unless the block does not always return or it is contained in
15588 another try { ... } catch { ... } block. Fixes bug #26506.
15589 Added verify-1.cs to the test suite.
15591 2002-07-22 Martin Baulig <martin@gnome.org>
15593 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15594 then we do not always return. Fixes bug #24985.
15596 2002-07-22 Martin Baulig <martin@gnome.org>
15598 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15599 lookup on a per-class level; ie. walk up the class hierarchy until we
15600 found at least one applicable method, then choose the best among them.
15601 Fixes bug #24463 and test-29.cs.
15603 2002-07-22 Martin Baulig <martin@gnome.org>
15605 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15606 return types of the methods. The return type is not part of the
15607 signature and we must not check it to make the `new' modifier work.
15608 Fixes bug #27999, also added test-147.cs.
15609 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15611 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15612 on the method's return type.
15614 2002-07-21 Martin Baulig <martin@gnome.org>
15616 * assign.cs: Make this work if the rightmost source is a constant and
15617 we need to do an implicit type conversion. Also adding a few more tests
15618 to test-38.cs which should have caught this.
15620 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15621 target in the makefile for this. The makefile.gnu is primarily intended
15622 for end-users who don't want to debug the compiler.
15624 2002-07-21 Martin Baulig <martin@gnome.org>
15626 * assign.cs: Improved the Assign class so it can now handle embedded
15627 assignments (X = Y = Z = something). As a side-effect this'll now also
15628 consume less local variables. test-38.cs now passes with MCS, added
15629 a few new test cases to that test.
15631 2002-07-20 Martin Baulig <martin@gnome.org>
15633 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15634 instructions. Fixes bug #27977, also added test-146.cs.
15636 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15638 * cs-tokenizer.cs: fixed getHex ().
15640 2002-07-19 Martin Baulig <martin@gnome.org>
15642 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15643 not Type.GetType() to lookup the array type. This is needed when
15644 we're constructing an array of a user-defined type.
15645 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15646 single-dimensional arrays, but also for single-dimensial arrays of
15649 2002-07-19 Martin Baulig <martin@gnome.org>
15651 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15652 this function is called, it's not allowed to share LocalBuilders
15653 among ILGenerators.
15655 2002-07-19 Martin Baulig <martin@gnome.org>
15657 * expression.cs (Argument.Resolve): Report an error 118 when trying
15658 to pass a type as argument.
15660 2002-07-18 Martin Baulig <martin@gnome.org>
15662 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15663 Conv_R_Un for the signed `long' type.
15665 2002-07-15 Miguel de Icaza <miguel@ximian.com>
15667 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15668 `expr' for the temporary result, as that will fail if we do
15669 multiple resolves on the same expression.
15671 2002-07-05 Miguel de Icaza <miguel@ximian.com>
15673 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15674 ec.TypeContainer for looking up aliases.
15676 * class.cs (TypeContainer): Remove LookupAlias from here.
15678 * decl.cs (DeclSpace); Move here.
15680 2002-07-01 Miguel de Icaza <miguel@ximian.com>
15682 * class.cs (FindMembers): Only call filter if the constructor
15683 bulider is not null.
15685 Also handle delegates in `NestedTypes' now. Now we will perform
15686 type lookups using the standard resolution process. This also
15689 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15690 This uses Expressions (the limited kind that can be parsed by the
15691 tree) instead of strings.
15693 * expression.cs (ComposedCast.ToString): Implement, used to flag
15694 errors since now we have to render expressions.
15696 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
15699 * ecore.cs (SimpleName.ToString): ditto.
15701 * cs-parser.jay: Instead of using strings to assemble types, use
15702 Expressions to assemble the type (using SimpleName, ComposedCast,
15703 MemberAccess). This should fix the type lookups in declarations,
15704 because we were using a different code path for this.
15706 * statement.cs (Block.Resolve): Continue processing statements
15707 even when there is an error.
15709 2002-07-17 Miguel de Icaza <miguel@ximian.com>
15711 * class.cs (Event.Define): Also remove the `remove' method from
15712 the list of pending items.
15714 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15715 generate more compact code.
15717 2002-07-17 Martin Baulig <martin@gnome.org>
15719 * const.cs (Const.LookupConstantValue): Add support for constant
15720 `unchecked' and `checked' expressions.
15721 Also adding test case test-140.cs for this.
15723 2002-07-17 Martin Baulig <martin@gnome.org>
15725 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15726 check whether mi.ReturnType implements the IEnumerator interface; the
15727 `==' and the IsAssignableFrom() will fail in this situation.
15729 2002-07-16 Ravi Pratap <ravi@ximian.com>
15731 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
15734 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15736 * expression.cs: fixed bug #27811.
15738 2002-07-14 Miguel de Icaza <miguel@ximian.com>
15740 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15741 Molaro: when we are a ref, the value already contains a pointer
15742 value, do not take the address of it.
15744 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15745 * removed mb-parser.jay and mb-tokenizer.cs
15747 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15749 * expression.cs: check against the building corlib void type.
15751 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15753 * ecore.cs: fix for valuetype static readonly fields: when
15754 initializing them, we need their address, not the address of a copy.
15756 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15758 * typemanager.cs: register also enum_type in corlib.
15760 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15762 * class.cs: allow calling this (but not base) initializers in structs.
15764 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15766 * ecore.cs: make sure we compare against the building base types
15769 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15771 * typemanager.cs: fix TypeToCoreType() to handle void and object
15772 (corlib gets no more typerefs after this change).
15774 2002-07-12 Miguel de Icaza <miguel@ximian.com>
15776 * expression.cs (ArrayCreation.EmitArrayArguments): use
15777 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15779 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15780 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
15781 array indexes, the runtime actually forbids them.
15783 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15784 for array arguments here.
15786 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15787 instead of the default for ValueTypes.
15789 (New.DoEmit): Use IsValueType instead of
15790 IsSubclassOf (value_type)
15791 (New.DoResolve): ditto.
15792 (Invocation.EmitCall): ditto.
15794 * assign.cs (Assign): ditto.
15796 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15797 Statements *are* currently doing part of their resolution during
15800 Expressions do always resolve during resolve, but statements are
15801 only required to propagate resolution to their children.
15803 2002-07-11 Miguel de Icaza <miguel@ximian.com>
15805 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15807 (LoadAssembly): Do not add the dll if it is already specified
15809 (MainDriver): Add the System directory to the link path at the end,
15810 after all the other -L arguments.
15812 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15813 wrong opcode for loading bytes and bools (ldelem.i1 instead of
15814 ldelem.u1) and using the opposite for sbytes.
15816 This fixes Digger, and we can finally run it.
15818 * driver.cs (UnixParseOption): Move the option parsing here.
15819 (CSCParseOption): Implement CSC-like parsing of options.
15821 We now support both modes of operation, the old Unix way, and the
15822 new CSC-like way. This should help those who wanted to make cross
15823 platform makefiles.
15825 The only thing broken is that /r:, /reference: and /lib: are not
15826 implemented, because I want to make those have the same semantics
15827 as the CSC compiler has, and kill once and for all the confussion
15828 around this. Will be doing this tomorrow.
15830 * statement.cs (Unsafe.Resolve): The state is checked during
15831 resolve, not emit, so we have to set the flags for IsUnsfe here.
15833 2002-07-10 Miguel de Icaza <miguel@ximian.com>
15835 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15836 not catch the Error_ObjectRefRequired in SimpleName (as it is
15837 possible to have a class/instance variable name that later gets
15838 deambiguated), we have to check this here.
15840 2002-07-10 Ravi Pratap <ravi@ximian.com>
15842 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15843 make static and put into Expression.
15845 (Event.Define): Register the private field of the event with the
15846 TypeManager so that GetFieldFromEvent can get at it.
15848 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15849 keep track of the private field associated with an event which
15852 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15855 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15857 2002-07-10 Miguel de Icaza <miguel@ximian.com>
15859 * expression.cs (Binary.EmitBranchable): this routine emits the
15860 Binary expression in a branchable context. This basically means:
15861 we need to branch somewhere, not just get the value on the stack.
15863 This works together with Statement.EmitBoolExpression.
15865 * statement.cs (Statement.EmitBoolExpression): Use
15868 2002-07-09 Miguel de Icaza <miguel@ximian.com>
15870 * statement.cs (For): Reduce the number of jumps in loops.
15872 (For): Implement loop inversion for the For statement.
15874 (Break): We can be breaking out of a Try/Catch controlled section
15875 (foreach might have an implicit try/catch clause), so we need to
15876 use Leave instead of Br.
15878 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15879 now). If the instace expression supports IMemoryLocation, we use
15880 the AddressOf method from the IMemoryLocation to extract the
15881 address instead of emitting the instance.
15883 This showed up with `This', as we were emitting the instance
15884 always (Emit) instead of the Address of This. Particularly
15885 interesting when This is a value type, as we dont want the Emit
15886 effect (which was to load the object).
15888 2002-07-08 Miguel de Icaza <miguel@ximian.com>
15890 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15892 * statement.cs (Checked): Set the CheckedState during the resolve
15893 process too, as the ConvCast operations track the checked state on
15894 the resolve process, and not emit.
15896 * cs-parser.jay (namespace_member_declaration): Flag that we have
15897 found a declaration when we do. This is used to flag error 1529
15899 * driver.cs: Report ok when we display the help only.
15901 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
15903 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15905 2002-07-04 Miguel de Icaza <miguel@ximian.com>
15907 * cs-tokenizer.cs (define): We also have to track locally the
15908 defines. AllDefines is just used for the Conditional Attribute,
15909 but we also need the local defines for the current source code.
15911 2002-07-03 Miguel de Icaza <miguel@ximian.com>
15913 * statement.cs (While, For, Do): These loops can exit through a
15914 Break statement, use this information to tell whether the
15915 statement is the last piece of code.
15917 (Break): Flag that we break.
15919 * codegen.cs (EmitContexts): New `Breaks' state variable.
15921 2002-07-03 Martin Baulig <martin@gnome.org>
15923 * class.cs (TypeContainer.MethodModifiersValid): Allow override
15924 modifiers in method declarations in structs. Otherwise, you won't
15925 be able to override things like Object.Equals().
15927 2002-07-02 Miguel de Icaza <miguel@ximian.com>
15929 * class.cs (Method, Property, Indexer): Do not allow the public
15930 modifier to be used in explicit interface implementations.
15932 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15933 override modifiers in method declarations in structs
15935 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
15937 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15938 integer or real overflow, report an error
15940 2002-07-02 Martin Baulig <martin@gnome.org>
15942 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15943 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15944 to tell the runtime about our newly created System.Object and
15945 System.ValueType types.
15947 2002-07-02 Miguel de Icaza <miguel@ximian.com>
15949 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15950 struct instead of Ldarg/Starg.
15952 2002-07-02 Martin Baulig <martin@gnome.org>
15954 * expression.cs (Indirection.Indirection): Call
15955 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15957 2002-07-02 Martin Baulig <martin@gnome.org>
15959 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15960 ValueType, call TypeManager.TypeToCoreType() on it.
15961 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15962 the OpCodes.Newarr argument.
15964 2002-07-02 Martin Baulig <martin@gnome.org>
15966 * expression.cs (Invocation.EmitCall): When compiling corlib,
15967 replace all calls to the system's System.Array type to calls to
15968 the newly created one.
15970 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15971 System.Array methods.
15972 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15973 from the system's System.Array type which must be replaced.
15975 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15977 * typemanager.cs: load unverifiable_code_ctor so we can build
15978 corlib using the correct type. Avoid using GetTypeCode() with
15980 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15981 TypeManager.object_type to allow building corlib.
15983 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15985 * ecore.cs: handle System.Enum separately in LoadFromPtr().
15987 2002-07-01 Martin Baulig <martin@gnome.org>
15989 * class.cs: Make the last change actually work, we need to check
15990 whether `ifaces != null' to avoid a crash.
15992 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15994 * class.cs: when we build structs without fields that implement
15995 interfaces, we need to add the interfaces separately, since there is
15996 no API to both set the size and add the interfaces at type creation
15999 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16001 * expression.cs: the dimension arguments to the array constructors
16002 need to be converted if they are a long.
16004 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16006 * class.cs: don't emit ldarg.0 if there is no parent constructor
16007 (fixes showstopper for corlib).
16009 2002-06-29 Martin Baulig <martin@gnome.org>
16011 MCS now compiles corlib on GNU/Linux :-)
16013 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16014 ie. check for MethodImplOptions.InternalCall.
16016 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16017 and TypeManager.attribute_type are null, so we must explicitly check
16018 whether parent is not null to find out whether it's an attribute type.
16019 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16020 and SetBuilder, not only if the property is neither abstract nor external.
16021 This is necessary to set the MethodImplOptions on the accessor methods.
16022 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16023 SetBuilder, see Property.Emit().
16025 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16026 populate "System.Object", "System.ValueType" and "System.Attribute" since
16027 they've already been populated from BootCorlib_PopulateCoreTypes().
16029 2002-06-29 Martin Baulig <martin@gnome.org>
16031 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16032 is the NullLiteral, we also need to make sure that target_type is not
16035 2002-06-29 Martin Baulig <martin@gnome.org>
16037 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16038 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16039 before calling BootstrapCorlib_ResolveDelegate ().
16041 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16043 * statement.cs: fixed build-breaker. All tests passed ok.
16045 2002-06-27 Martin Baulig <martin@gnome.org>
16047 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16048 for System.Decimal when compiling corlib.
16050 2002-06-27 Martin Baulig <martin@gnome.org>
16052 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16053 switch blocks which contain nothing but a default clause.
16055 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16057 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16059 2002-06-27 Martin Baulig <martin@gnome.org>
16061 * ecore.cs (PropertyExpr.PropertyExpr): Call
16062 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16064 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16065 is already a TypeBuilder.
16067 2002-06-27 Martin Baulig <martin@gnome.org>
16069 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16070 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16071 the "from an array-type to System.Array" case. This makes it work
16072 when compiling corlib.
16074 2002-06-27 Martin Baulig <martin@gnome.org>
16076 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16077 non-static PropertyExpr, set its InstanceExpression. This makes
16078 the `ICollection.Count' property work in System/Array.cs.
16080 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16082 * driver.cs: Made error handling more consistent. Errors now
16083 tracked by Report class, so many methods which used to return int
16084 now return void. Main() now prints success/failure and
16085 errors/warnings message.
16087 Renamed '--probe' compiler argument to '--expect-error'. Removed
16088 the magic number return values (123 and 124). Now, if the
16089 expected error occurs, the compiler exits with success (exit value
16090 0). If the compilation completes without seeing that particular
16091 error, the compiler exits with failure (exit value 1). The
16092 makefile in mcs/errors has been changed to handle the new behaviour.
16094 * report.cs: Made 'expected error' number a property and renamed
16095 it from 'Probe' to 'ExpectedError'.
16097 * genericparser.cs: Removed error handling support, since it is
16098 now all done by Report class.
16100 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16101 class, so parse() no longer returns an int.
16103 * namespace.cs: Use Report.Error instead of GenericParser.error
16105 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16107 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16108 TypeContainer.AddOperator): At the front of the list put the
16109 explicit implementations, so they get resolved/defined first.
16111 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16113 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16114 interface type is implemented by this TypeContainer. Used during
16115 explicit interface implementation.
16117 (Property.Define, Indexer.Define, Method.Define): Validate that
16118 the given interface in the explicit implementation is one of the
16119 base classes for the containing type.
16121 Also if we are explicitly implementing an interface, but there is
16122 no match in the pending implementation table, report an error.
16124 (Property.Define): Only define the property if we are
16125 not explicitly implementing a property from an interface. Use the
16126 correct name also for those properties (the same CSC uses,
16127 although that is really not needed).
16129 (Property.Emit): Do not emit attributes for explicitly implemented
16130 properties, as there is no TypeBuilder.
16132 (Indexer.Emit): ditto.
16134 Hiding then means that we do not really *implement* a pending
16135 implementation, which makes code fail.
16137 2002-06-22 Martin Baulig <martin@gnome.org>
16139 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16140 the return value of Object.GetType(). [FIXME: we need to do this whenever
16141 we get a type back from the reflection library].
16143 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16145 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16147 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16149 * attribute.cs: Return null if we can not look up the type.
16151 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16152 the interface types found.
16154 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16155 interface types found.
16157 * typemanager.cs (GetInterfaces): Make this routine returns alll
16158 the interfaces and work around the lame differences between
16159 System.Type and System.Reflection.Emit.TypeBuilder in the results
16160 result for GetInterfaces.
16162 (ExpandInterfaces): Given an array of interface types, expand and
16163 eliminate repeated ocurrences of an interface. This expands in
16164 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16167 2002-06-21 Martin Baulig <martin@gnome.org>
16169 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16172 2002-06-21 Martin Baulig <martin@gnome.org>
16174 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16175 and called with one of the core types, return the corresponding typebuilder for
16178 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16181 2002-06-21 Martin Baulig <martin@gnome.org>
16183 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16184 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16185 (Expression.ConvertReferenceExplicit): Likewise.
16187 * expression.cs (ElementAccess.DoResolve): Likewise.
16188 (ElementAccess.DoResolveLValue): Likewise.
16190 2002-06-10 Martin Baulig <martin@gnome.org>
16192 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16193 add the "value" parameter to the parameter list.
16195 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16198 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16200 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16201 the argument to an int, uint, long or ulong, per the spec. Also
16202 catch negative constants in array creation.
16204 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16206 * class.cs: do not allow the same interface to appear twice in
16207 the definition list.
16209 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16211 * ecore.cs: don't use ldlen with System.Array.
16213 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16215 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16217 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16219 * modifiers.cs: produce correct field attributes for protected
16220 internal. Easy fix so miguel can work on ther harder stuff:-)
16222 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16224 * pending.cs: New file. Move the code from class.cs here.
16225 Support clearning the pending flag for all methods (when not doing
16226 explicit interface implementation).
16228 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16230 * rootcontext.cs: added a couple more types needed to bootstrap.
16232 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16234 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16235 constructor in the type, instead of any constructor in the type
16236 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16237 a bug in the Mono runtime when applying the params attribute).
16239 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16240 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16242 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16244 * expression.cs (Unary.ResolveOperator): Use TypeManager
16245 to resolve the type.
16247 2002-06-13 Ravi Pratap <ravi@ximian.com>
16249 * cs-parser.jay (enum_member_declaration): Pass in the attributes
16252 * enum.cs (AddEnumMember): Add support to store the attributes associated
16253 with each member too.
16255 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16256 field builders too - this takes care of the enum member case.
16258 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
16260 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16261 address-of operator on both value types and pointers.
16263 2002-06-10 Martin Baulig <martin@gnome.org>
16265 * interface.cs (Interface.PopulateIndexer): Add the indexer's
16266 PropertyBuilder to the `property_builders' list.
16268 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16269 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16270 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
16271 find any indexers which are inherited from an interface.
16273 2002-06-09 Martin Baulig <martin@gnome.org>
16275 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16276 the same type as the constant if necessary. There's also a test-130.cs
16279 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16281 * typemanager.cs (TypeManager.ChangeType): Previously known as
16282 Enum.ChangeEnumType().
16284 2002-06-09 Martin Baulig <martin@gnome.org>
16286 * expression.cs (Cast.TryReduce): Added support for consts.
16288 2002-06-08 Ravi Pratap <ravi@ximian.com>
16290 * class.cs (Accessor): Hold attributes information so we can pass
16293 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16294 Modify to pass in attributes attached to the methods.
16296 (add_accessor_declaration, remove_accessor_declaration): Ditto.
16298 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16299 to handle the Accessor kind :-)
16301 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16303 2002-06-08 Martin Baulig <martin@gnome.org>
16305 * expression.cs (Unary.TryReduceNegative): Added support for
16308 2002-06-08 Martin Baulig <martin@gnome.org>
16310 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16311 name can't be found in the `defined_names' - the caller will do a
16312 MemberLookup in this case and thus find methods in System.Enum
16313 such as Enum.IsDefined().
16315 2002-06-08 Martin Baulig <martin@gnome.org>
16317 * enum.cs (Enum.ChangeEnumType): This is a custom version of
16318 Convert.ChangeType() which works with TypeBuilder created types.
16319 (Enum.LookupEnumValue, Enum.Define): Use it here.
16321 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16322 `TypeBuilder.BaseType != null' check.
16323 (TypeContainer.FindMembers): Only lookup parent members if we
16324 actually have a parent.
16325 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16326 (ConstructorInitializer.Resolve): Likewise.
16328 * interface.cs (Interface.FindMembers): Added
16329 `TypeBuilder.BaseType != null' check.
16331 * rootcontext.cs (RootContext.ResolveCore): Added
16332 "System.Runtime.CompilerServices.IndexerNameAttribute" to
16333 classes_second_stage.
16335 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16336 debug_type and trace_type when compiling with --nostdlib.
16338 2002-06-07 Martin Baulig <martin@gnome.org>
16340 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16341 (AddField): Set it to true when adding a non-static field.
16342 (DefineType): Use `have_nonstatic_fields' to find out whether we
16343 have non-static fields, not `Fields != null'.
16345 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16347 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16348 dereferencing a null on the static-field code path)
16350 2002-05-30 Martin Baulig <martin@gnome.org>
16352 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16353 to take command line arguments. Use reflection to call the new
16354 custom `Initialize' function on the symbol writer and pass it the
16355 command line arguments.
16357 * driver.cs (--debug-args): New command line argument to pass command
16358 line arguments to the symbol writer.
16360 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16362 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16363 the target type for indexers and properties. Thanks to Joe for
16366 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16368 * typemanager.cs (MethodFlags): returns the method flags
16369 (Obsolete/ShouldIgnore) that control warning emission and whether
16370 the invocation should be made, or ignored.
16372 * expression.cs (Invocation.Emit): Remove previous hack, we should
16373 not do this on matching a base type, we should do this based on an attribute
16375 Only emit calls to System.Diagnostics.Debug and
16376 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16377 on the command line.
16379 * rootcontext.cs: Global settings for tracing and debugging.
16381 * cs-tokenizer.cs (define): New utility function to track
16382 defines. Set the global settings for TRACE and DEBUG if found.
16384 2002-05-25 Ravi Pratap <ravi@ximian.com>
16386 * interface.cs (Populate*): Pass in the TypeContainer as well as
16387 the DeclSpace as parameters so that we can create EmitContexts and
16388 then use that to apply attributes etc.
16390 (PopulateMethod, PopulateEvent, PopulateProperty)
16391 (PopulateIndexer): Apply attributes everywhere.
16393 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16396 (ApplyAttributes): Update accordingly.
16398 We now apply interface attributes for all members too.
16400 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16402 * class.cs (Indexer.Define); Correctly check if we are explicit
16403 implementation (instead of checking the Name for a ".", we
16404 directly look up if the InterfaceType was specified).
16406 Delay the creation of the PropertyBuilder.
16408 Only create the PropertyBuilder if we are not an explicit
16409 interface implementation. This means that explicit interface
16410 implementation members do not participate in regular function
16411 lookups, and hence fixes another major ambiguity problem in
16412 overload resolution (that was the visible effect).
16414 (DefineMethod): Return whether we are doing an interface
16417 * typemanager.cs: Temporary hack until we get attributes in
16418 interfaces (Ravi is working on that) and we get IndexerName
16419 support in interfaces.
16421 * interface.cs: Register the indexers as properties.
16423 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16424 warning, I have verified that this is a bug in the .NET runtime
16425 (JavaScript suffers of the same problem).
16427 * typemanager.cs (MemberLookup): When looking up members for
16428 interfaces, the parent of an interface is the implicit
16429 System.Object (so we succeed in searches of Object methods in an
16430 interface method invocation. Example: IEnumerable x; x.ToString
16433 2002-05-25 Miguel de Icaza <miguel@ximian.com>
16435 * class.cs (Event): Events should also register if they do
16436 implement the methods that an interface requires.
16438 * typemanager.cs (MemberLookup); use the new GetInterfaces
16441 (GetInterfaces): The code used to lookup interfaces for a type is
16442 used in more than one place, factor it here.
16444 * driver.cs: Track the errors at the bottom of the file, we kept
16447 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16448 instance if the method we are calling is static!
16450 2002-05-24 Miguel de Icaza <miguel@ximian.com>
16452 * attribute.cs (ApplyAttributes): Make this function filter out
16453 the IndexerName attribute (as that attribute in reality is never
16454 applied) and return the string constant for the IndexerName
16457 * class.cs (TypeContainer.Emit): Validate that all the indexers
16458 have the same IndexerName attribute, and if so, set the
16459 DefaultName attribute on the class.
16461 * typemanager.cs: The return value might contain other stuff (not
16462 only methods). For instance, consider a method with an "Item"
16463 property and an Item method.
16465 * class.cs: If there is a problem with the parameter types,
16468 2002-05-24 Ravi Pratap <ravi@ximian.com>
16470 * ecore.cs (ImplicitConversionExists): Wrapper function which also
16471 looks at user defined conversion after making a call to
16472 StandardConversionExists - we need this for overload resolution.
16474 * expression.cs : Update accordingly the various method calls.
16476 This fixes 2 bugs filed against implicit user defined conversions
16478 2002-05-22 Miguel de Icaza <miguel@ximian.com>
16480 * statement.cs: Track the result of the assignment.
16482 2002-05-21 Miguel de Icaza <miguel@ximian.com>
16484 * expression.cs (MemberAccess): Improved error reporting for
16485 inaccessible members.
16487 2002-05-22 Martin Baulig <martin@gnome.org>
16489 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
16490 itself with debugging support.
16492 2002-05-22 Martin Baulig <martin@gnome.org>
16494 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16495 Removed, this isn't needed anymore.
16497 2002-05-20 Martin Baulig <martin@gnome.org>
16499 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16500 be underlying type for an enum.
16502 2002-05-20 Miguel de Icaza <miguel@ximian.com>
16504 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16505 that splits out the loading of just the core types.
16507 * rootcontext.cs (ResolveCore): Split the struct resolution in
16508 two, so we can load the enumeration underlying types before any
16511 * expression.cs (Is): Bandaid until we fix properly Switch (see
16512 bug #24985 for details).
16514 * typemanager.cs (ImplementsInterface): The hashtable will contain
16515 a null if there are no interfaces implemented.
16517 2002-05-18 Miguel de Icaza <miguel@ximian.com>
16519 * cs-parser.jay (indexer_declarator): It is fine to have array
16522 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16524 * typemanager.cs: (RegisterBuilder): New function used to register
16525 TypeBuilders that implement interfaces. Since
16526 TypeBuilder.GetInterfaces (as usual) does not work with lame
16528 (AddUserType): register interfaces.
16530 (ImplementsInterface): Use the builder_to_ifaces hash if we are
16531 dealing with TypeBuilder. Also, arrays are showing up as
16532 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16533 methods can not be invoked on them!
16535 * ecore.cs (ExplicitReferenceConversionExists): Made public.
16536 (ImplicitReferenceConversionExists): Split out from
16537 StandardConversionExists.
16539 * expression.cs (As): We were only implementing one of the three
16540 cases for the as operator. We now implement them all.
16541 (Is): Implement the various other cases for Is as well.
16543 * typemanager.cs (CACHE): New define used to control if we want or
16544 not the FindMembers cache. Seems to have a negative impact on
16545 performance currently
16547 (MemberLookup): Nested types have full acess to
16548 enclosing type members
16550 Remove code that coped with instance/static returns for events, we
16551 now catch this in RealFindMembers.
16553 (RealFindMembers): only perform static lookup if the instance
16554 lookup did not return a type or an event.
16556 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16558 * assign.cs (CompoundAssign): We pass more semantic information
16559 now to Compound Assignments than we did before: now we have all
16560 the information at hand, and now we resolve the target *before* we
16561 do the expression expansion, which allows the "CacheValue" method
16562 to have the effect we intended (before, a [x] += 1 would generate
16563 two differen ArrayAccess expressions from the ElementAccess,
16564 during the resolution process).
16566 (CompoundAssign.DoResolve): Resolve target and original_source here.
16568 2002-05-16 Miguel de Icaza <miguel@ximian.com>
16570 * expression.cs (ArrayAccess): dropped debugging information.
16572 * typemanager.cs: Small bug fix: I was always returning i_members,
16573 instead of one of i_members or s_members (depending on which had
16576 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
16577 method is invoked before any code generation takes place, and it
16578 is a mechanism to inform that the expression will be invoked more
16579 than once, and that the method should use temporary values to
16580 avoid having side effects
16582 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16584 * ecore.cs (Expression.CacheTemporaries): Provide empty default
16587 * expression.cs (Indirection, ArrayAccess): Add support for
16588 CacheTemporaries in these two bad boys.
16590 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16591 ldobj or ldind_ref.
16592 (StoreFromPtr): Handle stobj as well.
16594 * expression.cs (UnaryMutator): Share more code.
16596 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16597 down: I was not tracking the Filter function as well, which
16598 was affecting the results of the cache.
16600 2002-05-15 Miguel de Icaza <miguel@ximian.com>
16602 * attribute.cs: Remove the hack to handle the CharSet property on
16605 2002-05-14 Miguel de Icaza <miguel@ximian.com>
16607 * attribute.cs (DoResolve): More uglyness, we now only try to
16608 resolve the attribute partially, to extract the CharSet
16609 information (only if we are a StructLayout attribute). Otherwise
16611 (GetExtraTypeInfo): Add some code to conditionally kill in the
16612 future this. I am more and more convinced that the .NET
16613 framework has special code to handle the attribute setting on
16616 * expression.cs (IsParamsMethodApplicable): Revert my previous
16617 foreach change here, it was wrong.
16619 2002-05-13 Miguel de Icaza <miguel@ximian.com>
16621 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16622 (pp_expr): do not abort on unknown input, just return.
16623 (eval): abort if there are pending chars.
16625 * attribute.cs (Attribute.Resolve): Positional parameters are
16626 optional. Deal with that case.
16628 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16629 the Ansi/Unicode/Auto information for the type.
16631 (TypeContainer.DefineType): instantiate the EmitContext here, as
16632 we will be using it during the type definition (to resolve
16633 attributes) and during the emit phase.
16635 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16636 to pull type information out of the attributes
16638 (Attribute.Resolve): track the constructor builder, and allow for
16639 multiple invocations (structs and classes will use this).
16641 * ecore.cs (MemberLookupFinal): new version with all the
16642 parameters customizable.
16644 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16645 constructors. Return if the result value is null (as the error
16646 would have been flagged already by MemberLookupFinal)
16648 Do not allow instances of abstract classes or interfaces to be
16651 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16652 We have to compare the assembly property here when dealing with
16653 FamANDAssem and Assembly access modifiers, because we might be
16654 creating an assembly from *modules* (that means that we are not
16655 getting TypeBuilders for types defined in other modules that are
16656 part of this assembly).
16658 (Method.Emit): If the method is marked abstract and has a body,
16661 (TypeContainer.DefineMembers): If both the defined member and the
16662 parent name match are methods, then do not emit any warnings: let
16663 the Method.Define routine take care of flagging warnings. But if
16664 there is a mismatch (method overrides something else, or method is
16665 overriwritten by something, then emit warning).
16667 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16668 set to null, this means `do not check for the return type on the
16671 (Method.Define): set the return type for the method signature to
16672 null, so that we get methods with the same name and parameters and
16673 different return types. This is used to flag warning 114 (you are
16674 hiding a method, and you probably want to use the new/override
16677 * typemanager.cs (MemberLookup): Implemented proper access
16678 control, closing a long standing set of bug reports. The problem
16679 was that the Framework only has two bits: Public and NonPublic,
16680 and NonPublic includes private and protected methods, but we need
16681 to enforce the FamANDAssem, FamOrAssem and Family.
16683 2002-05-11 Miguel de Icaza <miguel@ximian.com>
16685 * statement.cs (GotoCase): Return true: Ammounts to giving up
16686 knowledge on whether we return or not, and letting the other case
16687 be responsible for it.
16689 2002-05-10 Miguel de Icaza <miguel@ximian.com>
16691 * driver.cs: Do not load directories for each file processed, only
16692 do it if there is a pattern.
16694 * ecore.cs: Report readonly assigns here as well, as we might have
16695 been resolved only by MemberAccess.
16697 (SimpleName.SimpleNameResolve): Also be useful for LValue
16698 resolution. We need this to propagate assign to local readonly variables
16700 * typemanager.cs: Use a ptrhashtable for the criteria, because we
16701 do not want to reuse potential criteria memory.
16703 * class.cs (MyEventBuilder): Set reflected_type;
16705 * ecore.cs (Constantify): Added support for constifying bools.
16707 (RootContext.LookupType): Added a cache for values looked up in
16708 the declaration space.
16710 * typemanager.cs (FindMembers): Now is a front-end to
16711 RealFindMembers, and provides a two-level hashtable-based cache to
16714 15% performance improvement: from 22.5 to 19.2 seconds.
16716 * expression.cs (IsParamsMethodApplicable): use foreach.
16717 (Invocation.DoResolve): ditto.
16718 (New.DoResolve): ditto.
16719 (ArrayCreation.DoResolve): ditto.
16721 * ecore.cs (FindMostEncompassingType): use foreach.
16723 * delegate.cs (NewDelegate.DoResolve): Use foreach
16725 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16726 (RemoveMethods): use foreach.
16728 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16729 nested foreach statements instead of for, and also break out of
16730 the inner loop once a match is found.
16732 (Invocation.OverloadResolve): Use foreach, simplify the code.
16734 2002-05-08 Miguel de Icaza <miguel@ximian.com>
16736 * cfold.cs (BinaryFold): During an enumeration evaluation context,
16737 we actually unwrap the expression to allow for extra information
16740 * expression.cs: Use Shr_Un on unsigned operations.
16742 2002-05-08 Ravi Pratap <ravi@ximian.com>
16744 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
16745 applicable operators was not being considered correctly. This closes
16746 the bug Miguel reported.
16748 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16750 * attribute.cs: check that the type derives from System.Attribute
16751 and report the correct error in that case (moved the duplicate code to
16752 its own method, too).
16754 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16756 * attribute.cs: lookup attribute type name as the spec says: first the
16757 bare attribute name and then name + "Attribute" (nant compiles with
16758 mcs after this fix).
16760 2002-05-07 Miguel de Icaza <miguel@ximian.com>
16762 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
16763 Because of the way we parse things, we should try to see if a
16764 UIntConstant can fit in an integer.
16766 2002-05-07 Ravi Pratap <ravi@ximian.com>
16768 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16769 when we are in an explicit context.
16771 (ConvertReferenceExplicit): When converting from Iface type S to Class
16772 T make sure the rules are implemented as an OR.
16774 * parameter.cs (ParameterType): Make it a property for now although the
16775 purpose really isn't anything immediate.
16777 * expression.cs (Is*Applicable): Do better checking on the parameter type
16778 of a ref/out parameter. The ones from the system assemblies are already
16779 marked with the correct type so we don't need to do any correction.
16781 * ecore.cs (StandardConversionExists): Conversion from Interface types to
16782 the object type is standard too so include that.
16784 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16786 * ecore.cs (StandardConversionExists): Augment with missing code:
16787 deal with IntConstant, LongConstants and Enumerations.
16789 * assign.cs: Report the error, instead of failing silently
16791 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16792 typecontainer that they are declared, because the
16793 typecontainer/namespace will have the list of using clauses that
16794 need to be applied.
16796 Assembly Attributes were escaping the normal registration
16799 (EmitCode): Apply attributes within an EmitContext that represents
16800 the container they were declared on.
16802 * cs-parser.jay: Track bases for structs. How did I get this wrong?
16804 2002-05-06 Ravi Pratap <ravi@ximian.com>
16806 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16807 Revamp completely - make much cleaner as we now operate only
16810 (FindMostSpecificSource, FindMostSpecificTarget): New methods
16811 to implement the logic detailed in the spec more correctly.
16813 (UserDefinedConversion): Update accordingly.
16815 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16817 * statement.cs: Return flow analysis information up.
16819 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16822 (token): Do not consume an extra character before calling
16825 2002-05-06 Piers Haken <piersh@friskit.com>
16827 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16829 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16831 * class.cs (Constructor.Emit): Set the IsStatic flag in the
16832 EmitContext during the instance constructor initializer
16833 resolution, to stop access to instance variables.
16835 This is mandated by the spec, last paragraph of the `constructor
16836 initializers' section.
16838 2002-05-05 Miguel de Icaza <miguel@ximian.com>
16840 * cs-parser.jay, class.cs (Accessor): new class used to represent
16841 an accessor (get or set). In the past we used `null' to represent
16842 a missing accessor. But this is ambiguous because there was no
16843 way to tell in abstract indexers/properties if one of them was
16846 Now there is a way of addressing that.
16848 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16849 instead of FindMembers.
16851 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16852 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16854 * attribute.cs: Treat indexers and properties as the same in terms
16855 of applying attributes
16857 * ecore.cs (FindMostEncompassedType): Use statically initialized
16858 EmptyExpressions()s like we do elsewhere to avoid creating useless
16859 objects (and we take this out of the tight loop).
16861 (GetConversionOperators): Move the code to extract the actual
16862 operators to a separate routine to clean things up.
16864 2002-05-04 Miguel de Icaza <miguel@ximian.com>
16866 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16867 events are always registered FieldBuilders.
16869 * class.cs (FieldBase): New class shared by Fields
16871 * delegate.cs: If we are a toplevel delegate, use our full name.
16872 If we are a nested delegate, then only use our tail name.
16874 2002-05-02 Ravi Pratap <ravi@ximian.com>
16876 * expression.cs (IsApplicable): Ensure that we add the "&" to
16877 ref/out types before comparing it with the type of the argument.
16879 (IsParamsMethodApplicable): Ditto.
16881 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
16884 * delegate.cs : Handle the case when we have more than one applicable
16885 method. Flag an error only when we finish checking all.
16887 2002-05-02 Miguel de Icaza <miguel@ximian.com>
16889 * expression.cs: Add support for boolean static initializers.
16891 2002-05-01 Miguel de Icaza <miguel@ximian.com>
16893 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16895 * parameter.cs (ComputeParameterTypes,
16896 ComputeAndDefineParameterTypes): Better error handling: now we
16897 clear the `types' cache if we fail during any of the type lookups.
16898 We also return the status code correctly to our caller
16900 * delegate.cs: If we fail to define a delegate, abort the extra
16903 * expression.cs (Binary.ResolveOperator): for
16904 operator==(object,object) and operator !=(object, object) we also
16905 have to verify that there is an implicit conversion from one to
16908 (ArrayAccess.DoResolve): Array Access can operate on
16911 2002-04-30 Miguel de Icaza <miguel@ximian.com>
16913 * assign.cs (CompoundAssign): A new class used as a "flag" that
16914 the assignment actually is happening as part of a compound
16915 assignment operator.
16917 During compound assignment, a few new rules exist to enable things
16924 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16925 to the type of x) if y is implicitly convertible to the type of x,
16926 and the operator is a builtin operator and the return type of the
16927 operator is explicitly convertible to the type of x.
16929 * rootcontext.cs: Reset warning level to 2. 4 catches various
16930 "interesting" features in mcs, we must clean this up at some
16931 point, but currently am trying to kill other bugs ;-)
16933 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16934 in container classes as well.
16936 * expression.cs (Binary.ResolveOperator): Handle string case
16937 before anything else (as operator overloading does emit an error
16938 before doing anything else).
16940 This code could go away when we move to a table driven model, but
16941 i could not come up with a good plan last night.
16943 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
16945 * typemanager.cs (CSharpName): reimplementation using regex.
16946 * class.cs: added null check for fields in Emit
16947 * rootcontext.cs: set warninglevel to 4
16949 2002-04-29 Miguel de Icaza <miguel@ximian.com>
16951 * typemanager.cs (CSharpName): reimplemented with Lupus
16954 2002-04-28 Miguel de Icaza <miguel@ximian.com>
16956 * statement.cs (If): correclty implement Resolve, because we were
16957 not catching sem errors in there. The same process is needed
16959 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16962 (Statement.Warning_DeadCodeFound): Factorize code.
16963 (While): Report dead code here too.
16965 (Statement): Added Resolve virtual method to allow
16966 for resolution split from the emit code.
16968 2002-04-26 Miguel de Icaza <miguel@ximian.com>
16970 * statement.cs (EmitBoolExpression): No longer try to resolve the
16972 (MakeBoolean): New utility function that resolve, implicitly
16973 converts to boolean and tags the expression.
16976 (If, Do): Implement dead code elimination.
16977 (While): Implement loop inversion
16979 (Do, While, For, If): Resolve the expression prior to calling our
16982 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
16985 - added method Report28 (warning: program has more than one entry point)
16986 - added method IsEntryPoint, implements paragraph 10.1 of the spec
16987 - modified method Method.Define, the part at the end of the method
16989 * rootcontext.cs: added static public Location EntryPointLocation;
16991 * ../errors/cs0028.cs : Add test case for the above warning.
16994 - modified method CSharpName to allow arrays of primitive type to
16995 be printed nicely (e.g. instead of System.Int32[][] it now prints
16997 - added method CSharpSignature: returns the signature of a method
16998 in string format to be used in reporting errors, warnings, etc.
17000 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17003 2002-04-26 Ravi Pratap <ravi@ximian.com>
17005 * delegate.cs (Define): Fix extremely silly bug where I was
17006 setting the type of the 'object' parameter of the BeginInvoke
17007 method to System.IAsyncResult instead of System.Object ;-)
17009 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17011 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17014 (Constructor.Emit): return if we fail to initialize the
17015 constructor. Another door closed!
17017 * expression.cs (New.DoResolve): Improve error message (from -6 to
17018 1501). Use DeclaredOnly lookup to find the exact constructor.
17020 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17021 loop. This is useful.
17023 * cs-parser.jay: Adjust the default parameters so that destructors
17024 have the proper signature.
17026 2002-04-26 Martin Baulig <martin@gnome.org>
17028 * driver.cs (LoadAssembly): If `assembly' contains any characters
17029 which are only valid in path names and not in assembly names
17030 (currently slash, backslash and point), use Assembly.LoadFrom ()
17031 instead of Assembly.Load () on the `assembly' (before iteration
17032 over the link_paths).
17034 2002-04-26 Martin Baulig <martin@gnome.org>
17036 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17038 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17040 * class.cs (Property): use the new typemanager.MemberLookup
17042 (TypeContainer.MemberLookup): Implement using the
17043 TypeManager.MemberLookup now.
17045 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17046 and return MemberInfos, so that these can be used without an
17047 EmitContext (what we had before).
17049 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17051 * expression.cs: Fix the case where the argument to params if the
17052 type of the params. I omitted handling this before. Fixed
17054 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17056 * driver.cs: Call BootCorlib_PopulateCoreType
17058 * class.cs (Property.CheckBase): Check for properties only, not
17061 * interface.cs: Temporary hack: try/catch around the
17062 CustomAttributeBuilder, because I am getting an exception that I
17065 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17066 types whose definitions are required to be there (attributes are
17067 defined before standard types).
17069 Compute definitions as we boot the various types, as they are used
17070 immediately (value_type class will need object_type, but if we do
17071 not initialize object_type, we will pass a null, which will let
17072 the runtime pick the System.Object from the existing corlib, which
17073 is not what we want).
17075 2002-04-22 Patrik Torstensson <totte@labs2.com>
17077 * cs-tokenizer.cs: fixed a number of trim() issues.
17079 2002-04-22 Ravi Pratap <ravi@ximian.com>
17081 * expression.cs (Argument.Type): Ensure that we return the correct
17082 type when we have out or ref parameters [in which case we
17085 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17087 * class.cs (Property, Indexer): Allow extern modifier in there.
17089 * typemanager.cs (InitBaseTypes): Initializes object_type and
17090 value_type, since those will be used early on during the bootstrap
17091 process to compile corlib.
17093 (InitCoreTypes): Move code from here to InitBaseTypes.
17095 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17097 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17098 single-dimension arrays as using the ldlen opcode.
17100 Daniel Lewis discovered this optimization.
17102 * typemanager.cs: Add signature for System.Array::get_Length
17104 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17106 * statement.cs: report the error when the foreach does not apply to an
17107 array nor a collection.
17109 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17111 * expression.cs: Add implicit conversions to the operator ~.
17113 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17115 * typemanager.cs: Locate the decimal constructor.
17117 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17119 * attribute.cs: use the new property of TypeOf.
17120 * expression.cs: added 'get' property around typearg.
17122 These changes fix a build breaker reported by NickD. Is this the
17123 correct way to fix? If not, please, revert my changes and make it
17126 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17128 * attribute.cs: Add support for typeof in attribute invocations.
17129 I am not sure that this is right though.
17131 2002-04-14 Duncan Mak <duncan@ximian.com>
17133 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17134 Binary.Operator.Division case.
17136 2002-04-13 Ravi Pratap <ravi@ximian.com>
17138 * class.cs (DefineType): Ensure that we do a proper check on
17139 attribute types and also register it with the TypeManager.
17141 (TypeContainer.Targets): The default for attribute types is
17142 AttributeTargets.All.
17144 * attribute.cs (ApplyAttributes): Registering the attribute type
17145 is done elsewhere, not when we discover we have a Usage attribute.
17147 2002-04-12 Ravi Pratap <ravi@ximian.com>
17149 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17150 and get rid of is_delegate parameter.
17152 * everywhere : update.
17154 2002-04-12 Ravi Pratap <ravi@ximian.com>
17156 * cs-parser.jay (compilation_unit): Revamp completely to use
17157 some new ideas that I got from Rhys' grammar to solve the problems
17158 with assembly level attributes.
17160 (outer_declaration): New grammar production.
17162 (attribute_sections): Add.
17164 (opt_attributes): Base on attribute_sections
17166 (namespace_declaration): Allow opt_attributes to tackle the case
17167 when we have assembly level attributes - we are clever in this
17170 * attribute.cs (ApplyAttributes): Do not worry about assembly
17171 attributes in the non-global context.
17173 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17174 instead of SetGlobalAttributes.
17176 * class.cs, rootcontext.cs : Ensure we define and generate
17177 attribute types before anything else.
17179 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17180 and flag the new error -20 for the case when the attribute type
17181 does not have valid targets specified. csc does not catch this.
17183 * ../errors/errors.txt : update for error # -20
17185 2002-04-11 Ravi Pratap <ravi@ximian.com>
17187 * support.cs (InternalParameters.ParameterModifier): Do some null
17188 checking and return sane values.
17190 * class.cs (Method.Define): If we are a PInvoke method, ensure
17191 that we are static and extern. Report error # 601
17193 * ../errors/cs0601.cs : Add test case for the above error.
17195 2002-04-07 Ravi Pratap <ravi@ximian.com>
17197 * rootcontext.cs (attribute_types): We need to keep type of
17198 all attribute types separately and emit code for them first.
17200 (RegisterAttribute) : Implement.
17202 * class.cs (DefineType): Check if the current Type is a custom
17203 attribute type and register it accordingly.
17205 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17206 adding the first attribute twice and rename to
17208 (SetGlobalAttributes): this.
17210 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17213 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17214 if we are processing global arguments. Hmm, I am unsure of this.
17216 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17218 * expression.cs: added static array of strings to avoid calling
17219 Enum.ToString () for Operator in Binary. Significant recover of
17222 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17224 * class.cs (FindMembers): Allow the Builders of the various
17225 members to be null. If they are skip them. This only happens
17226 during the PInvoke declaration.
17228 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17230 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17231 failure, so we do not keep going afterwards.
17233 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17234 wanted to pass `false' as the `is_delegate' argument. If this is
17235 the case, why not use delegate_type == null to mean `is_delegate =
17236 false' and anything else as is_delegate = true.
17238 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17240 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17241 code for the section, not the beginning of the tests.
17243 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17245 * cfold.cs: Handle operator + (Enum x, Underlying x)
17247 * expression.cs (Binary): same. Warn about errors where we have
17248 Enum/Enum in operator + as well.
17250 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
17253 - added support for switch(bool)
17254 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17255 - add TableSwitchEmit() to handle table-based switch statements
17257 2002-04-05 Ravi Pratap <ravi@ximian.com>
17259 * expression.cs (Invocation.OverloadResolve): Factor out code which
17260 does parameter compatibility checking with arguments so that we can
17261 re-use the code even from Delegate.VerifyApplicability
17263 (VerifyArgumentsCompat): Move above code here.
17265 * delegate.cs (VerifyApplicability): Get rid of duplicate code
17266 and instead make a call to the above method.
17268 2002-03-31 Ravi Pratap <ravi@ximian.com>
17270 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17271 We use it to keep track of classes which are attribute types.
17273 2002-04-02 Miguel de Icaza <miguel@ximian.com>
17275 * delegate.cs (Delegate.Define): Correctly define the types in the
17276 presence of fixed and array parameters.
17278 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17281 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17282 include NonPublic after the first iteration.
17284 * class.cs (Indexer.CheckBase): Only check if both parents are
17287 * cs-parser.jay (accessor_body): If empty, set to null.
17289 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17290 same code path here to resolve constants names that we did have in
17291 MemberAccess.DoResolve. There is too much code duplicated here.
17293 2002-04-01 Miguel de Icaza <miguel@ximian.com>
17295 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17297 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17300 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17301 tokens, numbers and strings.
17303 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17306 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17307 asyncronous parameters and the regular parameters.
17309 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17310 specify the target directory.
17312 * expression.cs: (This.DoResolve): Simplify
17313 (As.Emit): Optimize, do not generate IsInst if the expression is
17314 always of the given type.
17316 (Is.DoResolve): Bug fix, we were reporting both always/never for
17319 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17320 creating too many unnecessary arrays.
17322 2002-03-31 Miguel de Icaza <miguel@ximian.com>
17324 * class.cs (EmitFieldInitializer): Use Assign expression to assign
17325 fields instead of rolling our own initializer. Takes care of all
17326 implicit conversions, and drops unnecessary static checks/argument.
17328 2002-03-31 Dick Porter <dick@ximian.com>
17330 * driver.cs: use the GetDirectories() return values properly, and
17331 use "/" as path separator.
17333 2002-03-30 Miguel de Icaza <miguel@ximian.com>
17335 * expression.cs (Unary): Optimize - - expr into expr.
17336 (Binary): Optimize a + (-b) into a -b.
17338 * codegen.cs (CodeGen): Made all methods static.
17340 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17344 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17345 TypeBuilder property.
17347 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17350 * tree.cs: Removed the various RecordXXXX, and replaced with a
17351 single RecordDecl. Removed all the accessor methods, and just
17352 left a single access point Type
17354 * enum.cs: Rename DefineEnum to DefineType.
17356 * decl.cs: New abstract method `DefineType' used to unify the
17357 Defines for Enumerations, Interfaces, TypeContainers and
17360 (FindType): Moved LookupInterfaceOrClass here. Moved the
17361 LookupBaseClasses method that used to live in class.cs and
17362 interface.cs here, and renamed to FindType.
17364 * delegate.cs: Implement DefineType. Take advantage of the
17365 refactored pattern for locating the parent builder without taking
17366 the parent_builder argument (which we know does not work if we are
17367 nested, and triggering a toplevel definition).
17369 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17371 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17372 accessibility of a member has changed during override and report
17375 * class.cs (Method.Define, Property.Define): Only complain on
17376 overrides if the method is private, any other accessibility is
17377 fine (and since we just checked the permission is the same, we are
17380 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17381 and elif are processed always. The other pre-processing
17382 directives are only processed if we are "taking" the path
17384 2002-03-29 Martin Baulig <martin@gnome.org>
17386 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17387 current location is not Null.
17389 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17390 a separate method so we can profile it.
17392 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17393 `span.Seconds' are just seconds, but no minutes or hours.
17394 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17396 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17398 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17399 Remove the gratuitous set of Final:
17401 // If an interface implementation, then we can set Final.
17402 if (((flags & MethodAttributes.Abstract) == 0) &&
17403 implementing.DeclaringType.IsInterface)
17404 flags |= MethodAttributes.Final;
17406 I do not know what I was smoking when I used that.
17409 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17410 step into fixing the name resolution issues for delegates and
17411 unifying the toplevel name resolution.
17413 2002-03-28 Martin Baulig <martin@gnome.org>
17415 * class.cs (Method.Emit): If we have a symbol writer, call its
17416 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17417 tell it about the current method.
17419 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17420 writer that we're going to emit the first byte of IL code for a new
17421 statement (a new source line).
17422 (EmitContext.EmitTopBlock): If we have a symbol writer, call
17423 EmitContext.Mark() before emitting any code.
17425 * location.cs (SymbolDocument): Return null when we're Null.
17427 * statement.cs (Statement): Moved the `Location loc' variable here.
17428 (Statement.EmitBoolExpression): If we have a symbol writer, call
17429 ec.Mark() before emitting any code to tell it that we're at the
17430 beginning of a new statement.
17431 (StatementExpression): Added `Location' argument to the constructor.
17432 (Block): Added public readonly variable `StartLocation' and public
17433 variable `EndLocation'. The latter is to be set using SetEndLocation().
17434 (Block): Added constructor which takes a start and end location.
17435 (Block.SetEndLocation): New method. This sets the end location.
17436 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17437 local variables we create.
17438 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17439 each statement and do also mark the begin and end of the block.
17441 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17442 tell it the current lexer.Location, use Location.Null for the end of the
17444 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17445 current block, set its end location using SetEndLocation().
17446 (statement_expression): StatementExpression constructor now takes the
17447 lexer.Location as additional argument.
17448 (for_statement, declare_local_variables): Likewise.
17449 (declare_local_variables): When creating a new implicit block, use the
17450 new Block constructor and pass it the lexer.Location.
17452 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17454 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17455 members also on the parent interfaces recursively.
17457 2002-03-27 Miguel de Icaza <miguel@ximian.com>
17459 * report.cs: Use new formats, since Gonzalo finished the missing
17462 * expression.cs (Binary.ResolveOperator): added missing operator|
17463 operator& and operator^ for bool/bool.
17465 * cs-parser.jay: CheckDef now takes a Location argument that is
17466 used to report errors more precisly (instead of reporting the end
17467 of a definition, we try to track something which is a lot closer
17468 to the source of the problem).
17470 * cs-tokenizer.cs: Track global token use, so we can properly flag
17471 the use of #define/#undef after the first token has been seen.
17473 Also, rename the reportXXXX to Error_DescriptiveName
17475 * decl.cs (DeclSpace.IsTopLevel): Move property here from
17476 TypeContainer, so that Enum and Interface can use this too.
17478 * class.cs (TypeContainer.LookupInterfaceOrClass,
17479 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17480 `builder' argument. Typically this was used to pass the parent
17481 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17484 The problem is that a nested class could trigger the definition of
17485 a toplevel class, and the builder would be obviously wrong in that
17488 So we drop this argument, and we compute dynamically the
17489 TypeBuilder/ModuleBuilder (the correct information was available
17490 to us anyways from DeclSpace.Parent)
17492 * interface.cs (Interface.DefineInterface): Drop builder
17493 parameter cleanup like class.cs
17495 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
17498 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17501 (Try.Emit): Propagate the returns value from the statement.
17503 (Return.Emit): Even if we are leavning
17505 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17507 * modifiers.cs: Fix the computation of MethodAttributes flags.
17509 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17511 * driver.cs: allow compilation of files that start with '/'.
17512 Add a default case when checking the argument of --target.
17514 2002-03-25 Miguel de Icaza <miguel@ximian.com>
17516 * interface.cs: Implement the same search algorithm for types in
17517 the interface code.
17519 * delegate.cs: Do not allow multiple definition.
17521 * Recovered ChangeLog that got accidentally amputated
17523 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17525 * rootcontext.cs: Load manually enum to allow core classes to
17526 contain enumerations.
17528 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17529 Update to new static methods in TypeManager.
17531 * typemanager.cs (GetMethod, GetConstructor): Use our
17532 implementation of FindMembers to find the members, since during
17533 corlib compilation, the types are TypeBuilders and GetMethod and
17534 GetConstructor do not work.
17536 Make all methods in TypeManager static.
17538 (InitCodeHelpers): Split the functionality from
17539 the InitCodeTypes function.
17541 * driver.cs: Call InitCodeHelpers after we have populated the
17544 * cs-parser.jay (delegate_declaration): we did not used to compute
17545 the delegate name correctly for void delegates.
17547 2002-03-24 Miguel de Icaza <miguel@ximian.com>
17549 * rootcontext.cs (RootContext): Init the interface_resolve_order
17550 and type_container_resolve_order always.
17552 (ResolveCore, BootstrapCorlib_ResolveClass,
17553 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17554 compiler when compiling with --nostdlib
17556 * class.cs (TypeContainer.DefineType): Check that our parent is
17557 not null. This test is most important when we are bootstraping
17560 * codegen.cs: Split out the symbol writing code.
17562 2002-03-25 Martin Baulig <martin@gnome.org>
17564 * driver.cs (-g): Made -g an alias for --debug.
17566 2002-03-24 Martin Baulig <martin@gnome.org>
17568 * codegen.cs (SymbolWriter): New public variable. Returns the
17569 current symbol writer.
17570 (CodeGen): Added `bool want_debugging_support' argument to the
17571 constructor. If true, tell the ModuleBuild that we want debugging
17572 support and ask it for the ISymbolWriter.
17573 (Save): If we have a symbol writer, call it's Close() method after
17574 saving the assembly.
17576 * driver.c (--debug): New command line argument to create a
17577 debugger information file.
17579 * location.cs (SymbolDocument): New public property. Returns an
17580 ISymbolDocumentWriter object for the current source file or null
17581 if we don't have a symbol writer.
17583 2002-03-21 Miguel de Icaza <miguel@ximian.com>
17585 * driver.cs (LoadAssembly): Correctly return when all the paths
17586 have been tried and not before.
17588 * statement.cs (Switch.Emit): return the actual coverage for this
17589 statement (returns/not-returns)
17591 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17592 switch of the statement if we are the last switch section. That
17593 kills two problems: try/catch problems (we used to emit an empty
17594 nop at the end) and switch statements where all branches would
17597 2002-03-19 Miguel de Icaza <miguel@ximian.com>
17599 * driver.cs: Add default assemblies (the equivalent to the
17600 Microsoft CSC.RSP file)
17602 * cs-tokenizer.cs: When updating `cols and setting it to zero,
17603 also update tokens_seen and set it to false.
17605 * driver.cs: Implement --recurse for Mike.
17607 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17608 correctly splitting out the paths.
17610 2002-03-18 Miguel de Icaza <miguel@ximian.com>
17612 * interface.cs (Interface.PopulateProperty): Instead of using
17613 `parent' as the declaration space for the set parameters, use
17616 * support.cs (InternalParameters): InternalParameters constructor
17617 takes a DeclSpace instead of a TypeContainer.
17619 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17620 types are being initialized, load the address of it before calling
17623 (New): Provide a mechanism to disable the generation of local
17624 value type temporaries when the caller will be providing us with
17625 an address to store it.
17627 (ArrayCreation.EmitDynamicInitializers): Use it.
17629 2002-03-17 Miguel de Icaza <miguel@ximian.com>
17631 * expression.cs (Invocation.EmitArguments): Only probe for array
17632 property if there is more than one argument. Sorry about that.
17634 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17635 empty param arrays.
17637 * class.cs (Method.LabelParameters): Fix incorrect code path that
17638 prevented the `ParamArrayAttribute' from being applied to the
17641 2002-03-16 Miguel de Icaza <miguel@ximian.com>
17643 * support.cs (ReflectionParameters): Correctly compute whether the
17644 last argument is a params array. Fixes the problem with
17647 * typemanager.cs: Make the assemblies array always be non-null
17648 (empty, but non-null)
17650 * tree.cs (RecordDecl): New function that abstracts the recording
17651 of names. This reports error 101, and provides a pointer to the
17652 previous declaration. Fixes a crash in the compiler.
17654 * cs-parser.jay (constructor_declaration): Update to new grammar,
17655 and provide a constructor_body that can be empty.
17657 2002-03-15 Miguel de Icaza <miguel@ximian.com>
17659 * driver.cs: Add support for --resources.
17661 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17662 Make all types for the various array helper methods be integer.
17664 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17665 CheckState to ConvCast.
17667 (ConvCast): Now it takes a `checked' state argument, to avoid
17668 depending on the emit context for the conversion, and just using
17669 the resolve time setting.
17671 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17672 instead of Invocation.EmitArguments. We do not emit the original
17673 arguments, instead we emit those which have been converted to
17674 unsigned int expressions.
17676 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17678 * codegen.cs: ditto.
17680 * expression.cs (LocalVariableReference): Drop the use of the
17681 Store function that depended on the variable index.
17683 * statement.cs (VariableInfo): Drop the `Idx' property from this
17684 class, as this is not taking into account the indexes for
17685 temporaries tat we generate during the execution, getting the
17688 * class.cs: First emit class initializers, then call the parent
17691 * expression.cs (Binary): Fix opcode emision.
17692 (UnaryMutator.EmitCode): Support checked code generation
17694 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17695 matches for events for both the Static and Instance scans,
17696 pointing to the same element. Fix that.
17698 2002-03-14 Miguel de Icaza <miguel@ximian.com>
17700 * rootcontext.cs (ResolveTree): Always set the
17701 interface_resolve_order, because nested interfaces will be calling
17704 * class.cs (GetInterfaceOrClass): Track the same resolution
17705 process used by TypeManager.LookupType. This fixes the nested
17706 type lookups in class declarations (separate path from
17709 (TypeContainer.DefineType): Also define nested interfaces.
17710 (TypeContainer.RegisterOrder): New public function used to
17711 register the order in which child interfaces need to be closed.
17713 Nested interfaces need to be closed after their parents have been
17716 * interface.cs (InterfaceAttr): Put all the logic for computing
17717 the interface attribute here.
17719 (DefineInterface): Register our interface order with the
17720 RootContext or with the TypeContainer depending on the case.
17722 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17724 * cs-parser.jay: rework foreach statement to work with the new
17725 changes to the policy on SimpleNames.
17727 * report.cs: support Stacktrace on warnings as well.
17729 * makefile: drop --unsafe and /unsafe from the compile.
17731 2002-03-13 Ravi Pratap <ravi@ximian.com>
17733 * ecore.cs (StandardConversionExists): Modify to take an Expression
17734 as the first parameter. Ensure we do null -> reference type conversion
17737 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17738 temporary Expression objects.
17740 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17742 * interface.cs: workaround bug in method overloading resolution
17743 (there is already a bugzilla bug for it).
17745 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17747 We could also solve this problem by having a separate path for
17748 performing type lookups, instead of DoResolve, we could have a
17749 ResolveType entry point, and only participating pieces of the
17750 production (simplename, deref, array) would implement this.
17752 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17753 signal SimpleName to only resolve type names and not attempt to
17754 resolve anything else.
17756 * expression.cs (Cast): Set the flag.
17758 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17760 * class.cs: Only report 108 if there is no `new' modifier.
17762 * cs-parser.jay: rework foreach statement to work with the new
17763 changes to the policy on SimpleNames.
17765 * report.cs: support Stacktrace on warnings as well.
17767 * makefile: drop --unsafe and /unsafe from the compile.
17769 2002-03-11 Miguel de Icaza <miguel@ximian.com>
17771 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17772 lookups here, instead of doing that at parse time. This means
17773 that our grammar will not introduce `LocalVariableReferences' as
17774 expressions at this point. That solves the problem of code like
17778 static void Main ()
17782 This is only half the fix. The full fix requires parameters to
17783 also be handled in this way.
17785 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17786 makes the use more obvious of the DeclSpace. The
17787 ec.TypeContainer.TypeBuilder is now only used to pull the
17788 TypeBuilder for it.
17790 My theory is that I can get rid of the TypeBuilder completely from
17791 the EmitContext, and have typecasts where it is used (from
17792 DeclSpace to where it matters).
17794 The only pending problem is that the code that implements Aliases
17795 is on TypeContainer, and probably should go in DeclSpace.
17797 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17798 lookups here, instead of doing that at parse time. This means
17799 that our grammar will not introduce `LocalVariableReferences' as
17800 expressions at this point. That solves the problem of code like
17804 static void Main ()
17808 This is only half the fix. The full fix requires parameters to
17809 also be handled in this way.
17811 * class.cs (Property.DefineMethod): When implementing an interface
17812 method, set newslot, when implementing an abstract method, do not
17813 set the flag (before we tried never setting it, or always setting
17814 it, which is the difference).
17815 (Indexer.DefineMethod): same.
17816 (Method.DefineMethod): same.
17818 * ecore.cs: Only set the status used flag if we get back a Field.
17820 * attribute.cs: Temporary hack, so Paolo can keep working.
17822 2002-03-08 Ravi Pratap <ravi@ximian.com>
17824 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17825 the unmanaged type in the case we have a MarshalAs attribute.
17827 (Resolve): Handle the case when we are parsing the special MarshalAs
17828 attribute [we need to store the unmanaged type to use later]
17830 * typemanager.cs (marshal_as_attr_type): Built in type for the
17831 MarshalAs Attribute.
17833 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
17834 on parameters and accordingly set the marshalling info.
17836 2002-03-09 Miguel de Icaza <miguel@ximian.com>
17838 * class.cs: Optimizing slightly by removing redundant code after
17839 we switched to the `NoTypes' return value.
17840 (Property.DefineMethod): use NoTypes here too.
17842 This fixes the bug I introduced in my last batch of changes.
17844 2002-03-05 Ravi Pratap <ravi@ximian.com>
17846 * tree.cs (RecordEnum): Add. We now keep track of enums too.
17848 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17849 Enums since those are types too.
17851 * cs-parser.jay (enum_declaration): Record enums as we parse them.
17853 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
17854 thanks to a call during the lookup process.
17856 2002-03-07 Miguel de Icaza <miguel@ximian.com>
17858 * statement.cs (Foreach): Lots of work to accomodate a particular
17859 kind of foreach statement that I had not kept in mind. It is
17860 possible to have foreachs on classes that provide a GetEnumerator
17861 method that return objects that implement the "pattern" for using
17862 a foreach, there is no need to support GetEnumerator
17865 This is needed to compile nant.
17867 * decl.cs: Only report 114 if the member is not `Finalize' and if
17868 the warning level is at least 2.
17870 * class.cs: Moved the compare function from Method to
17873 (MethodSignature.InheritableMemberSignatureCompare): Add new
17874 filter function that is used to extract inheritable methods from a
17877 (Method.Define): Use the new `inheritable_method_signature_filter'
17880 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17883 2002-03-06 Miguel de Icaza <miguel@ximian.com>
17885 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17887 * cs-parser.jay: Add opt_semicolon to the interface declaration.
17889 * expression.cs: Pass location information to
17890 ConvertImplicitStandard.
17892 * class.cs: Added debugging code to track return values from
17895 2002-03-05 Miguel de Icaza <miguel@ximian.com>
17897 * expression.cs (Is.DoResolve): If either side of the `is' is an
17898 interface, do not flag the warning.
17900 * ecore.cs (ImplicitReferenceConversion): We need a separate test
17903 * report.cs: Allow for --fatal to be used with --probe.
17905 * typemanager.cs (NoTypes): Move the definition for the empty Type
17908 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17910 (TypeContainer.DefineProxy): New function used to proxy to parent
17911 implementations when implementing interfaces.
17912 (TypeContainer.ParentImplements): used to lookup if our parent
17913 implements a public function that is required by an interface.
17914 (TypeContainer.VerifyPendingMethods): Hook this up.
17916 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17917 `modules' and `assemblies' arraylists into arrays. We only grow
17918 these are the very early start up of the program, so this improves
17919 the speedof LookupType (nicely measured).
17921 * expression.cs (MakeByteBlob): Replaced unsafe code with
17922 BitConverter, as suggested by Paolo.
17924 * cfold.cs (ConstantFold.Binary): Special case: perform constant
17925 folding of string concatenation, but if either side is a string,
17926 and the other is not, then return null, and let the runtime use
17927 the concatenation on the string plus the object (using
17928 `Object.ToString').
17930 2002-03-04 Miguel de Icaza <miguel@ximian.com>
17932 Constant Folding has been implemented now.
17934 * expression.cs (Unary.Reduce): Do not throw an exception, catch
17935 the error instead on types that are not supported in one's
17938 * constant.cs (Constant and all children): New set of functions to
17939 perform implict and explicit conversions.
17941 * ecore.cs (EnumConstant): Implement the new functions to perform
17942 conversion by proxying to the child expression.
17944 * codegen.cs: (ConstantCheckState): Constant evaluation has its
17945 own separate setting that can not be turned off from the command
17946 line using --unchecked or --checked and is only controlled using
17947 the checked/unchecked statements and expressions. This setting is
17948 used by the constant folder to flag errors.
17950 * expression.cs (CheckedExpr, UncheckedExpr): Set the
17951 ConstantCheckState as well.
17953 During Resolve, they also have to flag the state, because the
17954 constant folder runs completely in the Resolve phase.
17956 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17959 2002-03-01 Miguel de Icaza <miguel@ximian.com>
17961 * cfold.cs: New file, this file contains the constant folder.
17963 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17964 argument to track whether we are using the resulting address to
17965 load or store a value and provide better error messages.
17967 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17968 new AddressOf arguments.
17970 * statement.cs (Foreach.EmitCollectionForeach): Update
17972 * expression.cs (Argument.Emit): Call AddressOf with proper
17973 arguments to track usage.
17975 (New.DoEmit): Call AddressOf with new arguments.
17977 (Unary.Emit): Adjust AddressOf call.
17979 2002-03-01 Ravi Pratap <ravi@ximian.com>
17981 * cs-parser.jay (member_access): Change the case for pre-defined types
17982 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
17985 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17988 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17989 essentially like methods and apply attributes like MethodImplOptions to them too.
17991 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17994 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17995 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17998 * Update code everywhere accordingly.
18000 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18002 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18004 2002-02-28 Ravi Pratap <ravi@ximian.com>
18006 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18007 try performing lookups against those instead of jumping straight into using
18008 the 'using' clauses.
18010 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18012 (LookupType): Perform lookups in implicit parents too.
18014 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18015 sequence as RootContext.LookupType.
18017 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18018 the various cases of namespace lookups into this method.
18020 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18022 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18023 in positional arguments)
18025 * class.cs (Operator): Update the AllowedModifiers to contain
18028 * cs-parser.jay: Update operator declaration to allow for the
18029 operator body to be empty.
18031 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18034 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18036 * class.cs (Method.Emit): Label parameters.
18038 * driver.cs: Return 1 or 0 as the program exit code.
18040 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18042 * expression.cs: Special case the `null' object when trying to
18043 auto-compute the type, as anything can be explicitly converted to
18046 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18047 spotting this Paolo.
18049 (Expression.ImplicitNumericConversion): Perform comparissions of
18050 the type using the underlying type in the case of an enumeration
18051 rather than using the enumeration type for the compare.
18053 Cope with the underlying == type case, which is not possible to
18056 (Expression.ConvertNumericExplicit): Perform comparissions of
18057 the type using the underlying type in the case of an enumeration
18058 rather than using the enumeration type for the compare.
18060 * driver.cs: If the user does not supply an extension, assume .exe
18062 * cs-parser.jay (if_statement): Rewrote so that we can track the
18063 location for the if statement.
18065 * expression.cs (Binary.ConstantFold): Only concat strings when
18066 the operation is "+", not everything ;-)
18068 * statement.cs (Statement.EmitBoolExpression): Take a location
18070 (If, While, Do): Track location.
18072 * expression.cs (Binary.ResolveOperator): In the object + string
18073 case, I was missing a call to ConvertImplicit
18075 2002-02-25 Ravi Pratap <ravi@ximian.com>
18077 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18078 Location arguments. Ensure we use RootContext.LookupType to do our work
18079 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18081 * interface.cs (PopulateMethod): Handle the type of the parameter being
18084 * expression.cs (Invocation.BetterFunction): Handle the case when we
18085 have a params method with no fixed arguments and a call is made with no
18088 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18090 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18091 the verbatim-string-literal
18093 * support.cs (InternalParameters.ParameterModifier): handle null
18095 (InternalParameters.ParameterType): ditto.
18097 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18098 duplicating the name of the variable parameter.
18099 (GetParameterByName): Fix bug where we were not looking up array
18100 paramters if they were the only present (thanks Paolo!).
18101 (GetParameterInfo): We only have an empty set of types if both
18102 fixed and array are set to null.
18103 (GetParameterInfo-idx): Handle FixedParameter == null
18105 * cs-parser.jay: Handle the case where there is no catch
18106 statements (missing null test).
18108 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18110 * driver.cs (MainDriver): Be conservative on our command line
18113 Catch DirectoryNotFoundException when calling GetFiles.
18115 (SplitPathAndPattern): Used to split the input specification into
18116 a path and a pattern that we can feed to Directory.GetFiles.
18118 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18120 * statement.cs (Fixed): Implement the last case of the Fixed
18121 statement (string handling).
18123 * expression.cs (StringPtr): New class used to return a char * to
18124 a string; Used by the Fixed statement.
18126 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18128 * expression.cs (Binary.ResolveOperator): Remove redundant
18129 MemberLookup pn parent type.
18130 Optimize union call, we do not need a union if the types are the same.
18131 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18134 Specialize the use of MemberLookup everywhere, instead of using
18135 the default settings.
18137 (StackAlloc): Implement stackalloc keyword.
18139 * cs-parser.jay: Add rule to parse stackalloc.
18141 * driver.cs: Handle /h, /help, /?
18143 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18144 before we supported unsafe code.
18146 * makefile: add --unsafe to the self compilation of mcs.
18148 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18150 * expression.cs (PointerArithmetic): New class that is used to
18151 perform pointer arithmetic.
18152 (Binary.Resolve): Handle pointer arithmetic
18153 Handle pointer comparission.
18154 (ArrayPtr): Utility expression class that is used to take the
18155 address of an array.
18157 (ElementAccess): Implement array access for pointers
18159 * statement.cs (Fixed): Implement fixed statement for arrays, we
18160 are missing one more case before we are done.
18162 * expression.cs (Indirection): Implement EmitAssign and set the
18163 ExprClass to Variable. This allows pointer dereferences to be
18164 treated as variables, and to have values assigned to them.
18166 * ecore.cs (Expression.StoreFromPtr): New utility function to
18167 store values dereferencing.
18169 2002-02-20 Ravi Pratap <ravi@ximian.com>
18171 * expression.cs (Binary.ResolveOperator): Ensure that we are
18172 not trying to operate on a void type - this fixes the reported
18175 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18176 the parent implementation is sealed.
18178 * ../errors/cs0239.cs : Add.
18180 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18182 * typemanager.cs (unverifiable_code_type): Corresponds to
18183 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18184 which have unsafe code in them.
18186 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18189 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18191 * cs-tokenizer.cs: Add support for @"litreal strings"
18193 Make tokenizer accept pre-processor directives
18194 on any column (remove the old C-like limitation).
18196 * rootcontext.cs (EmitCode): Emit any global attributes.
18197 (AddGlobalAttributes): Used to keep track of assembly attributes.
18199 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18201 * cs-parser.jay: Add support for global attributes.
18203 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18205 * expression.cs (Indirection): New helper class. Unary will
18206 create Indirection classes to be able to implement the
18207 IMemoryLocation interface on it.
18209 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18211 * cs-parser.jay (fixed_statement): reference the right statement.
18213 * statement.cs (Fixed.Emit): Finish implementing the fixed
18214 statement for the &x case.
18216 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18218 * class.cs (Property.Define, Method.Define): Remove newslot when
18221 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18222 wrong. NewSlot should only be used if the `new' keyword is present.
18224 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18225 locating our system dir. Sorry about this.
18227 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18229 * driver.cs (GetSystemDir): Compute correctly the location of our
18230 system assemblies. I was using the compiler directory instead of
18231 the library directory.
18233 2002-02-13 Ravi Pratap <ravi@ximian.com>
18235 * expression.cs (BetterFunction): Put back in what Miguel commented out
18236 since it is the correct fix. The problem is elsewhere ;-)
18238 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18239 parameters of the parms method are themselves compatible or not !
18241 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18242 to check that a class implements an interface before saying that an implicit
18243 conversion was allowed. Use ImplementsInterface to do the checking.
18245 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18247 * class.cs (Method.Define): Track whether we are an explicit
18248 implementation or not. And only call DefineMethodOverride if we
18249 are an explicit implementation.
18251 (Property.DefineMethod): Ditto.
18253 2002-02-11 Ravi Pratap <ravi@ximian.com>
18255 * expression.cs (BetterFunction): Catch hideous bug which was
18256 preventing us from detecting ambiguous calls due to implicit casts i.e
18259 2002-01-29 Miguel de Icaza <miguel@ximian.com>
18261 * support.cs (Pair): Remove un-needed method. I figured why I was
18262 getting the error in cs-parser.jay, the variable in a foreach loop
18263 is readonly, and the compiler does not really treat this as a variable.
18265 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
18266 instead of EQUALS in grammar.
18268 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18270 * expression.cs (Unary.DoResolve): Check whether the argument is
18273 2002-01-28 Miguel de Icaza <miguel@ximian.com>
18275 * support.cs: Api for Pair to set a value. Despite the fact that
18276 the variables are public the MS C# compiler refuses to compile
18277 code that accesses the field if the variable is part of a foreach
18280 * statement.cs (Fixed): Begin implementation of the fixed
18283 (Block.AddVariable): Return the VariableInfo on success and null
18284 on failure instead of true/false.
18286 * cs-parser.jay (foreach): Catch errors on variables already
18287 defined (we were ignoring this value before) and properly unwind
18288 the block hierarchy
18290 (fixed_statement): grammar for the fixed statement.
18292 2002-01-25 Miguel de Icaza <miguel@ximian.com>
18294 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18295 pointer types to be incretemented.
18297 (SizeOf): Implement.
18299 * cs-parser.jay (pointer_member_access): Implement
18300 expr->IDENTIFIER production.
18302 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18303 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18306 (Unary): Implement indirection.
18308 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18309 use in non-unsafe context).
18311 (SimpleName.DoResolve): Check for pointers in field access on safe
18314 (Expression.LoadFromPtr): Factor the load-indirect code in this
18315 function. This was duplicated in UnboxCast and ParameterReference
18317 2002-01-24 Miguel de Icaza <miguel@ximian.com>
18319 * expression.cs (ComposedCast): report an error if a pointer cast
18320 is used in a safe region.
18322 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18323 pointer type casts in unsafe context.
18325 * codegen.cs (EmitContext): Set up IsUnsafe.
18327 * cs-parser.jay (non_expression_type): Add productions for pointer
18330 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18331 code. We should not use force into static mode if the method is
18332 not virtual. Fixes bug in MIS
18334 * statement.cs (Do.Emit, While.Emit, For.Emit,
18335 Statement.EmitBoolExpression): Add support to Do and While to
18336 propagate infinite loop as `I do return' semantics.
18338 Improve the For case to also test for boolean constants.
18340 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18341 to the list of attributes we can add.
18343 Remove `EmitContext' argument.
18345 * class.cs (Method.Define): Apply parameter attributes.
18346 (Constructor.Define): Apply parameter attributes.
18347 (MethodCore.LabelParameters): Move here the core of labeling
18350 * support.cs (ReflectionParameters.ParameterModifier,
18351 InternalParameters.ParameterModifier): Use IsByRef on the type and
18352 only return the OUT bit for these parameters instead of in/out/ref
18355 This is because I miss-understood things. The ParameterInfo.IsIn
18356 and IsOut represent whether the parameter has the [In] and [Out]
18359 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18361 * ecore.cs (FieldExpr.Emit): Release temporaries.
18363 * assign.cs (LocalTemporary.Release): new function.
18365 * codegen.cs (EmitContext.GetTemporaryStorage,
18366 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18367 temporary storage. Now we can "put back" localbuilders when we
18370 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18372 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18373 need to make a copy of the variable to generate verifiable code.
18375 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18377 * driver.cs: Compute dynamically the system directory.
18379 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18380 Slower, but more generally useful. Used by the abstract
18381 registering implementation.
18383 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18384 the rules for the special rule on Type/instances. First check if
18385 we have the same name, and if so, try that special static path
18386 rather than the instance path.
18388 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18390 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18393 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18394 Enum, ValueType, Delegate or Array for non-corlib compiles.
18396 * cs-tokenizer.cs: Catch long identifiers (645)
18398 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18401 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18402 fix, we were returning too early, so we were not registering
18403 pending methods from abstract classes.
18405 Do not register pending methods if the class is abstract.
18407 * expression.cs (Conditional.DoResolve): Report circular implicit
18408 conversions when we neecd to compute it for conditional
18411 (Is.DoResolve): If the expression is always of the provided type,
18412 flag warning 183. If the expression can not ever be of the
18413 provided type flag warning 184.
18415 * class.cs: Catch 169 as well.
18417 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18420 2002-01-18 Nick Drochak <ndrochak@gol.com>
18422 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
18424 2002-01-17 Miguel de Icaza <miguel@ximian.com>
18426 * interface.cs: (PopulateMethod): Check for pointers being defined
18427 only if the unsafe context is active.
18428 (PopulateProperty): ditto.
18429 (PopulateIndexer): ditto.
18431 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18432 specified. If pointers are present, make sure that they are
18433 present in an unsafe context.
18434 (Constructor, Constructor.Define): ditto.
18435 (Field, Field.Define): ditto.
18436 (Property, Property.Define): ditto.
18437 (Event, Event.Define): ditto.
18439 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18440 hashtable if there are classes or structs defined.
18442 * expression.cs (LocalVariableReference.DoResolve): Simplify this
18443 code, as the constant resolution moved.
18445 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18446 the metadata, so we can flag error 133.
18448 * decl.cs (MemberCore.UnsafeOK): New function to test that a
18449 pointer is being declared in an unsafe context.
18451 2002-01-16 Miguel de Icaza <miguel@ximian.com>
18453 * modifiers.cs (Modifiers.Check): Require a Location argument.
18454 Report error 227 for Unsafe use.
18456 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18458 * statement.cs (For.Emit): If the test is null, then report that
18459 we do `return', as we wont reach anything afterwards.
18461 (Switch.SwitchGoverningType): Track the expression that matched
18464 * driver.cs: Allow negative numbers as an error code to flag.
18466 * cs-parser.jay: Handle 1551.
18468 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18470 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18472 * cs-parser.jay: Report 1518 (type declaration can only contain
18473 class, struct, interface, enum or delegate)
18475 (switch_label): Report 1523 (keywords `case' or `default' must
18478 (opt_switch_sections): Report 1522 (empty switch)
18480 * driver.cs: Report 1515 (response file specified multiple times)
18481 Report 1516 (Source file specified multiple times).
18483 * expression.cs (Argument.Resolve): Signal 1510
18485 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18486 access not allowed in static code)
18488 2002-01-11 Ravi Pratap <ravi@ximian.com>
18490 * typemanager.cs (IsPointerType): Utility method which we are going
18493 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18494 the object type, so we take care of that.
18496 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18498 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18499 added to non-params parameters :-)
18501 * typemanager.cs (CSharpName): Include 'void' type too.
18503 (void_ptr_type): Include in the set of core types.
18505 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
18508 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
18511 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
18512 completely forgotten about it.
18514 2002-01-10 Ravi Pratap <ravi@ximian.com>
18516 * cs-parser.jay (pointer_type): Add. This begins our implementation
18517 of parsing rules for unsafe code.
18519 (unsafe_statement): Implement.
18521 (embedded_statement): Modify to include the above.
18523 * statement.cs (Unsafe): Implement new class for unsafe blocks.
18525 * codegen.cs (EmitContext.InUnsafe): Add. This determines
18526 if the current context is an unsafe one.
18528 * cs-parser.jay (local_variable_pointer_type): Since local variable types
18529 are handled differently, we need separate rules for them.
18531 (local_variable_declaration): Update to use local_variable_pointer_type
18532 to allow variable declarations of unmanaged pointer types.
18534 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18535 in unsafe contexts.
18537 * ../errors/cs0214.cs : Add.
18539 2002-01-16 Nick Drochak <ndrochak@gol.com>
18541 * makefile: remove 'response' file when cleaning.
18543 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18545 * cs-parser.jay: Report 1524.
18547 2002-01-14 Miguel de Icaza <miguel@ximian.com>
18549 * typemanager.cs (RegisterMethod): drop checking if we have
18550 registered this from here
18552 2002-01-12 Miguel de Icaza <miguel@ximian.com>
18554 * class.cs (Method.EmitDestructor): Implement calling our base
18557 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18558 value of InFinally.
18560 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18561 this routine and will wrap the call in a try/catch block. Deal
18564 2002-01-11 Miguel de Icaza <miguel@ximian.com>
18566 * ecore.cs (Expression.MemberLookup): instead of taking a
18567 parameter `same_type' that was used to tell whether we could
18568 access private members we compute our containing type from the
18571 (FieldExpr): Added partial support for volatile fields. This does
18572 not work for volatile fields exposed from assemblies, as I can not
18573 figure out how to extract the modreq from it.
18575 Updated all the source files to use this.
18577 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18578 because it is referenced by MemberLookup very often.
18580 2002-01-09 Ravi Pratap <ravi@ximian.com>
18582 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18583 TypeBuilder.GetCustomAttributes to retrieve what we need.
18585 Get rid of redundant default_member_attr_type as this is the same as
18586 default_member_type which already exists.
18588 * interface.cs, attribute.cs : Update accordingly.
18590 2002-01-08 Miguel de Icaza <miguel@ximian.com>
18592 * typemanager.cs: Enable IndexerPropertyName again. It does not
18593 work for TYpeBuilders though. Ravi, can you please fix this?
18595 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18597 * expression.cs (Argument.Emit): Handle the case of ref objects
18598 being passed to ref functions;
18600 (ParameterReference.EmitLoad): Loads the content of the pointer
18601 without dereferencing.
18603 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18605 * cs-tokenizer.cs: Implemented the pre-processing expressions.
18607 2002-01-08 Ravi Pratap <ravi@ximian.com>
18609 * class.cs (Indexer.DefineMethod): Incorporate the interface
18610 type in the name of the method if we are doing explicit interface
18613 * expression.cs (ConversionExists): Remove as it is completely obsolete.
18615 (BetterConversion): Fix extremely trivial bug where we were referring to
18616 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18619 * ../errors/bug16.cs : Add although we have fixed it.
18621 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18623 * expression.cs (BaseIndexer): Begin implementation.
18625 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18627 * cs-parser.jay (indexer_declarator): Use qualified_identifier
18628 production directly to remove a shift/reduce, and implement
18629 explicit interface implementation.
18631 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18632 after a floating point suffix.
18634 * expression.cs (DoNumericPromotions): Improved the conversion for
18635 uint/uint. If we have a constant, we avoid doing a typecast to a
18638 * class.cs (Indexer): Implement explicit interface implementation
18641 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18643 * class.cs: make the default instance constructor public and hidebysig.
18645 2001-01-03 Ravi Pratap <ravi@ximian.com>
18647 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18648 so we can call it from elsewhere.
18650 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18651 we emit it internally if the class has a defined indexer; otherwise the user
18652 emits it by decorating the class definition with the DefaultMemberAttribute.
18654 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18655 attribute is not used on a type which defines an indexer.
18657 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18658 character when we skip whitespace.
18660 * ../errors/cs0646.cs : Add.
18662 2002-01-03 Miguel de Icaza <miguel@ximian.com>
18664 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18667 * makefile: Add practical target `mcs3.exe' which builds the third
18668 generation compiler.
18670 * expression.cs (New): Fix structures constructor calling.
18672 * class.cs (Property, Method, Indexer): Emit Final flag on the
18673 method if we are an interface implementation and we are not
18676 * ecore.cs (PropertyExpr): New public field `IsBase', tells
18677 whether this property is referencing a `base' method.
18679 * expression.cs (Invocation.EmitCall): take an extra argument:
18680 is_base, this is used to determine whether the `call' or
18681 `callvirt' opcode should be used.
18684 * delegate.cs: update EmitCall.
18686 * class.cs (Method.Define): Set NewSlot for the cases where we are
18687 not implementing an interface method.
18689 (Property.Define): ditto.
18691 2002-01-02 Miguel de Icaza <miguel@ximian.com>
18693 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18694 'r'. Allows mcs to parse itself fully.
18696 2002-01-02 Ravi Pratap <ravi@ximian.com>
18698 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18699 of the number of initializers that require the InitializeArray method.
18701 (CheckIndices): Store the Expression in all cases - not the plain value. Also
18702 update the above field where necessary.
18704 (MakeByteBlob): Update accordingly.
18706 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
18709 (EmitDynamicInitializers): Update in accordance with the new optimization.
18711 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18712 same OpCode applies.
18714 * cs-parser.jay : Fix some glaring errors I introduced.
18716 2002-01-01 Ravi Pratap <ravi@ximian.com>
18718 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18719 so that we can check for name clashes there too.
18721 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18722 for interface indexers.
18724 * interfaces.cs (Define): Emit the default member attribute.
18726 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18727 variable was being referred to while setting the value ;-)
18729 2002-01-01 Miguel de Icaza <miguel@ximian.com>
18731 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18732 byte-by-byte information when we know the data is zero.
18734 Make the block always a multiple of 4, because
18735 DefineInitializedData has a bug.
18737 * assign.cs: Fix, we should assign from the temporary, not from
18740 * expression.cs (MakeByteBlob): Fix my incorrect code.
18742 2001-12-31 Miguel de Icaza <miguel@ximian.com>
18744 * typemanager.cs (EnumToUnderlying): This function is used to get
18745 the underlying type from an enumeration, because it does not
18748 * constant.cs: Use the I4_S form for values between -128 and 127.
18750 * statement.cs (Block.LookupLabel): Looks up a label.
18751 (Block): Drop support for labeled blocks.
18753 (LabeledStatement): New kind of statement that represents a label
18756 (Goto): Finally implement this bad boy.
18758 * cs-parser.jay: Update to reflect new mechanism to implement
18761 2001-12-30 Miguel de Icaza <miguel@ximian.com>
18763 * codegen.cs (EmitContext.This): a codegen property that keeps the
18764 a single instance of this instead of creating many different this
18767 * delegate.cs (Delegate.DoResolve): Update to use the property;
18769 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18771 * expression.cs (BaseAccess.DoResolve): Ditto.
18773 2001-12-29 Ravi Pratap <ravi@ximian.com>
18775 * typemanager.cs (methodimpl_attr_type): Add to hold the type
18776 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18778 (InitCoreTypes): Update accordingly.
18780 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18781 so we can quickly store the state.
18783 (ApplyAttributes): Set the correct implementation flags
18784 for InternalCall methods.
18786 2001-12-29 Miguel de Icaza <miguel@ximian.com>
18788 * expression.cs (EmitCall): if a method is not virtual, then do
18789 not use callvirt on it.
18791 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18792 user defined stuff) requires the use of stobj, which takes an
18793 address on the stack instead of an array and an index. So emit
18794 the Ldelema operation for it.
18796 (EmitStoreOpcode): Use stobj for valuetypes.
18798 (UnaryMutator.EmitCode): Use the right 1 value depending on
18799 whether we are dealing with int64/uint64, float or doubles.
18801 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18802 constructors that I implemented last night.
18804 (Constructor.IsDefault): Fix to work properly for static
18807 * cs-parser.jay (CheckDef): report method signature errors.
18808 Update error number 103 to be 132.
18810 * decl.cs: New AdditionResult enumeration value: MethodExists.
18811 Although we do this check for methods later on in the semantic
18812 analysis, catching repeated default constructors is so easy that
18813 we catch these here.
18815 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18818 (ParameterReference.EmitAssign, Emit): handle
18821 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18822 (ArrayAccess.EmitStoreOpcode): ditto.
18824 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18826 * expression.cs (MakeByteBlob): Complete all the missing types
18827 (uint, short, ushort, byte, sbyte)
18829 * class.cs: Only init instance field initializers on instance
18832 Rename `constructors' to instance_constructors.
18834 (TypeContainer.AddConstructor): Only add constructors to the list
18835 if it is not static.
18837 Make sure that we handle default_static_constructor independently
18838 everywhere where we handle instance_constructors
18840 2001-12-28 Miguel de Icaza <miguel@ximian.com>
18842 * class.cs: Do not lookup or create a base initializer for a
18843 static constructor.
18845 (ConstructorInitializer.Resolve): use the proper type to lookup
18848 * cs-parser.jay: Report error 1585 (modifiers between type and name).
18850 * enum.cs, interface.cs: Remove CloseType, this is taken care by
18853 * decl.cs: CloseType is now an virtual method, the default
18854 implementation just closes this type.
18856 2001-12-28 Ravi Pratap <ravi@ximian.com>
18858 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18859 to PreserveSig by default. Also emit HideBySig on such methods.
18861 Basically, set the defaults to standard values.
18863 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18864 argument, if candidate is better, it can't be worse than the best !
18866 (Invocation): Re-write bits to differentiate between methods being
18867 applicable in their expanded form and their normal form - for params
18870 Get rid of use_standard everywhere as only standard conversions are allowed
18871 in overload resolution.
18873 More spec conformance.
18875 2001-12-27 Miguel de Icaza <miguel@ximian.com>
18877 * driver.cs: Add --timestamp, to see where the compiler spends
18880 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18881 `this' in static code.
18883 (SimpleName.DoResolve): Implement in terms of a helper function
18884 that allows static-references to be passed upstream to
18887 (Expression.ResolveWithSimpleName): Resolve specially simple
18888 names when called by MemberAccess to implement the special
18891 (Expression.ImplicitReferenceConversion): Handle conversions from
18892 Null to reference types before others, as Null's type is
18895 * expression.cs (Invocation.EmitCall): Handle the special case of
18896 calling methods declared on a reference type from a ValueType
18897 (Base classes System.Object and System.Enum)
18899 (MemberAccess.Resolve): Only perform lookups on Enumerations if
18900 the left hand side is a TypeExpr, not on every enumeration.
18902 (Binary.Resolve): If types are reference types, then do a cast to
18903 object on operators != and == of both arguments.
18905 * typemanager.cs (FindMembers): Extract instance and static
18906 members if requested.
18908 * interface.cs (PopulateProperty): Use void_type instead of null
18909 as the return type for the setter method.
18911 (PopulateIndexer): ditto.
18913 2001-12-27 Ravi Pratap <ravi@ximian.com>
18915 * support.cs (ReflectionParameters): Fix minor bug where we
18916 were examining the wrong parameter for the ParamArray attribute.
18918 Cope with requests for the type of the parameter at position
18919 greater than the params parameter's. We now return the element
18920 type of the params array as that makes more sense.
18922 * expression.cs (Invocation.IsParamsMethodApplicable): Update
18923 accordingly as we no longer have to extract the element type
18926 (Invocation.OverloadResolve): Update.
18928 2001-12-27 Miguel de Icaza <miguel@ximian.com>
18930 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18931 against IEnumerator, test whether the return value is a descendant
18932 of the IEnumerator interface.
18934 * class.cs (Indexer.Define): Use an auxiliary method to implement
18935 the other bits of the method definition. Begin support for
18936 explicit interface implementation.
18938 (Property.DefineMethod): Use TypeManager.void_type instead of null
18939 for an empty return value.
18941 2001-12-26 Miguel de Icaza <miguel@ximian.com>
18943 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18944 dealing with a FieldExpr which is composed of a FieldBuilder, in
18945 the code path we did extract the constant, but we should have
18946 obtained the underlying value to be able to cast it (otherwise we
18947 end up in an infinite loop, this is what Ravi was running into).
18949 (ArrayCreation.UpdateIndices): Arrays might be empty.
18951 (MemberAccess.ResolveMemberAccess): Add support for section
18952 14.5.4.1 that deals with the special case of E.I when E is a type
18953 and something else, that I can be a reference to a static member.
18955 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18956 handle a particular array type to create byte blobs, it is just
18957 something we dont generate byteblobs for.
18959 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18962 * location.cs (Push): remove the key from the hashtable that we
18963 are about to add. This happens for empty files.
18965 * driver.cs: Dispose files after we have parsed them.
18967 (tokenize): new function that only runs the tokenizer on its
18968 input, for speed testing.
18970 2001-12-26 Ravi Pratap <ravi@ximian.com>
18972 * class.cs (Event.Define): Define the private field only if there
18973 are no accessors defined.
18975 * expression.cs (ResolveMemberAccess): If there is no associated
18976 field with the event, that means we have an event defined with its
18977 own accessors and we should flag error cs0070 since transforming
18978 ourselves into a field is not valid in that case.
18980 * ecore.cs (SimpleName.DoResolve): Same as above.
18982 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18983 and charset to sane values.
18985 2001-12-25 Ravi Pratap <ravi@ximian.com>
18987 * assign.cs (DoResolve): Perform check on events only if they
18988 are being accessed outside the declaring type.
18990 * cs-parser.jay (event_declarations): Update rules to correctly
18991 set the type of the implicit parameter etc.
18993 (add_accessor, remove_accessor): Set current local parameters.
18995 * expression.cs (Binary): For delegate addition and subtraction,
18996 cast the return value from the method into the appropriate delegate
18999 2001-12-24 Ravi Pratap <ravi@ximian.com>
19001 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19002 of these as the workaround is unnecessary.
19004 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19005 delegate data - none of that is needed at all.
19007 Re-write bits to extract the instance expression and the delegate method
19010 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19013 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19014 of attaching attributes instead of duplicating code everywhere.
19016 * everywhere : Update code to do attribute emission using the above method.
19018 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19020 * expression.cs (IsParamsMethodApplicable): if there are not
19021 parameters, return immediately.
19023 * ecore.cs: The 0 literal can be implicity converted to an enum
19026 (SimpleName.DoResolve): First lookup the type, then lookup the
19029 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19030 want to get its address. If the InstanceExpression is not
19031 addressable, store the result in a temporary variable, then get
19034 * codegen.cs: Only display 219 errors on warning level or above.
19036 * expression.cs (ArrayAccess): Make it implement the
19037 IMemoryLocation interface.
19039 (Binary.DoResolve): handle the operator == (object a, object b)
19040 and operator != (object a, object b) without incurring into a
19041 BoxedCast (because 5 != o should never be performed).
19043 Handle binary enumerator operators.
19045 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19046 value type, otherwise use Ldelem_ref.
19048 Use precomputed names;
19050 (AddressOf): Implement address of
19052 * cs-parser.jay (labeled_statement): Fix recursive block
19053 addition by reworking the production.
19055 * expression.cs (New.DoEmit): New has a special case:
19057 If we are dealing with a ValueType, we have a few
19058 situations to deal with:
19060 * The target of New is a ValueType variable, that is
19061 easy, we just pass this as the variable reference
19063 * The target of New is being passed as an argument,
19064 to a boxing operation or a function that takes a
19067 In this case, we need to create a temporary variable
19068 that is the argument of New.
19071 2001-12-23 Ravi Pratap <ravi@ximian.com>
19073 * rootcontext.cs (LookupType): Check that current_type is not null before
19074 going about looking at nested types.
19076 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19077 not implement the IAssignMethod interface any more.
19079 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19080 where we tranform them into FieldExprs if they are being resolved from within
19081 the declaring type.
19083 * ecore.cs (SimpleName.DoResolve): Do the same here.
19085 * assign.cs (DoResolve, Emit): Clean up code considerably.
19087 * ../errors/bug10.cs : Add.
19089 * ../errors/cs0070.cs : Add.
19091 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19093 * assign.cs : Get rid of EventIsLocal everywhere.
19095 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19097 * ecore.cs (ConvertIntLiteral): finished the implementation.
19099 * statement.cs (SwitchLabel): Convert the value we are using as a
19100 key before looking up the table.
19102 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19104 * codegen.cs (EmitTopBlock): Require a Location argument now.
19106 * cs-parser.jay (constructor_declarator): We need to setup
19107 current_local_parameters before we parse the
19108 opt_constructor_initializer, to allow the variables to be bound
19109 to the constructor arguments.
19111 * rootcontext.cs (LookupType): First lookup nested classes in our
19112 class and our parents before we go looking outside our class.
19114 * expression.cs (ConstantFold): Extract/debox the values at the
19117 * rootcontext.cs (EmitCode): Resolve the constants first before we
19118 resolve the types. This is not really needed, but it helps debugging.
19120 * statement.cs: report location.
19122 * cs-parser.jay: pass location to throw statement.
19124 * driver.cs: Small bug fix.
19126 * report.cs: Updated format to be 4-zero filled digits.
19128 2001-12-22 Ravi Pratap <ravi@ximian.com>
19130 * expression.cs (CheckIndices): Fix minor bug where the wrong
19131 variable was being referred to ;-)
19133 (DoEmit): Do not call EmitStaticInitializers when the
19134 underlying type is System.Object.
19136 2001-12-21 Ravi Pratap <ravi@ximian.com>
19138 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19139 and do the usual workaround for SRE.
19141 * class.cs (MyEventBuilder.EventType): New member to get at the type
19142 of the event, quickly.
19144 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19146 * assign.cs (Assign.DoResolve): Handle the case when the target
19147 is an EventExpr and perform the necessary checks.
19149 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19152 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19154 (EventExpr): Set the type in the constructor itself since we
19155 are meant to be born fully resolved.
19157 (EventExpr.Define): Revert code I wrote earlier.
19159 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19160 instance expression is null. The instance expression is a This in that case
19161 or a null, depending on whether it is a static method or not.
19163 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19164 refers to more than one method.
19166 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19167 and accordingly flag errors.
19169 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19171 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19173 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19175 * location.cs (ToString): Provide useful rutine.
19177 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19179 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19180 objects, return the actual integral boxed.
19182 * statement.cs (SwitchLabel): define an ILLabel for each
19185 (Switch.CheckSwitch): If the value is a Literal, extract
19186 the underlying literal.
19188 Also in the unused hashtable we had, add the SwitchLabel so we can
19189 quickly look this value up.
19191 * constant.cs: Implement a bunch of new constants. Rewrite
19192 Literal based on this. Made changes everywhere to adapt to this.
19194 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19195 dereferencing array only once, and also copes with enumrations.
19197 bytes are two bytes wide, not one.
19199 (Cast): Perform constant conversions.
19201 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19202 wrappers to the literals here.
19204 * expression.cs (DoNumericPromotions): long literals can converted
19205 to ulong implicity (this is taken care of elsewhere, but I was
19206 missing this spot).
19208 * ecore.cs (Expression.Literalize): Make the return type Literal,
19209 to improve type checking.
19211 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19213 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19215 * literal.cs: Revert code from ravi that checked the bounds. The
19216 bounds are sane by the definition of the type itself.
19218 * typemanager.cs: Fix implementation of ImplementsInterface. We
19219 need to actually look up in our parent hierarchy for interfaces
19222 * const.cs: Use the underlying type for enumerations
19224 * delegate.cs: Compute the basename for the delegate creation,
19225 that should fix the delegate test case, and restore the correct
19226 Type Lookup semantics in rootcontext
19228 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19229 referencing a nested type with the Reflection API is using the "+"
19232 * cs-parser.jay: Do not require EOF token at the end.
19234 2001-12-20 Ravi Pratap <ravi@ximian.com>
19236 * rootcontext.cs (LookupType): Concatenate type names with
19237 a '.' instead of a '+' The test suite passes again.
19239 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19240 field of the enumeration.
19242 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19243 the case when the member is an EventExpr.
19245 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19246 static has an associated instance expression.
19248 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19250 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19252 * class.cs (Event.Define): Register event and perform appropriate checks
19255 We define the Add and Remove methods even if the use provides none because
19256 in that case, we provide default implementations ourselves.
19258 Define a private field of the type of the event. This is done by the CSC compiler
19259 and we should be doing it too ;-)
19261 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19262 More methods we use in code we generate.
19264 (multicast_delegate_type, delegate_type): Two separate types since the distinction
19267 (InitCoreTypes): Update accordingly for the above.
19269 * class.cs (Event.Emit): Generate code for default accessors that we provide
19271 (EmitDefaultMethod): Do the job in the above.
19273 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
19276 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19278 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19279 builders even if we were missing one.
19281 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19282 pass the Basename as our class name instead of the Name. The
19283 basename will be correctly composed for us.
19285 * parameter.cs (Paramters): Now takes a Location argument.
19287 * decl.cs (DeclSpace.LookupType): Removed convenience function and
19288 make all the code call directly LookupType in RootContext and take
19289 this chance to pass the Location information everywhere.
19291 * Everywhere: pass Location information.
19293 2001-12-19 Miguel de Icaza <miguel@ximian.com>
19295 * class.cs (Constructor.Define): Updated way of detecting the
19296 length of the parameters.
19298 (TypeContainer.DefineType): Use basename as the type name for
19301 (TypeContainer.Define): Do not recursively define types here, as
19302 definition is taken care in order by the RootContext.
19304 * tree.cs: Keep track of namespaces in a per-file basis.
19306 * parameter.cs (Parameter.ComputeSignature): Update to use
19309 (Parameters.GetSignature): ditto.
19311 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19312 instead of a TypeContainer.
19314 (Interface.SemanticAnalysis): Use `this' instead of our parent to
19315 resolve names. Because we need to be resolve in our context, not
19318 * driver.cs: Implement response files.
19320 * class.cs (TypeContainer.DefineType): If we are defined, do not
19321 redefine ourselves.
19323 (Event.Emit): Emit the code for add/remove handlers.
19324 (Event.Define): Save the MethodBuilders for add/remove.
19326 * typemanager.cs: Use pair here too.
19328 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19329 DictionaryEntry requires the first argument to be non-null.
19331 (enum_declaration): Compute full name for registering the
19334 (delegate_declaration): Instead of using
19335 formal_parameter_list, use opt_formal_parameter_list as the list
19338 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19339 (EventParsing): New property that controls whether `add' and
19340 `remove' are returned as tokens or identifiers (for events);
19342 2001-12-19 Ravi Pratap <ravi@ximian.com>
19344 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19345 use MyEventBuilder only and let it wrap the real builder for us.
19347 (MyEventBuilder): Revamp constructor etc.
19349 Implement all operations that we perform on EventBuilder in precisely the same
19352 (FindMembers): Update to use the EventBuilder member.
19354 (Event.Emit): Update accordingly.
19356 2001-12-18 Ravi Pratap <ravi@ximian.com>
19358 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19359 by calling the appropriate methods.
19361 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19364 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19366 2001-12-17 Ravi Pratap <ravi@ximian.com>
19368 * delegate.cs (Delegate.Populate): Check that the return type
19369 and various parameters types are indeed accessible.
19371 * class.cs (Constructor.Define): Same here.
19373 (Field.Define): Ditto.
19375 (Event.Define): Ditto.
19377 (Operator.Define): Check that the underlying Method defined itself
19378 correctly - so it's MethodBuilder should not be null.
19380 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19381 expression happens to be null.
19383 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19384 members but as of now we don't seem to be able to do anything really useful with it.
19386 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19387 not the EventBuilder.
19389 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19391 * cs-tokenizer.cs: Add support for defines.
19392 Add support for #if, #elif, #else, #endif
19394 (eval_var): evaluates a variable.
19395 (eval): stubbed for evaluating functions.
19397 * cs-parser.jay: Pass the defines information
19399 * driver.cs: Add --define command line option.
19401 * decl.cs: Move MemberCore here.
19403 Make it the base class for DeclSpace. This allows us to catch and
19404 report 108 and 109 for everything now.
19406 * class.cs (TypeContainer.Define): Extract all the members
19407 before populating and emit the warning 108 (new keyword required
19408 to override) instead of having each member implement this.
19410 (MemberCore.Define): New abstract method, we will be using this in
19411 the warning reporting engine in Populate.
19413 (Operator.Define): Adjust to new MemberCore protocol.
19415 * const.cs (Const): This does not derive from Expression, it is a
19416 temporary object we use to create fields, it is a MemberCore.
19418 * class.cs (Method.Define): Allow the entry point to be in a
19421 * driver.cs: Rewrite the argument handler to clean it up a bit.
19423 * rootcontext.cs: Made it just an auxiliary namespace feature by
19424 making everything static.
19426 * driver.cs: Adapt code to use RootContext type name instead of
19429 * delegate.cs: Remove RootContext argument.
19431 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19434 * class.cs (Event.Define): The lookup can fail.
19436 * cs-tokenizer.cs: Begin implementation of pre-procesor.
19438 * expression.cs: Resolve the this instance before invoking the code.
19440 2001-12-17 Miguel de Icaza <miguel@ximian.com>
19442 * cs-parser.jay: Add a production in element_access that allows
19443 the thing to become a "type" reference. This way we can parse
19444 things like "(string [])" as a type.
19446 Note that this still does not handle the more complex rules of
19450 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
19452 * ecore.cs: (CopyNewMethods): new utility function used to
19453 assemble the list of methods from running FindMembers.
19455 (MemberLookup): Rework FindMembers so that
19457 2001-12-16 Miguel de Icaza <miguel@ximian.com>
19459 * class.cs (TypeContainer): Remove Delegates who fail to be
19462 * delegate.cs (Populate): Verify that we dont get null return
19463 values. TODO: Check for AsAccessible.
19465 * cs-parser.jay: Use basename to emit error 574 (destructor should
19466 have the same name as container class), not the full name.
19468 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19469 possible representation.
19471 Also implements integer type suffixes U and L.
19473 2001-12-15 Miguel de Icaza <miguel@ximian.com>
19475 * expression.cs (ArrayCreation.DoResolve): We need to do the
19476 argument resolution *always*.
19478 * decl.cs: Make this hold the namespace. Hold the root context as
19480 (LookupType): Move here.
19482 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19484 * location.cs (Row, Name): Fixed the code, it was always returning
19485 references to the first file.
19487 * interface.cs: Register properties defined through interfaces.
19489 * driver.cs: Add support for globbing on the command line
19491 * class.cs (Field): Make it derive from MemberCore as well.
19494 2001-12-15 Ravi Pratap <ravi@ximian.com>
19496 * class.cs (Event::Define): Check that the type of the event is a delegate
19497 type else flag error #66.
19499 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19502 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19503 values of EntryPoint, CharSet etc etc.
19505 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19507 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19508 be null and we should ignore this. I am not sure if this is really clean. Apparently,
19509 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19510 which needs this to do its work.
19512 * ../errors/cs0066.cs : Add.
19514 2001-12-14 Miguel de Icaza <miguel@ximian.com>
19516 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19519 * class.cs: (MethodSignature.MethodSignature): Removed hack that
19520 clears out the parameters field.
19521 (MemberSignatureCompare): Cleanup
19523 (MemberCore): New base class used to share code between MethodCore
19526 (RegisterRequiredImplementations) BindingFlags.Public requires
19527 either BindingFlags.Instace or Static. Use instance here.
19529 (Property): Refactored code to cope better with the full spec.
19531 * parameter.cs (GetParameterInfo): Return an empty array instead
19534 * class.cs (Property): Abstract or extern properties have no bodies.
19536 * parameter.cs (GetParameterInfo): return a zero-sized array.
19538 * class.cs (TypeContainer.MethodModifiersValid): Move all the
19539 method modifier validation to the typecontainer so we can reuse
19540 this on properties.
19542 (MethodCore.ParameterTypes): return an empty sized array of types.
19544 (Property.Define): Test property modifier validity.
19546 Add tests for sealed/override too.
19548 (Method.Emit): abstract or extern methods have no bodies.
19550 2001-12-14 Ravi Pratap <ravi@ximian.com>
19552 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19555 (Method::Define, ::Emit): Modify accordingly.
19557 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19559 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19561 * makefile: Pass in /unsafe.
19563 2001-12-13 Miguel de Icaza <miguel@ximian.com>
19565 * class.cs (MakeKey): Kill routine.
19567 * class.cs (TypeContainer.Define): Correctly define explicit
19568 method implementations (they require the full interface name plus
19571 * typemanager.cs: Deply the PtrHashtable here and stop using the
19572 lame keys. Things work so much better.
19574 This of course broke everyone who depended on `RegisterMethod' to
19575 do the `test for existance' test. This has to be done elsewhere.
19577 * support.cs (PtrHashtable): A hashtable that avoid comparing with
19578 the object stupid Equals method (because, that like fails all over
19579 the place). We still do not use it.
19581 * class.cs (TypeContainer.SetRequiredInterface,
19582 TypeContainer.RequireMethods): Killed these two routines and moved
19583 all the functionality to RegisterRequiredImplementations.
19585 (TypeContainer.RegisterRequiredImplementations): This routine now
19586 registers all the implementations required in an array for the
19587 interfaces and abstract methods. We use an array of structures
19588 which can be computed ahead of time to reduce memory usage and we
19589 also assume that lookups are cheap as most classes will not
19590 implement too many interfaces.
19592 We also avoid creating too many MethodSignatures.
19594 (TypeContainer.IsInterfaceMethod): Update and optionally does not
19595 clear the "pending" bit if we find that there are problems with
19598 (TypeContainer.VerifyPendingMethods): Update to report errors of
19599 methods that look like implementations but are not.
19601 (TypeContainer.Define): Add support for explicit interface method
19604 2001-12-12 Miguel de Icaza <miguel@ximian.com>
19606 * typemanager.cs: Keep track of the parameters here instead of
19607 being a feature of the TypeContainer.
19609 * class.cs: Drop the registration of parameters here, as
19610 InterfaceMethods are also interface declarations.
19612 * delegate.cs: Register methods with the TypeManager not only with
19613 the TypeContainer. This code was buggy.
19615 * interface.cs: Full registation here.
19617 2001-12-11 Miguel de Icaza <miguel@ximian.com>
19619 * expression.cs: Remove reducer for binary expressions, it can not
19622 * const.cs: Put here the code that used to go into constant.cs
19624 * constant.cs: Put here the code for constants, this is a new base
19625 class for Literals.
19627 * literal.cs: Make Literal derive from Constant.
19629 2001-12-09 Miguel de Icaza <miguel@ximian.com>
19631 * statement.cs (Return.Emit): Report error 157 if the user
19632 attempts to return from a finally block.
19634 (Return.Emit): Instead of emitting a return, jump to the end of
19637 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19638 LocalBuilder to store the result of the function. ReturnLabel is
19639 the target where we jump.
19642 2001-12-09 Radek Doulik <rodo@ximian.com>
19644 * cs-parser.jay: remember alias in current namespace
19646 * ecore.cs (SimpleName::DoResolve): use aliases for types or
19649 * class.cs (LookupAlias): lookup alias in my_namespace
19651 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19653 (LookupAlias): lookup alias in this and if needed in parent
19656 2001-12-08 Miguel de Icaza <miguel@ximian.com>
19660 * rootcontext.cs: (ModuleBuilder) Made static, first step into
19661 making things static. I need this to avoid passing the
19662 TypeContainer when calling ParameterType.
19664 * support.cs (InternalParameters.ParameterType): Remove ugly hack
19665 that did string manipulation to compute the type and then call
19666 GetType. Use Parameter.ParameterType instead.
19668 * cs-tokenizer.cs: Consume the suffix for floating values.
19670 * expression.cs (ParameterReference): figure out whether this is a
19671 reference parameter or not. Kill an extra variable by computing
19672 the arg_idx during emission.
19674 * parameter.cs (Parameters.GetParameterInfo): New overloaded
19675 function that returns whether a parameter is an out/ref value or not.
19677 (Parameter.ParameterType): The type of the parameter (base,
19678 without ref/out applied).
19680 (Parameter.Resolve): Perform resolution here.
19681 (Parameter.ExternalType): The full type (with ref/out applied).
19683 * statement.cs (Using.Emit, Using.EmitExpression): Implement
19684 support for expressions on the using statement.
19686 2001-12-07 Miguel de Icaza <miguel@ximian.com>
19688 * statement.cs (Using.EmitLocalVariableDecls): Split the
19689 localvariable handling of the using statement.
19691 (Block.EmitMeta): Keep track of variable count across blocks. We
19692 were reusing slots on separate branches of blocks.
19694 (Try.Emit): Emit the general code block, we were not emitting it.
19696 Check the type of the declaration to be an IDisposable or
19697 something that can be implicity converted to it.
19699 Emit conversions if required.
19701 * ecore.cs (EmptyExpression): New utility class.
19702 (Expression.ImplicitConversionExists): New utility function.
19704 2001-12-06 Miguel de Icaza <miguel@ximian.com>
19706 * statement.cs (Using): Implement.
19708 * expression.cs (LocalVariableReference): Support read only variables.
19710 * statement.cs: Remove the explicit emit for the Leave opcode.
19711 (VariableInfo): Add a readonly field.
19713 2001-12-05 Miguel de Icaza <miguel@ximian.com>
19715 * ecore.cs (ConvCast): new class used to encapsulate the various
19716 explicit integer conversions that works in both checked and
19717 unchecked contexts.
19719 (Expression.ConvertNumericExplicit): Use new ConvCast class to
19720 properly generate the overflow opcodes.
19722 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19724 * statement.cs: The correct type for the EmptyExpression is the
19725 element_type, not the variable type. Ravi pointed this out.
19727 2001-12-04 Ravi Pratap <ravi@ximian.com>
19729 * class.cs (Method::Define): Handle PInvoke methods specially
19730 by using DefinePInvokeMethod instead of the usual one.
19732 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19733 above to do the task of extracting information and defining the method.
19735 2001-12-04 Ravi Pratap <ravi@ximian.com>
19737 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19738 of the condition for string type.
19740 (Emit): Move that here.
19742 (ArrayCreation::CheckIndices): Keep string literals in their expression
19745 (EmitDynamicInitializers): Handle strings appropriately.
19747 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19749 * codegen.cs (EmitContext): Replace multiple variables with a
19750 single pointer to the current Switch statement.
19752 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19755 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19759 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19762 (Foreach.Emit): Foreach on arrays was not setting
19763 up the loop variables (for break/continue).
19765 (GotoCase): Semi-implented.
19767 2001-12-03 Ravi Pratap <ravi@ximian.com>
19769 * attribute.cs (CheckAttribute): Handle system attributes by using
19770 Attribute.GetAttributes to examine information we need.
19772 (GetValidPlaces): Same here.
19774 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19776 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19778 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19780 (Method::Define): Set appropriate flags if we have a DllImport attribute.
19782 (Method::Emit): Handle the case when we are a PInvoke method.
19784 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19786 * expression.cs: Use ResolveWithSimpleName on compound names.
19788 2001-12-02 Ravi Pratap <ravi@ximian.com>
19790 * constant.cs (EmitConstant): Make sure we resolve the associated expression
19791 before trying to reduce it.
19793 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19795 * constant.cs (LookupConstantValue): Implement.
19797 (EmitConstant): Use the above in emitting the constant.
19799 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19800 that are user-defined by doing a LookupConstantValue on them.
19802 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19805 2001-11-29 Miguel de Icaza <miguel@ximian.com>
19807 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19809 (BaseAccess.DoResolve): Implement.
19811 (MemberAccess.DoResolve): Split this routine into a
19812 ResolveMemberAccess routine that can be used independently
19814 2001-11-28 Miguel de Icaza <miguel@ximian.com>
19816 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19817 As that share bits of the implementation. Is returns a boolean,
19818 while As returns the Type that is being probed.
19820 2001-12-01 Ravi Pratap <ravi@ximian.com>
19822 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19823 instead of a Literal - much easier.
19825 (EnumInTransit): Remove - utterly useless :-)
19827 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19829 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19831 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19832 chain when we have no associated expression.
19834 2001-11-30 Ravi Pratap <ravi@ximian.com>
19836 * constant.cs (Define): Use Location while reporting the errror.
19838 Also emit a warning when 'new' is used and there is no inherited
19841 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
19844 (LookupEnumValue): Implement to lookup an enum member's value and define it
19847 (Populate): Re-write accordingly to use the above routine.
19849 2001-11-27 Miguel de Icaza <miguel@ximian.com>
19851 * expression.cs (This): Fix prototype for DoResolveLValue to
19852 override the base class DoResolveLValue.
19854 * cs-parser.cs: Report errors cs574 and cs575 (destructor
19857 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19858 (we need to load the address of the field here). This fixes
19861 (FieldExpr.DoResolveLValue): Call the DoResolve
19862 function to initialize the Instance expression.
19864 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19865 correctly the GetEnumerator operation on a value type.
19867 * cs-parser.jay: Add more simple parsing error catches.
19869 * statement.cs (Switch): Add support for string switches.
19870 Handle null specially.
19872 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
19874 2001-11-28 Ravi Pratap <ravi@ximian.com>
19876 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19878 (declare_local_constant): New helper function.
19880 * statement.cs (AddConstant): Keep a separate record of constants
19882 (IsConstant): Implement to determine if a variable is a constant.
19884 (GetConstantExpression): Implement.
19886 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19888 * statement.cs (IsVariableDefined): Re-write.
19890 2001-11-27 Ravi Pratap <ravi@ximian.com>
19892 * class.cs (TypeContainer::FindMembers): Look for constants
19893 in the case when we are looking for MemberTypes.Field
19895 * expression.cs (MemberAccess::DoResolve): Check that in the
19896 case we are a FieldExpr and a Literal, we are not being accessed
19897 by an instance reference.
19899 * cs-parser.jay (local_constant_declaration): Implement.
19901 (declaration_statement): Implement for constant declarations.
19903 2001-11-26 Miguel de Icaza <miguel@ximian.com>
19905 * statement.cs (Switch): Catch double defaults.
19907 (Switch): More work on the switch() statement
19908 implementation. It works for integral values now, need to finish
19912 2001-11-24 Miguel de Icaza <miguel@ximian.com>
19914 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19915 integer literals into other integer literals. To be used by
19918 2001-11-24 Ravi Pratap <ravi@ximian.com>
19920 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19923 (EmitDynamicInitializers): Cope with the above since we extract data
19924 directly from ArrayData now.
19926 (ExpectInitializers): Keep track of whether initializers are mandatory
19929 (Bounds): Make it a hashtable to prevent the same dimension being
19930 recorded for every element in that dimension.
19932 (EmitDynamicInitializers): Fix bug which prevented the Set array method
19935 Also fix bug which was causing the indices to be emitted in the reverse
19938 2001-11-24 Miguel de Icaza <miguel@ximian.com>
19940 * expression.cs (ArrayCreation): Implement the bits that Ravi left
19941 unfinished. They do not work, because the underlying code is
19944 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19946 * cs-parser.jay: Remove bogus fixme.
19948 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19949 on Switch statement.
19951 2001-11-23 Ravi Pratap <ravi@ximian.com>
19953 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19956 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19957 parameter. Apparently, any expression is allowed.
19959 (ValidateInitializers): Update accordingly.
19961 (CheckIndices): Fix some tricky bugs thanks to recursion.
19963 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
19964 I was being completely brain-dead.
19966 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19967 and re-write acordingly.
19969 (DelegateInvocation): Re-write accordingly.
19971 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19973 (MakeByteBlob): Handle types more correctly.
19975 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19976 initialization from expressions but it is incomplete because I am a complete
19979 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19981 * statement.cs (If.Emit): Fix a bug that generated incorrect code
19982 on If. Basically, we have to return `true' (ie, we do return to
19983 our caller) only if both branches of the if return.
19985 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19986 short-circuit operators, handle them as short circuit operators.
19988 (Cast.DoResolve): Resolve type.
19989 (Cast.Cast): Take an expression as the target type.
19991 * cs-parser.jay (cast_expression): Remove old hack that only
19992 allowed a limited set of types to be handled. Now we take a
19993 unary_expression and we resolve to a type during semantic
19996 Use the grammar productions from Rhys to handle casts (this is
19997 not complete like Rhys syntax yet, we fail to handle that corner
19998 case that C# has regarding (-x), but we will get there.
20000 2001-11-22 Ravi Pratap <ravi@ximian.com>
20002 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20003 field which is an array type.
20005 * cs-parser.jay (declare_local_variables): Support array initialization too.
20007 * typemanager.cs (MakeKey): Implement.
20009 (everywhere): Use the above appropriately.
20011 * cs-parser.jay (for_statement): Update for array initialization while
20012 declaring variables.
20014 * ecore.cs : The error message was correct, it's the variable's names that
20015 were misleading ;-) Make the code more readable.
20017 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20018 the correct type etc.
20020 (ConvertExplicit): Handle Enum types by examining the underlying type.
20022 2001-11-21 Ravi Pratap <ravi@ximian.com>
20024 * parameter.cs (GetCallingConvention): Always return
20025 CallingConventions.Standard for now.
20027 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20029 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20030 and `r' after calling DoNumericPromotions.
20032 * ecore.cs: Fix error message (the types were in the wrong order).
20034 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20035 BindingFlags.Instance as well
20037 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20038 implicit int literal conversion in an empty cast so that we
20039 propagate the right type upstream.
20041 (UnboxCast): new class used to unbox value types.
20042 (Expression.ConvertExplicit): Add explicit type conversions done
20045 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20046 the target type before applying the implicit LongLiterals to ULong
20049 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20051 * cs-parser.jay (for_statement): Reworked the way For works: now
20052 we declare manually any variables that are introduced in
20053 for_initializer to solve the problem of having out-of-band code
20054 emition (that is what got for broken).
20056 (declaration_statement): Perform the actual variable declaration
20057 that used to be done in local_variable_declaration here.
20059 (local_variable_declaration): Do not declare anything, just pass
20060 the information on a DictionaryEntry
20062 2001-11-20 Ravi Pratap <ravi@ximian.com>
20064 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20065 re-write of the logic to now make it recursive.
20067 (UpdateIndices): Re-write accordingly.
20069 Store element data in a separate ArrayData list in the above methods.
20071 (MakeByteBlob): Implement to dump the array data into a byte array.
20073 2001-11-19 Ravi Pratap <ravi@ximian.com>
20075 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20078 * constant.cs (Define): Implement.
20080 (EmitConstant): Re-write fully.
20082 Pass in location info.
20084 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20087 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20088 DictionaryEntry since we need location info too.
20090 (constant_declaration): Update accordingly.
20092 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20093 code into another method : UpdateIndices.
20095 2001-11-18 Ravi Pratap <ravi@ximian.com>
20097 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20098 some type checking etc.
20100 2001-11-17 Ravi Pratap <ravi@ximian.com>
20102 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20103 bits to provide dimension info if the user skips doing that.
20105 Update second constructor to store the rank correctly.
20107 2001-11-16 Ravi Pratap <ravi@ximian.com>
20109 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20110 and try to implement.
20112 * ../errors/cs0150.cs : Add.
20114 * ../errors/cs0178.cs : Add.
20116 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20118 * statement.cs: Implement foreach on multi-dimensional arrays.
20120 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20121 name of the params argument.
20123 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20124 initializing the array.
20126 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20127 we can use this elsewhere.
20129 * statement.cs: Finish implementation of foreach for single
20132 * cs-parser.jay: Use an out-of-band stack to pass information
20133 around, I wonder why I need this.
20135 foreach_block: Make the new foreach_block the current_block.
20137 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20138 function used to return a static Parameters structure. Used for
20139 empty parameters, as those are created very frequently.
20141 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20143 2001-11-15 Ravi Pratap <ravi@ximian.com>
20145 * interface.cs : Default modifier is private, not public. The
20146 make verify test passes again.
20148 2001-11-15 Ravi Pratap <ravi@ximian.com>
20150 * support.cs (ReflectionParameters): Fix logic to determine
20151 whether the last parameter is a params one. Test 9 passes again.
20153 * delegate.cs (Populate): Register the builders we define with
20154 RegisterParameterForBuilder. Test 19 passes again.
20156 * cs-parser.jay (property_declaration): Reference $6 instead
20157 of $$ to get at the location.
20159 (indexer_declaration): Similar stuff.
20161 (attribute): Ditto.
20163 * class.cs (Property): Register parameters for the Get and Set methods
20164 if they exist. Test 23 passes again.
20166 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20167 call to EmitArguments as we are sure there aren't any params arguments.
20168 Test 32 passes again.
20170 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20171 IndexOutOfRangeException.
20173 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20174 Test 33 now passes again.
20176 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20178 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20179 broke a bunch of things. Will have to come up with a better way
20180 of tracking locations.
20182 * statement.cs: Implemented foreach for single dimension arrays.
20184 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20186 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20187 an error. This removes the lookup from the critical path.
20189 * cs-parser.jay: Removed use of temporary_loc, which is completely
20192 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20194 * support.cs (ReflectionParameters.ParameterModifier): Report
20195 whether the argument is a PARAMS argument or not.
20197 * class.cs: Set the attribute `ParamArrayAttribute' on the
20198 parameter argument.
20200 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20201 and cons_param_array_attribute (ConstructorInfo for
20202 ParamArrayAttribute).,
20204 * codegen.cs: Emit the return using the `Return' statement, that
20205 way we can report the error correctly for missing return values.
20207 * class.cs (Method.Emit): Clean up.
20209 * expression.cs (Argument.Resolve): Take another argument: the
20210 location where this argument is used. Notice that this is not
20211 part of the "Argument" class as to reduce the size of the
20212 structure (we know the approximate location anyways).
20214 Test if the argument is a variable-reference, if not, then
20215 complain with a 206.
20217 (Argument.Emit): Emit addresses of variables.
20219 (Argument.FullDesc): Simplify.
20221 (Invocation.DoResolve): Update for Argument.Resolve.
20223 (ElementAccess.DoResolve): ditto.
20225 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20226 method should be virtual, as this method is always virtual.
20228 (NewDelegate.DoResolve): Update for Argument.Resolve.
20230 * class.cs (ConstructorInitializer.DoResolve): ditto.
20232 * attribute.cs (Attribute.Resolve): ditto.
20234 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20236 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20238 * expression.cs (ParameterReference): Drop IStackStorage and implement
20239 IAssignMethod instead.
20241 (LocalVariableReference): ditto.
20243 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20244 IAssignMethod instead.
20246 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20248 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20249 enumerations that are used in heavily used structures derive from
20250 byte in a laughable and pathetic attempt to reduce memory usage.
20251 This is the kind of pre-optimzations that you should not do at
20252 home without adult supervision.
20254 * expression.cs (UnaryMutator): New class, used to handle ++ and
20255 -- separatedly from the other unary operators. Cleans up the
20256 code, and kills the ExpressionStatement dependency in Unary.
20258 (Unary): Removed `method' and `Arguments' from this class, making
20259 it smaller, and moving it all to SimpleCall, so I can reuse this
20260 code in other locations and avoid creating a lot of transient data
20261 strucutres when not required.
20263 * cs-parser.jay: Adjust for new changes.
20265 2001-11-11 Miguel de Icaza <miguel@ximian.com>
20267 * enum.cs (Enum.Populate): If there is a failure during
20270 * cs-parser.jay (opt_enum_base): we used to catch type errors
20271 here, but this is really incorrect. The type error should be
20272 catched during semantic analysis.
20274 2001-12-11 Ravi Pratap <ravi@ximian.com>
20276 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20277 current_local_parameters as expected since I, in my stupidity, had forgotten
20280 * attribute.cs (GetValidPlaces): Fix stupid bug.
20282 * class.cs (Method::Emit): Perform check on applicability of attributes.
20284 (Constructor::Emit): Ditto.
20286 (Field::Emit): Ditto.
20288 (Field.Location): Store location information.
20290 (Property, Event, Indexer, Operator): Ditto.
20292 * cs-parser.jay (field_declaration): Pass in location for each field.
20294 * ../errors/cs0592.cs : Add.
20296 2001-11-12 Ravi Pratap <ravi@ximian.com>
20298 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20300 (InitCoreTypes): Update accordingly.
20302 (RegisterAttrType, LookupAttr): Implement.
20304 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20305 info about the same.
20307 (Resolve): Update to populate the above as necessary.
20309 (Error592): Helper.
20311 (GetValidPlaces): Helper to the above.
20313 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20315 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20317 2001-11-12 Ravi Pratap <ravi@ximian.com>
20319 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20321 * ../errors/cs0617.cs : Add.
20323 2001-11-11 Ravi Pratap <ravi@ximian.com>
20325 * enum.cs (Emit): Rename to Populate to be more consistent with what
20326 we expect it to do and when exactly it is called.
20328 * class.cs, rootcontext.cs : Update accordingly.
20330 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20331 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20333 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20335 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20336 of a fieldinfo using the above, when dealing with a FieldBuilder.
20338 2001-11-10 Ravi Pratap <ravi@ximian.com>
20340 * ../errors/cs0031.cs : Add.
20342 * ../errors/cs1008.cs : Add.
20344 * ../errrors/cs0543.cs : Add.
20346 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20349 (FindMembers): Implement.
20351 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20352 enums and delegates too.
20354 (enum_types): Rename to builder_to_enum.
20356 (delegate_types): Rename to builder_to_delegate.
20358 * delegate.cs (FindMembers): Implement.
20360 2001-11-09 Ravi Pratap <ravi@ximian.com>
20362 * typemanager.cs (IsEnumType): Implement.
20364 * enum.cs (Emit): Re-write parts to account for the underlying type
20365 better and perform checking etc.
20367 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20368 of the underlying type.
20370 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20373 * enum.cs (error31): Helper to report error #31.
20375 * cs-parser.jay (enum_declaration): Store location of each member too.
20377 * enum.cs (member_to_location): New hashtable.
20379 (AddEnumMember): Update location hashtable.
20381 (Emit): Use the location of each member while reporting errors.
20383 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20385 * cs-parser.jay: A for_initializer if is a
20386 local_variable_declaration really ammount to have an implicit
20387 block with the variable declaration and no initializer for for.
20389 * statement.cs (For.Emit): Cope with null initializers.
20391 This fixes the infinite loop on for initializers.
20393 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20395 * enum.cs: More cleanup.
20397 * ecore.cs: Remove dead code.
20399 * class.cs (Property.Emit): More simplification.
20400 (Event.Emit): ditto.
20402 Reworked to have less levels of indentation.
20404 2001-11-08 Ravi Pratap <ravi@ximian.com>
20406 * class.cs (Property): Emit attributes.
20416 * enum.cs (Emit): Ditto.
20418 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20421 * class.cs (Field, Event, etc.): Move attribute generation into the
20422 Emit method everywhere.
20424 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20425 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20426 as we had no way of defining nested enums !
20428 * rootcontext.cs : Adjust code accordingly.
20430 * typemanager.cs (AddEnumType): To keep track of enum types separately.
20432 2001-11-07 Ravi Pratap <ravi@ximian.com>
20434 * expression.cs (EvalConstantExpression): Move into ecore.cs
20436 * enum.cs (Enum): Rename some members and make them public and readonly
20437 according to our convention.
20439 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20442 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20444 (Enum::Emit): Write a simple version for now which doesn't try to compute
20445 expressions. I shall modify this to be more robust in just a while.
20447 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20449 (TypeContainer::CloseType): Create the Enum types too.
20451 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20453 * expression.cs (EvalConstantExpression): Get rid of completely.
20455 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20456 user-defined values and other cases.
20458 (IsValidEnumLiteral): Helper function.
20460 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
20461 out there in the case we had a literal FieldExpr.
20463 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20465 (Literalize): Revamp a bit to take two arguments.
20467 (EnumLiteral): New class which derives from Literal to wrap enum literals.
20469 2001-11-06 Ravi Pratap <ravi@ximian.com>
20471 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20473 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20475 (Resolve): Use the above to ensure we have proper initializers.
20477 2001-11-05 Ravi Pratap <ravi@ximian.com>
20479 * expression.cs (Expression::EvalConstantExpression): New method to
20480 evaluate constant expressions.
20482 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20484 2001-11-07 Miguel de Icaza <miguel@ximian.com>
20486 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20489 (Binary.ResolveOperator): Handle operator != (object a, object b)
20490 and operator == (object a, object b);
20492 (Binary.DoNumericPromotions): Indicate whether the numeric
20493 promotion was possible.
20495 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20498 Made the ArrayAccess implement interface IAssignMethod instead of
20499 IStackStore as the order in which arguments are passed reflects
20502 * assign.cs: Instead of using expr.ExprClass to select the way of
20503 assinging, probe for the IStackStore/IAssignMethod interfaces.
20505 * typemanager.cs: Load InitializeArray definition.
20507 * rootcontext.cs (RootContext.MakeStaticData): Used to define
20508 static data that can be used to initialize arrays.
20510 2001-11-05 Miguel de Icaza <miguel@ximian.com>
20512 * expression.cs: Handle operator== and operator!= for booleans.
20514 (Conditioal.Reduce): Implement reducer for the ?: operator.
20516 (Conditional.Resolve): Implement dead code elimination.
20518 (Binary.Resolve): Catch string literals and return a new
20519 concatenated string.
20521 (Unary.Reduce): Implement reduction of unary expressions.
20523 * ecore.cs: Split out the expression core handling here.
20525 (Expression.Reduce): New method used to perform constant folding
20526 and CSE. This is needed to support constant-expressions.
20528 * statement.cs (Statement.EmitBoolExpression): Pass true and false
20529 targets, and optimize for !x.
20531 2001-11-04 Ravi Pratap <ravi@ximian.com>
20533 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20534 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20535 set custom atttributes.
20537 * literal.cs (Literal::GetValue): New abstract method to return the actual
20538 value of the literal, cast as an object.
20540 (*Literal): Implement GetValue method.
20542 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20543 expressions to the arraylist but objects of type Argument.
20545 * class.cs (TypeContainer::Emit): Emit our attributes too.
20547 (Method::Emit, Constructor::Emit): Ditto.
20549 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20550 to be ignoring earlier.
20552 2001-11-03 Ravi Pratap <ravi@ximian.com>
20554 * attribute.cs (AttributeSection::Define): Implement to do the business
20555 of constructing a CustomAttributeBuilder.
20557 (Attribute): New trivial class. Increases readability of code.
20559 * cs-parser.jay : Update accordingly.
20561 (positional_argument_list, named_argument_list, named_argument): New rules
20563 (attribute_arguments): Use the above so that we are more correct.
20565 2001-11-02 Ravi Pratap <ravi@ximian.com>
20567 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20568 to perform all checks for a method with a params parameter.
20570 (Invocation::OverloadResolve): Update to use the above method and therefore
20571 cope correctly with params method invocations.
20573 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
20576 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20577 constructors in our parent too because we can't afford to miss out on
20580 * attribute.cs (AttributeSection): New name for the class Attribute
20582 Other trivial changes to improve readability.
20584 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20585 use the new class names.
20587 2001-11-01 Ravi Pratap <ravi@ximian.com>
20589 * class.cs (Method::Define): Complete definition for params types too
20591 (Indexer::Define): Ditto.
20593 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20594 Cope everywhere with a request for info about the array parameter.
20596 2001-11-01 Ravi Pratap <ravi@ximian.com>
20598 * tree.cs (RecordNamespace): Fix up to check for the correct key.
20600 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
20601 local_variable_type to extract the string corresponding to the type.
20603 (local_variable_type): Fixup the action to use the new helper method.
20605 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
20608 * expression.cs : Clean out code which uses the above.
20610 2001-10-31 Ravi Pratap <ravi@ximian.com>
20612 * typemanager.cs (RegisterMethod): Check if we already have an existing key
20613 and bale out if necessary by returning a false.
20615 (RegisterProperty): Ditto.
20617 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20618 and print out appropriate error messages.
20620 * interface.cs (everywhere): Ditto.
20622 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20623 location to constructor.
20625 * class.cs (Property, Event, Indexer): Update accordingly.
20627 * ../errors/cs111.cs : Added.
20629 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20630 of a method, as laid down by the spec.
20632 (Invocation::OverloadResolve): Use the above method.
20634 2001-10-31 Ravi Pratap <ravi@ximian.com>
20636 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20637 now take a TypeContainer and a Parameters object.
20639 (ParameterData): Modify return type of ParameterModifier method to be
20640 Parameter.Modifier and not a string.
20642 (ReflectionParameters, InternalParameters): Update accordingly.
20644 * expression.cs (Argument::GetParameterModifier): Same here.
20646 * support.cs (InternalParameters::ParameterType): Find a better way of determining
20647 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20648 symbol in it at all so maybe this is only for now.
20650 2001-10-30 Ravi Pratap <ravi@ximian.com>
20652 * support.cs (InternalParameters): Constructor now takes an extra argument
20653 which is the actual Parameters class.
20655 (ParameterDesc): Update to provide info on ref/out modifiers.
20657 * class.cs (everywhere): Update call to InternalParameters to pass in
20658 the second argument too.
20660 * support.cs (ParameterData): Add ParameterModifier, which is a method
20661 to return the modifier info [ref/out etc]
20663 (InternalParameters, ReflectionParameters): Implement the above.
20665 * expression.cs (Argument::ParameterModifier): Similar function to return
20666 info about the argument's modifiers.
20668 (Invocation::OverloadResolve): Update to take into account matching modifiers
20671 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20672 a new SetFormalParameters object which we pass to InternalParameters.
20674 2001-10-30 Ravi Pratap <ravi@ximian.com>
20676 * expression.cs (NewArray): Merge into the ArrayCreation class.
20678 2001-10-29 Ravi Pratap <ravi@ximian.com>
20680 * expression.cs (NewArray): Merge classes NewBuiltinArray and
20681 NewUserdefinedArray into one as there wasn't much of a use in having
20684 * expression.cs (Argument): Change field's name to ArgType from Type.
20686 (Type): New readonly property which returns the proper type, taking into
20687 account ref/out modifiers.
20689 (everywhere): Adjust code accordingly for the above.
20691 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20692 whether we are emitting for a ref or out parameter.
20694 * expression.cs (Argument::Emit): Use the above field to set the state.
20696 (LocalVariableReference::Emit): Update to honour the flag and emit the
20699 * parameter.cs (Attributes): Set the correct flags for ref parameters.
20701 * expression.cs (Argument::FullDesc): New function to provide a full desc.
20703 * support.cs (ParameterData): Add method ParameterDesc to the interface.
20705 (ReflectionParameters, InternalParameters): Implement the above method.
20707 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20710 (Invocation::FullMethodDesc): Ditto.
20712 2001-10-29 Miguel de Icaza <miguel@ximian.com>
20714 * cs-parser.jay: Add extra production for the second form of array
20717 * expression.cs (ArrayCreation): Update to reflect the above
20720 * Small changes to prepare for Array initialization.
20722 2001-10-28 Miguel de Icaza <miguel@ximian.com>
20724 * typemanager.cs (ImplementsInterface): interface might be null;
20725 Deal with this problem;
20727 Also, we do store negative hits on the cache (null values), so use
20728 this instead of calling t.GetInterfaces on the type everytime.
20730 2001-10-28 Ravi Pratap <ravi@ximian.com>
20732 * typemanager.cs (IsBuiltinType): New method to help determine the same.
20734 * expression.cs (New::DoResolve): Get rid of array creation code and instead
20735 split functionality out into different classes.
20737 (New::FormArrayType): Move into NewBuiltinArray.
20739 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20742 (NewBuiltinArray): New class to handle creation of built-in arrays.
20744 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20745 account creation of one-dimensional arrays.
20747 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20749 (NewUserdefinedArray::DoResolve): Implement.
20751 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20753 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20754 we maintain inside the TypeManager. This is necessary to perform lookups on the
20757 (LookupType): Update to perform GetType on the module builders too.
20759 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20761 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20763 2001-10-23 Ravi Pratap <ravi@ximian.com>
20765 * expression.cs (New::DoResolve): Implement guts of array creation.
20767 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20769 2001-10-27 Miguel de Icaza <miguel@ximian.com>
20771 * expression.cs: Fix bug I introduced lsat night that broke
20774 (Expression.Resolve): Report a 246 error (can not resolve name)
20775 if we find a SimpleName in the stream.
20777 (Expression.ResolveLValue): Ditto.
20779 (Expression.ResolveWithSimpleName): This function is a variant of
20780 ResolveName, this one allows SimpleNames to be returned without a
20781 warning. The only consumer of SimpleNames is MemberAccess
20783 2001-10-26 Miguel de Icaza <miguel@ximian.com>
20785 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20786 might arrive here. I have my doubts that this is correct.
20788 * statement.cs (Lock): Implement lock statement.
20790 * cs-parser.jay: Small fixes to support `lock' and `using'
20792 * cs-tokenizer.cs: Remove extra space
20794 * driver.cs: New flag --checked, allows to turn on integer math
20797 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20798 Threading.Monitor.Exit
20800 2001-10-23 Miguel de Icaza <miguel@ximian.com>
20802 * expression.cs (IndexerAccess::DoResolveLValue): Set the
20803 Expression Class to be IndexerAccess.
20805 Notice that Indexer::DoResolve sets the eclass to Value.
20807 2001-10-22 Miguel de Icaza <miguel@ximian.com>
20809 * class.cs (TypeContainer::Emit): Emit code for indexers.
20811 * assign.cs (IAssignMethod): New interface implemented by Indexers
20812 and Properties for handling assignment.
20814 (Assign::Emit): Simplify and reuse code.
20816 * expression.cs (IndexerAccess, PropertyExpr): Implement
20817 IAssignMethod, clean up old code.
20819 2001-10-22 Ravi Pratap <ravi@ximian.com>
20821 * typemanager.cs (ImplementsInterface): New method to determine if a type
20822 implements a given interface. Provides a nice cache too.
20824 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20827 (ConvertReferenceExplicit): Ditto.
20829 * delegate.cs (Delegate::Populate): Update to define the parameters on the
20830 various methods, with correct names etc.
20832 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
20833 Operator.UnaryNegation.
20835 * cs-parser.jay (operator_declarator): Be a little clever in the case where
20836 we have a unary plus or minus operator.
20838 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
20841 * everywhere : update accordingly.
20843 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20846 * class.cs (Method::Define): For the case where we are implementing a method
20847 inherited from an interface, we need to set the MethodAttributes.Final flag too.
20848 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20850 2001-10-21 Ravi Pratap <ravi@ximian.com>
20852 * interface.cs (FindMembers): Implement to work around S.R.E
20855 * typemanager.cs (IsInterfaceType): Implement.
20857 (FindMembers): Update to handle interface types too.
20859 * expression.cs (ImplicitReferenceConversion): Re-write bits which
20860 use IsAssignableFrom as that is not correct - it doesn't work.
20862 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20863 and accordingly override EmitStatement.
20865 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20866 using the correct logic :-)
20868 2001-10-19 Ravi Pratap <ravi@ximian.com>
20870 * ../errors/cs-11.cs : Add to demonstrate error -11
20872 2001-10-17 Miguel de Icaza <miguel@ximian.com>
20874 * assign.cs (Assign::Resolve): Resolve right hand side first, and
20875 then pass this as a hint to ResolveLValue.
20877 * expression.cs (FieldExpr): Add Location information
20879 (FieldExpr::LValueResolve): Report assignment to readonly
20882 (Expression::ExprClassFromMemberInfo): Pass location information.
20884 (Expression::ResolveLValue): Add new method that resolves an
20887 (Expression::DoResolveLValue): Default invocation calls
20890 (Indexers): New class used to keep track of indexers in a given
20893 (IStackStore): Renamed from LValue, as it did not really describe
20894 what this did. Also ResolveLValue is gone from this interface and
20895 now is part of Expression.
20897 (ElementAccess): Depending on the element access type
20899 * typemanager.cs: Add `indexer_name_type' as a Core type
20900 (System.Runtime.CompilerServices.IndexerNameAttribute)
20902 * statement.cs (Goto): Take a location.
20904 2001-10-18 Ravi Pratap <ravi@ximian.com>
20906 * delegate.cs (Delegate::VerifyDelegate): New method to verify
20907 if two delegates are compatible.
20909 (NewDelegate::DoResolve): Update to take care of the case when
20910 we instantiate a delegate from another delegate.
20912 * typemanager.cs (FindMembers): Don't even try to look up members
20913 of Delegate types for now.
20915 2001-10-18 Ravi Pratap <ravi@ximian.com>
20917 * delegate.cs (NewDelegate): New class to take care of delegate
20920 * expression.cs (New): Split the delegate related code out into
20921 the NewDelegate class.
20923 * delegate.cs (DelegateInvocation): New class to handle delegate
20926 * expression.cs (Invocation): Split out delegate related code into
20927 the DelegateInvocation class.
20929 2001-10-17 Ravi Pratap <ravi@ximian.com>
20931 * expression.cs (New::DoResolve): Implement delegate creation fully
20932 and according to the spec.
20934 (New::DoEmit): Update to handle delegates differently.
20936 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20937 because of which we were printing out arguments in reverse order !
20939 * delegate.cs (VerifyMethod): Implement to check if the given method
20940 matches the delegate.
20942 (FullDelegateDesc): Implement.
20944 (VerifyApplicability): Implement.
20946 * expression.cs (Invocation::DoResolve): Update to accordingly handle
20947 delegate invocations too.
20949 (Invocation::Emit): Ditto.
20951 * ../errors/cs1593.cs : Added.
20953 * ../errors/cs1594.cs : Added.
20955 * delegate.cs (InstanceExpression, TargetMethod): New properties.
20957 2001-10-16 Ravi Pratap <ravi@ximian.com>
20959 * typemanager.cs (intptr_type): Core type for System.IntPtr
20961 (InitCoreTypes): Update for the same.
20963 (iasyncresult_type, asynccallback_type): Ditto.
20965 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20968 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20971 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20972 the builders for the 4 members of a delegate type :-)
20974 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20977 * expression.cs (New::DoResolve): Implement guts for delegate creation.
20979 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20981 2001-10-15 Miguel de Icaza <miguel@ximian.com>
20983 * statement.cs (Break::Emit): Implement.
20984 (Continue::Emit): Implement.
20986 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
20987 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
20988 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
20989 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
20992 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20993 properties that track the label for the current loop (begin of the
20994 loop and end of the loop).
20996 2001-10-15 Ravi Pratap <ravi@ximian.com>
20998 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20999 use of emitting anything at all.
21001 * class.cs, rootcontext.cs : Get rid of calls to the same.
21003 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21005 (Populate): Define the constructor correctly and set the implementation
21008 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21011 (AddDelegateType): Implement.
21013 (IsDelegateType): Implement helper method.
21015 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21017 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21018 and accordingly handle it.
21020 * delegate.cs (Populate): Take TypeContainer argument.
21021 Implement bits to define the Invoke method. However, I still haven't figured out
21022 how to take care of the native int bit :-(
21024 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21025 Qualify the name of the delegate, not its return type !
21027 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21030 (StandardConversionExists): Checking for array types turns out to be recursive.
21032 (ConvertReferenceExplicit): Implement array conversion.
21034 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21036 2001-10-12 Ravi Pratap <ravi@ximian.com>
21038 * cs-parser.jay (delegate_declaration): Store the fully qualified
21039 name as it is a type declaration.
21041 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21044 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21045 as TypeContainer::DefineType.
21047 (Populate): Method in which all the definition of the various methods (Invoke)
21050 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21053 (CloseDelegate): Finally creates the delegate.
21055 * class.cs (TypeContainer::DefineType): Update to define delegates.
21056 (Populate, Emit and CloseType): Do the same thing here too.
21058 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21059 delegates in all these operations.
21061 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21063 * expression.cs: LocalTemporary: a new expression used to
21064 reference a temporary that has been created.
21066 * assign.cs: Handle PropertyAccess back here, so that we can
21067 provide the proper semantic access to properties.
21069 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21070 a few more explicit conversions.
21072 * modifiers.cs: `NEW' modifier maps to HideBySig.
21074 * expression.cs (PropertyExpr): Make this into an
21075 ExpressionStatement, and support the EmitStatement code path.
21077 Perform get/set error checking, clean up the interface.
21079 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21080 them into toplevel access objects.
21082 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21084 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21087 * typemanager.cs: Keep track here of our PropertyBuilders again to
21088 work around lameness in SRE.
21090 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21092 * expression.cs (LValue::LValueResolve): New method in the
21093 interface, used to perform a second resolution pass for LValues.
21095 (This::DoResolve): Catch the use of this in static methods.
21097 (This::LValueResolve): Implement.
21099 (This::Store): Remove warning, assigning to `this' in structures
21102 (Invocation::Emit): Deal with invocation of
21103 methods on value types. We need to pass the address to structure
21104 methods rather than the object itself. (The equivalent code to
21105 emit "this" for structures leaves the entire structure on the
21106 stack instead of a pointer to it).
21108 (ParameterReference::DoResolve): Compute the real index for the
21109 argument based on whether the method takes or not a `this' pointer
21110 (ie, the method is static).
21112 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21113 value types returned from functions when we need to invoke a
21114 method on the sturcture.
21117 2001-10-11 Ravi Pratap <ravi@ximian.com>
21119 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21120 defining the type in the Modulebuilder or Typebuilder. This is to take
21121 care of nested types which need to be defined on the TypeBuilder using
21122 DefineNestedMethod.
21124 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21125 methods in RootContext, only ported to be part of TypeContainer.
21127 (TypeContainer::GetInterfaceOrClass): Ditto.
21129 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21131 * interface.cs (Interface::DefineInterface): New method. Does exactly
21132 what RootContext.CreateInterface did earlier, only it takes care of nested types
21135 (Interface::GetInterfaces): Move from RootContext here and port.
21137 (Interface::GetInterfaceByName): Same here.
21139 * rootcontext.cs (ResolveTree): Re-write.
21141 (PopulateTypes): Re-write.
21143 * class.cs (TypeContainer::Populate): Populate nested types too.
21144 (TypeContainer::Emit): Emit nested members too.
21146 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21147 instead just use the name argument passed in as it is already fully
21150 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21151 to TypeContainer mapping to see if a type is user-defined.
21153 * class.cs (TypeContainer::CloseType): Implement.
21155 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21156 the default constructor.
21158 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21161 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21163 * interface.cs (CloseType): Create the type here.
21165 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21168 Remove all the methods which are now in TypeContainer.
21170 2001-10-10 Ravi Pratap <ravi@ximian.com>
21172 * delegate.cs (Define): Re-write bits to define the delegate
21175 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21177 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21179 * expression.cs (ImplicitReferenceConversion): handle null as well
21180 as a source to convert to any reference type.
21182 * statement.cs (Return): Perform any implicit conversions to
21183 expected return type.
21185 Validate use of return statement.
21187 * codegen.cs (EmitContext): Pass the expected return type here.
21189 * class.cs (Method, Constructor, Property): Pass expected return
21190 type to EmitContext.
21192 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21194 * expression.cs: Make DoResolve take an EmitContext instead of a
21197 Replaced `l' and `location' for `loc', for consistency.
21199 (Error, Warning): Remove unneeded Tc argument.
21201 * assign.cs, literal.cs, constant.cs: Update to new calling
21204 * codegen.cs: EmitContext now contains a flag indicating whether
21205 code is being generated in a static method or not.
21207 * cs-parser.jay: DecomposeQI, new function that replaces the old
21208 QualifiedIdentifier. Now we always decompose the assembled
21209 strings from qualified_identifier productions into a group of
21212 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21214 * rootcontext.cs: Deal with field-less struct types correctly now
21215 by passing the size option to Define Type.
21217 * class.cs: Removed hack that created one static field.
21219 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21221 * statement.cs: Moved most of the code generation here.
21223 2001-10-09 Ravi Pratap <ravi@ximian.com>
21225 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21228 (ElementAccess): Remove useless bits for now - keep checks as the spec
21231 2001-10-08 Ravi Pratap <ravi@ximian.com>
21233 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21234 and start performing checks according to the spec.
21236 2001-10-07 Ravi Pratap <ravi@ximian.com>
21238 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21239 rank_specifiers instead.
21241 (rank_specifiers): Change the order in which the rank specifiers are stored
21243 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21245 * expression.cs (ElementAccess): Implement the LValue interface too.
21247 2001-10-06 Ravi Pratap <ravi@ximian.com>
21249 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21250 except that user defined conversions are not included.
21252 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
21253 perform the conversion of the return type, if necessary.
21255 (New::DoResolve): Check whether we are creating an array or an object
21256 and accordingly do the needful.
21258 (New::Emit): Same here.
21260 (New::DoResolve): Implement guts of array creation.
21262 (New::FormLookupType): Helper function.
21264 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21266 * codegen.cs: Removed most of the code generation here, and move the
21267 corresponding code generation bits to the statement classes.
21269 Added support for try/catch/finalize and throw.
21271 * cs-parser.jay: Added support for try/catch/finalize.
21273 * class.cs: Catch static methods having the flags override,
21274 virtual or abstract.
21276 * expression.cs (UserCast): This user cast was not really doing
21277 what it was supposed to do. Which is to be born in fully resolved
21278 state. Parts of the resolution were being performed at Emit time!
21282 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21284 * expression.cs: Implicity convert the result from UserCast.
21286 2001-10-05 Ravi Pratap <ravi@ximian.com>
21288 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21289 prevented it from working correctly.
21291 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21292 merely ConvertImplicit.
21294 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21296 * typemanager.cs: Make the LookupTypeContainer function static,
21297 and not per-instance.
21299 * class.cs: Make static FindMembers (the one that takes a Type
21302 * codegen.cs: Add EmitForeach here.
21304 * cs-parser.jay: Make foreach a toplevel object instead of the
21305 inline expansion, as we need to perform semantic analysis on it.
21307 2001-10-05 Ravi Pratap <ravi@ximian.com>
21309 * expression.cs (Expression::ImplicitUserConversion): Rename to
21310 UserDefinedConversion.
21312 (Expression::UserDefinedConversion): Take an extra argument specifying
21313 whether we look for explicit user conversions too.
21315 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21317 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21319 (ExplicitUserConversion): Make it a call to UserDefinedConversion
21320 with the appropriate arguments.
21322 * cs-parser.jay (cast_expression): Record location too.
21324 * expression.cs (Cast): Record location info.
21326 (Expression::ConvertExplicit): Take location argument.
21328 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21329 to determine if we are doing explicit conversions.
21331 (UserCast::Emit): Update accordingly.
21333 (Expression::ConvertExplicit): Report an error if everything fails.
21335 * ../errors/cs0030.cs : Add.
21337 2001-10-04 Miguel de Icaza <miguel@ximian.com>
21339 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21340 virtual and newslot bits.
21342 * class.cs (TypeContainer::RegisterRequiredImplementations):
21343 Record methods we need.
21345 (TypeContainer::MakeKey): Helper function to make keys for
21346 MethodBases, since the Methodbase key is useless.
21348 (TypeContainer::Populate): Call RegisterRequiredImplementations
21349 before defining the methods.
21351 Create a mapping for method_builders_to_methods ahead of time
21352 instead of inside a tight loop.
21354 (::RequireMethods): Accept an object as the data to set into the
21355 hashtable so we can report interface vs abstract method mismatch.
21357 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21359 * report.cs: Make all of it static.
21361 * rootcontext.cs: Drop object_type and value_type computations, as
21362 we have those in the TypeManager anyways.
21364 Drop report instance variable too, now it is a global.
21366 * driver.cs: Use try/catch on command line handling.
21368 Add --probe option to debug the error reporting system with a test
21371 * report.cs: Add support for exiting program when a probe
21372 condition is reached.
21374 2001-10-03 Ravi Pratap <ravi@ximian.com>
21376 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21377 we do a forcible conversion regardless of type, to check if
21378 ForceConversion returns a null.
21380 (Binary::error19): Use location to report error.
21382 (Unary::error23): Use location here too.
21384 * ../errors/cs0019.cs : Check in.
21386 * ../errors/cs0023.cs : Check in.
21388 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21389 case of a non-null MethodInfo object with a length of 0 !
21391 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21392 an applicable member - according to the spec :-)
21393 Also fix logic to find members in base types.
21395 (Unary::ResolveOperator): Same here.
21397 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21398 as I was getting thoroughly confused between this and error19 :-)
21400 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21401 (::FindMostEncompassedType): Implement.
21402 (::FindMostEncompassingType): Implement.
21403 (::StandardConversionExists): Implement.
21405 (UserImplicitCast): Re-vamp. We now need info about most specific
21406 source and target types so that we can do the necessary conversions.
21408 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21409 mathematical union with no duplicates.
21411 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21413 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21414 in order from base classes to child classes, so that we can in
21415 child classes look up in our parent for method names and
21416 attributes (required for handling abstract, virtual, new, override
21417 constructs: we need to instrospect our base class, and if we dont
21418 populate the classes in order, the introspection might be
21419 incorrect. For example, a method could query its parent before
21420 the parent has any methods and would determine that the parent has
21421 no abstract methods (while it could have had them)).
21423 (RootContext::CreateType): Record the order in which we define the
21426 2001-10-02 Miguel de Icaza <miguel@ximian.com>
21428 * class.cs (TypeContainer::Populate): Also method definitions can
21429 fail now, keep track of this.
21431 (TypeContainer::FindMembers): Implement support for
21432 DeclaredOnly/noDeclaredOnly flag.
21434 (Constructor::Emit) Return the ConstructorBuilder.
21436 (Method::Emit) Return the MethodBuilder.
21437 Check for abstract or virtual methods to be public.
21439 * rootcontext.cs (RootContext::CreateType): Register all the
21440 abstract methods required for the class to be complete and the
21441 interface methods that must be implemented.
21443 * cs-parser.jay: Report error 501 (method requires body if it is
21444 not marked abstract or extern).
21446 * expression.cs (TypeOf::Emit): Implement.
21448 * typemanager.cs: runtime_handle_type, new global type.
21450 * class.cs (Property::Emit): Generate code for properties.
21452 2001-10-02 Ravi Pratap <ravi@ximian.com>
21454 * expression.cs (Unary::ResolveOperator): Find operators on base type
21455 too - we now conform exactly to the spec.
21457 (Binary::ResolveOperator): Same here.
21459 * class.cs (Operator::Define): Fix minor quirk in the tests.
21461 * ../errors/cs0215.cs : Added.
21463 * ../errors/cs0556.cs : Added.
21465 * ../errors/cs0555.cs : Added.
21467 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21469 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21470 single integer which is really efficient
21472 2001-10-01 Ravi Pratap <ravi@ximian.com>
21474 * expression.cs (Expression::ImplicitUserConversion): Use location
21475 even in the case when we are examining True operators.
21477 * class.cs (Operator::Define): Perform extensive checks to conform
21478 with the rules for operator overloading in the spec.
21480 * expression.cs (Expression::ImplicitReferenceConversion): Implement
21481 some of the other conversions mentioned in the spec.
21483 * typemanager.cs (array_type): New static member for the System.Array built-in
21486 (cloneable_interface): For System.ICloneable interface.
21488 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21489 we start resolving the tree and populating types.
21491 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21493 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21495 * expression.cs (Expression::ExprClassFromMemberInfo,
21496 Expression::Literalize): Create literal expressions from
21497 FieldInfos which are literals.
21499 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21500 type casts, because they were wrong. The test suite in tests
21503 (ImplicitNumericConversion): ushort to ulong requires a widening
21506 Int32 constant to long requires widening cast as well.
21508 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21509 for integers because the type on the stack is not i4.
21511 2001-09-30 Miguel de Icaza <miguel@ximian.com>
21513 * expression.cs (report118): require location argument.
21515 * parameter.cs: Do not dereference potential null value.
21517 * class.cs: Catch methods that lack the `new' keyword when
21518 overriding a name. Report warnings when `new' is used without
21519 anything being there to override.
21521 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21523 * class.cs: Only add constructor to hashtable if it is non-null
21524 (as now constructors can fail on define).
21526 (TypeManager, Class, Struct): Take location arguments.
21528 Catch field instance initialization in structs as errors.
21530 accepting_filter: a new filter for FindMembers that is static so
21531 that we dont create an instance per invocation.
21533 (Constructor::Define): Catch errors where a struct constructor is
21536 * cs-parser.jay: Pass location information for various new
21539 * delegate.cs (Delegate): take a location argument.
21541 * driver.cs: Do not call EmitCode if there were problesm in the
21542 Definition of the types, as many Builders wont be there.
21544 * decl.cs (Decl::Decl): Require a location argument.
21546 * cs-tokenizer.cs: Handle properly hex constants that can not fit
21547 into integers, and find the most appropiate integer for it.
21549 * literal.cs: Implement ULongLiteral.
21551 * rootcontext.cs: Provide better information about the location of
21552 failure when CreateType fails.
21554 2001-09-29 Miguel de Icaza <miguel@ximian.com>
21556 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21559 * expression.cs (Binary::CheckShiftArguments): Add missing type
21561 (Binary::ResolveOperator): Add type to the logical and and logical
21562 or, Bitwise And/Or and Exclusive Or code paths, it was missing
21565 (Binary::DoNumericPromotions): In the case where either argument
21566 is ulong (and most signed types combined with ulong cause an
21567 error) perform implicit integer constant conversions as well.
21569 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21571 * expression.cs (UserImplicitCast): Method should always be
21573 (Invocation::BetterConversion): Simplified test for IntLiteral.
21575 (Expression::ImplicitNumericConversion): Split this routine out.
21576 Put the code that performs implicit constant integer conversions
21579 (Expression::Resolve): Become a wrapper around DoResolve so we can
21580 check eclass and type being set after resolve.
21582 (Invocation::Badness): Remove this dead function
21584 (Binary::ResolveOperator): Do not compute the expensive argumnets
21585 unless we have a union for it.
21587 (Probe::Emit): Is needs to do an isinst and then
21588 compare against null.
21590 (::CanConvert): Added Location argument. If the Location argument
21591 is null (Location.Null), then we do not report errors. This is
21592 used by the `probe' mechanism of the Explicit conversion. We do
21593 not want to generate an error for something that the user
21594 explicitly requested to be casted. But the pipeline for an
21595 explicit cast first tests for potential implicit casts.
21597 So for now, if the Location is null, it means `Probe only' to
21598 avoid adding another argument. Might have to revise this
21601 (ClassCast): New class used to type cast objects into arbitrary
21602 classes (used in Explicit Reference Conversions).
21604 Implement `as' as well.
21606 Reverted all the patches from Ravi below: they were broken:
21608 * The use of `level' as a mechanism to stop recursive
21609 invocations is wrong. That was there just to catch the
21610 bug with a strack trace but not as a way of addressing
21613 To fix the problem we have to *understand* what is going
21614 on and the interactions and come up with a plan, not
21615 just get things going.
21617 * The use of the type conversion cache that I proposed
21618 last night had an open topic: How does this work across
21619 protection domains. A user defined conversion might not
21620 be public in the location where we are applying the
21621 conversion, a different conversion might be selected
21622 (ie, private A->B (better) but public B->A (worse),
21623 inside A, A->B applies, but outside it, B->A will
21626 * On top of that (ie, even if the above is solved),
21627 conversions in a cache need to be abstract. Ie, `To
21628 convert from an Int to a Short use an OpcodeCast', not
21629 `To convert from an Int to a Short use the OpcodeCast on
21630 the variable 5' (which is what this patch was doing).
21632 2001-09-28 Ravi Pratap <ravi@ximian.com>
21634 * expression.cs (Invocation::ConversionExists): Re-write to use
21635 the conversion cache
21637 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21638 cache all conversions done, not just user-defined ones.
21640 (Invocation::BetterConversion): The real culprit. Use ConversionExists
21641 to determine if a conversion exists instead of acutually trying to
21642 perform the conversion. It's faster too.
21644 (Expression::ConvertExplicit): Modify to use ConversionExists to check
21645 and only then attempt the implicit conversion.
21647 2001-09-28 Ravi Pratap <ravi@ximian.com>
21649 * expression.cs (ConvertImplicit): Use a cache for conversions
21650 already found. Check level of recursion and bail out if necessary.
21652 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21654 * typemanager.cs (string_concat_string_string, string_concat_object_object):
21655 Export standard methods that we expect for string operations.
21657 * statement.cs (Block::UsageWarning): Track usage of variables and
21658 report the errors for not used variables.
21660 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21663 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21665 * codegen.cs: remove unnneded code
21667 * expression.cs: Removed BuiltinTypeAccess class
21669 Fix the order in which implicit conversions are
21672 The previous fixed dropped support for boxed conversions (adding a
21673 test to the test suite now)
21675 (UserImplicitCast::CanConvert): Remove test for source being null,
21676 that code is broken. We should not feed a null to begin with, if
21677 we do, then we should track the bug where the problem originates
21678 and not try to cover it up here.
21680 Return a resolved expression of type UserImplicitCast on success
21681 rather than true/false. Ravi: this is what I was talking about,
21682 the pattern is to use a static method as a "constructor" for
21685 Also, do not create arguments until the very last minute,
21686 otherwise we always create the arguments even for lookups that
21687 will never be performed.
21689 (UserImplicitCast::Resolve): Eliminate, objects of type
21690 UserImplicitCast are born in a fully resolved state.
21692 * typemanager.cs (InitCoreTypes): Init also value_type
21693 (System.ValueType).
21695 * expression.cs (Cast::Resolve): First resolve the child expression.
21697 (LValue): Add new method AddressOf to be used by
21700 Change the argument of Store to take an EmitContext instead of an
21701 ILGenerator, because things like FieldExpr need to be able to call
21702 their children expression to generate the instance code.
21704 (Expression::Error, Expression::Warning): Sugar functions for
21707 (Expression::MemberLookup): Accept a TypeContainer instead of a
21708 Report as the first argument.
21710 (Expression::ResolvePrimary): Killed. I still want to improve
21711 this as currently the code is just not right.
21713 (Expression::ResolveMemberAccess): Simplify, but it is still
21716 (Unary::Resolve): Catch errors in AddressOf operators.
21718 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21719 index to a byte for the short-version, or the compiler will choose
21720 the wrong Emit call, which generates the wrong data.
21722 (ParameterReference::Emit, ::Store): same.
21724 (FieldExpr::AddressOf): Implement.
21726 * typemanager.cs: TypeManager: made public variable instead of
21729 * driver.cs: document --fatal.
21731 * report.cs (ErrorMessage, WarningMessage): new names for the old
21732 Error and Warning classes.
21734 * cs-parser.jay (member_access): Turn built-in access to types
21735 into a normal simplename
21737 2001-09-27 Ravi Pratap <ravi@ximian.com>
21739 * expression.cs (Invocation::BetterConversion): Fix to cope
21740 with q being null, since this was introducing a bug.
21742 * expression.cs (ConvertImplicit): Do built-in conversions first.
21744 2001-09-27 Ravi Pratap <ravi@ximian.com>
21746 * expression.cs (UserImplicitCast::Resolve): Fix bug.
21748 2001-09-27 Ravi Pratap <ravi@ximian.com>
21750 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21751 I had introduced long ago (what's new ?).
21753 * expression.cs (UserImplicitCast::CanConvert): Static method to do
21754 the work of all the checking.
21755 (ConvertImplicit): Call CanConvert and only then create object if necessary.
21756 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21758 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21759 that is the right way.
21761 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
21762 overloading resolution. Use everywhere instead of cutting and pasting code.
21764 (Binary::ResolveOperator): Use MakeUnionSet.
21766 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
21767 we have to convert to bool types. Not complete yet.
21769 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21771 * typemanager.cs (TypeManager::CSharpName): support ushort.
21773 * expression.cs (Expression::TryImplicitIntConversion): Attempts
21774 to provide an expression that performsn an implicit constant int
21775 conversion (section 6.1.6).
21776 (Expression::ConvertImplicitRequired): Reworked to include
21777 implicit constant expression conversions.
21779 (Expression::ConvertNumericExplicit): Finished.
21781 (Invocation::Emit): If InstanceExpression is null, then it means
21782 that we perform a call on this.
21784 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21786 * expression.cs (Unary::Emit): Remove some dead code.
21787 (Probe): Implement Resolve and Emit for `is'.
21788 (Expression::ConvertImplicitRequired): Attempt to do constant
21789 expression conversions here. Maybe should be moved to
21790 ConvertImplicit, but I am not sure.
21791 (Expression::ImplicitLongConstantConversionPossible,
21792 Expression::ImplicitIntConstantConversionPossible): New functions
21793 that tell whether is it possible to apply an implicit constant
21794 expression conversion.
21796 (ConvertNumericExplicit): Started work on explicit numeric
21799 * cs-parser.jay: Update operator constants.
21801 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21802 (Parameters::GetSignature): Hook up VerifyArgs here.
21803 (Parameters::VerifyArgs): Verifies that no two arguments have the
21806 * class.cs (Operator): Update the operator names to reflect the
21807 ones that the spec expects (as we are just stringizing the
21810 * expression.cs (Unary::ResolveOperator): Fix bug: Use
21811 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21812 previous usage did only work for our methods.
21813 (Expression::ConvertImplicit): Handle decimal implicit numeric
21814 conversions as well.
21815 (Expression::InternalTypeConstructor): Used to invoke constructors
21816 on internal types for default promotions.
21818 (Unary::Emit): Implement special handling for the pre/post
21819 increment/decrement for overloaded operators, as they need to have
21820 the same semantics as the other operators.
21822 (Binary::ResolveOperator): ditto.
21823 (Invocation::ConversionExists): ditto.
21824 (UserImplicitCast::Resolve): ditto.
21826 2001-09-26 Ravi Pratap <ravi@ximian.com>
21828 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21829 operator, return after emitting body. Regression tests pass again !
21831 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21832 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21833 (Invocation::OverloadResolve): Ditto.
21834 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21836 * everywhere : update calls to the above methods accordingly.
21838 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21840 * assign.cs (Assign): Make it inherit from ExpressionStatement.
21842 * expression.cs (ExpressionStatement): New base class used for
21843 expressions that can appear in statements, so that we can provide
21844 an alternate path to generate expression that do not leave a value
21847 (Expression::Emit, and all the derivatives): We no longer return
21848 whether a value is left on the stack or not. Every expression
21849 after being emitted leaves a single value on the stack.
21851 * codegen.cs (EmitContext::EmitStatementExpression): Use the
21852 facilties of ExpressionStatement if possible.
21854 * cs-parser.jay: Update statement_expression.
21856 2001-09-25 Miguel de Icaza <miguel@ximian.com>
21858 * driver.cs: Change the wording of message
21860 2001-09-25 Ravi Pratap <ravi@ximian.com>
21862 * expression.cs (Binary::ResolveOperator): Had forgottten to set
21863 the type of the expression to the return type of the method if
21864 we have an overloaded operator match ! The regression tests pass again !
21865 (Unary::ResolveOperator): Ditto.
21867 * expression.cs (Invocation::ConversionExists): Correct the member lookup
21868 to find "op_Implicit", not "implicit" ;-)
21869 (UserImplicitCast): New class to take care of user-defined implicit conversions.
21870 (ConvertImplicit, ForceConversion): Take TypeContainer argument
21872 * everywhere : Correct calls to the above accordingly.
21874 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21875 (ConvertImplicit): Do user-defined conversion if it exists.
21877 2001-09-24 Miguel de Icaza <miguel@ximian.com>
21879 * assign.cs: track location.
21880 (Resolve): Use implicit conversions on assignment.
21882 * literal.cs: Oops. Not good, Emit of short access values should
21883 pass (Bytes) or the wrong argument will be selected.
21885 * expression.cs (Unary::Emit): Emit code for -expr.
21887 (Unary::ResolveOperator): Handle `Substract' for non-constants
21888 (substract from zero from the non-constants).
21889 Deal with Doubles as well.
21891 (Expression::ConvertImplicitRequired): New routine that reports an
21892 error if no implicit conversion exists.
21894 (Invocation::OverloadResolve): Store the converted implicit
21895 expressions if we make them
21897 2001-09-24 Ravi Pratap <ravi@ximian.com>
21899 * class.cs (ConstructorInitializer): Take a Location argument.
21900 (ConstructorBaseInitializer): Same here.
21901 (ConstructorThisInitializer): Same here.
21903 * cs-parser.jay : Update all calls accordingly.
21905 * expression.cs (Unary, Binary, New): Take location argument.
21906 Update accordingly everywhere.
21908 * cs-parser.jay : Update all calls to the above to take a location
21911 * class.cs : Ditto.
21913 2001-09-24 Ravi Pratap <ravi@ximian.com>
21915 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21916 (Invocation::BetterConversion): Same here
21917 (Invocation::ConversionExists): Ditto.
21919 (Invocation::ConversionExists): Implement.
21921 2001-09-22 Ravi Pratap <ravi@ximian.com>
21923 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21924 Also take an additional TypeContainer argument.
21926 * All over : Pass in TypeContainer as argument to OverloadResolve.
21928 * typemanager.cs (CSharpName): Update to check for the string type and return
21931 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21934 2001-09-21 Ravi Pratap <ravi@ximian.com>
21936 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21937 (Invocation::BetterFunction): Implement.
21938 (Invocation::BetterConversion): Implement.
21939 (Invocation::ConversionExists): Skeleton, no implementation yet.
21941 Okay, things work fine !
21943 2001-09-21 Miguel de Icaza <miguel@ximian.com>
21945 * typemanager.cs: declare and load enum_type, delegate_type and
21948 * expression.cs (Expression::Emit): Now emit returns a value that
21949 tells whether a value is left on the stack or not. This strategy
21950 might be reveted tomorrow with a mechanism that would address
21951 multiple assignments.
21952 (Expression::report118): Utility routine to report mismatches on
21955 (Unary::Report23): Report impossible type/operator combination
21958 (Unary::IsIncrementableNumber): Whether the type can be
21959 incremented or decremented with add.
21960 (Unary::ResolveOperator): Also allow enumerations to be bitwise
21962 (Unary::ResolveOperator): Implement ++, !, ~,
21964 (Invocation::Emit): Deal with new Emit convetion.
21966 * All Expression derivatives: Updated their Emit method to return
21967 whether they leave values on the stack or not.
21969 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21970 stack for expressions that are statements.
21972 2001-09-20 Miguel de Icaza <miguel@ximian.com>
21974 * expression.cs (LValue): New interface. Must be implemented by
21976 (LocalVariableReference, ParameterReference, FieldExpr): Implement
21979 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21980 interface for generating code, simplifies the code.
21982 2001-09-20 Ravi Pratap <ravi@ximian.com>
21984 * expression.cs (everywhere): Comment out return statements in ::Resolve
21985 methods to avoid the warnings.
21987 2001-09-20 Miguel de Icaza <miguel@ximian.com>
21989 * driver.cs (parse): Report error 2001 if we can not open the
21992 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21995 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21998 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21999 otherwise nested blocks end up with the same index.
22001 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22003 * expression.cs: Instead of having FIXMEs in the Resolve
22004 functions, throw exceptions so it is obvious that we are facing a
22007 * cs-parser.jay (invocation_expression): Pass Location information.
22009 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22010 Use a basename for those routines because .NET does not like paths
22013 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22016 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22018 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22019 are loading the correct data types (throws an exception if not).
22020 (TypeManager::InitCoreTypes): Use CoreLookupType
22022 * expression.cs (Unary::ResolveOperator): return the child
22023 expression for expressions which are just +expr.
22024 (Unary::ResolveOperator): Return negative literals for -LITERAL
22025 expressions (otherwise they are Unary {Literal}).
22026 (Invocation::Badness): Take into account `Implicit constant
22027 expression conversions'.
22029 * literal.cs (LongLiteral): Implement long literal class.
22030 (IntLiteral): export the `Value' of the intliteral.
22032 2001-09-19 Ravi Pratap <ravi@ximian.com>
22034 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22036 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22037 instead of 'Operator'
22039 * expression.cs (Binary::ResolveOperator): Update accordingly.
22040 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22043 * cs-parser.jay (unary_expression): Update to use the new names.
22045 * gen-treedump.cs (GetUnary): Same here.
22047 * expression.cs (Unary::Resolve): Implement.
22048 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22049 operators are found instead of making noise ;-)
22050 (Unary::ResolveOperator): New method to do precisely the same thing which
22051 Binary::ResolveOperator does for Binary expressions.
22052 (Unary.method, .Arguments): Add.
22053 (Unary::OperName): Implement.
22054 (Unary::ForceConversion): Copy and Paste !
22056 * class.cs (Operator::Define): Fix a small bug for the case when we have
22059 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22060 for the inbuilt operators. Only overloading works for now ;-)
22062 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22064 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22065 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22067 * expression.cs (This::Emit): Implement.
22068 (This::Resolve): Implement.
22069 (TypeOf:Resolve): Implement.
22070 (Expression::ResolveSimpleName): Add an implicit this to instance
22072 (MemberAccess::Resolve): Deal with Parameters and Fields.
22073 Bind instance variable to Field expressions.
22074 (FieldExpr::Instance): New field used to track the expression that
22075 represents the object instance.
22076 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22078 (FieldExpr::Emit): Implement.
22080 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22081 the last instruction contains a return opcode to avoid generating
22082 the last `ret' instruction (this generates correct code, and it is
22083 nice to pass the peverify output).
22085 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22086 initializer for static and instance variables.
22087 (Constructor::Emit): Allow initializer to be null in the case of
22088 static constructors. Only emit initializer for instance
22091 (TypeContainer::FindMembers): Return a null array if there are no
22094 Also fix the code for the MemberTypes.Method branch, as it was not
22095 scanning that for operators (or tried to access null variables before).
22097 * assign.cs (Assign::Emit): Handle instance and static fields.
22101 * driver.cs: Stop compilation if there are parse errors.
22103 * cs-parser.jay (constructor_declaration): Provide default base
22104 initializer for non-static constructors.
22105 (constructor_declarator): Do not provide a default base
22106 initializers if none was specified.
22107 Catch the fact that constructors should not have parameters.
22109 * class.cs: Do not emit parent class initializers for static
22110 constructors, that should be flagged as an error.
22112 2001-09-18 Ravi Pratap <ravi@ximian.com>
22114 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22115 Move back code into TypeContainer::Populate.
22117 2001-09-18 Ravi Pratap <ravi@ximian.com>
22119 * class.cs (TypeContainer::AddConstructor): Fix the check to
22120 compare against Name, not Basename.
22121 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22123 * cs-parser.jay : Update accordingly.
22125 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22126 for methods, don't forget to look into the operators too.
22127 (RegisterMethodBuilder): Helper method to take care of this for
22128 methods, constructors and operators.
22129 (Operator::Define): Completely revamp.
22130 (Operator.OperatorMethod, MethodName): New fields.
22131 (TypeContainer::Populate): Move the registering of builders into
22132 RegisterMethodBuilder.
22133 (Operator::Emit): Re-write.
22135 * expression.cs (Binary::Emit): Comment out code path to emit method
22136 invocation stuff for the case when we have a user defined operator. I am
22137 just not able to get it right !
22139 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22141 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22144 (Expression::MemberLookup): Provide a version that allows to
22145 specify the MemberTypes and BindingFlags.
22147 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22148 so it was not fetching variable information from outer blocks.
22150 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22151 Beforefieldinit as it was buggy.
22153 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22154 that Ravi put here.
22156 * class.cs (Constructor::Emit): Only emit if block is not null.
22157 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22158 deal with this by semantically definining it as if the user had
22161 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22162 constructors as we now "emit" them at a higher level.
22164 (TypeContainer::DefineDefaultConstructor): Used to define the
22165 default constructors if none was provided.
22167 (ConstructorInitializer): Add methods Resolve and Emit.
22169 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22171 2001-09-17 Ravi Pratap <ravi@ximian.com>
22173 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22174 the default constructor builder with our hashtable for methodbuilders
22177 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22178 and argument_count is 0 in which case we have a match.
22179 (Binary::ResolveOperator): More null checking and miscellaneous coding
22182 2001-09-17 Ravi Pratap <ravi@ximian.com>
22184 * rootcontext.cs (IsNameSpace): Compare against null.
22186 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22188 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22189 and Unary::Operator.
22191 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22194 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22195 we have overloaded operators.
22196 (Binary::ResolveOperator): Implement the part which does the operator overload
22199 * class.cs (Operator::Emit): Implement.
22200 (TypeContainer::Emit): Emit the operators we have too.
22202 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22203 the case when we have a user-defined operator.
22205 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22207 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22209 2001-09-16 Ravi Pratap <ravi@ximian.com>
22211 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22212 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22213 (Constructor::Emit): Implement.
22214 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22215 if we have no work to do.
22216 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22219 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22220 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22222 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22225 2001-09-15 Ravi Pratap <ravi@ximian.com>
22227 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22229 (Tree::RecordNamespace): Method to do what the name says ;-)
22230 (Tree::Namespaces): Property to get at the namespaces hashtable.
22232 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22235 * rootcontext.cs (IsNamespace): Fixed it :-)
22237 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22239 * class.cs (TypeContainer::FindMembers): Add support for
22241 (MethodCore): New class that encapsulates both the shared aspects
22242 of a Constructor and a Method.
22243 (Method, Constructor): Factored pieces into MethodCore.
22245 * driver.cs: Added --fatal which makes errors throw exceptions.
22246 Load System assembly as well as part of the standard library.
22248 * report.cs: Allow throwing exceptions on errors for debugging.
22250 * modifiers.cs: Do not use `parent', instead use the real type
22251 container to evaluate permission settings.
22253 * class.cs: Put Ravi's patch back in. He is right, and we will
22254 have to cope with the
22256 2001-09-14 Ravi Pratap <ravi@ximian.com>
22258 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22259 FamORAssem, not FamANDAssem.
22261 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22263 * driver.cs: Added --parse option that only parses its input files
22266 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
22267 incorrect. IsTopLevel is not used to tell whether an object is
22268 root_types or not (that can be achieved by testing this ==
22269 root_types). But to see if this is a top-level *class* (not
22270 necessarly our "toplevel" container).
22272 2001-09-14 Ravi Pratap <ravi@ximian.com>
22274 * enum.cs (Enum::Define): Modify to call the Lookup method on the
22275 parent instead of a direct call to GetType.
22277 2001-09-14 Ravi Pratap <ravi@ximian.com>
22279 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22280 Modifiers.TypeAttr. This should just be a call to that method.
22282 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22283 object so that we can determine if we are top-level or not.
22285 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
22288 * enum.cs (Enum::Define): Ditto.
22290 * modifiers.cs (FieldAttr): Re-write.
22292 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22293 (TypeContainer::HaveStaticConstructor): New property to provide access
22294 to precisely that info.
22296 * modifiers.cs (MethodAttr): Re-write.
22297 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22299 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22300 of top-level types as claimed.
22302 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22304 * expression.cs (MemberLookup): Fruitless attempt to lookup
22305 constructors. Maybe I need to emit default constructors? That
22306 might be it (currently .NET emits this for me automatically).
22307 (Invocation::OverloadResolve): Cope with Arguments == null.
22308 (Invocation::EmitArguments): new function, shared by the new
22309 constructor and us.
22310 (Invocation::Emit): Handle static and instance methods. Emit
22311 proper call instruction for virtual or non-virtual invocations.
22312 (New::Emit): Implement.
22313 (New::Resolve): Implement.
22314 (MemberAccess:Resolve): Implement.
22315 (MethodGroupExpr::InstanceExpression): used conforming to the spec
22316 to track instances.
22317 (FieldExpr::Resolve): Set type.
22319 * support.cs: Handle empty arguments.
22321 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22322 SimpleLookup): Auxiliary routines to help parse a qualifier
22325 Update qualifier_identifier rule.
22327 * codegen.cs: Removed debugging messages.
22329 * class.cs: Make this a global thing, this acts just as a "key" to
22330 objects that we might have around.
22332 (Populate): Only initialize method_builders_to_methods once.
22334 * expression.cs (PropertyExpr): Initialize type from the
22337 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22338 Resolve pattern. Attempt to implicitly convert value to boolean.
22341 * expression.cs: Set the type for the int32/int32 argument case.
22342 (Binary::ResolveOperator): Set the return type to boolean for
22343 comparission operators
22345 * typemanager.cs: Remove debugging print code.
22347 (Invocation::Resolve): resolve type.
22349 * class.cs: Allocate a MemberInfo of the correct size, as the code
22350 elsewhere depends on the test to reflect the correct contents.
22352 (Method::) Keep track of parameters, due to System.Reflection holes
22354 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22357 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22358 of the exact size and return that.
22360 (Class::LookupMethodByBuilder): New function that maps
22361 MethodBuilders to its methods. Required to locate the information
22362 on methods because System.Reflection bit us again.
22364 * support.cs: New file, contains an interface ParameterData and
22365 two implementations: ReflectionParameters and InternalParameters
22366 used to access Parameter information. We will need to grow this
22369 * expression.cs (Invocation::GetParameterData): implement a cache
22370 and a wrapper around the ParameterData creation for methods.
22371 (Invocation::OverloadResolve): Use new code.
22373 2001-09-13 Ravi Pratap <ravi@ximian.com>
22375 * class.cs (TypeContainer::EmitField): Remove and move into
22376 (Field::Define): here and modify accordingly.
22377 (Field.FieldBuilder): New member.
22378 (TypeContainer::Populate): Update accordingly.
22379 (TypeContainer::FindMembers): Implement.
22381 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22383 * statement.cs: (VariableInfo::VariableType): New field to be
22384 initialized with the full type once it is resolved.
22386 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22388 * parameter.cs (GetParameterInfo): Use a type cache to compute
22389 things only once, and to reuse this information
22391 * expression.cs (LocalVariableReference::Emit): Implement.
22392 (OpcodeCast::Emit): fix.
22394 (ParameterReference::Resolve): Implement.
22395 (ParameterReference::Emit): Implement.
22397 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22398 that are expressions need to stay as Expressions.
22400 * typemanager.cs (CSharpName): Returns the C# name of a type if
22403 * expression.cs (Expression::ConvertImplicit): New function that
22404 implements implicit type conversions.
22406 (Expression::ImplicitReferenceConversion): Implements implicit
22407 reference conversions.
22409 (EmptyCast): New type for transparent casts.
22411 (OpcodeCast): New type for casts of types that are performed with
22412 a sequence of bytecodes.
22414 (BoxedCast): New type used for casting value types into reference
22415 types. Emits a box opcode.
22417 (Binary::DoNumericPromotions): Implements numeric promotions of
22418 and computation of the Binary::Type.
22420 (Binary::EmitBranchable): Optimization.
22422 (Binary::Emit): Implement code emission for expressions.
22424 * typemanager.cs (TypeManager): Added two new core types: sbyte
22427 2001-09-12 Ravi Pratap <ravi@ximian.com>
22429 * class.cs (TypeContainer::FindMembers): Method which does exactly
22430 what Type.FindMembers does, only we don't have to use reflection. No
22431 implementation yet.
22433 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22434 typecontainer objects as we need to get at them.
22435 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22437 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22438 typecontainer object.
22440 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22441 of just a Report object.
22443 2001-09-11 Ravi Pratap <ravi@ximian.com>
22445 * class.cs (Event::Define): Go back to using the prefixes "add_" and
22447 (TypeContainer::Populate): Now define the delegates of the type too.
22448 (TypeContainer.Delegates): Property to access the list of delegates defined
22451 * delegates.cs (Delegate::Define): Implement partially.
22453 * modifiers.cs (TypeAttr): Handle more flags.
22455 2001-09-11 Ravi Pratap <ravi@ximian.com>
22457 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22459 (Operator::Define): Re-write logic to get types by using the LookupType method
22460 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22461 (Indexer::Define): Ditto.
22462 (Event::Define): Ditto.
22463 (Property::Define): Ditto.
22465 2001-09-10 Ravi Pratap <ravi@ximian.com>
22467 * class.cs (TypeContainer::Populate): Now define operators too.
22468 (TypeContainer.Operators): New property to access the list of operators
22470 (Operator.OperatorMethodBuilder): New member to hold the method builder
22471 for the operator we are defining.
22472 (Operator::Define): Implement.
22474 2001-09-10 Ravi Pratap <ravi@ximian.com>
22476 * class.cs (Event::Define): Make the prefixes of the accessor methods
22477 addOn_ and removeOn_
22479 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22480 of the location being passed in too. Ideally, this should go later since all
22481 error reporting should be done through the Report object.
22483 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22484 (Populate): Iterate thru the indexers we have and define them too.
22485 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22486 for the get and set accessors.
22487 (Indexer::Define): Implement.
22489 2001-09-09 Miguel de Icaza <miguel@ximian.com>
22491 * expression.cs (Binary::Resolve): Beginning of it. I scratched
22492 my previous implementation, did not work.
22494 * typemanager.cs: Add a couple of missing types (the longs).
22496 * literal.cs: Use TypeManager.bool_type instead of getting it.
22498 * expression.cs (EventExpr): New kind of expressions.
22499 (Expressio::ExprClassFromMemberInfo): finish
22501 2001-09-08 Miguel de Icaza <miguel@ximian.com>
22503 * assign.cs: Emit stores to static fields differently.
22505 2001-09-08 Ravi Pratap <ravi@ximian.com>
22507 * Merge in changes and adjust code to tackle conflicts. Backed out my
22508 code in Assign::Resolve ;-)
22510 2001-09-08 Ravi Pratap <ravi@ximian.com>
22512 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22513 instead Report.Error and also pass in the location.
22514 (CSharpParser::Lexer): New readonly property to return the reference
22515 to the Tokenizer object.
22516 (declare_local_variables): Use Report.Error with location instead of plain
22520 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22521 (Operator.CheckBinaryOperator): Ditto.
22523 * cs-parser.jay (operator_declarator): Update accordingly.
22525 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22526 (CheckBinaryOperator): Same here.
22528 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22529 on the name without any prefixes of namespace names etc. This is because we
22530 already might have something already fully qualified like
22531 'System.Console.WriteLine'
22533 * assign.cs (Resolve): Begin implementation. Stuck ;-)
22535 2001-09-07 Ravi Pratap <ravi@ximian.com>
22537 * cs-tokenizer.cs (location): Return a string which also contains
22540 * expression.cs (ElementAccess): New class for expressions of the
22541 type 'element access.'
22542 (BaseAccess): New class for expressions of the type 'base access.'
22543 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22546 * cs-parser.jay (element_access): Implement action.
22547 (base_access): Implement actions.
22548 (checked_expression, unchecked_expression): Implement.
22550 * cs-parser.jay (local_variable_type): Correct and implement.
22551 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22553 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22555 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22556 name and the specifiers.
22558 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22560 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
22561 making them all public ;-)
22563 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22566 2001-09-07 Miguel de Icaza <miguel@ximian.com>
22568 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22570 (FieldExpr, PropertyExprs): New resolved expressions.
22571 (SimpleName::MemberStaticCheck): Perform static checks for access
22572 to non-static fields on static methods. Maybe this should be
22573 generalized for MemberAccesses.
22574 (SimpleName::ResolveSimpleName): More work on simple name
22577 * cs-parser.jay (primary_expression/qualified_identifier): track
22578 the parameter index.
22580 * codegen.cs (CodeGen::Save): Catch save exception, report error.
22581 (EmitContext::EmitBoolExpression): Chain to expression generation
22582 instead of temporary hack.
22583 (::EmitStatementExpression): Put generic expression code generation.
22585 * assign.cs (Assign::Emit): Implement variable assignments to
22586 local variables, parameters and fields.
22588 2001-09-06 Miguel de Icaza <miguel@ximian.com>
22590 * statement.cs (Block::GetVariableInfo): New method, returns the
22591 VariableInfo for a variable name in a block.
22592 (Block::GetVariableType): Implement in terms of GetVariableInfo
22594 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22595 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22597 2001-09-06 Ravi Pratap <ravi@ximian.com>
22599 * cs-parser.jay (operator_declaration): Continue on my quest : update
22600 to take attributes argument.
22601 (event_declaration): Ditto.
22602 (enum_declaration): Ditto.
22603 (indexer_declaration): Ditto.
22605 * class.cs (Operator::Operator): Update constructor accordingly.
22606 (Event::Event): Ditto.
22608 * delegate.cs (Delegate::Delegate): Same here.
22610 * enum.cs (Enum::Enum): Same here.
22612 2001-09-05 Ravi Pratap <ravi@ximian.com>
22614 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22616 * ../tests/cs0658.cs : New file to demonstrate error 0658.
22618 * attribute.cs (Attributes): New class to encapsulate all attributes which were
22619 being passed around as an arraylist.
22620 (Attributes::AddAttribute): Method to add attribute sections.
22622 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22623 (struct_declaration): Update accordingly.
22624 (constant_declaration): Update.
22625 (field_declaration): Update.
22626 (method_header): Update.
22627 (fixed_parameter): Update.
22628 (parameter_array): Ditto.
22629 (property_declaration): Ditto.
22630 (destructor_declaration): Ditto.
22632 * class.cs (Struct::Struct): Update constructors accordingly.
22633 (Class::Class): Ditto.
22634 (Field::Field): Ditto.
22635 (Method::Method): Ditto.
22636 (Property::Property): Ditto.
22637 (TypeContainer::OptAttribute): update property's return type.
22639 * interface.cs (Interface.opt_attributes): New member.
22640 (Interface::Interface): Update to take the extra Attributes argument.
22642 * parameter.cs (Parameter::Parameter): Ditto.
22644 * constant.cs (Constant::Constant): Ditto.
22646 * interface.cs (InterfaceMemberBase): New OptAttributes field.
22647 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
22648 the attributes as a parameter.
22649 (InterfaceProperty): Update constructor call.
22650 (InterfaceEvent): Ditto.
22651 (InterfaceMethod): Ditto.
22652 (InterfaceIndexer): Ditto.
22654 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
22655 pass the attributes too.
22656 (interface_event_declaration): Ditto.
22657 (interface_property_declaration): Ditto.
22658 (interface_method_declaration): Ditto.
22659 (interface_declaration): Ditto.
22661 2001-09-05 Miguel de Icaza <miguel@ximian.com>
22663 * class.cs (Method::Define): Track the "static Main" definition to
22664 create an entry point.
22666 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22667 EntryPoint if we find it.
22669 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22670 (EmitContext::ig): Make this variable public.
22672 * driver.cs: Make the default output file be the first file name
22673 with the .exe extension.
22675 Detect empty compilations
22677 Handle various kinds of output targets. Handle --target and
22678 rename -t to --dumper.
22680 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22681 methods inherited from Expression return now an Expression. This
22682 will is used during the tree rewriting as we resolve them during
22685 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22686 the spec. Missing entirely is the information about
22687 accessability of elements of it.
22689 (Expression::ExprClassFromMemberInfo): New constructor for
22690 Expressions that creates a fully initialized Expression based on
22691 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22694 (Invocation::Resolve): Begin implementing resolution of invocations.
22696 * literal.cs (StringLiteral): Implement Emit.
22698 2001-09-05 Ravi Pratap <ravi@ximian.com>
22700 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22703 2001-09-04 Ravi Pratap <ravi@ximian.com>
22705 * cs-parser.jay (attribute_arguments): Implement actions.
22706 (attribute): Fix bug in production. Implement action.
22707 (attribute_list): Implement.
22708 (attribute_target): Implement.
22709 (attribute_target_specifier, opt_target_specifier): Implement
22710 (CheckAttributeTarget): New method to check if the attribute target
22712 (attribute_section): Implement.
22713 (opt_attributes): Implement.
22715 * attribute.cs : New file to handle attributes.
22716 (Attribute): Class to hold attribute info.
22718 * cs-parser.jay (opt_attribute_target_specifier): Remove production
22719 (attribute_section): Modify production to use 2 different rules to
22720 achieve the same thing. 1 s/r conflict down !
22721 Clean out commented, useless, non-reducing dimension_separator rules.
22723 * class.cs (TypeContainer.attributes): New member to hold list
22724 of attributes for a type.
22725 (Struct::Struct): Modify to take one more argument, the attribute list.
22726 (Class::Class): Ditto.
22727 (Field::Field): Ditto.
22728 (Method::Method): Ditto.
22729 (Property::Property): Ditto.
22731 * cs-parser.jay (struct_declaration): Update constructor call to
22732 pass in the attributes too.
22733 (class_declaration): Ditto.
22734 (constant_declaration): Ditto.
22735 (field_declaration): Ditto.
22736 (method_header): Ditto.
22737 (fixed_parameter): Ditto.
22738 (parameter_array): Ditto.
22739 (property_declaration): Ditto.
22741 * constant.cs (Constant::Constant): Update constructor similarly.
22742 Use System.Collections.
22744 * parameter.cs (Parameter::Parameter): Update as above.
22746 2001-09-02 Ravi Pratap <ravi@ximian.com>
22748 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22749 (TypeContainer.delegates): New member to hold list of delegates.
22751 * cs-parser.jay (delegate_declaration): Implement the action correctly
22752 this time as I seem to be on crack ;-)
22754 2001-09-02 Miguel de Icaza <miguel@ximian.com>
22756 * rootcontext.cs (RootContext::IsNamespace): new function, used to
22757 tell whether an identifier represents a namespace.
22759 * expression.cs (NamespaceExpr): A namespace expression, used only
22760 temporarly during expression resolution.
22761 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22762 utility functions to resolve names on expressions.
22764 2001-09-01 Miguel de Icaza <miguel@ximian.com>
22766 * codegen.cs: Add hook for StatementExpressions.
22768 * class.cs: Fix inverted test for static flag in methods.
22770 2001-09-02 Ravi Pratap <ravi@ximian.com>
22772 * class.cs (Operator::CheckUnaryOperator): Correct error number used
22773 to make it coincide with MS' number.
22774 (Operator::CheckBinaryOperator): Ditto.
22776 * ../errors/errors.txt : Remove error numbers added earlier.
22778 * ../errors/cs1019.cs : Test case for error # 1019
22780 * ../errros/cs1020.cs : Test case for error # 1020
22782 * cs-parser.jay : Clean out commented cruft.
22783 (dimension_separators, dimension_separator): Comment out. Ostensibly not
22784 used anywhere - non-reducing rule.
22785 (namespace_declarations): Non-reducing rule - comment out.
22787 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22788 with TypeContainer::AddEnum.
22790 * delegate.cs : New file for delegate handling classes.
22791 (Delegate): Class for declaring delegates.
22793 * makefile : Update.
22795 * cs-parser.jay (delegate_declaration): Implement.
22797 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
22799 * class.cs (Event::Define): Implement.
22800 (Event.EventBuilder): New member.
22802 * class.cs (TypeContainer::Populate): Update to define all enums and events
22804 (Events): New property for the events arraylist we hold. Shouldn't we move to using
22805 readonly fields for all these cases ?
22807 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22809 * class.cs (Property): Revamp to use the convention of making fields readonly.
22810 Accordingly modify code elsewhere.
22812 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22813 the Define method of the Property class.
22815 * class.cs : Clean up applied patch and update references to variables etc. Fix
22817 (TypeContainer::Populate): Update to define all the properties we have. Also
22818 define all enumerations.
22820 * enum.cs (Define): Implement.
22822 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22824 * cs-parser.jay (overloadable_operator): The semantic value is an
22825 enum of the Operator class.
22826 (operator_declarator): Implement actions.
22827 (operator_declaration): Implement.
22829 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22830 validity of definitions.
22831 (Operator::CheckBinaryOperator): Static method to check for binary operators
22832 (TypeContainer::AddOperator): New method to add an operator to a type.
22834 * cs-parser.jay (indexer_declaration): Added line to actually call the
22835 AddIndexer method so it gets added ;-)
22837 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
22838 already taken care of by the MS compiler ?
22840 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
22842 * class.cs (Operator): New class for operator declarations.
22843 (Operator::OpType): Enum for the various operators.
22845 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
22847 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22848 ostensibly handle this in semantic analysis.
22850 * cs-parser.jay (general_catch_clause): Comment out
22851 (specific_catch_clauses, specific_catch_clause): Ditto.
22852 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22853 (catch_args, opt_catch_args): New productions.
22854 (catch_clause): Rewrite to use the new productions above
22855 (catch_clauses): Modify accordingly.
22856 (opt_catch_clauses): New production to use in try_statement
22857 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22858 and re-write the code in the actions to extract the specific and
22859 general catch clauses by being a little smart ;-)
22861 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22862 Hooray, try and catch statements parse fine !
22864 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22866 * statement.cs (Block::GetVariableType): Fix logic to extract the type
22867 string from the hashtable of variables.
22869 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22870 I end up making that mistake ;-)
22871 (catch_clauses): Fixed gross error which made Key and Value of the
22872 DictionaryEntry the same : $1 !!
22874 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22876 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22878 * cs-parser.jay (event_declaration): Correct to remove the semicolon
22879 when the add and remove accessors are specified.
22881 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22883 * cs-parser.jay (IndexerDeclaration): New helper class to hold
22884 information about indexer_declarator.
22885 (indexer_declarator): Implement actions.
22886 (parsing_indexer): New local boolean used to keep track of whether
22887 we are parsing indexers or properties. This is necessary because
22888 implicit_parameters come into picture even for the get accessor in the
22889 case of an indexer.
22890 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22892 * class.cs (Indexer): New class for indexer declarations.
22893 (TypeContainer::AddIndexer): New method to add an indexer to a type.
22894 (TypeContainer::indexers): New member to hold list of indexers for the
22897 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22899 * cs-parser.jay (add_accessor_declaration): Implement action.
22900 (remove_accessor_declaration): Implement action.
22901 (event_accessors_declaration): Implement
22902 (variable_declarators): swap statements for first rule - trivial.
22904 * class.cs (Event): New class to hold information about event
22906 (TypeContainer::AddEvent): New method to add an event to a type
22907 (TypeContainer::events): New member to hold list of events.
22909 * cs-parser.jay (event_declaration): Implement actions.
22911 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22913 * cs-parser.jay (dim_separators): Implement. Make it a string
22914 concatenating all the commas together, just as they appear.
22915 (opt_dim_separators): Modify accordingly
22916 (rank_specifiers): Update accordingly. Basically do the same
22917 thing - instead, collect the brackets here.
22918 (opt_rank_sepcifiers): Modify accordingly.
22919 (array_type): Modify to actually return the complete type string
22920 instead of ignoring the rank_specifiers.
22921 (expression_list): Implement to collect the expressions
22922 (variable_initializer): Implement. We make it a list of expressions
22923 essentially so that we can handle the array_initializer case neatly too.
22924 (variable_initializer_list): Implement.
22925 (array_initializer): Make it a list of variable_initializers
22926 (opt_array_initializer): Modify accordingly.
22928 * expression.cs (New::NType): Add enumeration to help us
22929 keep track of whether we have an object/delegate creation
22930 or an array creation.
22931 (New:NewType, New::Rank, New::Indices, New::Initializers): New
22932 members to hold data about array creation.
22933 (New:New): Modify to update NewType
22934 (New:New): New Overloaded contructor for the array creation
22937 * cs-parser.jay (array_creation_expression): Implement to call
22938 the overloaded New constructor.
22940 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
22942 * class.cs (TypeContainer::Constructors): Return member
22943 constructors instead of returning null.
22945 2001-08-26 Miguel de Icaza <miguel@ximian.com>
22947 * typemanager.cs (InitCoreTypes): Initialize the various core
22948 types after we have populated the type manager with the user
22949 defined types (this distinction will be important later while
22950 compiling corlib.dll)
22952 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22953 on Expression Classification. Now all expressions have a method
22954 `Resolve' and a method `Emit'.
22956 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22957 generation from working. Also add some temporary debugging
22960 2001-08-24 Miguel de Icaza <miguel@ximian.com>
22962 * codegen.cs: Lots of code generation pieces. This is only the
22963 beginning, will continue tomorrow with more touches of polish. We
22964 handle the fundamentals of if, while, do, for, return. Others are
22965 trickier and I need to start working on invocations soon.
22967 * gen-treedump.cs: Bug fix, use s.Increment here instead of
22970 * codegen.cs (EmitContext): New struct, used during code
22971 emission to keep a context. Most of the code generation will be
22974 * cs-parser.jay: Add embedded blocks to the list of statements of
22975 this block. So code generation proceeds in a top down fashion.
22977 2001-08-23 Miguel de Icaza <miguel@ximian.com>
22979 * statement.cs: Add support for multiple child blocks.
22981 2001-08-22 Miguel de Icaza <miguel@ximian.com>
22983 * codegen.cs (EmitCode): New function, will emit the code for a
22984 Block of code given a TypeContainer and its ILGenerator.
22986 * statement.cs (Block): Standard public readonly optimization.
22987 (Block::Block constructors): Link children.
22988 (Block::Child): Child Linker.
22989 (Block::EmitVariables): Emits IL variable declarations.
22991 * class.cs: Drop support for MethodGroups here, delay until
22993 (Method::): Applied the same simplification that I did before, and
22994 move from Properties to public readonly fields.
22995 (Method::ParameterTypes): Returns the parameter types for the
22996 function, and implements a cache that will be useful later when I
22997 do error checking and the semantic analysis on the methods is
22999 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23000 and made a method, optional argument tells whether this is a class
23001 or a structure to apply the `has-this' bit.
23002 (Method::GetCallingConvention): Implement, returns the calling
23004 (Method::Define): Defines the type, a second pass is performed
23005 later to populate the methods.
23007 (Constructor::ParameterTypes): implement a cache similar to the
23008 one on Method::ParameterTypes, useful later when we do semantic
23011 (TypeContainer::EmitMethod): New method. Emits methods.
23013 * expression.cs: Removed MethodGroup class from here.
23015 * parameter.cs (Parameters::GetCallingConvention): new method.
23017 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23019 * class.cs (TypeContainer::Populate): Drop RootContext from the
23022 (Constructor::CallingConvention): Returns the calling convention.
23023 (Constructor::ParameterTypes): Returns the constructor parameter
23026 (TypeContainer::AddConstructor): Keep track of default constructor
23027 and the default static constructor.
23029 (Constructor::) Another class that starts using `public readonly'
23030 instead of properties.
23032 (Constructor::IsDefault): Whether this is a default constructor.
23034 (Field::) use readonly public fields instead of properties also.
23036 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23037 track of static constructors; If none is used, turn on
23038 BeforeFieldInit in the TypeAttributes.
23040 * cs-parser.jay (opt_argument_list): now the return can be null
23041 for the cases where there are no arguments.
23043 (constructor_declarator): If there is no implicit `base' or
23044 `this', then invoke the default parent constructor.
23046 * modifiers.cs (MethodAttr): New static function maps a set of
23047 modifiers flags into a MethodAttributes enum
23048 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23049 MethodAttr, TypeAttr to represent the various mappings where the
23050 modifiers are used.
23051 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23053 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23055 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23058 * interface.cs (PopulateIndexer): Implemented the code generator
23059 for interface indexers.
23061 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23063 * interface.cs (InterfaceMemberBase): Now we track the new status
23066 (PopulateProperty): Implement property population. Woohoo! Got
23067 Methods and Properties going today.
23069 Removed all the properties for interfaces, and replaced them with
23070 `public readonly' fields.
23072 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23074 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23075 initialize their hashtables/arraylists only when they are needed
23076 instead of doing this always.
23078 * parameter.cs: Handle refs and out parameters.
23080 * cs-parser.jay: Use an ArrayList to construct the arguments
23081 instead of the ParameterCollection, and then cast that to a
23084 * parameter.cs: Drop the use of ParameterCollection and use
23085 instead arrays of Parameters.
23087 (GetParameterInfo): Use the Type, not the Name when resolving
23090 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23092 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23093 and instead use public readonly fields.
23095 * class.cs: Put back walking code for type containers.
23097 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23099 * class.cs (MakeConstant): Code to define constants.
23101 * rootcontext.cs (LookupType): New function. Used to locate types
23104 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23106 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23107 this System.Reflection code is. Kudos to Microsoft
23109 * typemanager.cs: Implement a type cache and avoid loading all
23110 types at boot time. Wrap in LookupType the internals. This made
23111 the compiler so much faster. Wow. I rule!
23113 * driver.cs: Make sure we always load mscorlib first (for
23114 debugging purposes, nothing really important).
23116 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23117 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23119 * rootcontext.cs: Lookup types on their namespace; Lookup types
23120 on namespaces that have been imported using the `using' keyword.
23122 * class.cs (TypeContainer::TypeAttr): Virtualize.
23123 (Class::TypeAttr): Return attributes suitable for this bad boy.
23124 (Struct::TypeAttr): ditto.
23125 Handle nested classes.
23126 (TypeContainer::) Remove all the type visiting code, it is now
23127 replaced with the rootcontext.cs code
23129 * rootcontext.cs (GetClassBases): Added support for structs.
23131 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23133 * interface.cs, statement.cs, class.cs, parameter.cs,
23134 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23135 Drop use of TypeRefs, and use strings instead.
23137 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23141 * class.cs (Struct::Struct): set the SEALED flags after
23142 checking the modifiers.
23143 (TypeContainer::TypeAttr): new property, returns the
23144 TypeAttributes for a class.
23146 * cs-parser.jay (type_list): Oops, list production was creating a
23147 new list of base types.
23149 * rootcontext.cs (StdLib): New property.
23150 (GetInterfaceTypeByName): returns an interface by type name, and
23151 encapsulates error handling here.
23152 (GetInterfaces): simplified.
23153 (ResolveTree): Encapsulated all the tree resolution here.
23154 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23157 * driver.cs: Add support for --nostdlib, to avoid loading the
23158 default assemblies.
23159 (Main): Do not put tree resolution here.
23161 * rootcontext.cs: Beginning of the class resolution.
23163 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23165 * rootcontext.cs: Provide better error reporting.
23167 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23169 * rootcontext.cs (CreateInterface): Handle the case where there
23170 are no parent interfaces.
23172 (CloseTypes): Routine to flush types at the end.
23173 (CreateInterface): Track types.
23174 (GetInterfaces): Returns an array of Types from the list of
23175 defined interfaces.
23177 * typemanager.c (AddUserType): Mechanism to track user types (puts
23178 the type on the global type hash, and allows us to close it at the
23181 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23183 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23184 RecordInterface instead.
23186 * cs-parser.jay: Updated to reflect changes above.
23188 * decl.cs (Definition): Keep track of the TypeBuilder type that
23189 represents this type here. Not sure we will use it in the long
23190 run, but wont hurt for now.
23192 * driver.cs: Smaller changes to accomodate the new code.
23194 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23197 * rootcontext.cs (CreateInterface): New method, used to create
23198 the System.TypeBuilder type for interfaces.
23199 (ResolveInterfaces): new entry point to resolve the interface
23201 (CodeGen): Property, used to keep track of the code generator.
23203 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23205 * cs-parser.jay: Add a second production for delegate_declaration
23208 (enum_body): Put an opt_comma here instead of putting it on
23209 enum_body or enum_member_declarations so we can handle trailing
23210 commas on enumeration members. Gets rid of a shift/reduce.
23212 (type_list): Need a COMMA in the middle.
23214 (indexer_declaration): Tell tokenizer to recognize get/set
23216 * Remove old targets.
23218 * Re-add the parser target.
23220 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23222 * cs-parser.jay: Add precendence rules for a number of operators
23223 ot reduce the number of shift/reduce conflicts in the grammar.
23225 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23227 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23230 Get rid of old crufty code.
23232 * rootcontext.cs: Use this to keep track of the parsed
23233 representation and the defined types available to the program.
23235 * gen-treedump.cs: adjust for new convention.
23237 * type.cs: Split out the type manager, and the assembly builder
23240 * typemanager.cs: the type manager will live here now.
23242 * cil-codegen.cs: And the code generator here.
23244 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23246 * makefile: Fixed up for easy making.
23248 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23250 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23253 (unary_expression): Expand pre_increment_expression and
23254 post_decrement_expression to reduce a shift/reduce.
23256 2001-07-11 Simon Cozens
23258 * cs-tokenizer.cs: Hex numbers should begin with a 0.
23260 Improve allow_keyword_as_indent name.
23262 2001-06-19 Miguel de Icaza <miguel@ximian.com>
23264 * Adjustments for Beta2.
23266 2001-06-13 Miguel de Icaza <miguel@ximian.com>
23268 * decl.cs: Added `Define' abstract method.
23269 (InTransit): new property, used to catch recursive definitions.
23271 * interface.cs: Implement `Define'.
23273 * modifiers.cs: Map Modifiers.constants to
23274 System.Reflection.TypeAttribute flags.
23276 * class.cs: Keep track of types and user-defined types.
23277 (BuilderInit): New method for creating an assembly
23278 (ResolveType): New function to launch the resolution process, only
23279 used by interfaces for now.
23281 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23282 that are inserted into the name space.
23284 2001-06-08 Miguel de Icaza <miguel@ximian.com>
23286 * ARGH. I have screwed up my tree so many times due to the use of
23287 rsync rather than using CVS. Going to fix this at once.
23289 * driver.cs: Objetify driver. Load assemblies, use assemblies to
23292 2001-06-07 Miguel de Icaza <miguel@ximian.com>
23294 * Experiment successful: Use System.Type rather that our own
23297 2001-05-25 Miguel de Icaza <miguel@ximian.com>
23299 * cs-parser.jay: Removed nsAliases from here.
23301 Use new namespaces, handle `using XXX;'
23303 * namespace.cs: Reimplemented namespace handling, use a recursive
23304 definition of the class. Now we can keep track of using clauses
23305 and catch invalid using clauses.
23307 2001-05-24 Miguel de Icaza <miguel@ximian.com>
23309 * gen-treedump.cs: Adapted for all the renaming.
23311 * expression.cs (Expression): this class now has a Type property
23312 which returns an expression Type.
23314 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23315 `Type', as this has a different meaning now in the base
23317 2001-05-22 Miguel de Icaza <miguel@ximian.com>
23319 * interface.cs, class.cs: Removed from all the sources the
23320 references to signature computation, as we can not do method
23321 signature computation during the parsing time, as we are not
23322 trying to solve at that point distinguishing:
23326 void a (NS.Blah x) {}
23329 Which depending on the context might be valid or not, as we do not
23330 know if Blah is the same thing as NS.Blah at that point.
23332 * Redid everything so the code uses TypeRefs now instead of
23333 Types. TypeRefs are just temporary type placeholders, that need
23334 to be resolved. They initially have a pointer to a string and the
23335 current scope in which they are used. This is used later by the
23336 compiler to resolve the reference to an actual Type.
23338 * DeclSpace is no longer a CIR.Type, and neither are
23339 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23340 are all DeclSpaces, but no Types.
23342 * type.cs (TypeRefManager): This implements the TypeRef manager,
23343 which keeps track of all the types that need to be resolved after
23344 the parsing has finished.
23346 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23348 * ARGH. We are going to have to store `foreach' as a class rather
23349 than resolving it, as we need to verify error 1579 after name
23350 resolution. *OR* we could keep a flag that says `This request to
23351 IEnumerator comes from a foreach statement' which we can then use
23352 to generate the error.
23354 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23356 * class.cs (TypeContainer.AddMethod): we now add methods to the
23357 MethodGroup instead of the method hashtable.
23359 * expression.cs: Add MethodGroup abstraction, which gets us one
23360 step closer to the specification in the way we handle method
23363 * cs-parser.jay (primary_expression): qualified_identifier now
23364 tried to match up an identifier to a local variable reference or
23365 to a parameter reference.
23367 current_local_parameters is now a parser global variable that
23368 points to the current parameters for the block, used during name
23371 (property_declaration): Now creates an implicit `value' argument to
23374 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23376 * parameter.cs: Do not use `param' arguments as part of the
23377 signature, per the spec.
23379 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23381 * decl.cs: Base class for classes, structs and interfaces. This
23382 is the "Declaration Space"
23384 * cs-parser.jay: Use CheckDef for checking declaration errors
23385 instead of having one on each function.
23387 * class.cs: Factor out some code for handling error handling in
23388 accordance to the "Declarations" section in the "Basic Concepts"
23389 chapter in the ECMA C# spec.
23391 * interface.cs: Make all interface member classes derive from
23392 InterfaceMemberBase.
23394 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23396 * Many things: all interfaces are parsed and generated in
23397 gen-treedump. Support for member variables, constructors,
23398 destructors, properties, constants is there.
23400 Beginning of the IL backend, but very little done, just there for
23403 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23405 * cs-parser.jay: Fix labeled statement.
23407 * cs-tokenizer.cs (escape): Escape " and ' always.
23408 ref_line, ref_name: keep track of the line/filename as instructed
23409 by #line by the compiler.
23412 2001-04-27 Miguel de Icaza <miguel@ximian.com>
23414 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23415 to match the values in System.CodeDOM.
23417 Divid renamed to Divide.
23419 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23421 (Statements.set): remove.
23423 * System.CodeDOM/CodeCatchClause.cs: always have a valid
23426 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23427 falseStatements always have valid values.
23429 * cs-parser.jay: Use System.CodeDOM now.