1 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3 * cs-tokenizer.cs: Warning text fix.
5 * driver.cs: AllWarningNumbers exposed on public interface.
7 * report.cs (): Reviewed warning numbers.
8 (IsValidWarning): Use binary search.
10 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12 * driver.cs: Implemeted resource visibility.
13 (Resources): New class for code sharing between /res: and
16 2005-10-28 Marek Safar <marek.safar@seznam.cz>
19 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
22 * convert (Convert.ImplicitReferenceConversion): NullCast holds
25 * ecore.cs (NullCast): Child is contant only.
27 * literal.cs (NullLiteral.Reduce): null can be converted to any
30 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
32 * driver.cs: Use Encoding.Default as default code page instead
35 2005-10-27 Raja R Harinath <rharinath@novell.com>
38 * expression.cs (Invocation.Error_InvalidArguments): Handle
40 (Invocation.VerifyArgumentsCompat): Likewise.
41 * support.cs (ReflectionParameters.GetSignatureForError): Print
43 (InternalParamters.GetSignatureForError): Likewise.
44 * parameter.cs (Parameters.GetSignatureForError): Likewise.
46 2005-10-26 Marek Safar <marek.safar@seznam.cz>
48 * attribute.cs (GetPropertyValue): Made public.
50 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
52 Add new property WrapNonExceptionThrows to handle 2.0 assembly
54 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
57 * driver.cs: Reflect method name change.
59 * statement.cs (Try.Resolve): Warn when try has both general
62 * typemanager.cs: runtime_compatibility_attr_type new predefined
65 2005-10-26 Raja R Harinath <harinath@gmail.com>
68 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
69 treat it as an empty parameter list.
71 2005-10-26 Raja R Harinath <rharinath@novell.com>
74 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
75 ResolveAsTypeStep silent.
76 * statement.cs (Block.AddConstant): Mark block as used.
77 (Block.ResolveMeta): Avoid piling on error messages
78 if a constant initializer resolution fails.
80 2005-10-25 Raja R Harinath <rharinath@novell.com>
82 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
84 (NamespaceEntry.VerifyAllUsing): New.
85 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
86 behaviour. Delegates actual resolution of alias to ...
87 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
88 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
90 * driver.cs (Driver.MainDriver): Update.
92 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
93 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
95 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
97 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
98 RootNamespace.DefineNamespacesForAll.
100 2005-10-24 Raja R Harinath <harinath@gmail.com>
102 * typemanager.cs (assemblies, external_aliases, modules)
103 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
104 (ComputeNamespaces, GetRootNamespace): Remove extra staging
105 overhead. Move resposibility ...
106 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
107 * driver.cs, attribute.cs, codegen.cs: Update to changes.
109 2005-10-23 Raja R Harinath <harinath@gmail.com>
111 * namespace.cs (RootNamespace.all_namespaces): Renamed from
112 cached_namespaces. Improve usage.
113 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
114 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
115 Move from GlobalRootNamespace and simplify.
116 (RootNamespace.Global): Make instance variable.
117 (RootNamespace.RootNamespace): Add "alias name" parameter.
118 (GlobalRootNamespace): Simplify drastically.
119 (Namespace.Lookup): Don't use GetNamespace.
120 * typemanager.cs (GetRootNamespace): Rename from
121 ComputeNamespaceForAlias.
122 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
124 2005-10-23 Marek Safar <marek.safar@seznam.cz>
126 * anonymous.cs (AnonymousContainer): Don't crash when container
129 2005-10-23 Marek Safar <marek.safar@seznam.cz>
131 * expression.cs (Binary.DoResolve): Warn when comparing same
134 2005-10-23 Marek Safar <marek.safar@seznam.cz>
137 * expression.cs (Binary.DoResolve): It looks like there are no
138 convetsion rules in enum context.
140 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
142 Add support for extern alias qualifiers.
143 * typemanager.cs: Move some LookupTypeReflection code
144 to namespace.cs, to have cleaner code. Added some methods
145 to help us keep track of the extern aliased references.
146 * driver.cs: Add suport for extern alias assemblies on command
147 line and check for their warnings/errors. Also keep track of the
148 extern aliased assemblies.
149 * namespace.cs: Move the global functionality of Namespace
150 to GlobalRootNamespace/RootNamespace. Now the global namespace
151 is GlobalRootNamespace.Globa. Also the code moved from
152 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
153 Finally added LocalAliasEntry (AliasEntry before) and
154 ExternAliasEntry, to handle alias statements.
155 * cs-parser.jay: Add support in the grammar for extern alias
157 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
158 Update callings to Namespace (now in GlobalRootNamespace).
160 2005-10-18 Raja R Harinath <rharinath@novell.com>
163 * class.cs (TypeContainer.DefineType): Move updating of
164 topological sort earlier in the code.
165 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
167 2005-10-18 Marek Safar <marek.safar@seznam.cz>
170 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
172 * constant.cs (Constant.TryReduce): Moved from Cast class.
173 (Reduce): Made little bit more OO and fixed missing conversions.
175 * ecore.cs (Reduce): Implemented.
176 (Binary.EnumLiftUp): New method to upgrade values to enum values.
178 * literal.cs (Reduce): Implemented.
180 * class.cs: Reverted Miguel's wrong commit.
182 2005-10-14 Miguel de Icaza <miguel@novell.com>
184 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
186 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
188 * cs-parser.jay, expression.cs : CS0214 was missing error location
189 for constants. Fixed bug #76404.
191 2005-10-11 Marek Safar <marek.safar@seznam.cz>
194 * convert.cs (ExplicitConversionCore): Fixed object->enum
197 2005-10-10 Raja R Harinath <rharinath@novell.com>
199 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
201 (PropertyExpr.EmitCall): Likewise.
202 * expression.cs (Invocation.EmitArguments): Handle case where
204 (Invocation.EmitCall): Avoid allocating temporary variable if
205 there are no arguments.
207 2005-10-07 Raja R Harinath <rharinath@novell.com>
210 * convert.cs (ImplicitConversionStandard): Move conversion of
211 void* to arbitrary pointer types ...
212 (ExplicitConversionStandard): .. here.
213 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
214 error to always print typenames.
216 2005-10-07 Raja R Harinath <rharinath@novell.com>
218 * convert.cs (GetConversionOperator): Rename from
219 GetConversionOperators. Move operator selection code from ...
220 (UserDefinedConversion): ... here.
222 2005-10-06 Marek Safar <marek.safar@seznam.cz>
224 * convert.cs (ExplicitConversionCore): Removed duplicate enum
227 2005-10-05 Marek Safar <marek.safar@seznam.cz>
229 * assign.cs (Assign.DoResolve): Error method changed.
231 * cfold.cs (DoConstantNumericPromotions): Error method changed.
233 * const.cs (ResolveValue): Reset in_transit immediately.
235 * constant.cs: Error method changed.
237 * convert.cs: Removed useless location parameter.
238 (ExplicitNumericConversion): Don't do double enum check.
239 (ExplicitConversionCore): Renamed from ExplicitConversion.
240 (ExplicitUnsafe): Extracted from ExplicitConversion.
241 (ExplicitConversion): Uses for error reporting.
243 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
245 (ResolveBoolean): Uses common error method.
246 (CastToDecimal): Get rid of ec.
247 (CastFromDecimal): Optimized.
248 (ConvCast): Get rid of ec.
250 * enum.cs (ResolveValue): Reset in_transit immediately.
251 (Emit): Return after first error.
253 * expression.cs: Convert changes.
255 * literal.cs: Error method changed.
257 * statement.cs: Error method changed.
259 2005-10-03 Raja R Harinath <rharinath@novell.com>
261 * support.cs (SeekableStreamReader.Position): Don't error out when
262 the requested position is just beyond the end of the current
265 2005-09-28 Raja R Harinath <rharinath@novell.com>
267 * support.cs (SeekableStreamReader): Simplify drastically. Don't
268 try to keep in sync with the byte count of the underlying Stream.
269 However, this limits us to a window size of 2048 characters: i.e.,
270 the maximum lookahead of our lexer/parser can be 2048 characters.
272 2005-09-28 Marek Safar <marek.safar@seznam.cz>
275 * driver.cs: Fix compilation files with full root path.
277 2005-09-25 Miguel de Icaza <miguel@novell.com>
279 * report.cs (SymbolRelatedToPreviousError): Format the output so
280 it does not use an open parenthesis that is never closed.
282 * driver.cs: Follow coding guidelines
284 2005-09-27 Marek Safar <marek.safar@seznam.cz>
287 * const.cs (Const.ResolveValue): Check for assigning non-null
288 value to reference type.
290 2005-09-27 Marek Safar <marek.safar@seznam.cz>
292 * anonymous.cs: Implemented ExprClassName.
294 * assign.cs (Assign.DoResolve): Don't chrash when type is not
297 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
300 * class.cs (StaticClass.DefineContainerMembers): Report protected
303 * codegen.cs: if(ed) PRODUCTION.
305 * convert.cs (Error_CannotImplicitConversion): Better error
308 * cs-parser.jay: More error checks.
310 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
312 * driver.cs (CSCParseOption): Enabled wrong option check.
314 * ecore.cs (Expression.ExprClassName): Turned to property.
315 (MemberExpr.CheckIntermediateModification): For checking boxed
316 value types modification.
318 * statement.cs (Fixed.Resolve): Expression type must be
319 convertible to fixed type.
320 (CollectionForeach.GetEnumeratorFilter,TryType):
321 Small refactoring for easier error checking.
323 2005-09-26 Marek Safar <marek.safar@seznam.cz>
325 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
328 * class.cs (GeneratedBaseInitializer): New class for customization
329 compiler generated initializers.
330 (MemberBase.DoDefine): Check Obsolete attribute here.
331 (FieldMember.DoDefine): Ditto.
333 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
336 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
337 (MemberCore.GetObsoleteAttribute): Removed argument.
338 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
339 (MemberCore.CheckObsoleteType): New helper.
343 * statement.cs: Updates after MemberCore changes.
345 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
346 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
348 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
349 obsolete attribute for compiler construct.
350 (As.DoResolve): Cache result.
352 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
354 2005-09-26 Raja R Harinath <rharinath@novell.com>
357 * expression.cs (This.VerifyFixed): In a value type T, the type of
358 'this' is T&, iow, 'this' is either an out or ref parameter. In a
359 value type R, 'this' is treated as a value parameter.
361 2005-09-22 Miguel de Icaza <miguel@novell.com>
363 * statement.cs (Lock): Use the TemporaryVariable class instead of
364 manually using local variables as those do not work when variables
367 * ecore.cs: Moved the TemporaryVariable class from being a nested
368 class inside Foreach to be a public class that can be employed in
371 2005-09-19 Marek Safar <marek.safar@seznam.cz>
373 * cs-parser.jay: interface_accessors replaced by
374 accessor_declarations.
376 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
379 * statement.cs (GotoCase.Resolve): Convert null constant to
381 (SwitchLabel.ResolveAndReduce): Ditto.
382 (SwitchLabel.NullStringCase): Custom null stamp.
383 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
385 typemanager.cs (CSharpSignature): Don't skip first argument
388 2005-09-18 Miguel de Icaza <miguel@novell.com>
390 * driver.cs: Set InEmacs based on the environment variable EMACS.
392 * location.cs (InEmacs): in this mode, do not report column
393 location as it confuses Emacs.
395 2005-09-16 Marek Safar <marek.safar@seznam.cz>
397 * cfold.cs, constant.cs, convert.cs, ecore.cs,
398 expression.cs, iterators.cs, literal.cs: Store constants and
401 * class.cs (MemberBase.ShortName): Pass location.
403 * cs-parser.jay: Some location fixes.
405 * ecore.cs (Expression.Location): Made virtual.
407 2005-09-05 Miguel de Icaza <miguel@novell.com>
409 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
410 if the underlying types are the same, otherwise we need to produce
411 code that will do the proper cast.
413 This was exposed by Marek's constant rewrite which produced
414 invalid code for the call site:
421 This fixes test-49.cs
423 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
425 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
426 Type/Object should be allowed as well. Fixed bug #75968.
428 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
430 * expression.cs : (Binary.DoResolve): when one is enum constant and
431 another is constant 0, then return enum one *as enum type*.
434 2005-09-02 Raja R Harinath <rharinath@novell.com>
436 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
440 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
441 flow-branching for LocalVariableReferences in case we were invoked
443 * expression.cs (LocalVariableReference.VerifyAssigned): New.
445 (LocalVariableReference.DoResolveBase): ... this.
446 (MemberAccess.Resolve): Do the check that was disabled during
449 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
452 (PartialContainer.Create): check abstract/sealed/static strictly
453 but abstract/sealed can exist only at one side. Fixed bug #75883.
455 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
458 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
459 specified, don't default to UnmanagedType.I4.
461 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
463 * expression.cs : conditional operator should check possibly
464 incorrect assign expression. Fixed bug #75946.
466 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
468 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
469 Reverting the change. gmcs is much complex than mcs on this matter.
471 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
473 * cs-tokenizer.cs : To read another token ahead of the actual
474 consumption, use new SavedToken and cache token instead of moving
475 back the stream with SeekableStreamReader (it seemed problematic).
477 driver.cs : Thus use StreamReader directly.
478 * support.cs : Thus removed SeekableStreamReader.
480 2005-08-30 Raja R Harinath <rharinath@novell.com>
483 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
484 (ScopeInfo.EmitScopeType): Use it to construct field names from
485 names of captured locals.
488 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
489 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
490 Pass 'target_type' to BoxedCast. Don't default to 'object'.
491 (ExplicitConversion): Remove enum cases already handled by
492 implicit conversion. Move implicit conversion check to the beginning.
493 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
494 * expression.cs (ArrayCreation.EmitDynamicInitializers):
495 Don't treat System.Enum as a struct.
497 2005-08-30 Jb Evain <jbevain@gmail.com>
499 * attribute.cs: handles as expression in parameters.
501 2005-08-30 Raja R Harinath <rharinath@novell.com>
504 * class.cs (TypeContainer.VerifyClsName): Don't use a
505 PartialContainer when verifying CLS compliance.
506 (AbstractPropertyEventMethod): Set Parent here, ...
507 (PropertyMethod): ... not here.
509 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
511 * attribute.cs : escaped attribute name should not be allowed to be
512 resolved (e.g. @class as classAttribute). Fixed bug #75930.
514 2005-08-29 Raja R Harinath <rharinath@novell.com>
517 * convert.cs (ImplicitStandardConversionExists): Allow zero also
518 when converting a long constant to unsigned long.
519 * expression.cs (Invocation.OverloadResolve): Add sanity check to
520 detect where IsApplicable and VerifyArgumentsCompat disagree.
522 2005-08-29 Raja R Harinath <rharinath@novell.com>
523 and Carlos Alberto Cortez <carlos@unixmexico.org>
526 * class.cs (TypeContainer.CanElideInitializer): New helper.
527 (TypeContainer.EmitFieldInitializers): Use it to determine if we
528 can safely emitting the initializer of a field.
530 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
532 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
533 allowed inside a switch (without loop). Fixed bug #75433.
535 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
537 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
538 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
540 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
542 * driver.cs : kinda reverting the default encoding changes (not exact
543 revert since I noticed that "codepage:reset" might not work fine).
545 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
547 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
548 Location. Now getter and setter store location correctly.
549 (errors/cs0111-12.cs now reports the expected location.)
551 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
553 * driver.cs : Use default encoding on the environment.
554 Removed (now that) extra parameter for SeekableStreamReader.
555 * support.cs : (SeekableStreamReader) third .ctor() argument for
556 StreamReader is not required (always true). preamble size could
557 be acquired in simpler and safe way.
559 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
561 * cs-parser.jay: report CS0642 at warning level 3
562 and report CS0642 for an if else statement also
563 fixes bug #74745. Patch by John Luke (and a bit
565 Removed extra CS0642 warning check for "while",
567 * statement.cs: In Block.Resolve(), CS0642 check
568 is reimplemented to check a sequence of an empty
569 statement and a block.
573 2005-08-24 Marek Safar <marek.safar@seznam.cz>
575 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
576 detection until I fix it.
578 * cs-tokenizer.cs: Changed error message.
580 * cs-parser.jay: Fixed 2 error locations.
582 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
583 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
586 * enum.cs (GetSignatureForError): Fixed.
588 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
592 * typemanager.cs (RegisterProperty): Removed.
594 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
596 2005-08-24 Raja R Harinath <rharinath@novell.com>
599 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
600 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
602 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
604 * expression.cs : tiny fix is required for not warning positive ulong.
607 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
609 * expression.cs : add CS0652 check for constant and integral
610 expression. Fixed bug #53974.
612 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
614 * expression.cs : in DoNumericPromotions(), check if there is implicit
615 conversion overload for string (to check CS0034). Fixed bug #52492.
617 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
619 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
621 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
623 * ecore.cs : report location when it is *not* Null.
625 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
631 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
632 correctly. Fixed bug #75721.
634 2005-08-23 Raja R Harinath <rharinath@novell.com>
636 * support.cs (SeekableStreamReader.Position): Avoid an expensive
637 loop that performs 'min (pos, char_count)'.
640 * expression.cs (Unary.ResolveOperator): Don't discard implicit
641 converted value in Operator.OnesComplement.
643 2005-08-22 Ben Maurer <bmaurer@ximian.com>
645 * anonymous.cs: If the anon method is pulled into a helper class,
646 it needs to be `internal' not `private'. Fixes runtime behavior on
649 2005-08-20 Martin Baulig <martin@ximian.com>
651 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
652 scope if we don't already have it.
654 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
655 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
658 2005-08-17 Marek Safar <marek.safar@seznam.cz>
661 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
664 2005-08-16 Marek Safar <marek.safar@seznam.cz>
666 The big constants rewrite
667 Fix #75746, #75685 and more
668 As a side effect saved 1MB for MWF ;-)
670 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
671 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
672 enum based for corlib compilation.
674 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
677 * class.cs (FixedField.Define): Use ResolveAsConstant.
679 * const.cs (IConstant): Interface constants and enums.
680 (Const.ResolveValue): New method for constant resolvning.
681 (ExternalConstant): Constants from imported assemblies.
683 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
684 conversion; like enums.
685 (Constant.ToType): Converts this constant to different type.
686 (Constant.Increment): Adds 1.
688 * convert.cs (ImplicitConversionRequired): Simplified.
690 * cs-parser.jay: Create EnumMember directly.
692 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
694 * doc.cs (GenerateEnumDocComment): Removed.
696 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
697 (ConvertIntLiteral): Removed.
698 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
700 * enum.cs (EnumMember): Implement IConstant.
701 (Enum.IsValidEnumConstant): Removed.
702 (Enum.GetNextDefaultValue): Removed.
703 (Enum.FindMembers): Updated.
704 (Enum.GenerateDocComment): Iterate enum members.
706 * expression.cs (Cast.TryReduce): Handle enums correctly.
707 (New.Constantify): Made public.
708 (MemberAccess.DoResolve): Removed contant specific if(s).
710 * literal.cs (NullLiteral): Implement new abstract methods.
712 * statement.cs (GotoCase.Resolve): Use new constant methods.
713 (SwitchLabel.ResolveAndReduce): Use new constant methods.
715 * typemanager.cs (LookupEnum): Removed.
716 (IsEnumType): Fixed to work with corlib.
717 (RegisterConstant): Removed.
718 (LookupConstant): Removed.
719 (GetConstant): Changed to work with IConstant.
721 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
723 * location.cs : Fixed overflown (>255) column number.
725 2005-08-03 Raja R Harinath <rharinath@novell.com>
727 First cut of the qualified-alias-member feature.
728 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
730 * cs-parser.jay (DOUBLE_COLON): New token.
731 (namespace_or_type_name): Add rule for recognizing
732 qualified-alias-members.
733 (primary_expression): Likewise.
734 (element_access): Allow QualifiedAliasMember as a possible
735 type-bearing expression.
736 (local_variable_type, local_variable_pointer_type): Likewise.
737 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
738 aliases in the current and enclosing namespace declarations.
739 (NamespaceEntry.UsingAlias): Add CS0440 warning.
740 * decl.cs (MemberName.is_double_colon): New.
741 (MemberName.MemberName): Add new constructor for alias-member.
742 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
743 * expression.cs (QualifiedAliasMember): New expression type.
745 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
747 * location.cs : it borked when no argument was specified.
749 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
751 * location.cs : tiny ToString() format fix.
753 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
755 * statement.cs : oops, it was missing.
757 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
759 A set of fixes for precise line/column location.
762 "token" field now holds a file/line "delta", a line number offset
763 from the segment, and a column number. See also:
764 http://lists.ximian.com/pipermail/mono-devel-list/2004-
766 Removed static IsNull. Use instance IsNull property instead.
768 For some tokens it stores Location. For Identifier it stores
769 LocatedToken which is a pair of string name and location.
770 Column numbers are adjusted only at getChar().
772 Use Location.ToString() for reporting (it now contains column).
774 Largely modified to use LocatedToken instead of
775 string (IDENTIFIER), and to acquire Location from some tokens.
776 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
777 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
779 Now MemberName holds Location. DeclSpace.ctor() receives Location
780 as a parameter. Removed extra parameters to all derived classes.
781 Replaced Location.IsNull() with instance property.
782 * assign.cs, expression.cs :
783 Added .ctor() overload that omits Location.
785 Added "nameEscaped" flag that indicates the identifier was escaped
786 in the source file. This fixes bug #57047.
788 2005-08-02 Marek Safar <marek.safar@seznam.cz>
790 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
791 New method, looking for lo-case imported cls type.
793 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
796 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
798 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
800 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
802 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
804 Optimized to save 3.5 MB for SWF compilation.
806 2005-08-01 Marek Safar <marek.safar@seznam.cz>
808 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
809 (PartialContainer.Create): Moved logic AddToContainer.
810 (PartialContainer.MarkForDuplicationCheck): Shares name.
812 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
815 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
817 (Namespace.GetSignatureForError): New method.
819 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
820 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
822 2005-08-01 Raja R Harinath <rharinath@novell.com>
825 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
826 member lookup rather than qualifier_type, since qualifier_type can
829 2005-08-01 Marek Safar <marek.safar@seznam.cz>
831 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
834 2005-07-31 Miguel de Icaza <miguel@novell.com>
836 * statement.cs: Copy the local exception into the exception
837 captured local. Fixes 75674
839 2005-07-31 Raja R Harinath <harinath@gmail.com>
842 * expression.cs (Invocation.OverloadResolve): Don't report error
843 CS1501 if error CS1502 has been reported.
844 (New.DoResolve): Delegate CS1501 reporting to
845 Invocation.OverloadResolve.
848 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
849 invariant-meaning-in-block property in an enclosing block if
852 2005-07-29 Marek Safar <marek.safar@seznam.cz>
854 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
855 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
856 (Switch.CheckSwitch): Just save 50kb for SWF.
858 2005-07-27 Martin Baulig <martin@ximian.com>
860 * anonymous.cs (CaptureContext.AddField): Added
861 `AnonymousContainer am' argument; compute its toplevel scope if
862 it's not already computed. Fixes #75649.
864 2005-07-26 Raja R Harinath <rharinath@novell.com>
867 * class.cs (Constructor.Emit): Reset block to null if the block
870 2005-07-25 Marek Safar <marek.safar@seznam.cz>
872 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
874 2005-07-25 Marek Safar <marek.safar@seznam.cz>
876 * class.cs (MethodData.Define): Check whether accessor implementing
879 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
881 2005-07-22 Marek Safar <marek.safar@seznam.cz>
884 * namespace.cs (LookupType): Moved same type check to...
886 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
889 2005-07-21 Raja R Harinath <rharinath@novell.com>
891 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
892 already found a typebuilder.
893 * class.cs (MethodCore.IsDuplicateImplementation): Compare
894 MemberNames, not strings.
896 * const.cs (Error_ExpressionMustBeConst):
897 Rename from Error_EpressionMustBeConst.
898 * const.cs, class.cs, statement.cd: Update.
900 2005-07-21 Marek Safar <marek.safar@seznam.cz>
904 * const.cs (Const.LookupConstantValue): Report missing contant expression
906 (Error_EpressionMustBeConstant): Only one error method.
908 * class.cs, statement.c: Updated.
910 2005-07-20 Raja R Harinath <rharinath@novell.com>
912 * statement.cs (Block.Flags): Add back HasVarargs.
913 (Block.flags): Make protected.
914 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
916 * typemanager.cs (types, typecontainers, user_types): Remove.
917 (UserTypes, TypeContainers): Likewise.
918 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
919 (CleanUp, Reset): Update.
920 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
921 (GetNestedType): Use Type.GetNestedType.
922 (CoreLookupType): Take two arguments, the namespace and the
923 basename of the type. Update to use the Namespace.Lookup
925 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
926 (RealMemberLookup): Use IsNestedChildOf instead of playing with
927 string concatenation and substring matches.
928 * class.cs, enum.cs, delegate.cs: Update to changes.
930 2005-07-20 Marek Safar <marek.safar@seznam.cz>
932 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
933 Expression and made virtual.
935 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
936 (ImplicitStandardConversionExists): Fixed `byte' typo ?
938 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
940 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
943 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
946 2005-07-18 Marek Safar <marek.safar@seznam.cz>
949 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
950 AssemblyCultureAttribute is not used on executable.
953 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
955 2005-07-16 Raja R Harinath <rharinath@novell.com>
958 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
959 New. Reports CS0252/CS0253.
960 Mostly taken from preliminary patch by Duncak Mak.
961 (Binary.DoResolveOperator): Store results of operator lookup.
962 Use them to detect if we need to warn about unintended reference
965 2005-07-15 Raja R Harinath <rharinath@novell.com>
968 * namespace.cs (Namespace.Lookup): Add back location parameter.
969 (Namespace.LookupType): Add CS0436 report. Add location parameter.
970 * delegate.cs, ecore.cs, expression.cs: Update to changes.
972 * codegen.cs (EmitContext.DeclSpace): Make readonly.
973 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
974 (Namespace.LookupType): ... this.
975 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
977 * typemanager.cs (LookupTypeReflection): Remove buggy code that
978 purported to handle pointers.
979 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
982 2005-07-15 Marek Safar <marek.safar@seznam.cz>
984 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
987 2005-07-15 Raja R Harinath <rharinath@novell.com>
989 * namespace.cs (Namespace.Lookup): Drop location parameter.
990 (NamespaceEntry.LookupAlias): Remove. Merge into ...
991 (NamespaceEntry.Lookup): ... this.
992 (NamespaceEntry.Error_AmbiguousTypeReference):
993 Move here from DeclSpace.
994 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
996 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
997 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
998 Move to NamespaceEntry.
999 * delegate.cs, expression.cs: Update to changes.
1001 2005-07-14 Marek Safar <marek.safar@seznam.cz>
1003 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1004 CheckAttributeType and refactored.
1005 (Attribute.ResolvePossibleAttributeType): Changed to reuse
1006 ResolveAsTypeTerminal error handling.
1007 (ResolveAsTypeTerminal): Introduced because of global attributes extra
1009 (GetSignatureForError): Print errors in same way.
1012 * codegen.cs: Reflect attribute GetSignatureForError change.
1015 * expression.cs: Add silent parameter to ResolveAsTypeStep.
1017 * namespace.cs (UsingEntry): Refactored to make fields private.
1020 statement.cs: Error_UnexpectedKind has extra parameter.
1022 2005-07-14 Raja R Harinath <rharinath@novell.com>
1024 * ecore.cs (IAlias): Remove.
1025 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
1026 that implement the interface.
1027 * namespace.cs (Namespace): Likewise.
1028 (Namespace.declspaces): Renamed from 'defined_names'.
1029 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
1030 DeclSpace instead of an IAlias.
1031 * tree.cs (Tree.AddDecl): Update.
1033 2005-07-12 Raja R Harinath <rharinath@novell.com>
1035 * statement.cs (Block.Flags); Remove HasVarargs.
1036 (Block.HasVarargs): Move to ToplevelBlock.
1037 (Block.ThisVariable, Block.AddThisVariable): Likewise.
1038 (Block.Variables): Make protected. Initialize variable hashtable
1040 (Block.AddVariable): Update.
1041 (Block.Resolve): Update to changes.
1042 (ToplevelBlock.HasVarargs): New boolean.
1043 (ToplevelBlock.ThisVariable): Move here from Block.
1044 (ToplevelBlock.AddThisVariable): Likewise.
1045 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
1046 * expression.cs (This.ResolveBase): Update to changes.
1047 (ArglistAccess.DoResolve): Likewise.
1049 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1052 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1054 * class.cs (TypeContainer.VerifyMembers): Distinguish between
1055 not used and not used & assigned.
1056 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1058 2005-07-11 Marek Safar <marek.safar@seznam.cz>
1061 * expression.cs (Is.DoResolve): null is never provided type.
1063 2005-07-08 Marek Safar <marek.safar@seznam.cz>
1066 * cs-parser.jay: Less strict event error rule to catch more errors.
1068 2005-07-08 Martin Baulig <martin@ximian.com>
1070 Fix test-iter-10.cs - distinguish whether we `yield' in a property
1071 gettter (allowed) or setter (not allowed).
1073 * class.cs (Accessor): Implement IIteratorContainer.
1074 (Accessor.Yields): New public field.
1075 (PropertyBase.PropertyMethod.Define): Handle iterators on a
1079 (get_accessor_declaration, set_accessor_declaration): Set the
1080 `yields' flag on the accessor, not the property.
1081 (property_declaration): Do the iterators check on a per-accessor
1082 basis and not for the whole property.
1084 2005-07-08 Martin Baulig <martin@ximian.com>
1086 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1087 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1089 2005-07-07 Marek Safar <marek.safar@seznam.cz>
1092 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1093 (ExtractSecurityPermissionSet): Cope with self referencing security
1094 attributes properly.
1096 * driver.cs (SetOutputFile): Made public property OutputFile.
1098 2005-07-07 Raja R Harinath <rharinath@novell.com>
1101 * class.cs (TypeContainer.first_nonstatic_field): Rename from
1102 has_nonstatic_fields. Make into a FieldBase pointer.
1103 (TypeContainer.AddField): Add CS0282 check.
1104 (TypeContainer.EmitType): Update.
1106 2005-07-06 Miguel de Icaza <miguel@novell.com>
1108 * cs-tokenizer.cs (consume_identifier): Do not create strings to
1109 compare if they start with __.
1111 2005-07-06 Raja R Harinath <rharinath@novell.com>
1113 * statement.cs (Switch.SwitchGoverningType): Only look at
1114 UserCasts that don't need implicit standard conversions to one of
1115 the allowed switch types (Fixes test-322.cs).
1116 (LocalInfo.Resolve): Re-enable sanity-test.
1118 2005-07-06 Marek Safar <marek.safar@seznam.cz>
1120 * cs-tokenizer.cs (consume_identifier): Detect double undescores
1122 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1124 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1126 2005-07-06 Raja R Harinath <rharinath@novell.com>
1129 * ecore.cs (SimpleName.GetSignatureForError): Add.
1130 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1131 (MemberAccess.GetSignatureForError): Add.
1133 2005-07-05 Marek Safar <marek.safar@seznam.cz>
1135 The big error and warning messages review.
1165 * typemanager.cs: Updated.
1167 * class.cs: (MethodCore.SetYields): Moved here to share.
1168 (PropertyMethod.Define): Moved iterator setup here.
1170 * iterators.cs: Add orig_method to have full access to parent
1173 2005-07-05 Raja R Harinath <rharinath@novell.com>
1175 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1176 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1177 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1178 variable of struct type.
1179 * expression.cs (Unary.ResolveOperator): Update to change.
1180 (Indirection.VerifyFixed): Likewise.
1181 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1182 (ParameterReference.VerifyFixed): Value parameters are fixed.
1183 (This.VerifyFixed): Treat 'this' as a value parameter.
1184 * statement.cs (LocalInfo.IsFixed): Remove.
1186 2005-07-01 Martin Baulig <martin@ximian.com>
1188 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1189 `ec.EmitThis ()' to get the correct scope.
1191 2005-07-01 Martin Baulig <martin@ximian.com>
1193 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1194 instance is a ParameterReference; fixes #75299.
1196 2005-07-01 Martin Baulig <martin@ximian.com>
1198 Reverted Marek's latest patch (r46725):
1199 - it contains structural changes which are neither mentioned in
1200 the ChangeLog nor explained anywhere; for example the additional
1201 argument of EmitContext's and Iterator's .ctor's and the
1202 TypeContainer.DefineMembers() change.
1203 - structural changes like this should go in in seperate patches
1204 and not be hidden in a huge patch which just seems to affect
1205 warnings and errors.
1206 a big and hard to understand patch.
1207 - it breaks iterators and causes regressions, for instance in
1210 2005-06-30 Raja R Harinath <rharinath@novell.com>
1213 * expression.cs (Indexers.map): Remove.
1214 (Indexers.Append): Filter out inaccessible setters and getters.
1215 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1218 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
1220 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1221 (FieldExpr.Emit, PropertyExpr.Emit): Update.
1222 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1223 * expression.cs (Invocation.EmitCall): Add CS0120 check.
1225 2005-06-30 Marek Safar <marek.safar@seznam.cz>
1228 * class.cs (FieldBase.GetInitializerExpression): One more field
1231 2005-06-28 Miguel de Icaza <miguel@novell.com>
1233 * pending.cs: Do not define a proxy if the base method is virtual,
1234 it will be picked up by the runtime (bug 75270).
1236 2005-06-08 Martin Baulig <martin@ximian.com>
1238 The big Iterators rewrite :-)
1240 * iterators.cs: Rewrite this to use the anonymous methods framework.
1242 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1243 before the TypeContainers; see 2test-21.cs.
1246 (TypeContainer.DefineType): Don't create a new EmitContext if we
1247 already have one (this only happens if we're an Iterator).
1248 (TypeContainer.Define): Also call Define() on all our iterators.
1249 (Method.CreateEmitContext): Added support for iterators.
1252 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1253 (AnonymousContainer.CreateMethodHost): Moved here from
1254 AnonymousMethod and made abstract.
1255 (AnonymousContainer.CreateScopeType): New abstract method.
1256 (AnonymousContainer.IsIterator): New public property.
1257 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1258 get the ScopeTypeBuilder rather than manually defining it here.
1259 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1262 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1263 before RootContext.DefineTypes().
1265 * codegen.cs (EmitContext.RemapToProxy): Removed.
1266 (EmitContext.CurrentAnonymousMethod): Changed type from
1267 AnonymousMethod -> AnonymousContainer.
1268 (EmitContext.ResolveTopBlock): Protect from being called twice.
1269 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1270 (EmitContext.EmitThis): Removed the iterators hacks; use the
1271 anonymous methods framework for that.
1274 (ToplevelBlock.Container): Make this a property, not a field.
1275 (ToplevelBlock.ReParent): New public method; move the
1276 ToplevelBlock into a new container.
1277 (Foreach.TemporaryVariable): Simplify.
1279 2005-06-05 Martin Baulig <martin@ximian.com>
1281 * statement.cs (LocalInfo.CompilerGenerated): New flag.
1282 (Block.AddTemporaryVariable): New public method; creates a new
1283 `LocalInfo' for a temporary variable.
1284 (Block.EmitMeta): Create the LocalBuilders for all the temporary
1286 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1287 non-iterator variables.
1289 2005-06-05 Martin Baulig <martin@ximian.com>
1291 * statement.cs (Foreach.TemporaryVariable): Create the
1292 LocalBuilder in the Emit phase and not in Resolve since in some
1293 situations, we don't have an ILGenerator during Resolve; see
1294 2test-19.cs for an example.
1296 2005-06-04 Martin Baulig <martin@ximian.com>
1298 **** Merged r45395 from GCS ****
1300 The big Foreach rewrite - Part II.
1302 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1303 with `PropertyInfo ienumerator_getcurrent'.
1305 * codegen.cs (VariableStorage): Removed.
1308 (Foreach): Derive from Statement, not ExceptionStatement.
1309 (Foreach.CollectionForeach): New nested class. Moved all the code
1310 dealing with collection foreach here.
1311 (Foreach.ForeachHelperMethods): Removed.
1312 (Foreach.TemporaryVariable): Implement IMemoryLocation.
1314 2005-05-23 Martin Baulig <martin@ximian.com>
1316 * statement.cs (Try.DoResolve): Don't create a `finally' if we
1317 don't need to. Fix #75014.
1319 2005-05-20 Martin Baulig <martin@ximian.com>
1321 Merged r44808 from GMCS.
1323 * class.cs (TypeContainer.CircularDepException): Removed.
1324 (TypeContainer.DefineType): Removed the `InTransit' stuff.
1325 (TypeContainer.CheckRecursiveDefinition): Check for circular class
1326 (CS0146) and interface (CS0529) dependencies here.
1328 2005-06-21 Raja R Harinath <rharinath@novell.com>
1330 * expression.cs (Invocation.EmitCall): Fix initialization
1331 'this_call' to reflect current behaviour. Fix indentation.
1333 * convert.cs (FindMostEncompassedType): Add two trivial special
1334 cases (number_of_types == 0 || number_of_types == 1).
1335 (FindMostEncompasingType): Likewise.
1337 2005-06-17 Raja R Harinath <rharinath@novell.com>
1339 Some cleanups preparing for the fix of #75283.
1340 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1342 (EventExpr.InstanceResolve): Likewise.
1343 (EventExpr.DoResolve): Remove redundant checks.
1345 2005-06-10 Duncan Mak <duncan@novell.com>
1347 * cs-tokenizer.cs (process_directives): New flag for controlling
1348 the processing of preprocessor directives.
1349 (x_token): After seeing a '#', return Token.NONE instead of going
1350 to handle_preprocessing_directive() when not processing
1351 directives. This avoids unnecessary processing during the token peek in
1356 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1357 the existing error reporting methods instead of Report.Error.
1359 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1360 after Raja's rewrite.
1362 2005-06-08 Miguel de Icaza <miguel@novell.com>
1364 * class.cs: Small fix.
1366 2005-06-08 Raja R Harinath <rharinath@novell.com>
1369 * class.cs (GetPartialBases): Fix return value check of
1372 2005-06-07 Raja R Harinath <rharinath@novell.com>
1374 Ensure that partial classes are registered in their enclosing
1375 namespace. Initial part of fix of #75160.
1376 * tree.cs (Tree.RecordDecl): Add new namespace argument.
1377 Register declspace with namespace here, not in
1378 DeclSpace.RecordDecl.
1379 * cs-parser.jay: Pass namespace to RecordDecl.
1380 * class.cs (PartialContainer.Create): Likewise.
1381 (ClassPart.DefineType): New sanity-check. Throws an exception if
1383 * decl.cs (Declspace.RecordDecl): Remove.
1384 * namespace.cs (NamespaceEntry.DefineName): Remove.
1386 2005-06-06 Marek Safar <marek.safar@seznam.cz>
1388 * rootcontext.cs: Reset TargetExt as well.
1390 2005-06-03 Raja R Harinath <rharinath@novell.com>
1392 * ecore.cs (Expression.Resolve): Emit CS0654 error when
1395 2005-06-02 Raja R Harinath <rharinath@novell.com>
1397 Fix #75080, cs0119.cs.
1398 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
1400 (Expression.Resolve): ... this. Use it. Remove bogus code
1401 allowing ExprClass.Type and ExprClass.Namespace for
1402 ResolveFlags.VariableOrValue.
1403 (Expression.Resolve) [1-argument variant]: Change default resolve
1404 flags based on language version.
1405 (Expression.Error_UnexpectedKind): Use a simple string array
1406 rather than an ArrayList.
1407 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1409 (TypeOfVoid.DoResolve): Likewise.
1410 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
1411 flags argument -- it always has the same value.
1413 2005-05-31 Raja R Harinath <rharinath@novell.com>
1416 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1417 Use it in the error message.
1418 * assign.cs, expression.cs, statement.cs: Update.
1420 2005-05-30 Raja R Harinath <rharinath@novell.com>
1423 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1424 the "almostMatchedMember" case too.
1425 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1426 that failed the accessibility checks to 'almost_match'.
1428 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
1430 * attribute.cs: Use internal MethodBuilder methods to set
1431 ExactSpelling and SetLastError on PInvoke methods, instead
1432 of passing them via charset. Fixes #75060.
1434 2005-05-27 Raja R Harinath <rharinath@novell.com>
1436 * parameter.cs (Parameter): Remove TODO comment.
1437 (Parameter.DefineParameter): Remove Location parameter.
1438 (Parameters.LabelParameters): Likewise.
1439 * class.cs (Constructor.Emit): Update to change.
1440 (MethodData.Emit): Likewise.
1441 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
1442 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1444 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
1447 Removed Parameters.Location and added Parameter.Location instead.
1448 Removed Location parameter from Emit() and GetSignature().
1455 Modified all related calls.
1457 2005-05-26 Raja R Harinath <rharinath@novell.com>
1459 Improve user-defined conversion handling.
1460 * convert.cs (GetConversionOperators): Rewrite. Return only the
1461 applicable operators.
1462 (AddConversionOperators): New. Helper for GetConversionOperators.
1463 (FindMostEncompassedType, FindMostEncompassingType): Verify that
1464 there is only one most encompassed/encompassing type.
1465 (FindMostSpecificSource, FindMostSpecificTarget): Remove
1466 "applicable operator" handling.
1467 (UserConversion): Move cache here from GetConversionOperators.
1468 Directly cache the chosen operator, rather than the whole
1470 (ExplicitNumericConversion): Fix buggy implementation of Decimal
1471 case. Allow conversion of decimal to sbyte and byte too.
1472 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1473 New static methods. Used to avoid allocating EmptyExpressions in
1476 2005-05-24 Duncan Mak <duncan@novell.com>
1478 * ecore.cs (CastFromDecimal): New class for casting a decimal to
1479 another class, used in Convert.ExplicitNumericConversion.
1480 (CastToDecimal): New class, similar to above, but casts to
1481 System.Decimal, used in Convert.ImplicitNumericConversion and also
1482 in explicit convesion from double/float to decimal.
1484 * convert.cs (ImplicitNumericConversion): Handle implicit
1485 conversions to System.Decimal.
1486 (ExplicitNumericConversion): handle explicit conversions to
1491 2005-05-20 Miguel de Icaza <miguel@novell.com>
1493 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1494 know the type at this stage, just break through. Fixes #75008
1496 2005-05-19 Martin Baulig <martin@ximian.com>
1499 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1500 to disable error reporting.
1502 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1503 here since we don't want to report an error; see the new test-336.cs.
1505 2005-05-19 Raja R Harinath <rharinath@novell.com>
1507 * statement.cs (ToplevelBlock.GetParameterReference)
1508 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1509 Move here from class Block.
1510 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1511 * expression.cs (ParameterReference.DoResolveBase): Likewise.
1513 2005-05-18 Martin Baulig <martin@ximian.com>
1518 (FlowBranching.Reachability): Add non-static public And() and Or()
1520 (FlowBranchingSwitch): New class; do the `break_origins' thing
1521 like in FlowBranchingLoop.
1522 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1523 reachability, not just locals and parameters.
1524 (FlowBranching.MergeChild): Remove some of the hacks for loop and
1525 switch; MergeBreakOrigins() now takes care of that.
1527 2005-05-18 Martin Baulig <martin@ximian.com>
1529 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1530 a loop and may leave it, reset the barrier; fixes #74974.
1532 2005-05-17 Marek Safar <marek.safar@seznam.cz>
1534 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1537 * cs-parser.jay: Catch more lexical errors.
1539 * report.cs: Add one more Error method.
1542 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1544 2005-05-17 Martin Baulig <martin@ximian.com>
1546 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1549 2005-05-16 Raja R Harinath <rharinath@novell.com>
1551 Fix test-382.cs. Emit values of decimal constants.
1552 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1554 (TypeContainer.AddField): ... this.
1555 (TypeContainer.EmitFieldInitializers): Allow the list of fields
1556 with initializers to include 'Const's.
1557 (ClassPart.RegisterFieldForInitialization): Forward to
1559 * const.cs (Const.Const): Pass initializer to base class.
1560 (Const.Define): In case of decimal constants, register them for
1561 initialization in a static constructor.
1563 2005-05-14 Martin Baulig <martin@ximian.com>
1565 * statement.cs (Block.Resolve): Correctly handle unreachable code;
1566 do not call ResolveUnreachable() on unreachable statements in
1567 here, see the comment in the source code.
1569 2005-05-13 Raja R Harinath <rharinath@novell.com>
1572 * expression.cs (BinaryResolveOperator): If one of the operands of
1573 an equality comparison is 'null' and the other is a pointer type,
1574 convert the null to a NullPointer.
1575 * convert.cs (ImplicitReferenceConversion): If the expression is a
1576 NullLiteral and the target type is a pointer type, return a
1577 NullPointer instead.
1578 (ImplicitConversionStandard): Likewise.
1580 2005-05-13 Marek Safar <marek.safar@seznam.cz>
1582 * cs-parser.jay: Set readonly context based on special constructs.
1584 * expression.cs (LocalVariableReference.DoResolveBase): Improved
1585 readonly variable error handling.
1587 * rootcontext.cs (EmitCode): Don't verify members when error
1590 * statement.cs (LocalInfo): Add reaodnly context information.
1591 (SetReadOnlyContext, GetReadOnlyContext): New methods.
1593 2005-05-13 Raja R Harinath <rharinath@novell.com>
1595 * statement.cs (Block.Resolve): Revert change below. Modify fix
1596 for #74041 to initialize 'resolved' to false only for explicit
1597 blocks. Fixes #74873.
1599 2005-05-12 Raja R Harinath <harinath@gmail.com>
1602 * typemanager.cs (unmanaged_enclosing_types): New.
1603 (IsUnmanagedType): Avoid infloops by using
1604 'unmanaged_enclosing_types' to talk with recursive invocations.
1606 2005-05-13 Martin Baulig <martin@ximian.com>
1608 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1609 instance variable, not a local. Fix #74873.
1610 (Block.ResolveUnreachable): Set it to true here.
1612 2005-05-11 Duncan Mak <duncan@novell.com>
1614 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1615 continuing to process for 'arg'.
1616 (handle_preprocessing_directive): Check the argument of the #endif
1617 directive and report error CS1025 if there are any trailing
1620 According to the C# spec, having even whitespace after the #endif
1621 directive is illegal; however, because we call arg.TrimEnd ()
1622 beforehand, we have the same behavior as csc, allowing whitespace
1623 after the directive.
1627 2005-05-11 Marek Safar <marek.safar@seznam.cz>
1631 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1632 (Constructor.GetObsoleteAttribute): Implemented correctly.
1634 2005-05-10 Martin Baulig <martin@ximian.com>
1636 * support.cs (ReflectionParameters.ParameterModifier): Use
1637 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1638 and `ParameterAttributes.In'. Fixes #74884.
1640 2005-05-10 Marek Safar <marek.safar@seznam.cz>
1642 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1644 * expression.cs (Argument.GetParameterModifier): Turned to property.
1645 (Invocation.Error_InvalidArguments): Add more descriptive errors.
1647 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1650 2005-05-09 Raja R Harinath <rharinath@novell.com>
1653 * decl.cs (MemberCache.AddMethods): Register override methods,
1654 rather than non-override methods.
1655 * typemanager.cs (RegisterOverride): New.
1656 (IsOverride): Update.
1658 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1662 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1663 recursive declaration.
1665 * statement.cs (Block.ResolveMeta): Report any error in resolving.
1667 2005-05-06 Marek Safar <marek.safar@seznam.cz>
1669 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1671 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1673 2005-05-05 Raja R Harinath <rharinath@novell.com>
1676 * decl.cs (DeclSpace.FamilyAccessible):
1677 Use TypeManager.IsNestedFamilyAccessible.
1679 Fix reopened #64812.
1680 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1683 2005-05-04 Raja R Harinath <rharinath@novell.com>
1684 Abin Thomas <projectmonokochi@rediffmail.com>
1685 Anoob V E <projectmonokochi@rediffmail.com>
1686 Harilal P R <projectmonokochi@rediffmail.com>
1689 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1690 allow access to all static members.
1692 2005-05-04 Martin Baulig <martin@ximian.com>
1694 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1696 2005-05-04 Martin Baulig <martin@ximian.com>
1700 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1701 section at the end; make things work if `default' is not the last
1704 2005-05-04 Martin Baulig <martin@ximian.com>
1708 * statement.cs (Switch): Replaced the `got_default' field with a
1709 `default_section' one.
1710 (Switch.CheckSwitch): Set `default_section' here.
1711 (Switch.Resolve): If we're a constant switch and the constant is
1712 not found, use the default section.
1714 2005-05-03 Martin Baulig <martin@ximian.com>
1716 * expression.cs (ArrayAccess.EmitGetLength): New public method.
1718 * statement.cs (Foreach.ArrayForeach): New nested class.
1719 (Foreach.TemporaryVariable): New nested class.
1720 (Foreach.EmitArrayForeach): Removed; this is now in the new
1723 2005-05-03 Raja R Harinath <rharinath@novell.com>
1725 * pending.cs (BaseImplements): Move the #74773 fix here. This is
1727 (VerifyPendingMethods): Revert change below.
1729 * typemanager.cs (IsOverride, RegisterNonOverride): New.
1730 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1731 that used to trigger warning -28. Remove warning -28.
1732 * expression.cs (Invocation.OverloadResolve): Use
1733 TypeManager.IsOverride to distinguish override methods.
1736 * pending.cs (VerifyPendingMethods): If a base type implements the
1737 requested interface, don't bother checking individual methods of
1738 the base type. As a side-effect, this prevents the creation of
1739 unnecessary proxies.
1741 2005-05-02 Martin Baulig <martin@ximian.com>
1745 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1746 Also `And' the locals if the old vector is null.
1747 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1748 null; in this case we basically reset all the variables.
1750 2005-05-02 Martin Baulig <martin@ximian.com>
1754 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1755 Added `FlowBranching branching' argument; always `and' the
1756 variables instead of `or'ing them unless we're an infinite loop.
1758 * statement.cs (While.Resolve): Create a new sibling unless we're
1761 2005-05-02 Martin Baulig <martin@ximian.com>
1765 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1766 arguments; use it instead of creating a new TopLevelBlock.
1767 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1768 our ConstructorInitializer.
1771 (TopLevelBlock.TopLevelBranching): New public property.
1772 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1773 and create our `TopLevelBranching'.
1775 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1776 anonymous method host, use `block.TopLevelBranching' rather than
1777 creating a new branching.
1779 2005-04-20 Miguel de Icaza <miguel@novell.com>
1781 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1782 a ScopeInfo, if any of the current children is a child of the new
1783 entry, move those children there.
1785 2005-04-30 Martin Baulig <martin@ximian.com>
1787 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1788 at the beginning of a SwitchSection. Fix #73335.
1790 2005-04-27 Marek Safar <marek.safar@seznam.cz>
1793 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1795 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1796 (FieldExpr.DoResolve): Obsolete members are ignored for field
1799 2005-04-26 Marek Safar <marek.safar@seznam.cz>
1801 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1802 of arrays detection.
1804 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1806 (Field.VerifyClsCompliance): Volatile fields are not compliant.
1808 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1811 2005-04-25 Ben Maurer <bmaurer@ximian.com>
1813 * cs-parser.jay: Use the prefered version of -unsafe in error
1816 2005-04-22 Marek Safar <marek.safar@seznam.cz>
1818 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1821 2005-04-20 John Luke <john.luke@gmail.com>
1823 * driver.cs: fix typo in error message, --outout to --output
1825 2005-04-20 Marek Safar <marek.safar@seznam.cz>
1827 * codegen.cs (InRefOutArgumentResolving): New field.
1829 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1830 fields outside contructor.
1832 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1834 2005-04-19 Miguel de Icaza <miguel@novell.com>
1836 * anonymous.cs (CaptureContext.EmitParameterInstance): The
1837 parameter code was not completed ever, so it was not as up-to-date
1838 as local variables. Must finish it.
1840 The bug fix was to compare the Toplevel of the block, not the
1841 current block. Thanks for Ben for pointing this out.
1843 2005-04-19 Raja R Harinath <rharinath@novell.com>
1845 * decl.cs (AddMethods): Use the declaring type of the problem
1846 method to determine if we want to squash a warning.
1848 2005-04-19 Marek Safar <marek.safar@seznam.cz>
1850 * attribute.cs: Removed debug output.
1852 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1854 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1857 2005-04-18 Raja R Harinath <rharinath@novell.com>
1860 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1861 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1862 all null comparisons against reference types.
1864 2005-04-18 Marek Safar <marek.safar@seznam.cz>
1867 * class.cs (TypeContainer.CircularDepException) New nested
1869 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1870 (TypeContainer.DefineType): Removed error, reset InTransit before
1872 (Class.DefineType): Throw exception when is in Transit.
1873 Catch exception and report error.
1874 (Struct.DefineType): Throw exception when is in Transit.
1875 Catch exception and report error.
1876 (Interface.DefineType): Throw exception when is in Transit.
1877 Catch exception and report error.
1879 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1880 handle nested exception handlers.
1882 * flowanalysis.cs (InTryWithCatch): New method, search for try with
1885 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1886 InFinally and InCatch storage.
1888 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1889 (Catch.Resolve): Set and Restore ec.InCatch.
1890 (Try.Resolve): Set and Restore ec.InFinally.
1891 (Try.HasCatch): True when try has catch.
1893 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
1895 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1896 for the same event member, so exclude such cases from warning 419.
1899 2005-04-16 Miguel de Icaza <miguel@novell.com>
1901 * expression.cs (Binary.ResolveOperator): Apply patch from John
1902 Luke to fix bug 59864: operators &, | and ^ on enumerations
1903 require that the same enum type on both sides.
1905 * driver.cs: Add warnings to old flag usage, this is to assist
1906 people who produce Makefiles and hope that the Makefiles will be
1909 * class.cs (TypeContainer.EmitType): Moved the definition of the
1910 special $PRIVATE$ field from the resolve phase to the Emit phase.
1911 During resolve we do not know if we are a struct with
1912 HasExplicitLayout, we know this only after the attributes for the
1915 Set the FieldOffset to zero on the dummy field that we create for
1916 the class. Fixes 74590.
1918 2005-04-16 Raja R Harinath <rharinath@novell.com>
1921 * ecore.cs (PropertyExpr.resolved): New.
1922 (DoResolve): Use it to handle a case of double resolution here.
1923 Handle a case of identical-name-and-type-name.
1924 * expression.cs (ArrayCreation.CheckIndices): Avoid double
1925 resolution by storing the results of expression resolution back
1926 into the "probes" array.
1928 2005-04-15 Raja R Harinath <rharinath@novell.com>
1930 Fix cs0208-7.cs and cs0208-8.cs.
1931 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1932 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
1933 error reporting to point out the reason a struct is not unmanaged.
1935 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
1937 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
1938 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1940 2005-04-13 Raja R Harinath <rharinath@novell.com>
1943 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1944 IdenticalNameAndTypeName here.
1945 (EventExpr.InstanceResolve): Likewise.
1947 2005-04-13 Marek Safar <marek.safar@seznam.cz>
1949 C# 2.0 DefaultCharSetAttribute implementation
1951 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1952 which allows us to set GlobalNamespace for every resolve.
1953 (Attribute.ResolveArguments): Cut from Resolve.
1954 (Attribute.GetCharSetValue): Returns CharSet named argument.
1955 (Attribute.DefinePInvokeMethod): Gets default charset from
1957 (GlobalAttribute.ResolveAsTypeStep): Override.
1958 (GlobalAttribute.ResolveArguments): Override.
1960 * class.cs (TypeAttr): Is protected.
1962 * codegen.cs (ModuleClass.DefaultCharSet): New member.
1963 (ModuleClass.DefaultCharSetType): New memeber.
1964 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1966 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1967 charset from module.
1969 * delegate.cs (TypeAttr): Override.
1970 (Delegate.DefineType): Use this TypeAttr.
1972 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1973 at very early stage (before types are defined) to resolve model
1974 module attributes. It will probably not work with corlib but it
1977 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1978 charset from module.
1980 * typemanager.cs (default_charset_type): New type.
1982 2005-04-13 Raja R Harinath <rharinath@novell.com>
1984 * decl.cs (MemberCache.AddMethods): Don't warn if
1985 System.Object.Finalize has buggy MethodAttributes.
1987 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1990 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
1992 * doc.cs : detect ambiguous reference to overloaded members.
1993 Fixed bug #71603. MS 1.1 csc does not detect it.
1995 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
1997 * doc.cs : delegates must not be referenced with parameters.
2000 2005-04-12 Miguel de Icaza <miguel@novell.com>
2002 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2004 2005-04-10 Miguel de Icaza <miguel@novell.com>
2006 * driver.cs (MainDriver): Stop processing if the CLS stage found
2009 (CompilerCallableEntryPoint.InvokeCompiler): Always
2010 reset after execution; Take a TextWriter argument for the
2013 * report.cs: Use the error stream instead of hardcoding stderr.
2015 2005-04-09 Miguel de Icaza <miguel@novell.com>
2017 * class.cs: Reduce code paths to test, too small of an
2018 optimization to make it worth the extra testing. Always perform
2021 2005-04-08 Raja R Harinath <rharinath@novell.com>
2024 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2025 operators that had errors reported on them.
2027 2005-04-08 Marek Safar <marek.safar@seznam.cz>
2029 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2031 (Attribute.Resolve): Add named argument type checking.
2033 * class.cs (FixedField.Define): Use IsPrimitiveType
2035 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2037 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2038 unsafe parameter types.
2040 * statement.cs (Using.ResolveExpression): Add better error description.
2042 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2044 2005-04-08 Raja R Harinath <rharinath@novell.com>
2047 * attribute.cs (Attribute.GetAttributeUsage): Resolve
2048 AttributeUsageAttribute in the emitcontext of the attribute class,
2049 not in the emitcontext of the attributable entity it was attached to.
2050 * cs-parser.jay: Use 'current_class', not 'current_container',
2051 when creating a GlobalAttribute.
2053 2005-04-08 Alp Toker <alp@atoker.com>
2055 * pending.cs: The fix to #58413 failed to compile methods implementing
2056 interfaces with/without params modifiers and vice versa, even though
2057 params modifiers aren't part of the signature. Make the modifier check
2058 less strict as in csc.
2060 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
2061 Anoob V E <projectmonokochi@rediffmail.com>
2062 Harilal P R <projectmonokochi@rediffmail.com>
2065 * pending.cs (TypeAndMethods.mods): New. Store the parameter
2066 modifiers of pending methods.
2067 (PendingImplementation.PendingImplementation): Initialize it.
2068 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2069 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2070 with ParameterData. Add check for modifiers.
2071 * class.cs (MethodData.Define): Update to changes.
2073 2005-04-07 Raja R Harinath <rharinath@novell.com>
2075 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2077 2005-04-07 Marek Safar <marek.safar@seznam.cz>
2079 * class.cs (PropertyMethod.Define): Check private accessor in abstract
2082 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2085 * typemanager.cs: Registered RequiredAttributeAttribute.
2087 2005-04-06 Marek Safar <marek.safar@seznam.cz>
2089 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2090 Warning CS0169 is back at level 3.
2091 (IMethodData.SetMemberIsUsed): New method.
2093 * decl.cs (IsUsed): New value; moved from FieldBase.Status
2094 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2096 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2098 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2100 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2103 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2106 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2107 to avoid the problems with nested types.
2109 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
2110 Anoob V.E <projectmonokochi@rediffmail.com>
2111 Harilal P.R <projectmonokochi@rediffmail.com>
2112 Raja R Harinath <rharinath@novell.com>
2115 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2117 * typemanager (GetConstructor): Make public.
2119 2005-04-05 John Luke <john.luke@gmail.com>
2120 Raja R Harinath <rharinath@novell.com>
2123 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2124 struct too. Return false quicker in a few cases.
2125 (VerifyUnManaged): Use it.
2127 2005-04-05 Raja R Harinath <rharinath@novell.com>
2130 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2131 not 'unreachable_seen'.
2133 2005-04-04 Marek Safar <marek.safar@seznam.cz>
2135 * attribute.cs (Attribute.GetValue): Removed unused.
2137 * codegen.cs (CodeGen.TrimExt): Removed unused.
2139 * cs-parser.jay (output): Removed unused.
2141 * cs-tokenizer.cs (hex_digits): Removed unused.
2143 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2145 * expression.cs (Indirection.LoadExprValue): Removed unused.
2146 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2148 * iterators.cs (Iterator.param_types): Removed unused.
2150 * statement.cs (Goto.block): Removed unused.
2151 (ToplevelBlock.did): Removed unused.
2152 (Switch.ResolveConstantSwitch): Removed unused.
2154 2005-04-01 Ben Maurer <bmaurer@ximian.com>
2156 * rootcontext.cs: Allow mcs to bootstrap with the compilation
2159 2005-04-01 Raja R Harinath <rharinath@novell.com>
2161 Fix #74232 and cs0208-3.cs.
2162 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2163 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2164 unmanaged type. Don't use FieldBuilders when 't' is a
2165 TypeBuilder. Use ModFlags and MemberType fields.
2166 * class.cs (MemberBase.member_type): Rename from MemberType.
2167 (MemberBase.MemberType): New property. Determines member_type on
2169 (MemberBase.DoDefine): Don't initialize MemberType here.
2170 (FieldMember.Define): Likewise.
2172 2005-04-01 Marek Safar <marek.safar@seznam.cz>
2175 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2176 Attributes are emitted there.
2178 2005-04-01 Raja R Harinath <rharinath@novell.com>
2180 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2181 keyword in 'partial enum' too.
2182 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2184 Report from Kamil Skalski <nazgul@omega.pl>.
2187 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2188 have partial containers too.
2190 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2191 in block' checks to Block.CheckInvariantMeaningInBlock.
2192 * statement.cs (Block.GetKnownVariableInfo): Make private.
2193 (Block.IsVariableUsedInChildBlock): Remove.
2194 (Block.IsVariableUsedInBlock): Likewise.
2195 (Block.CheckInvariantMeaningInBlock): New. Show location of
2196 conflicting declaration.
2197 (Block.AddVariable): Make error messages less long-winded and more
2198 specific. Show location of conflicting declaration.
2199 * parameter.cs (Parameters.Location): New readonly property.
2201 2005-03-31 Raja R Harinath <rharinath@novell.com>
2203 Clean up semantics of invoking ResolveMemberAccess.
2204 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2205 can have an instance, ensure that we pass in a non-TypeExpression
2206 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
2207 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2208 argument. Update to changes and simplify.
2209 (FieldExpr.Emitinstance): Remove CS0120 check.
2210 (PropertyExpr.EmitInstance): Likewise.
2211 * expression.cs (Argument.Resolve): Likewise.
2212 (Invocation.DoResolve): Update to changes in semantics of
2215 2005-03-31 Marek Safar <marek.safar@seznam.cz>
2218 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2221 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2223 2005-03-31 Raja R Harinath <rharinath@novell.com>
2225 Fix difference in behaviour with commandline invocation.
2226 * driver.cs (Driver.Reset): New.
2227 (CompilerCallableEntryPoint): Call it.
2229 * statement.cs (If.Resolve): Avoid spurious "uninitialized
2230 variable" warnings if the boolean expression failed to resolve.
2232 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
2234 * attribute.cs: Fix the union of several permissions when some of them
2235 are unrestricted (so the result isn't an unrestricted permission set).
2238 2005-03-30 Raja R Harinath <rharinath@novell.com>
2240 * ecore.cs (MemberExpr): New class. Convert from interface
2242 (MemberExpr.ResolveMemberAccess): Refactor and move here from
2243 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
2245 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2246 (MethodGroupExpr.IsExplicitImpl): Remove.
2247 (Expression.GetFieldFromEvent): Remove.
2248 (SimpleName.MemberStaticCheck): Remove.
2249 (SimpleName.DoSimpleNameResolve): Update to changes.
2250 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2251 (MemberAccess.IdenticalNameAndTypeName): Remove.
2252 (MemberAccess.error176): Move to MemberExpr.
2253 (MemberAccess.DoResolve): Update to changes.
2254 (BaseAccess.DoResolve): Likewise.
2256 2005-03-30 Marek Safar <marek.safar@seznam.cz>
2258 C# 2.0 Conditional attribute class implementation
2260 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2261 Analyzes class whether it has attribute which has ConditionalAttribute
2262 and its condition is not defined.
2264 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2265 (Class.IsExcluded): New method. Search for at least one defined
2266 condition in ConditionalAttribute of attribute class.
2268 2005-03-30 Raja R Harinath <rharinath@novell.com>
2270 * ecore.cs (PropertyExpr): Derive from Expression, not
2271 ExpressionStatement.
2272 (PropertyExpr.EmitStatement): Remove.
2274 2005-03-29 Raja R Harinath <rharinath@novell.com>
2277 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2278 internal field "value__" of an enum be private. The examples for
2279 "value__" that I found on MSDN all used FieldAttributes.Private.
2281 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2282 Don't mention IL method attribute names.
2284 Fix #47991. Remove a TODO.
2285 * statement.cs (Block.Toplevel): Make into a field.
2286 (Block.Parameters): Move into ToplevelBlock.
2287 (Block.known_variables): Rename from child_variable_names.
2288 (Block.Block): Remove variants that take Parameters. Initialize
2289 'Toplevel' with the immediately surrounding toplevel block.
2290 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
2291 LocalInfo parameter.
2292 (Block.GetKnownVariableInfo): New.
2293 (Block.IsVariableNameUsedInChildBlock): Update.
2294 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
2295 the block, even though it may not be in scope.
2296 (Block.AddVariable): Remove Parameters parameter. Use
2297 Toplevel.Parameters instead.
2298 (Block.AddConstant): Remove Parameters parameter.
2299 (Block.GetParameterReference): Update to use Toplevel.Parameters.
2300 (Block.IsParamaterReference): Likewise.
2301 (Block.IsLocalParameter): Likewise. Simplify a lot.
2302 (ToplevelBlock.Parameters): New. Moved from Block.
2303 (ToplevelBlock.ToplevelBlock): Update to changes. Always
2304 initialize Parameters to a non-null value.
2305 * cs-parser.jay: Update to changes.
2306 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2307 simple names that mean different things in the same block. Use
2308 Block.IsVariableNameUsedInBlock.
2310 2005-03-28 Raja R Harinath <rharinath@novell.com>
2312 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2313 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2314 GetTypeHandle. It is possible for a reflected type to derive from
2315 a TypeBuilder (e.g., int[] derives from the TypeBuilder
2316 System.Array during mscorlib compilation).
2317 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2318 contain a method_hash, don't create one either. Don't create a
2319 deep copy of the base cache's method_hash.
2320 (MemberCache.SetupCache): Rename back from DeepCopy.
2321 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2322 already initialized. If we see an override function, add its
2323 underlying base virtual function to the member_hash too.
2325 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2327 2005-03-26 Raja R Harinath <harinath@acm.org>
2330 * assign.cs (Assign.DoResolve): When the RHS of an assignment
2331 fails to resolve, ensure that the LHS is still resolved as an
2334 2005-03-25 Raja R Harinath <harinath@acm.org>
2336 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2338 (Enum.current_ec): Remove.
2339 (Enum.LookupEnumValue): Remove EmitContext argument.
2340 Just uses the one created during DefineType.
2341 (Enum.FindMembers): Update.
2342 * expression.cs (MemberAccess.DoResolve): Update.
2344 2005-03-22 Marek Safar <marek.safar@seznam.cz>
2346 * assign.cs (Assign.DoResolve): Check for CS1717 when
2347 source and target are same (uses Equals).
2349 * expression.cs (LocalVariableReference, ParameterReference,
2350 This): Implemented Equals, GetHashCode.
2352 * statement.cs (Block.GetParameterReference): Removed useless
2355 2005-03-22 Raja R Harinath <rharinath@novell.com>
2358 * statement.cs (Block.AddVariable): Ensure that we skip implicit
2359 blocks before deciding whether the error is cs0136 or cs0128.
2361 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2362 (using_alias_directive, using_namespace_directive): Pass
2363 MemberName, not an expression to Namespace.UsingAlias and
2365 (MakeName): Use the MemberName of the namespace.
2366 * namespace.cs (Namespace.MemberName): New.
2367 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2368 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2370 * decl.cs (MemberName.Name): Make readonly.
2371 (MemberName.FromDotted): New "constructor".
2372 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2373 (MemberCore.Name): Compute from MemberName on demand.
2374 (MemberCore.SetMemberName): Provide a way to change the
2376 (MemberCore.AddToContainer): Don't take a fullname parameter.
2377 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2378 fully qualified name of the container to the member name.
2379 (TypeContainer.AddToTypeContainer): Use a fully qualified name
2380 only if the type is a member of the root container.
2381 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2382 MemberName.Left rather than searching for an embedded ".".
2383 (PartialContainer.CreatePart): Update to changes in RootContext.
2384 (MemberBase.ShortName): Turn into a property. Use
2385 MemberCore.SetMemberName.
2386 (MemberBase.ExplicitInterfaceName): Remove.
2387 (MemberBase.UpdateMemberName): Remove.
2388 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2389 (PropertyBase.SetMemberName): New override.
2390 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2391 (Tree.GetDecl): New.
2392 (Tree.AllDecls): Rename from Decls.
2393 * attribute.cs, enum.cs, report.cs: Update to changes.
2394 * driver.cs (MainDriver): Use MemberName.FromDotted on
2395 RootContext.MainClass.
2397 2005-03-21 Marek Safar <marek.safar@seznam.cz>
2399 * class.cs (FixedField.Define): Check for CS1664 and more sanity
2402 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2404 2005-03-18 Marek Safar <marek.safar@seznam.cz>
2406 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2407 property accessor modifiers.
2409 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2410 fixed buffer attribute (CS1716).
2411 (PropertyMethod.HasCustomAccessModifier): When property accessor
2412 has custom modifier.
2414 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2416 (PropertyExpr.DoResolveLValue): Add CS0272.
2418 2005-03-17 Miguel de Icaza <miguel@novell.com>
2420 * convert.cs: When converting to a pointer, use the proper Conv.U
2421 or Conv.I depending on the source data type.
2423 * cs-tokenizer.cs: Make the size for large decimal constants,
2426 2005-03-17 Martin Baulig <martin@ximian.com>
2428 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2429 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
2431 2005-03-17 Martin Baulig <martin@ximian.com>
2433 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2434 to bool so we can return an error condition.
2435 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2438 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
2440 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2443 2005-03-16 Raja R Harinath <rharinath@novell.com>
2445 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2446 Refactor to avoid traversing the list of assemblies, and to avoid
2447 string concatenation.
2448 * typemanager.cs (guid_attr_type): Remove.
2449 (negative_hits, pointers, references): Remove hashes.
2451 (GetConstructedType): New. Uses type_hash to handle constructed
2452 types (arrays, references, pointers).
2453 (GetReferenceType, GetPointerType): Use it.
2454 (GetNestedType): New. Uses type_hash to handle nested types of
2456 (LookupType, LookupTypeDirect): Remove.
2457 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
2458 'types' hash and LookupTypeReflection directly.
2459 (params_string, params_object): Use GetConstructedType.
2460 * namespace.cs (Namespace.cached_types): New. Cache of reflected
2462 (Namespace.Lookup): Use cached_types.
2463 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2464 provided by old TypeManager.LookupType.
2465 * rootcontext.cs (MakeFQN): Remove.
2466 * decl.cs (DeclSpace.MakeFQN): Likewise.
2467 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2468 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2469 TypeManager.GetConstructedType.
2470 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2472 2005-03-15 Marek Safar <marek.safar@seznam.cz>
2474 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2477 * cs-parser.jay: Reports CS1527 for any namespace element.
2479 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2482 * expression.cs (ParameterReference.IsAssigned): Changed error to
2484 (Error_WrongNumArguments): Moved CS0245 detection here.
2486 * statement.cs (Return.Resolve): Add CS1622 report.
2488 2005-03-11 Marek Safar <marek.safar@seznam.cz>
2490 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2492 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
2494 * attribute.cs expression.cs: Get rid of some allocations.
2496 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
2498 * doc.cs : just eliminate the latest change.
2500 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2502 * doc.cs : commented out the latest change. It breaks xml-030.cs
2504 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2506 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2507 fail. So invoke CreateType() in FindDocumentedType().
2509 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2511 * cs-tokenizer.cs : added IsKeyword().
2512 * doc.cs : Detect keyword incorrectly used as identifier.
2513 Allow identifiers prefixed by @.
2515 2005-03-10 Marek Safar <marek.safar@seznam.cz>
2517 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2518 It caused exception in namespace resolving (again!).
2520 * class.cs (Class.ctor): Removed exit.
2521 (PropertyMethod.ctor): ditto.
2523 * codegen.cs (Codegen.Reset): Reset static data.
2524 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2526 * cs-tokenizer.cs (Cleanup): Removed.
2528 * driver.cs (GetSystemDir): Rewrote to one line command.
2529 It caused problem with unloaded dynamic modules.
2530 (UnixParseOption): Removed Exit.
2531 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2532 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2533 Now can be mcs used as library.
2535 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2538 * location.cs (Reset): Reset static data.
2540 * namespace.cs (Reset): Reset static data.
2542 * report.cs (Report.Reset): Reset static data.
2544 * rootcontext.cs (RootContext.Reset): Reset static data.
2546 * tree.cs (RootTypes.ctor): Use Location.Null
2548 * typemanager.cs (TypeManager.Reset): Reset static data.
2549 (CoreLookupType): Removed Exit.
2550 (TypeHandle.Reset): Reset static data.
2552 2005-03-10 Raja R Harinath <rharinath@novell.com>
2555 * typemanager.cs (ComputeNamespaces): Import namespaces from
2556 referenced modules too.
2558 2005-03-09 Raja R Harinath <rharinath@novell.com>
2560 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2563 2005-03-09 Raja R Harinath <rharinath@novell.com>
2565 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2566 enclosing DeclSpace. This ensures that a name-lookup populates
2567 more caches and there are fewer 'TypeExpression's. Carve out
2568 nested type lookup into ...
2569 (LookupNestedTypeInHierarchy): ... this.
2571 2005-03-09 Raja R Harinath <rharinath@novell.com>
2573 Clean up a few partial-class semantics.
2574 Fixes test-357.cs and cs1618-2.cs.
2575 * cs-parser.jay (struct_declaration): Use 'current_class' as
2576 parent of newly-created struct. Remove call to Register ().
2577 Use 'pop_current_class' to complete handing the current struct.
2578 (interface_declaration): Likewise.
2579 (class_declaration): Likewise.
2580 (enum_declaration): Use 'current_class' as parent of newly created
2582 (delegate_declaration): Likewise.
2583 (pop_current_class): New function. This is used to handle closing
2584 up the 'current_class' and 'current_container', and pointing them
2585 to the enclosing class/container.
2586 (CSharpParser): Initialize 'current_class' too.
2587 * decl.cs (MemberCore): Add check for invariant: a partial
2588 container is not a parsed entity, and thus does not enclose any
2590 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2591 (DeclSpace.BaseTypeExpr): Use it.
2592 (DeclSpace.LookupType): Add check for invariant.
2593 * class.cs (TypeContainer): Add check for invariant: a nested
2594 class should have the same NamespaceEntry as its enclosing class.
2595 (TypeContainer.EmitFieldInitializers): Make virtual.
2596 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2598 (TypeContainer.Register): Remove.
2599 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2600 null. Use TypeResolveEmitContext for resolving base types and
2601 interfaces. Move initialization of Parts.TypeBuilder here from
2603 (TypeContainer.DefineNestedTypes): ... here.
2604 (PartialContainer): Take a Namespace not a NamespaceEntry.
2605 (PartialContainer.Create): Don't use Register. Call the
2606 appropriate Add... function directly.
2607 (ClassPart): Take both the PartialContainer and the enclosing
2608 class as constructor arguments.
2609 (ClassPart.EmitFieldInitializers): Override.
2610 (ClassPart.PartFindNestedTypes): Remove.
2611 (FieldBase.GetInitializerExpression): Resolve the initializer
2612 expression in the emit context of the enclosing class.
2613 * tree.cs (RootTypes): Remove Register ().
2615 2005-03-08 Marek Safar <marek.safar@seznam.cz>
2617 * cs-parser.jay: Removed CS0134.
2619 * driver.cs: Removed CS1901.
2621 * expression.cs (SizeOf.DoResolve): Don't report CS0233
2622 for predefined types.
2624 2005-03-07 Duncan Mak <duncan@novell.com>
2626 * codegen.cs (Save): Catch UnauthorizedAccessException as
2627 well. Fixes bug #73454.
2629 2005-03-07 Marek Safar <marek.safar@seznam.cz>
2631 * cs-tokenizer.cs (xtoken): Add CS1035.
2633 * class.cs (MethodData.Define): Add CS0683.
2634 (FieldMember.ctor): Add CS0681.
2636 2005-03-07 Raja R Harinath <rharinath@novell.com>
2638 * ecore.cs (SimpleName.DoResolve): Rename from
2639 SimpleName.DoResolveAllowStatic.
2640 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2641 Pass 'intermediate' flag to MemberStaticCheck.
2642 (SimpleName.MemberStaticCheck): Skip "static check" only in case
2643 of "intermediate" lookups via MemberAccess.
2644 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
2645 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2647 2005-03-07 Raja R Harinath <rharinath@novell.com>
2650 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2651 slipped in because of variable names that are identical to a
2652 builtin type's BCL equivalent ('string String;', 'int Int32;').
2653 (PropertyExpr.EmitInstance): Likewise.
2655 2005-03-04 Marek Safar <marek.safar@seznam.cz>
2657 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2659 * report.cs (warning_ignore_table): Made public.
2661 2005-03-04 Raja R Harinath <rharinath@novell.com>
2664 * class.cs (MethodData.Emit): Pass 'container' to
2665 container.GetObsoleteAttribute instead of 'container.Parent'.
2667 2005-03-03 Marek Safar <marek.safar@seznam.cz>
2669 * cs-parser.jay: Add 1534 error test.
2671 * iterators.cs (Yield.CheckContext): Add error 1629.
2672 (Iterator.ctor): Save unsafe modifier.
2673 (MoveNextMethod.DoEmit): Restore unsafe context.
2675 * namespace.cs (UsingAlias): Better error message.
2677 2005-03-03 Dan Winship <danw@novell.com>
2679 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2680 the warning message [#73219]
2682 2005-03-03 Raja R Harinath <rharinath@novell.com>
2684 Fix compile with MCS 1.0.0.0.
2685 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2686 w_restore to not depend on string constant folding.
2688 2005-03-03 Raja R Harinath <rharinath@novell.com>
2690 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
2691 CS0246 check to users who passed 'silent = false'.
2692 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2694 (SimpleName.SimpleNameResolve): Update.
2695 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2696 (MemberAccess.IdenticalNameAndTypeName): Update.
2697 * doc.cs (FindDocumentedTypeNonArray): Update.
2699 2005-03-03 Raja R Harinath <rharinath@novell.com>
2701 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2702 * parameters.cs (ComputeAndDefineParameters): Remove.
2703 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2704 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2705 Use GetParameterInfo.
2707 2005-03-02 Marek Safar <marek.safar@seznam.cz>
2709 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2711 2005-03-02 Raja R Harinath <rharinath@novell.com>
2713 Unify DeclSpace.LookupType and DeclSpace.FindType.
2714 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
2715 is in charge of defining nested types on demand.
2716 (DeclSpace.LookupType): Use it when the current_type is a
2717 TypeBuilder. Use LookupTypeDirect for reflected types.
2718 (DeclSpace.FindType): Remove.
2719 (DeclSpace.LookupInterfaceOrClass): Likewise.
2720 (DeclSpace.DefineTypeAndParents): Likewise.
2721 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2722 DeclSpace.LookupType.
2723 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2724 * typemanager.cs (LookupType): Simplify.
2725 (AddUserType): Remove type from negative_hits.
2726 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2727 * class.cs (TypeContainer.FindMembers): Move handling of nested
2729 (TypeContainer.FindMembers_NestedTypes): ... here.
2730 (TypeContainer.FindNestedType): Implement override.
2731 (ClassPart.FindNestedType): Delegate to PartialContainer.
2732 (ClassPart.PartFindNestedType): Looks up the nested types of the
2735 2005-03-02 Martin Baulig <martin@ximian.com>
2737 * class.cs (TypeContainer.DoDefineMembers): We also need a default
2738 static constructor in static classes.
2740 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
2742 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2743 sizeParamIndex is not specified.
2745 2005-03-01 Marek Safar <marek.safar@seznam.cz>
2748 * report.cs (WarningMessage.IsEnabled): Missing null check.
2750 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2752 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2753 in the fields and not in the properties.
2755 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
2757 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
2760 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2762 * attribute.cs: Small refactoring (improved robustness).
2763 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2764 (ValidateGuid): Removed.
2765 (Resolve): Removed referenced to above mentioned.
2766 (GetAttributeUsage): Made private and changed to work without
2768 (GetIndexerAttributeValue): Don't crash.
2769 (GetConditionalAttributeValue): Ditto.
2770 (GetClsCompliantAttributeValue): Ditto.
2771 (ExtractSecurityPermissionSet): All attributes exceptions are
2773 (GetPropertyValue): New helper.
2774 (GetMethodImplOptions): New method.
2775 (DefinePInvokeMethod): Reuse common code. Implemented handling of
2776 some missing properties.
2778 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2779 (Method.ApplyAttributeBuilder): Updated.
2781 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2784 2005-02-28 Raja R Harinath <rharinath@novell.com>
2787 * report.cs (Report.SymbolRelatedToPreviousError): Handle
2788 non-simple types (array, pointer, reference).
2790 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2792 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2794 * class.cs (MethodCore.IsDuplicateImplementation): Special error
2796 (Method.CheckBase): Catch wrong destructor here.
2797 (MethodData.Define): Add errors 550, 668.
2799 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2801 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2803 * pending.cs (VerifyPendingMethods): Add error 551.
2805 * typemanager.cs (CSharpName): Next error report helper.
2807 2005-02-25 Marek Safar <marek.safar@seznam.cz>
2809 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2810 attributes. Removed useless attribute double check.
2811 It saves almost 2MBs for corlib.
2813 2005-02-25 Raja R Harinath <rharinath@novell.com>
2816 * statement.cs (ExpressionStatement.Resolve): Make robust to being
2817 called twice in case of error.
2819 2005-02-23 Chris Toshok <toshok@ximian.com>
2821 Fix compiler portions of #72827.
2822 * statement.cs (Block.Emit): call Begin/EndScope on the
2823 EmitContext instead of the ILGenerator.
2825 * codegen.cs (EmitContext.BeginScope): new method, call
2826 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2828 (EmitContext.BeginScope): same, but EndScope and CloseScope
2830 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2831 offset and call the superclass's OpenScope(int) with it.
2832 (SymbolWriter.CloseScope): get the current il
2833 offset and call superclass's CloseScope(int) with it.
2835 2005-02-23 Marek Safar <marek.safar@seznam.cz>
2837 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2838 CS1677 for out and ref as well.
2840 * class.cs (Method.Define): Add error CS1599 detection.
2842 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2844 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2846 * delegate.cs (Delegate.Define): Add error CS1599 detection.
2848 * support.cs.cs (ModifierDesc): New helper method.
2850 2005-02-23 Raja R Harinath <rharinath@novell.com>
2851 Abin Thomas <projectmonokochi@rediffmail.com>
2852 Anoob V E <projectmonokochi@rediffmail.com>
2853 Harilal P R <projectmonokochi@rediffmail.com>
2856 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2857 MemberLookup (used for error reporting) actually returns a result.
2858 Fix error report number (122, not 112).
2860 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
2861 Anoob V E <projectmonokochi@rediffmail.com>
2862 Harilal P R <projectmonokochi@rediffmail.com>
2865 * pending.cs (PendingImplementation.GetAbstractMethods):
2866 Find NonPublic members too.
2868 2005-02-22 Marek Safar <marek.safar@seznam.cz>
2870 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2873 * class.cs (MethodCore.CheckMethodAgainstBase):
2874 Add error 239 report.
2876 2005-02-21 Raja R Harinath <rharinath@novell.com>
2879 * expression.cs (Invocation.IsApplicable): Make public.
2880 (Invocation.IsParamsMethodApplicable): Likewise.
2881 * delegate.cs (Delegate.VerifyApplicability): Don't use
2882 Invocation.VerifyArgumentCompat for parameter applicability
2883 testing. Use Invocation.IsApplicable and
2884 Invocation.IsParamsMethodApplicable.
2886 2005-02-21 Marek Safar <marek.safar@seznam.cz>
2888 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2890 * class.cs (Operator.Define): Add error 217 report.
2892 2005-02-21 Raja R Harinath <rharinath@novell.com>
2894 * namespace.cs (UsingEntry.Resolve): Undo change below.
2896 2005-02-21 Raja R Harinath <rharinath@novell.com>
2899 * ecore.cs (Expression.MemberLookupFailed): Add argument to
2900 disable the error message when the extended MemberLookup also
2902 (Expression.MemberLookupFinal): Update.
2903 (SimpleName.DoSimpleNameResolve): Update.
2904 * expression.cs (MemberAccess.ResolveNamespaceOrType):
2905 Don't use MemberLookupFinal.
2906 (New.DoResolve): Update.
2907 (BaseAccess.CommonResolve): Update.
2909 2005-02-21 Raja R Harinath <rharinath@novell.com>
2912 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2913 occured previously, don't resolve again.
2915 2005-02-21 Marek Safar <marek.safar@seznam.cz>
2918 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2919 argument. Call ResolveAttributeUsage for unresolved.
2920 when types doesn't match ctor arguments.
2922 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2923 for nested attribute classes.
2924 (Class.attribute_usage): Removed.
2925 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2926 for attribute class.
2928 * ecore.cs (IsAttribute): Removed.
2930 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2932 * rootcontext.cs (RegisterAttribute): Removed, attributes are
2934 (attribute_types): Removed.
2935 (EmitCode): Global attributes are emited as the latest.
2937 2005-02-18 Marek Safar <marek.safar@seznam.cz>
2939 * class.cs (EmitFieldInitializers): Don't emit field initializer
2940 for default values when optimilization is on.
2942 * constant.cs (Constant.IsDefaultValue): New property.
2944 * driver.cs: Add /optimize handling.
2948 * literal.cs: Implement new IsDefaultValue property.
2950 * rootcontext.cs (Optimize): New field, holds /optimize option.
2952 2005-02-18 Raja R Harinath <rharinath@novell.com>
2954 Fix crasher in re-opened #72347.
2955 * namespace.cs (Namespace.Lookup): Return null if
2956 DeclSpace.DefineType returns null.
2959 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2961 2005-02-18 Raja R Harinath <rharinath@novell.com>
2963 Fix remainder of #63202. Change semantics of DoResolveLValue: it
2964 now returns null if it cannot resolve to an lvalue.
2965 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2966 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2967 returned null. Remove check for SimpleName.
2968 (EventExpr.DoResolveLValue): New.
2969 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2970 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
2972 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
2974 (Unary.ResolveOperator): Move CS0211 check ...
2975 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
2977 (Unary.DoResolveLValue): Simplify.
2978 (AddressOf.DoResolveLValue): New.
2979 (ArrayAccess.DoResolveLValue): New.
2981 2005-02-16 Marek Safar <marek.safar@seznam.cz>
2983 * attribute.cs (Attribute.Resolve): Add arguments casting for
2984 when types doesn't match ctor arguments.
2986 2005-02-16 Raja R Harinath <rharinath@novell.com>
2988 Fix parts of #63202.
2989 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2990 lookup of operator in base type. Ensure that all checks happen
2991 when the operator resolves to an "op_..." method.
2993 2005-02-15 Raja R Harinath <rharinath@novell.com>
2996 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2997 'ignore_cs0104' parameter. Pass it to ...
2998 (NamespaceEntry.Lookup): ... this.
2999 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3000 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3001 (TypeLookupExpression.DoResolveAsTypeStep): Update.
3002 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3003 Update. Request that cs0104 errors be ignored.
3004 (ComposedCast.ResolveAsTypeStep): Update.
3006 2005-02-14 Raja R Harinath <rharinath@novell.com>
3009 * expression.cs (Invocation.BetterFunction): Remove support for
3010 comparing virtual functions and their overrides.
3011 (Invocation.IsOverride): New.
3012 (Invocation.OverloadResolve): Don't consider 'override' functions
3013 during candidate selection. Store them in a lookaside list.
3014 If the selected method is a 'virtual' function, use the list to
3015 find any overrides that are closer to the LHS type.
3017 2005-02-14 Marek Safar <marek.safar@seznam.cz>
3019 * expression.cs (New.DoResolve): Add complex core type reduction.
3020 (New.Constantify): Converts complex core type syntax like 'new int ()'
3023 2005-02-14 Raja R Harinath <rharinath@novell.com>
3025 * decl.cs (EntryType.EntryType): New constructor to create an
3026 updated copy of a cache entry.
3027 (MemberCache.AddMethods): Use it.
3028 (MemberCache.ClearDeclaredOnly): Remove.
3029 (MemberCache.MemberCache): Update.
3031 2005-02-11 Miguel de Icaza <miguel@novell.com>
3033 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3034 variable. This one is represents the actual low-level declaration
3035 of the method, as opposed to the semantic level `IsStatic'.
3037 An anonymous method which is hosted into a static method might be
3038 actually an instance method. IsStatic would reflect the
3039 container, while MethodIsStatic represents the actual code
3042 * expression.cs (ParameterReference): Use the new MethodIsStatic
3043 instead of IsStatic.
3045 * anonymous.cs (AnonymousMethod.Compatible): Pass the
3046 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3047 set on the current EmitContext.
3049 * expression.cs (Cast): Overload DoResolveLValue so we can pass
3050 resolve our casted expression as an LValue. This triggers the
3051 proper LValue processing that is later required by Assign.
3055 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3057 2005-02-11 Marek Safar <marek.safar@seznam.cz>
3059 C# 2.0 Fixed buffer implementation
3061 * anonymous.cs: Update after RegisterHelperClass renaming.
3063 * attribute.cs (AttributeTester.fixed_buffer_cache):
3064 Cache of external fixed buffers.
3065 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3066 implementation if field is fixed buffer else null.
3069 (TypeContainer.AddField): Accept FieldMember instead of Field.
3070 (FieldBase.IsFieldClsCompliant): Extracted code from
3071 VerifyClsCompliance descendant customization.
3072 (FixedField): New class handles fixed buffer fields.
3073 (FixedFieldExternal): Keeps information about imported fixed
3075 (IFixedField): Make access to internal or external fixed buffer
3078 * cs-parser.jay: Add fixed buffer parsing.
3080 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3083 * expression.cs (Indirection): Extended implementation to accept
3085 (PointerArithmetic.Emit): Get element from fixed buffer as well.
3086 (ElementAccess.MakePointerAccess): Get type as parameter.
3087 (DoResolve): Add fixed buffer field expression conversion.
3088 (DoResolveLValue): Ditto.
3089 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3090 (ArrayPtr): Derives from FixedBufferPtr.
3091 (ArrayPtr.Emit): Add extra emit for array elements.
3093 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3095 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3096 for compiler generated types.
3097 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3099 * statement.cs (Fixed): Refactored to be easier add fixed buffer
3100 and consume less memory.
3101 (Fixed.Resolve): Add fixed buffer case.
3103 * typemanager.cs (compiler_generated_attr_ctor,
3104 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3105 (HasElementType): Add our own implementation to work on every
3108 2005-02-11 Miguel de Icaza <miguel@novell.com>
3110 * anonymous.cs (CaptureContext): Track whether `this' has been
3113 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
3114 only captured `this' if it was implicitly done (instance
3115 methods/variables were used).
3117 * codegen.cs (EmitContext.CaptureThis): New method to flag that
3118 `this' must be captured.
3120 2005-01-30 Miguel de Icaza <miguel@novell.com>
3122 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3123 is null it means that there has been no need to capture anything,
3124 so we just create a sibling.
3126 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3128 Just a partial fix. The other half is fairly elusive.
3130 2005-02-10 Raja R Harinath <rharinath@novell.com>
3132 Fix #52586, cs0121-4.cs.
3133 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
3134 and return a hashtable.
3135 (MemberCache.ClearDeclaredOnly): New.
3136 (MemberCache.MemberCache): Update to change. Make a deep copy of
3137 the method_hash of a base type too.
3138 (MemberCache.AddMethods): Adapt to having a deep copy of the base
3139 type methods. Overwrite entries with the same MethodHandle so
3140 that the ReflectedType is correct. The process leaves in base
3141 virtual functions and their overrides as distinct entries.
3142 (CacheEntry): Now a class instead of a struct. It shouldn't alter
3143 matters since it was boxed in a ArrayList before.
3144 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3146 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
3147 case of a virtual function and its override (choose the overload
3149 (Invocation.OverloadResolve): Avoid 'override' members during
3150 'applicable_type' calculation.
3152 2005-02-09 Raja R Harinath <rharinath@novell.com>
3154 Combine two near-redundant caches.
3155 * typemanager.cs (method_params): Rename from method_internal_params.
3156 (TypeManager.GetParameterData): New. Replace
3157 Invocation.GetParameterData.
3158 (TypeManager.LookupParametersByBuilder): Remove.
3159 * expression.cs (Invocation.method_parameter_cache): Remove.
3160 (Invocation.GetParameterData): Remove.
3162 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3165 2005-02-08 Raja R Harinath <rharinath@novell.com>
3168 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3169 TypeManager.multicast_delegate_type is null, resolve it by looking
3170 up "System.MulticastDelegate".
3171 * rootcontext.cs (RootContext.ResolveCore): Simplify.
3173 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
3174 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
3175 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
3178 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3179 (LabeledStatement.AddReference): New. Set 'referenced'.
3180 (Goto.Resolve): Use it.
3182 2005-02-05 John Luke <john.luke@gmail.com>
3184 * driver.cs: remove duplicate -doc line in Usage ()
3186 2005-02-04 Raja R Harinath <rharinath@novell.com>
3188 * location.cs (Location.AddFile): Fix CS2002 error report.
3190 2005-02-02 Martin Baulig <martin@ximian.com>
3192 * delegate.cs (Delegate.DefineType): Report an internal error if
3193 TypeManager.multicast_delegate_type is null. See bug #72015 for
3196 2005-02-02 Raja R Harinath <rharinath@novell.com>
3198 Fix a crasher in a variant of #31984.
3199 * const.cs (Constant.CheckBase): New override that defers the
3200 new-or-override check in case the base type hasn't been populated
3202 (Constant.Define): Ensure the new-or-override check is performed.
3204 2005-02-01 Duncan Mak <duncan@ximian.com>
3206 * const.cs (LookupConstantValue): Check that `ce' is not null
3207 before calling GetValue ().
3209 2005-02-01 Raja R Harinath <rharinath@novell.com>
3211 Fix test-334.cs (#69519).
3212 * cs-parser.jay (using_alias_directive): Pass in an expression to
3213 NamespaceEntry.UsingAlias.
3214 (using_namespace_directive): Pass in an expression to
3215 NamespaceEntry.Using.
3216 (namespace_name): Don't flatten to a string.
3217 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3218 (NamespaceEntry.AliasEntry.Resolve): Lookup using
3220 (NamespaceEntry.UsingEntry): Likewise.
3221 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3223 (NamespaceEntry.LookupForUsing): Remove.
3224 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3226 (NamespaceEntry.Lookup): Remove support for dotted names.
3228 2005-02-01 Raja R Harinath <rharinath@novell.com>
3230 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3232 (NamespaceEntry.ImplicitParent): Compute on demand.
3233 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3234 parallels the current.
3235 (NamespaceEntry.LookupForUsing): Use it.
3236 (NamespaceEntry.Lookup): If the current namespace-entry is
3237 implicit, don't search aliases and using tables.
3239 2005-02-01 Raja R Harinath <rharinath@novell.com>
3242 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3244 (TypeContainer.BaseCache): Compute on demand.
3245 (TypeContainer.FindMembers): Define constants and types if they're
3246 not already created.
3247 (FieldMember.Define): Move resetting of ec.InUnsafe before error
3249 * const.cs (Constant.Define): Make idempotent.
3251 2005-01-29 Miguel de Icaza <miguel@novell.com>
3253 * pending.cs: Produce better code (no nops produced by using Ldarg
3256 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3257 i - 1' it should be arg + 1.
3261 2005-01-28 Raja R Harinath <rharinath@novell.com>
3263 * attribute.cs (Attribute.CheckAttributeType): Make private
3265 (Attribute.ResolveType): Make virtual.
3266 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3267 handling of RootContext.Tree.Types.
3269 2005-01-27 Raja R Harinath <rharinath@novell.com>
3271 Update attribute-handling to use the SimpleName/MemberAccess
3273 * cs-parser.jay (attribute): Pass in an expression to the
3274 constructors of Attribute and GlobalAttribute.
3275 * attribute.cs (Attribute): Take an expression for the name.
3276 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
3277 passed in attribute name expression.
3278 (Attribute.CheckAttributeType): Use it.
3279 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3280 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3281 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
3282 argument to prevent error messages if the lookup fails.
3284 2005-01-27 Marek Safar <marek.safar@seznam.cz>
3286 * expression.cs (Indirection): Implemented IVariable interface
3287 to support indirection in AddressOf operator.
3288 (PointerArithmetic.Emit): Add optimalization for case where
3289 result can be precomputed.
3291 2005-01-26 Martin Baulig <martin@ximian.com>
3293 * class.cs (TypeContainer.AttributeTargets): Return the correct
3294 AttributeTargets depending on our `Kind' instead of throwing an
3295 exception; fixes #71632.
3297 2005-01-26 Marek Safar <marek.safar@seznam.cz>
3300 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3303 2005-01-25 Raja R Harinath <rharinath@novell.com>
3306 * expression.cs (MemberAccess.DoResolve): Don't complain with
3307 cs0572 when the LHS of a member access has identical name and type
3310 2005-01-25 Marek Safar <marek.safar@seznam.cz>
3313 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3315 Create custom PermissionSet only for PermissionSetAttribute.
3317 2005-01-24 Marek Safar <marek.safar@seznam.cz>
3320 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3321 delegates in static class.
3323 2005-01-24 Martin Baulig <martin@ximian.com>
3325 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3326 merging an implicit block, just use its reachability.
3328 * statement.cs (Block.Resolve): Make the unreachable code check
3329 work wrt. implicit blocks; see test-337 from #63842.
3331 2005-01-21 Alp Toker <alp@atoker.com>
3333 * cs-parser.jay: destructor_declaration's container is PartialContainer
3334 not Class when partial types are used, so use Kind prop instead of
3337 2005-01-22 Miguel de Icaza <miguel@ximian.com>
3339 * cs-parser.jay: Improve error reporting when an interface
3342 2005-01-20 Dick Porter <dick@ximian.com>
3344 * support.cs: SeekableStreamReader fix from Sandor Dobos
3345 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3346 chars are read. Fixes bug 70369.
3348 2005-01-20 Raja R Harinath <rharinath@novell.com>
3350 * cs-parser.jay (catch_clause): Simplify current_block handling
3353 2005-01-17 Miguel de Icaza <miguel@ximian.com>
3355 * convert.cs (ImplicitStandardConversionExists): Synchronize the
3356 code with ImplicitStandardConversion to handle the implicit
3357 conversion of method groups into valid delegate invocations.
3359 The problem is that in parameter handling we were using this code
3360 path. Fixes bug #64698
3362 2005-01-19 Raja R Harinath <rharinath@novell.com>
3364 * cs-parser.jay: Fix several infelicities.
3365 - Avoid assigning to the parser value stack. Code like
3366 '$3 = null' is unclean. Synthesize a value for the code block
3368 - Avoid using oob_stack for storing location information. Use ...
3369 (_mark_): ... this. New (empty) rule. Saves the current location
3371 (foreach_statement): Avoid using oob_stack for current_block
3372 handling. Use technique used in for_statement and
3373 using_statement. Synthesize a value for the code block to store
3374 additional intermediate information.
3376 2005-01-13 Miguel de Icaza <miguel@ximian.com>
3378 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3379 of a different type is only allowed to private fields of a
3380 containing type, not on fields of a base class.
3382 See test-174.cs and error cs0122-9.cs
3384 2005-01-13 Raja R Harinath <rharinath@novell.com>
3386 Fix test-335.cs (bug #58126).
3387 * cs-parser.jay (argument): Split out non-expression parts of the
3388 rule into 'non_simple_argument'.
3389 (invocation_expression): Support parenthesized invocations with
3390 multiple arguments, and with single non-simple arguments.
3392 2005-01-13 Raja R Harinath <rharinath@novell.com>
3394 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3397 2005-01-12 Raja R Harinath <rharinath@novell.com>
3399 Fix cs0038-1.cs, cs1640-6.cs.
3400 * ecore.cs (Expression.Resolve): Remove special-case for
3401 SimpleName in error-handling.
3402 (Expression.almostMatchedMembers): Relax access permission to
3404 (Expression.MemberLookupFailed): Handle duplicates in
3405 almostMatchedMembers list.
3406 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3407 * expression.cs (New.DoResolve): Report CS1540 for more cases.
3408 * typemanager.cs (GetFullNameSignature): Use the MethodBase
3409 overload if the passed in MemberInfo is a MethodBase.
3411 2005-01-12 Marek Safar <marek.safar@seznam.cz>
3414 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3415 for non-CAS & merge permission sets properly.
3417 2005-01-11 Raja R Harinath <rharinath@novell.com>
3419 Improve standard-compliance of simple name and member access
3420 resolution. Fixes bugs #52697, #57200, #67520, #69519.
3421 * ecore.cs (FullNamedExpression): New abstract base class
3422 for Namespaces and TypeExpressions.
3423 (ResolveFlags.SimpleName): Remove.
3424 (SimpleName): Remove support for dotted names.
3425 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
3426 DeclSpace.FindType and DeclSpace.LookupType.
3427 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3428 (Expression.ExprClassName): Make member function.
3429 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3430 a namespace. Remove creation of dotted "SimpleName"s.
3431 (MemberAccess.DoResolve): Likewise.
3432 * decl.cs (DeclSpace.Cache): Make private.
3433 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3434 (DeclSpace.FindType): Update.
3435 (DeclSpace.LookupType): Move here from RootContext. Return a
3436 FullNamedExpression.
3437 * namespace.cs (Namespace): Derive from FullNamedExpression
3438 so that it can be part of expression resolution.
3439 (Namespace.Lookup): Return an FullNamedExpression.
3440 (NamespaceEntry.LookupAlias): Lookup aliases only in current
3442 * rootcontext.cs (NamespaceLookup): Remove.
3443 (LookupType): Move to DeclSpace.
3444 * attribute.cs (CheckAttributeType): Update.
3445 * doc.cs (FindDocumentedType): Remove allowAlias argument.
3446 (FindDocumentedTypeNonArray): Likewise.
3448 2005-01-11 Raja R Harinath <rharinath@novell.com>
3450 Fix cs0509.cs, cs1632.cs.
3451 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3452 is the same as IsInterface.
3453 (TypeContainer.GetClassBases): Likewise.
3454 * statement.cs (LabeledStatement.ig): New field.
3455 (LabeledStatement.LabelTarget): Save ILGenerator which created the
3457 (LabeledStatement.DoEmit): Check that the label was created with
3458 the same ILGenerator.
3460 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3463 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3464 accessors to its properties.
3466 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3467 from accessors to property.
3469 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3472 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3475 2005-01-08 Miguel de Icaza <miguel@ximian.com>
3477 * attribute.cs: Check for null and empty strings.
3479 I have lost another battle to Paolo.
3481 2005-01-07 Marek Safar <marek.safar@seznam.cz>
3484 * class.cs (PropertyMethod): Set Parent field in ctors.
3485 (SetMethod.InternalParameters): Add unsafe switch hack.
3486 Override MarkForDuplicationCheck where it is appropriate.
3488 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3489 It says whether container allows members with the same name.
3491 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3492 Removed is_method parameter.
3494 2005-01-06 Duncan Mak <duncan@ximian.com>
3496 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3497 because the previous change led to incorrect reporting of CS1032
3498 ("Cannot define/undefine preprocessor symbols after first token in
3499 file"). Instead of using `tokens_seen' as the only flag that
3500 triggers CS1040, introduce `comments_seen'. This new flag is used
3501 to signify having seen comments on the current line, so it is
3502 unset after a newline.
3504 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
3506 * doc.cs : When searching for a type, find nested type too.
3507 This fixes bug #71040.
3509 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
3512 - Warn missing member comment on those classes which also does not
3513 have doc comments. Fixed bug #71041.
3514 - Don't warn missing doc comment on default constructor.
3517 2005-01-06 Duncan Mak <duncan@ximian.com>
3519 * cs-tokenizer.cs (xtoken): After handling traditional C-style
3520 comments, set `tokens_seen' to true. This allows us to detect
3521 misplaced preprocessor directives (i.e. not at the beginning of
3522 the a line, nor after whitespaces). In that case, report error
3523 CS1040. This fixes bug #56460.
3525 * cs-parser.jay (interface_member_declaration): Add checks for
3526 IsExplicitImpl, and report CS0541 error if an interface member is
3527 defined as an explicit interface declaration.
3529 2005-01-06 Marek Safar <marek.safar@seznam.cz>
3532 * class.cs (PropertyMethod): Set Parent field in ctors.
3533 (SetMethod.InternalParameters): Add unsafe switch hack.
3535 * decl.cs (MemberCore.Parent): Cannot be readonly.
3537 2005-01-06 Raja R Harinath <rharinath@novell.com>
3539 * decl.cs (DeclSpace.ResolveType): Remove.
3540 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3541 Merge in code from ...
3542 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
3543 * class.cs, enum.cs: Update to changes.
3545 2005-01-06 Miguel de Icaza <miguel@ximian.com>
3547 * anonymous.cs: Ensure that we init the scope of our parent if it
3548 has not been initialized yet.
3550 2004-12-30 Duncan Mak <duncan@ximian.com>
3552 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3553 if field.FieldBuilder is null. Fixes #70758.
3555 * convert.cs: Fixed some typos and updated some of the comments.
3556 (ImplicitStandardConversionExists):
3557 (TryImplicitIntConversion): If `target_type' is an interface and
3558 the type of `ic' implements this interface, return true or a new
3559 BoxedCast instead of null. This fixes #70468.
3561 2004-12-29 Duncan Mak <duncan@ximian.com>
3563 * expression.cs (Argument.Emit): Check that Expr is
3564 IMemoryLocation before casting to it, and report CS1510 otherwise.
3568 2004-12-21 Ben Maurer <bmaurer@ximian.com>
3570 * statement.cs (Block.ThisVariable): remove the recursion here, to
3571 make the --profile more sane.
3573 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
3575 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3576 assembly, by JB Evain.
3578 2004-12-17 Raja R Harinath <rharinath@novell.com>
3580 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
3581 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3582 "parent" refers to enclosing type/class. "base" refers to superclass.
3584 2004-12-17 Raja R Harinath <rharinath@novell.com>
3586 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3587 Ensure that we only have GlobalAttributes.
3588 * attribute.cs (Attribute.Emit): Make non-virtual.
3589 (GlobalAttribute.Emit): Remove.
3590 (Attribute.Resolve): Make virtual.
3591 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
3592 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3593 the argument. Don't create one.
3594 (Attribute.GetObsoleteAttribute): Likewise.
3595 (Attribute.GetClsCompliantAttributeValue): Likewise.
3596 * class.cs, decl.cs: Update to changes.
3598 2004-12-17 Marek Safar <marek.safar@seznam.cz>
3600 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3602 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3604 * statement.cs (Foreach.Resolve): Add error 186 report.
3606 2004-12-16 Marek Safar <marek.safar@seznam.cz>
3608 * expression.cs (Conditional.DoResolve): Add warning 429.
3610 * statement.cs (If.Resolve): Add warning 665.
3612 2004-12-16 Raja R Harinath <rharinath@novell.com>
3614 New invariant: RootContext.Tree.Types.NamespaceEntry == null
3615 except when in the parser, and in GlobalAttribute.
3616 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3617 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3618 RootContext.Tree.Types.NamespaceEntry once work is done.
3619 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
3620 and resets RootContext.Tree.Types.NamespaceEntry.
3622 2004-12-15 Marek Safar <marek.safar@seznam.cz>
3624 * cs-parser.jay: Don't create a block for every variable.
3626 2004-12-14 Miguel de Icaza <miguel@ximian.com>
3628 * location.cs: Provide extra information.
3630 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3631 variables from the captured environment, it is the ldarg_0.
3633 2004-12-14 Marek Safar <marek.safar@seznam.cz>
3635 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3638 * class.cs: Changed warning level for 169 to avoid developer
3639 displeasure from warning flooding. It will be changed back when they
3640 fix most of current BCL warnings.
3642 * RootContext.cs: Pushed default WarningLevel to 3.
3644 * statement.cs: Removed unused variable.
3646 2004-12-14 Marek Safar <marek.safar@seznam.cz>
3648 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3649 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3650 Add error 502 report.
3651 (StaticClass.DefineType): Add error 441 report.
3652 (Class.AllowedModifiersProp): New virtual property as temporary
3653 extension to AllowedModifiers.
3654 (Class.DefineType): Add error 418 report. Moved ModFlags check here
3655 to share implementation with StaticClass and don't call virtual
3658 * driver.cs (MainDriver): Add error 1558 test.
3660 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3661 report. Moved error 36 test here.
3663 * statement.cs (Throw.Resolve): Add error 724 report.
3665 * typemanager.cs: Add out_attribute_type core type.
3667 2004-12-13 Marek Safar <marek.safar@seznam.cz>
3669 * class.cs (TypeContainer.VerifyClsCompliance): Add error
3671 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3673 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3676 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3678 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
3679 Add error 3023 report.
3680 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3682 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3685 2004-12-12 John Luke <john.luke@gmail.com>
3687 * driver.cs (AddArgs): take -- into account when
3688 adding arguments, fixes bug 65710
3690 2004-12-12 Martin Baulig <martin@ximian.com>
3692 * expression.cs (Unary.TryReduceNegative): Added support for
3693 SByteConstant and ByteConstant.
3694 (Unary.Reduce): Check error values from TryReduceNegative().
3696 2004-12-10 Marek Safar <marek.safar@seznam.cz>
3698 * attributes.cs (Attribute.Resolve): Avoid multiple error report
3699 and report exception as error 182.
3701 2004-12-10 Raja R Harinath <rharinath@novell.com>
3703 * driver.cs (Main): Fix message when there are warnings.
3705 2004-12-09 Miguel de Icaza <miguel@ximian.com>
3707 * delegate.cs: Fixed my fix from yesterday, sorry about that.
3709 2004-12-09 Marek Safar <marek.safar@seznam.cz>
3711 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
3712 Reduced number of warnings.
3714 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3716 2004-12-08 Miguel de Icaza <miguel@ximian.com>
3718 * driver.cs: Removed message.
3720 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3722 2004-12-08 <vargaz@freemail.hu>
3724 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3726 2004-12-08 Martin Baulig <martin@ximian.com>
3728 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3729 instead of a CS3002 for properties and indexer.
3731 2004-12-08 Martin Baulig <martin@ximian.com>
3733 * decl.cs (MemberName.ToString): Make this work again.
3735 2004-12-08 Marek Safar <marek.safar@seznam.cz>
3737 * attribute.cs (Resolve): Add error 591 detection.
3739 * class.cs (FieldMember.Define): Add error 1547 detection.
3740 (Indexer.Define): Add error 620 detection.
3741 (Operator.Define): Add error 590 detection.
3743 * ecore.cs: Missing argument for error 79.
3745 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3748 2004-12-07 Marek Safar <marek.safar@seznam.cz>
3751 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3754 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
3756 * cs-parser.jay : handle doc comments on implicit/explicit operators.
3757 Some operator comments were suppressed.
3758 * doc.cs : Implicit/explicit operator name in doc comments are like
3759 "op_Explicit(type)~returnType", so added suffix handling.
3761 2004-12-07 Martin Baulig <martin@ximian.com>
3764 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3765 (MemberCore.GetClsCompliantAttributeValue): Likewise.
3766 (DeclSpace.ec): New protected field; store the EmitContext here.
3767 (DeclSpace.EmitContext): New public property; moved here from
3769 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3772 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3773 (Enum.Emit): Don't create a new EmitContext.
3775 * delegate.cs (Delegate.DefineType): Always create the
3778 * iterators.cs (Iterators.DefineIterator): Create a new
3779 EmitContext and store it in `ec'.
3781 2004-08-24 Martin Baulig <martin@ximian.com>
3784 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3785 this for accessibility checks.
3786 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3787 IsNestedFamilyAccessible.
3788 (TypeManager.IsSubclassOf): New method, do what the name actually
3791 2004-12-06 Raja R Harinath <rharinath@novell.com>
3793 Fix crash on cs0657-17.cs.
3794 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3795 Use RootContext.Tree.Types, not 'new RootTypes ()'.
3796 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3797 the case where the NamespaceEntry gets overwritten.
3799 2004-12-06 Marek Safar <marek.safar@seznam.cz>
3801 Fixed #69195, #56821
3802 * ecore.cs (ResolveBoolean): Tiny refactoring.
3804 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3805 of right expression resolving when left is false constant and
3806 operator is LogicalAnd OR true constant and operator is LogicalOr.
3808 * statement.cs (ResolveUnreachable): Always reports warning.
3810 2004-12-05 Miguel de Icaza <miguel@ximian.com>
3812 * class.cs: Distinguish between 1721 and 1722 (just a little help
3813 for the programmer).
3815 2004-12-03 Miguel de Icaza <miguel@ximian.com>
3817 * delegate.cs: Only allow this on new versions of the language.
3819 2004-12-02 Duncan Mak <duncan@ximian.com>
3821 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3823 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3824 here as a static method. Take an additional bool out parameter
3825 `must_do_cs1540_check' for signaling to InstanceResolve.
3826 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3827 member field from PropertyExpr class and made it an argument of
3829 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3830 check for MarshalByRefObject, and report CS0122 instead of CS1540.
3831 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3832 and `remove_accessor' as well as InstanceResolve: report CS0122
3837 2004-12-03 Raja R Harinath <rharinath@novell.com>
3839 Fix test-327.cs, test-328.cs, and put in early infrastructure
3840 for eventually fixing #52697.
3841 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3842 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3844 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3845 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3846 (VerifyUsing, error246): Update.
3847 * rootcontext.cs (RootContext.NamespaceLookup): Just use
3848 'NamespaceEntry.LookupNamespaceOrType'.
3850 2004-12-03 Martin Baulig <martin@ximian.com>
3852 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3853 method as our child, call AnonymousMethod.Compatible() on it.
3855 2004-12-03 Raja R Harinath <rharinath@novell.com>
3857 Disable XML documentation support in 'basic' profile.
3858 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3859 Redirect XmlElement to System.Object.
3860 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3861 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3862 * mcs.exe.sources: Add doc-bootstrap.cs.
3863 * doc-bootstrap.cs: New file. Contains empty stub implementation
3866 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
3868 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3869 comments are allowed.
3871 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3873 * delegate.cs: Add checks for subtypes in paramaters and return values
3874 in VerifyMethod () to add support for Covariance/Contravariance
3877 2004-12-02 Miguel de Icaza <miguel@ximian.com>
3879 * report.cs: Remove extra closing parenthesis.
3881 * convert.cs (Error_CannotImplicitConversion): If the name of the
3882 types are the same, provide some extra information.
3884 * class.cs (FieldBase): Use an unused bit field from the field to
3885 encode the `has_offset' property from the FieldMember. This saves
3886 a couple of Ks on bootstrap compilation.
3888 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3889 method as our child, return the AnonymousMethod resolved
3892 * expression.cs (New.DoResolve): Allow return values from
3893 NewDelegate to also include AnonymousMethods.
3897 2004-12-02 Marek Safar <marek.safar@seznam.cz>
3900 * attribute.cs (Resolve): Improved implementation of params
3901 attribute arguments.
3903 * support.cs (ParameterData): Add HasParams to be faster.
3905 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
3907 all things are for /doc support:
3909 * doc.cs: new file that supports XML documentation generation.
3910 * mcs.exe.sources: added doc.cs.
3912 Handle /doc command line option.
3913 Report error 2006 instead of 5 for missing file name for /doc.
3914 Generate XML documentation when required, after type resolution.
3916 Added support for picking up documentation (/// and /** ... */),
3917 including a new XmlCommentState enumeration.
3919 Added lines to fill Documentation element for field, constant,
3920 property, indexer, method, constructor, destructor, operator, event
3921 and class, struct, interface, delegate, enum.
3922 Added lines to warn incorrect comment.
3924 Added Documentation field (passed only when /doc was specified).
3926 Added DocComment, DocCommentHeader, GenerateDocComment() and
3927 OnGenerateDocComment() and some supporting private members for
3928 /doc feature to MemberCore.
3930 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3932 Added overriden DocCommentHeader.
3934 Added overriden DocCommentHeader and GenerateDocComment().
3936 2004-12-01 Miguel de Icaza <miguel@ximian.com>
3938 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3939 unwrapping the enumeration values, chain to
3940 DoConstantNumericPromotions again, so we can promote things to the
3941 fundamental types (takes care of enums that are bytes, sbytes).
3945 2004-12-01 Raja R Harinath <rharinath@novell.com>
3947 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3948 Fix long-standing bug in type-lookup. Use FindType instead of
3949 LookupType when ec.ResolvingTypeTree.
3950 (Attribute.ResolveType, Attribute.Resolve)
3951 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3953 (Attributes.Search): Remove internal version. Update.
3954 (Attributes.SearchMulti): Update.
3955 (Attributes.GetClsCompliantAttribute): Remove.
3956 (Attributes.GetIndexerNameAttribute): Remove.
3957 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3958 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3959 * class.cs (Indexer.Define): Likewise.
3961 2004-12-01 Marek Safar <marek.safar@seznam.cz>
3964 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3965 MarshallByReference members access.
3967 * expression.cs: Use CheckMarshallByRefAccess;
3968 Better error CS0197 message.
3970 * report.cs: Print whole related error message.
3972 2004-11-30 Raja R Harinath <rharinath@novell.com>
3974 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3975 the current directory to help debugging.
3977 2004-11-29 Marek Safar <marek.safar@seznam.cz>
3979 * class (GetClassBases): Better error 60 report.
3980 (EventProperty): Disabled warning 67 detection.
3982 2004-11-29 Marek Safar <marek.safar@seznam.cz>
3985 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3987 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3990 2004-11-29 Marek Safar <marek.safar@seznam.cz>
3993 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3995 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3997 2004-11-26 Miguel de Icaza <miguel@ximian.com>
3999 * attribute.cs (Attribute.Resolve): Refine error reporting and
4000 report a cs0117 if the identifier does not exist, to distinguish
4001 from 0617 which is a miss-use of the actual identifier.
4003 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4004 between cs0070 and cs0079.
4006 * class.cs (MemberBase.DoDefine): When reporting a wrong
4007 accessibility level, we use MethodCore to compare instead of
4008 Method (this was a regression in some refactoring effort).
4010 So now we correctly report cs0056 again.
4012 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4013 testing the target_type (which was known to be object_type) and
4014 not the source type (which is anonymous_method).
4016 Fixed reporting of error cs1660.
4018 * expression.cs (UserCast.Source): Expose the underlying cast.
4020 * statement.cs (Switch.SwitchGoverningType): Sort the list of
4021 allowed types to find a match to int32 first (most common).
4023 In addition, it ignores any ImplicitUserConversions that did an
4024 internal implicit conversion (as the switch statement allows only
4025 one integral conversion to exist).
4027 * class.cs (PartialContainer.Create): rename `name' to
4028 `member_name' for clarity. Then replace the string calls with a
4029 call to MemberName.GetPartialName, as now using
4030 MemberName.ToString is an error (this is due to the side effects
4031 it had, that were fixed in the past).
4033 This will restore the error reporting on a number of partial class
4034 errors that were missusing this (and getting an exception as a
4035 results, which is now just a plain textual warning, because
4036 yyparse debug output would crash otherwise).
4038 2004-11-26 Raja R Harinath <rharinath@novell.com>
4040 * Makefile (PROGRAM_INSTALL_DIR): Remove.
4042 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4044 * rootcontext.cs (LookupType): Make sure to cache lookups that
4045 don't give us a negative result. This saves about 5% of corlib
4048 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4050 * report.cs (AbstractMessage.Print): messages are sent to stderr
4052 * class.cs (TypeContainer.GetClassBases): It is an error to have a
4053 non-interface in the list of interfaces (at this point, either
4054 parent was properly set, or a base class is being listed in the
4055 interfaces section).
4057 This flags error 1722, and resolves the crash from bug 69259.
4059 2004-11-25 Ben Maurer <bmaurer@ximian.com>
4061 * statement.cs (Using.EmitExpressionFinally): make this work right
4062 for valuetypes. Fixes 69926.
4064 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4066 * const.cs (Const.ChangeType): Cope with the "0 literal can be
4067 converted to an enum" here, before we try to change the underlying
4068 type. This code exists, but it is a different code path than the
4069 one used while encoding constants.
4071 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4072 old bug: when converting from the null literal to a pointer,
4073 return an EmptyCast, not the NullLiteral.
4075 This fixes #69921, the recent null_type changes probably made this
4078 (ImplicitReferenceConversionExists): In addition, resynchronized
4079 the code here, so it matches the same code in
4080 ImplicitReferenceConversionExists for the `from any class-type S
4081 to any interface-type T'.
4084 2004-11-25 Marek Safar <marek.safar@seznam.cz>
4086 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4088 2004-11-24 Miguel de Icaza <miguel@ximian.com>
4090 * cs-parser.jay: Use verbosity accordingly.
4092 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4094 * expression.cs (Unary.ResolveOperator): Do not report warning;
4095 AddressOf reads from variable.
4097 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4099 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4103 * attribute.cs (Attributable): Removed CheckTargets.
4104 (Attributes.Emit): Explicit attribute targets are tested here.
4106 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4107 not enabled for interfaces.
4109 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4110 (GetAssemblyName): Ouch next bug there.
4112 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4114 * expression.cs: Error 275 added.
4116 2004-11-23 Marek Safar <marek.safar@seznam.cz>
4118 Fix bug #69177 (Implemented decimal constant support)
4120 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4121 (BinaryFold): Add DecimalConstant.
4123 * const.cs (Define): Decimal constant
4125 (ChangeType): Add decimal type handling.
4126 (LookupConstantValue): Don't set value for decimal type but
4127 emit DecimalConstantAttribute. Needed for constant optimization.
4129 * constant.cs (ToDecimal): New method.
4130 (ConvertToDecimal): New method.
4131 (IntConstant): Implemented ConvertToDecimal.
4132 (DecimalConstant.Emit): Emit optimized version for decimals in
4135 * expression.cs (ResolveOperator): Changed order of constant
4136 reduction to work correctly with native types which have
4137 overloaded operators.
4138 (ResolveMemberAccess): Extract constant value from attribute
4141 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4143 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4144 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4145 (ChangeType): Decimal is special.
4146 (TypeToCoreType): Add decimal type.
4148 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4150 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4153 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4155 * class.cs (EventField.ApplyAttributeBuilder): Fix error
4158 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4160 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4162 * pending.cs (PendingImplementation): Grab only interfaces.
4164 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4166 * statement.cs (ForeachHelperMethods): Add location member and
4167 error 202 detection.
4169 2004-11-19 Raja R Harinath <rharinath@novell.com>
4171 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
4172 automatically handled by executable.make.
4173 (PROGRAM): Make profile-specific.
4175 2004-11-18 Marek Safar <marek.safar@seznam.cz>
4177 * expression.cs (DoResolveBase): Fixed wrong warning for out
4180 2004-11-18 Martin Baulig <martin@ximian.com>
4182 Merged latest changes into gmcs. Please keep this comment in
4183 here, it makes it easier for me to see what changed in MCS since
4184 the last time I merged.
4186 2004-11-17 Raja R Harinath <rharinath@novell.com>
4188 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4189 (TypeHandle.GetMemberCache): New.
4190 (TypeHandle.TypeHandle): Update.
4191 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4192 (TypeManager.LookupParentInterfacesCache):
4193 Rename from LookupInterfaceCache. Optimize slightly.
4194 (TypeManager.MemberLookup_FindMembers): Update.
4195 * decl.cs (MemberCache.MemberCache): Set Container to null in the
4197 (AddCacheContents): Rename from AddHashtable.
4198 * class.cs (TypeContainer.parent_container): Remove.
4199 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4200 (TypeContainer.DoDefineMembers): Don't initialize it.
4201 Update to name changes.
4203 2004-11-17 Miguel de Icaza <miguel@ximian.com>
4205 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4206 that factors the code to check access modifiers on override.
4208 (PropertyBase): Use the code here.
4210 Patch from Lluis S'anchez, fixes bug #69361.
4212 2004-11-15 Miguel de Icaza <miguel@ximian.com>
4214 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4215 routine that is used to report the use of a captured variable
4216 whose address has been taken.
4218 There are two checks: one when variables are being captured and
4219 the other check is when the address of a variable is taken.
4221 (because an anonymous methods might be resolved before *or* after
4222 the address has been taken) and
4224 * expression.cs (Conditional.DoResolve): Remove the special
4225 casing that Martin added to trueExpr and falseExpr being both
4226 NullLiteral. We get the right behavior now just by introducing
4227 the null_type into the compiler.
4229 * convert.cs (ExplicitConversion): Change the code to use
4230 null_type instead of testing `expr is NullLiteral'.
4231 (ImplicitConversionStandard): use null_type too.
4232 (ImplicitReferenceConversionExists): use null_type too.
4233 (ImplicitReferenceConversion): use null_type too.
4235 * literal.cs: The type of `NullLiteral' is now null_type instead
4237 (Resolve): Set the type here.
4239 * typemanager.cs: Introduce null_type.
4241 2004-11-17 Martin Baulig <martin@ximian.com>
4243 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4244 direction, like FindMembers() does. Fixes #69546, testcase is in
4247 2004-11-16 Martin Baulig <martin@ximian.com>
4249 This is based on a patch from Marek Safar, see bug #69082.
4250 Fixes bugs #63705 and #67130.
4252 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4253 method; create a MemberCache for an interface type and cache the
4256 * decl.cs (IMemberContainer.ParentContainer): Removed.
4257 (IMemberContainer.ParentCache): New property.
4258 (MemberCache.SetupCacheForInterface): Removed.
4259 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4260 to create a cache for an interface's "parent".
4262 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4265 2004-11-16 Martin Baulig <martin@ximian.com>
4267 Merged back from gmcs; these changes already went into gmcs a
4268 couple of weeks ago.
4271 (TypeManager.AddUserType): Removed the `ifaces' argument.
4272 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4274 (TypeManager.AddUserInterface): Removed.
4275 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4277 (TypeManager.GetInterfaces): Likewise.
4278 (TypeManager.GetExplicitInterfaces): Likewise.
4280 * ecore.cs (TypeExpr.GetInterfaces): Removed.
4282 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4283 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4285 2004-11-14 Ben Maurer <bmaurer@ximian.com>
4287 * statement.cs: Avoid adding bools to a hashtable.
4289 2004-11-07 Miguel de Icaza <miguel@ximian.com>
4291 * expression.cs (Invocation.OverloadResolve): Flag error if we are
4292 calling an unsafe method from a safe location.
4294 2004-11-06 Marek Safar <marek.safar@seznam.cz>
4297 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4299 2004-11-06 Miguel de Icaza <miguel@ximian.com>
4301 * namespace.cs (VerifyUsing): use GetPartialName instead of
4304 2004-11-05 Miguel de Icaza <miguel@ximian.com>
4306 * statement.cs (Return.Resolve): Fix regression in typo: if
4307 `in_exc', we have to request a NeedReturnLabel, this was a typo
4308 introduced in the anonymous method check-in. Fixes #69131.
4310 * Indexers were using the ShortName when defining themselves,
4311 causing a regression in the compiler bootstrap when applying the
4312 patch from 2004-11-02 (first part), now they use their full name
4313 and the bug is gone.
4315 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
4317 * driver.cs: Strip the path from the names of embedded resources. Fixes
4320 2004-11-04 Raja R Harinath <rharinath@novell.com>
4322 Fix error message regression: cs0104-2.cs.
4323 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4324 (AliasEntry.Resolve): Update.
4325 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
4327 (RootContext.LookupType): Update.
4329 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
4331 * cs-parser.jay: Add support for handling accessor modifiers
4332 * class: Add support port accessor modifiers and error checking,
4333 define PropertyMethod.Define as virtual (not abstract anymore)
4334 * ecore.cs: Add checking for proeprties access with access modifiers
4335 * iterators.cs: Modify Accessor constructor call based in the modified
4337 2004-11-02 Ben Maurer <bmaurer@ximian.com>
4339 * expression.cs (StringConcat): Handle being called twice,
4340 as when we have a concat in a field init with more than two
4343 2004-11-02 Miguel de Icaza <miguel@ximian.com>
4345 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4346 special case explicit implementations, we should always produce
4347 the .property or .event declaration.
4349 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4350 since it will not return correct data if people use this
4351 unresolved in the presence of using statements (see test-313).
4353 * class.cs (MethodData.Define): If we are an explicit interface
4354 implementation, set the method name to the full name of the
4355 interface plus the name of the method.
4357 Notice that using the method.MethodName.GetFullName() does not
4358 work, as it will only contain the name as declared on the source
4359 file (it can be a shorthand in the presence of using statements)
4360 and not the fully qualifed type name, for example:
4364 class D : ICloneable {
4365 object ICloneable.Clone () {
4369 Would produce a method called `ICloneable.Clone' instead of
4370 `System.ICloneable.Clone'.
4372 * namespace.cs (Alias.Resolve): Use GetPartialName.
4374 2004-11-01 Marek Safar <marek.safar@seznam.cz>
4376 * cs-parser.jay: Add error 1055 report.
4378 2004-11-01 Miguel de Icaza <miguel@ximian.com>
4380 * assign.cs (Assign.DoResolve): Only do the transform of
4381 assignment into a New if the types are compatible, if not, fall
4382 through and let the implicit code deal with the errors and with
4383 the necessary conversions.
4385 2004-11-01 Marek Safar <marek.safar@seznam.cz>
4387 * cs-parser.jay: Add error 1031 report.
4389 * cs-tokenizer.cs: Add location for error 1038.
4391 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4393 * cs-parser.jay: Add error 1016 report.
4395 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4397 * cs-parser.jay: Add errors 1575,1611 report.
4399 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4401 * cs-parser.jay: Add error 1001 report.
4403 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4406 * attribute.cs (GetMarshal): Add method argument for
4407 caller identification.
4409 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4410 agument for GetMarshal and RuntimeMissingSupport.
4412 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4414 * attribute.cs (ExtractSecurityPermissionSet): Removed
4415 TypeManager.code_access_permission_type.
4417 * typemanager.cs: Removed TypeManager.code_access_permission_type.
4419 2004-10-27 Miguel de Icaza <miguel@ximian.com>
4421 * expression.cs (LocalVariableReference.DoResolveLValue): Check
4422 for obsolete use of a variable here. Fixes regression on errors
4423 cs0619-25 and cs0619-26.
4425 2004-10-27 Marek Safar <marek.safar@seznam.cz>
4427 Fix #62358, implemented security attribute encoding.
4429 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4430 Tests permitted SecurityAction for assembly or other types.
4431 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4432 data from SecurityPermissionAttribute to PermisionSet class.
4434 * class.cs (ApplyAttributeBuilder): Added special handling
4435 for System.Security.Permissions.SecurityAttribute based types.
4437 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4438 special handling for System.Security.Permissions.SecurityAttribute
4441 * enum.cs (ApplyAttributeBuilder): Added special handling
4442 for System.Security.Permissions.SecurityAttribute based types.
4444 * parameter.cs (ApplyAttributeBuilder): Added special handling
4445 for System.Security.Permissions.SecurityAttribute based types.
4447 * rootcontext.cs: Next 2 core types.
4449 * typemanager.cs (TypeManager.security_permission_attr_type):
4450 Built in type for the SecurityPermission Attribute.
4451 (code_access_permission_type): Build in type.
4453 2004-10-17 Miguel de Icaza <miguel@ximian.com>
4455 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4456 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4457 all of this information into
4458 EmitContext.EmitCapturedVariableInstance.
4460 * codegen.cs (EmitCapturedVariableInstance): move here the
4461 funcionality of emitting an ldarg.0 in the presence of a
4462 remapping. This centralizes the instance emit code.
4464 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4465 then emit a load of this: it means that we have reached the
4466 topmost ScopeInfo: the one that contains the pointer to the
4467 instance of the class hosting the anonymous method.
4469 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4470 captures to the topmost CaptureContext.
4472 2004-10-12 Miguel de Icaza <miguel@ximian.com>
4474 * expression.cs (LocalVariableReference): Move the knowledge about
4475 the iterators into codegen's EmitCapturedVariableInstance.
4477 2004-10-11 Miguel de Icaza <miguel@ximian.com>
4479 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4480 all code paths return a value from an anonymous method (it is the
4481 same as the 161 error, but for anonymous methods).
4483 2004-10-08 Miguel de Icaza <miguel@ximian.com>
4485 The introduction of anonymous methods in the compiler changed
4486 various ways of doing things in the compiler. The most
4487 significant one is the hard split between the resolution phase
4488 and the emission phases of the compiler.
4490 For instance, routines that referenced local variables no
4491 longer can safely create temporary variables during the
4492 resolution phase: they must do so from the emission phase,
4493 since the variable might have been "captured", hence access to
4494 it can not be done with the local-variable operations from the runtime.
4498 (Block.Flags): New flag `IsTopLevel' to indicate that this block
4499 is a toplevel block.
4501 (ToplevelBlock): A new kind of Block, these are the blocks that
4502 are created by the parser for all toplevel method bodies. These
4503 include methods, accessors and anonymous methods.
4505 These contain some extra information not found in regular blocks:
4506 A pointer to an optional CaptureContext (for tracking captured
4507 local variables and parameters). A pointer to the parent
4510 (Return.Resolve): Catch missmatches when returning a value from an
4511 anonymous method (error 1662).
4512 Invoke NeedReturnLabel from the Resolve phase instead of the emit
4515 (Break.Resolve): ditto.
4517 (SwitchLabel): instead of defining the labels during the
4518 resolution phase, we now turned the public ILLabel and ILLabelCode
4519 labels into methods called GetILLabelCode() and GetILLabel() that
4520 only define the label during the Emit phase.
4522 (GotoCase): Track the SwitchLabel instead of the computed label
4523 (its contained therein). Emit the code by using
4524 SwitchLabel.GetILLabelCode ().
4526 (LocalInfo.Flags.Captured): A new flag has been introduce to track
4527 whether the Local has been captured or not.
4529 (LocalInfo.IsCaptured): New property, used to tell whether the
4530 local has been captured.
4532 * anonymous.cs: Vastly updated to contain the anonymous method
4535 The main classes here are: CaptureContext which tracks any
4536 captured information for a toplevel block and ScopeInfo used to
4537 track the activation frames for various local variables.
4539 Each toplevel block has an optional capture context associated
4540 with it. When a method contains an anonymous method both the
4541 toplevel method and the anonymous method will create a capture
4542 context. When variables or parameters are captured, they are
4543 recorded on the CaptureContext that owns them, for example:
4547 MyDelegate d = delegate {
4552 Here `a' will be recorded as captured on the toplevel
4553 CapturedContext, the inner captured context will not have anything
4554 (it will only have data if local variables or parameters from it
4555 are captured in a nested anonymous method.
4557 The ScopeInfo is used to track the activation frames for local
4558 variables, for example:
4560 for (int i = 0; i < 10; i++)
4561 for (int j = 0; j < 10; j++){
4562 MyDelegate d = delegate {
4567 At runtime this captures a single captured variable `i', but it
4568 captures 10 different versions of the variable `j'. The variable
4569 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4570 recorded on a child.
4572 The toplevel ScopeInfo will also track information like the `this'
4573 pointer if instance variables were referenced (this is necessary
4574 as the anonymous method lives inside a nested class in the host
4575 type of the method).
4577 (AnonymousMethod): Expanded to track the Toplevel, implement
4578 `AnonymousMethod.Compatible' to tell whether an anonymous method
4579 can be converted to a target delegate type.
4581 The routine now also produces the anonymous method content
4583 (AnonymousDelegate): A helper class that derives from
4584 DelegateCreation, this is used to generate the code necessary to
4585 produce the delegate for the anonymous method that was created.
4587 * assign.cs: API adjustments for new changes in
4588 Convert.ImplicitStandardConversionExists.
4590 * class.cs: Adjustments to cope with the fact that now toplevel
4591 blocks are of type `ToplevelBlock'.
4593 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4594 insteda of standard blocks.
4596 Flag errors if params arguments are passed to anonymous methods.
4598 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4599 `CurrentAnonymousMethod' which points to the current Anonymous
4600 Method. The variable points to the AnonymousMethod class that
4601 holds the code being compiled. It is set in the new EmitContext
4602 created for the anonymous method.
4604 (EmitContext.Phase): Introduce a variable and an enumeration to
4605 assist in enforcing some rules about when and where we are allowed
4606 to invoke certain methods (EmitContext.NeedsReturnLabel is the
4607 only one that enfonces this right now).
4609 (EmitContext.HaveCaptureInfo): new helper method that returns
4610 whether we have a CapturedContext initialized.
4612 (EmitContext.CaptureVariable): New method used to register that a
4613 LocalInfo must be flagged for capturing.
4615 (EmitContext.CapturedParameter): New method used to register that a
4616 parameters must be flagged for capturing.
4618 (EmitContext.CapturedField): New method used to register that a
4619 field must be flagged for capturing.
4621 (EmitContext.HaveCapturedVariables,
4622 EmitContext.HaveCapturedFields): Return whether there are captured
4623 variables or fields.
4625 (EmitContext.EmitMethodHostInstance): This is used to emit the
4626 instance for the anonymous method. The instance might be null
4627 (static methods), this (for anonymous methods that capture nothing
4628 and happen to live side-by-side with the current method body) or a
4629 more complicated expression if the method has a CaptureContext.
4631 (EmitContext.EmitTopBlock): Routine that drives the emission of
4632 code: it will first resolve the top block, then emit any metadata
4633 and then emit the code. The split is done so that we can extract
4634 any anonymous methods and flag any captured variables/parameters.
4636 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4637 during this phase, the ILGenerator should not be used as labels
4638 and local variables declared here might not be accessible to any
4639 code that is part of an anonymous method.
4641 Exceptions to this include the temporary variables that are
4642 created by some statements internally for holding temporary
4645 (EmitContext.EmitMeta): New routine, in charge of emitting all the
4648 (EmitContext.TemporaryReturn): This method is typically called
4649 from the Emit phase, and its the only place where we allow the
4650 ReturnLabel to be defined other than the EmitMeta. The reason is
4651 that otherwise we would have to duplicate a lot of logic in the
4652 Resolve phases of various methods that today is on the Emit
4655 (EmitContext.NeedReturnLabel): This no longer creates the label,
4656 as the ILGenerator is not valid during the resolve phase.
4658 (EmitContext.EmitThis): Extended the knowledge in this class to
4659 work in anonymous methods in addition to iterators.
4661 (EmitContext.EmitCapturedVariableInstance): This emits whatever
4662 code is necessary on the stack to access the instance to a local
4663 variable (the variable will be accessed as a field).
4665 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4666 EmitContext.EmitAddressOfParameter): Routines to support
4667 parameters (not completed at this point).
4669 Removals: Removed RemapLocal and RemapLocalLValue. We probably
4670 will also remove the parameters.
4672 * convert.cs (Convert): Define a `ConstantEC' which points to a
4673 null. This is just to prefity some code that uses
4674 ImplicitStandardConversion code and do not have an EmitContext
4677 The idea is to flag explicitly that at that point in time, it is
4678 known that the conversion will not trigger the delegate checking
4679 code in implicit conversions (which requires a valid
4682 Everywhere: pass new EmitContext parameter since
4683 ImplicitStandardConversionExists now requires it to check for
4684 anonymous method conversions.
4686 (Convert.ImplicitStandardConversionExists): If the type of an
4687 expression is the anonymous_method_type, and the type is a
4688 delegate, we invoke the AnonymousMethod.Compatible method to check
4689 whether an implicit conversion is possible.
4691 (Convert.ImplicitConversionStandard): Only do implicit method
4692 group conversions if the language level is not ISO_1.
4694 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4695 MethodInfo for the Invoke method. used by Delegate and
4698 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4699 method conversions if the target type is a delegate.
4701 Removed extra debugging nops.
4703 (LocalVariableReference): Turn the `local_info' into a public
4706 Add `prepared' field, the same hack used for FieldExprs to cope
4707 with composed assignments, as Local variables do not necessarily
4708 operate purely on the stack as they used to: they can be captured
4711 Add `temp' for a temporary result, like fields.
4713 Refactor DoResolve and DoResolveLValue into DoResolveBase.
4715 It now copes with Local variables that are captured and emits the
4716 proper instance variable to load it from a field in the captured
4719 (ParameterReference.DoResolveBase): During the resolve phase,
4720 capture parameters if we are in an anonymous method.
4722 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4723 anonymous method, use the EmitContext helper routines to emit the
4724 parameter reference.
4726 * iterators.cs: Set RemapToProxy to true/false during the
4729 * parameters.cs (GetParameterByName): New helper method.
4731 * typemanager.cs (anonymous_method_type) a new type that
4732 represents an anonyous method. This is always an internal type,
4733 used as a fencepost to test against the anonymous-methodness of an
4736 2004-10-20 Marek Safar <marek.safar@seznam.cz>
4738 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4740 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4742 2004-10-18 Martin Baulig <martin@ximian.com>
4744 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4745 `Type' directly, but call ResolveType() on it.
4746 (Catch.Resolve): Likewise.
4747 (Foreach.Resolve): Likewise.
4749 2004-10-18 Martin Baulig <martin@ximian.com>
4751 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4752 `Type' directly, but call ResolveType() on it.
4753 (Probe.DoResolve): Likewise.
4754 (ArrayCreation.LookupType): Likewise.
4755 (TypeOf.DoResolve): Likewise.
4756 (SizeOf.DoResolve): Likewise.
4758 2004-10-18 Martin Baulig <martin@ximian.com>
4760 * expression.cs (Invocation.BetterFunction): Put back
4761 TypeManager.TypeToCoreType().
4763 2004-10-18 Raja R Harinath <rharinath@novell.com>
4765 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4768 2004-10-18 Martin Baulig <martin@ximian.com>
4770 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
4771 `Type' directly, but call ResolveType() on it.
4773 2004-10-18 Martin Baulig <martin@ximian.com>
4775 * class.cs (FieldMember.Define): Don't access the TypeExpr's
4776 `Type' directly, but call ResolveType() on it.
4777 (MemberBase.DoDefine): Likewise.
4779 * expression.cs (New.DoResolve): Don't access the TypeExpr's
4780 `Type' directly, but call ResolveType() on it.
4781 (ComposedCast.DoResolveAsTypeStep): Likewise.
4783 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4784 `Type' directly, but call ResolveType() on it.
4786 2004-10-17 John Luke <john.luke@gmail.com>
4788 * class.cs (Operator.GetSignatureForError): use CSharpName
4790 * parameter.cs (Parameter.GetSignatureForError): Returns
4791 correct name even if was not defined.
4793 2004-10-13 Raja R Harinath <rharinath@novell.com>
4796 * class.cs (TypeContainer.EmitContext): New property.
4797 (DefineNestedTypes): Create an emitcontext for each part.
4798 (MethodCore.DoDefineParameters): Use container's emitcontext.
4799 Pass type array to InternalParameters.
4800 (MemberBase.DoDefine): Use container's emitcontext.
4801 (FieldMember.Define): Likewise.
4802 (Event.Define): Likewise.
4803 (SetMethod.GetParameterInfo): Change argument to EmitContext.
4804 Pass type array to InternalParameters.
4805 (SetIndexerMethod.GetParameterInfo): Likewise.
4806 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4807 * delegate.cs (Define): Pass emitcontext to
4808 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
4809 array to InternalParameters.
4810 * expression.cs (ParameterReference.DoResolveBase): Pass
4811 emitcontext to GetParameterInfo.
4812 (ComposedCast.DoResolveAsTypeStep): Remove check on
4813 ec.ResolvingTypeTree.
4814 * parameter.cs (Parameter.Resolve): Change argument to
4815 EmitContext. Use ResolveAsTypeTerminal.
4816 (Parameter.GetSignature): Change argument to EmitContext.
4817 (Parameters.ComputeSignature): Likewise.
4818 (Parameters.ComputeParameterTypes): Likewise.
4819 (Parameters.GetParameterInfo): Likewise.
4820 (Parameters.ComputeAndDefineParameterTypes): Likewise.
4821 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
4822 * support.cs (InternalParameters..ctor): Remove variant that takes
4824 * typemanager.cs (system_intptr_expr): New.
4825 (InitExpressionTypes): Initialize it.
4827 2004-10-12 Chris Toshok <toshok@ximian.com>
4829 * cs-parser.jay: fix location for try_statement and catch_clause.
4831 2004-10-11 Martin Baulig <martin@ximian.com>
4833 * report.cs: Don't make --fatal abort on warnings, we have
4834 -warnaserror for that.
4836 2004-10-07 Raja R Harinath <rharinath@novell.com>
4838 More DeclSpace.ResolveType avoidance.
4839 * decl.cs (MemberCore.InUnsafe): New property.
4840 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
4841 with newly created EmitContext.
4842 (FieldMember.Define): Likewise.
4843 * delegate.cs (Delegate.Define): Likewise.
4844 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4845 only if normal name-lookup fails.
4846 (TypeExpr.DoResolve): Enable error-checking.
4847 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4848 (SizeOf.DoResolve): Likewise.
4849 (ComposedCast.DoResolveAsTypeStep): Likewise.
4850 (StackAlloc.DoResolve): Likewise.
4851 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4852 (Block.Unsafe): New property.
4853 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4854 (Unsafe): Set 'unsafe' flag of contained block.
4855 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4856 (Fixed.Resolve): Likewise.
4857 (Catch.Resolve): Likewise.
4858 (Using.ResolveLocalVariableDecls): Likewise.
4859 (Foreach.Resolve): Likewise.
4861 2004-10-05 John Luke <john.luke@gmail.com>
4863 * cs-parser.jay: add location to error CS0175
4865 2004-10-04 Miguel de Icaza <miguel@ximian.com>
4867 * ecore.cs (Expression.Constantity): Add support for turning null
4870 * const.cs (Const.Define): Allow constants to be reference types
4871 as long as the value is Null.
4873 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
4875 * namespace.cs (NamespaceEntry.Using): No matter which warning
4876 level is set, check if this namespace name has already been added.
4878 2004-10-03 Ben Maurer <bmaurer@ximian.com>
4880 * expression.cs: reftype [!=]= null should always use br[true,false].
4883 2004-10-03 Marek Safar <marek.safar@seznam.cz>
4886 * attribute.cs: Enum conversion moved to
4887 GetAttributeArgumentExpression to be applied to the all
4890 2004-10-01 Raja R Harinath <rharinath@novell.com>
4892 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4893 * class.c (TypeContainer.DefineType): Flag error if
4894 base types aren't accessible due to access permissions.
4895 * decl.cs (DeclSpace.ResolveType): Move logic to
4896 Expression.ResolveAsTypeTerminal.
4897 (DeclSpace.ResolveTypeExpr): Thin layer over
4898 Expression.ResolveAsTypeTerminal.
4899 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4900 Refactor code into NestedAccess. Use it.
4901 (DeclSpace.NestedAccess): New.
4902 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4903 argument to silence errors. Check access permissions.
4904 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4905 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4906 (Cast.DoResolve): Likewise.
4907 (New.DoResolve): Likewise.
4908 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4909 (TypeOf.DoResolve): Likewise.
4911 * expression.cs (Invocation.BetterConversion): Return the Type of
4912 the better conversion. Implement section 14.4.2.3 more faithfully.
4913 (Invocation.BetterFunction): Make boolean. Make correspondence to
4914 section 14.4.2.2 explicit.
4915 (Invocation.OverloadResolve): Update.
4916 (Invocation): Remove is_base field.
4917 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
4918 (Invocation.Emit): Likewise.
4920 2004-09-27 Raja R Harinath <rharinath@novell.com>
4922 * README: Update to changes.
4924 2004-09-24 Marek Safar <marek.safar@seznam.cz>
4926 * cs-parser.jay: Reverted 642 warning fix.
4928 2004-09-23 Marek Safar <marek.safar@seznam.cz>
4931 * decl.cs (FindMemberWithSameName): Indexer can have more than
4934 2004-09-23 Marek Safar <marek.safar@seznam.cz>
4936 * expression.cs (LocalVariableReference.DoResolveLValue):
4937 Do not report warning 219 for out values.
4938 (EmptyExpression.Null): New member to avoid extra allocations.
4940 2004-09-23 Marek Safar <marek.safar@seznam.cz>
4942 * cs-parser.jay: Fix wrong warning 642 report.
4944 * cs-tokenizer.cs (CheckNextToken): New helper;
4945 Inspect next character if is same as expected.
4947 2004-09-23 Martin Baulig <martin@ximian.com>
4949 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4950 (Convert.ImplicitReferenceConversionExists): Likewise.
4952 2004-09-23 Marek Safar <marek.safar@seznam.cz>
4954 * class.cs (Operator.Define): Add error 448 and 559 report.
4956 2004-09-22 Marek Safar <marek.safar@seznam.cz>
4958 * class.cs (MemberBase.IsTypePermitted): New protected
4959 method for checking error CS0610.
4961 2004-09-22 Marek Safar <marek.safar@seznam.cz>
4963 * class.cs (TypeContainer.HasExplicitLayout): New property
4964 Returns whether container has StructLayout attribute set Explicit.
4965 (FieldMember): New abstract class for consts and fields.
4966 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4967 (Field): Reuse FieldMember.
4969 * const.cs (Const): Reuse FieldMember.
4971 * rootcontext.cs: EmitConstants call moved to class.
4973 2004-09-22 Martin Baulig <martin@ximian.com>
4975 Thanks to Peter Sestoft for this bug report.
4977 * expression.cs (Conditional): If both the `trueExpr' and the
4978 `falseExpr' is a NullLiteral, return a NullLiteral.
4980 2004-09-22 Martin Baulig <martin@ximian.com>
4982 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4983 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4984 for the "get_Current" call.
4986 2004-09-22 Martin Baulig <martin@ximian.com>
4988 Marek and me just fixed one of our oldest bugs: #28562 :-)
4990 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4992 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4993 we're an EnumConstant, just return that.
4994 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4995 an EnumConstant. In this case, we need to use GetValueAsEnumType()
4996 to get the value which'll actually be written into the attribute.
4997 However, we have to use GetValue() to access the attribute's value
5000 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5002 * constant.cs (Constant.IsNegative): New abstract property
5005 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5006 (StackAlloc.DoResolve): Reused IsNegative.
5008 2004-09-21 Martin Baulig <martin@ximian.com>
5010 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5011 if we're used in an iterator, we may be called from different
5014 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5015 we actually have an exception block.
5017 2004-09-20 John Luke <jluke@cfl.rr.com>
5019 * class.cs, cs-parser.jay: Improve the error report for 1520:
5020 report the actual line where the error happens, not where the
5023 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5024 Pass location information that was available elsewhere.
5026 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
5028 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5029 runtime to delay sign assemblies.
5031 2004-09-19 Miguel de Icaza <miguel@ximian.com>
5033 * cs-parser.jay: Do not report the stack trace, this is barely
5036 2004-08-22 John Luke <john.luke@gmail.com>
5038 * driver.cs : check that a resource id is not already used
5039 before adding it, report CS1508 if it is, bug #63637
5041 2004-09-19 Miguel de Icaza <miguel@ximian.com>
5043 * ecore.cs: Removed dead code.
5045 2004-09-18 Marek Safar <marek.safar@seznam.cz>
5047 * class.cs: Do not report warning CS0067 on the interfaces.
5049 2004-09-16 Marek Safar <marek.safar@seznam.cz>
5051 * cs-parser.jay: Add error 504 report.
5053 2004-09-16 Marek Safar <marek.safar@seznam.cz>
5055 * rootcontext.cs: WarningLevel is 4 by default now.
5057 * statement.cs (Fixed.Resolve): Do not null
5060 2004-09-16 Marek Safar <marek.safar@seznam.cz>
5063 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5064 deep search when property is not virtual.
5065 (PropertyExpr.ResolveAccessors): Make one call for both
5068 2004-09-15 Marek Safar <marek.safar@seznam.cz>
5071 * statement.cs: Error 152 report constains also location.
5073 2004-09-15 Marek Safar <marek.safar@seznam.cz>
5076 * const.cs: Explicitly set constant as static.
5078 2004-09-15 Marek Safar <marek.safar@seznam.cz>
5081 * cs-parser.jay: Add error 1017 report.
5083 2004-09-15 Marek Safar <marek.safar@seznam.cz>
5085 Fixed bug #59980, #64224
5086 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5088 * typemanager.cs (IsSpecialMethod): Simplified
5090 2004-09-14 Marek Safar <marek.safar@seznam.cz>
5092 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5093 condition with better params.
5095 2004-09-14 Marek Safar <marek.safar@seznam.cz>
5098 * attribute.cs (Resolve): Property has to have both
5101 2004-09-14 Martin Baulig <martin@ximian.com>
5103 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5105 2004-09-14 Marek Safar <marek.safar@seznam.cz>
5108 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5109 called and is obsolete then this member suppress message
5110 when call is inside next [Obsolete] method or type.
5112 * expression.cs: Use TestObsoleteMethodUsage member.
5114 2004-09-14 Martin Baulig <martin@ximian.com>
5116 * cs-parser.jay: Sync a bit with the GMCS version.
5118 2004-09-14 Martin Baulig <martin@ximian.com>
5120 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5121 (CSharpParser.yacc_verbose_flag): New public field.
5123 * genericparser.cs: Removed.
5125 2004-09-14 Raja R Harinath <rharinath@novell.com>
5127 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5129 2004-09-13 Marek Safar <marek.safar@seznam.cz>
5131 * class.cs (MethodCore.CheckBase): Fix bug #65757.
5133 2004-09-10 Martin Baulig <martin@ximian.com>
5135 Backported my MemberName changes from GMCS into MCS.
5137 - we are now using a special `MemberName' class instead of using
5138 strings; in GMCS, the `MemberName' also contains the type
5141 - changed the grammar rules a bit:
5142 * the old `member_name' is now a `namespace_or_type_name':
5143 The rule is that we use `namespace_or_type_name' everywhere
5144 where we expect either a "member name" (GetEnumerator) or a
5145 "member name" with an explicit interface name
5146 (IEnumerable.GetEnumerator).
5147 In GMCS, the explicit interface name may include type arguments
5148 (IEnumerable<T>.GetEnumerator).
5149 * we use `member_name' instead of just `IDENTIFIER' for
5151 The rule is that we use `member_name' wherever a member may
5152 have type parameters in GMCS.
5154 * decl.cs (MemberName): New public class.
5155 (MemberCore.MemberName): New public readonly field.
5156 (MemberCore.ctor): Take a `MemberName' argument, not a string.
5157 (DeclSpace): Likewise.
5159 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5160 * enum.cs (Enum.ctor): Likewise.
5162 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5164 (AliasEntry.ctor): Take a MemberName, not an Expression.
5165 (AliasEntry.UsingAlias): Likewise.
5167 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5168 (IMethodData.MemberName): Changed type from string to MemberName.
5169 (MemberBase.ExplicitInterfaceName): Likewise.
5170 (AbstractPropertyEventMethod.SetupName): Make this private.
5171 (AbstractPropertyEventMethod.ctor): Added `string prefix'
5172 argument; compute the member name here.
5173 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5174 on the `member.MemberName' and the `prefix'.
5176 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5178 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5179 thus, we get a `MemberName' instead of a `string'. These
5180 declarations may have type parameters in GMCS.
5181 (interface_method_declaration, delegate_declaration): Likewise.
5182 (class_declaration, interface_declaration): Likewise.
5183 (method_header): Use `namespace_or_type_name' instead of
5184 `member_name'. We may be an explicit interface implementation.
5185 (property_declaration, event_declaration): Likewise.
5186 (member_name): This is now just an `IDENTIFIER', not a
5187 `namespace_or_type_name'.
5188 (type_name, interface_type): Removed.
5189 (namespace_or_type_name): Return a MemberName, not an Expression.
5190 (primary_expression): Use `member_name' instead of `IDENTIFIER';
5191 call GetTypeExpression() on the MemberName to get an expression.
5192 (IndexerDeclaration.interface_type): Changed type from string to
5194 (MakeName): Operate on MemberName's instead of string's.
5196 2004-09-13 Raja R Harinath <rharinath@novell.com>
5199 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5200 (NamespaceEntry.Lookup): Add new argument to flag if we want the
5201 lookup to avoid symbols introduced by 'using'.
5202 * rootcontext.cs (NamespaceLookup): Update.
5204 2004-09-12 Marek Safar <marek.safar@seznam.cz>
5206 * class.cs (TypeContainer.DoDefineMembers): Do not call
5207 DefineDefaultConstructor for static classes.
5209 2004-09-12 Marek Safar <marek.safar@seznam.cz>
5211 * attribute.cs (Attribute.Resolve): Add error 653 report.
5213 * class.cs (Class.ApplyAttributeBuilder): Add error 641
5215 (Method.ApplyAttributeBuilder): Add error 685 report.
5216 (Operator.Define): Add error 564 report.
5218 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5220 * expression.cs (Invocation.DoResolve): Add error
5223 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5226 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5228 * class.cs (ConstructorInitializer.Resolve):
5229 Wrong error number (515->516).
5231 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5233 * class.cs (Indexer.Define): Add error 631 report.
5235 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5237 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5239 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5241 * expression.cs (Probe.DoResolve): Add error CS0241 report.
5243 2004-09-10 Marek Safar <marek.safar@seznam.cz>
5245 * cs-parser.jay: Added error CS0241 report.
5247 2004-09-10 Raja R Harinath <rharinath@novell.com>
5249 * cs-parser.jay (fixed_statement): Introduce a scope for the
5250 declaration in the 'fixed' statement.
5252 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5254 * cs-parser.jay: Added CS0230 error report.
5256 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5258 * cs-parser.jay: Added errors CS0231 and CS0257 report.
5260 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5262 * expression.cs (Argument.Resolve): Added error CS0192 and
5265 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5267 C# 2.0 #pragma warning feature
5269 * cs-tokenizer.cs (PreProcessPragma): New method;
5270 Handles #pragma directive.
5272 * report.cs (WarningRegions): New class; Support
5273 class for #pragma warning directive. It tests whether
5274 warning is enabled for a given line.
5276 2004-09-08 Miguel de Icaza <miguel@ximian.com>
5278 * const.cs: Add more descriptive error report, tahnks to
5281 2004-09-08 Marek Safar <marek.safar@seznam.cz>
5283 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5285 2004-09-07 Miguel de Icaza <miguel@ximian.com>
5287 * expression.cs: Apply patch from Ben: Remove dead code from
5288 ArrayCreation, and remove the TurnintoConstant call in const.cs,
5289 as that code just threw an exception anwyays.
5291 * const.cs: Remove the call to the turnintoconstant, for details
5294 * literal.cs: The type of the null-literal is the null type; So
5295 we use a placeholder type (literal.cs:System.Null, defined here)
5298 * expression.cs (Conditional.DoResolve): Remove some old code that
5299 is no longer needed, conversions have been fixed.
5301 (ArrayCreationExpression.DoResolve): Return false if we fail to
5302 resolve the inner expression.
5304 2004-09-07 Raja R Harinath <rharinath@novell.com>
5307 * cs-parser.jay (delegate_declaration): Record a delegate
5308 declaration as a type declaration.
5309 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5311 2004-09-06 Miguel de Icaza <miguel@ximian.com>
5313 * parameter.cs: Do not crash if the type can not be resolved.
5315 * expression.cs: Report errors with unsafe pointers, fixes #64896
5317 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
5319 * expression.cs: Pointer arith always needs to do a conv.i
5320 if the operand is a long. fix 65320
5322 2004-09-04 Marek Safar <marek.safar@seznam.cz>
5324 Fixed cs0619-37.cs, cs0619-38.cs
5326 * enum.cs (GetObsoleteAttribute): Removed.
5328 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5329 on Enum member is double staged. The first is tested member
5332 2004-09-04 Marek Safar <marek.safar@seznam.cz>
5334 Fixed #56986, #63631, #65231
5336 * class.cs: (TypeContainer.AddToMemberContainer): New method,
5337 adds member to name container.
5338 (TypeContainer.AddToTypeContainer): New method, adds type to
5340 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5341 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5342 AddOperator): Simplified by reusing AddToMemberContainer.
5343 (TypeContainer.UserDefinedStaticConstructor): Changed to property
5345 (Method.CheckForDuplications): Fixed implementation to test all
5347 (MemberBase): Detection whether member is explicit interface
5348 implementation is now in constructor.
5349 (MemberBase.UpdateMemberName): Handles IndexerName.
5350 (Accessor): Changed to keep also location information.
5351 (AbstractPropertyEventMethod): Is derived from MemberCore.
5352 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5353 will be emited or not.
5354 (PropertyBase.AreAccessorsDuplicateImplementation):
5355 Tests whether accessors are not in collision with some method.
5356 (Operator): Is derived from MethodCore to simplify common
5359 * decl.cs (Flags.TestMethodDuplication): Test for duplication
5361 (DeclSpace.AddToContainer): Adds the member to defined_names
5362 table. It tests for duplications and enclosing name conflicts.
5364 * enum.cs (EnumMember): Clean up to reuse the base structures
5366 2004-09-03 Martin Baulig <martin@ximian.com>
5368 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5369 into TypeContainer, to make partial classes work again.
5371 2004-09-03 Martin Baulig <martin@ximian.com>
5373 * rootcontext.cs (RootContext.V2): Removed.
5375 2004-03-23 Martin Baulig <martin@ximian.com>
5377 * expression.cs (Invocation.OverloadResolve): Added `bool
5378 may_fail' argument and use it instead of the Location.IsNull() hack.
5380 2004-09-03 Martin Baulig <martin@ximian.com>
5382 Merged latest changes into gmcs. Please keep this comment in
5383 here, it makes it easier for me to see what changed in MCS since
5384 the last time I merged.
5386 2004-09-03 Raja R Harinath <rharinath@novell.com>
5389 * expression.cs (BetterConversion): Don't allow either conversion
5390 to be null. Remove redundant implicit conversion test when 'q ==
5391 null' -- when this function is invoked, we already know that the
5392 implicit conversion exists.
5393 (BetterFunction): Assume that 'best' is non-null. Remove
5394 redundant reimplementation of IsApplicable when 'best' is null.
5395 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5396 number of arguments.
5397 (IsAncestralType): Extract from OverloadResolve.
5398 (OverloadResolve): Make robust to the MethodGroupExpr being
5399 unsorted. Implement all the logic of Section 14.5.5.1, and
5400 support overloading of methods from multiple applicable types.
5401 Clean up logic somewhat. Don't pass null methods to BetterFunction.
5403 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5404 (RealError, Warning): Append type of report to related symbol.
5406 2004-09-03 Marek Safar <marek.safar@seznam.cz>
5408 * enum.cs: Fixed CLS-Compliance checks for enum members.
5409 Error tests cs3008-8.cs, cs3014-8.cs
5411 2004-09-02 Marek Safar <marek.safar@seznam.cz>
5413 Fixed bug #62342, #63102
5414 * class.cs: ImplementIndexer uses member.IsExplicitImpl
5415 like ImplementMethod.
5417 2004-09-02 Marek Safar <marek.safar@seznam.cz>
5419 * attribute.cs (Attribute.GetAttributeArgumentExpression):
5422 2004-09-02 Martin Baulig <martin@ximian.com>
5424 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5425 TypeManager.GetArgumentTypes() rather than calling GetParameters()
5428 2004-09-01 Marek Safar <marek.safar@seznam.cz>
5430 C# 2.0 Static classes implemented
5432 * class.cs (TypeContainer): instance_constructors,
5433 initialized_fields, initialized_static_fields,
5434 default_constructor, base_inteface_types are protected to be
5435 accessible from StaticClass.
5436 (TypeContainer.DefineDefaultConstructor): New virtual method
5437 for custom default constructor generating
5438 (StaticClass): New class to handle "Static classes" feature.
5440 * cs-parser.jay: Handle static keyword on class like instance
5443 * driver.cs: Added "/langversion" command line switch with two
5444 options (iso-1, default).
5446 2004-08-31 Marek Safar <marek.safar@seznam.cz>
5448 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5450 2004-08-31 Miguel de Icaza <miguel@ximian.com>
5452 * delegate.cs: Style.
5454 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
5456 * delegate.cs: Add seperate instance expr field for miguel.
5458 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
5460 * PointerArithmetic (Resolve): make sure we are not doing
5461 pointer arith on void*. Also, make sure we are resolved
5462 by not setting eclass until resolve.
5464 All callers: Make sure that PointerArithmetic gets resolved.
5466 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
5468 * ArrayCreation (LookupType): If the type does not resolve
5469 to an array, give an error.
5471 2004-08-27 Marek Safar <marek.safar@seznam.cz>
5473 * statement.cs (Try.Resolve): Fixed bug #64222
5475 2004-08-27 Martin Baulig <martin@ximian.com>
5478 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5481 2004-08-26 Marek Safar <marek.safar@seznam.cz>
5483 * ecore.cs (Constantify): Get underlying type via
5484 System.Enum.GetUnderlyingType to avoid StackOverflow on the
5485 Windows in special cases.
5487 2004-08-26 Marek Safar <marek.safar@seznam.cz>
5489 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5490 for obtaining also private methods.
5491 (GetRemoveMethod): Used GetRemoveMethod (true)
5492 for obtaining also private methods.
5494 2004-08-24 Martin Baulig <martin@ximian.com>
5496 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5497 MethodAttributes.HideBySig for operators.
5499 2004-08-23 Martin Baulig <martin@ximian.com>
5501 Back to the old error reporting system :-)
5503 * report.cs (Message): Removed.
5504 (Report.MessageData, ErrorData, WarningData): Removed.
5505 (Report.Error, Warning): Back to the old system.
5507 2004-08-23 Martin Baulig <martin@ximian.com>
5509 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5511 * class.cs (TypeContainer.ParentContainer): New public virtual
5512 method; replaces the explicit interface implementation.
5513 (ClassPart.ParentContainer): Override.
5515 2004-08-23 Martin Baulig <martin@ximian.com>
5517 * statement.cs (Switch): Added support for constant switches; see
5518 #59428 or test-285.cs.
5520 2004-08-22 Marek Safar <marek.safar@seznam.cz>
5523 * statement.cs (GetEnumeratorFilter): Removed useless
5524 logic because C# specs is strict. GetEnumerator must be
5527 2004-08-22 Martin Baulig <martin@ximian.com>
5529 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5530 a switch and may break, reset the barrier. Fixes #59867.
5532 2004-08-22 Marek Safar <marek.safar@seznam.cz>
5534 CLS-Compliance speed up (~5% for corlib)
5536 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5537 New method. Tests container for CLS-Compliant names
5539 * class.cs (TypeContainer.VerifyClsName): New method.
5540 Checks whether container name is CLS Compliant.
5541 (Constructor): Implements IMethodData.
5543 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5544 low-case table for CLS Compliance test.
5545 (MemberCache.VerifyClsParameterConflict): New method.
5546 Checks method parameters for CS3006 error.
5548 * enum.cs (EnumMember): Is derived from MemberCore.
5549 (Enum.VerifyClsName): Optimized for better performance.
5551 2004-08-06 Marek Safar <marek.safar@seznam.cz>
5553 * report.cs: Renamed Error_T to Error and changed all
5556 2004-08-06 Marek Safar <marek.safar@seznam.cz>
5558 * class.cs (TypeContainer.IndexerArrayList): New inner class
5559 container for indexers.
5560 (TypeContainer.DefaultIndexerName): New constant for default
5561 indexer name. Replaced all "Item" with this constant.
5562 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5564 * typemanager.cs (TypeManager.default_member_ctor): Cache here
5565 DefaultMemberAttribute constructor.
5567 2004-08-05 Martin Baulig <martin@ximian.com>
5569 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5572 2004-08-05 Marek Safar <marek.safar@seznam.cz>
5574 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5575 multi platforms problem.
5577 * compiler.csproj: Included shared files.
5579 2004-08-04 Marek Safar <marek.safar@seznam.cz>
5581 Fix bug 60333, 55971 in the more general way
5582 * attribute.cs (Attribute.GetAttributeArgumentExpression):
5583 Added arg_type argument for constant conversion.
5584 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5586 2004-08-04 Marek Safar <marek.safar@seznam.cz>
5589 * class.cs (TypeContainer ): New inner classes MethodArrayList,
5590 OperatorArrayList, MethodCoreArrayList for typecontainer
5591 containers. Changed class member types to these new types.
5592 (MethodArrayList.DefineMembers): Added test for CS0659.
5594 2004-08-04 Miguel de Icaza <miguel@ximian.com>
5596 * cfold.cs: Synchronize the folding with the code in expression.cs
5597 Binary.DoNumericPromotions for uint operands.
5599 * attribute.cs: Revert patch from Raja, it introduced a regression
5600 while building Blam-1.2.1 (hard to isolate a test case).
5602 2004-08-04 Marek Safar <marek.safar@seznam.cz>
5606 (TypeContainer.Define): Renamed to DefineContainerMembers because of
5608 (MethodCore.parent_method): New member. The method we're overriding
5609 if this is an override method.
5610 (MethodCore.CheckBase): Moved from Method class and made common.
5611 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5613 (MethodCore.CheckForDuplications): New abstract method. For custom
5614 member duplication search in a container
5615 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5616 method and its return type.
5617 (Event.conflict_symbol): New member. Symbol with same name in the
5621 (MemberCache.FindMemberWithSameName): New method. The method
5622 is looking for conflict with inherited symbols.
5624 2004-08-04 Martin Baulig <martin@ximian.com>
5626 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5628 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5630 2004-08-03 Marek Safar <marek.safar@seznam.cz>
5632 * report.cs (Message): New enum for better error, warning reference in
5634 (MessageData): New inner abstract class. It generally handles printing of
5635 error and warning messages.
5636 Removed unused Error, Warning, Message methods.
5638 2004-08-03 Marek Safar <marek.safar@seznam.cz>
5640 Fix for cs0592-8.cs test
5642 (Attributable.ValidAttributeTargets): Made public.
5643 (Attribute.ExplicitTarget): New member for explicit target value.
5644 (Attribute.CheckTargets): Now we translate explicit attribute
5645 target to Target here.
5647 2004-08-03 Ben Maurer <bmaurer@ximian.com>
5649 * ecore.cs (MethodGroupExpr): new IsBase property.
5651 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5653 * delegate.cs (DelegateCreation): store a MethodGroupExpr
5654 rather than an instance expr.
5656 (DelegateCreation.Emit): Use the method group rather than
5657 the instance expression. Also, if you have base.Foo as the
5658 method for a delegate, make sure to emit ldftn, not ldftnvirt.
5660 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
5662 (NewDelegate.DoResolve): Only check for the existance of Invoke
5663 if the method is going to be needed. Use MethodGroupExpr.
5665 (NewDelegate.Emit): Remove, DelegateCreation implements this.
5667 * expression.cs: For pointer arith., make sure to use
5668 the size of the type, not the size of the pointer to
5671 2004-08-03 Marek Safar <marek.safar@seznam.cz>
5674 * class.cs (Class): Added error CS0502 test.
5676 2004-08-03 John Luke <jluke@cfl.rr.com>
5677 Raja R Harinath <rharinath@novell.com>
5680 * attribute.cs (Attribute.complained_before): New flag.
5681 (Attribute.ResolveType, Attribute.Resolve),
5682 (Attribute.DefinePInvokeMethod): Set it.
5683 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5685 2004-08-03 Martin Baulig <martin@ximian.com>
5687 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5688 use a user-defined operator; we still need to do numeric
5689 promotions in case one argument is a builtin type and the other
5690 one has an implicit conversion to that type. Fixes #62322.
5692 2004-08-02 Martin Baulig <martin@ximian.com>
5694 * statement.cs (LocalInfo.Flags): Added `IsThis'.
5695 (LocalInfo.IsThis): New public property.
5696 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5698 2004-08-01 Martin Baulig <martin@ximian.com>
5700 * class.cs (TypeContainer.GetClassBases): Don't set the default
5701 here since we may get called from GetPartialBases().
5702 (TypeContainer.DefineType): If GetClassBases() didn't return a
5703 parent, use the default one.
5705 2004-07-30 Duncan Mak <duncan@ximian.com>
5707 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5709 2004-07-30 Martin Baulig <martin@ximian.com>
5711 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5713 * class.cs (SourceMethod): New public class, derive from the
5714 symbol writer's ISourceMethod.
5715 (Method): Use the new symbol writer API.
5717 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5718 as argument and use the new symbol writer.
5721 (SourceFile): Implement the symbol writer's ISourceFile.
5722 (Location.SymbolDocument): Removed.
5723 (Location.SourceFile): New public property.
5725 * symbolwriter.cs: Use the new symbol writer API.
5727 2004-07-30 Raja R Harinath <rharinath@novell.com>
5729 * Makefile (install-local): Remove. Functionality moved to
5732 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
5734 * Makefile: Install mcs.exe.config file together with mcs.exe.
5735 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5736 correct runtime version.
5738 2004-07-25 Martin Baulig <martin@ximian.com>
5741 (TypeContainer.RegisterOrder): Removed, this was unused.
5742 (TypeContainer, interface_order): Removed.
5743 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5744 TypeContainer as argument since we can also be called with a
5745 `PartialContainer' for a partial class/struct/interface.
5746 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5747 of checking whether we're an `Interface' - we could be a
5749 (PartialContainer.Register): Override; call
5750 AddClass()/AddStruct()/AddInterface() on our parent.
5752 * cs-parser.jay (interface_member_declaration): Add things to the
5753 `current_container', not the `current_class'.
5755 * rootcontext.cs (RegisterOrder): The overloaded version which
5756 takes an `Interface' was unused, removed.
5758 * typemanager.cs (TypeManager.LookupInterface): Return a
5759 `TypeContainer', not an `Interface'.
5760 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5761 contain a `PartialContainer' for an interface, so check it's
5762 `Kind' to figure out what it is.
5764 2004-07-25 Martin Baulig <martin@ximian.com>
5766 * class.cs (Class.DefaultTypeAttributes): New public constant.
5767 (Struct.DefaultTypeAttributes): Likewise.
5768 (Interface.DefaultTypeAttributes): Likewise.
5769 (PartialContainer.TypeAttr): Override this and add the
5770 DefaultTypeAttributes.
5772 2004-07-25 Martin Baulig <martin@ximian.com>
5774 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5775 we can just use the `Parent' field instead.
5777 2004-07-25 Martin Baulig <martin@ximian.com>
5779 * class.cs (TypeContainer.Emit): Renamed to EmitType().
5781 2004-07-25 Martin Baulig <martin@ximian.com>
5783 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5784 our parts before defining any methods.
5785 (TypeContainer.VerifyImplements): Make this virtual.
5786 (ClassPart.VerifyImplements): Override and call VerifyImplements()
5787 on our PartialContainer.
5789 2004-07-25 Martin Baulig <martin@ximian.com>
5791 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5793 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5794 argument, we can just use the `Parent' field instead.
5797 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
5798 (MemberBase.DoDefine): Likewise.
5800 2004-07-24 Martin Baulig <martin@ximian.com>
5802 * decl.cs (MemberCore.Parent): New public field.
5803 (DeclSpace.Parent): Moved to MemberCore.
5805 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5806 (MemberBase.ctor): Added TypeContainer argument, pass it to our
5808 (FieldBase, Field, Operator): Likewise.
5809 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5810 (EventField, Event): Likewise.
5812 2004-07-23 Martin Baulig <martin@ximian.com>
5814 * class.cs (PartialContainer): New public class.
5815 (ClassPart): New public class.
5816 (TypeContainer): Added support for partial classes.
5817 (TypeContainer.GetClassBases): Splitted some of the functionality
5818 out into GetNormalBases() and GetPartialBases().
5820 * cs-tokenizer.cs (Token.PARTIAL): New token.
5821 (Tokenizer.consume_identifier): Added some hacks to recognize
5822 `partial', but only if it's immediately followed by `class',
5823 `struct' or `interface'.
5825 * cs-parser.jay: Added support for partial clases.
5827 2004-07-23 Martin Baulig <martin@ximian.com>
5829 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5830 a `DeclSpace' and also made it readonly.
5831 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5832 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5833 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5835 * cs-parser.jay: Pass the `current_class', not the
5836 `current_container' (at the moment, this is still the same thing)
5837 to a new Method, Property, Event, Indexer or Constructor.
5839 2004-07-23 Martin Baulig <martin@ximian.com>
5841 * cs-parser.jay (CSharpParser): Added a new `current_class' field
5842 and removed the `current_interface' one.
5843 (struct_declaration, class_declaration, interface_declaration):
5844 Set `current_class' to the newly created class/struct/interface;
5845 set their `Bases' and call Register() before parsing their body.
5847 2004-07-23 Martin Baulig <martin@ximian.com>
5849 * class.cs (Kind): New public enum.
5850 (TypeContainer): Made this class abstract.
5851 (TypeContainer.Kind): New public readonly field.
5852 (TypeContainer.CheckDef): New public method; moved here from
5854 (TypeContainer.Register): New public abstract method.
5855 (TypeContainer.GetPendingImplementations): New public abstract
5857 (TypeContainer.GetClassBases): Removed the `is_class' and
5858 `is_iface' parameters.
5859 (TypeContainer.DefineNestedTypes): Formerly known as
5861 (ClassOrStruct): Made this class abstract.
5863 * tree.cs (RootTypes): New public type.
5865 2004-07-20 Martin Baulig <martin@ximian.com>
5867 * tree.cs (Tree.RecordNamespace): Removed.
5868 (Tree.Namespaces): Removed.
5870 * rootcontext.cs (RootContext.IsNamespace): Removed.
5872 * cs-parser.jay (namespace_declaration): Just create a new
5873 NamespaceEntry here.
5875 2004-07-20 Martin Baulig <martin@ximian.com>
5877 * statement.cs (ExceptionStatement): New abstract class. This is
5878 now used as a base class for everyone who's using `finally'.
5879 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5880 our local variables before using them.
5882 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5883 virtual method. This is used by Yield.Resolve() to "steal" an
5884 outer block's `finally' clauses.
5885 (FlowBranchingException): The .ctor now takes an ExceptionStatement
5888 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5889 version which takes an ExceptionStatement. This version must be
5890 used to create exception branchings.
5893 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5894 (Iterator.EmitMoveNext): Added exception support; protect the
5895 block with a `fault' clause, properly handle 'finally' clauses.
5896 (Iterator.EmitDispose): Run all the `finally' clauses here.
5898 2004-07-20 Martin Baulig <martin@ximian.com>
5900 * iterator.cs: This is the first of a set of changes in the
5901 iterator code. Match the spec more closely: if we're an
5902 IEnumerable, then GetEnumerator() must be called. The first time
5903 GetEnumerator() is called, it returns the current instance; all
5904 subsequent invocations (if any) must create a copy.
5906 2004-07-19 Miguel de Icaza <miguel@ximian.com>
5908 * expression.cs: Resolve the constant expression before returning
5911 2004-07-19 Martin Baulig <martin@ximian.com>
5913 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5914 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5915 the return type of the new EmitContext.
5917 2004-07-18 Martin Baulig <martin@ximian.com>
5919 * class.cs (Property.Define): Fix iterators.
5921 * iterators.cs (Iterator.Define): Moved the
5922 `container.AddInterator (this)' call here from the .ctor; only do
5923 it if we resolved successfully.
5925 2004-07-17 Miguel de Icaza <miguel@ximian.com>
5927 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5928 `true' for preprocessing directives that we parse. The return
5929 value indicates whether we should return to regular tokenizing or
5930 not, not whether it was parsed successfully.
5932 In the past if we were in: #if false ... #line #endif, we would
5933 resume parsing after `#line'. See bug 61604.
5935 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5936 building: IsEnumType should return true only for enums, not for
5937 enums or System.Enum itself. This fixes #61593.
5939 Likely what happened is that corlib was wrong: mcs depended on
5940 this bug in some places. The bug got fixed, we had to add the
5941 hack, which caused bug 61593.
5943 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5944 that was a workaround for the older conditions.
5946 2004-07-16 Ben Maurer <bmaurer@ximian.com>
5948 * assign.cs: IAssignMethod has a new interface, as documented
5949 inline. All assignment code now uses this new api.
5951 * ecore.cs, expression.cs: All classes which implement
5952 IAssignMethod now use the new interface.
5954 * expression.cs (Invocation): add a hack to EmitCall so that
5955 IndexerAccess can be the target of a compound assignment without
5956 evaluating its arguments twice.
5958 * statement.cs: Handle changes in Invocation api.
5960 2004-07-16 Martin Baulig <martin@ximian.com>
5962 * iterators.cs: Rewrote this. We're now using one single Proxy
5963 class for both the IEnumerable and the IEnumerator interface and
5964 `Iterator' derives from Class so we can use the high-level API.
5966 * class.cs (TypeContainer.AddIterator): New method.
5967 (TypeContainer.DoDefineType): New protected virtual method, which
5968 is called from DefineType().
5969 (TypeContainer.DoDefineMembers): Call DefineType() and
5970 DefineMembers() on all our iterators.
5971 (TypeContainer.Emit): Call Emit() on all our iterators.
5972 (TypeContainer.CloseType): Call CloseType() on all our iterators.
5974 * codegen.cs (EmitContext.CurrentIterator): New public field.
5976 2004-07-15 Martin Baulig <martin@ximian.com>
5979 (TypeManager.not_supported_exception_type): New type.
5981 2004-07-14 Martin Baulig <martin@ximian.com>
5983 * iterators.cs: Use real error numbers.
5985 2004-07-14 Martin Baulig <martin@ximian.com>
5987 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5988 requires this to be a System.Collection.IEnumerable and not a
5989 class implementing that interface.
5990 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
5992 2004-07-13 Marek Safar <marek.safar@seznam.cz>
5994 * class.cs: Fixed previous fix, it broke some error tests.
5996 2004-07-12 Martin Baulig <martin@ximian.com>
5998 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6001 2004-07-09 Miguel de Icaza <miguel@ximian.com>
6003 * assign.cs (LocalTemporary): Add new argument: is_address,If
6004 `is_address' is true, then the value that we store is the address
6005 to the real value, and not the value itself.
6007 * ecore.cs (PropertyExpr): use the new local temporary
6008 stuff to allow us to handle X.Y += z (where X is a struct)
6010 2004-07-08 Martin Baulig <martin@ximian.com>
6012 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6013 not always return, just like we're doing in Using.Resolve().
6015 2004-07-07 Miguel de Icaza <miguel@ximian.com>
6017 * cs-parser.jay (fixed_statement): flag this as Pinned.
6019 2004-07-06 Miguel de Icaza <miguel@ximian.com>
6021 * typemanager.cs (TypeManager): Removed MakePinned method, this
6022 mechanism is replaced with the .NET 2.x compatible mechanism of
6023 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6025 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
6026 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6027 `IsFixed' property which has a different meaning.
6029 2004-07-02 Raja R Harinath <rharinath@novell.com>
6031 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6032 visible from inside a nested class, not just the names of the
6033 immediately enclosing class.
6036 2004-06-24 Raja R Harinath <rharinath@novell.com>
6038 * expression.cs (BetterConversion): Remove buggy special-case
6039 handling of "implicit constant expression conversions". At this
6040 point, we already know that the conversion is possible -- we're
6041 only checking to see which is better.
6043 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6045 * cs-parser.jay: Added error CS0210 test.
6047 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6049 * cs-parser.jay: Added error CS0134 test.
6051 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6054 * cs-parser.jay: Added error CS0145 test.
6056 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6058 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6060 2004-06-23 Ben Maurer <bmaurer@ximian.com>
6062 * expression.cs (StackAlloc.Resolve): The argument may not
6063 be a constant; deal with this case.
6065 2004-06-23 Marek Safar <marek.safar@seznam.cz>
6067 * attribute.cs (IndexerName_GetIndexerName): Renamed to
6068 GetIndexerAttributeValue.
6069 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6071 * class.cs (Indexer.Define): Added error tests for CS0415,
6074 2004-06-23 Miguel de Icaza <miguel@ximian.com>
6076 * attribute.cs (Attribute.Resolve): Keep field code in sync with
6079 2004-06-23 Martin Baulig <martin@ximian.com>
6081 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6082 neither return nor throw, reset the barrier as well. Fixes #60457.
6084 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
6086 * class.cs : EventAttributes is now set to None by default.
6087 This fixes bug #60459.
6089 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6092 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6093 Don't throw exception but return null (it's sufficient now).
6095 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6097 * typemanager.cs (GetArgumentTypes): Faster implementation.
6099 2004-06-18 Martin Baulig <martin@ximian.com>
6101 * attribute.cs (Attribute.Resolve): Check whether we're an
6102 EmptyCast which a Constant child. Fixes #60333.
6104 2004-06-17 Ben Maurer <bmaurer@ximian.com>
6106 * statement.cs (EmitCollectionForeach): Account for the fact that
6107 not all valuetypes are in areas which we can take the address of.
6108 For these variables, we store to a temporary variable. Also, make
6109 sure that we dont emit a `callvirt' on a valuetype method.
6111 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6113 * expression.cs (StackAlloc.DoReSolve): Added test for
6114 negative parameter (CS0247).
6116 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6119 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6121 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6124 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6127 2004-06-14 Marek Safar <marek.safar@seznam.cz>
6129 Fix bug #58254 & cs1555.cs, cs1556.cs
6130 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6132 2004-06-14 Marek Safar <marek.safar@seznam.cz>
6134 * cs-parser.jay: Added error CS1669 test for indexers.
6136 2004-06-11 Martin Baulig <martin@ximian.com>
6138 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6139 call this twice: for params and varargs methods.
6141 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6144 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6146 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6148 * attribute.cs (Attribute.GetValidTargets): Made public.
6151 (AbstractPropertyEventMethod): New class for better code sharing.
6152 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6154 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6156 2004-06-11 Raja R Harinath <rharinath@novell.com>
6159 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6160 that the call to Resolve is part of a MemberAccess.
6161 (Expression.Resolve): Use it for SimpleName resolution.
6162 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6163 Add 'intermediate' boolean argument.
6164 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
6165 error message when the SimpleName can be resolved ambiguously
6166 between an expression and a type.
6167 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6169 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6170 call on the left-side.
6172 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6175 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6177 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6179 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6181 2004-06-11 Martin Baulig <martin@ximian.com>
6183 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6184 varargs methods if applicable.
6186 2004-06-11 Martin Baulig <martin@ximian.com>
6188 * expression.cs (Invocation.EmitCall): Don't use
6189 `method.CallingConvention == CallingConventions.VarArgs' since the
6190 method could also have `CallingConventions.HasThis'.
6192 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6194 * class.cs (Event.GetSignatureForError): Implemented.
6195 Fixed crash in error test cs3010.cs
6197 2004-06-10 Miguel de Icaza <miguel@ximian.com>
6199 * cs-tokenizer.cs: Change the way we track __arglist to be
6200 consistent with the other keywords.
6202 2004-06-09 Miguel de Icaza <miguel@ximian.com>
6204 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6207 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
6209 * codegen.cs: Check that all referenced assemblies have a strongname
6210 before strongnaming the compiled assembly. If not report error CS1577.
6211 Fix bug #56563. Patch by Jackson Harper.
6212 * typemanager.cs: Added a method to return all referenced assemblies.
6213 Fix bug #56563. Patch by Jackson Harper.
6215 2004-06-08 Marek Safar <marek.safar@seznam.cz>
6218 (Method.ApplyAttributeBuilder): Moved and added conditional
6219 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6222 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6224 2004-06-08 Marek Safar <marek.safar@seznam.cz>
6227 * class.cs: (EventField.attribute_targets): Changed default target.
6229 2004-06-08 Martin Baulig <martin@ximian.com>
6231 * expression.cs (Invocation.EmitCall): Enable varargs methods.
6233 2004-06-08 Martin Baulig <martin@ximian.com>
6235 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6237 2004-06-07 Martin Baulig <martin@ximian.com>
6239 Added support for varargs methods.
6241 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6244 * cs-parser.jay: Added support for `__arglist'.
6246 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6248 * expression.cs (Argument.AType): Added `ArgList'.
6249 (Invocation): Added support for varargs methods.
6250 (ArglistAccess): New public class.
6251 (Arglist): New public class.
6253 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6255 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
6256 a method's top-level block if the method has varargs.
6258 * support.cs (ReflectionParameters, InternalParameters): Added
6259 support for varargs methods.
6261 2004-06-07 Miguel de Icaza <miguel@ximian.com>
6263 * class.cs: Provide location in indexer error report.
6265 * driver.cs: Use standard names.
6267 * namespace.cs: Catch the use of using after a namespace has been
6268 declared also on using aliases.
6270 2004-06-03 Raja R Harinath <rharinath@novell.com>
6273 * typemanager.cs (closure_private_ok, closure_invocation_type)
6274 (closure_qualifier_type, closure_invocation_assembly)
6275 (FilterWithClosure): Move to ...
6276 (Closure): New internal nested class.
6277 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6278 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6279 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6280 (MemberLookup, MemberLookupFailed): Use it.
6281 * expression.cs (New.DoResolve): Treat the lookup for the
6282 constructor as being qualified by the 'new'ed type.
6283 (Indexers.GetIndexersForTypeOrInterface): Update.
6285 2004-06-03 Marek Safar <marek.safar@seznam.cz>
6288 (GetConditionalAttributeValue): New method. Returns
6289 condition of ConditionalAttribute.
6290 (SearchMulti): New method. Returns all attributes of type 't'.
6291 Use it when attribute is AllowMultiple = true.
6292 (IsConditionalMethodExcluded): New method.
6295 (Method.IsExcluded): Implemented. Returns true if method has conditional
6296 attribute and the conditions is not defined (method is excluded).
6297 (IMethodData): Extended interface for ConditionalAttribute support.
6298 (PropertyMethod.IsExcluded): Implemented.
6301 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6304 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6307 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
6309 * expression.cs (ArrayCreationExpression): Make this just an
6310 `expression'. It can't be a statement, so the code here was
6313 2004-06-02 Marek Safar <marek.safar@seznam.cz>
6316 * typemanager.cs (GetFullNameSignature): New method for
6319 2004-06-02 Marek Safar <marek.safar@seznam.cz>
6322 * class.cs (MemberBase.GetSignatureForError): New virtual method.
6323 Use this method when MethodBuilder is null.
6324 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6325 Added test for error CS0626 (MONO reports error for this situation).
6326 (IMethodData.GetSignatureForError): Extended interface.
6328 2004-06-01 Marek Safar <marek.safar@seznam.cz>
6331 (AttributeTester.GetObsoleteAttribute): Returns instance of
6332 ObsoleteAttribute when type is obsolete.
6335 (TypeContainer.VerifyObsoleteAttribute): Override.
6336 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6337 (MethodCode.VerifyObsoleteAttribute): Override.
6338 (MemberBase.VerifyObsoleteAttribute): Override.
6341 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6342 and report proper error.
6345 Delegate.VerifyObsoleteAttribute): Override.
6348 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6349 and report proper error.
6350 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6353 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6357 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6358 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6359 Added test for ObsoleteAttribute.
6362 (Catch): Derived from Statement.
6364 2004-06-01 Marek Safar <marek.safar@seznam.cz>
6366 Fixed bug #59071 & cs0160.cs
6368 * statement.cs (Try.Resolve): Check here whether order of catch
6369 clauses matches their dependencies.
6371 2004-05-31 Miguel de Icaza <miguel@ximian.com>
6373 * Reverted patch to namespace.cs (Use lookuptypedirect). This
6374 caused a regression: #59343. Referencing nested classes from an
6375 assembly stopped working.
6377 2004-05-31 Martin Baulig <martin@ximian.com>
6379 MCS is now frozen for beta 2.
6381 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6383 * convert.cs: add a trivial cache for overload operator resolution.
6385 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6387 * decl.cs: If possible, use lookuptypedirect here. We can only do
6388 this if there is no `.' after the namespace. Avoids using
6389 LookupType, which does lots of slow processing.
6390 (FindNestedType) New method, does what it says :-).
6391 * namespace.cs: use LookupTypeDirect.
6392 * rootcontext.cs: use membercache, if possible.
6393 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6395 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6398 According to the spec,
6400 In a member access of the form E.I, if E is a single identifier,
6401 and if the meaning of E as a simple-name (§7.5.2) is a constant,
6402 field, property, localvariable, or parameter with the same type as
6403 the meaning of E as a type-name (§3.8), then both possible
6404 meanings of E are permitted.
6406 We did not check that E as a simple-name had the same type as E as
6409 This trivial check gives us 5-7% on bootstrap time.
6411 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6413 * expression.cs (Invocation.OverloadResolve): Avoid the
6414 use of hashtables and boxing here by allocating on demand.
6416 2004-05-30 Martin Baulig <martin@ximian.com>
6418 * rootcontext.cs (RootContext.LookupType): Don't cache things if
6419 we're doing a silent lookup. Don't try to lookup nested types in
6420 TypeManager.object_type (thanks to Ben Maurer).
6422 2004-05-30 Martin Baulig <martin@ximian.com>
6424 Committing a patch from Ben Maurer.
6426 * rootcontext.cs (RootContext.LookupType): Cache negative results.
6428 2004-05-29 Martin Baulig <martin@ximian.com>
6430 * class.cs (IMethodData.ShouldIgnore): New method.
6432 * typemanager.cs (TypeManager.MethodFlags): Don't take a
6433 `Location' argument, we don't need it anywhere. Use
6434 `IMethodData.ShouldIgnore ()' instead of
6435 `MethodData.GetMethodFlags ()'.
6436 (TypeManager.AddMethod): Removed.
6437 (TypeManager.AddMethod2): Renamed to AddMethod.
6439 2004-05-29 Martin Baulig <martin@ximian.com>
6441 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6443 * convert.cs (Convert.ImplicitReferenceConversion): If we're
6444 converting from a class type S to an interface type and we already
6445 have an object on the stack, don't box it again. Fixes #52578.
6447 2004-05-29 Martin Baulig <martin@ximian.com>
6449 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6450 Added support for `params' parameters. Fixes #59267.
6452 2004-05-29 Martin Baulig <martin@ximian.com>
6454 * literal.cs (NullPointer): Provide a private .ctor which sets
6455 `type' to TypeManager.object_type. Fixes #59048.
6457 2004-05-29 Martin Baulig <martin@ximian.com>
6459 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6460 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
6462 * ecore.cs (EventExpr.instance_expr): Make the field private.
6464 2004-05-26 Marek Safar <marek.safar@seznam.cz>
6466 Fixed bug #50080 & cs0214-2.cs
6467 * expression.cs (Cast.DoResolve): Check unsafe context here.
6469 * statement.cs (Resolve.DoResolve): Likewise.
6471 2004-05-26 Martin Baulig <martin@ximian.com>
6473 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6475 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6476 (RootContext.LookupType): Pass down the `silent' flag.
6478 2004-05-25 Martin Baulig <martin@ximian.com>
6481 (MethodGroupExpr.IdenticalTypeName): New public property.
6482 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6483 expression actually refers to a type.
6485 2004-05-25 Martin Baulig <martin@ximian.com>
6487 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6488 for #56176 and made it actually work.
6490 2004-05-25 Martin Baulig <martin@ximian.com>
6492 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6493 (FieldExpr, PropertyExpr): Override and implement
6494 CacheTemporaries. Fixes #52279.
6496 2004-05-25 Miguel de Icaza <miguel@ximian.com>
6498 * location.cs: In the new compiler listing a file twice is a
6499 warning, not an error.
6501 2004-05-24 Martin Baulig <martin@ximian.com>
6503 * enum.cs (Enum.DefineType): For the `BaseType' to be a
6504 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
6506 2004-05-24 Martin Baulig <martin@ximian.com>
6508 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6509 walking the `using' list. Fixes #53921.
6511 2004-05-24 Martin Baulig <martin@ximian.com>
6513 * const.cs (Const.LookupConstantValue): Added support for
6514 EmptyCast's; fixes #55251.
6516 2004-05-24 Martin Baulig <martin@ximian.com>
6518 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6519 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6520 which does the CS0135 check. The reason is that we first need to
6521 check whether the variable actually exists.
6523 2004-05-24 Martin Baulig <martin@ximian.com>
6525 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6526 than RootContext.LookupType() to find the explicit interface
6529 2004-05-24 Raja R Harinath <rharinath@novell.com>
6531 * Makefile: Simplify. Use executable.make.
6532 * mcs.exe.sources: New file. List of sources of mcs.exe.
6534 2004-05-24 Anders Carlsson <andersca@gnome.org>
6538 Use the invariant culture when doing String.Compare for CLS case
6541 2004-05-23 Martin Baulig <martin@ximian.com>
6543 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6544 don't have any dots. Fixes #52622, added cs0246-8.cs.
6546 * namespace.cs (NamespaceEntry.Lookup): Likewise.
6548 2004-05-23 Marek Safar <marek.safar@seznam.cz>
6550 * class.cs (MemberBase.Define): Reuse MemberType member for
6551 resolved type. Other methods can use it too.
6553 2004-05-23 Martin Baulig <martin@ximian.com>
6555 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6556 the variable also exists in the current block (otherwise, we need
6557 to report a CS0103). Fixes #58670.
6559 2004-05-23 Martin Baulig <martin@ximian.com>
6561 * flowanalysis.cs (Reachability.Reachable): Compute this
6562 on-the-fly rather than storing it as a field.
6564 2004-05-23 Martin Baulig <martin@ximian.com>
6566 * flowanalysis.cs (Reachability.And): Manually compute the
6567 resulting `barrier' from the reachability.
6569 2004-05-23 Marek Safar <marek.safar@seznam.cz>
6572 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6573 instance of ObsoleteAttribute when symbol is obsolete.
6576 (IMethodData): Extended interface for ObsoleteAttribute support.
6578 2004-05-22 Marek Safar <marek.safar@seznam.cz>
6580 * attribute.cs: Fix bug #55970
6582 2004-05-22 Marek Safar <marek.safar@seznam.cz>
6586 (GetObsoleteAttribute): New method. Creates the instance of
6588 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6589 ObsoleteAttribute when member is obsolete.
6590 (AttributeTester.Report_ObsoleteMessage): Common method for
6591 Obsolete error/warning reporting.
6594 (TypeContainer.base_classs_type): New member for storing parent type.
6597 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6598 for this MemberCore.
6600 2004-05-21 Marek Safar <marek.safar@seznam.cz>
6602 * attribute.cs, const.cs: Fix bug #58590
6604 2004-05-21 Martin Baulig <martin@ximian.com>
6606 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6607 out parameters if the end of the method is unreachable. Fixes
6610 2004-05-21 Marek Safar <marek.safar@seznam.cz>
6612 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6613 Hari was right, why extra method.
6615 2004-05-21 Marek Safar <marek.safar@seznam.cz>
6617 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6619 2004-05-20 Martin Baulig <martin@ximian.com>
6621 Merged this back from gmcs to keep the differences to a minumum.
6623 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6624 instead of a Declspace.
6625 (Attribute.ResolveType): Likewise.
6626 (Attributes.Search): Likewise.
6627 (Attributes.Contains): Likewise.
6628 (Attributes.GetClsCompliantAttribute): Likewise.
6630 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6632 (MethodData.ApplyAttributes): Take an EmitContext instead of a
6635 2004-05-19 Marek Safar <marek.safar@seznam.cz>
6637 Fix bug #58688 (MCS does not report error when the same attribute
6640 * attribute.cs (Attribute.Emit): Distinction between null and default.
6642 2004-05-19 Raja R Harinath <rharinath@novell.com>
6644 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6645 of a top-level attribute without an attribute target.
6646 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
6648 (Attribute.Conditional_GetConditionName),
6649 (Attribute.Obsolete_GetObsoleteMessage): Update.
6650 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
6651 part of ScanForIndexerName.
6652 (Attribute.CanIgnoreInvalidAttribute): New function.
6653 (Attribute.ScanForIndexerName): Move to ...
6654 (Attributes.ScanForIndexerName): ... here.
6655 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6656 (Attributes.Search): New internal variant that can choose not to
6657 complain if types aren't resolved. The original signature now
6659 (Attributes.GetClsCompliantAttribute): Use internal variant, with
6660 complaints suppressed.
6661 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6662 only if it not useful.
6663 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6664 top-level for attributes that are shared between the assembly
6665 and a top-level class.
6666 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6667 * class.cs: Update to reflect changes.
6668 (DefineIndexers): Fuse loops.
6669 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
6670 a couple more variants of attribute names.
6672 2004-05-18 Marek Safar <marek.safar@seznam.cz>
6674 Fix bug #52585 (Implemented explicit attribute declaration)
6677 (Attributable.ValidAttributeTargets): New abstract method. It gets
6678 list of valid attribute targets for explicit target declaration.
6679 (Attribute.Target): It holds target itself.
6680 (AttributeSection): Removed.
6681 (Attribute.CheckTargets): New method. It checks whether attribute
6682 target is valid for the current element.
6685 (EventProperty): New class. For events that are declared like
6686 property (with add and remove accessors).
6687 (EventField): New class. For events that are declared like field.
6690 * cs-parser.jay: Implemented explicit attribute target declaration.
6692 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
6693 Override ValidAttributeTargets.
6696 (ReturnParameter): Class for applying custom attributes on
6698 (ParameterAtribute): New class. Class for applying custom
6699 attributes on the parameter type.
6701 2004-05-17 Miguel de Icaza <miguel@ximian.com>
6703 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6706 (Method): Allow UNSAFE here.
6708 * modifiers.cs: Support unsafe reporting.
6710 2004-05-17 Marek Safar <marek.safar@seznam.cz>
6712 * decl.cs: Fix bug #58478.
6714 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6716 * statement.cs: When checking for unreachable code on an EmptyStatement,
6717 set the location. Fixes bug #58488.
6719 2004-05-13 Miguel de Icaza <miguel@ximian.com>
6721 * driver.cs: Add -pkg handling.
6723 From Gonzalo: UseShelLExecute=false
6725 2004-05-12 Marek Safar <marek.safar@seznam.cz>
6728 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6730 (Attribute.IsClsCompliaceRequired): Moved to base for better
6732 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6733 when attribute is AttributeUsageAttribute.
6734 (Attribute.GetValidTargets): Simplified.
6735 (Attribute.GetAttributeUsage): New method returns AttributeUsage
6736 attribute for this type.
6737 (Attribute.ApplyAttributes): Method renamed to Emit and make
6739 (GlobalAttributeSection): New class for special handling of global
6740 attributes (assembly, module).
6741 (AttributeSection.Emit): New method.
6743 * class.cs: Implemented Attributable abstract methods.
6744 (MethodCore.LabelParameters): Moved to Parameter class.
6745 (Accessor): Is back simple class.
6746 (PropertyMethod): Implemented Attributable abstract class.
6747 (DelegateMethod): Implemented Attributable abstract class.
6748 (Event): New constructor for disctintion between normal Event
6749 and Event with accessors.
6751 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6753 * codegen.cs, const.cs, decl.cs, delegate.cs:
6754 (CommonAssemblyModulClass): Implemented Attributable abstract class
6757 * enum.cs: Implement IAttributeSupport interface.
6758 (EnumMember): New class for emum members. Implemented Attributable
6762 (ParameterBase): Is abstract.
6763 (ReturnParameter): New class for easier [return:] attribute handling.
6765 * typemanager.cs: Removed builder_to_attr.
6767 2004-05-11 Raja R Harinath <rharinath@novell.com>
6770 * attribute.cs (Attribute.GetPositionalValue): New function.
6771 * class.cs (TypeContainer.VerifyMembers): New function.
6772 (TypeContainer.Emit): Use it.
6773 (ClassOrStruct): New base class for Class and Struct.
6774 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
6775 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6777 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6778 then each non-static field should have a FieldOffset attribute.
6779 Otherwise, none of the fields should have a FieldOffset attribute.
6780 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
6781 and FieldOffset attributes.
6782 * typemanager.cs (TypeManager.struct_layout_attribute_type)
6783 (TypeManager.field_offset_attribute_type): New core types.
6784 (TypeManager.InitCoreTypes): Initialize them.
6786 2004-05-11 Michal Moskal <malekith@pld-linux.org>
6788 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6789 Return correct type.
6792 2004-05-09 Miguel de Icaza <miguel@ximian.com>
6794 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6795 be implicitly converted to ulong.
6797 * expression.cs: The logic for allowing operator &, | and ^ worked
6798 was wrong, it worked before because we did not report an error in
6799 an else branch. Fixes 57895.
6801 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6802 allow volatile fields to be reference types.
6804 2004-05-07 Miguel de Icaza <miguel@ximian.com>
6806 * driver.cs: Add support for /debug-
6808 2004-05-07 Raja R Harinath <rharinath@novell.com>
6810 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
6811 Add a 'complain' parameter to silence errors.
6812 (Attribute.Resolve): Update to changes. Put in sanity check to catch
6813 silently overlooked type-resolutions.
6814 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6816 (Attributes.Search): New function.
6817 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6818 (Attributes.GetAttributeFullName): Remove hack.
6819 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
6820 Update to reflect changes.
6821 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6822 Use Attributes.Search instead of nested loops.
6824 2004-05-07 Marek Safar <marek.safar@seznam.cz>
6827 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6828 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6829 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6831 * report.cs: (Report.Warning): Renamed to Warning_T because of
6832 parameter collision.
6834 2004-05-05 Raja R Harinath <rharinath@novell.com>
6836 * expression.cs (MemberAccess.ResolveMemberAccess):
6837 Exit with non-zero status after Report.Error.
6838 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6840 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6842 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
6844 * support.cs: Don't hang when the file is empty.
6846 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
6848 * support.cs: In SeekableStreamReader, compute the preamble size of the
6849 underlying stream. Position changes should take into account that initial
6852 2004-05-03 Todd Berman <tberman@sevenl.net>
6854 * driver.cs: remove unused GetSysVersion function.
6856 2004-05-03 Todd Berman <tberman@sevenl.net>
6858 * driver.cs: Remove the hack from saturday, as well as the hack
6859 from jackson (LoadAssemblyFromGac), also adds the CWD to the
6860 link_paths to get that bit proper.
6862 2004-05-01 Todd Berman <tberman@sevenl.net>
6864 * driver.cs: Try a LoadFrom before a Load, this checks the current
6865 path. This is currently a bug in mono that is be fixed, however, this
6866 provides a workaround for now. This will be removed when the bug
6869 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
6871 * CryptoConvert.cs: Updated to latest version. Fix issue with
6872 incomplete key pairs (#57941).
6874 2004-05-01 Todd Berman <tberman@sevenl.net>
6876 * driver.cs: Remove '.' from path_chars, now System.* loads properly
6879 2004-04-30 Jackson Harper <jackson@ximian.com>
6881 * codegen.cs: Open keys readonly.
6883 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6885 * typemanager.cs: don't report cyclic struct layout when a struct
6886 contains 2 or more fields of the same type. Failed for Pango.AttrShape
6887 which has 2 Pango.Rectangle fields.
6889 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
6891 * expression.cs: Handle IntPtr comparisons with IL code
6892 rather than a method call.
6894 2004-04-29 Martin Baulig <martin@ximian.com>
6896 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
6897 the list of PropertyInfo's in class hierarchy and find the
6898 accessor. Fixes #56013.
6900 2004-04-29 Martin Baulig <martin@ximian.com>
6902 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6904 2004-04-29 Martin Baulig <martin@ximian.com>
6906 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6908 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6910 2004-04-29 Martin Baulig <martin@ximian.com>
6912 * class.cs (ConstructorInitializer.Resolve): Check whether the
6913 parent .ctor is accessible. Fixes #52146.
6915 2004-04-29 Martin Baulig <martin@ximian.com>
6917 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6919 * statement.cs (Using.EmitLocalVariableDecls): Use
6920 TypeManager.idisposable_type, not typeof (IDisposable).
6921 (Foreach.EmitCollectionForeach): Added support for valuetypes.
6923 2004-04-29 Martin Baulig <martin@ximian.com>
6925 * class.cs (Event.Define): Don't emit the field and don't set
6926 RTSpecialName and SpecialName for events on interfaces. Fixes
6929 2004-04-29 Raja R Harinath <rharinath@novell.com>
6931 Refactor Attribute.ApplyAttributes.
6932 * attribute.cs (Attributable): New base class for objects that can
6933 have Attributes applied on them.
6934 (Attribute): Make AttributeUsage fields public.
6935 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6936 (Attribute.IsInternalCall): New property.
6937 (Attribute.UsageAttr): Convert to a public read-only property.
6938 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6939 (Attribute.ResolveType, Attribute.Resolve)
6940 (Attribute.ScanForIndexerName): Update to reflect changes.
6941 (Attribute.CheckAttributeTarget): Re-format.
6942 (Attribute.ApplyAttributes): Refactor, to various
6943 Attributable.ApplyAttributeBuilder methods.
6944 * decl.cs (MemberCore): Make Attributable.
6945 * class.cs (Accessor): Make Attributable.
6946 (MethodData.ApplyAttributes): Use proper attribute types, not
6948 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6949 (TypeContainer.ApplyAttributeBuilder)
6950 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6951 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
6952 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6953 (Operator.ApplyAttributeBuilder): New factored-out methods.
6954 * const.cs (Const.ApplyAttributeBuilder): Likewise.
6955 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6956 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6957 * parameter.cs (ParameterBase): New Attributable base class
6958 that can also represent Return types.
6959 (Parameter): Update to the changes.
6961 2004-04-29 Jackson Harper <jackson@ximian.com>
6963 * driver.cs: Prefer the corlib system version when looking for
6964 assemblies in the GAC. This is still a hack, but its a better hack
6967 2004-04-29 Marek Safar <marek.safar@seznam.cz>
6969 * decl.cs, enum.cs: Improved error 3005 reporting.
6971 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6972 (related_symbols): New private member for list of symbols
6973 related to reported error/warning.
6975 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6977 2004-04-29 Martin Baulig <martin@ximian.com>
6979 * ecore.cs (Expression.Constantify): If we're an enum and
6980 TypeManager.TypeToCoreType() doesn't give us another type, use
6981 t.UnderlyingSystemType. Fixes #56178.
6983 2004-04-29 Martin Baulig <martin@ximian.com>
6985 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6986 interfaces and for each interface, only add members directly
6987 declared in that interface. Fixes #53255.
6989 2004-04-28 Martin Baulig <martin@ximian.com>
6991 * expression.cs (ConditionalLogicalOperator): Use a temporary
6992 variable for `left' to avoid that we evaluate it more than once;
6995 2004-04-28 Martin Baulig <martin@ximian.com>
6997 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7000 2004-04-28 Martin Baulig <martin@ximian.com>
7002 * statement.cs (LocalInfo.Resolve): Check whether the type is not
7005 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7006 whether the type is not void (CS1547).
7008 2004-04-28 Martin Baulig <martin@ximian.com>
7010 * expression.cs (Unary.DoResolveLValue): Override this and report
7011 CS0131 for anything but Operator.Indirection.
7013 2004-04-28 Martin Baulig <martin@ximian.com>
7015 Committing a patch from Ben Maurer; see bug #50820.
7017 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7020 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7023 2004-04-28 Martin Baulig <martin@ximian.com>
7025 Committing a patch from Ben Maurer; see bug #50820.
7027 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7030 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7033 2004-04-28 Martin Baulig <martin@ximian.com>
7035 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7036 (Block.AddLabel): Call DoLookupLabel() to only search in the
7039 2004-04-28 Martin Baulig <martin@ximian.com>
7041 * cfold.cs (ConstantFold.BinaryFold): Added special support for
7042 comparing StringConstants and NullLiterals in Equality and Inequality.
7044 2004-04-28 Jackson Harper <jackson@ximian.com>
7046 * driver.cs: Attempt to load referenced assemblies from the
7047 GAC. This is the quick and dirty version of this method that
7048 doesnt take into account versions and just takes the first
7049 canidate found. Will be good enough for now as we will not have more
7050 then one version installed into the GAC until I update this method.
7052 2004-04-28 Martin Baulig <martin@ximian.com>
7054 * typemanager.cs (TypeManager.CheckStructCycles): New public
7055 static method to check for cycles in the struct layout.
7057 * rootcontext.cs (RootContext.PopulateTypes): Call
7058 TypeManager.CheckStructCycles() for each TypeContainer.
7059 [Note: We only need to visit each type once.]
7061 2004-04-28 Martin Baulig <martin@ximian.com>
7063 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7065 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7066 success and added `out object value'. Use a `bool resolved' field
7067 to check whether we've already been called rather than
7068 `ConstantValue != null' since this breaks for NullLiterals.
7070 2004-04-28 Raja R Harinath <rharinath@novell.com>
7072 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7073 setting of this flag, since the 'set' method may be non-public.
7075 2004-04-28 Raja R Harinath <rharinath@novell.com>
7077 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7078 check on current_vector.Block.
7080 2004-04-27 Martin Baulig <martin@ximian.com>
7082 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7083 a field initializer. Fixes #56459.
7085 2004-04-27 Martin Baulig <martin@ximian.com>
7087 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7088 we're not attempting to use an indexer. Fixes #52154.
7090 2004-04-27 Martin Baulig <martin@ximian.com>
7092 * statement.cs (Return): Don't create a return label if we don't
7093 need it; reverts my change from January 20th. Thanks to Ben
7096 2004-04-27 Martin Baulig <martin@ximian.com>
7098 According to the spec, `goto' can only leave a nested scope, but
7101 * statement.cs (Block.LookupLabel): Only lookup in the current
7102 block, don't recurse into parent or child blocks.
7103 (Block.AddLabel): Check in parent and child blocks, report
7104 CS0140/CS0158 if we find a duplicate.
7105 (Block): Removed this indexer for label lookups.
7106 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7107 this already does the error reporting for us.
7110 (FlowBranching.UsageVector.Block): New public variable; may be null.
7111 (FlowBranching.CreateSibling): Added `Block' argument.
7112 (FlowBranching.LookupLabel): New public virtual method. Lookup a
7113 label for the target of a `goto' and check whether we're not
7114 leaving a `finally'.
7116 2004-04-27 Martin Baulig <martin@ximian.com>
7118 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7119 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7122 2004-04-27 Martin Baulig <martin@ximian.com>
7124 * statement.cs (Block.AddLabel): Also check for implicit blocks
7125 and added a CS0158 check.
7127 2004-04-27 Martin Baulig <martin@ximian.com>
7129 * flowanalysis.cs (FlowBranchingLoop): New class.
7130 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7131 UsageVector's instead of an ArrayList.
7132 (FlowBranching.Label): Likewise.
7133 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7134 (FlowBranching.AddBreakVector): New method.
7136 2004-04-27 Miguel de Icaza <miguel@ximian.com>
7138 * attribute.cs: Small regression fix: only convert the type if we
7139 the type is different, fixes System.Drawing build.
7141 2004-04-27 Martin Baulig <martin@ximian.com>
7143 * attribute.cs (Attribute.Resolve): If we have a constant value
7144 for a named field or property, implicity convert it to the correct
7147 2004-04-27 Raja R Harinath <rharinath@novell.com>
7149 * statement.cs (Block.Block): Implicit blocks share
7150 'child_variable_names' fields with parent blocks.
7151 (Block.AddChildVariableNames): Remove.
7152 (Block.AddVariable): Mark variable as "used by a child block" in
7153 every surrounding block.
7154 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7155 been used in a child block, complain about violation of "Invariant
7156 meaning in blocks" rule.
7157 * cs-parser.jay (declare_local_variables): Don't use
7158 AddChildVariableNames.
7159 (foreach_statement): Don't create an implicit block: 'foreach'
7162 2004-04-23 Miguel de Icaza <miguel@ximian.com>
7164 * convert.cs (ImplicitNumericConversion): 0 is also positive when
7165 converting from 0L to ulong. Fixes 57522.
7167 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7169 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7170 derived class hides via 'new' keyword field from base class (test-242.cs).
7171 TODO: Handle this in the more general way.
7173 * class.cs (CheckBase): Ditto.
7175 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7177 * decl.cs (caching_flags): New member for storing cached values
7179 (MemberCore.Flags): New enum where bit flags for caching_flags
7181 (MemberCore.cls_compliance): Moved to caching_flags.
7182 (DeclSpace.Created): Moved to caching_flags.
7184 * class.cs: Use caching_flags instead of DeclSpace.Created
7186 2004-04-21 Miguel de Icaza <miguel@ximian.com>
7188 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7189 if we are only a derived class, not a nested class.
7191 * typemanager.cs: Same as above, but do this at the MemberLookup
7192 level (used by field and methods, properties are handled in
7193 PropertyExpr). Allow for the qualified access if we are a nested
7196 2004-04-21 Marek Safar <marek.safar@seznam.cz>
7198 * class.cs: Refactoring.
7199 (IMethodData): New inteface; Holds links to parent members
7200 to avoid member duplication (reduced memory allocation).
7201 (Method): Implemented IMethodData interface.
7202 (PropertyBase): New inner classes for get/set methods.
7203 (PropertyBase.PropertyMethod): Implemented IMethodData interface
7204 (Event): New inner classes for add/remove methods.
7205 (Event.DelegateMethod): Implemented IMethodData interface.
7207 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7208 EmitContext (related to class.cs refactoring).
7210 2004-04-21 Raja R Harinath <rharinath@novell.com>
7212 * delegate.cs (Delegate.VerifyApplicability): If the number of
7213 arguments are the same as the number of parameters, first try to
7214 verify applicability ignoring any 'params' modifier on the last
7218 2004-04-16 Raja R Harinath <rharinath@novell.com>
7220 * class.cs (TypeContainer.AddIndexer): Use
7221 'ExplicitInterfaceName' to determine if interface name was
7222 explicitly specified. 'InterfaceType' is not initialized at this time.
7223 (TypeContainer.DefineIndexers): Remove use of temporary list. The
7224 Indexers array is already in the required order. Initialize
7225 'IndexerName' only if there are normal indexers.
7226 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7227 (TypeContainer.Emit): Emit DefaultMember attribute only if
7228 IndexerName is initialized.
7231 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
7233 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7236 2004-04-15 Raja R Harinath <rharinath@novell.com>
7238 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7242 * attribute.cs (Attribute.Resolve): Check for duplicate named
7246 2004-04-15 Miguel de Icaza <miguel@ximian.com>
7248 * iterators.cs (MarkYield): track whether we are in an exception,
7249 and generate code accordingly. Use a temporary value to store the
7250 result for our state.
7252 I had ignored a bit the interaction of try/catch with iterators
7253 since their behavior was not entirely obvious, but now it is
7254 possible to verify that our behavior is the same as MS .NET 2.0
7258 2004-04-14 Miguel de Icaza <miguel@ximian.com>
7260 * iterators.cs: Avoid creating temporaries if there is no work to
7263 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7264 Enumerations, use TypeManager.EnumToUnderlying and call
7267 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7270 (This.Emit): Use EmitContext.EmitThis to emit our
7273 (This.EmitAssign): Ditto.
7275 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7276 codepaths, we will move all the functionality into
7279 (FieldExpr.EmitAssign): Ditto.
7281 This fixes several hidden bugs that I uncovered while doing a code
7282 review of this today.
7284 * codegen.cs (EmitThis): reworked so the semantics are more clear
7285 and also support value types "this" instances.
7287 * iterators.cs: Changed so that for iterators in value types, we
7288 do not pass the value type as a parameter.
7290 Initialization of the enumerator helpers is now done in the caller
7291 instead of passing the parameters to the constructors and having
7292 the constructor set the fields.
7294 The fields have now `assembly' visibility instead of private.
7296 2004-04-11 Miguel de Icaza <miguel@ximian.com>
7298 * expression.cs (Argument.Resolve): Check if fields passed as ref
7299 or out are contained in a MarshalByRefObject.
7301 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7302 another compiler type.
7304 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
7306 * class.cs (Indexer.Define): use the new name checking method.
7307 Also, return false on an error.
7308 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7309 (is_identifier_[start/part]_character): make static.
7311 2004-04-10 Miguel de Icaza <miguel@ximian.com>
7313 * expression.cs (Binary.ResolveOperator): Do no append strings
7314 twice: since we can be invoked more than once (array evaluation)
7315 on the same concatenation, take care of this here. Based on a fix
7316 from Ben (bug #56454)
7318 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
7320 * codegen.cs: Fix another case where CS1548 must be reported (when
7321 delay-sign isn't specified and no private is available #56564). Fix
7322 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
7323 error when MCS is used on the MS runtime and we need to delay-sign
7324 (which seems unsupported by AssemblyBuilder - see #56621).
7326 2004-04-08 Marek Safar <marek.safar@seznam.cz>
7328 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7329 (TypeManager.ComputeNamespaces): Faster implementation for
7332 * compiler.csproj: Updated AssemblyName to mcs.
7334 2004-04-07 Miguel de Icaza <miguel@ximian.com>
7336 * rootcontext.cs: Add new types to the boot resolution.
7338 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7339 MulticastDelegate is not allowed.
7341 * typemanager.cs: Add new types to lookup: System.TypedReference
7344 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7345 check for TypedReference or ArgIterator, they are not allowed.
7347 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7348 makes us properly catch 1510 in some conditions (see bug 56016 for
7351 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
7353 * CryptoConvert.cs: update from corlib version
7356 2004-04-05 Miguel de Icaza <miguel@ximian.com>
7358 * class.cs (Indexer.Define): Check indexername declaration
7360 2004-04-05 Marek Safar <marek.safar@seznam.cz>
7362 * attribute.cs (IsClsCompliant): Fixed problem with handling
7363 all three states (compliant, not-compliant, undetected).
7365 2004-03-30 Marek Safar <marek.safar@seznam.cz>
7367 * attribute.cs (Attribute): Location is now public.
7368 (Resolve): Store resolved arguments (pos_values) in attribute class.
7369 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7370 (GetClsCompliantAttributeValue): New method that gets
7371 CLSCompliantAttribute value.
7372 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7373 if exists else null.
7374 (AttributeTester): New class for CLS-Compliant verification routines.
7376 * class.cs (Emit): Add CLS-Compliant verification.
7377 (Method.GetSignatureForError): Implemented.
7378 (Constructor.GetSignatureForError): Implemented
7379 (Constructor.HasCompliantArgs): Returns if constructor has
7380 CLS-Compliant arguments.
7381 (Constructor.Emit): Override.
7382 (Construcor.IsIdentifierClsCompliant): New method; For constructors
7383 is needed to test only parameters.
7384 (FieldBase.GetSignatureForError): Implemented.
7385 (TypeContainer): New member for storing base interfaces.
7386 (TypeContainer.FindMembers): Search in base interfaces too.
7388 * codegen.cs (GetClsComplianceAttribute): New method that gets
7389 assembly or module CLSCompliantAttribute value.
7390 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7392 (ModuleClass.Emit): Add error 3012 test.
7394 * const.cs (Emit): Override and call base for CLS-Compliant tests.
7396 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7397 state for all decl types.
7398 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7399 if CLS-Compliant tests are required.
7400 (IsClsCompliaceRequired): New method. Analyze whether code
7401 must be CLS-Compliant.
7402 (IsExposedFromAssembly): New method. Returns true when MemberCore
7403 is exposed from assembly.
7404 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7405 value or gets cached value.
7406 (HasClsCompliantAttribute): New method. Returns true if MemberCore
7407 is explicitly marked with CLSCompliantAttribute.
7408 (IsIdentifierClsCompliant): New abstract method. This method is
7409 used to testing error 3005.
7410 (IsIdentifierAndParamClsCompliant): New method. Common helper method
7411 for identifier and parameters CLS-Compliant testing.
7412 (VerifyClsCompliance): New method. The main virtual method for
7413 CLS-Compliant verifications.
7414 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7415 null. I don't know why is null (too many public members !).
7416 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7417 and get value of first CLSCompliantAttribute that found.
7419 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7420 (VerifyClsCompliance): Override and add extra tests.
7422 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7423 clscheck- disable CLS-Compliant verification event if assembly is has
7424 CLSCompliantAttribute(true).
7426 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7427 ApllyAttribute is now called in emit section as in the other cases.
7428 Possible future Emit integration.
7429 (IsIdentifierClsCompliant): New override.
7430 (VerifyClsCompliance): New override.
7431 (GetEnumeratorName): Returns full enum name.
7433 * parameter.cs (GetSignatureForError): Implemented.
7435 * report.cs (WarningData): New struct for Warning message information.
7436 (LocationOfPreviousError): New method.
7437 (Warning): New method. Reports warning based on the warning table.
7438 (Error_T): New method. Reports error based on the error table.
7440 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7441 verifications are done here.
7443 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7445 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7446 CLSCompliantAttribute.
7447 (all_imported_types): New member holds all imported types from other
7449 (LoadAllImportedTypes): New method fills static table with exported types
7450 from all referenced assemblies.
7451 (Modules): New property returns all assembly modules.
7453 2004-03-30 Miguel de Icaza <miguel@ximian.com>
7455 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7456 throwing a parser error.
7458 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7459 which removes the hardcoded get_/set_ prefixes for properties, as
7460 IL allows for the properties to be named something else.
7464 * expression.cs: Do not override operand before we know if it is
7467 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
7469 * typemanager.cs: support for pinned variables.
7471 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
7473 * decl.cs, typemanager.cs: Avoid using an arraylist
7474 as a buffer if there is only one result set.
7476 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
7478 * expression.cs: Make sure you cant call a static method
7479 with an instance expression, bug #56174.
7481 2004-03-29 Miguel de Icaza <miguel@ximian.com>
7483 * class.cs (IsDuplicateImplementation): Improve error reporting to
7484 flag 663 (method only differs in parameter modifier).
7486 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7487 in preprocessor directives.
7489 * location.cs (LookupFile): Allow for the empty path.
7491 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
7492 better approach for some of that patch, but its failing with the
7493 CharSet enumeration. For now try/catch will do.
7495 * typemanager.cs: Do not crash if a struct does not have fields.
7498 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
7500 * expression.cs: cs0213, cant fix a fixed expression.
7503 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
7505 * cs-parser.jay: detect invalid embeded statements gracefully.
7508 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
7510 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7513 the invocation type may not be a subclass of the tye of the item/
7514 The type of the item must be a subclass of the invocation item.
7519 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
7521 * attribute.cs: Added methods to get a string and a bool from an
7522 attribute. Required to information from AssemblyKeyFileAttribute,
7523 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7524 * codegen.cs: Modified AssemblyName creation to include support for
7525 strongnames. Catch additional exceptions to report them as CS1548.
7526 * compiler.csproj: Updated include CryptoConvert.cs.
7527 * compiler.csproj.user: Removed file - user specific configuration.
7528 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
7529 Mono.Security assembly. The original class is maintained and tested in
7530 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7531 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7532 like CSC 8.0 (C# v2) supports.
7533 * Makefile: Added CryptoConvert.cs to mcs sources.
7534 * rootcontext.cs: Added new options for strongnames.
7536 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
7538 * driver.cs: For --expect-error, report error code `2'
7539 if the program compiled with no errors, error code `1' if
7540 it compiled with an error other than the one expected.
7542 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
7544 * compiler.csproj: Updated for Visual Studio .NET 2003.
7545 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7546 * compiler.sln: Updated for Visual Studio .NET 2003.
7548 2004-03-24 Ravi Pratap M <ravi@ximian.com>
7550 * expression.cs: Fix bug #47234. We basically need to apply the
7551 rule that we prefer the conversion of null to a reference type
7552 when faced with a conversion to 'object' (csc behaviour).
7554 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
7556 * statement.cs: Shorter form for foreach, eliminates
7557 a local variable. r=Martin.
7559 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
7561 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7562 checks if we can use brtrue/brfalse to test for 0.
7563 * expression.cs: use the above in the test for using brtrue/brfalse.
7566 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
7568 * expression.cs: Rewrite string concat stuff. Benefits:
7570 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7571 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7572 rather than a concat chain.
7574 * typemanager.cs: Add lookups for more concat overloads.
7576 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
7578 * expression.cs: Emit shorter il code for array init.
7595 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
7597 * statement.cs: Before, two switch blocks would be merged if the
7598 total size of the blocks (end_item - begin_item + 1) was less than
7599 two times the combined sizes of the blocks.
7601 Now, it will only merge if after the merge at least half of the
7606 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
7608 * class.cs : csc build fix for GetMethods(). See bug #52503.
7610 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
7612 * expression.cs: Make sure fp comparisons work with NaN.
7613 This fixes bug #54303. Mig approved this patch a long
7614 time ago, but we were not able to test b/c the runtime
7617 2004-03-19 Miguel de Icaza <miguel@ximian.com>
7619 * ecore.cs (TypExpr.GetHashCode): implement this overload.
7621 2004-03-19 Martin Baulig <martin@ximian.com>
7623 * class.cs (MemberCore.IsDuplicateImplementation): Report the
7624 error here and not in our caller.
7626 2004-03-19 Martin Baulig <martin@ximian.com>
7628 * interface.cs: Completely killed this file.
7629 (Interface): We're now a TypeContainer and live in class.cs.
7631 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7632 argument; we're now also called for interfaces.
7633 (TypeContainer.DefineMembers): Allow this method being called
7635 (TypeContainer.GetMethods): New public method; formerly known as
7636 Interface.GetMethod(). This is used by PendingImplementation.
7637 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7638 it's now private and non-static.
7639 (Interface): Moved this here; it's now implemented similar to
7641 (Method, Property, Event, Indexer): Added `bool is_interface'
7642 argument to their .ctor's.
7643 (MemberBase.IsInterface): New public field.
7645 * cs-parser.jay: Create normal Method, Property, Event, Indexer
7646 instances instead of InterfaceMethod, InterfaceProperty, etc.
7647 (opt_interface_base): Removed; we now use `opt_class_base' instead.
7648 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7650 2004-03-19 Martin Baulig <martin@ximian.com>
7652 * class.cs (MethodCore.IsDuplicateImplementation): New private
7653 method which does the CS0111 checking.
7654 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7655 Use IsDuplicateImplementation().
7657 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
7659 * decl.cs (FindMemberToOverride): New method to find the correct
7660 method or property to override in the base class.
7662 - Make Method/Property use the above method to find the
7663 version in the base class.
7664 - Remove the InheritableMemberSignatureCompare as it is now
7667 This patch makes large code bases much faster to compile, as it is
7668 O(n) rather than O(n^2) to do this validation.
7670 Also, it fixes bug 52458 which is that nested classes are not
7671 taken into account when finding the base class member.
7673 Reviewed/Approved by Martin.
7675 2004-03-17 Marek Safar <marek.safar@seznam.cz>
7677 * interface.cs: In all interface classes removed redundant
7678 member initialization.
7680 2004-03-16 Martin Baulig <martin@ximian.com>
7682 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7684 2004-03-15 Miguel de Icaza <miguel@ximian.com>
7686 * decl.cs (DefineTypeAndParents): New helper method to define a
7687 type's containers before the type itself is defined; This is a
7688 bug exposed by the recent changes to Windows.Forms when an
7689 implemented interface was defined inside a class that had not been
7692 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7694 (Check): Loop correctly to report errors modifiers
7695 (UNSAFE was not in the loop, since it was the same as TOP).
7697 * interface.cs: Every interface member now takes a ModFlags,
7698 instead of a "is_new" bool, which we set on the base MemberCore.
7700 Every place where we called "UnsafeOk" in the interface, now we
7701 call the proper member (InterfaceMethod.UnsafeOK) instead to get
7702 the unsafe settings from the member declaration instead of the
7703 container interface.
7705 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
7707 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7708 `set_indexer_name' to the pending bits (one per type).
7710 We fixed a bug today that was picking the wrong method to
7711 override, since for properties the existing InterfaceMethod code
7712 basically ignored the method name. Now we make sure that the
7713 method name is one of the valid indexer names.
7715 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
7717 * support.cs (SeekableStreamReader): Keep track of stream byte
7718 positions and don't mix them with character offsets to the buffer.
7720 Patch from Gustavo Giráldez
7722 2004-03-15 Marek Safar <marek.safar@seznam.cz>
7724 * interface.cs (InterfaceSetGetBase): Removed double member
7725 initialization, base class does it as well.
7727 2004-03-13 Martin Baulig <martin@ximian.com>
7729 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7730 when compiling corlib.
7732 2004-03-13 Miguel de Icaza <miguel@ximian.com>
7734 * convert.cs (ExplicitConversion): We were reporting an error on
7735 certain conversions (object_type source to a value type, when the
7736 expression was `null') before we had a chance to pass it through
7737 the user defined conversions.
7739 * driver.cs: Replace / and \ in resource specifications to dots.
7742 * class.cs: Add check for duplicate operators. Fixes 52477
7744 2004-03-11 Miguel de Icaza <miguel@ximian.com>
7746 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7747 that are in the middle of the statements, not only at the end.
7750 * class.cs (TypeContainer.AddField): No longer set the
7751 `HaveStaticConstructor' flag, now we call it
7752 `UserDefineStaticConstructor' to diferentiate the slightly
7753 semantic difference.
7755 The situation is that we were not adding BeforeFieldInit (from
7756 Modifiers.TypeAttr) to classes that could have it.
7757 BeforeFieldInit should be set to classes that have no static
7762 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7764 And most importantly Zoltan's comment:
7766 http://bugzilla.ximian.com/show_bug.cgi?id=44229
7768 "I think beforefieldinit means 'it's ok to initialize the type sometime
7769 before its static fields are used', i.e. initialization does not need
7770 to be triggered by the first access to the type. Setting this flag
7771 helps the JIT to compile better code, since it can run the static
7772 constructor at JIT time, and does not need to generate code to call it
7773 (possibly lots of times) at runtime. Unfortunately, mcs does not set
7774 this flag for lots of classes like String.
7776 csc sets this flag if the type does not have an explicit static
7777 constructor. The reasoning seems to be that if there are only static
7778 initalizers for a type, and no static constructor, then the programmer
7779 does not care when this initialization happens, so beforefieldinit
7782 This bug prevents the AOT compiler from being usable, since it
7783 generates so many calls to mono_runtime_class_init that the AOT code
7784 is much slower than the JITted code. The JITted code is faster,
7785 because it does not generate these calls if the vtable is type is
7786 already initialized, which is true in the majority of cases. But the
7787 AOT compiler can't do this."
7789 2004-03-10 Miguel de Icaza <miguel@ximian.com>
7791 * class.cs (MethodData.Emit): Refactor the code so symbolic
7792 information is generated for destructors; For some reasons we
7793 were taking a code path that did not generate symbolic information
7796 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
7798 * class.cs: Create a Constructor.CheckBase method that
7799 takes care of all validation type code. The method
7800 contains some code that was moved from Define.
7802 It also includes new code that checks for duplicate ctors.
7803 This fixes bug #55148.
7805 2004-03-09 Joshua Tauberer <tauberer@for.net>
7807 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7808 a { ... }-style array creation invokes EmitStaticInitializers
7809 which is not good for reference-type arrays. String, decimal
7810 and now null constants (NullCast) are not counted toward
7811 static initializers.
7813 2004-03-05 Martin Baulig <martin@ximian.com>
7815 * location.cs (SourceFile.HasLineDirective): New public field;
7816 specifies whether the file contains or is referenced by a "#line"
7818 (Location.DefineSymbolDocuments): Ignore source files which
7819 either contain or are referenced by a "#line" directive.
7821 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
7823 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7824 direct access to our parent, so check the method inline there.
7826 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
7828 * expression.cs (Invocation.EmitCall): Miguel's last commit
7829 caused a regression. If you had:
7834 In Foo the implict this would be null.
7836 2004-02-27 Miguel de Icaza <miguel@ximian.com>
7838 * expression.cs (Invocation.EmitCall): If the method is not
7839 virtual, do not emit a CallVirt to it, use Call.
7841 * typemanager.cs (GetFullNameSignature): Improve the method to
7842 cope with ".ctor" and replace it with the type name.
7844 * class.cs (ConstructorInitializer.Resolve): Now the method takes
7845 as an argument the ConstructorBuilder where it is being defined,
7846 to catch the recursive constructor invocations.
7848 2004-02-26 Miguel de Icaza <miguel@ximian.com>
7850 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7851 routines to check if a type is an enumerable/enumerator allow
7852 classes that implement the IEnumerable or IEnumerator interfaces.
7854 * class.cs (Property, Operator): Implement IIteratorContainer, and
7855 implement SetYields.
7857 (Property.Define): Do the block swapping for get_methods in the
7858 context of iterators. We need to check if Properties also
7859 include indexers or not.
7861 (Operator): Assign the Block before invoking the
7862 OperatorMethod.Define, so we can trigger the Iterator code
7865 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
7866 Property and Operator classes are not created when we parse the
7867 declarator but until we have the block completed, so we use a
7868 singleton SimpleIteratorContainer.Simple to flag whether the
7869 SetYields has been invoked.
7871 We propagate this setting then to the Property or the Operator to
7872 allow the `yield' to function.
7874 2004-02-25 Marek Safar <marek.safar@seznam.cz>
7876 * codegen.cs: Implemented attribute support for modules.
7877 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7878 Assembly/Module functionality.
7880 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7881 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7882 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7884 2004-02-16 Marek Safar <marek.safar@seznam.cz>
7886 * interface.cs (FindMembers): The operation is performed on all base
7887 interfaces and not only on the first. It is required for future CLS Compliance patch.
7889 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
7891 * statement.cs, codegen.cs:
7892 This patch deals with patterns such as:
7894 public class List : IEnumerable {
7896 public MyEnumerator GetEnumerator () {
7897 return new MyEnumerator(this);
7900 IEnumerator IEnumerable.GetEnumerator () {
7904 public struct MyEnumerator : IEnumerator {
7909 Before, there were a few things we did wrong:
7910 1) we would emit callvirt on a struct, which is illegal
7911 2) we emited ldarg when we needed to emit ldarga
7912 3) we would mistakenly call the interface methods on an enumerator
7913 type that derived from IEnumerator and was in another assembly. For example:
7915 public class MyEnumerator : IEnumerator
7917 Would have the interface methods called, even if there were public impls of the
7918 method. In a struct, this lead to invalid IL code.
7920 2004-02-11 Marek Safar <marek.safar@seznam.cz>
7922 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7925 * delegate.cs (Define): Fixed crash when delegate type is undefined.
7927 2004-02-11 Miguel de Icaza <miguel@ximian.com>
7929 * cs-parser.jay: Fix small regression: we were not testing V2
7930 compiler features correctly.
7932 * interface.cs: If the emit context is null, then create one
7934 2004-02-09 Marek Safar <marek.safar@seznam.cz>
7936 * decl.cs (GetSignatureForError): New virtual method to get full name
7939 * attribute.cs (IAttributeSupport): New interface for attribute setting.
7940 Now it is possible to rewrite ApplyAttributes method to be less if/else.
7942 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7943 Duplicated members and code in these classes has been removed.
7944 Better encapsulation in these classes.
7946 2004-02-07 Miguel de Icaza <miguel@ximian.com>
7948 * assign.cs (Assign.DoResolve): When dealing with compound
7949 assignments, there is a new rule in ECMA C# 2.4 (might have been
7950 there before, but it is documented here) that states that in:
7954 If b is of type int, and the `op' is a shift-operator, then the
7955 above is evaluated as:
7959 * expression.cs (Binary.ResolveOperator): Instead of testing for
7960 int/uint/long/ulong, try to implicitly convert to any of those
7961 types and use that in pointer arithmetic.
7963 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7964 method to print information for from the type, not from the
7965 null-method we were given.
7967 2004-02-01 Duncan Mak <duncan@ximian.com>
7969 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7970 parsing for cmd, fixes bug #53694.
7972 2004-02-04 Marek Safar <marek.safar@seznam.cz>
7974 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7975 in the member name duplication tests. Property and operator name duplication
7976 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7978 2004-02-03 Marek Safar <marek.safar@seznam.cz>
7980 * interface.cs (PopulateMethod): Fixed crash when interface method
7981 returns not existing type (error test cs0246-3.cs).
7983 2004-02-02 Ravi Pratap M <ravi@ximian.com>
7985 * cs-parser.jay (interface_accessors): Re-write actions to also
7986 store attributes attached to get and set methods. Fix spelling
7989 (inteface_property_declaration): Modify accordingly.
7991 (InterfaceAccessorInfo): New helper class to store information to pass
7992 around between rules that use interface_accessors.
7994 * interface.cs (Emit): Apply attributes on the get and set
7995 accessors of properties and indexers too.
7997 * attribute.cs (ApplyAttributes): Modify accordingly to use the
7998 right MethodBuilder when applying attributes to the get and set accessors.
8000 2004-01-31 Miguel de Icaza <miguel@ximian.com>
8002 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8004 2004-01-26 Miguel de Icaza <miguel@ximian.com>
8006 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8008 2004-01-25 Miguel de Icaza <miguel@ximian.com>
8010 * cs-parser.jay: Remove YIELD token, instead use the new grammar
8011 changes that treat `yield' specially when present before `break'
8014 * cs-tokenizer.cs: yield is no longer a keyword.
8016 2004-01-23 Marek Safar <marek.safar@seznam.cz>
8018 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8019 setting for default constructors.
8020 For default constructors are almost every time set wrong Modifier. The
8021 generated IL code has been alright. But inside mcs this values was
8022 wrong and this was reason why several of my CLS Compliance tests
8025 2004-01-22 Martin Baulig <martin@ximian.com>
8027 * cs-parser.jay (namespace_or_type_name): Return an Expression,
8028 not a QualifiedIdentifier. This is what `type_name_expression'
8029 was previously doing.
8030 (type_name_expression): Removed; the code is now in
8031 `namespace_or_type_name'.
8032 (qualified_identifier): Removed, use `namespace_or_type_name'
8034 (QualifiedIdentifier): Removed this class.
8036 2004-01-22 Martin Baulig <martin@ximian.com>
8038 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8039 not a string as alias name.
8041 2004-01-21 Miguel de Icaza <miguel@ximian.com>
8043 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8044 #52730 bug, and instead compute correctly the need to use a
8045 temporary variable when requesting an address based on the
8046 static/instace modified of the field and the constructor.
8048 2004-01-21 Martin Baulig <martin@ximian.com>
8050 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8051 class and namespace before looking up aliases. Fixes #52517.
8053 2004-01-21 Martin Baulig <martin@ximian.com>
8055 * flowanalysis.cs (UsageVector.Merge): Allow variables being
8056 assinged in a 'try'; fixes exception4.cs.
8058 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8059 * class.cs : Implemented parameter-less constructor for TypeContainer
8061 * decl.cs: Attributes are now stored here. New property OptAttributes
8063 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8065 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8067 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8069 * typemanager.cs (CSharpSignature): Now reports also inner class name.
8070 (CSharpSignature): New method for indexer and property signature.
8072 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8074 * pending.cs (IsVirtualFilter): Faster implementation.
8076 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8078 * typemanager.cs: Avoid inclusion of same assembly more than once.
8080 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8082 * cs-parser.jay: Fixed problem where the last assembly attribute
8083 has been applied also to following declaration (class, struct, etc.)
8085 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8087 * class.cs: Added error CS0538, CS0539 reporting.
8088 Fixed crash on Microsoft runtime when field type is void.
8090 * cs-parser.jay: Added error CS0537 reporting.
8092 * pending.cs: Added error CS0535 reporting.
8093 Improved error report for errors CS0536, CS0534.
8095 2004-01-20 Miguel de Icaza <miguel@ximian.com>
8097 Merge a few bits from the Anonymous Method MCS tree.
8099 * statement.cs (ToplevelBlock): New class for toplevel methods,
8100 will hold anonymous methods, lifted variables.
8102 * cs-parser.jay: Create toplevel blocks for delegates and for
8103 regular blocks of code.
8105 2004-01-20 Martin Baulig <martin@ximian.com>
8107 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8108 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8109 and `NeedExplicitReturn'; added `IsLastStatement'.
8110 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8111 have a `ReturnLabel' or we're not unreachable.
8113 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8114 child's reachability; don't just override ours with it. Fixes
8115 #58058 (lluis's example).
8116 (FlowBranching): Added public InTryOrCatch(), InCatch(),
8117 InFinally(), InLoop(), InSwitch() and
8118 BreakCrossesTryCatchBoundary() methods.
8120 * statement.cs (Return): Do all error checking in Resolve().
8121 Unless we are the last statement in a top-level block, always
8122 create a return label and jump to it.
8123 (Break, Continue): Do all error checking in Resolve(); also make
8124 sure we aren't leaving a `finally'.
8125 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8126 statement in a top-level block.
8127 (Block.Flags): Added `IsDestructor'.
8128 (Block.IsDestructor): New public property.
8130 2004-01-20 Martin Baulig <martin@ximian.com>
8132 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8134 2004-01-20 Martin Baulig <martin@ximian.com>
8136 * statement.cs (Statement.ResolveUnreachable): New public method.
8137 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8138 (Block.Resolve): Resolve unreachable statements.
8140 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
8142 * expression.cs: We need to fix the case where we do
8143 not have a temp variable here.
8145 * assign.cs: Only expression compound assignments need
8146 temporary variables.
8148 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
8150 * flowanalysis.cs: Reduce memory allocation in a few ways:
8151 - A block with no variables should not allocate a bit
8153 - A method with no out parameters does not need any tracking
8154 for assignment of the parameters, so we need not allocate
8157 public readonly Type[] VariableTypes;
8158 public readonly string[] VariableNames;
8159 Are redundant. The data is already stored in the variable
8160 map, so we need not allocate another array for it.
8161 - We need to add alot of checks for if (params | locals) == null
8162 due to the first two changes.
8164 2004-01-18 Miguel de Icaza <miguel@ximian.com>
8166 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8167 implement IMemoryLocation, we store a copy on a local variable and
8168 take the address of it. Patch from Benjamin Jemlich
8170 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8171 to use a special "type_name_expression" rule which reduces the
8172 number of "QualifiedIdentifier" classes created, and instead
8173 directly creates MemberAccess expressions.
8175 2004-01-17 Miguel de Icaza <miguel@ximian.com>
8177 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8178 that fixes #52853. Null literal assignment to ValueType
8180 * class.cs (MethodData.Emit): Instead of checking the name of the
8181 method to determine if its a destructor, create a new derived
8182 class from Method called Destructor, and test for that.
8184 * cs-parser.jay: Create a Destructor object instead of a Method.
8186 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8190 2004-01-16 Miguel de Icaza <miguel@ximian.com>
8192 * expression.cs (Binary.ResolveOperator): Perform an implicit
8193 conversion from MethodGroups to their delegate types on the
8196 * delegate.cs: Introduce a new class DelegateCreation that is the
8197 base class for `NewDelegate' and `ImplicitDelegateCreation',
8198 factor some code in here.
8200 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8201 conversion from MethodGroups to compatible delegate types.
8203 * ecore.cs (Expression.Resolve): Do not flag error 654
8204 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8205 we allow conversions from MethodGroups to delegate types now.
8207 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8208 assignments in v2 either.
8210 2004-01-10 Miguel de Icaza <miguel@ximian.com>
8212 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8213 static read-only fields in ctors.
8215 Applied patch from Benjamin Jemlich
8217 * expression.cs (UnaryMutator): Avoid leaking local variables.
8219 2004-01-09 Miguel de Icaza <miguel@ximian.com>
8221 * cs-tokenizer.cs (IsCastToken): Allow the various native types
8222 here to return true, as they can be used like this:
8226 Fixed 49836 and all the other dups
8228 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
8230 * driver.cs: Implement /win32res and /win32icon.
8232 2004-01-08 Miguel de Icaza <miguel@ximian.com>
8234 * cs-parser.jay: Add a rule to improve error handling for the
8235 common mistake of placing modifiers after the type.
8237 2004-01-07 Miguel de Icaza <miguel@ximian.com>
8239 * cs-parser.jay (interface_event_declaration): Catch
8240 initialization of events on interfaces, and report cs0068
8242 * cs-parser.jay (interface_event_declaration): Catch
8243 initialization of events.
8245 * ecore.cs: Better report missing constructors.
8247 * expression.cs (Binary.ResolveOperator): My previous bug fix had
8248 the error reporting done in the wrong place. Fix.
8250 * expression.cs (Binary.ResolveOperator): Catch the
8251 operator + (E x, E y) error earlier, and later allow for implicit
8252 conversions in operator +/- (E e, U x) from U to the underlying
8255 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8256 52596, if the container class is abstract, the default constructor
8257 is protected otherwise its public (before, we were always public).
8259 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8262 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8263 Jemlich that fixes bug #52597, MCS was generating invalid code for
8264 idisposable structs. Thanks to Ben for following up with this
8267 2004-01-06 Miguel de Icaza <miguel@ximian.com>
8269 * driver.cs: Allow assemblies without code to be generated, fixes
8272 2004-01-07 Nick Drochak <ndrochak@gol.com>
8274 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8276 2004-01-05 Miguel de Icaza <miguel@ximian.com>
8278 * cs-parser.jay: Add rules to improve error reporting if fields or
8279 methods are declared at the namespace level (error 116)
8281 * Add rules to catch event add/remove
8283 2004-01-04 David Sheldon <dave-mono@earth.li>
8285 * expression.cs: Added matching ")" to error message for
8288 2004-01-03 Todd Berman <tberman@gentoo.org>
8290 * ecore.cs, attribute.cs:
8291 Applying fix from #52429.
8293 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
8295 * ecore.cs, expression.cs, statement.cs:
8296 Total rewrite of how we handle branching. We
8297 now handle complex boolean expressions with fewer
8298 jumps. As well if (x == 0) no longer emits a ceq.
8300 if (x is Foo) is much faster now, because we generate
8303 Overall, we get a pretty big improvement on our benchmark
8304 tests. The code we generate is smaller and more readable.
8306 I did a full two-stage bootstrap. The patch was reviewed
8307 by Martin and Miguel.
8309 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
8311 * cs-parser.jay: Make primary_expression not take a QI.
8312 we dont need this because the member_access rule covers
8313 us here. So we replace the rule with just IDENTIFIER.
8315 This has two good effects. First, we remove a s/r conflict.
8316 Second, we allocate many fewer QualifiedIdentifier objects.
8318 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
8320 * attribute.cs: Handle MarshalAs attributes as pseudo, and
8321 set the correct information via SRE. This prevents
8322 hanging on the MS runtime. Fixes #29374.
8324 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
8326 * convert.cs: correctly handle conversions to value types
8327 from Enum and ValueType as unboxing conversions.
8329 Fixes bug #52569. Patch by Benjamin Jemlich.
8331 2004-01-02 Ravi Pratap <ravi@ximian.com>
8333 * expression.cs (BetterConversion): Prefer int -> uint
8334 over int -> ulong (csc's behaviour). This fixed bug #52046.
8336 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
8338 * decl.cs (MemberCache.FindMembers): now returns a
8341 * typemanager.cs: In general, go with with ^^.
8342 (CopyNewMethods): take an IList.
8343 (RealMemberLookup): Only allocate an arraylist
8344 if we copy from two sets of methods.
8346 This change basically does two things:
8347 1) Fewer array lists allocated due to CopyNewMethods.
8348 2) the explicit cast in MemberList costed ALOT.
8350 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
8352 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8353 a hashtable to avoid needless string allocations when an identifier is
8354 used more than once (the common case).
8356 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
8358 * pending.cs: MS's TypeBuilder.GetInterfaces ()
8359 is broken, it will not return anything. So, we
8360 have to use the information we have in mcs to
8363 * typemanager.cs: Add a cache for GetInterfaces,
8364 since this will now be used more often (due to ^^)
8366 (GetExplicitInterfaces) New method that gets the
8367 declared, not effective, interfaces on a type
8368 builder (eg, if you have interface IFoo, interface
8369 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8372 This patch makes MCS able to bootstrap itself on
8375 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
8377 * expression.cs: Remove the Nop's that Miguel put
8380 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
8382 * report.cs, codegen.cs: Give the real stack trace to
8383 the error when an exception is thrown.
8385 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
8387 * decl.cs: only allocate hashtables for ifaces if
8390 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
8392 * expression.cs: fix the error from cs0121-2.cs
8393 (a parent interface has two child interfaces that
8394 have a function with the same name and 0 params
8395 and the function is called through the parent).
8397 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
8399 * class.cs, rootcontext.cs, typmanager.cs: do not
8402 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
8404 * codegen.cs: remove stack for the ec flow branching.
8405 It is already a linked list, so no need.
8407 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
8409 * Makefile: Allow custom profiler here.
8411 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
8413 * typemanager.cs (LookupType):
8414 - Use a static char [], because split takes
8415 a param array for args, so it was allocating
8417 - Do not store true in a hashtable, it boxes.
8419 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
8421 * flowanalysis.cs: bytify common enums.
8423 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
8425 * modifiers.cs: Add a new set of flags for the
8426 flags allowed on explicit interface impls.
8427 * cs-parser.jay: catch the use of modifiers in
8428 interfaces correctly.
8429 * class.cs: catch private void IFoo.Blah ().
8431 All related to bug #50572.
8433 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
8435 * decl.cs: Rewrite the consistant accessability checking.
8436 Accessability is not linear, it must be implemented in
8437 a tableish way. Fixes #49704.
8439 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
8441 * expression.cs: Handle negation in a checked context.
8442 We must use subtraction from zero. Fixes #38674.
8444 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
8446 * class.cs: Ignore static void main in DLLs.
8447 * rootcontext.cs: Handle the target type here,
8448 since we are have to access it from class.cs
8449 * driver.cs: account for the above.
8451 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
8453 * report.cs: Give line numbers and files if available.
8455 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
8457 * driver.cs: Implement /addmodule.
8459 * typemanager.cs: Change 'modules' field so it now contains Modules not
8462 2003-12-20 Martin Baulig <martin@ximian.com>
8464 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8465 (FieldBase.IsAssigned): Removed this field.
8466 (FieldBase.SetAssigned): New public method.
8467 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8469 2003-12-20 Martin Baulig <martin@ximian.com>
8471 * expression.cs (LocalVariableReference.DoResolve): Don't set
8472 `vi.Used' if we're called from DoResolveLValue().
8474 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8475 returns the usage vector it just merged into the current one -
8476 pass this one to UsageWarning().
8477 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8478 of the `EmitContext', don't call this recursively on our children.
8480 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
8482 * driver.cs: Implement /target:module.
8484 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
8486 * support.cs (CharArrayHashtable): New helper class.
8488 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
8489 char arrays, not strings, so we can avoid creating a string in
8490 consume_identifier if the identifier is a keyword.
8492 2003-12-16 Martin Baulig <martin@ximian.com>
8494 * statement.cs (LocalInfo.Assigned): Removed this property.
8495 (LocalInfo.Flags): Removed `Assigned'.
8496 (LocalInfo.IsAssigned): New public method; takes the EmitContext
8497 and uses flow analysis.
8498 (Block.UsageWarning): Made this method private.
8499 (Block.Resolve): Call UsageWarning() if appropriate.
8501 * expression.cs (LocalVariableReference.DoResolve): Always set
8502 LocalInfo.Used here.
8504 2003-12-13 Martin Baulig <martin@ximian.com>
8506 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8507 any value here; we're now using flow analysis to figure out
8508 whether a statement/block returns a value.
8510 2003-12-13 Martin Baulig <martin@ximian.com>
8512 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8514 (FlowBranching.MergeFinally): Don't call
8515 `branching.CheckOutParameters()' here, this is called in
8517 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8518 when adding the `finally' vector.
8520 2003-12-13 Martin Baulig <martin@ximian.com>
8523 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8524 actually work and also fix #48962.
8526 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
8528 * decl.cs: Do not check System.Object for nested types,
8529 since we know it does not have any. Big bang for buck:
8534 corlib: 17.99 seconds
8538 corlib: 17.39 seconds
8540 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
8542 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8543 time we are returning 0 members, so we save alot here.
8545 2003-12-11 Martin Baulig <martin@ximian.com>
8547 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8548 `MergeChild()', also just take the `FlowBranching' as argument;
8549 call Merge() on it and return the result.
8550 (FlowBranching.Merge): We don't need to do anything if we just
8553 2003-12-11 Martin Baulig <martin@ximian.com>
8555 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8556 them in an `ArrayList' to reduce memory usage. Thanks to Ben
8557 Maurer for this idea.
8559 2003-12-11 Martin Baulig <martin@ximian.com>
8561 * flowanalysis.cs (MergeResult): This class is now gone; we now
8562 use the `UsageVector' for this. The reason for this is that if a
8563 branching just has one sibling, we don't need to "merge" them at
8564 all - that's the next step to do.
8565 (FlowBranching.Merge): We now return a `UsageVector' instead of a
8568 2003-12-11 Martin Baulig <martin@ximian.com>
8570 Reworked flow analyis and made it more precise and bug-free. The
8571 most important change is that we're now using a special `Reachability'
8572 class instead of having "magic" meanings of `FlowReturns'. I'll
8573 do some more cleanups and optimizations and also add some more
8574 documentation this week.
8576 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8577 largely reworked this class.
8578 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8579 the new `Reachability' class instead of having "magic" values here.
8580 (FlowBranching): We're now using an instance of `Reachability'
8581 instead of having separate `Returns', `Breaks' etc. fields.
8583 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8584 based on flow analysis; ignore the return value of block.Emit ().
8586 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
8588 * driver.cs typemanager.cs: Find the mono extensions to corlib even
8589 if they are private.
8591 2003-12-09 Martin Baulig <martin@ximian.com>
8593 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8594 call them directly on the UsageVector.
8596 2003-12-09 Martin Baulig <martin@ximian.com>
8598 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8599 Changed return type from `FlowReturns' to `Reachability'.
8601 2003-12-09 Martin Baulig <martin@ximian.com>
8603 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8604 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8605 `Reachable' fields with a single `Reachability' one.
8607 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
8609 * class.cs (FindMembers): Remove foreach's.
8622 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
8627 This patch does a few things:
8628 1. EmptyStatement is now a singleton, so it is never reallocated.
8629 2. All blah is EmptyStatement constructs have been changed to
8630 blah == EmptyStatement.Value, which is much faster and valid
8631 now that EmptyStatement is a singleton.
8632 3. When resolving a block, rather than allocating a new array for
8633 the non-empty statements, empty statements are replaced with
8634 EmptyStatement.Value
8635 4. Some recursive functions have been made non-recursive.
8636 Mainly the performance impact is from (3), however (1) and (2) are needed for
8637 this to work. (4) does not make a big difference in normal situations, however
8638 it makes the profile look saner.
8643 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8644 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8645 Total memory allocated: 56397 KB
8648 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8649 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8650 Total memory allocated: 55666 KB
8652 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
8654 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8655 than the hashtable in a hashtable version
8657 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8658 we always end up concating a string. This results in a huge perf
8659 loss, because many strings have to be tracked by the GC. In this
8660 patch, we first use a hashtable that works with two keys, so that
8661 the strings do not need to be concat'ed.
8672 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
8674 * Makefile: Add a new target `do-time' that does a quick and simple
8675 profile, leaving easy to parse output.
8677 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
8679 * codegen.cs (Init): Create the dynamic assembly with
8680 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8682 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
8684 * support.cs: Make the PtrHashtable use only one
8685 instance of its comparer.
8687 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
8689 * typemanager.cs: Fix lookup of GetNamespaces.
8691 2003-11-29 Miguel de Icaza <miguel@ximian.com>
8693 * expression.cs: Removed redundant line.
8695 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8696 ArrayLists, use for loops with bounds.
8698 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8701 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8702 arraylists, use for loop with bounds.
8704 The above three changes give us a 0.071 second performance
8705 improvement out of 3.294 seconds down to 3.223. On my machine
8706 the above changes reduced the memory usage by 1,387 KB during
8709 * cs-parser.jay (QualifiedIdentifier): New class used to represent
8710 QualifiedIdentifiers. Before we created a new string through
8711 concatenation, and mostly later on, the result would be
8712 manipulated by DecomposeQI through string manipulation.
8714 This reduced the compiler memory usage for bootstrapping from
8715 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8716 compile times in 0.05 seconds.
8718 2003-11-28 Dick Porter <dick@ximian.com>
8720 * support.cs: Do string compares with the Invariant culture.
8728 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8729 the comparison is done with the Invariant culture.
8731 2003-11-27 Miguel de Icaza <miguel@ximian.com>
8733 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8734 GetEnumerator method.
8736 (ProbeCollectionType): Iterate starting at the most specific type
8737 upwards looking for a GetEnumerator
8739 * expression.cs: Shift count can be up to 31 for int/uint and 63
8742 2003-11-26 Miguel de Icaza <miguel@ximian.com>
8744 * statement.cs (Block.LookupLabel): Also look for the label on the
8745 children blocks. Use a hash table to keep track of visited
8748 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8749 we actually did transform the other operand, otherwise fall back
8750 to the common codepath that casts to long.
8752 * cs-tokenizer.cs: Use the same code pattern as the int case.
8753 Maybe I should do the parsing myself, and avoid depending on the
8754 Parse routines to get this done.
8756 2003-11-25 Miguel de Icaza <miguel@ximian.com>
8758 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
8759 which fixes bug 51347. This time test it.
8761 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8762 attributes for example can not tell the difference between these.
8763 The difference was only a syntax feature of the language.
8765 * attribute.cs: Apply attributes to delegates.
8767 * delegate.cs: Call the apply attributes method.
8769 2003-11-24 Miguel de Icaza <miguel@ximian.com>
8771 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8772 comparing 0 vs Byte.MinValue, not the value
8774 (ImplicitConversionRequired): When reporting a conversion error,
8775 use error 31 to print out the constant error instead of the
8778 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
8779 which fixes bug 51347.
8781 2003-11-22 Miguel de Icaza <miguel@ximian.com>
8783 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
8784 which fixes the -warnaserror command line option.
8786 2003-11-21 Miguel de Icaza <miguel@ximian.com>
8788 * cfold.cs (DoNumericPromotions): During constant folding of
8789 additions on UIntConstant, special case intconstants with
8790 IntConstants like we do on the expression binary operator.
8792 2003-11-12 Miguel de Icaza <miguel@ximian.com>
8794 * convert.cs (ImplicitReferenceConversion): We were missing a case
8795 (System.Enum are not value types or class types, so we need to
8796 classify them separatedly).
8798 * driver.cs: We do not support error 2007.
8800 2003-11-12 Jackson Harper <jackson@ximian.com>
8802 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8803 system directory. Also use the full file name so users can
8804 libraries names mscorlib-o-tron.dll in a non system dir.
8806 2003-11-10 Martin Baulig <martin@ximian.com>
8808 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8809 (TypeManager.InitCoreTypes): Initialize them here, but instead of
8810 calling `ResolveType()' on them, directly assign their `Type'.
8812 2003-11-08 Martin Baulig <martin@ximian.com>
8814 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8815 return value and the `out parent' parameter.
8816 (TypeContainer.DefineType): Moved the CS0644 check into
8817 GetClassBases(). Don't pass the interface types to the
8818 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8819 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8821 * ecore.cs (TypeExpr.IsAttribute): New property.
8822 (TypeExpr.GetInterfaces): New method.
8824 * interface.cs (Interface.GetInterfaceTypeByName): Return a
8825 TypeExpr instead of a Type.
8826 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8827 (Interface.DefineType): Don't pass the interface types to the
8828 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8829 them later and then call `TypeBulider.AddInterfaceImplementation()'.
8831 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8832 instead of a `Type[]'.
8833 (TypeManager.RegisterBuilder): Likewise.
8834 (TypeManager.AddUserInterface): Likewise.
8835 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8836 `Type[]' and also return a `TypeExpr[]'.
8837 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8839 2003-11-08 Martin Baulig <martin@ximian.com>
8841 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8844 2003-11-08 Martin Baulig <martin@ximian.com>
8846 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8847 TypeManager.ResolveExpressionTypes().
8849 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8850 instead of an Expression.
8851 (TypeExpr): This is now an abstract base class for `TypeExpression'.
8852 (TypeExpression): New public class; formerly known as `TypeExpr'.
8854 * expression.cs (ComposedCast): Derive from TypeExpr.
8856 * typemanager.cs (TypeManager.system_*_expr): These are now
8857 TypExpr's instead of Expression's.
8858 (TypeManager.ResolveExpressionTypes): New public static function;
8859 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8862 2003-11-06 Miguel de Icaza <miguel@ximian.com>
8864 * expression.cs (New.DoResolve): Do not dereference value that
8865 might be a null return.
8867 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8868 sure that the constant value has the right type. Fixes an
8869 unreported bug, similar to 50425.
8871 * const.cs (Const.LookupConstantValue): Call
8872 ImplicitStandardConversionExists before doing a conversion to
8873 avoid havng the TypeManager.ChangeType do conversions.
8875 Reduced the number of casts used
8877 (Const.ChangeType): New routine to enable reuse of the constant
8878 type changing code from statement.
8880 * typemanager.cs (ChangeType): Move common initialization to
8881 static global variables.
8885 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8886 every value type to go through, even if it was void. Fix that.
8888 * cs-tokenizer.cs: Use is_identifier_start_character on the start
8889 character of the define, and the is_identifier_part_character for
8890 the rest of the string.
8892 2003-11-05 Miguel de Icaza <miguel@ximian.com>
8894 * expression.cs (UnaryMutator.EmitCode): When I updated
8895 LocalVariableReference.DoResolve, I overdid it, and dropped an
8896 optimization done on local variable references.
8898 2003-11-04 Miguel de Icaza <miguel@ximian.com>
8900 * ecore.cs: Convert the return from Ldlen into an int.
8902 2003-10-20 Miguel de Icaza <miguel@ximian.com>
8904 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8905 the accessibility, this is a special case for toplevel non-public
8906 classes (internal for instance).
8908 2003-10-20 Nick Drochak <ndrochak@gol.com>
8910 * ecore.cs: Fix typo and build. Needed another right paren.
8912 2003-10-19 Miguel de Icaza <miguel@ximian.com>
8914 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
8915 `internal' case regular and protected, but not allowing protected
8916 to be evaluated later. Bug 49840
8918 2003-10-15 Miguel de Icaza <miguel@ximian.com>
8920 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8921 to kb.Nlast, and not the kb.nFirst to isolate the switch
8924 Extract the underlying type, so enumerations of long/ulong are
8925 treated like long/ulong.
8927 2003-10-14 Miguel de Icaza <miguel@ximian.com>
8929 * expression.cs (New): Overload the meaning of RequestedType to
8930 track the possible creation of the NewDelegate type, since
8931 DoResolve is invoked more than once for new constructors on field
8934 See bugs: #48800 and #37014
8936 * cs-parser.jay (declare_local_constants): Take an arraylist
8937 instead of a single constant.
8939 (local_constant_declaration): It should take a
8940 constant_declarators, not a constant_declarator. Fixes 49487
8942 * convert.cs: Fix error report.
8944 2003-10-13 Jackson Harper <jackson@ximian.com>
8946 * typemanager.cs (TypeToCoreType): Add float and double this fixes
8949 2003-10-09 Martin Baulig <martin@ximian.com>
8951 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8953 (MethodCore.DoDefineParameters): Removed the TypeContainer
8954 argument; use the DeclSpace which was passed to the .ctor instead.
8955 (MethodCore.CheckParameter): Take a DeclSpace instead of a
8956 TypeContainer; we only need a DeclSpace here.
8958 2003-10-09 Martin Baulig <martin@ximian.com>
8960 * class.cs (MethodData): Added additional `DeclSpace ds' argument
8962 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8963 EmitContext's .ctor.
8965 2003-10-09 Martin Baulig <martin@ximian.com>
8967 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8968 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8969 AsAccessible(), moved them as well.
8971 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8973 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8975 * cs-parser.jay : Renamed yyName to yyNames related to jay.
8977 2003-10-07 Miguel de Icaza <miguel@ximian.com>
8979 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8980 generation for >=, as spotted by Paolo, bug 48679.
8981 Patch from David Waite.
8983 * cs-tokenizer.cs: Add handling for #pragma.
8985 * cs-parser.jay: Allow for both yield and yield return in the
8986 syntax. The anti-cobolization of C# fight will go on!
8988 * class.cs (TypeBuilder.DefineType): Catch error condition here
8989 (Parent.DefineType erroring out and returning null).
8991 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8992 coping with enumerations variables, we were mistakenly processing
8993 them as a regular value type instead of built-in types. Fixes the
8996 * typemanager.cs (IsBuiltinOrEnum): New method.
8998 2003-09-30 Miguel de Icaza <miguel@ximian.com>
9000 * cs-parser.jay: Upgrade: yield now needs the return clause.
9002 2003-09-19 Martin Baulig <martin@ximian.com>
9004 * decl.cs (MemberCache.SetupCacheForInterface): Take a
9005 `MemberCache parent' argument. Normally, an interface doesn't
9006 have a parent type except System.Object, but we use this in gmcs
9007 for generic type parameters.
9009 2003-09-18 Martin Baulig <martin@ximian.com>
9011 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9012 on `type.IsInterface'; don't check whether the type has a parent
9013 to determine whether it's an interface.
9015 2003-09-15 Martin Baulig <martin@ximian.com>
9017 * class.cs (TypeContainer.DefineType): Added an error flag to
9018 avoid reporting duplicate CS0146's ("class definition is
9021 * driver.cs (Driver.MainDriver): Abort if
9022 RootContext.ResolveTree() reported any errors.
9024 2003-09-07 Martin Baulig <martin@ximian.com>
9026 * report.cs (Error, Warning): Added overloaded versions which take
9027 a `params object[] args' and call String.Format().
9029 2003-09-07 Martin Baulig <martin@ximian.com>
9031 * decl.cs (DeclSpace..ctor): Don't call
9032 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9033 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
9034 (DeclSpace.RecordDecl): New method.
9036 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9038 2003-09-02 Ravi Pratap <ravi@ximian.com>
9040 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9041 value attributes to be applied to ParameterBuilders.
9043 * class.cs (MethodCore.LabelParameters): Make static and more
9044 generic so that it can be used from other places - like interface
9045 methods, for instance.
9047 * interface.cs (Interface.Emit): Call LabelParameters before
9048 emitting attributes on the InterfaceMethod.
9050 2003-08-26 Martin Baulig <martin@ximian.com>
9052 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9053 resolving aliases; fixes #47927.
9055 2003-08-26 Martin Baulig <martin@ximian.com>
9057 * statement.cs (Using.DoResolve): This is internally emitting a
9058 try/finally clause, so we need to set ec.NeedExplicitReturn if we
9059 do not always return. Fixes #47681.
9061 2003-08-26 Martin Baulig <martin@ximian.com>
9063 * decl.cs (MemberCore): Moved WarningNotHiding(),
9064 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9066 (AdditionResult): Make this nested in DeclSpace.
9067 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9068 argument; call NamespaceEntry.Define() unless we're nested in a
9071 * namespace.cs (Namespace.DefineName): New public function. This
9072 is called from DeclSpace's .ctor to add
9073 (Namespace.Lookup): Include DeclSpaces in the lookup.
9075 * class.cs (Operator): Derive from MemberBase, not MemberCore.
9077 * const.cs (Const): Derive from MemberBase, not MemberCore.
9079 2003-08-25 Martin Baulig <martin@ximian.com>
9081 * convert.cs (Convert.ExplicitReferenceConversion): When
9082 converting from an interface type to a class, unbox if the target
9083 type is a struct type. Fixes #47822.
9085 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9087 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9090 2003-08-22 Martin Baulig <martin@ximian.com>
9092 * class.cs (TypeManager.DefineType): When defining a nested type,
9093 call DefineType() on our parent; fixes #47801.
9095 2003-08-22 Martin Baulig <martin@ximian.com>
9097 * class.cs (MethodData.Define): While checking if a method is an
9098 interface implementation, improve the test a bit more to fix #47654.
9100 2003-08-22 Martin Baulig <martin@ximian.com>
9102 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9103 correctly; fixes #47722.
9105 2003-08-22 Martin Baulig <martin@ximian.com>
9107 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9108 LocalVariableReference, ensure it's not read-only. Fixes #47536.
9110 * statement.cs (Fixed.DoResolve): Make all variables read-only.
9112 2003-08-22 Martin Baulig <martin@ximian.com>
9114 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9115 can only be assigned in static constructors. Fixes #47161.
9117 2003-08-22 Martin Baulig <martin@ximian.com>
9119 Rewrote and improved the flow analysis code.
9121 * flowbranching.cs (FlowBranching): Make this class abstract.
9122 (FlowBranching.CreateBranching): New static function to create a
9124 (FlowBranchingBlock, FlowBranchingException): New classes.
9125 (FlowBranching.UsageVector.Type): New public readonly field.
9126 (FlowBranching.UsageVector.Breaks): Removed the setter.
9127 (FlowBranching.UsageVector.Returns): Removed the setter.
9128 (FlowBranching.UsageVector): Added Break(), Return(),
9129 NeverReachable() and Throw() methods to modify the reachability.
9130 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9131 done by FlowBranching.Merge().
9132 (FlowBranching.UsageVector.MergeChild): New method; merges the
9133 merge result into the current vector.
9134 (FlowBranching.Merge): New abstract method to merge a branching.
9136 2003-08-12 Martin Baulig <martin@ximian.com>
9138 * expression.cs (Indirection.CacheTemporaries): Create the
9139 LocalTemporary with the pointer type, not its element type.
9141 2003-08-10 Miguel de Icaza <miguel@ximian.com>
9143 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9144 token was a keyword or not.
9146 Add `error' options where an IDENTIFIER was expected; Provide
9147 CheckToken and CheckIdentifierToken convenience error reporting
9150 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9152 * decl.cs: Rename `NamespaceEntry Namespace' public field into
9153 NameSpaceEntry NameSpaceEntry.
9155 (LookupInterfaceOrClass): Avoid creating a full qualified name
9156 from namespace and name: avoid doing lookups when we know the
9157 namespace is non-existant. Use new Tree.LookupByNamespace which
9158 looks up DeclSpaces based on their namespace, name pair.
9160 * driver.cs: Provide a new `parser verbose' to display the
9161 exception thrown during parsing. This is turned off by default
9162 now, so the output of a failure from mcs is more graceful.
9164 * namespace.cs: Track all the namespaces defined in a hashtable
9167 (IsNamespace): New method
9169 2003-08-09 Miguel de Icaza <miguel@ximian.com>
9171 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
9172 we know that we need to concatenate (full typename can never be
9177 * statement.cs: Use a bitfield; Do not initialize to null things
9178 which are done by the constructor by default.
9180 * cs-parser.jay: bug fix, parameter was 4, not 3.
9182 * expression.cs: Just use the property;
9184 * statement.cs: No need for GetVariableInfo method.
9186 2003-08-08 Martin Baulig <martin@ximian.com>
9188 * flowanalysis.cs (FlowReturns): This is now nested in the
9189 `FlowBranching' class.
9190 (MyBitVector): Moved this here from statement.cs.
9191 (FlowBranching.SiblingType): New enum type.
9192 (FlowBranching.CreateSibling): Added `SiblingType' argument.
9194 2003-08-07 Martin Baulig <martin@ximian.com>
9196 * flowanalysis.cs (FlowBranchingType): This is now nested in the
9197 `FlowBranching' class and called `BranchingType'.
9199 2003-08-07 Martin Baulig <martin@ximian.com>
9201 * flowanalysis.cs: Moved all the control flow analysis code into
9204 2003-08-07 Martin Baulig <martin@ximian.com>
9206 * assign.cs (Assign.DoResolve): `target' must either be an
9207 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
9210 2003-08-07 Miguel de Icaza <miguel@ximian.com>
9212 * expression.cs (BinaryMethod): This kind of expression is created by the
9213 Binary class if it determines that the operator has to be handled
9216 (BinaryDelegate): This kind of expression is created if we are
9217 dealing with a + or - operator on delegates.
9219 (Binary): remove method, argumetns, and DelegateOperator: when
9220 dealing with methods,
9222 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9224 * statement.cs (Block): use bitfields for the three extra booleans
9225 we had in use. Remove unused topblock parameter.
9227 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9229 * assign.cs: Drop extra unneeded tests.
9231 2003-08-06 Miguel de Icaza <miguel@ximian.com>
9233 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9235 * statement.cs (Foreach): Use VariableStorage instead of
9238 * codegen.cs (VariableStorage): New class used by clients that
9239 require a variable stored: locals or fields for variables that
9240 need to live across yield.
9242 Maybe provide a convenience api for EmitThis+EmitLoad?
9244 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9247 2003-08-05 Miguel de Icaza <miguel@ximian.com>
9249 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9250 RemapParameterLValue): New methods that are used to turn a
9251 precomputed FieldInfo into an expression like this:
9255 The idea is to use this instead of making LocalVariableReference
9256 have more than one meaning.
9258 * cs-parser.jay: Add error production to BASE.
9260 * ecore.cs: Deal with TypeManager.GetField returning null, which
9261 is now a valid return value.
9263 (FieldExprNoAddress): New expression for Fields whose address can
9266 * expression.cs (LocalVariableReference): During the resolve
9267 phases, create new expressions if we are in a remapping context.
9268 Remove code that dealt with remapping here.
9270 (ParameterReference): same.
9272 (ProxyInstance): New expression, like the `This' expression, but
9273 it is born fully resolved. We know what we are doing, so remove
9274 the errors that are targeted to user-provided uses of `this'.
9276 * statement.cs (Foreach): our variable is now stored as an
9277 Expression; During resolution, follow the protocol, dont just
9278 assume it will return this.
9280 2003-08-06 Martin Baulig <martin@ximian.com>
9282 * support.cs (SeekableStreamReader.cs): New public class.
9284 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9285 SeekableStreamReader instead of the normal StreamReader.
9287 2003-08-04 Martin Baulig <martin@ximian.com>
9289 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9290 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9291 deambiguate casts and delegate invocations.
9292 (parenthesized_expression): Use the new tokens to ensure this is
9293 not a cast of method invocation.
9295 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9296 when reading a `)' and Deambiguate_CloseParens () was previously
9299 * expression.cs (ParenthesizedExpression): New class. This is
9300 just used for the CS0075 test.
9301 (Binary.DoResolve): Check for CS0075.
9303 2003-07-29 Ravi Pratap <ravi@ximian.com>
9305 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9306 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9307 reference comparison.
9309 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9310 examine the ReturnType for equality - this is necessary in the
9311 cases of implicit and explicit operators whose signature also
9312 includes the return type.
9314 2003-07-26 Miguel de Icaza <miguel@ximian.com>
9316 * namespace.cs: Cache the result of the namespace computation,
9317 instead of computing it every time.
9319 2003-07-24 Miguel de Icaza <miguel@ximian.com>
9321 * decl.cs: Use a global arraylist that we reuse over invocations
9322 to avoid excesive memory consumption. Reduces memory usage on an
9323 mcs compile by one meg (45 average).
9325 * typemanager.cs (LookupTypeReflection): In .NET pointers are
9326 private, work around that.
9328 2003-07-23 Miguel de Icaza <miguel@ximian.com>
9330 * literal.cs (IntLiteral): Define Zero and One static literals.
9332 * cs-parser.jay (integer_literal): use static literals to reduce
9333 memory usage for the most used literals (0, 1 and -1). 211kb
9334 reduced in memory usage.
9336 Replace all calls to `new ArrayList' with `new
9337 ArrayList(4)' which is a good average number for most allocations,
9338 and also requires only 16 bytes of memory for its buffer by
9341 This reduced MCS memory usage in seven megabytes for the RSS after
9344 2003-07-28 Ravi Pratap <ravi@ximian.com>
9346 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9347 handle params methods the correct way by forming only one
9348 applicable set with params and normal methods in them. Earlier we
9349 were looking at params methods only if we found no normal methods
9350 which was not the correct thing to do.
9352 (Invocation.BetterFunction): Take separate arguments indicating
9353 when candidate and the best method are params methods in their
9356 This fixes bugs #43367 and #46199.
9358 * attribute.cs: Documentation updates.
9360 (CheckAttribute): Rename to CheckAttributeTarget.
9361 (GetValidPlaces): Rename to GetValidTargets.
9363 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9364 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9368 2003-07-28 Martin Baulig <martin@ximian.com>
9370 * class.cs (TypeContainer.DefineMembers): Use the base type's full
9371 name when looking up the base class of a nested class. Fixes #46977.
9373 2003-07-26 Martin Baulig <martin@ximian.com>
9375 * expression.cs (Indexers.Indexer): New nested struct; contains
9376 getter, setter and the indexer's type.
9377 (Indexers.Properties): This is now an ArrayList of
9379 (IndexerAccess.DoResolveLValue): Correctly set the type if the
9380 indexer doesn't have any getters.
9382 * assign.cs (Assign.DoResolve): Also do the implicit conversions
9383 for embedded property and indexer assignments.
9385 2003-07-26 Martin Baulig <martin@ximian.com>
9387 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9388 preprocessor directive is not the first non-whitespace character
9391 2003-07-26 Martin Baulig <martin@ximian.com>
9393 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9394 namespace parsing, follow the spec more closely.
9396 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9397 NamespaceEntry.Lookup().
9399 2003-07-25 Martin Baulig <martin@ximian.com>
9401 * MethodCore.cs (OverridesSomething): New public field; it's set
9402 from TypeContainer.DefineMembers if this method overrides
9403 something (which doesn't need to be a method). Fix #39462.
9405 2003-07-25 Ravi Pratap <ravi@ximian.com>
9407 * typemanager.cs (GetMembers): Ensure that the list of members is
9408 reversed. This keeps things in sync.
9410 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9411 find an AttributeUsage attribute.
9413 * expression.cs (Invocation.OverloadResolve): Perform the check
9414 which disallows Invoke to be directly called on a Delegate.
9416 (Error_InvokeOnDelegate): Report error cs1533.
9418 2003-07-25 Martin Baulig <martin@ximian.com>
9420 * expression.cs (Indexers.GetIndexersForType): Only look in the
9421 interface hierarchy if the requested type is already an
9422 interface. Fixes #46788 while keeping #46502 fixed.
9424 2003-07-25 Martin Baulig <martin@ximian.com>
9426 * class.cs (TypeContainer.DefineMembers): Check whether all
9427 readonly fields have been assigned and report warning CS0649 if
9430 * statement.cs (LocalInfo.IsFixed): Always return true if this is
9433 2003-07-24 Ravi Pratap <ravi@ximian.com>
9435 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9436 returned from GetMethods to make things consistent with the
9437 assumptions MCS makes about ordering of methods.
9439 This should comprehensively fix bug #45127 and it does :-)
9441 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9442 ordering is actually reverse.
9444 * Clean up some debug messages I left lying around.
9446 * interface.cs (Populate*): Get rid of code which emits attributes
9447 since the stage in which we emit attributes is the 'Emit' stage,
9448 not the define stage.
9450 (Emit): Move attribute emission for interface members here.
9452 2003-07-22 Ravi Pratap <ravi@ximian.com>
9454 * expression.cs (Invocation.OverloadResolve): Follow the spec more
9455 closely: we eliminate methods in base types when we have an
9456 applicable method in a top-level type.
9458 Please see section 14.5.5.1 for an exact description of what goes
9461 This fixes bug #45127 and a host of other related to corlib compilation.
9463 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9464 array is the method corresponding to the top-level type (this is
9465 because of the changes made to icall.c) so we change this
9468 (MethodGroupExpr.Name): This too.
9470 * typemanager.cs (GetElementType): New method which does the right
9471 thing when compiling corlib.
9473 * everywhere: Make use of the above in the relevant places.
9475 2003-07-22 Martin Baulig <martin@ximian.com>
9477 * cs-parser.jay (invocation_expression): Moved
9478 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9479 `cast_expression', but create a InvocationOrCast which later
9480 resolves to either an Invocation or a Cast.
9482 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9483 method; call this before EmitStatement() to make sure that this
9484 expression can be used as a statement.
9486 * expression.cs (InvocationOrCast): New class; resolves to either
9487 an Invocation or a Cast.
9489 * statement.cs (StatementExpression): Call ResolveStatement() on
9490 the ExpressionStatement before emitting it.
9492 2003-07-21 Martin Baulig <martin@ximian.com>
9494 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9495 `ref' and `out' attributes match; fixes #46220.
9496 (MemberAccess.ResolveMemberAccess): You can't reference a type
9497 through an expression; fixes #33180.
9498 (Indexers.GetIndexersForType): Don't return the indexers from
9499 interfaces the class implements; fixes #46502.
9501 2003-07-21 Martin Baulig <martin@ximian.com>
9503 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9504 CS0661 checks; fixes bug #30442.
9506 2003-07-21 Martin Baulig <martin@ximian.com>
9508 * decl.cs (AdditionResult): Added `Error'.
9510 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9512 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9513 makes cs0031.cs actually work.
9515 2003-07-20 Martin Baulig <martin@ximian.com>
9517 * namespace.cs: Fixed that bug which caused a crash when compiling
9520 2003-07-20 Miguel de Icaza <miguel@ximian.com>
9522 * typemanager.cs (LookupTypeReflection): Never expose types which
9523 are NotPublic, NestedPrivate, NestedAssembly, or
9524 NestedFamANDAssem. We used to return these, and later do a check
9525 that would report a meaningful error, but the problem is that we
9526 would not get the real match, if there was a name override.
9528 2003-07-18 Miguel de Icaza <miguel@ximian.com>
9530 * namespace.cs (Namespace, Name): Do not compute the namespace
9531 name dynamically, compute it in the constructor. This reduced
9532 memory usage by 1697 KB.
9534 * driver.cs: Use --pause to pause at the end.
9536 2003-07-17 Peter Williams <peter@newton.cx>
9538 * Makefile: Change the name of the test target so that it doesn't
9539 conflict with the recursive test target.
9541 2003-07-17 Miguel de Icaza <miguel@ximian.com>
9543 * expression.cs (LocalVariableReference.Emit, EmitAssign,
9544 AddressOf): Do not use EmitThis, that was wrong, use the actual
9547 2003-07-15 Miguel de Icaza <miguel@ximian.com>
9549 * class.cs (MethodData.Define): While checking if a method is an
9550 interface implementation, improve the test: If we are not public
9551 (use new test here: use the computed MethodAttributes directly,
9552 instead of the parsed modifier flags) check if the `implementing'
9553 method comes from an interface or not.
9555 * pending.cs (VerifyPendingMethods): Slightly better error
9558 * makefile: add test target that does the mcs bootstrap.
9560 2003-07-16 Ravi Pratap <ravi@ximian.com>
9562 * interface.cs (Define): Do nothing here since there are no
9563 members to populate etc. Move the attribute emission out of here
9564 since this was just totally the wrong place to put it. Attribute
9565 application happens during the 'Emit' phase, not in the 'Define'
9568 (Emit): Add this method and move the attribute emission here
9570 * rootcontext.cs (EmitCode): Call the Emit method on interface
9573 2003-07-14 Ravi Pratap M <ravi@ximian.com>
9575 * expression.cs (OverloadResolve): Report error only if Location
9576 is not 'Null' which means that there was a probe going on.
9578 2003-07-14 Martin Baulig <martin@ximian.com>
9580 * expression.cs (ConditionalLogicalOperator): New public class to
9581 implement user defined conditional logical operators.
9582 This is section 14.11.2 in the spec and bug #40505.
9584 2003-07-14 Martin Baulig <martin@ximian.com>
9586 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9588 2003-07-14 Martin Baulig <martin@ximian.com>
9590 * codegen.cs (EmitContext.InFixedInitializer): New public field.
9592 * ecore.cs (IVariable.VerifyFixed): New interface method.
9594 * expression.cs (Unary.ResolveOperator): When resolving the `&'
9595 operator, check whether the variable is actually fixed. Fixes bug
9596 #36055. Set a variable definitely assigned when taking its
9597 address as required by the spec.
9599 * statement.cs (LocalInfo.IsFixed): New field.
9600 (LocalInfo.MakePinned): Set `IsFixed' to true.
9602 2003-07-14 Ravi Pratap M <ravi@ximian.com>
9604 * attribute.cs (Attribute.Resolve): While doing a Member lookup
9605 for .ctors, ensure that we only ask for members declared in the
9606 attribute type (BindingFlags.DeclaredOnly).
9610 * expression.cs (Error_WrongNumArguments): Report error 1501
9611 correctly the way CSC does.
9613 2003-07-13 Martin Baulig <martin@ximian.com>
9615 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9616 lookup on the fully qualified name, to make things like "X.X" work
9617 where "X.X" is a fully qualified type name, but we also have a
9618 namespace "X" in the using list. Fixes #41975.
9620 2003-07-13 Martin Baulig <martin@ximian.com>
9622 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9623 function. If we're a CompoundAssign, we need to create an embedded
9624 CompoundAssign, not an embedded Assign.
9625 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9628 2003-07-13 Martin Baulig <martin@ximian.com>
9630 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9631 work to fix bug #46088.
9633 2003-07-13 Ravi Pratap <ravi@ximian.com>
9635 * class.cs (Operator.Emit): Do not emit attributes here - it is
9636 taken care of by the Method class that we delegate too. This takes
9639 2003-07-10 Martin Baulig <martin@ximian.com>
9641 * expression.cs (TypeOfVoid): New class.
9642 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
9644 2003-07-10 Martin Baulig <martin@ximian.com>
9646 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9649 2003-07-10 Martin Baulig <martin@ximian.com>
9651 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9652 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9654 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9656 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9658 2003-07-10 Martin Baulig <martin@ximian.com>
9660 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9661 of decimal. Fixes #42850.
9663 NOTE: I also fixed the created byte blob, but this doesn't work on
9664 the MS runtime and csc never produces any byte blobs for decimal
9667 2003-07-10 Martin Baulig <martin@ximian.com>
9669 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9670 structs; fixes #32068.
9671 (Block.AddChildVariableNames): Fixed #44302.
9673 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9675 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9677 2003-07-07 Miguel de Icaza <miguel@ximian.com>
9679 * attribute.cs: And this test is onger needed.
9681 2003-07-08 Martin Baulig <martin@ximian.com>
9683 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9684 inaccessible types. Fixes #36313.
9686 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9688 * namespace.cs (NamespaceEntry): Create implicit entries for all
9689 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9690 implicit entries for N1.N2 and N1.
9692 2003-07-08 Martin Baulig <martin@ximian.com>
9694 Rewrote the handling of namespaces to fix a lot of the issues
9695 wrt. `using' aliases etc.
9697 * namespace.cs (Namespace): Splitted this class into a
9698 per-assembly `Namespace' and a per-file `NamespaceEntry'.
9700 * typemanager.cs (TypeManager.IsNamespace): Removed.
9701 (TypeManager.ComputeNamespaces): Only compute namespaces from
9702 loaded assemblies here, not the namespaces from the assembly we're
9703 currently compiling.
9705 2003-07-08 Martin Baulig <martin@ximian.com>
9707 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9709 2003-07-07 Miguel de Icaza <miguel@ximian.com>
9711 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9714 I thought about the memory savings here, but LookupTypeReflection
9715 is used under already very constrained scenarios. Compiling
9716 corlib or mcs only exposes one hit, so it would not really reduce
9717 any memory consumption.
9719 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9721 * typemanager.cs: fixes bug #45889 by only adding public types from
9722 other assemblies to the list of known types.
9724 2003-07-07 Miguel de Icaza <miguel@ximian.com>
9726 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9727 on the type we resolved.
9729 2003-07-05 Martin Baulig <martin@ximian.com>
9731 * pending.cs (PendingImplementation.ParentImplements): Don't
9732 create the proxy if the parent is abstract.
9734 * class.cs (TypeContainer.DefineIndexers): Process explicit
9735 interface implementations first. Fixes #37714.
9737 2003-07-04 Miguel de Icaza <miguel@ximian.com>
9739 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9740 defined recursively; but since we modify the input parameters
9741 (left is set to `this' temporarily), we reset this value if the
9742 left_is_explicit is false, which gives the original semantics to
9745 * literal.cs (NullPointer): new class used to represent a null
9746 literal in a pointer context.
9748 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9749 type is a pointer, use a NullPointer object instead of a
9750 NullLiteral. Closes 43687
9752 (ExplicitConversion): Convert pointer values using
9753 the conv opcode to the proper type.
9755 * ecore.cs (New): change ValueTypeVariable property into a method,
9756 that returns whether the valuetype is suitable for being used.
9758 * expression.cs (Binary.DoNumericPromotions): Only return if we
9759 the int constant was a valid uint, and we can return both left and
9760 right as uints. If not, we continue processing, to trigger the
9761 type conversion. This fixes 39018.
9763 * statement.cs (Block.EmitMeta): During constant resolution, set
9764 the CurrentBlock property on the emitcontext, so that we resolve
9765 constants propertly.
9767 2003-07-02 Martin Baulig <martin@ximian.com>
9769 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9770 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9772 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9773 than emitting it here.
9775 * statement.cs: Fixed some more flow analysis bugs.
9777 2003-07-02 Martin Baulig <martin@ximian.com>
9779 * class.cs (MethodData.Define): When implementing interface
9780 methods, set Final unless we're Virtual.
9782 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9783 check work for interface methods.
9785 2003-07-01 Martin Baulig <martin@ximian.com>
9787 * ecore.cs (EmitContext.This): Replaced this property with a
9788 GetThis() method which takes a Location argument. This ensures
9789 that we get the correct error location for a CS0188.
9791 2003-07-01 Miguel de Icaza <miguel@ximian.com>
9793 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9794 ImplicitStandardConversion.
9796 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9798 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
9800 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9803 2003-06-30 Miguel de Icaza <miguel@ximian.com>
9805 * class.cs (Constructor.Define): Turn off initlocals for unsafe
9808 (MethodData.Define): Turn off initlocals for unsafe methods.
9810 2003-06-29 Miguel de Icaza <miguel@ximian.com>
9812 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9813 complete; Fixes #37521.
9815 * delegate.cs: Use Modifiers.TypeAttr to compute the
9816 TypeAttributes, instead of rolling our own. This makes the flags
9817 correct for the delegates.
9819 2003-06-28 Miguel de Icaza <miguel@ximian.com>
9821 * class.cs (Constructor.Define): Set the private flag for static
9822 constructors as well.
9824 * cs-parser.jay (statement_expression): Set the return value to
9825 null, to avoid a crash when we catch an error.
9827 2003-06-24 Miguel de Icaza <miguel@ximian.com>
9829 * cs-parser.jay: Applied patch from Jackson that adds support for
9830 extern and unsafe modifiers to destructor declarations.
9832 * expression.cs: Report error 21 if the user is trying to index a
9835 * driver.cs: Add an error message, suggested by the bug report.
9837 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9838 if we do not have a ": this ()" constructor initializer. Fixes 45149
9840 2003-06-14 Miguel de Icaza <miguel@ximian.com>
9842 * namespace.cs: Add some information to reduce FAQs.
9844 2003-06-13 Miguel de Icaza <miguel@ximian.com>
9846 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9847 underlying enumeration types. Fixes #43915.
9849 * expression.cs: Treat ushort/short as legal values to be used in
9852 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9854 * delegate.cs: transfer custom attributes for paramenters from
9855 the delegate declaration to Invoke and BeginInvoke.
9857 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9859 * attribute.cs: handle custom marshalers and emit marshal info
9862 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
9864 * makefile.gnu: Added anonymous.cs to the compiler sources.
9866 2003-05-28 Miguel de Icaza <miguel@ximian.com>
9868 * iterators.cs: Change the name of the proxy class to include two
9871 * cs-parser.jay: Update grammar to include anonymous methods.
9873 * anonymous.cs: new file.
9875 2003-05-27 Miguel de Icaza <miguel@ximian.com>
9877 * class.cs (Field.Define): Add missing test for pointers and
9880 2003-05-27 Ravi Pratap <ravi@ximian.com>
9882 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9883 we use the stobj opcode.
9885 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9886 since it wasn't the correct fix.
9888 It still is puzzling that we are required to use stobj for IntPtr
9889 which seems to be a ValueType.
9891 2003-05-26 Miguel de Icaza <miguel@ximian.com>
9893 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9894 during regular simple name resolution. Now, the trick is that
9895 instead of returning for processing the simplename, we do a
9896 TypeManager.LookupType (ie, a rooted lookup as opposed to a
9897 contextual lookup type). If a match is found, return that, if
9898 not, return for further composition.
9900 This fixes long-standing 30485.
9902 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9903 using the address to initialize an object, do an Stobj instead of
9904 using the regular Stelem.
9906 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9907 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9908 Because if we are a BaseIndexerAccess that value will be true.
9911 * statement.cs (GotoCase.Resolve): Return after reporting an
9912 error, do not attempt to continue.
9914 * expression.cs (PointerArithmetic.Emit): If our operand is a
9915 long, convert our constants to match the operand before
9916 multiplying. Convert to I type before adding. Fixes 43670.
9918 2003-05-14 Ravi Pratap <ravi@ximian.com>
9920 * enum.cs (ImplicitConversionExists) : Rename to
9921 ImplicitEnumConversionExists to remove ambiguity.
9923 * ecore.cs (NullCast): New type of cast expression class which
9924 basically is very similar to EmptyCast with the difference being
9925 it still is a constant since it is used only to cast a null to
9929 * convert.cs (ImplicitReferenceConversion): When casting a null
9930 literal, we return a NullCast.
9932 * literal.cs (NullLiteralTyped): Remove - I don't see why this
9933 should be around anymore.
9935 The renaming (reported was slightly wrong). Corrections:
9937 ConvertImplicitStandard -> ImplicitConversionStandard
9938 ConvertExplicitStandard -> ExplicitConversionStandard
9940 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9941 before passing them in !
9943 * convert.cs (ImplicitConversionStandard): When comparing for
9944 equal expr and target types, ensure that expr is not a
9947 In general, we must not be checking (expr_type ==
9948 target_type) in the top level conversion methods
9949 (ImplicitConversion, ExplicitConversion etc). This checking is
9950 done in the methods that they delegate to.
9952 2003-05-20 Miguel de Icaza <miguel@ximian.com>
9954 * convert.cs: Move Error_CannotConvertType,
9955 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9956 ImplicitNumericConversion, ImplicitConversionExists,
9957 ImplicitUserConversionExists, StandardConversionExists,
9958 FindMostEncompassedType, FindMostSpecificSource,
9959 FindMostSpecificTarget, ImplicitUserConversion,
9960 ExplicitUserConversion, GetConversionOperators,
9961 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9962 TryImplicitIntConversion, Error_CannotConvertImplicit,
9963 ConvertImplicitRequired, ConvertNumericExplicit,
9964 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9965 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9968 Perform the following renames:
9970 StandardConversionExists -> ImplicitStandardConversionExists
9971 ConvertImplicit -> ImplicitConversion
9972 ConvertImplicitStandard -> ImplicitStandardConversion
9973 TryImplicitIntConversion -> ImplicitIntConversion
9974 ConvertImplicitRequired -> ImplicitConversionRequired
9975 ConvertNumericExplicit -> ExplicitNumericConversion
9976 ConvertReferenceExplicit -> ExplicitReferenceConversion
9977 ConvertExplicit -> ExplicitConversion
9978 ConvertExplicitStandard -> ExplicitStandardConversion
9980 2003-05-19 Martin Baulig <martin@ximian.com>
9982 * statement.cs (TypeInfo.StructInfo): Made this type protected.
9983 (TypeInfo): Added support for structs having structs as fields.
9985 * ecore.cs (FieldExpr): Implement IVariable.
9986 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9987 VariableInfo for the field.
9989 2003-05-18 Martin Baulig <martin@ximian.com>
9991 * expression.cs (This.DoResolve): Report a CS0027 if we're
9992 emitting a field initializer.
9994 2003-05-18 Martin Baulig <martin@ximian.com>
9996 * expression.cs (This.ResolveBase): New public function.
9997 (This.DoResolve): Check for CS0188.
9999 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10002 * ecore.cs (MethodGroupExpr.DoResolve): Set the
10003 `instance_expression' to null if we don't have any non-static
10006 2003-05-18 Martin Baulig <martin@ximian.com>
10008 Reworked the way how local variables and parameters are handled by
10009 the flow analysis code.
10011 * statement.cs (TypeInfo, VariableMap): New public classes.
10012 (VariableInfo): New public class. This is now responsible for
10013 checking whether a variable has been assigned. It is used for
10014 parameters and local variables.
10015 (Block.EmitMeta): Take the InternalParameters as argument; compute
10016 the layout of the flow vectors here.
10017 (Block.LocalMap, Block.ParameterMap): New public properties.
10018 (FlowBranching): The .ctor doesn't get the InternalParameters
10019 anymore since Block.EmitMeta() now computes the layout of the flow
10021 (MyStructInfo): This class is now known as `StructInfo' and nested
10022 in `TypeInfo'; we don't access this directly anymore.
10024 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10025 property and removed IsAssigned(), IsFieldAssigned(),
10026 SetAssigned() and SetFieldAssigned(); we now call them on the
10027 VariableInfo so we don't need to duplicate this code everywhere.
10029 * expression.cs (ParameterReference): Added `Block block' argument
10031 (LocalVariableReference, ParameterReference, This): The new
10032 VariableInfo class is now responsible for all the definite
10035 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10036 IsParameterAssigned, SetParameterAssigned): Removed.
10038 2003-05-18 Martin Baulig <martin@ximian.com>
10040 * typemanager.cs (InitCoreTypes): Try calling
10041 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10042 the 3-args-version. Corlib now also needs our `void_type'.
10043 (GetMethod): Added overloaded version which takes an optional
10044 `bool report_errors' to allow lookups of optional methods.
10046 2003-05-12 Martin Baulig <martin@ximian.com>
10048 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10049 only used for locals and not for parameters.
10051 2003-05-12 Miguel de Icaza <miguel@ximian.com>
10053 * support.cs (InternalParameters.ParameterType): Return the
10054 ExternalType of the parameter.
10056 * parameter.cs (Parameter.ExternalType): drop the two arguments,
10059 2003-05-11 Miguel de Icaza <miguel@ximian.com>
10061 * class.cs (MethodData.Define): Do not set the `newslot' on
10062 interface members, if they are also flagged as "override".
10064 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10065 better code for ++i and i++. This only works for static fields
10066 and local variables.
10068 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10069 want to pull the DeclSpace out of the builder_to_declspace instead
10070 of the TypeBuilder (like in TypeContainer.FindMembers).
10072 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10073 instead of LookupTypeContainer. Fixes the crash on .NET for
10074 looking up interface members.
10076 * const.cs: Create our own emit context during the Definition
10077 stage, so that constants are evaluated in the proper context, when
10078 a recursive definition happens.
10080 2003-05-11 Martin Baulig <martin@ximian.com>
10082 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
10083 new block for a switch section.
10084 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10085 the adding/lookup in the switch block. Fixes #39828.
10087 2003-05-09 Miguel de Icaza <miguel@ximian.com>
10089 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10090 functionality: I needed to convert the data after I had performed
10091 the add/sub operation into the operands type size.
10093 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10094 pass the type for the box operation, otherwise the resulting
10095 object would have been of type object.
10097 (BoxedCast): Add constructor to specify the type to box as.
10099 2003-05-07 Miguel de Icaza <miguel@ximian.com>
10101 * iterators.cs: I was reusing the `count' variable inadvertently,
10102 take steps to not allow this to happen.
10104 2003-05-06 Miguel de Icaza <miguel@ximian.com>
10106 * attribute.cs (Attribute.Resolve): Params attributes are encoded
10107 by creating an array at the point where the params starts and
10108 putting all those arguments there, then adjusting the size of the
10111 2003-05-05 Miguel de Icaza <miguel@ximian.com>
10113 * expression.cs (New.AddressOf): Implement interface
10114 IMemoryLocation. This is used when the `new' operator is used in
10115 the context of an invocation to a method on a value type.
10117 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10120 * namespace.cs: Also check the using aliases here.
10122 * driver.cs: Move the test for using validity after the types have
10123 been entered, so we do a single pass that also includes the using
10126 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10127 in the regular case. CreateSiblingForFinally is doing extra
10130 * attribute.cs (GetAttributeArgumentExpression): Store the result
10131 on an out value, and use the return value to indicate failure
10132 instead of using null (which is a valid return for Constant.GetValue).
10134 * statement.cs: Perform the analysis flow for the increment
10135 portion after the statement, because this will be the real flow of
10136 execution. Fixes #42385
10138 * codegen.cs (EmitContext.EmitArgument,
10139 EmitContext.EmitStoreArgument): New helper functions when the
10140 RemapToProxy flag is set.
10142 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10145 Add support for remapping parameters.
10147 * iterators.cs: Propagate parameter values; Store parameter
10148 values in the proxy classes.
10150 2003-05-04 Miguel de Icaza <miguel@ximian.com>
10152 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
10153 need a proxy reference; I do not know what I was thinking
10155 * cs-parser.jay (constructor_initializer): catch another error,
10156 and display nice message.
10158 (field_declaration): catch void field declaration
10159 to flag a better error.
10161 * class.cs (MemberBase.CheckBase): Report an error instead of a
10162 warning if a new protected member is declared in a struct.
10163 (Field.Define): catch the error of readonly/volatile.
10165 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10167 (FieldExpr.AddressOf): ditto. Catch error where the address of a
10168 volatile variable is taken
10170 2003-05-02 Miguel de Icaza <miguel@ximian.com>
10172 * statement.cs (Fixed.Resolve): Report an error if we are not in
10175 2003-05-01 Miguel de Icaza <miguel@ximian.com>
10177 * typemanager.cs: reuse the code that handles type clashes for
10178 delegates and enumerations.
10180 * class.cs (Report28): Always report.
10182 * expression.cs (EncodeAsAttribute): Allow nulls here.
10184 2003-04-28 Miguel de Icaza <miguel@ximian.com>
10186 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10187 the functionality for testing whether an expression is valid for
10188 an attribute here. Also handle the case of arrays of elements
10191 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10192 encoding a linear array into an array of objects that are suitable
10193 to be passed to an CustomAttributeBuilder.
10195 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10197 * ecore.cs: (FieldExpr): Handle field remapping here.
10199 * iteratators.cs: Pass the instance variable (if the method is an
10200 instance method) to the constructors, so we can access the field
10201 variables on the class.
10203 TODO: Test this with structs. I think the THIS variable on
10204 structs might have to be a pointer, and not a refenrece
10206 2003-04-27 Miguel de Icaza <miguel@ximian.com>
10208 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10209 local variables to fields in a proxy class.
10211 * iterators.cs (PopulateProxy): Rename our internal fields to
10213 Create a <THIS> field if we are an instance method, so we can
10214 reference our parent container variables.
10215 (MapVariable): Called back from the EmitContext code to enter a
10216 new variable to field mapping into the proxy class (we just create
10220 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10221 for using the remapped locals to fields.
10223 I placed the code here, because that gives the same semantics to
10224 local variables, and only changes the Emit code.
10226 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10227 statements inside iterators.
10228 (VariableInfo): Add a FieldBuilder for the cases when we are
10229 remapping local variables to fields in a proxy class
10231 * ecore.cs (SimpleNameResolve): Avoid testing two times for
10232 current_block != null.
10234 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10235 not cope with strings, as it has been moved to the
10236 TableSwitchEmit. Fixed bug in switch generation.
10238 * expression.cs (New.DoResolve): Provide more context for the user
10239 when reporting an error.
10241 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10244 * expression.cs (MemberAccess.DoResolve): When we get a type back,
10245 check the permissions for it. Note than in a type-resolution
10246 context the check was already present in DeclSpace.ResolveType,
10247 but was missing from the MemberAccess.
10249 (ArrayCreation.CheckIndices): warn if the user has
10250 more nested levels of expressions, but there are no more
10251 dimensions specified. Avoids crash on bug 41906.
10253 2003-04-26 Miguel de Icaza <miguel@ximian.com>
10255 * statement.cs (Block): replace Implicit bool, for a generic
10257 New flag: `Unchecked'. This is used during the EmitMeta phase
10258 (which is out-of-line with the regular Resolve/Emit process for a
10259 statement, as this is done ahead of time, but still gets a chance
10260 to call constant resolve).
10262 (Block.Flags): new enum for adding a new flag.
10264 (Block.EmitMeta): track the state of unchecked.
10266 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10267 to enable constant resolution to work there as well.
10269 2003-04-22 Miguel de Icaza <miguel@ximian.com>
10271 * typemanager.cs (ienumerable_type): Also look up
10272 System.Collections.IEnumerable.
10274 2003-04-21 Miguel de Icaza <miguel@ximian.com>
10276 TODO: Test more than one conditional per method.
10278 * class.cs (Indexer.Define): Report the location where the user is
10279 referencing the unsupported feature.
10281 (MethodData): Overload the use of `conditionals' to
10282 minimize the creation of needless ArrayLists. This saves roughly
10283 212kb on my machine.
10285 (Method): Implement the new IIteratorContainer interface.
10286 (Method.SetYields): Implement the method by setting the ModFlags
10287 to contain METHOD_YIELDS.
10289 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10290 which just got set to null.
10292 * iterators.cs: New file.
10294 (Yield, YieldBreak): New statements.
10296 * statement.cs (Return.Resolve): Flag an error if we are used in
10297 an iterator method.
10299 * codegen.cs (InIterator): New flag set if the code is being
10300 compiled in an iterator method.
10302 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
10303 internal modifier, and we just use it to avoid adding extra
10304 fields, as this is seldom used.
10306 * cs-parser.jay: Add yield_statement (yield and yield break).
10308 * driver.cs: New flag -v2 to turn on version 2 features.
10310 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10311 hashtable when v2 is enabled.
10313 2003-04-20 Miguel de Icaza <miguel@ximian.com>
10315 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10316 there is already a namespace defined with this name.
10318 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10319 people upgraded their corlibs.
10321 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10322 always use fully qualified types, no need to use the compiler
10325 (TypeManager.IsNamespace): Use binarysearch.
10327 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10328 AddDelegate): I did not quite use the new IsValid API properly: I
10329 have to pass the short-name and the fullname. I was passing only
10330 the basename instead of the fullname sometimes.
10332 (TypeContainer.DefineType): call NamespaceClash.
10334 * interface.cs (Interface.DefineType): use NamespaceClash before
10337 * delegate.cs (Delegate.DefineType): use NamespaceClash before
10340 * enum.cs: (Enum.DefineType): use NamespaceClash before
10343 * typemanager.cs (: 3-line patch that gives us some tasty 11%
10344 speed increase. First, use the negative_hits cache when we get a
10345 negative. Second, add the type with its full original name
10346 instead of the new . and + encoded name (reflection uses + to
10347 separate type from a nested type). Use LookupTypeReflection
10348 directly which bypasses the type->name hashtable (that we already
10349 know does not contain the type.
10351 * decl.cs (DeclSpace.ResolveTypeExpr): track the
10352 location/container type.
10354 * driver.cs: When passing utf8, use directly the UTF8Encoding.
10356 2003-04-19 Miguel de Icaza <miguel@ximian.com>
10358 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10360 * delegate.cs (NewDelegate.Resolve): Test whether an instance
10361 method is being referenced in the method group from a static
10362 context, and report error 120 if so.
10364 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10367 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10368 is created, we create the A namespace).
10370 * cs-parser.jay: A namespace also introduces a DeclarationFound.
10373 2003-04-18 Miguel de Icaza <miguel@ximian.com>
10375 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10376 invocation to ModuleBuilder.GetType with the same values will
10377 return a new type instance, so we need to cache its return
10380 * expression.cs (Binary.ResolveOperator): Only allow the compare
10381 operators on enums if they are of the same type.
10383 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10384 types of ValueType on their own case. Before we were giving them
10385 the same treatment as objects.
10387 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10388 fullname. Short name is used to compare against container name.
10389 Fullname is used to check against defined namespace names.
10391 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10392 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10394 (Method.CheckBase): Call parent.
10395 (MemberBase.CheckBase): Check for protected members on sealed
10397 (PropertyBase.CheckBase): Call parent.
10398 (Field.Define): Call parent.
10400 * report.cs: Negative error codes are now mapped to 8000 - code,
10401 so that the display is render more nicely.
10403 * typemanager.cs: Do not use try/catch, instead report a regular
10406 (GetPointerType, GetReferenceType): These methods provide
10407 mechanisms to obtain the T* and T& from a T. We had the code
10408 previously scattered around the code base, and it also used
10409 TypeManager.LookupType that would go through plenty of caches.
10410 This one goes directly to the type source.
10412 In some places we did the Type.GetType followed by
10413 ModuleBuilder.GetType, but not in others, so this unifies the
10414 processing as well.
10416 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10417 statements now that we have namespace information.
10419 * typemanager.cs (IsNamespace): New method, returns whether the
10420 string presented is a namespace or not.
10422 (ComputeNamespaces): New public entry point, computes the list of
10423 available namespaces, using the GetNamespaces API call in Mono, or
10424 the slower version in MS.NET.
10426 Now before we start the semantic analysis phase, we have a
10427 complete list of namespaces including everything that the user has
10430 Deleted old code to cache namespaces in .nsc files.
10432 2003-04-17 Miguel de Icaza <miguel@ximian.com>
10434 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10435 class/struct location definition Location for the implicit
10436 constructor location.
10438 (Operator.Define): Use the location of the operator for the
10439 implicit Method definition.
10441 (Constructor.Emit): use the constructor location for the implicit
10442 base initializer constructor.
10444 * ecore.cs: Remove ITypeExpression. This interface is now gone,
10445 and the Expression class now contains two new methods:
10447 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
10448 isolate type lookup from the rest of the resolution process.
10450 Since we use Expressions to hold type definitions due to the way
10451 we parse the input we have historically overloaded Resolve to
10452 perform the Type lookups if a special flag is passed. Now this is
10453 eliminated and two methods take their place.
10455 The differences in the two methods between xStep and xTerminal is
10456 that xStep is involved in our current lookup system that uses
10457 SimpleNames to compose a name, while xTerminal is used just to
10458 catch the case where the simplename lookup failed.
10460 2003-04-16 Miguel de Icaza <miguel@ximian.com>
10462 * expression.cs (ResolveMemberAccess): Remove redundant code.
10463 TypeExpr expressions are always born fully resolved.
10465 * interface.cs (PopulateMethod): Do not lookup the types twice.
10466 We were doing it once during SemanticAnalysis and once during
10469 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10470 in local variable type definitions, were being returned as a
10471 SimpleName (we decomposed everything into a string), that is
10472 because primary_expression was being used instead of a type in the
10473 grammar (reduce/reduce conflicts).
10475 The part that was wrong is that we converted the expression into a
10476 string (an oversimplification in one hand, compounded with primary
10477 expressions doing string concatenation).
10483 Would return "A.B.C[]" as a SimpleName. This stopped things like
10484 using clauses from working on this particular context. And a type
10485 was being matched directly against "A.B.C[]".
10487 We now use the correct approach, and allow for ComposedCast to be
10488 part of the unary expression. So the "A.B.C []" become a composed
10489 cast of "A.B.C" (as a nested group of MemberAccess with a
10490 SimpleName at the end) plus the rank composition "[]".
10494 2003-04-10 Miguel de Icaza <miguel@ximian.com>
10496 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10497 for the access level checking.
10499 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
10500 `TypeContainer container', because I kept getting confused when I
10501 was debugging this code.
10503 * expression.cs (Indexers): Instead of tracking getters/setters,
10504 we now track them in parallel. We create one arraylist less, but
10505 most importantly it is possible now for the LValue code to find a
10506 matching get for a set.
10508 (IndexerAccess.DoResolveLValue): Update the code.
10509 GetIndexersForType has been modified already to extract all the
10510 indexers from a type. The code assumed it did not.
10512 Also make the code set the correct return type for the indexer.
10513 This was fixed a long time ago for properties, but was missing for
10514 indexers. It used to be void_type.
10516 (Binary.Emit): Test first for doubles instead of
10517 floats, as they are more common.
10519 (Binary.EmitBranchable): Use the .un version of the branch opcodes
10520 when dealing with floats and the <=, >= operators. This fixes bug
10523 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10524 to load the array value by emitting a load on the foreach variable
10525 type. This was incorrect.
10527 We now emit the code to load an element using the the array
10528 variable type, and then we emit the conversion operator.
10532 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
10534 * attribute.cs: Avoid allocation of ArrayLists in the common case.
10536 2003-04-09 Miguel de Icaza <miguel@ximian.com>
10538 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10539 test for protection before we test for signatures.
10541 (MethodSignature.ToString): implement.
10543 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10544 to the case where we reduced into a LongConstant.
10546 * decl.cs (CheckAccessLevel): If the type is an array, we can not
10547 depend on whether the information is acurrate, because the
10548 Microsoft runtime will always claim that the array type is public,
10549 regardless of the real state.
10551 If the type is a pointer, another problem happens: the type is
10552 reported as non-public in Microsoft.
10554 In both cases we have to call CheckAccessLevel recursively with
10555 the underlying type as the argument to be tested.
10557 2003-04-08 Miguel de Icaza <miguel@ximian.com>
10559 * assign.cs (Assign.Emit): If we are dealing with a compound
10560 assignment expression, we should use the code path that stores the
10561 intermediate result in a temporary value. This fixes #40903.
10563 *expression.cs (Indirection.ToString): Provide ToString method for
10566 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
10568 * class.cs: Null out fields holding references to Block objects so
10569 they can be garbage collected.
10571 * expression.cs (OverloadResolve): Remove unused local.
10573 2003-04-07 Martin Baulig <martin@ximian.com>
10575 * codegen.cs (EmitContext.CurrentFile): New public field.
10576 (EmitContext.Mark): Use the CurrentFile to check whether the
10577 location is in the correct file.
10578 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10580 2003-04-07 Martin Baulig <martin@ximian.com>
10582 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10584 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10585 location. [FIXME: The location argument which gets passed to this
10586 method is sometimes wrong!]
10588 2003-04-07 Nick Drochak <ndrochak@gol.com>
10590 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10592 2003-04-07 Miguel de Icaza <miguel@ximian.com>
10594 * expression.cs (Indirection.EmitAssign): We were using the
10595 temporary, but returning immediately instead of continuing the
10598 2003-04-06 Martin Baulig <martin@ximian.com>
10600 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10601 if it's a nested child, but also deriving from the outer class.
10604 * typemanager.cs (IsNestedChildOf): Make this work if it's a
10605 nested child, but also deriving from the outer class. See
10607 (FilterWithClosure): We may access private members of the outer
10608 class if we're a nested child and deriving from the outer class.
10609 (RealMemberLookup): Only set `closure_private_ok' if the
10610 `original_bf' contained BindingFlags.NonPublic.
10612 2003-04-05 Martin Baulig <martin@ximian.com>
10614 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10616 2003-04-02 Miguel de Icaza <miguel@ximian.com>
10618 * class.cs (Event.Define): Do not allow abstract events to have
10621 2003-04-01 Miguel de Icaza <miguel@ximian.com>
10623 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10624 block in event declarations.
10626 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10627 value type, get its address.
10629 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10630 leaving a class on the stack instead of a boolean value (int
10631 0/1). Change the code so we compare against null, and then the
10632 result against zero.
10634 * class.cs (TypeContainer.GetClassBases): We were checking for the
10635 parent class being sealed too late.
10637 * expression.cs (Binary.Emit): For <= and >= when dealing with
10638 floating point values, use cgt.un and clt.un instead of cgt and
10641 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
10643 * statement.cs: Apply the same optimization as MS: skip the
10644 GetEnumerator returning an IEnumerator, and use the one returning a
10645 CharEnumerator instead. This allows us to avoid the try-finally block
10648 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
10650 * cs-parser.jay: Attributes cannot be applied to
10651 namespaces. Fixes #40473
10653 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10656 (Add*): check if the name is valid using the full name for constants,
10657 fields, properties and events.
10659 2003-03-28 Miguel de Icaza <miguel@ximian.com>
10661 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10662 char constants to be part of the enumeration.
10664 * expression.cs (Conditional.DoResolve): Add support for operator
10665 true. Implements the missing functionality from 14.12
10667 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10668 operator true/false as required by the spec.
10670 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10671 implicit conversion to boolean.
10673 * statement.cs (Statement.ResolveBoolean): A boolean expression is
10674 also one where the type implements `operator true'.
10676 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10677 get an expression that will invoke operator true based on an
10680 (GetConversionOperators): Removed the hack that called op_True
10683 (Expression.ResolveBoolean): Move this from Statement.
10685 2003-03-17 Miguel de Icaza <miguel@ximian.com>
10687 * ecore.cs (FieldExpr): do not allow initialization of initonly
10688 fields on derived classes
10690 2003-03-13 Martin Baulig <martin@ximian.com>
10692 * statement.cs (Block.Emit): Call ig.BeginScope() and
10693 ig.EndScope() when compiling with debugging info; call
10694 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10696 2003-03-08 Miguel de Icaza <miguel@ximian.com>
10698 * expression.cs (Indexers): Do not construct immediately, allow
10699 for new members to be appended as we go. Fixes 38143
10701 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10703 * expression.cs: save/restore context when resolving an unchecked
10706 2003-03-05 Miguel de Icaza <miguel@ximian.com>
10708 * cfold.cs: Catch division by zero in modulus operator during
10711 2003-03-03 Miguel de Icaza <miguel@ximian.com>
10713 * interface.cs (Interface.DefineMembers): Avoid defining members
10716 2003-02-27 Miguel de Icaza <miguel@ximian.com>
10718 * driver.cs: handle the +/- options for -noconfig
10720 * statement.cs (Unckeched.Resolve): Also track the state of
10721 unchecked in the Resolve phase.
10723 2003-02-27 Martin Baulig <martin@ximian.com>
10725 * ecore.cs (Expression.MemberLookup): Don't create a
10726 MethodGroupExpr for something which is not a method. Fixes #38291.
10728 2003-02-25 Miguel de Icaza <miguel@ximian.com>
10730 * class.cs (MemberBase.CheckParameters): Also check that the type
10731 is unmanaged if it is a pointer.
10733 * expression.cs (SizeOf.Resolve): Add location information.
10735 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10736 a managed type is declared.
10738 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10739 parameter modifiers as well. Fixes bug 38606
10741 * class.cs: Very sad. Am backing out the speed up changes
10742 introduced by the ArrayList -> Array in the TypeContainer, as they
10743 were not actually that much faster, and introduced a bug (no error
10744 reports on duplicated methods).
10746 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10747 source first, this will guarantee that we have a valid expression
10748 before calling in lower levels functions that will require a
10749 resolved object. Then use this original_source in the
10750 target.ResolveLValue instead of the original source that was
10753 Another change. Use target.Resolve instead of LValueResolve.
10754 Although we are resolving for LValues, we will let the Assign code
10755 take care of that (it will be called again from Resolve). This
10756 basically allows code like this:
10758 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10759 class Y { void A (X x) { x [0] += o; }
10761 The problem was that the indexer was trying to resolve for
10762 set_Item (idx, object o) and never finding one. The real set_Item
10763 was set_Item (idx, X). By delaying the process we get the right
10768 2003-02-23 Martin Baulig <martin@ximian.com>
10770 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10771 while calling DoEmit ().
10773 * codegen.cs (EmitContext.Mark): Don't mark locations in other
10774 source files; if you use the #line directive inside a method, the
10775 compiler stops emitting line numbers for the debugger until it
10776 reaches the end of the method or another #line directive which
10777 restores the original file.
10779 2003-02-23 Martin Baulig <martin@ximian.com>
10781 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10783 2003-02-23 Martin Baulig <martin@ximian.com>
10785 * statement.cs (Block.AddChildVariableNames): We need to call this
10786 recursively, not just for our immediate children.
10788 2003-02-23 Martin Baulig <martin@ximian.com>
10790 * class.cs (Event.Define): Always make the field private, like csc does.
10792 * typemanager.cs (TypeManager.RealMemberLookup): Make events
10793 actually work, fixes bug #37521.
10795 2003-02-23 Miguel de Icaza <miguel@ximian.com>
10797 * delegate.cs: When creating the various temporary "Parameters"
10798 classes, make sure that we call the ComputeAndDefineParameterTypes
10799 on those new parameters (just like we do with the formal ones), to
10800 allow them to be resolved in the context of the DeclSpace.
10802 This fixes the bug that Dick observed in Bugzilla #38530.
10804 2003-02-22 Miguel de Icaza <miguel@ximian.com>
10806 * expression.cs (ResolveMemberAccess): When resolving a constant,
10807 do not attempt to pull a constant if the value was not able to
10808 generate a valid constant.
10810 * const.cs (LookupConstantValue): Do not report more errors than required.
10812 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10814 * expression.cs: fixes bug #38328.
10816 2003-02-18 Miguel de Icaza <miguel@ximian.com>
10818 * class.cs: Changed all the various members that can be part of a
10819 class from being an ArrayList to be an Array of the right type.
10820 During the DefineType type_list, interface_list, delegate_list and
10821 enum_list are turned into types, interfaces, delegates and enums
10824 And during the member population, indexer_list, event_list,
10825 constant_list, field_list, instance_constructor_list, method_list,
10826 operator_list and property_list are turned into their real arrays.
10828 Although we could probably perform this operation earlier, for
10829 good error reporting we need to keep the lists and remove the
10830 lists for longer than required.
10832 This optimization was triggered by Paolo profiling the compiler
10833 speed on the output of `gen-sample-program.pl' perl script.
10835 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10836 not crash in methods like MemberLookupFailed that use this field.
10838 This problem arises when the compiler fails to resolve a type
10839 during interface type definition for example.
10841 2003-02-18 Miguel de Icaza <miguel@ximian.com>
10843 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10844 inherit from System.Object, so we have to stop at null, not only
10845 when reaching System.Object.
10847 2003-02-17 Miguel de Icaza <miguel@ximian.com>
10849 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10850 DeclaredOnly because the parent indexer might have had a different
10851 name, but did not loop until the top of the hierarchy was reached.
10853 The problem this one fixes is 35492: when a class implemented an
10854 indexer from an interface, we were getting the interface method
10855 (which was abstract) and we were flagging an error (can not invoke
10858 This also keeps bug 33089 functioning, and test-148 functioning.
10860 * typemanager.cs (IsSpecialMethod): The correct way of figuring
10861 out if a method is special is to see if it is declared in a
10862 property or event, or whether it is one of the predefined operator
10863 names. This should fix correctly #36804.
10865 2003-02-15 Miguel de Icaza <miguel@ximian.com>
10867 The goal here is to remove the dependency on EmptyCast.Peel ().
10868 Killing it completely.
10870 The problem is that currently in a number of places where
10871 constants are expected, we have to "probe" for an EmptyCast, and
10872 Peel, which is not the correct thing to do, as this will be
10873 repetitive and will likely lead to errors.
10875 The idea is to remove any EmptyCasts that are used in casts that
10876 can be reduced to constants, so we only have to cope with
10879 This bug hunt was triggered by Bug 37363 and the desire to remove
10880 the duplicate pattern where we were "peeling" emptycasts to check
10881 whether they were constants. Now constants will always be
10884 * ecore.cs: Use an enumconstant here instead of wrapping with
10887 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10888 throwing me off. By handling this we can get rid of a few hacks.
10890 * statement.cs (Switch): Removed Peel() code.
10892 2003-02-14 Miguel de Icaza <miguel@ximian.com>
10894 * class.cs: Location information for error 508
10896 * expression.cs (New.DoResolve): Add a guard against double
10897 resolution of an expression.
10899 The New DoResolve might be called twice when initializing field
10900 expressions (see EmitFieldInitializers, the call to
10901 GetInitializerExpression will perform a resolve on the expression,
10902 and later the assign will trigger another resolution
10904 This leads to bugs (#37014)
10906 * delegate.cs: The signature for EndInvoke should contain any ref
10907 or out parameters as well. We were not doing this in the past.
10909 * class.cs (Field.Define): Do not overwrite the type definition
10910 inside the `volatile' group. Turns out that volatile enumerations
10911 were changing the type here to perform a validity test, which
10914 2003-02-12 Miguel de Icaza <miguel@ximian.com>
10916 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10917 and structs, we do not want to load the instance variable
10919 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10920 enum_type has to be handled like an object reference (implicit
10921 conversions exists from this to object), but the regular IsClass
10922 and IsValueType tests will never return true for this one.
10924 Also we use TypeManager.IsValueType instead of type.IsValueType,
10925 just for consistency with the rest of the code (this is only
10926 needed if we ever use the construct exposed by test-180.cs inside
10927 corlib, which we dont today).
10929 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
10931 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10934 2003-02-09 Martin Baulig <martin@ximian.com>
10936 * namespace.cs (Namespace..ctor): Added SourceFile argument.
10937 (Namespace.DefineNamespaces): New static public method; this is
10938 called when we're compiling with debugging to add all namespaces
10939 to the symbol file.
10941 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10942 pass it to the Namespace's .ctor.
10944 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10945 and MethodBase arguments; pass the namespace ID to the symwriter;
10946 pass the MethodBase instead of the token to the symwriter.
10947 (SymbolWriter.DefineNamespace): New method to add a namespace to
10950 2003-02-09 Martin Baulig <martin@ximian.com>
10952 * symbolwriter.cs: New file. This is a wrapper around
10953 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
10954 methods here in near future.
10956 2003-02-09 Martin Baulig <martin@ximian.com>
10958 * codegen.cs (EmitContext.Mark): Just pass the arguments to
10959 ILGenerator.MarkSequencePoint() which are actually used by the
10962 2003-02-09 Martin Baulig <martin@ximian.com>
10964 * location.cs (SourceFile): New public sealed class. This
10965 contains the name and an index which is used in the location's token.
10966 (Location): Reserve an appropriate number of bits in the token for
10967 the source file instead of walking over that list, this gives us a
10968 really huge performance improvement when compiling with debugging.
10970 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10971 `SourceFile' argument instead of a string.
10972 (Driver.ProcessFile): Add all the files via Location.AddFile(),
10973 but don't parse/tokenize here, we need to generate the list of all
10974 source files before we do that.
10975 (Driver.ProcessFiles): New static function. Parses/tokenizes all
10978 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10979 instead of a string.
10981 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10984 2003-02-09 Martin Baulig <martin@ximian.com>
10986 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10987 filename on `#line default'.
10989 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10991 * statement.cs: don't clear the pinned var when the fixed statement
10992 returns from the method (fixes bug#37752).
10994 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10996 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
10999 2003-02-07 Martin Baulig <martin@ximian.com>
11001 * driver.cs: Removed the `--debug-args' command line argument.
11003 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11004 automatically by the AsssemblyBuilder.
11005 (CodeGen.InitializeSymbolWriter): We don't need to call any
11006 initialization function on the symbol writer anymore. This method
11007 doesn't take any arguments.
11009 2003-02-03 Miguel de Icaza <miguel@ximian.com>
11011 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11012 from referenced assemblies as well.
11014 2003-02-02 Martin Baulig <martin@ximian.com>
11016 * class.cs (MethodData.Emit): Generate debugging info for external methods.
11018 2003-02-02 Martin Baulig <martin@ximian.com>
11020 * class.cs (Constructor.Emit): Open the symbol writer before
11021 emitting the constructor initializer.
11022 (ConstructorInitializer.Emit): Call ec.Mark() to allow
11023 single-stepping through constructor initializers.
11025 2003-01-30 Miguel de Icaza <miguel@ximian.com>
11027 * class.cs: Handle error 549: do not allow virtual methods in
11030 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11032 * decl.cs: Check access levels when resolving types
11034 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11036 * statement.cs: Add parameters and locals set in catch blocks that might
11037 return to set vector
11039 2003-01-29 Miguel de Icaza <miguel@ximian.com>
11041 * class.cs (Operator): Set the SpecialName flags for operators.
11043 * expression.cs (Invocation.DoResolve): Only block calls to
11044 accessors and operators on SpecialName methods.
11046 (Cast.TryReduce): Handle conversions from char constants.
11049 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11051 * statement.cs: small memory and time optimization in FlowBranching.
11053 2003-01-28 Pedro Mart <yoros@wanadoo.es>
11055 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11056 problem that the last fix but in the other sid (Set).
11058 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11059 access when there is no indexer in the hierarchy.
11061 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11063 * class.cs: Combine some if statements.
11065 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11067 * driver.cs: fixed bug #37187.
11069 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
11071 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11072 any indexer, it's needed to build a list with all the indexers in the
11073 hierarchy (AllGetters), else we have problems. Fixes #35653.
11075 2003-01-23 Miguel de Icaza <miguel@ximian.com>
11077 * class.cs (MethodData.Define): It is wrong for an interface
11078 implementation to be static in both cases: explicit and implicit.
11079 We were only handling this in one case.
11081 Improve the if situation there to not have negations.
11083 * class.cs (Field.Define): Turns out that we do not need to check
11084 the unsafe bit on field definition, only on usage. Remove the test.
11086 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11088 * driver.cs: use assembly.Location instead of Codebase (the latest
11089 patch made mcs fail when using MS assemblies).
11091 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
11093 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11094 get the path to *corlib.dll.
11096 2003-01-21 Nick Drochak <ndrochak@gol.com>
11100 * typemanager.cs: Remove compiler warnings
11102 2003-01-20 Duncan Mak <duncan@ximian.com>
11104 * AssemblyInfo.cs: Bump the version number to 0.19.
11106 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11108 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11110 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
11112 * class.cs (Constructor::Emit): Emit debugging info for constructors.
11114 2003-01-17 Miguel de Icaza <miguel@ximian.com>
11116 * cs-parser.jay: Small fix: we were not comparing the constructor
11117 name correctly. Thanks to Zoltan for the initial pointer.
11119 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11121 * cs-tokenizer.cs: Set file name when specified with #line
11123 2003-01-15 Miguel de Icaza <miguel@ximian.com>
11125 * cs-parser.jay: Only perform the constructor checks here if we
11126 are named like the class; This will help provider a better
11127 error. The constructor path is taken when a type definition is
11128 not found, but most likely the user forgot to add the type, so
11129 report that rather than the constructor error.
11131 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11133 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11136 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11138 * cs-parser.jay: Add cleanup call.
11140 2003-01-13 Duncan Mak <duncan@ximian.com>
11142 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11143 consistent with other methods.
11145 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11147 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11149 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11151 * attribute.cs: only set GuidAttr to true when we have a
11154 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11158 * typemanager.cs: fixes to allow mcs compile corlib with the new
11159 Type.IsSubclassOf fix.
11161 2003-01-08 Miguel de Icaza <miguel@ximian.com>
11163 * expression.cs (LocalVariableReference.DoResolve): Classify a
11164 constant as a value, not as a variable. Also, set the type for
11167 * cs-parser.jay (fixed_statement): take a type instead of a
11168 pointer_type, so we can produce a better error message later.
11170 * statement.cs (Fixed.Resolve): Flag types that are not pointers
11173 (For.DoEmit): Make inifinite loops have a
11174 non-conditional branch back.
11176 (Fixed.DoEmit): First populate the pinned variables, then emit the
11177 statement, then clear the variables. Before I was emitting the
11178 code once for each fixed piece.
11181 2003-01-08 Martin Baulig <martin@ximian.com>
11183 * statement.cs (FlowBranching.MergeChild): A break in a
11184 SWITCH_SECTION does not leave a loop. Fixes #36155.
11186 2003-01-08 Martin Baulig <martin@ximian.com>
11188 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11189 lives in the same number space than `param_map'. Fixes #36154.
11191 2003-01-07 Miguel de Icaza <miguel@ximian.com>
11193 * cs-parser.jay (constructor_declaration): Set the
11194 Constructor.ModFlags before probing for it. This makes the
11195 compiler report 514, 515 and 132 (the code was there, but got
11198 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11199 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11200 (GotoCase.Resolve): Set `Returns' to ALWAYS.
11202 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11204 * enum.cs: create the enum static fields using the enum type.
11206 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11208 * class.cs: don't try to create the ParamBuilder for the return
11209 type if it's not needed (and handle it breaking for the ms runtime
11212 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11214 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11216 2002-12-29 Miguel de Icaza <miguel@ximian.com>
11218 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11219 the command. This showed up while compiling the JANET source
11220 code, which used \r as its only newline separator.
11222 2002-12-28 Miguel de Icaza <miguel@ximian.com>
11224 * class.cs (Method.Define): If we are an operator (because it
11225 reuses our code), then set the SpecialName and HideBySig. #36128
11227 2002-12-22 Miguel de Icaza <miguel@ximian.com>
11229 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11230 exception, report error 120 `object reference required'.
11232 * driver.cs: Add --pause option, used during to measure the size
11233 of the process as it goes with --timestamp.
11235 * expression.cs (Invocation.DoResolve): Do not allow methods with
11236 SpecialName to be invoked.
11238 2002-12-21 Miguel de Icaza <miguel@ximian.com>
11240 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11241 number before adding it.
11243 2002-12-21 Ravi Pratap <ravi@ximian.com>
11245 * ecore.cs (StandardImplicitConversion): When in an unsafe
11246 context, we allow conversion between void * to any other pointer
11247 type. This fixes bug #35973.
11249 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11251 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11252 is not thrown when extensionless outputs are used
11254 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11256 * rootcontext.cs: fixed compilation of corlib.
11258 2002-12-19 Miguel de Icaza <miguel@ximian.com>
11260 * attribute.cs (Attributes.Contains): Add new method.
11262 * class.cs (MethodCore.LabelParameters): if the parameter is an
11263 `out' parameter, check that no attribute `[In]' has been passed.
11265 * enum.cs: Handle the `value__' name in an enumeration.
11267 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
11269 * decl.cs: Added special case to allow overrides on "protected
11272 2002-12-18 Ravi Pratap <ravi@ximian.com>
11274 * attribute.cs (Attributes.AddAttributeSection): Rename to this
11275 since it makes much more sense.
11277 (Attributes.ctor): Don't require a Location parameter.
11279 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11281 * attribute.cs (ApplyAttributes): Remove extra Location parameters
11282 since we already have that information per attribute.
11284 * everywhere : make appropriate changes.
11286 * class.cs (LabelParameters): Write the code which actually
11287 applies attributes to the return type. We can't do this on the MS
11288 .NET runtime so we flag a warning in the case an exception is
11291 2002-12-18 Miguel de Icaza <miguel@ximian.com>
11293 * const.cs: Handle implicit null conversions here too.
11295 2002-12-17 Ravi Pratap <ravi@ximian.com>
11297 * class.cs (MethodCore.LabelParameters): Remove the extra
11298 Type [] parameter since it is completely unnecessary. Instead
11299 pass in the method's attributes so that we can extract
11300 the "return" attribute.
11302 2002-12-17 Miguel de Icaza <miguel@ximian.com>
11304 * cs-parser.jay (parse): Use Report.Error to flag errors instead
11305 of ignoring it and letting the compile continue.
11307 * typemanager.cs (ChangeType): use an extra argument to return an
11308 error condition instead of throwing an exception.
11310 2002-12-15 Miguel de Icaza <miguel@ximian.com>
11312 * expression.cs (Unary.TryReduce): mimic the code for the regular
11313 code path. Perform an implicit cast in the cases where we can
11314 implicitly convert to one of the integral types, and then reduce
11315 based on that constant. This fixes bug #35483.
11317 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11319 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11321 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11323 * namespace.cs: fixed bug #35489.
11325 2002-12-12 Miguel de Icaza <miguel@ximian.com>
11327 * class.cs: Remove some dead code.
11329 * cs-parser.jay: Estimate the number of methods needed
11330 (RootContext.MethodCount);
11332 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11333 numbers instead of StringBuilders.
11335 * support.cs (PtrHashtable): Add constructor with initial size;
11336 We can now reduce reallocations of the method table.
11338 2002-12-10 Ravi Pratap <ravi@ximian.com>
11340 * attribute.cs (ApplyAttributes): Keep track of the emitted
11341 attributes on a per-target basis. This fixes bug #35413.
11343 2002-12-10 Miguel de Icaza <miguel@ximian.com>
11345 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11346 default to the Windows 1252 encoding.
11348 (UnixParseOption): Support version, thanks to Alp for the missing
11351 * AssemblyInfo.cs: Add nice assembly information.
11353 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11356 * cs-parser.jay: Allow a trailing comma before the close bracked
11357 in the attribute_section production.
11359 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11360 address of the instance was being taken, I will take this out,
11361 because we take the address of the object immediately here.
11363 2002-12-09 Ravi Pratap <ravi@ximian.com>
11365 * typemanager.cs (AreMultipleAllowed): Take care of the most
11366 obvious case where attribute type is not in the current assembly -
11369 2002-12-08 Miguel de Icaza <miguel@ximian.com>
11371 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11372 definitions, instead of doing that afterwards.
11374 Also we use a nice little hack, depending on the constructor, we
11375 know if we are a "composed" name or a simple name. Hence, we
11376 avoid the IndexOf test, and we avoid
11378 * codegen.cs: Add code to assist in a bug reporter to track down
11379 the source of a compiler crash.
11381 2002-12-07 Ravi Pratap <ravi@ximian.com>
11383 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11384 types have been emitted for a given element and flag an error
11385 if something which does not have AllowMultiple set is used more
11388 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11389 attribute types and their corresponding AllowMultiple properties
11391 (AreMultipleAllowed): Check the property for a given type.
11393 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11394 property in the case we have a TypeContainer.
11396 (Attributes.AddAttribute): Detect duplicates and just skip on
11397 adding them. This trivial fix catches a pretty gross error in our
11398 attribute emission - global attributes were being emitted twice!
11400 Bugzilla bug #33187 is now fixed.
11402 2002-12-06 Miguel de Icaza <miguel@ximian.com>
11404 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11405 instead of pp_and).
11407 * expression.cs (Binary.ResolveOperator): I can only use the
11408 Concat (string, string, string) and Concat (string, string,
11409 string, string) if the child is actually a concatenation of
11412 2002-12-04 Miguel de Icaza <miguel@ximian.com>
11414 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11415 context where we need a 2-character lookahead.
11417 * pending.cs (PendingImplementation): Rework so we can keep track
11418 of interface types all the time, and flag those which were
11419 implemented by parents as optional.
11421 2002-12-03 Miguel de Icaza <miguel@ximian.com>
11423 * expression.cs (Binary.ResolveOperator): Use
11424 String.Concat(string,string,string) or
11425 String.Concat(string,string,string,string) when possible.
11427 * typemanager: More helper methods.
11430 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11432 * pending.cs: remove the bogus return from GetMissingInterfaces()
11433 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11435 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11437 * namespace.cs: avoid duplicated 'using xxx' being added to
11438 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11439 when we get more than one 'using' statement for the same namespace.
11440 Report a CS0105 warning for it.
11442 2002-11-30 Miguel de Icaza <miguel@ximian.com>
11444 * cs-tokenizer.cs (consume_identifier): use read directly, instead
11445 of calling getChar/putback, uses internal knowledge of it.
11447 (xtoken): Reorder tokenizer so most common patterns are checked
11448 first. This reduces the compilation time in another 5% (from 8.11s
11449 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11451 The parsing time is 22% of the compilation in mcs, and from that
11452 64% is spent on the tokenization process.
11454 I tried using a binary search for keywords, but this is slower
11455 than the hashtable. Another option would be to do a couple of
11458 * Not use a StringBuilder, instead use an array of chars,
11459 with a set value. Notice that this way we could catch
11460 the 645 error without having to do it *afterwards*.
11462 * We could write a hand-parser to avoid the hashtable
11463 compares altogether.
11465 The identifier consumption process takes 37% of the tokenization
11466 time. Another 15% is spent on is_number. 56% of the time spent
11467 on is_number is spent on Int64.Parse:
11469 * We could probably choose based on the string length to
11470 use Int32.Parse or Int64.Parse and avoid all the 64-bit
11473 Another 3% is spend on wrapping `xtoken' in the `token' function.
11475 Handle 0xa0 as whitespace (#34752)
11477 2002-11-26 Miguel de Icaza <miguel@ximian.com>
11479 * typemanager.cs (IsCLRType): New routine to tell whether a type
11480 is one of the builtin types.
11482 Maybe it needs to use TypeCodes to be faster. Maybe we could use
11483 typecode in more places instead of doing pointer comparissions.
11484 We could leverage some knowledge about the way the typecodes are
11487 New code to cache namespaces in assemblies, it is currently not
11488 invoked, to be used soon.
11490 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11492 * expression.cs (Binary.ResolveOperator): specially handle
11493 strings, and do not perform user-defined operator overloading for
11496 2002-11-24 Miguel de Icaza <miguel@ximian.com>
11498 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11499 internalcall as it is a pretty simple operation; Avoid whenever
11500 possible to call Char.IsLetter.
11502 (consume_identifier): Cut by half the number of
11503 hashtable calls by merging the is_keyword and GetKeyword behavior.
11505 Do not short-circuit, because if we do, we
11506 report errors (ie, #if false && true would produce an invalid
11510 2002-11-24 Martin Baulig <martin@ximian.com>
11512 * expression.cs (Cast.TryReduce): If we're in checked syntax,
11513 check constant ranges and report a CS0221. Fixes #33186.
11515 2002-11-24 Martin Baulig <martin@ximian.com>
11517 * cs-parser.jay: Make this work for uninitialized variable
11518 declarations in the `for' initializer. Fixes #32416.
11520 2002-11-24 Martin Baulig <martin@ximian.com>
11522 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11523 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
11525 2002-11-24 Martin Baulig <martin@ximian.com>
11527 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11528 argument; if true, we also check for user-defined conversions.
11529 This is only needed if both arguments are of a user-defined type.
11530 Fixes #30443, added test-175.cs.
11531 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11533 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11535 2002-11-24 Martin Baulig <martin@ximian.com>
11537 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11538 function to get the store opcode.
11539 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11540 only emit the Ldelema if the store opcode is Stobj. You must run
11541 both test-34 and test-167 to test this. Fixes #34529.
11543 2002-11-23 Martin Baulig <martin@ximian.com>
11545 * ecore.cs (Expression.MemberLookup): Added additional
11546 `qualifier_type' argument which is used when we're being called
11547 from MemberAccess.DoResolve() and null if we're called from a
11549 (Expression.MemberLookupFailed): New method to report errors; this
11550 does the CS1540 check and reports the correct error message.
11552 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11553 argument for the CS1540 check and redone the way how we're dealing
11554 with private members. See the comment in the source code for details.
11555 (FilterWithClosure): Reverted this back to revision 1.197; renamed
11556 `closure_start_type' to `closure_qualifier_type' and check whether
11557 it's not null. It was not this filter being broken, it was just
11558 being called with the wrong arguments.
11560 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11561 and pass it the correct `qualifier_type'; this also does the error
11564 2002-11-22 Miguel de Icaza <miguel@ximian.com>
11566 * expression.cs (Invocation.EmitParams): If the we are dealing
11567 with a non-built-in value type, load its address as well.
11569 (ArrayCreation): Use a a pretty constant instead
11570 of the hardcoded value 2. Use 6 instead of 2 for the number of
11571 static initializers.
11573 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11574 because they are not really value types, just glorified integers.
11576 * driver.cs: Do not append .exe, the CSC compiler does not do it.
11578 * ecore.cs: Remove redundant code for enumerations, make them use
11579 the same code path as everything else, fixes the casting issue
11580 with enumerations in Windows.Forms.
11582 * attribute.cs: Do only cast to string if it is a string, the
11583 validation happens later.
11585 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11586 people upgrade their corlibs.
11588 * ecore.cs: Oops, enumerations were not following the entire code path
11590 2002-11-21 Miguel de Icaza <miguel@ximian.com>
11592 * typemanager.cs (FilterWithClosure): Commented out the test for
11593 1540 in typemanager.cs, as it has problems when accessing
11594 protected methods from a parent class (see test-174.cs).
11596 * attribute.cs (Attribute.ValidateGuid): new method.
11597 (Attribute.Resolve): Use above.
11599 2002-11-19 Miguel de Icaza <miguel@ximian.com>
11601 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11603 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11604 handling for enumerations, as we only needed the TypeContainer
11605 functionality to begin with (this is required for the fix below to
11606 work for enums that reference constants in a container class for
11609 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11611 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11612 a valid TypeBuilder to perform lookups on.o
11614 * class.cs (InheritableMemberSignatureCompare): Use true in the
11615 call to GetGetMethod and GetSetMethod, because we are comparing
11616 the signature, and we need to get the methods *even* if they are
11619 (PropertyBase.CheckBase): ditto.
11621 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11622 GotoCase.Resolve): Use Peel on EmpytCasts.
11624 * ecore.cs (EmptyCast): drop child, add Peel method.
11626 2002-11-17 Martin Baulig <martin@ximian.com>
11628 * ecore.cs (EmptyCast.Child): New public property.
11630 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11631 label resolved to an EmptyCast. Fixes #34162.
11632 (GotoCase.Resolve): Likewise.
11633 (Block.EmitMeta): Likewise.
11635 2002-11-17 Martin Baulig <martin@ximian.com>
11637 * expression.cs (Invocation.BetterConversion): Prefer int over
11638 uint; short over ushort; long over ulong for integer literals.
11639 Use ImplicitConversionExists instead of StandardConversionExists
11640 since we also need to check for user-defined implicit conversions.
11641 Fixes #34165. Added test-173.cs.
11643 2002-11-16 Martin Baulig <martin@ximian.com>
11645 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11646 with the `true' and `false' literals. Fixes #33151.
11648 2002-11-16 Martin Baulig <martin@ximian.com>
11650 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11651 October 22nd; don't do the cs1540 check for static members.
11653 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11654 now using our own filter here and doing the cs1540 check again.
11656 2002-11-16 Martin Baulig <martin@ximian.com>
11658 * support.cs (InternalParameters): Don't crash if we don't have
11659 any fixed parameters. Fixes #33532.
11661 2002-11-16 Martin Baulig <martin@ximian.com>
11663 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11664 when looking up static methods to make this work on Windows.
11667 2002-11-16 Martin Baulig <martin@ximian.com>
11669 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11670 a setter rather than using PropertyInfo.CanWrite.
11672 2002-11-15 Nick Drochak <ndrochak@gol.com>
11674 * class.cs: Allow acces to block member by subclasses. Fixes build
11677 2002-11-14 Martin Baulig <martin@ximian.com>
11679 * class.cs (Constructor.Emit): Added the extern/block check.
11682 2002-11-14 Martin Baulig <martin@ximian.com>
11684 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11685 iteration while looking for indexers, this is needed because the
11686 indexer may have a different name in our base classes. Fixed the
11687 error reporting (no indexers at all, not get accessor, no
11688 overloaded match). Fixes bug #33089.
11689 (IndexerAccess.DoResolveLValue): Likewise.
11691 2002-11-14 Martin Baulig <martin@ximian.com>
11693 * class.cs (PropertyBase.CheckBase): Make this work for multiple
11694 indexers. Fixes the first part of bug #33089.
11695 (MethodSignature.InheritableMemberSignatureCompare): Added support
11698 2002-11-13 Ravi Pratap <ravi@ximian.com>
11700 * attribute.cs (Attribute.Resolve): Catch the
11701 NullReferenceException and report it since it isn't supposed to
11704 2002-11-12 Miguel de Icaza <miguel@ximian.com>
11706 * expression.cs (Binary.EmitBranchable): Also handle the cases for
11707 LogicalOr and LogicalAnd that can benefit from recursively
11708 handling EmitBranchable. The code now should be nice for Paolo.
11710 2002-11-08 Miguel de Icaza <miguel@ximian.com>
11712 * typemanager.cs (LookupType): Added a negative-hit hashtable for
11713 the Type lookups, as we perform quite a number of lookups on
11714 non-Types. This can be removed once we can deterministically tell
11715 whether we have a type or a namespace in advance.
11717 But this might require special hacks from our corlib.
11721 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11722 and double which avoids a conversion from an integer to a double.
11724 * expression.cs: tiny optimization, avoid calling IsConstant,
11725 because it effectively performs the lookup twice.
11727 2002-11-06 Miguel de Icaza <miguel@ximian.com>
11729 But a bogus return here to keep the semantics of the old code
11730 until the Mono runtime is fixed.
11732 * pending.cs (GetMissingInterfaces): New method used to remove all
11733 the interfaces that are already implemented by our parent
11734 classes from the list of pending methods.
11736 * interface.cs: Add checks for calls after ResolveTypeExpr.
11738 2002-11-05 Miguel de Icaza <miguel@ximian.com>
11740 * class.cs (Class.Emit): Report warning 67: event not used if the
11741 warning level is beyond 3.
11743 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11744 being a NullLiteral.
11746 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11749 * class.cs (TypeContainer.GetClassBases): Cover a missing code
11750 path that might fail if a type can not be resolved.
11752 * expression.cs (Binary.Emit): Emit unsigned versions of the
11755 * driver.cs: use error 5.
11757 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11759 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11761 2002-11-01 Miguel de Icaza <miguel@ximian.com>
11763 * cs-parser.jay (switch_section): A beautiful patch from Martin
11764 Baulig that fixed 33094.
11766 2002-10-31 Miguel de Icaza <miguel@ximian.com>
11768 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11769 Check whether the base is abstract and report an error if so.
11771 * expression.cs (IndexerAccess.DoResolveLValue,
11772 IndexerAccess.DoResolve): ditto.
11774 (Invocation.DoResolve): ditto.
11776 (Invocation.FullMethodDesc): Improve the report string.
11778 * statement.cs (Block): Eliminate IsVariableDefined as it is
11779 basically just a wrapper for GetVariableInfo.
11781 * ecore.cs (SimpleName): Use new
11783 * support.cs (ReflectionParamter.ParameterType): We unwrap the
11784 type, as we return the actual parameter ref/unref state on a
11787 2002-10-30 Miguel de Icaza <miguel@ximian.com>
11789 * support.cs: Return proper flags REF/OUT fixing the previous
11792 * expression.cs: Reverted last patch, that was wrong. Is_ref is
11793 not used to mean `ref' but `ref or out' in ParameterReference
11795 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11796 full type signature instead of calling TypeManger.CSharpName
11799 * support.cs (InternalParameters.ParameterDesc): Do not compare
11800 directly to the modflags, because REF/OUT will actually be bitsets
11803 * delegate.cs (VerifyMethod): Check also the modifiers.
11805 * cs-tokenizer.cs: Fix bug where floating point values with an
11806 exponent where a sign was missing was ignored.
11808 * driver.cs: Allow multiple assemblies to be specified in a single
11811 2002-10-28 Miguel de Icaza <miguel@ximian.com>
11813 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
11814 because identifiers after a parenthesis would end up in this kind
11815 of production, and we needed to desamiguate it for having casts
11818 (UserDefinedType *) xxx
11820 2002-10-24 Miguel de Icaza <miguel@ximian.com>
11822 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11823 we should set on the Bindingflags.NonPublic, but not turn on
11824 private_ok. private_ok controls whether a Private member is
11825 returned (this is chekced on the filter routine), while the
11826 BindingFlags.NonPublic just controls whether private/protected
11827 will be allowed. This fixes the problem part of the problem of
11828 private properties being allowed to be used in derived classes.
11830 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11831 so we can call the children DoResolveLValue method (this will
11832 properly signal errors on lvalue assignments to base properties)
11834 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11835 getter are null, and we have a property info, we know that this
11836 happened because the lookup failed, so we report an error 122 for
11837 protection level violation.
11839 We also silently return if setter and getter are null in the
11840 resolve functions, this condition only happens if we have flagged
11841 the error before. This is the other half of the problem.
11843 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11844 not have accessibility information, that is why we were returning
11845 true in the filter function in typemanager.cs.
11847 To properly report 122 (property is inaccessible because of its
11848 protection level) correctly, we report this error in ResolveAccess
11849 by failing if both the setter and the getter are lacking (ie, the
11852 DoResolve and DoLResolve have been modified to check for both
11853 setter/getter being null and returning silently, the reason being
11854 that I did not want to put the knowledge about this error in upper
11857 int old = Report.Errors;
11858 x = new PropertyExpr (...);
11859 if (old != Report.Errors)
11864 So the property expr is returned, but it is invalid, so the error
11865 will be flagged during the resolve process.
11867 * class.cs: Remove InheritablePropertySignatureCompare from the
11868 class, as we no longer depend on the property signature to compute
11869 whether it is possible to implement a method or not.
11871 The reason is that calling PropertyInfo.GetGetMethod will return
11872 null (in .NET, in Mono it works, and we should change this), in
11873 cases where the Get Method does not exist in that particular
11878 class X { public virtual int A { get { return 1; } } }
11880 class Z : Y { public override int A { get { return 2; } } }
11882 Would fail in Z because the parent (Y) would not have the property
11883 defined. So we avoid this completely now (because the alternative
11884 fix was ugly and slow), and we now depend exclusively on the
11887 (PropertyBase.CheckBase): Use a method-base mechanism to find our
11888 reference method, instead of using the property.
11890 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11891 routines are gone now.
11893 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11894 names, they were incorrectly named.
11896 * cs-tokenizer.cs: Return are more gentle token on failure.
11898 * pending.cs (PendingImplementation.InterfaceMethod): This routine
11899 had an out-of-sync index variable, which caused it to remove from
11900 the list of pending methods the wrong method sometimes.
11902 2002-10-22 Miguel de Icaza <miguel@ximian.com>
11904 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11905 CanWrite, because those refer to this particular instance of the
11906 property, and do not take into account the fact that we can
11907 override single members of a property.
11909 Constructor requires an EmitContext. The resolution process does
11910 not happen here, but we need to compute the accessors before,
11911 because the resolution does not always happen for properties.
11913 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11914 subclass, before we did not update this flag, but we did update
11917 (GetAccessors): Drop this routine, as it did not work in the
11918 presence of partially overwritten set/get methods.
11920 Notice that this broke the cs1540 detection, but that will require
11923 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11927 * driver.cs: issue a warning instead of an error if we don't support
11928 debugging for the platform. Also ignore a couple of errors that may
11929 arise when trying to write the symbols. Undo my previous patch.
11931 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11933 * driver.cs: ignore /debug switch except for Unix platforms.
11935 2002-10-23 Nick Drochak <ndrochak@gol.com>
11937 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11939 2002-10-21 Miguel de Icaza <miguel@ximian.com>
11941 * driver.cs: Do not make mcs-debug conditional, so we do not break
11942 builds that use it.
11944 * statement.cs (UsageVector.MergeChildren): I would like Martin to
11945 review this patch. But basically after all the children variables
11946 have been merged, the value of "Breaks" was not being set to
11947 new_breaks for Switch blocks. I think that it should be set after
11948 it has executed. Currently I set this to the value of new_breaks,
11949 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11950 conservative, but I do not understand this code very well.
11952 I did not break anything in the build, so that is good ;-)
11954 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11956 2002-10-20 Mark Crichton <crichton@gimp.org>
11958 * cfold.cs: Fixed compile blocker. Really fixed it this time.
11960 2002-10-20 Nick Drochak <ndrochak@gol.com>
11962 * cfold.cs: Fixed compile blocker.
11964 2002-10-20 Miguel de Icaza <miguel@ximian.com>
11966 * driver.cs: I was chekcing the key, not the file.
11968 2002-10-19 Ravi Pratap <ravi@ximian.com>
11970 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11971 message that we were generating - we just need to silently return
11974 2002-10-19 Miguel de Icaza <miguel@ximian.com>
11976 * class.cs (Event.Define): Change my previous commit, as this
11977 breaks the debugger. This is a temporary hack, as it seems like
11978 the compiler is generating events incorrectly to begin with.
11980 * expression.cs (Binary.ResolveOperator): Added support for
11981 "U operator - (E x, E y)"
11983 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11986 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11987 init-only variables, but this path did not take into account that
11988 there might be also instance readonly variables. Correct this
11991 This fixes bug 32253
11993 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11996 * driver.cs: Change the extension for modules to `netmodule'
11998 * cs-parser.jay: Improved slightly the location tracking for
11999 the debugger symbols.
12001 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12002 modifiers that were specified instead of the hardcoded value
12003 (FamAndAssem). This was basically ignoring the static modifier,
12004 and others. Fixes 32429.
12006 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12007 fixed a bug in the process (32476)
12009 * expression.cs (ArrayAccess.EmitAssign): Patch from
12010 hwang_rob@yahoo.ca that fixes bug 31834.3
12012 2002-10-18 Miguel de Icaza <miguel@ximian.com>
12014 * driver.cs: Make the module extension .netmodule.
12016 2002-10-16 Miguel de Icaza <miguel@ximian.com>
12018 * driver.cs: Report an error if the resource file is not found
12019 instead of crashing.
12021 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12022 false, like Emit does.
12024 2002-10-16 Nick Drochak <ndrochak@gol.com>
12026 * typemanager.cs: Remove unused private member. Also reported mcs
12027 bug to report this as a warning like csc.
12029 2002-10-15 Martin Baulig <martin@gnome.org>
12031 * statement.cs (Statement.Emit): Made this a virtual method; emits
12032 the line number info and calls DoEmit().
12033 (Statement.DoEmit): New protected abstract method, formerly knows
12034 as Statement.Emit().
12036 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12038 2002-10-11 Miguel de Icaza <miguel@ximian.com>
12040 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12041 have fixed a remaining problem: not every AddXXXX was adding a
12042 fully qualified name.
12044 Now everyone registers a fully qualified name in the DeclSpace as
12045 being defined instead of the partial name.
12047 Downsides: we are slower than we need to be due to the excess
12048 copies and the names being registered this way.
12050 The reason for this is that we currently depend (on the corlib
12051 bootstrap for instance) that types are fully qualified, because
12052 we dump all the types in the namespace, and we should really have
12053 types inserted into the proper namespace, so we can only store the
12054 basenames in the defined_names array.
12056 2002-10-10 Martin Baulig <martin@gnome.org>
12058 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12059 from bug #31834, see the bug report for a testcase which is
12062 2002-10-10 Martin Baulig <martin@gnome.org>
12064 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12065 flow analysis code for this.
12067 * statement.cs (Do, While, For): Tell the flow analysis code about
12069 (FlowBranching.UsageVector): Added support for infinite loops.
12070 (Block.Resolve): Moved the dead code elimination here and use flow
12073 2002-10-09 Miguel de Icaza <miguel@ximian.com>
12075 * class.cs (Field.Define): Catch cycles on struct type
12078 * typemanager.cs (IsUnmanagedtype): Do not recursively check
12079 fields if the fields are static. We only need to check instance
12082 * expression.cs (As.DoResolve): Test for reference type.
12084 * statement.cs (Using.ResolveExpression): Use
12085 ConvertImplicitRequired, not ConvertImplicit which reports an
12087 (Using.ResolveLocalVariableDecls): ditto.
12089 * expression.cs (Binary.ResolveOperator): Report errors in a few
12090 places where we had to.
12092 * typemanager.cs (IsUnmanagedtype): Finish implementation.
12094 2002-10-08 Miguel de Icaza <miguel@ximian.com>
12096 * expression.cs: Use StoreFromPtr instead of extracting the type
12097 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
12099 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12100 an enumeration value to a System.Enum, but System.Enum is not a
12101 value type, but an class type, so we need to box.
12103 (Expression.ConvertExplicit): One codepath could return
12104 errors but not flag them. Fix this. Fixes #31853
12106 * parameter.cs (Resolve): Do not allow void as a parameter type.
12108 2002-10-06 Martin Baulig <martin@gnome.org>
12110 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12111 if it's a class type and not a struct. Fixes #31815.
12113 2002-10-06 Martin Baulig <martin@gnome.org>
12115 * statement.cs: Reworked the flow analysis code a bit to make it
12116 usable for dead code elimination.
12118 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12120 * cs-parser.jay: allow empty source files. Fixes bug #31781.
12122 2002-10-04 Miguel de Icaza <miguel@ximian.com>
12124 * expression.cs (ComposedCast.DoResolveType): A quick workaround
12125 to fix the test 165, will investigate deeper.
12127 2002-10-04 Martin Baulig <martin@gnome.org>
12129 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12130 finally blocks actually work.
12131 (Try.Resolve): We don't need to create a sibling for `finally' if
12132 there is no finally block.
12134 2002-10-04 Martin Baulig <martin@gnome.org>
12136 * class.cs (Constructor.Define): The default accessibility for a
12137 non-default constructor is private, not public.
12139 2002-10-04 Miguel de Icaza <miguel@ximian.com>
12141 * class.cs (Constructor): Make AllowedModifiers public, add
12144 * cs-parser.jay: Perform the modifiers test here, as the
12145 constructor for the Constructor class usually receives a zero
12146 because of the way we create it (first we create, later we
12147 customize, and we were never checking the modifiers).
12149 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12150 is a version of LookupTypeReflection that includes the type-name
12151 cache. This can be used as a fast path for functions that know
12152 the fully qualified name and are only calling into *.GetType() to
12153 obtain a composed type.
12155 This is also used by TypeManager.LookupType during its type
12158 (LookupType): We now also track the real type name, as sometimes
12159 we can get a quey for the real type name from things like
12160 ComposedCast. This fixes bug 31422.
12162 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12163 complete type fullname, it does not have to go through the type
12164 resolution system to obtain the composed version of the type (for
12165 obtaining arrays or pointers).
12167 (Conditional.Emit): Use the EmitBoolExpression to
12168 generate nicer code, as requested by Paolo.
12170 (ArrayCreation.CheckIndices): Use the patch from
12171 hwang_rob@yahoo.ca to validate the array initializers.
12173 2002-10-03 Miguel de Icaza <miguel@ximian.com>
12175 * class.cs (ConstructorInitializer.Emit): simplify code by using
12176 Invocation.EmitCall, and at the same time, fix the bugs in calling
12177 parent constructors that took variable arguments.
12179 * ecore.cs (Expression.ConvertNumericExplicit,
12180 Expression.ImplicitNumericConversion): Remove the code that
12181 manually wrapped decimal (InternalTypeConstructor call is now gone
12184 * expression.cs (Cast.TryReduce): Also handle decimal types when
12185 trying to perform a constant fold on the type.
12187 * typemanager.cs (IsUnmanagedtype): Partially implemented.
12189 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12190 that only turned off an error report, and did nothing else.
12192 2002-10-02 Miguel de Icaza <miguel@ximian.com>
12194 * driver.cs: Handle and ignore /fullpaths
12196 2002-10-01 Miguel de Icaza <miguel@ximian.com>
12198 * expression.cs (Binary.ResolveOperator): Catch the case where
12199 DoNumericPromotions returns true,
12201 (Binary.DoNumericPromotions): Simplify the code, and the tests.
12203 2002-09-27 Miguel de Icaza <miguel@ximian.com>
12205 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12208 2002-09-26 Miguel de Icaza <miguel@ximian.com>
12210 * ecore.cs (ConvertNumericExplicit): It is not enough that the
12211 conversion exists, but it is also required that the conversion be
12212 performed. This manifested in "(Type64Enum) 2".
12214 * class.cs (TypeManager.AddMethod): The fix is not to change
12215 AddEnum, because that one was using a fully qualified name (every
12216 DeclSpace derivative does), but to change the AddMethod routine
12217 that was using an un-namespaced name. This now correctly reports
12218 the duplicated name.
12220 Revert patch until I can properly fix it. The issue
12221 is that we have a shared Type space across all namespaces
12222 currently, which is wrong.
12224 Options include making the Namespace a DeclSpace, and merge
12225 current_namespace/current_container in the parser.
12227 2002-09-25 Miguel de Icaza <miguel@ximian.com>
12229 * cs-parser.jay: Improve error reporting when we get a different
12230 kind of expression in local_variable_type and
12231 local_variable_pointer_type.
12233 Propagate this to avoid missleading errors being reported.
12235 * ecore.cs (ImplicitReferenceConversion): treat
12236 TypeManager.value_type as a target just like object_type. As
12241 Is valid, and needs to result in the int 1 being boxed before it
12242 is assigned to the value type v.
12244 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12245 to validate the enumeration name.
12247 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12248 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
12249 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12251 * ecore.cs (TryImplicitIntConversion): When doing an
12252 implicit-enumeration-conversion, check if the type is 64-bits and
12253 perform a conversion before passing to EnumConstant.
12255 2002-09-23 Miguel de Icaza <miguel@ximian.com>
12257 * decl.cs (Error_AmbiguousTypeReference); New routine used to
12258 report ambiguous type references. Unlike the MS version, we
12259 report what the ambiguity is. Innovation at work ;-)
12261 (DeclSpace.FindType): Require a location argument to
12262 display when we display an ambiguous error.
12264 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12266 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12268 * expression.cs (EmitDynamicInitializers): Apply patch from
12269 hwang_rob@yahoo.ca that fixes the order in which we emit our
12272 2002-09-21 Martin Baulig <martin@gnome.org>
12274 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12275 delegate takes no arguments.
12277 2002-09-20 Miguel de Icaza <miguel@ximian.com>
12279 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12282 * expression.cs: Extract the underlying type.
12284 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12286 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12288 2002-09-19 Miguel de Icaza <miguel@ximian.com>
12290 * class.cs (TypeContainer.DefineType): We can not use the nice
12291 PackingSize with the size set to 1 DefineType method, because it
12292 will not allow us to define the interfaces that the struct
12295 This completes the fixing of bug 27287
12297 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12298 means also structs. This fixes part of the problem.
12299 (Expresion.ImplicitReferenceConversionExists): ditto.
12301 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12302 error if there were no errors reported during the type lookup
12303 process, to avoid duplicates or redundant errors. Without this
12304 you would get an ambiguous errors plus a type not found. We have
12305 beaten the user enough with the first error.
12307 (DeclSparce.FindType): Emit a warning if we have an ambiguous
12310 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12311 during the resolution process, stop the lookup, this avoids
12312 repeated error reports (same error twice).
12314 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12316 * typemanager.cs (LookupType): Redo the type lookup code to match
12317 the needs of System.Reflection.
12319 The issue is that System.Reflection requires references to nested
12320 types to begin with a "+" sign instead of a dot. So toplevel
12321 types look like: "NameSpace.TopLevelClass", and nested ones look
12322 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12325 2002-09-19 Martin Baulig <martin@gnome.org>
12327 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12328 says that a method always returns or always throws an exception,
12329 don't report the CS0161.
12331 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12332 set `Returns = new_returns'.
12334 2002-09-19 Martin Baulig <martin@gnome.org>
12336 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12337 to an enum constant, check for a CS0176.
12339 2002-09-18 Miguel de Icaza <miguel@ximian.com>
12341 * class.cs (TypeContainer.CheckPairedOperators): Now we check
12342 for operators that must be in pairs and report errors.
12344 * ecore.cs (SimpleName.DoResolveType): During the initial type
12345 resolution process, when we define types recursively, we must
12346 check first for types in our current scope before we perform
12347 lookups in the enclosing scopes.
12349 * expression.cs (MakeByteBlob): Handle Decimal blobs.
12351 (Invocation.VerifyArgumentsCompat): Call
12352 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12353 I thought we were supposed to always call this, but there are a
12354 few places in the code where we dont do it.
12356 2002-09-17 Miguel de Icaza <miguel@ximian.com>
12358 * driver.cs: Add support in -linkres and -resource to specify the
12359 name of the identifier.
12361 2002-09-16 Miguel de Icaza <miguel@ximian.com>
12363 * ecore.cs (StandardConversionExists): Sync with the conversion
12364 code: allow anything-* to void* conversions.
12366 (FindMostSpecificSource): Use an Expression argument
12367 instead of a Type, because we might be handed over a Literal which
12368 gets a few more implicit conversions that plain types do not. So
12369 this information was being lost.
12371 Also, we drop the temporary type-holder expression when not
12374 2002-09-17 Martin Baulig <martin@gnome.org>
12376 * class.cs (PropertyBase.CheckBase): Don't check the base class if
12377 this is an explicit interface implementation.
12379 2002-09-17 Martin Baulig <martin@gnome.org>
12381 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12382 different `IndexerName' attributes.
12384 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12385 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12386 virtual CommonResolve().
12388 2002-09-16 Miguel de Icaza <miguel@ximian.com>
12390 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12391 and convert that to the UnderlyingType.
12393 * statement.cs (Foreach.Resolve): Indexers are just like variables
12394 or PropertyAccesses.
12396 * cs-tokenizer.cs (consume_string): Track line numbers and columns
12397 inside quoted strings, we were not doing this before.
12399 2002-09-16 Martin Baulig <martin@gnome.org>
12401 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12402 resolve it. This is needed for the definite assignment check of the
12403 instance expression, fixes bug #29846.
12404 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12406 2002-09-16 Nick Drochak <ndrochak@gol.com>
12408 * parameter.cs: Fix compile error. Cannot reference static member
12409 from an instance object. Is this an mcs bug?
12411 2002-09-14 Martin Baulig <martin@gnome.org>
12413 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12414 multiple times. Fixes bug #30295, added test-166.cs.
12416 2002-09-14 Martin Baulig <martin@gnome.org>
12418 * statement.cs (Block.Emit): Don't emit unreachable code.
12419 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12420 `break' statements.
12421 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12423 2002-09-14 Martin Baulig <martin@gnome.org>
12425 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12428 2002-09-14 Martin Baulig <martin@gnome.org>
12430 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12431 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12432 be false on the ms runtime.
12434 2002-09-13 Martin Baulig <martin@gnome.org>
12436 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12437 the CS0038 error message.
12439 2002-09-12 Miguel de Icaza <miguel@ximian.com>
12441 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12442 constant inside, return it.
12444 2002-09-12 Martin Baulig <martin@gnome.org>
12446 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12447 implicit conversion can be done between enum types.
12449 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12450 check whether an implicit conversion to the current enum's UnderlyingType
12451 exists and report an error if not.
12453 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12454 without debugging support.
12456 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12457 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
12459 2002-09-12 Martin Baulig <martin@gnome.org>
12461 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12463 * ecore.cs (IMemberExpr.DeclaringType): New property.
12464 (SimpleName.SimpleNameResolve): Check whether we're accessing a
12465 nonstatic member of an outer type (CS0038).
12467 2002-09-11 Miguel de Icaza <miguel@ximian.com>
12469 * driver.cs: Activate the using-error detector at warning level
12470 4 (at least for MS-compatible APIs).
12472 * namespace.cs (VerifyUsing): Small buglett fix.
12474 * pending.cs (PendingImplementation): pass the container pointer.
12476 * interface.cs (GetMethods): Allow for recursive definition. Long
12477 term, I would like to move every type to support recursive
12478 definitions, not the current ordering mechanism that we have right
12481 The situation is this: Attributes are handled before interfaces,
12482 so we can apply attributes to interfaces. But some attributes
12483 implement interfaces, we will now handle the simple cases
12484 (recursive definitions will just get an error).
12486 * parameter.cs: Only invalidate types at the end if we fail to
12489 2002-09-09 Martin Baulig <martin@gnome.org>
12491 * ecore.cs (PropertyExpr.Emit): Also check for
12492 TypeManager.system_int_array_get_length so this'll also work when
12493 compiling corlib. Fixes #30003.
12495 2002-09-09 Martin Baulig <martin@gnome.org>
12497 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12498 and throw an exception if we can't get the type's size. Fixed #30040,
12501 2002-09-09 Martin Baulig <martin@gnome.org>
12503 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12505 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12506 context. Fixes bug #30027.
12508 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12509 virtual functions. Fixes bug #30043, added test-164.cs.
12511 2002-09-08 Ravi Pratap <ravi@ximian.com>
12513 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12515 2002-09-08 Nick Drochak <ndrochak@gol.com>
12517 * driver.cs: Use an object to get the windows codepage since it's not a
12520 2002-09-08 Miguel de Icaza <miguel@ximian.com>
12522 * statement.cs (For.Emit): for infinite loops (test == null)
12523 return whether there is a break inside, not always "true".
12525 * namespace.cs (UsingEntry): New struct to hold the name of the
12526 using definition, the location where it is defined, and whether it
12527 has been used in a successful type lookup.
12529 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12534 2002-09-06 Ravi Pratap <ravi@ximian.com>
12536 * attribute.cs : Fix incorrect code which relied on catching
12537 a NullReferenceException to detect a null being passed in
12538 where an object was expected.
12540 2002-09-06 Miguel de Icaza <miguel@ximian.com>
12542 * statement.cs (Try): flag the catch variable as assigned
12544 * expression.cs (Cast): Simplified by using ResolveType instead of
12545 manually resolving.
12547 * statement.cs (Catch): Fix bug by using ResolveType.
12549 2002-09-06 Ravi Pratap <ravi@ximian.com>
12551 * expression.cs (BetterConversion): Special case for when we have
12552 a NullLiteral as the argument and we have to choose between string
12553 and object types - we choose string the way csc does.
12555 * attribute.cs (Attribute.Resolve): Catch the
12556 NullReferenceException and report error #182 since the Mono
12557 runtime no more has the bug and having this exception raised means
12558 we tried to select a constructor which takes an object and is
12561 2002-09-05 Ravi Pratap <ravi@ximian.com>
12563 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12564 message (1502, 1503) when we can't locate a method after overload
12565 resolution. This is much more informative and closes the bug
12568 * interface.cs (PopulateMethod): Return if there are no argument
12569 types. Fixes a NullReferenceException bug.
12571 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12572 expressions too. Previously we were checking only in one place for
12573 positional arguments leaving out named arguments.
12575 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12576 type to the enum type is not allowed. Remove code corresponding to
12579 (ConvertNumericExplicit): Allow explicit conversions from
12580 the underlying type to enum type. This precisely follows the spec
12581 and closes a bug filed by Gonzalo.
12583 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12586 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12588 2002-09-03 Miguel de Icaza <miguel@ximian.com>
12590 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12591 it was important that we stored the right value after the
12592 reduction in `converted'.
12594 2002-09-04 Martin Baulig <martin@gnome.org>
12596 * location.cs (Location.SymbolDocument): Use full pathnames for the
12599 2002-08-30 Miguel de Icaza <miguel@ximian.com>
12601 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12602 of the expression resolve mechanism, because that will catch the
12603 SimpleName error failures.
12605 (Conditional): If we can not resolve the
12606 expression, return, do not crash.
12608 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12611 (location): display token name instead of its number.
12613 2002-08-28 Martin Baulig <martin@gnome.org>
12615 * expression.cs (Binary.ResolveOperator): Don't silently return
12616 but return an error if an operator cannot be applied between two
12619 2002-08-28 Martin Baulig <martin@gnome.org>
12621 * class.cs (Constructor.Define): Set the permission attributes
12622 correctly instead of making all constructors public.
12624 2002-08-28 Martin Baulig <martin@gnome.org>
12626 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12627 for private members before reporting a CS0103; if we find anything,
12630 2002-08-28 Martin Baulig <martin@gnome.org>
12632 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12633 to check whether `closure_start_type == closure_invocation_type',
12634 we also need to check whether `m.DeclaringType == closure_invocation_type'
12635 before bypassing the permission checks. We might be accessing
12636 protected/private members from the base class.
12637 (TypeManager.RealMemberLookup): Only set private_ok if private
12638 members were requested via BindingFlags.NonPublic.
12640 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12642 * expression.cs (MemberAccess.ResolveMemberAccess): Set
12643 MethodGroupExpr.IsExplicitImpl if appropriate.
12644 (Invocation.DoResolve): Don't report the CS0120 for explicit
12645 interface implementations.
12647 2002-08-27 Martin Baulig <martin@gnome.org>
12649 * expression.cs (Invocation.DoResolve): If this is a static
12650 method and we don't have an InstanceExpression, we must report
12653 2002-08-25 Martin Baulig <martin@gnome.org>
12655 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12656 `==' between a valuetype and an object.
12658 2002-08-25 Miguel de Icaza <miguel@ximian.com>
12660 * ecore.cs (TypeExpr): Provide a ToString method.
12662 2002-08-24 Martin Baulig <martin@gnome.org>
12664 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12665 now called proggie.dbg and it's a binary file.
12667 2002-08-23 Martin Baulig <martin@gnome.org>
12669 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12671 2002-08-23 Martin Baulig <martin@gnome.org>
12673 * struct.cs (MyStructInfo.ctor): Make this work with empty
12674 structs; it's not allowed to use foreach() on null.
12676 2002-08-23 Martin Baulig <martin@gnome.org>
12678 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12679 writer the full pathname of the generated assembly.
12681 2002-08-23 Martin Baulig <martin@gnome.org>
12683 * statements.cs (FlowBranching.UsageVector.MergeChildren):
12684 A `finally' block never returns or breaks; improved handling of
12687 2002-08-23 Martin Baulig <martin@gnome.org>
12689 * statement.cs (Throw.Resolve): Allow `throw null'.
12691 2002-08-23 Martin Baulig <martin@gnome.org>
12693 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12694 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12695 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
12696 MemberLookup would return a wrong event if this is an explicit
12697 interface implementation and the class has an event with the same
12700 2002-08-23 Martin Baulig <martin@gnome.org>
12702 * statement.cs (Block.AddChildVariableNames): New public method.
12703 (Block.AddChildVariableName): Likewise.
12704 (Block.IsVariableNameUsedInChildBlock): Likewise.
12705 (Block.AddVariable): Check whether a variable name has already
12706 been used in a child block.
12708 * cs-parser.jay (declare_local_variables): Mark all variable names
12709 from the current block as being used in a child block in the
12712 2002-08-23 Martin Baulig <martin@gnome.org>
12714 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12715 find the symbol writer.
12717 * driver.cs: csc also allows the arguments to /define being
12718 separated by commas, not only by semicolons.
12720 2002-08-23 Martin Baulig <martin@gnome.org>
12722 * interface.cs (Interface.GetMembers): Added static check for events.
12724 2002-08-15 Martin Baulig <martin@gnome.org>
12726 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12727 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12729 * ecore.cs (Expression.MemberLookup): Added documentation and explained
12730 why the MethodData.EmitDestructor() change was necessary.
12732 2002-08-20 Martin Baulig <martin@gnome.org>
12734 * class.cs (TypeContainer.FindMembers): Added static check for events.
12736 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12738 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12739 use Type.GetEvents(), not Type.FindMembers().
12741 2002-08-20 Martin Baulig <martin@gnome.org>
12743 * decl.cs (MemberCache): Added a special method cache which will
12744 be used for method-only searched. This ensures that a method
12745 search will return a MethodInfo with the correct ReflectedType for
12748 2002-08-20 Martin Baulig <martin@gnome.org>
12750 * decl.cs (DeclSpace.FindMembers): Made this public.
12752 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12754 * delegate.cs: fixed build on windows.
12755 [FIXME: Filed as bug #29150: MCS must report these errors.]
12757 2002-08-19 Ravi Pratap <ravi@ximian.com>
12759 * ecore.cs (StandardConversionExists): Return a false
12760 if we are trying to convert the void type to anything else
12761 since that is not allowed.
12763 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12764 we flag error 70 in the event an event is trying to be accessed
12765 directly from outside the declaring type.
12767 2002-08-20 Martin Baulig <martin@gnome.org>
12769 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12770 MemberCache from typemanager.cs to decl.cs.
12772 2002-08-19 Martin Baulig <martin@gnome.org>
12774 * class.cs (TypeContainer): Implement IMemberContainer.
12775 (TypeContainer.DefineMembers): Create the MemberCache.
12776 (TypeContainer.FindMembers): Do better BindingFlags checking; only
12777 return public members if BindingFlags.Public was given, check
12778 whether members are static.
12780 2002-08-16 Martin Baulig <martin@gnome.org>
12782 * decl.cs (DeclSpace.Define): Splitted this in Define and
12783 DefineMembers. DefineMembers is called first and initializes the
12786 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
12787 DefineMembers() on all our DeclSpaces.
12789 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12790 but call DefineMembers() on all nested interfaces. We call their
12791 Define() in our new Define() function.
12793 * interface.cs (Interface): Implement IMemberContainer.
12794 (Interface.Define): Moved all code except the attribute stuf to
12796 (Interface.DefineMembers): Initialize the member cache.
12798 * typemanager.cs (IMemberFinder): Removed this interface, we don't
12799 need this anymore since we can use MemberCache.FindMembers directly.
12801 2002-08-19 Martin Baulig <martin@gnome.org>
12803 * typemanager.cs (MemberCache): When creating the cache for an
12804 interface type, add all inherited members.
12805 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12806 to `out bool used_cache' and documented it.
12807 (TypeManager.MemberLookup): If we already used the cache in the first
12808 iteration, we don't need to do the interfaces check.
12810 2002-08-19 Martin Baulig <martin@gnome.org>
12812 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
12813 here from IMemberFinder and don't implement this interface anymore.
12814 (DeclSpace.MemberCache): Moved here from IMemberFinder.
12816 * typemanager.cs (IMemberFinder): This interface is now only used by
12817 classes which actually support the member cache.
12818 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12819 since we only put DeclSpaces into this Hashtable.
12820 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12821 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12823 2002-08-16 Martin Baulig <martin@gnome.org>
12825 * typemanager.cs (ICachingMemberFinder): Removed.
12826 (IMemberFinder.MemberCache): New property.
12827 (TypeManager.FindMembers): Merged this with RealFindMembers().
12828 This function will never be called from TypeManager.MemberLookup()
12829 so we can't use the cache here, just the IMemberFinder.
12830 (TypeManager.MemberLookup_FindMembers): Check whether the
12831 IMemberFinder has a MemberCache and call the cache's FindMembers
12833 (MemberCache): Rewrote larger parts of this yet another time and
12834 cleaned it up a bit.
12836 2002-08-15 Miguel de Icaza <miguel@ximian.com>
12838 * driver.cs (LoadArgs): Support quoting.
12840 (Usage): Show the CSC-like command line arguments.
12842 Improved a few error messages.
12844 2002-08-15 Martin Baulig <martin@gnome.org>
12846 * typemanager.cs (IMemberContainer.Type): New property.
12847 (IMemberContainer.IsInterface): New property.
12849 The following changes are conditional to BROKEN_RUNTIME, which is
12850 defined at the top of the file.
12852 * typemanager.cs (MemberCache.MemberCache): Don't add the base
12853 class'es members, but add all members from TypeHandle.ObjectType
12854 if we're an interface.
12855 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12856 is the current type.
12857 (MemberCache.CacheEntry.Container): Removed this field.
12858 (TypeHandle.GetMembers): Include inherited members.
12860 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12862 * typemanager.cs: fixed compilation and added a comment on a field that
12865 2002-08-15 Martin Baulig <martin@gnome.org>
12867 * class.cs (ConstructorInitializer.Resolve): In the
12868 Expression.MemberLookup call, use the queried_type as
12871 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12872 declared' attribute, it's always true.
12873 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12874 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12875 temporary wrapper for FindMembers which tells MemberLookup whether
12876 members from the base classes are included in the return value.
12877 This will go away soon.
12878 (TypeManager.MemberLookup): Use this temporary hack here; once the
12879 new MemberCache is completed, we don't need to do the DeclaredOnly
12880 looping here anymore since the MemberCache will take care of this.
12881 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12882 (MemberCache): When creating the MemberCache for a class, get
12883 members from the current class and all its base classes.
12884 (MemberCache.CacheEntry.Container): New field. This is a
12885 temporary hack until the Mono runtime is fixed to distinguish
12886 between ReflectedType and DeclaringType. It allows us to use MCS
12887 with both the MS runtime and the unfixed Mono runtime without
12888 problems and without accecting performance.
12889 (MemberCache.SearchMembers): The DeclaredOnly looping from
12890 TypeManager.MemberLookup is now done here.
12892 2002-08-14 Martin Baulig <martin@gnome.org>
12894 * statement.cs (MyStructInfo.MyStructInfo): Don't call
12895 Type.GetFields on dynamic types but get the fields from the
12896 corresponding TypeContainer.
12897 (MyStructInfo.GetStructInfo): Added check for enum types.
12899 * typemanager.cs (MemberList.IsSynchronized): Implemented.
12900 (MemberList.SyncRoot): Implemented.
12901 (TypeManager.FilterWithClosure): No need to check permissions if
12902 closure_start_type == closure_invocation_type, don't crash if
12903 closure_invocation_type is null.
12905 2002-08-13 Martin Baulig <martin@gnome.org>
12907 Rewrote TypeContainer.FindMembers to use a member cache. This
12908 gives us a speed increase of about 35% for the self-hosting MCS
12909 build and of about 15-20% for the class libs (both on GNU/Linux).
12911 * report.cs (Timer): New class to get enhanced profiling. This
12912 whole class is "TIMER" conditional since it remarkably slows down
12915 * class.cs (MemberList): New class. This is an IList wrapper
12916 which we're now using instead of passing MemberInfo[]'s around to
12917 avoid copying this array unnecessarily.
12918 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12919 (ICachingMemberFinder, IMemberContainer): New interface.
12920 (TypeManager.FilterWithClosure): If `criteria' is null, the name
12921 has already been checked, otherwise use it for the name comparision.
12922 (TypeManager.FindMembers): Renamed to RealMemberFinder and
12923 provided wrapper which tries to use ICachingMemberFinder.FindMembers
12924 if possible. Returns a MemberList, not a MemberInfo [].
12925 (TypeHandle): New class, implements IMemberContainer. We create
12926 one instance of this class per type, it contains a MemberCache
12927 which is used to do the member lookups.
12928 (MemberCache): New class. Each instance of this class contains
12929 all members of a type and a name-based hash table.
12930 (MemberCache.FindMembers): This is our new member lookup
12931 function. First, it looks up all members of the requested name in
12932 the hash table. Then, it walks this list and sorts out all
12933 applicable members and returns them.
12935 2002-08-13 Martin Baulig <martin@gnome.org>
12937 In addition to a nice code cleanup, this gives us a performance
12938 increase of about 1.4% on GNU/Linux - not much, but it's already
12939 half a second for the self-hosting MCS compilation.
12941 * typemanager.cs (IMemberFinder): New interface. It is used by
12942 TypeManager.FindMembers to call FindMembers on a TypeContainer,
12943 Enum, Delegate or Interface.
12944 (TypeManager.finder_to_member_finder): New PtrHashtable.
12945 (TypeManager.finder_to_container): Removed.
12946 (TypeManager.finder_to_delegate): Removed.
12947 (TypeManager.finder_to_interface): Removed.
12948 (TypeManager.finder_to_enum): Removed.
12950 * interface.cs (Interface): Implement IMemberFinder.
12952 * delegate.cs (Delegate): Implement IMemberFinder.
12954 * enum.cs (Enum): Implement IMemberFinder.
12956 * class.cs (TypeContainer): Implement IMemberFinder.
12958 2002-08-12 Martin Baulig <martin@gnome.org>
12960 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12962 2002-08-12 Martin Baulig <martin@gnome.org>
12964 * ecore.cs (ITypeExpression): New interface for expressions which
12966 (TypeExpression): Renamed to TypeLookupExpression.
12967 (Expression.DoResolve): If we're doing a types-only lookup, the
12968 expression must implement the ITypeExpression interface and we
12969 call DoResolveType() on it.
12970 (SimpleName): Implement the new ITypeExpression interface.
12971 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12972 hack, the situation that we're only looking up types can't happen
12973 anymore when this method is called. Moved the type lookup code to
12974 DoResolveType() and call it.
12975 (SimpleName.DoResolveType): This ITypeExpression interface method
12976 is now doing the types-only lookup.
12977 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12978 (ResolveFlags): Added MaskExprClass.
12980 * expression.cs (MemberAccess): Implement the ITypeExpression
12982 (MemberAccess.DoResolve): Added support for a types-only lookup
12983 when we're called via ITypeExpression.DoResolveType().
12984 (ComposedCast): Implement the ITypeExpression interface.
12986 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
12987 Expression.Resolve() with ResolveFlags.Type instead.
12989 2002-08-12 Martin Baulig <martin@gnome.org>
12991 * interface.cs (Interface.Define): Apply attributes.
12993 * attribute.cs (Attribute.ApplyAttributes): Added support for
12994 interface attributes.
12996 2002-08-11 Martin Baulig <martin@gnome.org>
12998 * statement.cs (Block.Emit): Only check the "this" variable if we
12999 do not always throw an exception.
13001 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13002 whether the property has a set accessor.
13004 2002-08-11 Martin Baulig <martin@gnome.org>
13006 Added control flow analysis support for structs.
13008 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13009 with control flow analysis turned off.
13010 (IVariable): New interface.
13011 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13012 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13013 (FieldExpr.DoResolve): Resolve the instance expression with flow
13014 analysis turned off and do the definite assignment check after the
13015 resolving when we know what the expression will resolve to.
13017 * expression.cs (LocalVariableReference, ParameterReference):
13018 Implement the new IVariable interface, only call the flow analysis
13019 code if ec.DoFlowAnalysis is true.
13020 (This): Added constructor which takes a Block argument. Implement
13021 the new IVariable interface.
13022 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13023 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13024 This does the definite assignment checks for struct members.
13026 * class.cs (Constructor.Emit): If this is a non-static `struct'
13027 constructor which doesn't have any initializer, call
13028 Block.AddThisVariable() to tell the flow analysis code that all
13029 struct elements must be initialized before control returns from
13032 * statement.cs (MyStructInfo): New public class.
13033 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13034 argument to this indexer. If non-zero, check an individual struct
13035 member, not the whole struct.
13036 (FlowBranching.CheckOutParameters): Check struct members.
13037 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13038 overloaded versions of these methods which take an additional
13039 `int field_idx' argument to check struct members.
13040 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13041 overloaded versions of these methods which take an additional
13042 `string field_name' argument to check struct member.s
13043 (VariableInfo): Implement the IVariable interface.
13044 (VariableInfo.StructInfo): New public property. Returns the
13045 MyStructInfo instance of the variable if it's a struct or null.
13046 (Block.AddThisVariable): New public method. This is called from
13047 Constructor.Emit() for non-static `struct' constructor which do
13048 not have any initializer. It creates a special variable for the
13049 "this" instance variable which will be checked by the flow
13050 analysis code to ensure that all of the struct's fields are
13051 initialized before control returns from the constructor.
13052 (UsageVector): Added support for struct members. If a
13053 variable/parameter is a struct with N members, we reserve a slot
13054 in the usage vector for each member. A struct is considered fully
13055 initialized if either the struct itself (slot 0) or all its
13056 members are initialized.
13058 2002-08-08 Martin Baulig <martin@gnome.org>
13060 * driver.cs (Driver.MainDriver): Only report an error CS5001
13061 if there were no compilation errors.
13063 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13064 `UnsafeContext' property to determine whether the parent is in
13065 unsafe context rather than checking the parent's ModFlags:
13066 classes nested in an unsafe class are unsafe as well.
13068 2002-08-08 Martin Baulig <martin@gnome.org>
13070 * statement.cs (UsageVector.MergeChildren): Distinguish between
13071 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13072 we return. Added test17() and test18() to test-154.cs.
13074 2002-08-08 Martin Baulig <martin@gnome.org>
13076 * typemanager.cs (TypeManager.FilterWithClosure): If we have
13077 Family access, make sure the invoking type isn't a subclass of the
13078 queried type (that'd be a CS1540).
13080 * ecore.cs (Expression.MemberLookup): Added overloaded version of
13081 this method which takes an additional `Type invocation_type'.
13083 * expression.cs (BaseAccess.DoResolve): Use the base type as
13084 invocation and query type.
13085 (MemberAccess.DoResolve): If the lookup failed and we're about to
13086 report a CS0122, try a lookup with the ec.ContainerType - if this
13087 succeeds, we must report a CS1540.
13089 2002-08-08 Martin Baulig <martin@gnome.org>
13091 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13092 (MethodGroupExpr): Implement the IMemberExpr interface.
13094 * expression (MemberAccess.ResolveMemberAccess): No need to have
13095 any special code for MethodGroupExprs anymore, they're now
13098 2002-08-08 Martin Baulig <martin@gnome.org>
13100 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13101 Family, FamANDAssem and FamORAssem permissions.
13102 (TypeManager.IsSubclassOrNestedChildOf): New public method.
13104 2002-08-08 Martin Baulig <martin@gnome.org>
13106 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13107 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13110 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13112 * driver.cs: implemented /resource option to embed managed resources.
13114 2002-08-07 Martin Baulig <martin@gnome.org>
13116 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13117 (FieldBase.HasFieldInitializer): New public property.
13118 (FieldBase.GetInitializerExpression): New public method. Resolves and
13119 returns the field initializer and makes sure it is only resolved once.
13120 (TypeContainer.EmitFieldInitializers): Call
13121 FieldBase.GetInitializerExpression to get the initializer, this ensures
13122 that it isn't resolved multiple times.
13124 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
13125 the resolving process (SimpleName/MemberLookup) that we're currently
13126 emitting a field initializer (which must not access any instance members,
13127 this is an error CS0236).
13129 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13130 argument, if the `IsFieldInitializer' flag is set, we must report and
13131 error CS0236 and not an error CS0120.
13133 2002-08-07 Martin Baulig <martin@gnome.org>
13135 * ecore.cs (IMemberExpr): New public interface.
13136 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13137 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13138 if the expression is an IMemberExpr.
13140 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13141 to be null, implicitly default to `this' if we're non-static in
13142 this case. Simplified the code a lot by using the new IMemberExpr
13143 interface. Also fixed bug #28176 here.
13145 2002-08-06 Martin Baulig <martin@gnome.org>
13147 * cs-parser.jay (SimpleLookup): Removed. We need to create
13148 ParameterReferences during semantic analysis so that we can do a
13149 type-only search when resolving Cast, TypeOf and SizeOf.
13150 (block): Pass the `current_local_parameters' to the Block's
13153 * class.cs (ConstructorInitializer): Added `Parameters parameters'
13154 argument to the constructor.
13155 (ConstructorInitializer.Resolve): Create a temporary implicit
13156 block with the parameters.
13158 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13159 references here if we aren't doing a type-only search.
13161 * statement.cs (Block): Added constructor which takes a
13162 `Parameters parameters' argument.
13163 (Block.Parameters): New public property.
13165 * support.cs (InternalParameters.Parameters): Renamed `parameters'
13166 to `Parameters' and made it public readonly.
13168 2002-08-06 Martin Baulig <martin@gnome.org>
13170 * ecore.cs (Expression.Warning): Made this public as well.
13172 * report.cs (Report.Debug): Print the contents of collections.
13174 2002-08-06 Martin Baulig <martin@gnome.org>
13176 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
13177 used to tell Resolve() which kinds of expressions it may return.
13178 (Expression.Resolve): Added overloaded version of this method which
13179 takes a `ResolveFlags flags' argument. This can be used to tell
13180 Resolve() which kinds of expressions it may return. Reports a
13182 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13183 ResolveFlags.SimpleName.
13184 (Expression.Error118): Added overloaded version of this method which
13185 takes a `ResolveFlags flags' argument. It uses the flags to determine
13186 which kinds of expressions are allowed.
13188 * expression.cs (Argument.ResolveMethodGroup): New public method.
13189 Resolves an argument, but allows a MethodGroup to be returned.
13190 This is used when invoking a delegate.
13192 * TODO: Updated a bit.
13194 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13196 Fixed compilation with csc.
13198 * ecore.cs: Expression.Error made public. Is this correct? Should
13199 Warning be made public too?
13201 * expression.cs: use ea.Location instead of ea.loc.
13202 [FIXME: Filed as bug #28607: MCS must report these errors.]
13204 2002-08-06 Martin Baulig <martin@gnome.org>
13206 * ecore.cs (Expression.loc): Moved the location here instead of
13207 duplicating it in all derived classes.
13208 (Expression.Location): New public property.
13209 (Expression.Error, Expression.Warning): Made them non-static and
13210 removed the location argument.
13211 (Expression.Warning): Added overloaded version which takes an
13212 `int level' argument.
13213 (Expression.Error118): Make this non-static and removed the
13214 expression and location arguments.
13215 (TypeExpr): Added location argument to the constructor.
13217 * expression.cs (StaticCallExpr): Added location argument to
13219 (Indirection, PointerArithmetic): Likewise.
13220 (CheckedExpr, UnCheckedExpr): Likewise.
13221 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13222 (StringPtr): Likewise.
13225 2002-08-05 Martin Baulig <martin@gnome.org>
13227 * expression.cs (BaseAccess.DoResolve): Actually report errors.
13229 * assign.cs (Assign.DoResolve): Check whether the source
13230 expression is a value or variable.
13232 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13233 while resolving the corresponding blocks.
13235 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13236 an error, don't silently return null.
13238 * statement.cs (Block.AddVariable): Do the error reporting here
13239 and distinguish between CS0128 and CS0136.
13240 (Block.DoResolve): Report all unused labels (warning CS0164).
13241 (LabeledStatement): Pass the location to the constructor.
13242 (LabeledStatement.HasBeenReferenced): New property.
13243 (LabeledStatement.Resolve): Set it to true here.
13245 * statement.cs (Return.Emit): Return success even after reporting
13246 a type mismatch error (CS0126 or CS0127), this is what csc does and
13247 it avoids confusing the users with any consecutive errors.
13249 2002-08-05 Martin Baulig <martin@gnome.org>
13251 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13253 * const.cs (Const.LookupConstantValue): Catch circular definitions.
13255 * expression.cs (MemberAccess.DoResolve): Silently return if an
13256 error has already been reported.
13258 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13259 error has already been reported.
13261 2002-08-05 Martin Baulig <martin@gnome.org>
13263 * statement.cs (UsageVector): Only initialize the `parameters'
13264 vector if we actually have any "out" parameters.
13266 2002-08-05 Martin Baulig <martin@gnome.org>
13268 * expression.cs (Binary.ResolveOperator): When combining delegates,
13269 they must have the same type.
13271 2002-08-05 Martin Baulig <martin@gnome.org>
13273 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13274 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13275 work with the ms runtime and we also don't need it: if we're a
13276 PropertyBuilder and not in the `indexer_arguments' hash, then we
13277 are a property and not an indexer.
13279 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13280 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13281 since the latter one doesn't work with the ms runtime.
13283 2002-08-03 Martin Baulig <martin@gnome.org>
13285 Fixed bugs #27998 and #22735.
13287 * class.cs (Method.IsOperator): New public field.
13288 (Method.CheckBase): Report CS0111 if there's already a method
13289 with the same parameters in the current class. Report CS0508 when
13290 attempting to change the return type of an inherited method.
13291 (MethodData.Emit): Report CS0179 if a method doesn't have a body
13292 and it's not marked abstract or extern.
13293 (PropertyBase): New abstract base class for Property and Indexer.
13294 (PropertyBase.CheckBase): Moved here from Property and made it work
13296 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13297 the same so we can reuse it there.
13298 (Property, Indexer): Derive from PropertyBase.
13299 (MethodSignature.inheritable_property_signature_filter): New delegate
13300 to find properties and indexers.
13302 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13303 argument and improved error reporting.
13305 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13306 EmptyReadOnlyParameters and made it a property.
13308 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13309 version of this method which takes a `PropertyInfo indexer'.
13310 (TypeManager.RegisterIndexer): New method.
13312 * class.cs: Added myself as author of this file :-)
13314 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13316 * class.cs: fixed compilation on windoze.
13318 2002-08-03 Martin Baulig <martin@gnome.org>
13320 * interface.cs (Interface.GetInterfaceBases): Check whether all
13321 base interfaces are at least as accessible than the current one.
13323 * class.cs (TypeContainer.GetClassBases): Check whether base types
13324 are at least as accessible than the current type.
13325 (TypeContainer.AsAccessible): Implemented and made non-static.
13326 (MemberBase.CheckParameters): Report errors if the accessibility
13329 * delegate.cs (Delegate.Delegate): The default visibility is
13330 internal for top-level types and private for nested types.
13331 (Delegate.Define): Report errors if the accessibility checks fail.
13333 * enum.cs (Enum.Enum): The default visibility is internal for
13334 top-level types and private for nested types.
13335 (Enum.DefineType): Compute the correct visibility.
13337 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13338 function which takes a `bool is_toplevel' instead of a TypeContainer.
13340 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13343 2002-08-02 Martin Baulig <martin@gnome.org>
13345 * expression.cs (LocalVariableReferenc): Added constructor which
13346 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13347 (LocalVariableReference.IsReadOnly): New property.
13348 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13349 variable is readonly, use our own readonly flag to do this; you can
13350 use the new constructor to get a writable reference to a read-only
13353 * cs-parser.jay (foreach_statement, using_statement): Get a writable
13354 reference to the local variable.
13356 2002-08-01 Miguel de Icaza <miguel@ximian.com>
13358 * rootcontext.cs (ResolveCore): Also include System.Exception
13360 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13361 we reach an EmptyStatement.
13363 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13366 * expression.cs (Binary.ResolveOperator): Check error result in
13369 use brtrue/brfalse directly and avoid compares to null.
13371 2002-08-02 Martin Baulig <martin@gnome.org>
13373 * class.cs (TypeContainer.Define): Define all nested interfaces here.
13374 Fixes bug #28407, added test-155.cs.
13376 2002-08-01 Martin Baulig <martin@gnome.org>
13378 * class.cs (Event.EmitDefaultMethod): Make this work with static
13379 events. Fixes #28311, added verify-3.cs.
13381 2002-08-01 Martin Baulig <martin@gnome.org>
13383 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13384 `is_disposable' fields.
13385 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13386 `hm.is_disposable' if we're using the collection pattern.
13387 (Foreach.EmitCollectionForeach): Use the correct type for the
13388 enumerator's local variable, only emit the try/finally block if
13389 necessary (fixes #27713).
13391 2002-08-01 Martin Baulig <martin@gnome.org>
13393 * ecore.cs (Expression.report118): Renamed to Error118 and made
13396 * statement.cs (Throw.Resolve): Check whether the expression is of
13397 the correct type (CS0118) and whether the type derives from
13398 System.Exception (CS0155).
13399 (Catch.Resolve): New method. Do the type lookup here and check
13400 whether it derives from System.Exception (CS0155).
13401 (Catch.CatchType, Catch.IsGeneral): New public properties.
13403 * typemanager.cs (TypeManager.exception_type): Added.
13405 2002-07-31 Miguel de Icaza <miguel@ximian.com>
13407 * driver.cs: Updated About function.
13409 2002-07-31 Martin Baulig <martin@gnome.org>
13411 Implemented Control Flow Analysis.
13413 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13414 (EmitContext.CurrentBranching): Added.
13415 (EmitContext.StartFlowBranching): Added.
13416 (EmitContext.EndFlowBranching): Added.
13417 (EmitContext.KillFlowBranching): Added.
13418 (EmitContext.IsVariableAssigned): Added.
13419 (EmitContext.SetVariableAssigned): Added.
13420 (EmitContext.IsParameterAssigned): Added.
13421 (EmitContext.SetParameterAssigned): Added.
13422 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13423 Added control flow analysis stuff here.
13425 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13426 resolve the expression as lvalue.
13427 (LocalVariableReference.DoResolve): Check whether the variable has
13428 already been assigned.
13429 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13430 the parameter as assigned here.
13431 (ParameterReference.DoResolve): Check whether the parameter has already
13433 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13434 expression as lvalue.
13436 * statement.cs (FlowBranching): New class for the flow analysis code.
13437 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13438 (LabeledStatement.IsDefined): New public property.
13439 (LabeledStatement.AddUsageVector): New public method to tell flow
13440 analyis that the label may be reached via a forward jump.
13441 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13443 (VariableInfo.Number): New public field. This is used by flow analysis
13444 to number all locals of a block.
13445 (Block.CountVariables): New public property. This is the number of
13446 local variables in this block (including the locals from all parent
13448 (Block.EmitMeta): Number all the variables.
13450 * statement.cs: Added flow analysis support to all classes.
13452 2002-07-31 Martin Baulig <martin@gnome.org>
13454 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13455 To get debugging messages, compile mcs with /define:MCS_DEBUG and
13456 then use this argument.
13458 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13460 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13461 use this to specify /define options.
13463 2002-07-29 Martin Baulig <martin@gnome.org>
13465 * statement.cs (Fixed): Moved all code that does variable lookups
13466 and resolvings from Emit to Resolve.
13468 * statement.cs (For): Moved all code that does variable lookups
13469 and resolvings from Emit to Resolve.
13471 * statement.cs (Using): Moved all code that does variable lookups
13472 and resolvings from Emit to Resolve.
13474 2002-07-29 Martin Baulig <martin@gnome.org>
13476 * attribute.cs (Attribute.Resolve): Explicitly catch a
13477 System.NullReferenceException when creating the
13478 CustromAttributeBuilder and report a different warning message.
13480 2002-07-29 Martin Baulig <martin@gnome.org>
13482 * support.cs (ParameterData.ParameterName): Added method to
13483 get the name of a parameter.
13485 * typemanager.cs (TypeManager.IsValueType): New public method.
13487 2002-07-29 Martin Baulig <martin@gnome.org>
13489 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
13490 is a flag which specifies that it's either ref or out.
13491 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13492 the out parameter to `out Parameter.Modifier mod', also set the
13493 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13495 * support.cs (InternalParameters.ParameterModifier): Distinguish
13496 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13497 Parameter.Modifier.ISBYREF flag if it's either ref or out.
13499 * expression.cs (Argument.GetParameterModifier): Distinguish
13500 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13501 Parameter.Modifier.ISBYREF flag if it's either ref or out.
13503 2002-07-29 Martin Baulig <martin@gnome.org>
13505 * expression.cs (ParameterReference.ParameterReference): Added
13506 `Location loc' argument to the constructor.
13508 * cs-parser.jay: Pass location to ParameterReference.
13510 2002-07-28 Miguel de Icaza <miguel@ximian.com>
13512 * statement.cs (Try): Initialize the location.
13514 * cs-parser.jay: pass location to Try.
13516 * expression.cs (Unary.Reduce): Change the prototype to return
13517 whether a constant fold could be performed or not. The result is
13518 returned in an out parameters. In the case of Indirection and
13519 AddressOf, we want to perform the full tests.
13521 2002-07-26 Miguel de Icaza <miguel@ximian.com>
13523 * statement.cs (Statement.Emit): Flag dead code.
13525 2002-07-27 Andrew Birkett <andy@nobugs.org>
13527 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13529 2002-07-27 Martin Baulig <martin@gnome.org>
13531 * class.cs (MethodData.Define): Put back call to
13532 TypeManager.AddMethod(), accidentally commented this out.
13534 * report.cs (Debug): New public method to print debugging information,
13535 this is `[Conditional ("DEBUG")]'.
13537 2002-07-26 Martin Baulig <martin@gnome.org>
13539 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13540 (switch_statement): Push the current_block to the switch_stack and
13541 pop it again when we're done with the switch.
13542 (switch_section): The new block is a child of the current_block.
13543 Fixes bug #24007, added test-152.cs.
13545 2002-07-27 Martin Baulig <martin@gnome.org>
13547 * expression.cs (Invocation.EmitArguments): When calling a varargs
13548 function with only its fixed arguments, we need to pass an empty
13551 2002-07-27 Martin Baulig <martin@gnome.org>
13553 Mono 0.13 has been released.
13555 2002-07-25 Miguel de Icaza <miguel@ximian.com>
13557 * driver.cs: Rename --resource to --linkres, because that is what
13558 we do currently, we dont support --resource yet.
13560 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13562 2002-07-25 Martin Baulig <martin@gnome.org>
13564 * class.cs (MethodData): New public class. This is a `method builder'
13565 class for a method or one accessor of a Property/Indexer/Event.
13566 (MethodData.GetMethodFlags): Moved here from MemberBase.
13567 (MethodData.ApplyAttributes): Likewise.
13568 (MethodData.ApplyObsoleteAttribute): Likewise.
13569 (MethodData.ApplyConditionalAttribute): Likewise.
13570 (MethodData.ApplyDllImportAttribute): Likewise.
13571 (MethodData.CheckAbstractAndExternal): Likewise.
13572 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13573 (MethodData.Emit): Formerly known as Method.Emit().
13574 (MemberBase): Moved everything which was specific to a single
13575 accessor/method to MethodData.
13576 (Method): Create a new MethodData and call Define() and Emit() on it.
13577 (Property, Indexer, Event): Create a new MethodData objects for each
13578 accessor and call Define() and Emit() on them.
13580 2002-07-25 Martin Baulig <martin@gnome.org>
13582 Made MethodCore derive from MemberBase to reuse the code from there.
13583 MemberBase now also checks for attributes.
13585 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13586 (MemberBase.GetMethodFlags): Moved here from class Method and marked
13588 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13589 `CallingConventions cc' and `Attributes opt_attrs' arguments.
13590 (MemberBase.ApplyAttributes): New virtual method; applies the
13591 attributes to a method or accessor.
13592 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13593 (MemberBase.ApplyConditionalAttribute): Likewise.
13594 (MemberBase.ApplyDllImportAttribute): Likewise.
13595 (MemberBase.CheckAbstractAndExternal): Likewise.
13596 (MethodCore.ParameterTypes): This is now a property instead of a
13597 method, it's initialized from DoDefineParameters().
13598 (MethodCore.ParameterInfo): Removed the set accessor.
13599 (MethodCore.DoDefineParameters): New protected virtual method to
13600 initialize ParameterTypes and ParameterInfo.
13601 (Method.GetReturnType): We can now simply return the MemberType.
13602 (Method.GetMethodFlags): Override the MemberBase version and add
13603 the conditional flags.
13604 (Method.CheckBase): Moved some code from Define() here, call
13605 DoDefineParameters() here.
13606 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13607 here to avoid some larger code duplication.
13608 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13609 ensure that abstract and external accessors don't declare a body.
13611 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13612 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13613 lookup in the attribute's parent classes, so we need to abort as soon
13614 as we found the first match.
13615 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13616 the attribute has no arguments.
13618 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13621 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13623 * cs-parser.jay: reverted previous patch.
13625 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13627 * cs-parser.jay: fixed bug #22119.
13629 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13631 * attribute.cs: fixed compilation. The error was:
13632 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
13633 be assigned to before control leaves the current method."
13634 [FIXME: Filed as bug #28186: MCS must report this error.]
13636 2002-07-25 Martin Baulig <martin@gnome.org>
13638 * attribute.cs (Attribute.Conditional_GetConditionName): New static
13639 method to pull the condition name ouf of a Conditional attribute.
13640 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13641 the obsolete message and error flag out of an Obsolete attribute.
13643 * class.cs (Method.GetMethodFlags): New public method to get the
13644 TypeManager.MethodFlags for this method.
13645 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13647 (Method.Define): Get and apply the Obsolete and Conditional attributes;
13648 if we're overriding a virtual function, set the new private variable
13649 `parent_method'; call the new TypeManager.AddMethod().
13651 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
13652 the MethodBuilder and the Method in a PtrHashtable.
13653 (TypeManager.builder_to_method): Added for this purpose.
13654 (TypeManager.MethodFlags): Added IsObsoleteError.
13655 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
13656 Obsolete and Conditional arguments in MethodBuilders. If we discover
13657 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13658 the message from the attribute.
13660 2002-07-24 Martin Baulig <martin@gnome.org>
13662 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13663 preprocessor directives, ensure that the argument to #define/#undef is
13664 exactly one identifier and that it's actually an identifier.
13666 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13669 2002-07-24 Martin Baulig <martin@gnome.org>
13671 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13672 initialize it to TypeManager.object_type in the constructor.
13673 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13674 of the `hm.get_current' method if we're using the collection pattern.
13675 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13676 for the explicit conversion to make it work when we're using the collection
13677 pattern and the `Current' property has a different return type than `object'.
13680 2002-07-24 Martin Baulig <martin@gnome.org>
13682 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13683 does not match, but don't report any errors. This method is called in
13684 order for all methods in a MethodGroupExpr until a matching method is
13685 found, so we don't want to bail out if the first method doesn't match.
13686 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13687 matches, report the 123. Fixes #28070.
13689 2002-07-24 Martin Baulig <martin@gnome.org>
13691 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13692 TypeManager.TypeToCoreType() to the top of the method so the
13693 following equality checks will work. Fixes #28107.
13695 2002-07-24 Martin Baulig <martin@gnome.org>
13697 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13698 operand is of type uint, and the other operand is of type sbyte,
13699 short or int, the operands are converted to type long." -
13700 Actually do what this comment already told us. Fixes bug #28106,
13703 2002-07-24 Martin Baulig <martin@gnome.org>
13705 * class.cs (MethodBase): New abstract class. This is now a base
13706 class for Property, Indexer and Event to avoid some code duplication
13707 in their Define() and DefineMethods() methods.
13708 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13709 generic methods for Define() and DefineMethods().
13710 (FieldBase): Derive from MemberBase, not MemberCore.
13711 (Property): Derive from MemberBase, not MemberCore.
13712 (Property.DefineMethod): Moved all the code from this method to the
13713 new MethodBase.DefineAccessor(), just call it with appropriate
13715 (Property.Define): Call the new Property.DoDefine(), this does some
13716 sanity checks and we don't need to duplicate the code everywhere.
13717 (Event): Derive from MemberBase, not MemberCore.
13718 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13719 accessors, this will also make them work with interface events.
13720 (Indexer): Derive from MemberBase, not MemberCore.
13721 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13722 (Indexer.Define): Use the new MethodBase functions.
13724 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13725 argument to the constructor.
13726 (Interface.FindMembers): Added support for interface events.
13727 (Interface.PopluateEvent): Implemented.
13729 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
13731 2002-07-22 Miguel de Icaza <miguel@ximian.com>
13733 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13734 but this is required to check for a method name being the same as
13735 the containing class.
13739 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13741 * interface.cs: initialize variable.
13743 2002-07-23 Martin Baulig <martin@gnome.org>
13745 Implemented the IndexerName attribute in interfaces.
13747 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13748 name if this is an explicit interface implementation.
13749 (Indexer.InterfaceIndexerName): New public variable. If we're
13750 implementing an interface indexer, this is the IndexerName in that
13751 interface. Otherwise, it's the IndexerName.
13752 (Indexer.DefineMethod): If we're implementing interface indexer,
13753 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
13754 and Pending.ImplementIndexer methods.
13755 (Indexer.Define): Also define the PropertyBuilder if we're
13756 implementing an interface indexer and this is neither an explicit
13757 interface implementation nor do the IndexerName match the one in
13760 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13761 If a method is defined here, then we always need to create a proxy
13762 for it. This is used when implementing interface indexers.
13763 (Pending.IsInterfaceIndexer): New public method.
13764 (Pending.ImplementIndexer): New public method.
13765 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13766 This is used when implementing interface indexers to define a proxy
13768 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13769 define a proxy if necessary.
13771 * interface.cs (Interface.IndexerName): New public variable.
13772 (Interface.PopulateIndexer): Set the IndexerName.
13773 (Interface.DefineIndexers): New private method. Populate all the
13774 indexers and make sure their IndexerNames match.
13776 * typemanager.cs (IndexerPropertyName): Added support for interface
13779 2002-07-22 Martin Baulig <martin@gnome.org>
13781 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13782 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13783 ret if HasReturnLabel.
13784 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13787 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13788 and set the ec.LoopBeginTryCatchLevel.
13789 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13790 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13791 the current ec.TryCatchLevel, the branch goes out of an exception
13792 block. In this case, we need to use Leave and not Br.
13794 2002-07-22 Martin Baulig <martin@gnome.org>
13796 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13797 block unless the block does not always return or it is contained in
13798 another try { ... } catch { ... } block. Fixes bug #26506.
13799 Added verify-1.cs to the test suite.
13801 2002-07-22 Martin Baulig <martin@gnome.org>
13803 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13804 then we do not always return. Fixes bug #24985.
13806 2002-07-22 Martin Baulig <martin@gnome.org>
13808 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13809 lookup on a per-class level; ie. walk up the class hierarchy until we
13810 found at least one applicable method, then choose the best among them.
13811 Fixes bug #24463 and test-29.cs.
13813 2002-07-22 Martin Baulig <martin@gnome.org>
13815 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13816 return types of the methods. The return type is not part of the
13817 signature and we must not check it to make the `new' modifier work.
13818 Fixes bug #27999, also added test-147.cs.
13819 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13821 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13822 on the method's return type.
13824 2002-07-21 Martin Baulig <martin@gnome.org>
13826 * assign.cs: Make this work if the rightmost source is a constant and
13827 we need to do an implicit type conversion. Also adding a few more tests
13828 to test-38.cs which should have caught this.
13830 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13831 target in the makefile for this. The makefile.gnu is primarily intended
13832 for end-users who don't want to debug the compiler.
13834 2002-07-21 Martin Baulig <martin@gnome.org>
13836 * assign.cs: Improved the Assign class so it can now handle embedded
13837 assignments (X = Y = Z = something). As a side-effect this'll now also
13838 consume less local variables. test-38.cs now passes with MCS, added
13839 a few new test cases to that test.
13841 2002-07-20 Martin Baulig <martin@gnome.org>
13843 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13844 instructions. Fixes bug #27977, also added test-146.cs.
13846 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13848 * cs-tokenizer.cs: fixed getHex ().
13850 2002-07-19 Martin Baulig <martin@gnome.org>
13852 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13853 not Type.GetType() to lookup the array type. This is needed when
13854 we're constructing an array of a user-defined type.
13855 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13856 single-dimensional arrays, but also for single-dimensial arrays of
13859 2002-07-19 Martin Baulig <martin@gnome.org>
13861 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13862 this function is called, it's not allowed to share LocalBuilders
13863 among ILGenerators.
13865 2002-07-19 Martin Baulig <martin@gnome.org>
13867 * expression.cs (Argument.Resolve): Report an error 118 when trying
13868 to pass a type as argument.
13870 2002-07-18 Martin Baulig <martin@gnome.org>
13872 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13873 Conv_R_Un for the signed `long' type.
13875 2002-07-15 Miguel de Icaza <miguel@ximian.com>
13877 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13878 `expr' for the temporary result, as that will fail if we do
13879 multiple resolves on the same expression.
13881 2002-07-05 Miguel de Icaza <miguel@ximian.com>
13883 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13884 ec.TypeContainer for looking up aliases.
13886 * class.cs (TypeContainer): Remove LookupAlias from here.
13888 * decl.cs (DeclSpace); Move here.
13890 2002-07-01 Miguel de Icaza <miguel@ximian.com>
13892 * class.cs (FindMembers): Only call filter if the constructor
13893 bulider is not null.
13895 Also handle delegates in `NestedTypes' now. Now we will perform
13896 type lookups using the standard resolution process. This also
13899 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13900 This uses Expressions (the limited kind that can be parsed by the
13901 tree) instead of strings.
13903 * expression.cs (ComposedCast.ToString): Implement, used to flag
13904 errors since now we have to render expressions.
13906 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
13909 * ecore.cs (SimpleName.ToString): ditto.
13911 * cs-parser.jay: Instead of using strings to assemble types, use
13912 Expressions to assemble the type (using SimpleName, ComposedCast,
13913 MemberAccess). This should fix the type lookups in declarations,
13914 because we were using a different code path for this.
13916 * statement.cs (Block.Resolve): Continue processing statements
13917 even when there is an error.
13919 2002-07-17 Miguel de Icaza <miguel@ximian.com>
13921 * class.cs (Event.Define): Also remove the `remove' method from
13922 the list of pending items.
13924 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13925 generate more compact code.
13927 2002-07-17 Martin Baulig <martin@gnome.org>
13929 * const.cs (Const.LookupConstantValue): Add support for constant
13930 `unchecked' and `checked' expressions.
13931 Also adding test case test-140.cs for this.
13933 2002-07-17 Martin Baulig <martin@gnome.org>
13935 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13936 check whether mi.ReturnType implements the IEnumerator interface; the
13937 `==' and the IsAssignableFrom() will fail in this situation.
13939 2002-07-16 Ravi Pratap <ravi@ximian.com>
13941 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
13944 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13946 * expression.cs: fixed bug #27811.
13948 2002-07-14 Miguel de Icaza <miguel@ximian.com>
13950 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13951 Molaro: when we are a ref, the value already contains a pointer
13952 value, do not take the address of it.
13954 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13955 * removed mb-parser.jay and mb-tokenizer.cs
13957 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13959 * expression.cs: check against the building corlib void type.
13961 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13963 * ecore.cs: fix for valuetype static readonly fields: when
13964 initializing them, we need their address, not the address of a copy.
13966 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13968 * typemanager.cs: register also enum_type in corlib.
13970 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13972 * class.cs: allow calling this (but not base) initializers in structs.
13974 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13976 * ecore.cs: make sure we compare against the building base types
13979 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13981 * typemanager.cs: fix TypeToCoreType() to handle void and object
13982 (corlib gets no more typerefs after this change).
13984 2002-07-12 Miguel de Icaza <miguel@ximian.com>
13986 * expression.cs (ArrayCreation.EmitArrayArguments): use
13987 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13989 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13990 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
13991 array indexes, the runtime actually forbids them.
13993 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13994 for array arguments here.
13996 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13997 instead of the default for ValueTypes.
13999 (New.DoEmit): Use IsValueType instead of
14000 IsSubclassOf (value_type)
14001 (New.DoResolve): ditto.
14002 (Invocation.EmitCall): ditto.
14004 * assign.cs (Assign): ditto.
14006 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14007 Statements *are* currently doing part of their resolution during
14010 Expressions do always resolve during resolve, but statements are
14011 only required to propagate resolution to their children.
14013 2002-07-11 Miguel de Icaza <miguel@ximian.com>
14015 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14017 (LoadAssembly): Do not add the dll if it is already specified
14019 (MainDriver): Add the System directory to the link path at the end,
14020 after all the other -L arguments.
14022 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14023 wrong opcode for loading bytes and bools (ldelem.i1 instead of
14024 ldelem.u1) and using the opposite for sbytes.
14026 This fixes Digger, and we can finally run it.
14028 * driver.cs (UnixParseOption): Move the option parsing here.
14029 (CSCParseOption): Implement CSC-like parsing of options.
14031 We now support both modes of operation, the old Unix way, and the
14032 new CSC-like way. This should help those who wanted to make cross
14033 platform makefiles.
14035 The only thing broken is that /r:, /reference: and /lib: are not
14036 implemented, because I want to make those have the same semantics
14037 as the CSC compiler has, and kill once and for all the confussion
14038 around this. Will be doing this tomorrow.
14040 * statement.cs (Unsafe.Resolve): The state is checked during
14041 resolve, not emit, so we have to set the flags for IsUnsfe here.
14043 2002-07-10 Miguel de Icaza <miguel@ximian.com>
14045 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14046 not catch the Error_ObjectRefRequired in SimpleName (as it is
14047 possible to have a class/instance variable name that later gets
14048 deambiguated), we have to check this here.
14050 2002-07-10 Ravi Pratap <ravi@ximian.com>
14052 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14053 make static and put into Expression.
14055 (Event.Define): Register the private field of the event with the
14056 TypeManager so that GetFieldFromEvent can get at it.
14058 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14059 keep track of the private field associated with an event which
14062 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14065 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14067 2002-07-10 Miguel de Icaza <miguel@ximian.com>
14069 * expression.cs (Binary.EmitBranchable): this routine emits the
14070 Binary expression in a branchable context. This basically means:
14071 we need to branch somewhere, not just get the value on the stack.
14073 This works together with Statement.EmitBoolExpression.
14075 * statement.cs (Statement.EmitBoolExpression): Use
14078 2002-07-09 Miguel de Icaza <miguel@ximian.com>
14080 * statement.cs (For): Reduce the number of jumps in loops.
14082 (For): Implement loop inversion for the For statement.
14084 (Break): We can be breaking out of a Try/Catch controlled section
14085 (foreach might have an implicit try/catch clause), so we need to
14086 use Leave instead of Br.
14088 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14089 now). If the instace expression supports IMemoryLocation, we use
14090 the AddressOf method from the IMemoryLocation to extract the
14091 address instead of emitting the instance.
14093 This showed up with `This', as we were emitting the instance
14094 always (Emit) instead of the Address of This. Particularly
14095 interesting when This is a value type, as we dont want the Emit
14096 effect (which was to load the object).
14098 2002-07-08 Miguel de Icaza <miguel@ximian.com>
14100 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14102 * statement.cs (Checked): Set the CheckedState during the resolve
14103 process too, as the ConvCast operations track the checked state on
14104 the resolve process, and not emit.
14106 * cs-parser.jay (namespace_member_declaration): Flag that we have
14107 found a declaration when we do. This is used to flag error 1529
14109 * driver.cs: Report ok when we display the help only.
14111 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
14113 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14115 2002-07-04 Miguel de Icaza <miguel@ximian.com>
14117 * cs-tokenizer.cs (define): We also have to track locally the
14118 defines. AllDefines is just used for the Conditional Attribute,
14119 but we also need the local defines for the current source code.
14121 2002-07-03 Miguel de Icaza <miguel@ximian.com>
14123 * statement.cs (While, For, Do): These loops can exit through a
14124 Break statement, use this information to tell whether the
14125 statement is the last piece of code.
14127 (Break): Flag that we break.
14129 * codegen.cs (EmitContexts): New `Breaks' state variable.
14131 2002-07-03 Martin Baulig <martin@gnome.org>
14133 * class.cs (TypeContainer.MethodModifiersValid): Allow override
14134 modifiers in method declarations in structs. Otherwise, you won't
14135 be able to override things like Object.Equals().
14137 2002-07-02 Miguel de Icaza <miguel@ximian.com>
14139 * class.cs (Method, Property, Indexer): Do not allow the public
14140 modifier to be used in explicit interface implementations.
14142 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14143 override modifiers in method declarations in structs
14145 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
14147 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14148 integer or real overflow, report an error
14150 2002-07-02 Martin Baulig <martin@gnome.org>
14152 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14153 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14154 to tell the runtime about our newly created System.Object and
14155 System.ValueType types.
14157 2002-07-02 Miguel de Icaza <miguel@ximian.com>
14159 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14160 struct instead of Ldarg/Starg.
14162 2002-07-02 Martin Baulig <martin@gnome.org>
14164 * expression.cs (Indirection.Indirection): Call
14165 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14167 2002-07-02 Martin Baulig <martin@gnome.org>
14169 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14170 ValueType, call TypeManager.TypeToCoreType() on it.
14171 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14172 the OpCodes.Newarr argument.
14174 2002-07-02 Martin Baulig <martin@gnome.org>
14176 * expression.cs (Invocation.EmitCall): When compiling corlib,
14177 replace all calls to the system's System.Array type to calls to
14178 the newly created one.
14180 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14181 System.Array methods.
14182 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14183 from the system's System.Array type which must be replaced.
14185 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14187 * typemanager.cs: load unverifiable_code_ctor so we can build
14188 corlib using the correct type. Avoid using GetTypeCode() with
14190 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14191 TypeManager.object_type to allow building corlib.
14193 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14195 * ecore.cs: handle System.Enum separately in LoadFromPtr().
14197 2002-07-01 Martin Baulig <martin@gnome.org>
14199 * class.cs: Make the last change actually work, we need to check
14200 whether `ifaces != null' to avoid a crash.
14202 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14204 * class.cs: when we build structs without fields that implement
14205 interfaces, we need to add the interfaces separately, since there is
14206 no API to both set the size and add the interfaces at type creation
14209 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14211 * expression.cs: the dimension arguments to the array constructors
14212 need to be converted if they are a long.
14214 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14216 * class.cs: don't emit ldarg.0 if there is no parent constructor
14217 (fixes showstopper for corlib).
14219 2002-06-29 Martin Baulig <martin@gnome.org>
14221 MCS now compiles corlib on GNU/Linux :-)
14223 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14224 ie. check for MethodImplOptions.InternalCall.
14226 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14227 and TypeManager.attribute_type are null, so we must explicitly check
14228 whether parent is not null to find out whether it's an attribute type.
14229 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14230 and SetBuilder, not only if the property is neither abstract nor external.
14231 This is necessary to set the MethodImplOptions on the accessor methods.
14232 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14233 SetBuilder, see Property.Emit().
14235 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14236 populate "System.Object", "System.ValueType" and "System.Attribute" since
14237 they've already been populated from BootCorlib_PopulateCoreTypes().
14239 2002-06-29 Martin Baulig <martin@gnome.org>
14241 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14242 is the NullLiteral, we also need to make sure that target_type is not
14245 2002-06-29 Martin Baulig <martin@gnome.org>
14247 * rootcontext.cs (RootContext.ResolveCore): We must initialize
14248 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14249 before calling BootstrapCorlib_ResolveDelegate ().
14251 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14253 * statement.cs: fixed build-breaker. All tests passed ok.
14255 2002-06-27 Martin Baulig <martin@gnome.org>
14257 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14258 for System.Decimal when compiling corlib.
14260 2002-06-27 Martin Baulig <martin@gnome.org>
14262 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14263 switch blocks which contain nothing but a default clause.
14265 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
14267 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14269 2002-06-27 Martin Baulig <martin@gnome.org>
14271 * ecore.cs (PropertyExpr.PropertyExpr): Call
14272 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14274 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14275 is already a TypeBuilder.
14277 2002-06-27 Martin Baulig <martin@gnome.org>
14279 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14280 `target_type == TypeManager.array_type', not IsAssignableFrom() in
14281 the "from an array-type to System.Array" case. This makes it work
14282 when compiling corlib.
14284 2002-06-27 Martin Baulig <martin@gnome.org>
14286 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14287 non-static PropertyExpr, set its InstanceExpression. This makes
14288 the `ICollection.Count' property work in System/Array.cs.
14290 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
14292 * driver.cs: Made error handling more consistent. Errors now
14293 tracked by Report class, so many methods which used to return int
14294 now return void. Main() now prints success/failure and
14295 errors/warnings message.
14297 Renamed '--probe' compiler argument to '--expect-error'. Removed
14298 the magic number return values (123 and 124). Now, if the
14299 expected error occurs, the compiler exits with success (exit value
14300 0). If the compilation completes without seeing that particular
14301 error, the compiler exits with failure (exit value 1). The
14302 makefile in mcs/errors has been changed to handle the new behaviour.
14304 * report.cs: Made 'expected error' number a property and renamed
14305 it from 'Probe' to 'ExpectedError'.
14307 * genericparser.cs: Removed error handling support, since it is
14308 now all done by Report class.
14310 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14311 class, so parse() no longer returns an int.
14313 * namespace.cs: Use Report.Error instead of GenericParser.error
14315 2002-06-22 Miguel de Icaza <miguel@ximian.com>
14317 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14318 TypeContainer.AddOperator): At the front of the list put the
14319 explicit implementations, so they get resolved/defined first.
14321 2002-06-21 Miguel de Icaza <miguel@ximian.com>
14323 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14324 interface type is implemented by this TypeContainer. Used during
14325 explicit interface implementation.
14327 (Property.Define, Indexer.Define, Method.Define): Validate that
14328 the given interface in the explicit implementation is one of the
14329 base classes for the containing type.
14331 Also if we are explicitly implementing an interface, but there is
14332 no match in the pending implementation table, report an error.
14334 (Property.Define): Only define the property if we are
14335 not explicitly implementing a property from an interface. Use the
14336 correct name also for those properties (the same CSC uses,
14337 although that is really not needed).
14339 (Property.Emit): Do not emit attributes for explicitly implemented
14340 properties, as there is no TypeBuilder.
14342 (Indexer.Emit): ditto.
14344 Hiding then means that we do not really *implement* a pending
14345 implementation, which makes code fail.
14347 2002-06-22 Martin Baulig <martin@gnome.org>
14349 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14350 the return value of Object.GetType(). [FIXME: we need to do this whenever
14351 we get a type back from the reflection library].
14353 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14355 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14357 2002-06-20 Miguel de Icaza <miguel@ximian.com>
14359 * attribute.cs: Return null if we can not look up the type.
14361 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14362 the interface types found.
14364 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14365 interface types found.
14367 * typemanager.cs (GetInterfaces): Make this routine returns alll
14368 the interfaces and work around the lame differences between
14369 System.Type and System.Reflection.Emit.TypeBuilder in the results
14370 result for GetInterfaces.
14372 (ExpandInterfaces): Given an array of interface types, expand and
14373 eliminate repeated ocurrences of an interface. This expands in
14374 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14377 2002-06-21 Martin Baulig <martin@gnome.org>
14379 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14382 2002-06-21 Martin Baulig <martin@gnome.org>
14384 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
14385 and called with one of the core types, return the corresponding typebuilder for
14388 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14391 2002-06-21 Martin Baulig <martin@gnome.org>
14393 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14394 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14395 (Expression.ConvertReferenceExplicit): Likewise.
14397 * expression.cs (ElementAccess.DoResolve): Likewise.
14398 (ElementAccess.DoResolveLValue): Likewise.
14400 2002-06-10 Martin Baulig <martin@gnome.org>
14402 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14403 add the "value" parameter to the parameter list.
14405 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14408 2002-06-19 Miguel de Icaza <miguel@ximian.com>
14410 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14411 the argument to an int, uint, long or ulong, per the spec. Also
14412 catch negative constants in array creation.
14414 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14416 * class.cs: do not allow the same interface to appear twice in
14417 the definition list.
14419 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14421 * ecore.cs: don't use ldlen with System.Array.
14423 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14425 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14427 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14429 * modifiers.cs: produce correct field attributes for protected
14430 internal. Easy fix so miguel can work on ther harder stuff:-)
14432 2002-06-18 Miguel de Icaza <miguel@ximian.com>
14434 * pending.cs: New file. Move the code from class.cs here.
14435 Support clearning the pending flag for all methods (when not doing
14436 explicit interface implementation).
14438 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14440 * rootcontext.cs: added a couple more types needed to bootstrap.
14442 2002-06-17 Miguel de Icaza <miguel@ximian.com>
14444 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14445 constructor in the type, instead of any constructor in the type
14446 hierarchy. Thanks to Paolo for finding this bug (it showed up as
14447 a bug in the Mono runtime when applying the params attribute).
14449 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14450 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14452 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
14454 * expression.cs (Unary.ResolveOperator): Use TypeManager
14455 to resolve the type.
14457 2002-06-13 Ravi Pratap <ravi@ximian.com>
14459 * cs-parser.jay (enum_member_declaration): Pass in the attributes
14462 * enum.cs (AddEnumMember): Add support to store the attributes associated
14463 with each member too.
14465 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14466 field builders too - this takes care of the enum member case.
14468 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
14470 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14471 address-of operator on both value types and pointers.
14473 2002-06-10 Martin Baulig <martin@gnome.org>
14475 * interface.cs (Interface.PopulateIndexer): Add the indexer's
14476 PropertyBuilder to the `property_builders' list.
14478 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14479 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14480 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
14481 find any indexers which are inherited from an interface.
14483 2002-06-09 Martin Baulig <martin@gnome.org>
14485 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14486 the same type as the constant if necessary. There's also a test-130.cs
14489 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14491 * typemanager.cs (TypeManager.ChangeType): Previously known as
14492 Enum.ChangeEnumType().
14494 2002-06-09 Martin Baulig <martin@gnome.org>
14496 * expression.cs (Cast.TryReduce): Added support for consts.
14498 2002-06-08 Ravi Pratap <ravi@ximian.com>
14500 * class.cs (Accessor): Hold attributes information so we can pass
14503 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14504 Modify to pass in attributes attached to the methods.
14506 (add_accessor_declaration, remove_accessor_declaration): Ditto.
14508 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14509 to handle the Accessor kind :-)
14511 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14513 2002-06-08 Martin Baulig <martin@gnome.org>
14515 * expression.cs (Unary.TryReduceNegative): Added support for
14518 2002-06-08 Martin Baulig <martin@gnome.org>
14520 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14521 name can't be found in the `defined_names' - the caller will do a
14522 MemberLookup in this case and thus find methods in System.Enum
14523 such as Enum.IsDefined().
14525 2002-06-08 Martin Baulig <martin@gnome.org>
14527 * enum.cs (Enum.ChangeEnumType): This is a custom version of
14528 Convert.ChangeType() which works with TypeBuilder created types.
14529 (Enum.LookupEnumValue, Enum.Define): Use it here.
14531 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14532 `TypeBuilder.BaseType != null' check.
14533 (TypeContainer.FindMembers): Only lookup parent members if we
14534 actually have a parent.
14535 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14536 (ConstructorInitializer.Resolve): Likewise.
14538 * interface.cs (Interface.FindMembers): Added
14539 `TypeBuilder.BaseType != null' check.
14541 * rootcontext.cs (RootContext.ResolveCore): Added
14542 "System.Runtime.CompilerServices.IndexerNameAttribute" to
14543 classes_second_stage.
14545 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14546 debug_type and trace_type when compiling with --nostdlib.
14548 2002-06-07 Martin Baulig <martin@gnome.org>
14550 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14551 (AddField): Set it to true when adding a non-static field.
14552 (DefineType): Use `have_nonstatic_fields' to find out whether we
14553 have non-static fields, not `Fields != null'.
14555 2002-06-02 Miguel de Icaza <miguel@ximian.com>
14557 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14558 dereferencing a null on the static-field code path)
14560 2002-05-30 Martin Baulig <martin@gnome.org>
14562 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14563 to take command line arguments. Use reflection to call the new
14564 custom `Initialize' function on the symbol writer and pass it the
14565 command line arguments.
14567 * driver.cs (--debug-args): New command line argument to pass command
14568 line arguments to the symbol writer.
14570 2002-05-28 Miguel de Icaza <miguel@ximian.com>
14572 * assign.cs (DoResolve): Forgot to do the implicit conversion to
14573 the target type for indexers and properties. Thanks to Joe for
14576 2002-05-27 Miguel de Icaza <miguel@ximian.com>
14578 * typemanager.cs (MethodFlags): returns the method flags
14579 (Obsolete/ShouldIgnore) that control warning emission and whether
14580 the invocation should be made, or ignored.
14582 * expression.cs (Invocation.Emit): Remove previous hack, we should
14583 not do this on matching a base type, we should do this based on an attribute
14585 Only emit calls to System.Diagnostics.Debug and
14586 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14587 on the command line.
14589 * rootcontext.cs: Global settings for tracing and debugging.
14591 * cs-tokenizer.cs (define): New utility function to track
14592 defines. Set the global settings for TRACE and DEBUG if found.
14594 2002-05-25 Ravi Pratap <ravi@ximian.com>
14596 * interface.cs (Populate*): Pass in the TypeContainer as well as
14597 the DeclSpace as parameters so that we can create EmitContexts and
14598 then use that to apply attributes etc.
14600 (PopulateMethod, PopulateEvent, PopulateProperty)
14601 (PopulateIndexer): Apply attributes everywhere.
14603 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14606 (ApplyAttributes): Update accordingly.
14608 We now apply interface attributes for all members too.
14610 2002-05-26 Miguel de Icaza <miguel@ximian.com>
14612 * class.cs (Indexer.Define); Correctly check if we are explicit
14613 implementation (instead of checking the Name for a ".", we
14614 directly look up if the InterfaceType was specified).
14616 Delay the creation of the PropertyBuilder.
14618 Only create the PropertyBuilder if we are not an explicit
14619 interface implementation. This means that explicit interface
14620 implementation members do not participate in regular function
14621 lookups, and hence fixes another major ambiguity problem in
14622 overload resolution (that was the visible effect).
14624 (DefineMethod): Return whether we are doing an interface
14627 * typemanager.cs: Temporary hack until we get attributes in
14628 interfaces (Ravi is working on that) and we get IndexerName
14629 support in interfaces.
14631 * interface.cs: Register the indexers as properties.
14633 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14634 warning, I have verified that this is a bug in the .NET runtime
14635 (JavaScript suffers of the same problem).
14637 * typemanager.cs (MemberLookup): When looking up members for
14638 interfaces, the parent of an interface is the implicit
14639 System.Object (so we succeed in searches of Object methods in an
14640 interface method invocation. Example: IEnumerable x; x.ToString
14643 2002-05-25 Miguel de Icaza <miguel@ximian.com>
14645 * class.cs (Event): Events should also register if they do
14646 implement the methods that an interface requires.
14648 * typemanager.cs (MemberLookup); use the new GetInterfaces
14651 (GetInterfaces): The code used to lookup interfaces for a type is
14652 used in more than one place, factor it here.
14654 * driver.cs: Track the errors at the bottom of the file, we kept
14657 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14658 instance if the method we are calling is static!
14660 2002-05-24 Miguel de Icaza <miguel@ximian.com>
14662 * attribute.cs (ApplyAttributes): Make this function filter out
14663 the IndexerName attribute (as that attribute in reality is never
14664 applied) and return the string constant for the IndexerName
14667 * class.cs (TypeContainer.Emit): Validate that all the indexers
14668 have the same IndexerName attribute, and if so, set the
14669 DefaultName attribute on the class.
14671 * typemanager.cs: The return value might contain other stuff (not
14672 only methods). For instance, consider a method with an "Item"
14673 property and an Item method.
14675 * class.cs: If there is a problem with the parameter types,
14678 2002-05-24 Ravi Pratap <ravi@ximian.com>
14680 * ecore.cs (ImplicitConversionExists): Wrapper function which also
14681 looks at user defined conversion after making a call to
14682 StandardConversionExists - we need this for overload resolution.
14684 * expression.cs : Update accordingly the various method calls.
14686 This fixes 2 bugs filed against implicit user defined conversions
14688 2002-05-22 Miguel de Icaza <miguel@ximian.com>
14690 * statement.cs: Track the result of the assignment.
14692 2002-05-21 Miguel de Icaza <miguel@ximian.com>
14694 * expression.cs (MemberAccess): Improved error reporting for
14695 inaccessible members.
14697 2002-05-22 Martin Baulig <martin@gnome.org>
14699 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
14700 itself with debugging support.
14702 2002-05-22 Martin Baulig <martin@gnome.org>
14704 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14705 Removed, this isn't needed anymore.
14707 2002-05-20 Martin Baulig <martin@gnome.org>
14709 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14710 be underlying type for an enum.
14712 2002-05-20 Miguel de Icaza <miguel@ximian.com>
14714 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14715 that splits out the loading of just the core types.
14717 * rootcontext.cs (ResolveCore): Split the struct resolution in
14718 two, so we can load the enumeration underlying types before any
14721 * expression.cs (Is): Bandaid until we fix properly Switch (see
14722 bug #24985 for details).
14724 * typemanager.cs (ImplementsInterface): The hashtable will contain
14725 a null if there are no interfaces implemented.
14727 2002-05-18 Miguel de Icaza <miguel@ximian.com>
14729 * cs-parser.jay (indexer_declarator): It is fine to have array
14732 2002-05-17 Miguel de Icaza <miguel@ximian.com>
14734 * typemanager.cs: (RegisterBuilder): New function used to register
14735 TypeBuilders that implement interfaces. Since
14736 TypeBuilder.GetInterfaces (as usual) does not work with lame
14738 (AddUserType): register interfaces.
14740 (ImplementsInterface): Use the builder_to_ifaces hash if we are
14741 dealing with TypeBuilder. Also, arrays are showing up as
14742 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14743 methods can not be invoked on them!
14745 * ecore.cs (ExplicitReferenceConversionExists): Made public.
14746 (ImplicitReferenceConversionExists): Split out from
14747 StandardConversionExists.
14749 * expression.cs (As): We were only implementing one of the three
14750 cases for the as operator. We now implement them all.
14751 (Is): Implement the various other cases for Is as well.
14753 * typemanager.cs (CACHE): New define used to control if we want or
14754 not the FindMembers cache. Seems to have a negative impact on
14755 performance currently
14757 (MemberLookup): Nested types have full acess to
14758 enclosing type members
14760 Remove code that coped with instance/static returns for events, we
14761 now catch this in RealFindMembers.
14763 (RealFindMembers): only perform static lookup if the instance
14764 lookup did not return a type or an event.
14766 2002-05-17 Miguel de Icaza <miguel@ximian.com>
14768 * assign.cs (CompoundAssign): We pass more semantic information
14769 now to Compound Assignments than we did before: now we have all
14770 the information at hand, and now we resolve the target *before* we
14771 do the expression expansion, which allows the "CacheValue" method
14772 to have the effect we intended (before, a [x] += 1 would generate
14773 two differen ArrayAccess expressions from the ElementAccess,
14774 during the resolution process).
14776 (CompoundAssign.DoResolve): Resolve target and original_source here.
14778 2002-05-16 Miguel de Icaza <miguel@ximian.com>
14780 * expression.cs (ArrayAccess): dropped debugging information.
14782 * typemanager.cs: Small bug fix: I was always returning i_members,
14783 instead of one of i_members or s_members (depending on which had
14786 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
14787 method is invoked before any code generation takes place, and it
14788 is a mechanism to inform that the expression will be invoked more
14789 than once, and that the method should use temporary values to
14790 avoid having side effects
14792 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14794 * ecore.cs (Expression.CacheTemporaries): Provide empty default
14797 * expression.cs (Indirection, ArrayAccess): Add support for
14798 CacheTemporaries in these two bad boys.
14800 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14801 ldobj or ldind_ref.
14802 (StoreFromPtr): Handle stobj as well.
14804 * expression.cs (UnaryMutator): Share more code.
14806 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14807 down: I was not tracking the Filter function as well, which
14808 was affecting the results of the cache.
14810 2002-05-15 Miguel de Icaza <miguel@ximian.com>
14812 * attribute.cs: Remove the hack to handle the CharSet property on
14815 2002-05-14 Miguel de Icaza <miguel@ximian.com>
14817 * attribute.cs (DoResolve): More uglyness, we now only try to
14818 resolve the attribute partially, to extract the CharSet
14819 information (only if we are a StructLayout attribute). Otherwise
14821 (GetExtraTypeInfo): Add some code to conditionally kill in the
14822 future this. I am more and more convinced that the .NET
14823 framework has special code to handle the attribute setting on
14826 * expression.cs (IsParamsMethodApplicable): Revert my previous
14827 foreach change here, it was wrong.
14829 2002-05-13 Miguel de Icaza <miguel@ximian.com>
14831 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14832 (pp_expr): do not abort on unknown input, just return.
14833 (eval): abort if there are pending chars.
14835 * attribute.cs (Attribute.Resolve): Positional parameters are
14836 optional. Deal with that case.
14838 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14839 the Ansi/Unicode/Auto information for the type.
14841 (TypeContainer.DefineType): instantiate the EmitContext here, as
14842 we will be using it during the type definition (to resolve
14843 attributes) and during the emit phase.
14845 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14846 to pull type information out of the attributes
14848 (Attribute.Resolve): track the constructor builder, and allow for
14849 multiple invocations (structs and classes will use this).
14851 * ecore.cs (MemberLookupFinal): new version with all the
14852 parameters customizable.
14854 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14855 constructors. Return if the result value is null (as the error
14856 would have been flagged already by MemberLookupFinal)
14858 Do not allow instances of abstract classes or interfaces to be
14861 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14862 We have to compare the assembly property here when dealing with
14863 FamANDAssem and Assembly access modifiers, because we might be
14864 creating an assembly from *modules* (that means that we are not
14865 getting TypeBuilders for types defined in other modules that are
14866 part of this assembly).
14868 (Method.Emit): If the method is marked abstract and has a body,
14871 (TypeContainer.DefineMembers): If both the defined member and the
14872 parent name match are methods, then do not emit any warnings: let
14873 the Method.Define routine take care of flagging warnings. But if
14874 there is a mismatch (method overrides something else, or method is
14875 overriwritten by something, then emit warning).
14877 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14878 set to null, this means `do not check for the return type on the
14881 (Method.Define): set the return type for the method signature to
14882 null, so that we get methods with the same name and parameters and
14883 different return types. This is used to flag warning 114 (you are
14884 hiding a method, and you probably want to use the new/override
14887 * typemanager.cs (MemberLookup): Implemented proper access
14888 control, closing a long standing set of bug reports. The problem
14889 was that the Framework only has two bits: Public and NonPublic,
14890 and NonPublic includes private and protected methods, but we need
14891 to enforce the FamANDAssem, FamOrAssem and Family.
14893 2002-05-11 Miguel de Icaza <miguel@ximian.com>
14895 * statement.cs (GotoCase): Return true: Ammounts to giving up
14896 knowledge on whether we return or not, and letting the other case
14897 be responsible for it.
14899 2002-05-10 Miguel de Icaza <miguel@ximian.com>
14901 * driver.cs: Do not load directories for each file processed, only
14902 do it if there is a pattern.
14904 * ecore.cs: Report readonly assigns here as well, as we might have
14905 been resolved only by MemberAccess.
14907 (SimpleName.SimpleNameResolve): Also be useful for LValue
14908 resolution. We need this to propagate assign to local readonly variables
14910 * typemanager.cs: Use a ptrhashtable for the criteria, because we
14911 do not want to reuse potential criteria memory.
14913 * class.cs (MyEventBuilder): Set reflected_type;
14915 * ecore.cs (Constantify): Added support for constifying bools.
14917 (RootContext.LookupType): Added a cache for values looked up in
14918 the declaration space.
14920 * typemanager.cs (FindMembers): Now is a front-end to
14921 RealFindMembers, and provides a two-level hashtable-based cache to
14924 15% performance improvement: from 22.5 to 19.2 seconds.
14926 * expression.cs (IsParamsMethodApplicable): use foreach.
14927 (Invocation.DoResolve): ditto.
14928 (New.DoResolve): ditto.
14929 (ArrayCreation.DoResolve): ditto.
14931 * ecore.cs (FindMostEncompassingType): use foreach.
14933 * delegate.cs (NewDelegate.DoResolve): Use foreach
14935 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14936 (RemoveMethods): use foreach.
14938 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14939 nested foreach statements instead of for, and also break out of
14940 the inner loop once a match is found.
14942 (Invocation.OverloadResolve): Use foreach, simplify the code.
14944 2002-05-08 Miguel de Icaza <miguel@ximian.com>
14946 * cfold.cs (BinaryFold): During an enumeration evaluation context,
14947 we actually unwrap the expression to allow for extra information
14950 * expression.cs: Use Shr_Un on unsigned operations.
14952 2002-05-08 Ravi Pratap <ravi@ximian.com>
14954 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
14955 applicable operators was not being considered correctly. This closes
14956 the bug Miguel reported.
14958 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14960 * attribute.cs: check that the type derives from System.Attribute
14961 and report the correct error in that case (moved the duplicate code to
14962 its own method, too).
14964 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14966 * attribute.cs: lookup attribute type name as the spec says: first the
14967 bare attribute name and then name + "Attribute" (nant compiles with
14968 mcs after this fix).
14970 2002-05-07 Miguel de Icaza <miguel@ximian.com>
14972 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
14973 Because of the way we parse things, we should try to see if a
14974 UIntConstant can fit in an integer.
14976 2002-05-07 Ravi Pratap <ravi@ximian.com>
14978 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14979 when we are in an explicit context.
14981 (ConvertReferenceExplicit): When converting from Iface type S to Class
14982 T make sure the rules are implemented as an OR.
14984 * parameter.cs (ParameterType): Make it a property for now although the
14985 purpose really isn't anything immediate.
14987 * expression.cs (Is*Applicable): Do better checking on the parameter type
14988 of a ref/out parameter. The ones from the system assemblies are already
14989 marked with the correct type so we don't need to do any correction.
14991 * ecore.cs (StandardConversionExists): Conversion from Interface types to
14992 the object type is standard too so include that.
14994 2002-05-06 Miguel de Icaza <miguel@ximian.com>
14996 * ecore.cs (StandardConversionExists): Augment with missing code:
14997 deal with IntConstant, LongConstants and Enumerations.
14999 * assign.cs: Report the error, instead of failing silently
15001 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15002 typecontainer that they are declared, because the
15003 typecontainer/namespace will have the list of using clauses that
15004 need to be applied.
15006 Assembly Attributes were escaping the normal registration
15009 (EmitCode): Apply attributes within an EmitContext that represents
15010 the container they were declared on.
15012 * cs-parser.jay: Track bases for structs. How did I get this wrong?
15014 2002-05-06 Ravi Pratap <ravi@ximian.com>
15016 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15017 Revamp completely - make much cleaner as we now operate only
15020 (FindMostSpecificSource, FindMostSpecificTarget): New methods
15021 to implement the logic detailed in the spec more correctly.
15023 (UserDefinedConversion): Update accordingly.
15025 2002-05-06 Miguel de Icaza <miguel@ximian.com>
15027 * statement.cs: Return flow analysis information up.
15029 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15032 (token): Do not consume an extra character before calling
15035 2002-05-06 Piers Haken <piersh@friskit.com>
15037 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15039 2002-05-06 Miguel de Icaza <miguel@ximian.com>
15041 * class.cs (Constructor.Emit): Set the IsStatic flag in the
15042 EmitContext during the instance constructor initializer
15043 resolution, to stop access to instance variables.
15045 This is mandated by the spec, last paragraph of the `constructor
15046 initializers' section.
15048 2002-05-05 Miguel de Icaza <miguel@ximian.com>
15050 * cs-parser.jay, class.cs (Accessor): new class used to represent
15051 an accessor (get or set). In the past we used `null' to represent
15052 a missing accessor. But this is ambiguous because there was no
15053 way to tell in abstract indexers/properties if one of them was
15056 Now there is a way of addressing that.
15058 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15059 instead of FindMembers.
15061 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15062 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15064 * attribute.cs: Treat indexers and properties as the same in terms
15065 of applying attributes
15067 * ecore.cs (FindMostEncompassedType): Use statically initialized
15068 EmptyExpressions()s like we do elsewhere to avoid creating useless
15069 objects (and we take this out of the tight loop).
15071 (GetConversionOperators): Move the code to extract the actual
15072 operators to a separate routine to clean things up.
15074 2002-05-04 Miguel de Icaza <miguel@ximian.com>
15076 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15077 events are always registered FieldBuilders.
15079 * class.cs (FieldBase): New class shared by Fields
15081 * delegate.cs: If we are a toplevel delegate, use our full name.
15082 If we are a nested delegate, then only use our tail name.
15084 2002-05-02 Ravi Pratap <ravi@ximian.com>
15086 * expression.cs (IsApplicable): Ensure that we add the "&" to
15087 ref/out types before comparing it with the type of the argument.
15089 (IsParamsMethodApplicable): Ditto.
15091 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
15094 * delegate.cs : Handle the case when we have more than one applicable
15095 method. Flag an error only when we finish checking all.
15097 2002-05-02 Miguel de Icaza <miguel@ximian.com>
15099 * expression.cs: Add support for boolean static initializers.
15101 2002-05-01 Miguel de Icaza <miguel@ximian.com>
15103 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15105 * parameter.cs (ComputeParameterTypes,
15106 ComputeAndDefineParameterTypes): Better error handling: now we
15107 clear the `types' cache if we fail during any of the type lookups.
15108 We also return the status code correctly to our caller
15110 * delegate.cs: If we fail to define a delegate, abort the extra
15113 * expression.cs (Binary.ResolveOperator): for
15114 operator==(object,object) and operator !=(object, object) we also
15115 have to verify that there is an implicit conversion from one to
15118 (ArrayAccess.DoResolve): Array Access can operate on
15121 2002-04-30 Miguel de Icaza <miguel@ximian.com>
15123 * assign.cs (CompoundAssign): A new class used as a "flag" that
15124 the assignment actually is happening as part of a compound
15125 assignment operator.
15127 During compound assignment, a few new rules exist to enable things
15134 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15135 to the type of x) if y is implicitly convertible to the type of x,
15136 and the operator is a builtin operator and the return type of the
15137 operator is explicitly convertible to the type of x.
15139 * rootcontext.cs: Reset warning level to 2. 4 catches various
15140 "interesting" features in mcs, we must clean this up at some
15141 point, but currently am trying to kill other bugs ;-)
15143 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15144 in container classes as well.
15146 * expression.cs (Binary.ResolveOperator): Handle string case
15147 before anything else (as operator overloading does emit an error
15148 before doing anything else).
15150 This code could go away when we move to a table driven model, but
15151 i could not come up with a good plan last night.
15153 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
15155 * typemanager.cs (CSharpName): reimplementation using regex.
15156 * class.cs: added null check for fields in Emit
15157 * rootcontext.cs: set warninglevel to 4
15159 2002-04-29 Miguel de Icaza <miguel@ximian.com>
15161 * typemanager.cs (CSharpName): reimplemented with Lupus
15164 2002-04-28 Miguel de Icaza <miguel@ximian.com>
15166 * statement.cs (If): correclty implement Resolve, because we were
15167 not catching sem errors in there. The same process is needed
15169 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15172 (Statement.Warning_DeadCodeFound): Factorize code.
15173 (While): Report dead code here too.
15175 (Statement): Added Resolve virtual method to allow
15176 for resolution split from the emit code.
15178 2002-04-26 Miguel de Icaza <miguel@ximian.com>
15180 * statement.cs (EmitBoolExpression): No longer try to resolve the
15182 (MakeBoolean): New utility function that resolve, implicitly
15183 converts to boolean and tags the expression.
15186 (If, Do): Implement dead code elimination.
15187 (While): Implement loop inversion
15189 (Do, While, For, If): Resolve the expression prior to calling our
15192 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
15195 - added method Report28 (warning: program has more than one entry point)
15196 - added method IsEntryPoint, implements paragraph 10.1 of the spec
15197 - modified method Method.Define, the part at the end of the method
15199 * rootcontext.cs: added static public Location EntryPointLocation;
15201 * ../errors/cs0028.cs : Add test case for the above warning.
15204 - modified method CSharpName to allow arrays of primitive type to
15205 be printed nicely (e.g. instead of System.Int32[][] it now prints
15207 - added method CSharpSignature: returns the signature of a method
15208 in string format to be used in reporting errors, warnings, etc.
15210 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15213 2002-04-26 Ravi Pratap <ravi@ximian.com>
15215 * delegate.cs (Define): Fix extremely silly bug where I was
15216 setting the type of the 'object' parameter of the BeginInvoke
15217 method to System.IAsyncResult instead of System.Object ;-)
15219 2002-04-26 Miguel de Icaza <miguel@ximian.com>
15221 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15224 (Constructor.Emit): return if we fail to initialize the
15225 constructor. Another door closed!
15227 * expression.cs (New.DoResolve): Improve error message (from -6 to
15228 1501). Use DeclaredOnly lookup to find the exact constructor.
15230 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15231 loop. This is useful.
15233 * cs-parser.jay: Adjust the default parameters so that destructors
15234 have the proper signature.
15236 2002-04-26 Martin Baulig <martin@gnome.org>
15238 * driver.cs (LoadAssembly): If `assembly' contains any characters
15239 which are only valid in path names and not in assembly names
15240 (currently slash, backslash and point), use Assembly.LoadFrom ()
15241 instead of Assembly.Load () on the `assembly' (before iteration
15242 over the link_paths).
15244 2002-04-26 Martin Baulig <martin@gnome.org>
15246 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15248 2002-04-25 Miguel de Icaza <miguel@ximian.com>
15250 * class.cs (Property): use the new typemanager.MemberLookup
15252 (TypeContainer.MemberLookup): Implement using the
15253 TypeManager.MemberLookup now.
15255 * typemanager.cs: Make MemberLookup a function of the TypeManager,
15256 and return MemberInfos, so that these can be used without an
15257 EmitContext (what we had before).
15259 2002-04-24 Miguel de Icaza <miguel@ximian.com>
15261 * expression.cs: Fix the case where the argument to params if the
15262 type of the params. I omitted handling this before. Fixed
15264 2002-04-22 Miguel de Icaza <miguel@ximian.com>
15266 * driver.cs: Call BootCorlib_PopulateCoreType
15268 * class.cs (Property.CheckBase): Check for properties only, not
15271 * interface.cs: Temporary hack: try/catch around the
15272 CustomAttributeBuilder, because I am getting an exception that I
15275 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15276 types whose definitions are required to be there (attributes are
15277 defined before standard types).
15279 Compute definitions as we boot the various types, as they are used
15280 immediately (value_type class will need object_type, but if we do
15281 not initialize object_type, we will pass a null, which will let
15282 the runtime pick the System.Object from the existing corlib, which
15283 is not what we want).
15285 2002-04-22 Patrik Torstensson <totte@labs2.com>
15287 * cs-tokenizer.cs: fixed a number of trim() issues.
15289 2002-04-22 Ravi Pratap <ravi@ximian.com>
15291 * expression.cs (Argument.Type): Ensure that we return the correct
15292 type when we have out or ref parameters [in which case we
15295 2002-04-22 Miguel de Icaza <miguel@ximian.com>
15297 * class.cs (Property, Indexer): Allow extern modifier in there.
15299 * typemanager.cs (InitBaseTypes): Initializes object_type and
15300 value_type, since those will be used early on during the bootstrap
15301 process to compile corlib.
15303 (InitCoreTypes): Move code from here to InitBaseTypes.
15305 2002-04-21 Miguel de Icaza <miguel@ximian.com>
15307 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15308 single-dimension arrays as using the ldlen opcode.
15310 Daniel Lewis discovered this optimization.
15312 * typemanager.cs: Add signature for System.Array::get_Length
15314 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15316 * statement.cs: report the error when the foreach does not apply to an
15317 array nor a collection.
15319 2002-04-19 Miguel de Icaza <miguel@ximian.com>
15321 * expression.cs: Add implicit conversions to the operator ~.
15323 * constant.cs (DecimalConstant.Emit): Emit decimal value.
15325 * typemanager.cs: Locate the decimal constructor.
15327 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15329 * attribute.cs: use the new property of TypeOf.
15330 * expression.cs: added 'get' property around typearg.
15332 These changes fix a build breaker reported by NickD. Is this the
15333 correct way to fix? If not, please, revert my changes and make it
15336 2002-04-17 Miguel de Icaza <miguel@ximian.com>
15338 * attribute.cs: Add support for typeof in attribute invocations.
15339 I am not sure that this is right though.
15341 2002-04-14 Duncan Mak <duncan@ximian.com>
15343 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15344 Binary.Operator.Division case.
15346 2002-04-13 Ravi Pratap <ravi@ximian.com>
15348 * class.cs (DefineType): Ensure that we do a proper check on
15349 attribute types and also register it with the TypeManager.
15351 (TypeContainer.Targets): The default for attribute types is
15352 AttributeTargets.All.
15354 * attribute.cs (ApplyAttributes): Registering the attribute type
15355 is done elsewhere, not when we discover we have a Usage attribute.
15357 2002-04-12 Ravi Pratap <ravi@ximian.com>
15359 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15360 and get rid of is_delegate parameter.
15362 * everywhere : update.
15364 2002-04-12 Ravi Pratap <ravi@ximian.com>
15366 * cs-parser.jay (compilation_unit): Revamp completely to use
15367 some new ideas that I got from Rhys' grammar to solve the problems
15368 with assembly level attributes.
15370 (outer_declaration): New grammar production.
15372 (attribute_sections): Add.
15374 (opt_attributes): Base on attribute_sections
15376 (namespace_declaration): Allow opt_attributes to tackle the case
15377 when we have assembly level attributes - we are clever in this
15380 * attribute.cs (ApplyAttributes): Do not worry about assembly
15381 attributes in the non-global context.
15383 * rootcontext.cs (AddGlobalAttributes): Go back to using this
15384 instead of SetGlobalAttributes.
15386 * class.cs, rootcontext.cs : Ensure we define and generate
15387 attribute types before anything else.
15389 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15390 and flag the new error -20 for the case when the attribute type
15391 does not have valid targets specified. csc does not catch this.
15393 * ../errors/errors.txt : update for error # -20
15395 2002-04-11 Ravi Pratap <ravi@ximian.com>
15397 * support.cs (InternalParameters.ParameterModifier): Do some null
15398 checking and return sane values.
15400 * class.cs (Method.Define): If we are a PInvoke method, ensure
15401 that we are static and extern. Report error # 601
15403 * ../errors/cs0601.cs : Add test case for the above error.
15405 2002-04-07 Ravi Pratap <ravi@ximian.com>
15407 * rootcontext.cs (attribute_types): We need to keep type of
15408 all attribute types separately and emit code for them first.
15410 (RegisterAttribute) : Implement.
15412 * class.cs (DefineType): Check if the current Type is a custom
15413 attribute type and register it accordingly.
15415 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15416 adding the first attribute twice and rename to
15418 (SetGlobalAttributes): this.
15420 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15423 * attribute.cs (ApplyAttributes): Take an additional argument telling us
15424 if we are processing global arguments. Hmm, I am unsure of this.
15426 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15428 * expression.cs: added static array of strings to avoid calling
15429 Enum.ToString () for Operator in Binary. Significant recover of
15432 2002-04-10 Miguel de Icaza <miguel@ximian.com>
15434 * class.cs (FindMembers): Allow the Builders of the various
15435 members to be null. If they are skip them. This only happens
15436 during the PInvoke declaration.
15438 2002-04-09 Miguel de Icaza <miguel@ximian.com>
15440 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15441 failure, so we do not keep going afterwards.
15443 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15444 wanted to pass `false' as the `is_delegate' argument. If this is
15445 the case, why not use delegate_type == null to mean `is_delegate =
15446 false' and anything else as is_delegate = true.
15448 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
15450 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15451 code for the section, not the beginning of the tests.
15453 2002-04-08 Miguel de Icaza <miguel@ximian.com>
15455 * cfold.cs: Handle operator + (Enum x, Underlying x)
15457 * expression.cs (Binary): same. Warn about errors where we have
15458 Enum/Enum in operator + as well.
15460 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
15463 - added support for switch(bool)
15464 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15465 - add TableSwitchEmit() to handle table-based switch statements
15467 2002-04-05 Ravi Pratap <ravi@ximian.com>
15469 * expression.cs (Invocation.OverloadResolve): Factor out code which
15470 does parameter compatibility checking with arguments so that we can
15471 re-use the code even from Delegate.VerifyApplicability
15473 (VerifyArgumentsCompat): Move above code here.
15475 * delegate.cs (VerifyApplicability): Get rid of duplicate code
15476 and instead make a call to the above method.
15478 2002-03-31 Ravi Pratap <ravi@ximian.com>
15480 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15481 We use it to keep track of classes which are attribute types.
15483 2002-04-02 Miguel de Icaza <miguel@ximian.com>
15485 * delegate.cs (Delegate.Define): Correctly define the types in the
15486 presence of fixed and array parameters.
15488 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15491 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15492 include NonPublic after the first iteration.
15494 * class.cs (Indexer.CheckBase): Only check if both parents are
15497 * cs-parser.jay (accessor_body): If empty, set to null.
15499 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15500 same code path here to resolve constants names that we did have in
15501 MemberAccess.DoResolve. There is too much code duplicated here.
15503 2002-04-01 Miguel de Icaza <miguel@ximian.com>
15505 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15507 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15510 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15511 tokens, numbers and strings.
15513 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15516 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15517 asyncronous parameters and the regular parameters.
15519 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15520 specify the target directory.
15522 * expression.cs: (This.DoResolve): Simplify
15523 (As.Emit): Optimize, do not generate IsInst if the expression is
15524 always of the given type.
15526 (Is.DoResolve): Bug fix, we were reporting both always/never for
15529 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15530 creating too many unnecessary arrays.
15532 2002-03-31 Miguel de Icaza <miguel@ximian.com>
15534 * class.cs (EmitFieldInitializer): Use Assign expression to assign
15535 fields instead of rolling our own initializer. Takes care of all
15536 implicit conversions, and drops unnecessary static checks/argument.
15538 2002-03-31 Dick Porter <dick@ximian.com>
15540 * driver.cs: use the GetDirectories() return values properly, and
15541 use "/" as path separator.
15543 2002-03-30 Miguel de Icaza <miguel@ximian.com>
15545 * expression.cs (Unary): Optimize - - expr into expr.
15546 (Binary): Optimize a + (-b) into a -b.
15548 * codegen.cs (CodeGen): Made all methods static.
15550 2002-03-29 Miguel de Icaza <miguel@ximian.com>
15554 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15555 TypeBuilder property.
15557 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15560 * tree.cs: Removed the various RecordXXXX, and replaced with a
15561 single RecordDecl. Removed all the accessor methods, and just
15562 left a single access point Type
15564 * enum.cs: Rename DefineEnum to DefineType.
15566 * decl.cs: New abstract method `DefineType' used to unify the
15567 Defines for Enumerations, Interfaces, TypeContainers and
15570 (FindType): Moved LookupInterfaceOrClass here. Moved the
15571 LookupBaseClasses method that used to live in class.cs and
15572 interface.cs here, and renamed to FindType.
15574 * delegate.cs: Implement DefineType. Take advantage of the
15575 refactored pattern for locating the parent builder without taking
15576 the parent_builder argument (which we know does not work if we are
15577 nested, and triggering a toplevel definition).
15579 2002-03-28 Miguel de Icaza <miguel@ximian.com>
15581 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15582 accessibility of a member has changed during override and report
15585 * class.cs (Method.Define, Property.Define): Only complain on
15586 overrides if the method is private, any other accessibility is
15587 fine (and since we just checked the permission is the same, we are
15590 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15591 and elif are processed always. The other pre-processing
15592 directives are only processed if we are "taking" the path
15594 2002-03-29 Martin Baulig <martin@gnome.org>
15596 * class.cs (Method.Emit): Only emit symbolic debugging info if the
15597 current location is not Null.
15599 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15600 a separate method so we can profile it.
15602 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15603 `span.Seconds' are just seconds, but no minutes or hours.
15604 (MainDriver): Profile the CodeGen.SaveSymbols calls.
15606 2002-03-28 Miguel de Icaza <miguel@ximian.com>
15608 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15609 Remove the gratuitous set of Final:
15611 // If an interface implementation, then we can set Final.
15612 if (((flags & MethodAttributes.Abstract) == 0) &&
15613 implementing.DeclaringType.IsInterface)
15614 flags |= MethodAttributes.Final;
15616 I do not know what I was smoking when I used that.
15619 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15620 step into fixing the name resolution issues for delegates and
15621 unifying the toplevel name resolution.
15623 2002-03-28 Martin Baulig <martin@gnome.org>
15625 * class.cs (Method.Emit): If we have a symbol writer, call its
15626 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15627 tell it about the current method.
15629 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15630 writer that we're going to emit the first byte of IL code for a new
15631 statement (a new source line).
15632 (EmitContext.EmitTopBlock): If we have a symbol writer, call
15633 EmitContext.Mark() before emitting any code.
15635 * location.cs (SymbolDocument): Return null when we're Null.
15637 * statement.cs (Statement): Moved the `Location loc' variable here.
15638 (Statement.EmitBoolExpression): If we have a symbol writer, call
15639 ec.Mark() before emitting any code to tell it that we're at the
15640 beginning of a new statement.
15641 (StatementExpression): Added `Location' argument to the constructor.
15642 (Block): Added public readonly variable `StartLocation' and public
15643 variable `EndLocation'. The latter is to be set using SetEndLocation().
15644 (Block): Added constructor which takes a start and end location.
15645 (Block.SetEndLocation): New method. This sets the end location.
15646 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15647 local variables we create.
15648 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15649 each statement and do also mark the begin and end of the block.
15651 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15652 tell it the current lexer.Location, use Location.Null for the end of the
15654 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15655 current block, set its end location using SetEndLocation().
15656 (statement_expression): StatementExpression constructor now takes the
15657 lexer.Location as additional argument.
15658 (for_statement, declare_local_variables): Likewise.
15659 (declare_local_variables): When creating a new implicit block, use the
15660 new Block constructor and pass it the lexer.Location.
15662 2002-03-28 Miguel de Icaza <miguel@ximian.com>
15664 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15665 members also on the parent interfaces recursively.
15667 2002-03-27 Miguel de Icaza <miguel@ximian.com>
15669 * report.cs: Use new formats, since Gonzalo finished the missing
15672 * expression.cs (Binary.ResolveOperator): added missing operator|
15673 operator& and operator^ for bool/bool.
15675 * cs-parser.jay: CheckDef now takes a Location argument that is
15676 used to report errors more precisly (instead of reporting the end
15677 of a definition, we try to track something which is a lot closer
15678 to the source of the problem).
15680 * cs-tokenizer.cs: Track global token use, so we can properly flag
15681 the use of #define/#undef after the first token has been seen.
15683 Also, rename the reportXXXX to Error_DescriptiveName
15685 * decl.cs (DeclSpace.IsTopLevel): Move property here from
15686 TypeContainer, so that Enum and Interface can use this too.
15688 * class.cs (TypeContainer.LookupInterfaceOrClass,
15689 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15690 `builder' argument. Typically this was used to pass the parent
15691 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15694 The problem is that a nested class could trigger the definition of
15695 a toplevel class, and the builder would be obviously wrong in that
15698 So we drop this argument, and we compute dynamically the
15699 TypeBuilder/ModuleBuilder (the correct information was available
15700 to us anyways from DeclSpace.Parent)
15702 * interface.cs (Interface.DefineInterface): Drop builder
15703 parameter cleanup like class.cs
15705 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
15708 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15711 (Try.Emit): Propagate the returns value from the statement.
15713 (Return.Emit): Even if we are leavning
15715 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15717 * modifiers.cs: Fix the computation of MethodAttributes flags.
15719 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15721 * driver.cs: allow compilation of files that start with '/'.
15722 Add a default case when checking the argument of --target.
15724 2002-03-25 Miguel de Icaza <miguel@ximian.com>
15726 * interface.cs: Implement the same search algorithm for types in
15727 the interface code.
15729 * delegate.cs: Do not allow multiple definition.
15731 * Recovered ChangeLog that got accidentally amputated
15733 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15735 * rootcontext.cs: Load manually enum to allow core classes to
15736 contain enumerations.
15738 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15739 Update to new static methods in TypeManager.
15741 * typemanager.cs (GetMethod, GetConstructor): Use our
15742 implementation of FindMembers to find the members, since during
15743 corlib compilation, the types are TypeBuilders and GetMethod and
15744 GetConstructor do not work.
15746 Make all methods in TypeManager static.
15748 (InitCodeHelpers): Split the functionality from
15749 the InitCodeTypes function.
15751 * driver.cs: Call InitCodeHelpers after we have populated the
15754 * cs-parser.jay (delegate_declaration): we did not used to compute
15755 the delegate name correctly for void delegates.
15757 2002-03-24 Miguel de Icaza <miguel@ximian.com>
15759 * rootcontext.cs (RootContext): Init the interface_resolve_order
15760 and type_container_resolve_order always.
15762 (ResolveCore, BootstrapCorlib_ResolveClass,
15763 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15764 compiler when compiling with --nostdlib
15766 * class.cs (TypeContainer.DefineType): Check that our parent is
15767 not null. This test is most important when we are bootstraping
15770 * codegen.cs: Split out the symbol writing code.
15772 2002-03-25 Martin Baulig <martin@gnome.org>
15774 * driver.cs (-g): Made -g an alias for --debug.
15776 2002-03-24 Martin Baulig <martin@gnome.org>
15778 * codegen.cs (SymbolWriter): New public variable. Returns the
15779 current symbol writer.
15780 (CodeGen): Added `bool want_debugging_support' argument to the
15781 constructor. If true, tell the ModuleBuild that we want debugging
15782 support and ask it for the ISymbolWriter.
15783 (Save): If we have a symbol writer, call it's Close() method after
15784 saving the assembly.
15786 * driver.c (--debug): New command line argument to create a
15787 debugger information file.
15789 * location.cs (SymbolDocument): New public property. Returns an
15790 ISymbolDocumentWriter object for the current source file or null
15791 if we don't have a symbol writer.
15793 2002-03-21 Miguel de Icaza <miguel@ximian.com>
15795 * driver.cs (LoadAssembly): Correctly return when all the paths
15796 have been tried and not before.
15798 * statement.cs (Switch.Emit): return the actual coverage for this
15799 statement (returns/not-returns)
15801 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15802 switch of the statement if we are the last switch section. That
15803 kills two problems: try/catch problems (we used to emit an empty
15804 nop at the end) and switch statements where all branches would
15807 2002-03-19 Miguel de Icaza <miguel@ximian.com>
15809 * driver.cs: Add default assemblies (the equivalent to the
15810 Microsoft CSC.RSP file)
15812 * cs-tokenizer.cs: When updating `cols and setting it to zero,
15813 also update tokens_seen and set it to false.
15815 * driver.cs: Implement --recurse for Mike.
15817 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15818 correctly splitting out the paths.
15820 2002-03-18 Miguel de Icaza <miguel@ximian.com>
15822 * interface.cs (Interface.PopulateProperty): Instead of using
15823 `parent' as the declaration space for the set parameters, use
15826 * support.cs (InternalParameters): InternalParameters constructor
15827 takes a DeclSpace instead of a TypeContainer.
15829 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15830 types are being initialized, load the address of it before calling
15833 (New): Provide a mechanism to disable the generation of local
15834 value type temporaries when the caller will be providing us with
15835 an address to store it.
15837 (ArrayCreation.EmitDynamicInitializers): Use it.
15839 2002-03-17 Miguel de Icaza <miguel@ximian.com>
15841 * expression.cs (Invocation.EmitArguments): Only probe for array
15842 property if there is more than one argument. Sorry about that.
15844 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15845 empty param arrays.
15847 * class.cs (Method.LabelParameters): Fix incorrect code path that
15848 prevented the `ParamArrayAttribute' from being applied to the
15851 2002-03-16 Miguel de Icaza <miguel@ximian.com>
15853 * support.cs (ReflectionParameters): Correctly compute whether the
15854 last argument is a params array. Fixes the problem with
15857 * typemanager.cs: Make the assemblies array always be non-null
15858 (empty, but non-null)
15860 * tree.cs (RecordDecl): New function that abstracts the recording
15861 of names. This reports error 101, and provides a pointer to the
15862 previous declaration. Fixes a crash in the compiler.
15864 * cs-parser.jay (constructor_declaration): Update to new grammar,
15865 and provide a constructor_body that can be empty.
15867 2002-03-15 Miguel de Icaza <miguel@ximian.com>
15869 * driver.cs: Add support for --resources.
15871 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15872 Make all types for the various array helper methods be integer.
15874 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15875 CheckState to ConvCast.
15877 (ConvCast): Now it takes a `checked' state argument, to avoid
15878 depending on the emit context for the conversion, and just using
15879 the resolve time setting.
15881 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15882 instead of Invocation.EmitArguments. We do not emit the original
15883 arguments, instead we emit those which have been converted to
15884 unsigned int expressions.
15886 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15888 * codegen.cs: ditto.
15890 * expression.cs (LocalVariableReference): Drop the use of the
15891 Store function that depended on the variable index.
15893 * statement.cs (VariableInfo): Drop the `Idx' property from this
15894 class, as this is not taking into account the indexes for
15895 temporaries tat we generate during the execution, getting the
15898 * class.cs: First emit class initializers, then call the parent
15901 * expression.cs (Binary): Fix opcode emision.
15902 (UnaryMutator.EmitCode): Support checked code generation
15904 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15905 matches for events for both the Static and Instance scans,
15906 pointing to the same element. Fix that.
15908 2002-03-14 Miguel de Icaza <miguel@ximian.com>
15910 * rootcontext.cs (ResolveTree): Always set the
15911 interface_resolve_order, because nested interfaces will be calling
15914 * class.cs (GetInterfaceOrClass): Track the same resolution
15915 process used by TypeManager.LookupType. This fixes the nested
15916 type lookups in class declarations (separate path from
15919 (TypeContainer.DefineType): Also define nested interfaces.
15920 (TypeContainer.RegisterOrder): New public function used to
15921 register the order in which child interfaces need to be closed.
15923 Nested interfaces need to be closed after their parents have been
15926 * interface.cs (InterfaceAttr): Put all the logic for computing
15927 the interface attribute here.
15929 (DefineInterface): Register our interface order with the
15930 RootContext or with the TypeContainer depending on the case.
15932 2002-03-12 Miguel de Icaza <miguel@ximian.com>
15934 * cs-parser.jay: rework foreach statement to work with the new
15935 changes to the policy on SimpleNames.
15937 * report.cs: support Stacktrace on warnings as well.
15939 * makefile: drop --unsafe and /unsafe from the compile.
15941 2002-03-13 Ravi Pratap <ravi@ximian.com>
15943 * ecore.cs (StandardConversionExists): Modify to take an Expression
15944 as the first parameter. Ensure we do null -> reference type conversion
15947 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15948 temporary Expression objects.
15950 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15952 * interface.cs: workaround bug in method overloading resolution
15953 (there is already a bugzilla bug for it).
15955 2002-03-12 Miguel de Icaza <miguel@ximian.com>
15957 We could also solve this problem by having a separate path for
15958 performing type lookups, instead of DoResolve, we could have a
15959 ResolveType entry point, and only participating pieces of the
15960 production (simplename, deref, array) would implement this.
15962 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15963 signal SimpleName to only resolve type names and not attempt to
15964 resolve anything else.
15966 * expression.cs (Cast): Set the flag.
15968 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15970 * class.cs: Only report 108 if there is no `new' modifier.
15972 * cs-parser.jay: rework foreach statement to work with the new
15973 changes to the policy on SimpleNames.
15975 * report.cs: support Stacktrace on warnings as well.
15977 * makefile: drop --unsafe and /unsafe from the compile.
15979 2002-03-11 Miguel de Icaza <miguel@ximian.com>
15981 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15982 lookups here, instead of doing that at parse time. This means
15983 that our grammar will not introduce `LocalVariableReferences' as
15984 expressions at this point. That solves the problem of code like
15988 static void Main ()
15992 This is only half the fix. The full fix requires parameters to
15993 also be handled in this way.
15995 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15996 makes the use more obvious of the DeclSpace. The
15997 ec.TypeContainer.TypeBuilder is now only used to pull the
15998 TypeBuilder for it.
16000 My theory is that I can get rid of the TypeBuilder completely from
16001 the EmitContext, and have typecasts where it is used (from
16002 DeclSpace to where it matters).
16004 The only pending problem is that the code that implements Aliases
16005 is on TypeContainer, and probably should go in DeclSpace.
16007 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16008 lookups here, instead of doing that at parse time. This means
16009 that our grammar will not introduce `LocalVariableReferences' as
16010 expressions at this point. That solves the problem of code like
16014 static void Main ()
16018 This is only half the fix. The full fix requires parameters to
16019 also be handled in this way.
16021 * class.cs (Property.DefineMethod): When implementing an interface
16022 method, set newslot, when implementing an abstract method, do not
16023 set the flag (before we tried never setting it, or always setting
16024 it, which is the difference).
16025 (Indexer.DefineMethod): same.
16026 (Method.DefineMethod): same.
16028 * ecore.cs: Only set the status used flag if we get back a Field.
16030 * attribute.cs: Temporary hack, so Paolo can keep working.
16032 2002-03-08 Ravi Pratap <ravi@ximian.com>
16034 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16035 the unmanaged type in the case we have a MarshalAs attribute.
16037 (Resolve): Handle the case when we are parsing the special MarshalAs
16038 attribute [we need to store the unmanaged type to use later]
16040 * typemanager.cs (marshal_as_attr_type): Built in type for the
16041 MarshalAs Attribute.
16043 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
16044 on parameters and accordingly set the marshalling info.
16046 2002-03-09 Miguel de Icaza <miguel@ximian.com>
16048 * class.cs: Optimizing slightly by removing redundant code after
16049 we switched to the `NoTypes' return value.
16050 (Property.DefineMethod): use NoTypes here too.
16052 This fixes the bug I introduced in my last batch of changes.
16054 2002-03-05 Ravi Pratap <ravi@ximian.com>
16056 * tree.cs (RecordEnum): Add. We now keep track of enums too.
16058 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16059 Enums since those are types too.
16061 * cs-parser.jay (enum_declaration): Record enums as we parse them.
16063 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
16064 thanks to a call during the lookup process.
16066 2002-03-07 Miguel de Icaza <miguel@ximian.com>
16068 * statement.cs (Foreach): Lots of work to accomodate a particular
16069 kind of foreach statement that I had not kept in mind. It is
16070 possible to have foreachs on classes that provide a GetEnumerator
16071 method that return objects that implement the "pattern" for using
16072 a foreach, there is no need to support GetEnumerator
16075 This is needed to compile nant.
16077 * decl.cs: Only report 114 if the member is not `Finalize' and if
16078 the warning level is at least 2.
16080 * class.cs: Moved the compare function from Method to
16083 (MethodSignature.InheritableMemberSignatureCompare): Add new
16084 filter function that is used to extract inheritable methods from a
16087 (Method.Define): Use the new `inheritable_method_signature_filter'
16090 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16093 2002-03-06 Miguel de Icaza <miguel@ximian.com>
16095 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16097 * cs-parser.jay: Add opt_semicolon to the interface declaration.
16099 * expression.cs: Pass location information to
16100 ConvertImplicitStandard.
16102 * class.cs: Added debugging code to track return values from
16105 2002-03-05 Miguel de Icaza <miguel@ximian.com>
16107 * expression.cs (Is.DoResolve): If either side of the `is' is an
16108 interface, do not flag the warning.
16110 * ecore.cs (ImplicitReferenceConversion): We need a separate test
16113 * report.cs: Allow for --fatal to be used with --probe.
16115 * typemanager.cs (NoTypes): Move the definition for the empty Type
16118 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16120 (TypeContainer.DefineProxy): New function used to proxy to parent
16121 implementations when implementing interfaces.
16122 (TypeContainer.ParentImplements): used to lookup if our parent
16123 implements a public function that is required by an interface.
16124 (TypeContainer.VerifyPendingMethods): Hook this up.
16126 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16127 `modules' and `assemblies' arraylists into arrays. We only grow
16128 these are the very early start up of the program, so this improves
16129 the speedof LookupType (nicely measured).
16131 * expression.cs (MakeByteBlob): Replaced unsafe code with
16132 BitConverter, as suggested by Paolo.
16134 * cfold.cs (ConstantFold.Binary): Special case: perform constant
16135 folding of string concatenation, but if either side is a string,
16136 and the other is not, then return null, and let the runtime use
16137 the concatenation on the string plus the object (using
16138 `Object.ToString').
16140 2002-03-04 Miguel de Icaza <miguel@ximian.com>
16142 Constant Folding has been implemented now.
16144 * expression.cs (Unary.Reduce): Do not throw an exception, catch
16145 the error instead on types that are not supported in one's
16148 * constant.cs (Constant and all children): New set of functions to
16149 perform implict and explicit conversions.
16151 * ecore.cs (EnumConstant): Implement the new functions to perform
16152 conversion by proxying to the child expression.
16154 * codegen.cs: (ConstantCheckState): Constant evaluation has its
16155 own separate setting that can not be turned off from the command
16156 line using --unchecked or --checked and is only controlled using
16157 the checked/unchecked statements and expressions. This setting is
16158 used by the constant folder to flag errors.
16160 * expression.cs (CheckedExpr, UncheckedExpr): Set the
16161 ConstantCheckState as well.
16163 During Resolve, they also have to flag the state, because the
16164 constant folder runs completely in the Resolve phase.
16166 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16169 2002-03-01 Miguel de Icaza <miguel@ximian.com>
16171 * cfold.cs: New file, this file contains the constant folder.
16173 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16174 argument to track whether we are using the resulting address to
16175 load or store a value and provide better error messages.
16177 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16178 new AddressOf arguments.
16180 * statement.cs (Foreach.EmitCollectionForeach): Update
16182 * expression.cs (Argument.Emit): Call AddressOf with proper
16183 arguments to track usage.
16185 (New.DoEmit): Call AddressOf with new arguments.
16187 (Unary.Emit): Adjust AddressOf call.
16189 2002-03-01 Ravi Pratap <ravi@ximian.com>
16191 * cs-parser.jay (member_access): Change the case for pre-defined types
16192 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
16195 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16198 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16199 essentially like methods and apply attributes like MethodImplOptions to them too.
16201 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16204 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16205 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16208 * Update code everywhere accordingly.
16210 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16212 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16214 2002-02-28 Ravi Pratap <ravi@ximian.com>
16216 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16217 try performing lookups against those instead of jumping straight into using
16218 the 'using' clauses.
16220 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16222 (LookupType): Perform lookups in implicit parents too.
16224 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16225 sequence as RootContext.LookupType.
16227 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
16228 the various cases of namespace lookups into this method.
16230 2002-03-01 Miguel de Icaza <miguel@ximian.com>
16232 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16233 in positional arguments)
16235 * class.cs (Operator): Update the AllowedModifiers to contain
16238 * cs-parser.jay: Update operator declaration to allow for the
16239 operator body to be empty.
16241 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16244 2002-02-27 Miguel de Icaza <miguel@ximian.com>
16246 * class.cs (Method.Emit): Label parameters.
16248 * driver.cs: Return 1 or 0 as the program exit code.
16250 2002-02-26 Miguel de Icaza <miguel@ximian.com>
16252 * expression.cs: Special case the `null' object when trying to
16253 auto-compute the type, as anything can be explicitly converted to
16256 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16257 spotting this Paolo.
16259 (Expression.ImplicitNumericConversion): Perform comparissions of
16260 the type using the underlying type in the case of an enumeration
16261 rather than using the enumeration type for the compare.
16263 Cope with the underlying == type case, which is not possible to
16266 (Expression.ConvertNumericExplicit): Perform comparissions of
16267 the type using the underlying type in the case of an enumeration
16268 rather than using the enumeration type for the compare.
16270 * driver.cs: If the user does not supply an extension, assume .exe
16272 * cs-parser.jay (if_statement): Rewrote so that we can track the
16273 location for the if statement.
16275 * expression.cs (Binary.ConstantFold): Only concat strings when
16276 the operation is "+", not everything ;-)
16278 * statement.cs (Statement.EmitBoolExpression): Take a location
16280 (If, While, Do): Track location.
16282 * expression.cs (Binary.ResolveOperator): In the object + string
16283 case, I was missing a call to ConvertImplicit
16285 2002-02-25 Ravi Pratap <ravi@ximian.com>
16287 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16288 Location arguments. Ensure we use RootContext.LookupType to do our work
16289 and not try to do a direct Type.GetType and ModuleBuilder.GetType
16291 * interface.cs (PopulateMethod): Handle the type of the parameter being
16294 * expression.cs (Invocation.BetterFunction): Handle the case when we
16295 have a params method with no fixed arguments and a call is made with no
16298 2002-02-25 Miguel de Icaza <miguel@ximian.com>
16300 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16301 the verbatim-string-literal
16303 * support.cs (InternalParameters.ParameterModifier): handle null
16305 (InternalParameters.ParameterType): ditto.
16307 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16308 duplicating the name of the variable parameter.
16309 (GetParameterByName): Fix bug where we were not looking up array
16310 paramters if they were the only present (thanks Paolo!).
16311 (GetParameterInfo): We only have an empty set of types if both
16312 fixed and array are set to null.
16313 (GetParameterInfo-idx): Handle FixedParameter == null
16315 * cs-parser.jay: Handle the case where there is no catch
16316 statements (missing null test).
16318 2002-02-22 Miguel de Icaza <miguel@ximian.com>
16320 * driver.cs (MainDriver): Be conservative on our command line
16323 Catch DirectoryNotFoundException when calling GetFiles.
16325 (SplitPathAndPattern): Used to split the input specification into
16326 a path and a pattern that we can feed to Directory.GetFiles.
16328 2002-02-21 Miguel de Icaza <miguel@ximian.com>
16330 * statement.cs (Fixed): Implement the last case of the Fixed
16331 statement (string handling).
16333 * expression.cs (StringPtr): New class used to return a char * to
16334 a string; Used by the Fixed statement.
16336 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
16338 * expression.cs (Binary.ResolveOperator): Remove redundant
16339 MemberLookup pn parent type.
16340 Optimize union call, we do not need a union if the types are the same.
16341 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16344 Specialize the use of MemberLookup everywhere, instead of using
16345 the default settings.
16347 (StackAlloc): Implement stackalloc keyword.
16349 * cs-parser.jay: Add rule to parse stackalloc.
16351 * driver.cs: Handle /h, /help, /?
16353 * expression.cs (MakeByteBlob): Removed the hacks we had in place
16354 before we supported unsafe code.
16356 * makefile: add --unsafe to the self compilation of mcs.
16358 2002-02-20 Miguel de Icaza <miguel@ximian.com>
16360 * expression.cs (PointerArithmetic): New class that is used to
16361 perform pointer arithmetic.
16362 (Binary.Resolve): Handle pointer arithmetic
16363 Handle pointer comparission.
16364 (ArrayPtr): Utility expression class that is used to take the
16365 address of an array.
16367 (ElementAccess): Implement array access for pointers
16369 * statement.cs (Fixed): Implement fixed statement for arrays, we
16370 are missing one more case before we are done.
16372 * expression.cs (Indirection): Implement EmitAssign and set the
16373 ExprClass to Variable. This allows pointer dereferences to be
16374 treated as variables, and to have values assigned to them.
16376 * ecore.cs (Expression.StoreFromPtr): New utility function to
16377 store values dereferencing.
16379 2002-02-20 Ravi Pratap <ravi@ximian.com>
16381 * expression.cs (Binary.ResolveOperator): Ensure that we are
16382 not trying to operate on a void type - this fixes the reported
16385 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16386 the parent implementation is sealed.
16388 * ../errors/cs0239.cs : Add.
16390 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16392 * typemanager.cs (unverifiable_code_type): Corresponds to
16393 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16394 which have unsafe code in them.
16396 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
16399 2002-02-19 Miguel de Icaza <miguel@ximian.com>
16401 * cs-tokenizer.cs: Add support for @"litreal strings"
16403 Make tokenizer accept pre-processor directives
16404 on any column (remove the old C-like limitation).
16406 * rootcontext.cs (EmitCode): Emit any global attributes.
16407 (AddGlobalAttributes): Used to keep track of assembly attributes.
16409 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16411 * cs-parser.jay: Add support for global attributes.
16413 2002-02-17 Miguel de Icaza <miguel@ximian.com>
16415 * expression.cs (Indirection): New helper class. Unary will
16416 create Indirection classes to be able to implement the
16417 IMemoryLocation interface on it.
16419 2002-02-16 Miguel de Icaza <miguel@ximian.com>
16421 * cs-parser.jay (fixed_statement): reference the right statement.
16423 * statement.cs (Fixed.Emit): Finish implementing the fixed
16424 statement for the &x case.
16426 2002-02-14 Miguel de Icaza <miguel@ximian.com>
16428 * class.cs (Property.Define, Method.Define): Remove newslot when
16431 * modifiers.cs: My use of NewSlot when `Abstract' was set was
16432 wrong. NewSlot should only be used if the `new' keyword is present.
16434 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16435 locating our system dir. Sorry about this.
16437 2002-02-13 Miguel de Icaza <miguel@ximian.com>
16439 * driver.cs (GetSystemDir): Compute correctly the location of our
16440 system assemblies. I was using the compiler directory instead of
16441 the library directory.
16443 2002-02-13 Ravi Pratap <ravi@ximian.com>
16445 * expression.cs (BetterFunction): Put back in what Miguel commented out
16446 since it is the correct fix. The problem is elsewhere ;-)
16448 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16449 parameters of the parms method are themselves compatible or not !
16451 (StandardConversionExists): Fix very dangerous bug where we were forgetting
16452 to check that a class implements an interface before saying that an implicit
16453 conversion was allowed. Use ImplementsInterface to do the checking.
16455 2002-02-13 Miguel de Icaza <miguel@ximian.com>
16457 * class.cs (Method.Define): Track whether we are an explicit
16458 implementation or not. And only call DefineMethodOverride if we
16459 are an explicit implementation.
16461 (Property.DefineMethod): Ditto.
16463 2002-02-11 Ravi Pratap <ravi@ximian.com>
16465 * expression.cs (BetterFunction): Catch hideous bug which was
16466 preventing us from detecting ambiguous calls due to implicit casts i.e
16469 2002-01-29 Miguel de Icaza <miguel@ximian.com>
16471 * support.cs (Pair): Remove un-needed method. I figured why I was
16472 getting the error in cs-parser.jay, the variable in a foreach loop
16473 is readonly, and the compiler does not really treat this as a variable.
16475 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
16476 instead of EQUALS in grammar.
16478 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16480 * expression.cs (Unary.DoResolve): Check whether the argument is
16483 2002-01-28 Miguel de Icaza <miguel@ximian.com>
16485 * support.cs: Api for Pair to set a value. Despite the fact that
16486 the variables are public the MS C# compiler refuses to compile
16487 code that accesses the field if the variable is part of a foreach
16490 * statement.cs (Fixed): Begin implementation of the fixed
16493 (Block.AddVariable): Return the VariableInfo on success and null
16494 on failure instead of true/false.
16496 * cs-parser.jay (foreach): Catch errors on variables already
16497 defined (we were ignoring this value before) and properly unwind
16498 the block hierarchy
16500 (fixed_statement): grammar for the fixed statement.
16502 2002-01-25 Miguel de Icaza <miguel@ximian.com>
16504 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16505 pointer types to be incretemented.
16507 (SizeOf): Implement.
16509 * cs-parser.jay (pointer_member_access): Implement
16510 expr->IDENTIFIER production.
16512 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16513 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16516 (Unary): Implement indirection.
16518 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16519 use in non-unsafe context).
16521 (SimpleName.DoResolve): Check for pointers in field access on safe
16524 (Expression.LoadFromPtr): Factor the load-indirect code in this
16525 function. This was duplicated in UnboxCast and ParameterReference
16527 2002-01-24 Miguel de Icaza <miguel@ximian.com>
16529 * expression.cs (ComposedCast): report an error if a pointer cast
16530 is used in a safe region.
16532 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16533 pointer type casts in unsafe context.
16535 * codegen.cs (EmitContext): Set up IsUnsafe.
16537 * cs-parser.jay (non_expression_type): Add productions for pointer
16540 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16541 code. We should not use force into static mode if the method is
16542 not virtual. Fixes bug in MIS
16544 * statement.cs (Do.Emit, While.Emit, For.Emit,
16545 Statement.EmitBoolExpression): Add support to Do and While to
16546 propagate infinite loop as `I do return' semantics.
16548 Improve the For case to also test for boolean constants.
16550 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16551 to the list of attributes we can add.
16553 Remove `EmitContext' argument.
16555 * class.cs (Method.Define): Apply parameter attributes.
16556 (Constructor.Define): Apply parameter attributes.
16557 (MethodCore.LabelParameters): Move here the core of labeling
16560 * support.cs (ReflectionParameters.ParameterModifier,
16561 InternalParameters.ParameterModifier): Use IsByRef on the type and
16562 only return the OUT bit for these parameters instead of in/out/ref
16565 This is because I miss-understood things. The ParameterInfo.IsIn
16566 and IsOut represent whether the parameter has the [In] and [Out]
16569 2002-01-22 Miguel de Icaza <miguel@ximian.com>
16571 * ecore.cs (FieldExpr.Emit): Release temporaries.
16573 * assign.cs (LocalTemporary.Release): new function.
16575 * codegen.cs (EmitContext.GetTemporaryStorage,
16576 EmitContext.FreeTemporaryStorage): Rework the way we deal with
16577 temporary storage. Now we can "put back" localbuilders when we
16580 2002-01-21 Miguel de Icaza <miguel@ximian.com>
16582 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16583 need to make a copy of the variable to generate verifiable code.
16585 2002-01-19 Miguel de Icaza <miguel@ximian.com>
16587 * driver.cs: Compute dynamically the system directory.
16589 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16590 Slower, but more generally useful. Used by the abstract
16591 registering implementation.
16593 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16594 the rules for the special rule on Type/instances. First check if
16595 we have the same name, and if so, try that special static path
16596 rather than the instance path.
16598 2002-01-18 Miguel de Icaza <miguel@ximian.com>
16600 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16603 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16604 Enum, ValueType, Delegate or Array for non-corlib compiles.
16606 * cs-tokenizer.cs: Catch long identifiers (645)
16608 * typemanager.cs (IndexerPropetyName): Ravi never tested this
16611 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16612 fix, we were returning too early, so we were not registering
16613 pending methods from abstract classes.
16615 Do not register pending methods if the class is abstract.
16617 * expression.cs (Conditional.DoResolve): Report circular implicit
16618 conversions when we neecd to compute it for conditional
16621 (Is.DoResolve): If the expression is always of the provided type,
16622 flag warning 183. If the expression can not ever be of the
16623 provided type flag warning 184.
16625 * class.cs: Catch 169 as well.
16627 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16630 2002-01-18 Nick Drochak <ndrochak@gol.com>
16632 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
16634 2002-01-17 Miguel de Icaza <miguel@ximian.com>
16636 * interface.cs: (PopulateMethod): Check for pointers being defined
16637 only if the unsafe context is active.
16638 (PopulateProperty): ditto.
16639 (PopulateIndexer): ditto.
16641 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16642 specified. If pointers are present, make sure that they are
16643 present in an unsafe context.
16644 (Constructor, Constructor.Define): ditto.
16645 (Field, Field.Define): ditto.
16646 (Property, Property.Define): ditto.
16647 (Event, Event.Define): ditto.
16649 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16650 hashtable if there are classes or structs defined.
16652 * expression.cs (LocalVariableReference.DoResolve): Simplify this
16653 code, as the constant resolution moved.
16655 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16656 the metadata, so we can flag error 133.
16658 * decl.cs (MemberCore.UnsafeOK): New function to test that a
16659 pointer is being declared in an unsafe context.
16661 2002-01-16 Miguel de Icaza <miguel@ximian.com>
16663 * modifiers.cs (Modifiers.Check): Require a Location argument.
16664 Report error 227 for Unsafe use.
16666 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16668 * statement.cs (For.Emit): If the test is null, then report that
16669 we do `return', as we wont reach anything afterwards.
16671 (Switch.SwitchGoverningType): Track the expression that matched
16674 * driver.cs: Allow negative numbers as an error code to flag.
16676 * cs-parser.jay: Handle 1551.
16678 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16680 2002-01-15 Miguel de Icaza <miguel@ximian.com>
16682 * cs-parser.jay: Report 1518 (type declaration can only contain
16683 class, struct, interface, enum or delegate)
16685 (switch_label): Report 1523 (keywords `case' or `default' must
16688 (opt_switch_sections): Report 1522 (empty switch)
16690 * driver.cs: Report 1515 (response file specified multiple times)
16691 Report 1516 (Source file specified multiple times).
16693 * expression.cs (Argument.Resolve): Signal 1510
16695 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16696 access not allowed in static code)
16698 2002-01-11 Ravi Pratap <ravi@ximian.com>
16700 * typemanager.cs (IsPointerType): Utility method which we are going
16703 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16704 the object type, so we take care of that.
16706 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16708 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16709 added to non-params parameters :-)
16711 * typemanager.cs (CSharpName): Include 'void' type too.
16713 (void_ptr_type): Include in the set of core types.
16715 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
16718 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
16721 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
16722 completely forgotten about it.
16724 2002-01-10 Ravi Pratap <ravi@ximian.com>
16726 * cs-parser.jay (pointer_type): Add. This begins our implementation
16727 of parsing rules for unsafe code.
16729 (unsafe_statement): Implement.
16731 (embedded_statement): Modify to include the above.
16733 * statement.cs (Unsafe): Implement new class for unsafe blocks.
16735 * codegen.cs (EmitContext.InUnsafe): Add. This determines
16736 if the current context is an unsafe one.
16738 * cs-parser.jay (local_variable_pointer_type): Since local variable types
16739 are handled differently, we need separate rules for them.
16741 (local_variable_declaration): Update to use local_variable_pointer_type
16742 to allow variable declarations of unmanaged pointer types.
16744 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16745 in unsafe contexts.
16747 * ../errors/cs0214.cs : Add.
16749 2002-01-16 Nick Drochak <ndrochak@gol.com>
16751 * makefile: remove 'response' file when cleaning.
16753 2002-01-15 Miguel de Icaza <miguel@ximian.com>
16755 * cs-parser.jay: Report 1524.
16757 2002-01-14 Miguel de Icaza <miguel@ximian.com>
16759 * typemanager.cs (RegisterMethod): drop checking if we have
16760 registered this from here
16762 2002-01-12 Miguel de Icaza <miguel@ximian.com>
16764 * class.cs (Method.EmitDestructor): Implement calling our base
16767 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16768 value of InFinally.
16770 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16771 this routine and will wrap the call in a try/catch block. Deal
16774 2002-01-11 Miguel de Icaza <miguel@ximian.com>
16776 * ecore.cs (Expression.MemberLookup): instead of taking a
16777 parameter `same_type' that was used to tell whether we could
16778 access private members we compute our containing type from the
16781 (FieldExpr): Added partial support for volatile fields. This does
16782 not work for volatile fields exposed from assemblies, as I can not
16783 figure out how to extract the modreq from it.
16785 Updated all the source files to use this.
16787 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16788 because it is referenced by MemberLookup very often.
16790 2002-01-09 Ravi Pratap <ravi@ximian.com>
16792 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16793 TypeBuilder.GetCustomAttributes to retrieve what we need.
16795 Get rid of redundant default_member_attr_type as this is the same as
16796 default_member_type which already exists.
16798 * interface.cs, attribute.cs : Update accordingly.
16800 2002-01-08 Miguel de Icaza <miguel@ximian.com>
16802 * typemanager.cs: Enable IndexerPropertyName again. It does not
16803 work for TYpeBuilders though. Ravi, can you please fix this?
16805 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16807 * expression.cs (Argument.Emit): Handle the case of ref objects
16808 being passed to ref functions;
16810 (ParameterReference.EmitLoad): Loads the content of the pointer
16811 without dereferencing.
16813 2002-01-07 Miguel de Icaza <miguel@ximian.com>
16815 * cs-tokenizer.cs: Implemented the pre-processing expressions.
16817 2002-01-08 Ravi Pratap <ravi@ximian.com>
16819 * class.cs (Indexer.DefineMethod): Incorporate the interface
16820 type in the name of the method if we are doing explicit interface
16823 * expression.cs (ConversionExists): Remove as it is completely obsolete.
16825 (BetterConversion): Fix extremely trivial bug where we were referring to
16826 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16829 * ../errors/bug16.cs : Add although we have fixed it.
16831 2002-01-07 Miguel de Icaza <miguel@ximian.com>
16833 * expression.cs (BaseIndexer): Begin implementation.
16835 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16837 * cs-parser.jay (indexer_declarator): Use qualified_identifier
16838 production directly to remove a shift/reduce, and implement
16839 explicit interface implementation.
16841 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16842 after a floating point suffix.
16844 * expression.cs (DoNumericPromotions): Improved the conversion for
16845 uint/uint. If we have a constant, we avoid doing a typecast to a
16848 * class.cs (Indexer): Implement explicit interface implementation
16851 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16853 * class.cs: make the default instance constructor public and hidebysig.
16855 2001-01-03 Ravi Pratap <ravi@ximian.com>
16857 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16858 so we can call it from elsewhere.
16860 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16861 we emit it internally if the class has a defined indexer; otherwise the user
16862 emits it by decorating the class definition with the DefaultMemberAttribute.
16864 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16865 attribute is not used on a type which defines an indexer.
16867 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16868 character when we skip whitespace.
16870 * ../errors/cs0646.cs : Add.
16872 2002-01-03 Miguel de Icaza <miguel@ximian.com>
16874 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16877 * makefile: Add practical target `mcs3.exe' which builds the third
16878 generation compiler.
16880 * expression.cs (New): Fix structures constructor calling.
16882 * class.cs (Property, Method, Indexer): Emit Final flag on the
16883 method if we are an interface implementation and we are not
16886 * ecore.cs (PropertyExpr): New public field `IsBase', tells
16887 whether this property is referencing a `base' method.
16889 * expression.cs (Invocation.EmitCall): take an extra argument:
16890 is_base, this is used to determine whether the `call' or
16891 `callvirt' opcode should be used.
16894 * delegate.cs: update EmitCall.
16896 * class.cs (Method.Define): Set NewSlot for the cases where we are
16897 not implementing an interface method.
16899 (Property.Define): ditto.
16901 2002-01-02 Miguel de Icaza <miguel@ximian.com>
16903 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16904 'r'. Allows mcs to parse itself fully.
16906 2002-01-02 Ravi Pratap <ravi@ximian.com>
16908 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16909 of the number of initializers that require the InitializeArray method.
16911 (CheckIndices): Store the Expression in all cases - not the plain value. Also
16912 update the above field where necessary.
16914 (MakeByteBlob): Update accordingly.
16916 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
16919 (EmitDynamicInitializers): Update in accordance with the new optimization.
16921 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16922 same OpCode applies.
16924 * cs-parser.jay : Fix some glaring errors I introduced.
16926 2002-01-01 Ravi Pratap <ravi@ximian.com>
16928 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16929 so that we can check for name clashes there too.
16931 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16932 for interface indexers.
16934 * interfaces.cs (Define): Emit the default member attribute.
16936 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16937 variable was being referred to while setting the value ;-)
16939 2002-01-01 Miguel de Icaza <miguel@ximian.com>
16941 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16942 byte-by-byte information when we know the data is zero.
16944 Make the block always a multiple of 4, because
16945 DefineInitializedData has a bug.
16947 * assign.cs: Fix, we should assign from the temporary, not from
16950 * expression.cs (MakeByteBlob): Fix my incorrect code.
16952 2001-12-31 Miguel de Icaza <miguel@ximian.com>
16954 * typemanager.cs (EnumToUnderlying): This function is used to get
16955 the underlying type from an enumeration, because it does not
16958 * constant.cs: Use the I4_S form for values between -128 and 127.
16960 * statement.cs (Block.LookupLabel): Looks up a label.
16961 (Block): Drop support for labeled blocks.
16963 (LabeledStatement): New kind of statement that represents a label
16966 (Goto): Finally implement this bad boy.
16968 * cs-parser.jay: Update to reflect new mechanism to implement
16971 2001-12-30 Miguel de Icaza <miguel@ximian.com>
16973 * codegen.cs (EmitContext.This): a codegen property that keeps the
16974 a single instance of this instead of creating many different this
16977 * delegate.cs (Delegate.DoResolve): Update to use the property;
16979 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16981 * expression.cs (BaseAccess.DoResolve): Ditto.
16983 2001-12-29 Ravi Pratap <ravi@ximian.com>
16985 * typemanager.cs (methodimpl_attr_type): Add to hold the type
16986 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16988 (InitCoreTypes): Update accordingly.
16990 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16991 so we can quickly store the state.
16993 (ApplyAttributes): Set the correct implementation flags
16994 for InternalCall methods.
16996 2001-12-29 Miguel de Icaza <miguel@ximian.com>
16998 * expression.cs (EmitCall): if a method is not virtual, then do
16999 not use callvirt on it.
17001 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17002 user defined stuff) requires the use of stobj, which takes an
17003 address on the stack instead of an array and an index. So emit
17004 the Ldelema operation for it.
17006 (EmitStoreOpcode): Use stobj for valuetypes.
17008 (UnaryMutator.EmitCode): Use the right 1 value depending on
17009 whether we are dealing with int64/uint64, float or doubles.
17011 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17012 constructors that I implemented last night.
17014 (Constructor.IsDefault): Fix to work properly for static
17017 * cs-parser.jay (CheckDef): report method signature errors.
17018 Update error number 103 to be 132.
17020 * decl.cs: New AdditionResult enumeration value: MethodExists.
17021 Although we do this check for methods later on in the semantic
17022 analysis, catching repeated default constructors is so easy that
17023 we catch these here.
17025 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17028 (ParameterReference.EmitAssign, Emit): handle
17031 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17032 (ArrayAccess.EmitStoreOpcode): ditto.
17034 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17036 * expression.cs (MakeByteBlob): Complete all the missing types
17037 (uint, short, ushort, byte, sbyte)
17039 * class.cs: Only init instance field initializers on instance
17042 Rename `constructors' to instance_constructors.
17044 (TypeContainer.AddConstructor): Only add constructors to the list
17045 if it is not static.
17047 Make sure that we handle default_static_constructor independently
17048 everywhere where we handle instance_constructors
17050 2001-12-28 Miguel de Icaza <miguel@ximian.com>
17052 * class.cs: Do not lookup or create a base initializer for a
17053 static constructor.
17055 (ConstructorInitializer.Resolve): use the proper type to lookup
17058 * cs-parser.jay: Report error 1585 (modifiers between type and name).
17060 * enum.cs, interface.cs: Remove CloseType, this is taken care by
17063 * decl.cs: CloseType is now an virtual method, the default
17064 implementation just closes this type.
17066 2001-12-28 Ravi Pratap <ravi@ximian.com>
17068 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17069 to PreserveSig by default. Also emit HideBySig on such methods.
17071 Basically, set the defaults to standard values.
17073 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17074 argument, if candidate is better, it can't be worse than the best !
17076 (Invocation): Re-write bits to differentiate between methods being
17077 applicable in their expanded form and their normal form - for params
17080 Get rid of use_standard everywhere as only standard conversions are allowed
17081 in overload resolution.
17083 More spec conformance.
17085 2001-12-27 Miguel de Icaza <miguel@ximian.com>
17087 * driver.cs: Add --timestamp, to see where the compiler spends
17090 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17091 `this' in static code.
17093 (SimpleName.DoResolve): Implement in terms of a helper function
17094 that allows static-references to be passed upstream to
17097 (Expression.ResolveWithSimpleName): Resolve specially simple
17098 names when called by MemberAccess to implement the special
17101 (Expression.ImplicitReferenceConversion): Handle conversions from
17102 Null to reference types before others, as Null's type is
17105 * expression.cs (Invocation.EmitCall): Handle the special case of
17106 calling methods declared on a reference type from a ValueType
17107 (Base classes System.Object and System.Enum)
17109 (MemberAccess.Resolve): Only perform lookups on Enumerations if
17110 the left hand side is a TypeExpr, not on every enumeration.
17112 (Binary.Resolve): If types are reference types, then do a cast to
17113 object on operators != and == of both arguments.
17115 * typemanager.cs (FindMembers): Extract instance and static
17116 members if requested.
17118 * interface.cs (PopulateProperty): Use void_type instead of null
17119 as the return type for the setter method.
17121 (PopulateIndexer): ditto.
17123 2001-12-27 Ravi Pratap <ravi@ximian.com>
17125 * support.cs (ReflectionParameters): Fix minor bug where we
17126 were examining the wrong parameter for the ParamArray attribute.
17128 Cope with requests for the type of the parameter at position
17129 greater than the params parameter's. We now return the element
17130 type of the params array as that makes more sense.
17132 * expression.cs (Invocation.IsParamsMethodApplicable): Update
17133 accordingly as we no longer have to extract the element type
17136 (Invocation.OverloadResolve): Update.
17138 2001-12-27 Miguel de Icaza <miguel@ximian.com>
17140 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17141 against IEnumerator, test whether the return value is a descendant
17142 of the IEnumerator interface.
17144 * class.cs (Indexer.Define): Use an auxiliary method to implement
17145 the other bits of the method definition. Begin support for
17146 explicit interface implementation.
17148 (Property.DefineMethod): Use TypeManager.void_type instead of null
17149 for an empty return value.
17151 2001-12-26 Miguel de Icaza <miguel@ximian.com>
17153 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17154 dealing with a FieldExpr which is composed of a FieldBuilder, in
17155 the code path we did extract the constant, but we should have
17156 obtained the underlying value to be able to cast it (otherwise we
17157 end up in an infinite loop, this is what Ravi was running into).
17159 (ArrayCreation.UpdateIndices): Arrays might be empty.
17161 (MemberAccess.ResolveMemberAccess): Add support for section
17162 14.5.4.1 that deals with the special case of E.I when E is a type
17163 and something else, that I can be a reference to a static member.
17165 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17166 handle a particular array type to create byte blobs, it is just
17167 something we dont generate byteblobs for.
17169 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17172 * location.cs (Push): remove the key from the hashtable that we
17173 are about to add. This happens for empty files.
17175 * driver.cs: Dispose files after we have parsed them.
17177 (tokenize): new function that only runs the tokenizer on its
17178 input, for speed testing.
17180 2001-12-26 Ravi Pratap <ravi@ximian.com>
17182 * class.cs (Event.Define): Define the private field only if there
17183 are no accessors defined.
17185 * expression.cs (ResolveMemberAccess): If there is no associated
17186 field with the event, that means we have an event defined with its
17187 own accessors and we should flag error cs0070 since transforming
17188 ourselves into a field is not valid in that case.
17190 * ecore.cs (SimpleName.DoResolve): Same as above.
17192 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17193 and charset to sane values.
17195 2001-12-25 Ravi Pratap <ravi@ximian.com>
17197 * assign.cs (DoResolve): Perform check on events only if they
17198 are being accessed outside the declaring type.
17200 * cs-parser.jay (event_declarations): Update rules to correctly
17201 set the type of the implicit parameter etc.
17203 (add_accessor, remove_accessor): Set current local parameters.
17205 * expression.cs (Binary): For delegate addition and subtraction,
17206 cast the return value from the method into the appropriate delegate
17209 2001-12-24 Ravi Pratap <ravi@ximian.com>
17211 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17212 of these as the workaround is unnecessary.
17214 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17215 delegate data - none of that is needed at all.
17217 Re-write bits to extract the instance expression and the delegate method
17220 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
17223 * attribute.cs (ApplyAttributes): New method to take care of common tasks
17224 of attaching attributes instead of duplicating code everywhere.
17226 * everywhere : Update code to do attribute emission using the above method.
17228 2001-12-23 Miguel de Icaza <miguel@ximian.com>
17230 * expression.cs (IsParamsMethodApplicable): if there are not
17231 parameters, return immediately.
17233 * ecore.cs: The 0 literal can be implicity converted to an enum
17236 (SimpleName.DoResolve): First lookup the type, then lookup the
17239 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17240 want to get its address. If the InstanceExpression is not
17241 addressable, store the result in a temporary variable, then get
17244 * codegen.cs: Only display 219 errors on warning level or above.
17246 * expression.cs (ArrayAccess): Make it implement the
17247 IMemoryLocation interface.
17249 (Binary.DoResolve): handle the operator == (object a, object b)
17250 and operator != (object a, object b) without incurring into a
17251 BoxedCast (because 5 != o should never be performed).
17253 Handle binary enumerator operators.
17255 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17256 value type, otherwise use Ldelem_ref.
17258 Use precomputed names;
17260 (AddressOf): Implement address of
17262 * cs-parser.jay (labeled_statement): Fix recursive block
17263 addition by reworking the production.
17265 * expression.cs (New.DoEmit): New has a special case:
17267 If we are dealing with a ValueType, we have a few
17268 situations to deal with:
17270 * The target of New is a ValueType variable, that is
17271 easy, we just pass this as the variable reference
17273 * The target of New is being passed as an argument,
17274 to a boxing operation or a function that takes a
17277 In this case, we need to create a temporary variable
17278 that is the argument of New.
17281 2001-12-23 Ravi Pratap <ravi@ximian.com>
17283 * rootcontext.cs (LookupType): Check that current_type is not null before
17284 going about looking at nested types.
17286 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17287 not implement the IAssignMethod interface any more.
17289 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17290 where we tranform them into FieldExprs if they are being resolved from within
17291 the declaring type.
17293 * ecore.cs (SimpleName.DoResolve): Do the same here.
17295 * assign.cs (DoResolve, Emit): Clean up code considerably.
17297 * ../errors/bug10.cs : Add.
17299 * ../errors/cs0070.cs : Add.
17301 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17303 * assign.cs : Get rid of EventIsLocal everywhere.
17305 2001-12-23 Miguel de Icaza <miguel@ximian.com>
17307 * ecore.cs (ConvertIntLiteral): finished the implementation.
17309 * statement.cs (SwitchLabel): Convert the value we are using as a
17310 key before looking up the table.
17312 2001-12-22 Miguel de Icaza <miguel@ximian.com>
17314 * codegen.cs (EmitTopBlock): Require a Location argument now.
17316 * cs-parser.jay (constructor_declarator): We need to setup
17317 current_local_parameters before we parse the
17318 opt_constructor_initializer, to allow the variables to be bound
17319 to the constructor arguments.
17321 * rootcontext.cs (LookupType): First lookup nested classes in our
17322 class and our parents before we go looking outside our class.
17324 * expression.cs (ConstantFold): Extract/debox the values at the
17327 * rootcontext.cs (EmitCode): Resolve the constants first before we
17328 resolve the types. This is not really needed, but it helps debugging.
17330 * statement.cs: report location.
17332 * cs-parser.jay: pass location to throw statement.
17334 * driver.cs: Small bug fix.
17336 * report.cs: Updated format to be 4-zero filled digits.
17338 2001-12-22 Ravi Pratap <ravi@ximian.com>
17340 * expression.cs (CheckIndices): Fix minor bug where the wrong
17341 variable was being referred to ;-)
17343 (DoEmit): Do not call EmitStaticInitializers when the
17344 underlying type is System.Object.
17346 2001-12-21 Ravi Pratap <ravi@ximian.com>
17348 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17349 and do the usual workaround for SRE.
17351 * class.cs (MyEventBuilder.EventType): New member to get at the type
17352 of the event, quickly.
17354 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17356 * assign.cs (Assign.DoResolve): Handle the case when the target
17357 is an EventExpr and perform the necessary checks.
17359 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17362 (SimpleName.MemberStaticCheck): Include check for EventExpr.
17364 (EventExpr): Set the type in the constructor itself since we
17365 are meant to be born fully resolved.
17367 (EventExpr.Define): Revert code I wrote earlier.
17369 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17370 instance expression is null. The instance expression is a This in that case
17371 or a null, depending on whether it is a static method or not.
17373 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17374 refers to more than one method.
17376 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17377 and accordingly flag errors.
17379 2001-12-21 Miguel de Icaza <miguel@ximian.com>
17381 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17383 2001-12-22 Miguel de Icaza <miguel@ximian.com>
17385 * location.cs (ToString): Provide useful rutine.
17387 2001-12-21 Miguel de Icaza <miguel@ximian.com>
17389 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17390 objects, return the actual integral boxed.
17392 * statement.cs (SwitchLabel): define an ILLabel for each
17395 (Switch.CheckSwitch): If the value is a Literal, extract
17396 the underlying literal.
17398 Also in the unused hashtable we had, add the SwitchLabel so we can
17399 quickly look this value up.
17401 * constant.cs: Implement a bunch of new constants. Rewrite
17402 Literal based on this. Made changes everywhere to adapt to this.
17404 * expression.cs (Expression.MakeByteBlob): Optimize routine by
17405 dereferencing array only once, and also copes with enumrations.
17407 bytes are two bytes wide, not one.
17409 (Cast): Perform constant conversions.
17411 * ecore.cs (TryImplicitIntConversion): Return literals instead of
17412 wrappers to the literals here.
17414 * expression.cs (DoNumericPromotions): long literals can converted
17415 to ulong implicity (this is taken care of elsewhere, but I was
17416 missing this spot).
17418 * ecore.cs (Expression.Literalize): Make the return type Literal,
17419 to improve type checking.
17421 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17423 2001-12-20 Miguel de Icaza <miguel@ximian.com>
17425 * literal.cs: Revert code from ravi that checked the bounds. The
17426 bounds are sane by the definition of the type itself.
17428 * typemanager.cs: Fix implementation of ImplementsInterface. We
17429 need to actually look up in our parent hierarchy for interfaces
17432 * const.cs: Use the underlying type for enumerations
17434 * delegate.cs: Compute the basename for the delegate creation,
17435 that should fix the delegate test case, and restore the correct
17436 Type Lookup semantics in rootcontext
17438 * rootcontext.cs: Revert Ravi's last patch. The correct way of
17439 referencing a nested type with the Reflection API is using the "+"
17442 * cs-parser.jay: Do not require EOF token at the end.
17444 2001-12-20 Ravi Pratap <ravi@ximian.com>
17446 * rootcontext.cs (LookupType): Concatenate type names with
17447 a '.' instead of a '+' The test suite passes again.
17449 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17450 field of the enumeration.
17452 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17453 the case when the member is an EventExpr.
17455 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17456 static has an associated instance expression.
17458 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17460 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17462 * class.cs (Event.Define): Register event and perform appropriate checks
17465 We define the Add and Remove methods even if the use provides none because
17466 in that case, we provide default implementations ourselves.
17468 Define a private field of the type of the event. This is done by the CSC compiler
17469 and we should be doing it too ;-)
17471 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17472 More methods we use in code we generate.
17474 (multicast_delegate_type, delegate_type): Two separate types since the distinction
17477 (InitCoreTypes): Update accordingly for the above.
17479 * class.cs (Event.Emit): Generate code for default accessors that we provide
17481 (EmitDefaultMethod): Do the job in the above.
17483 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
17486 2001-12-20 Miguel de Icaza <miguel@ximian.com>
17488 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17489 builders even if we were missing one.
17491 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17492 pass the Basename as our class name instead of the Name. The
17493 basename will be correctly composed for us.
17495 * parameter.cs (Paramters): Now takes a Location argument.
17497 * decl.cs (DeclSpace.LookupType): Removed convenience function and
17498 make all the code call directly LookupType in RootContext and take
17499 this chance to pass the Location information everywhere.
17501 * Everywhere: pass Location information.
17503 2001-12-19 Miguel de Icaza <miguel@ximian.com>
17505 * class.cs (Constructor.Define): Updated way of detecting the
17506 length of the parameters.
17508 (TypeContainer.DefineType): Use basename as the type name for
17511 (TypeContainer.Define): Do not recursively define types here, as
17512 definition is taken care in order by the RootContext.
17514 * tree.cs: Keep track of namespaces in a per-file basis.
17516 * parameter.cs (Parameter.ComputeSignature): Update to use
17519 (Parameters.GetSignature): ditto.
17521 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17522 instead of a TypeContainer.
17524 (Interface.SemanticAnalysis): Use `this' instead of our parent to
17525 resolve names. Because we need to be resolve in our context, not
17528 * driver.cs: Implement response files.
17530 * class.cs (TypeContainer.DefineType): If we are defined, do not
17531 redefine ourselves.
17533 (Event.Emit): Emit the code for add/remove handlers.
17534 (Event.Define): Save the MethodBuilders for add/remove.
17536 * typemanager.cs: Use pair here too.
17538 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17539 DictionaryEntry requires the first argument to be non-null.
17541 (enum_declaration): Compute full name for registering the
17544 (delegate_declaration): Instead of using
17545 formal_parameter_list, use opt_formal_parameter_list as the list
17548 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17549 (EventParsing): New property that controls whether `add' and
17550 `remove' are returned as tokens or identifiers (for events);
17552 2001-12-19 Ravi Pratap <ravi@ximian.com>
17554 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17555 use MyEventBuilder only and let it wrap the real builder for us.
17557 (MyEventBuilder): Revamp constructor etc.
17559 Implement all operations that we perform on EventBuilder in precisely the same
17562 (FindMembers): Update to use the EventBuilder member.
17564 (Event.Emit): Update accordingly.
17566 2001-12-18 Ravi Pratap <ravi@ximian.com>
17568 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17569 by calling the appropriate methods.
17571 (GetCustomAttributes): Make stubs as they cannot possibly do anything
17574 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17576 2001-12-17 Ravi Pratap <ravi@ximian.com>
17578 * delegate.cs (Delegate.Populate): Check that the return type
17579 and various parameters types are indeed accessible.
17581 * class.cs (Constructor.Define): Same here.
17583 (Field.Define): Ditto.
17585 (Event.Define): Ditto.
17587 (Operator.Define): Check that the underlying Method defined itself
17588 correctly - so it's MethodBuilder should not be null.
17590 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17591 expression happens to be null.
17593 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17594 members but as of now we don't seem to be able to do anything really useful with it.
17596 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17597 not the EventBuilder.
17599 2001-12-18 Miguel de Icaza <miguel@ximian.com>
17601 * cs-tokenizer.cs: Add support for defines.
17602 Add support for #if, #elif, #else, #endif
17604 (eval_var): evaluates a variable.
17605 (eval): stubbed for evaluating functions.
17607 * cs-parser.jay: Pass the defines information
17609 * driver.cs: Add --define command line option.
17611 * decl.cs: Move MemberCore here.
17613 Make it the base class for DeclSpace. This allows us to catch and
17614 report 108 and 109 for everything now.
17616 * class.cs (TypeContainer.Define): Extract all the members
17617 before populating and emit the warning 108 (new keyword required
17618 to override) instead of having each member implement this.
17620 (MemberCore.Define): New abstract method, we will be using this in
17621 the warning reporting engine in Populate.
17623 (Operator.Define): Adjust to new MemberCore protocol.
17625 * const.cs (Const): This does not derive from Expression, it is a
17626 temporary object we use to create fields, it is a MemberCore.
17628 * class.cs (Method.Define): Allow the entry point to be in a
17631 * driver.cs: Rewrite the argument handler to clean it up a bit.
17633 * rootcontext.cs: Made it just an auxiliary namespace feature by
17634 making everything static.
17636 * driver.cs: Adapt code to use RootContext type name instead of
17639 * delegate.cs: Remove RootContext argument.
17641 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17644 * class.cs (Event.Define): The lookup can fail.
17646 * cs-tokenizer.cs: Begin implementation of pre-procesor.
17648 * expression.cs: Resolve the this instance before invoking the code.
17650 2001-12-17 Miguel de Icaza <miguel@ximian.com>
17652 * cs-parser.jay: Add a production in element_access that allows
17653 the thing to become a "type" reference. This way we can parse
17654 things like "(string [])" as a type.
17656 Note that this still does not handle the more complex rules of
17660 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
17662 * ecore.cs: (CopyNewMethods): new utility function used to
17663 assemble the list of methods from running FindMembers.
17665 (MemberLookup): Rework FindMembers so that
17667 2001-12-16 Miguel de Icaza <miguel@ximian.com>
17669 * class.cs (TypeContainer): Remove Delegates who fail to be
17672 * delegate.cs (Populate): Verify that we dont get null return
17673 values. TODO: Check for AsAccessible.
17675 * cs-parser.jay: Use basename to emit error 574 (destructor should
17676 have the same name as container class), not the full name.
17678 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17679 possible representation.
17681 Also implements integer type suffixes U and L.
17683 2001-12-15 Miguel de Icaza <miguel@ximian.com>
17685 * expression.cs (ArrayCreation.DoResolve): We need to do the
17686 argument resolution *always*.
17688 * decl.cs: Make this hold the namespace. Hold the root context as
17690 (LookupType): Move here.
17692 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17694 * location.cs (Row, Name): Fixed the code, it was always returning
17695 references to the first file.
17697 * interface.cs: Register properties defined through interfaces.
17699 * driver.cs: Add support for globbing on the command line
17701 * class.cs (Field): Make it derive from MemberCore as well.
17704 2001-12-15 Ravi Pratap <ravi@ximian.com>
17706 * class.cs (Event::Define): Check that the type of the event is a delegate
17707 type else flag error #66.
17709 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17712 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17713 values of EntryPoint, CharSet etc etc.
17715 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17717 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17718 be null and we should ignore this. I am not sure if this is really clean. Apparently,
17719 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17720 which needs this to do its work.
17722 * ../errors/cs0066.cs : Add.
17724 2001-12-14 Miguel de Icaza <miguel@ximian.com>
17726 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17729 * class.cs: (MethodSignature.MethodSignature): Removed hack that
17730 clears out the parameters field.
17731 (MemberSignatureCompare): Cleanup
17733 (MemberCore): New base class used to share code between MethodCore
17736 (RegisterRequiredImplementations) BindingFlags.Public requires
17737 either BindingFlags.Instace or Static. Use instance here.
17739 (Property): Refactored code to cope better with the full spec.
17741 * parameter.cs (GetParameterInfo): Return an empty array instead
17744 * class.cs (Property): Abstract or extern properties have no bodies.
17746 * parameter.cs (GetParameterInfo): return a zero-sized array.
17748 * class.cs (TypeContainer.MethodModifiersValid): Move all the
17749 method modifier validation to the typecontainer so we can reuse
17750 this on properties.
17752 (MethodCore.ParameterTypes): return an empty sized array of types.
17754 (Property.Define): Test property modifier validity.
17756 Add tests for sealed/override too.
17758 (Method.Emit): abstract or extern methods have no bodies.
17760 2001-12-14 Ravi Pratap <ravi@ximian.com>
17762 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17765 (Method::Define, ::Emit): Modify accordingly.
17767 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17769 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17771 * makefile: Pass in /unsafe.
17773 2001-12-13 Miguel de Icaza <miguel@ximian.com>
17775 * class.cs (MakeKey): Kill routine.
17777 * class.cs (TypeContainer.Define): Correctly define explicit
17778 method implementations (they require the full interface name plus
17781 * typemanager.cs: Deply the PtrHashtable here and stop using the
17782 lame keys. Things work so much better.
17784 This of course broke everyone who depended on `RegisterMethod' to
17785 do the `test for existance' test. This has to be done elsewhere.
17787 * support.cs (PtrHashtable): A hashtable that avoid comparing with
17788 the object stupid Equals method (because, that like fails all over
17789 the place). We still do not use it.
17791 * class.cs (TypeContainer.SetRequiredInterface,
17792 TypeContainer.RequireMethods): Killed these two routines and moved
17793 all the functionality to RegisterRequiredImplementations.
17795 (TypeContainer.RegisterRequiredImplementations): This routine now
17796 registers all the implementations required in an array for the
17797 interfaces and abstract methods. We use an array of structures
17798 which can be computed ahead of time to reduce memory usage and we
17799 also assume that lookups are cheap as most classes will not
17800 implement too many interfaces.
17802 We also avoid creating too many MethodSignatures.
17804 (TypeContainer.IsInterfaceMethod): Update and optionally does not
17805 clear the "pending" bit if we find that there are problems with
17808 (TypeContainer.VerifyPendingMethods): Update to report errors of
17809 methods that look like implementations but are not.
17811 (TypeContainer.Define): Add support for explicit interface method
17814 2001-12-12 Miguel de Icaza <miguel@ximian.com>
17816 * typemanager.cs: Keep track of the parameters here instead of
17817 being a feature of the TypeContainer.
17819 * class.cs: Drop the registration of parameters here, as
17820 InterfaceMethods are also interface declarations.
17822 * delegate.cs: Register methods with the TypeManager not only with
17823 the TypeContainer. This code was buggy.
17825 * interface.cs: Full registation here.
17827 2001-12-11 Miguel de Icaza <miguel@ximian.com>
17829 * expression.cs: Remove reducer for binary expressions, it can not
17832 * const.cs: Put here the code that used to go into constant.cs
17834 * constant.cs: Put here the code for constants, this is a new base
17835 class for Literals.
17837 * literal.cs: Make Literal derive from Constant.
17839 2001-12-09 Miguel de Icaza <miguel@ximian.com>
17841 * statement.cs (Return.Emit): Report error 157 if the user
17842 attempts to return from a finally block.
17844 (Return.Emit): Instead of emitting a return, jump to the end of
17847 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17848 LocalBuilder to store the result of the function. ReturnLabel is
17849 the target where we jump.
17852 2001-12-09 Radek Doulik <rodo@ximian.com>
17854 * cs-parser.jay: remember alias in current namespace
17856 * ecore.cs (SimpleName::DoResolve): use aliases for types or
17859 * class.cs (LookupAlias): lookup alias in my_namespace
17861 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17863 (LookupAlias): lookup alias in this and if needed in parent
17866 2001-12-08 Miguel de Icaza <miguel@ximian.com>
17870 * rootcontext.cs: (ModuleBuilder) Made static, first step into
17871 making things static. I need this to avoid passing the
17872 TypeContainer when calling ParameterType.
17874 * support.cs (InternalParameters.ParameterType): Remove ugly hack
17875 that did string manipulation to compute the type and then call
17876 GetType. Use Parameter.ParameterType instead.
17878 * cs-tokenizer.cs: Consume the suffix for floating values.
17880 * expression.cs (ParameterReference): figure out whether this is a
17881 reference parameter or not. Kill an extra variable by computing
17882 the arg_idx during emission.
17884 * parameter.cs (Parameters.GetParameterInfo): New overloaded
17885 function that returns whether a parameter is an out/ref value or not.
17887 (Parameter.ParameterType): The type of the parameter (base,
17888 without ref/out applied).
17890 (Parameter.Resolve): Perform resolution here.
17891 (Parameter.ExternalType): The full type (with ref/out applied).
17893 * statement.cs (Using.Emit, Using.EmitExpression): Implement
17894 support for expressions on the using statement.
17896 2001-12-07 Miguel de Icaza <miguel@ximian.com>
17898 * statement.cs (Using.EmitLocalVariableDecls): Split the
17899 localvariable handling of the using statement.
17901 (Block.EmitMeta): Keep track of variable count across blocks. We
17902 were reusing slots on separate branches of blocks.
17904 (Try.Emit): Emit the general code block, we were not emitting it.
17906 Check the type of the declaration to be an IDisposable or
17907 something that can be implicity converted to it.
17909 Emit conversions if required.
17911 * ecore.cs (EmptyExpression): New utility class.
17912 (Expression.ImplicitConversionExists): New utility function.
17914 2001-12-06 Miguel de Icaza <miguel@ximian.com>
17916 * statement.cs (Using): Implement.
17918 * expression.cs (LocalVariableReference): Support read only variables.
17920 * statement.cs: Remove the explicit emit for the Leave opcode.
17921 (VariableInfo): Add a readonly field.
17923 2001-12-05 Miguel de Icaza <miguel@ximian.com>
17925 * ecore.cs (ConvCast): new class used to encapsulate the various
17926 explicit integer conversions that works in both checked and
17927 unchecked contexts.
17929 (Expression.ConvertNumericExplicit): Use new ConvCast class to
17930 properly generate the overflow opcodes.
17932 2001-12-04 Miguel de Icaza <miguel@ximian.com>
17934 * statement.cs: The correct type for the EmptyExpression is the
17935 element_type, not the variable type. Ravi pointed this out.
17937 2001-12-04 Ravi Pratap <ravi@ximian.com>
17939 * class.cs (Method::Define): Handle PInvoke methods specially
17940 by using DefinePInvokeMethod instead of the usual one.
17942 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17943 above to do the task of extracting information and defining the method.
17945 2001-12-04 Ravi Pratap <ravi@ximian.com>
17947 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17948 of the condition for string type.
17950 (Emit): Move that here.
17952 (ArrayCreation::CheckIndices): Keep string literals in their expression
17955 (EmitDynamicInitializers): Handle strings appropriately.
17957 2001-12-04 Miguel de Icaza <miguel@ximian.com>
17959 * codegen.cs (EmitContext): Replace multiple variables with a
17960 single pointer to the current Switch statement.
17962 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17965 2001-12-03 Miguel de Icaza <miguel@ximian.com>
17969 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17972 (Foreach.Emit): Foreach on arrays was not setting
17973 up the loop variables (for break/continue).
17975 (GotoCase): Semi-implented.
17977 2001-12-03 Ravi Pratap <ravi@ximian.com>
17979 * attribute.cs (CheckAttribute): Handle system attributes by using
17980 Attribute.GetAttributes to examine information we need.
17982 (GetValidPlaces): Same here.
17984 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17986 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17988 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17990 (Method::Define): Set appropriate flags if we have a DllImport attribute.
17992 (Method::Emit): Handle the case when we are a PInvoke method.
17994 2001-12-03 Miguel de Icaza <miguel@ximian.com>
17996 * expression.cs: Use ResolveWithSimpleName on compound names.
17998 2001-12-02 Ravi Pratap <ravi@ximian.com>
18000 * constant.cs (EmitConstant): Make sure we resolve the associated expression
18001 before trying to reduce it.
18003 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18005 * constant.cs (LookupConstantValue): Implement.
18007 (EmitConstant): Use the above in emitting the constant.
18009 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18010 that are user-defined by doing a LookupConstantValue on them.
18012 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18015 2001-11-29 Miguel de Icaza <miguel@ximian.com>
18017 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18019 (BaseAccess.DoResolve): Implement.
18021 (MemberAccess.DoResolve): Split this routine into a
18022 ResolveMemberAccess routine that can be used independently
18024 2001-11-28 Miguel de Icaza <miguel@ximian.com>
18026 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18027 As that share bits of the implementation. Is returns a boolean,
18028 while As returns the Type that is being probed.
18030 2001-12-01 Ravi Pratap <ravi@ximian.com>
18032 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18033 instead of a Literal - much easier.
18035 (EnumInTransit): Remove - utterly useless :-)
18037 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18039 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18041 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18042 chain when we have no associated expression.
18044 2001-11-30 Ravi Pratap <ravi@ximian.com>
18046 * constant.cs (Define): Use Location while reporting the errror.
18048 Also emit a warning when 'new' is used and there is no inherited
18051 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
18054 (LookupEnumValue): Implement to lookup an enum member's value and define it
18057 (Populate): Re-write accordingly to use the above routine.
18059 2001-11-27 Miguel de Icaza <miguel@ximian.com>
18061 * expression.cs (This): Fix prototype for DoResolveLValue to
18062 override the base class DoResolveLValue.
18064 * cs-parser.cs: Report errors cs574 and cs575 (destructor
18067 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18068 (we need to load the address of the field here). This fixes
18071 (FieldExpr.DoResolveLValue): Call the DoResolve
18072 function to initialize the Instance expression.
18074 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18075 correctly the GetEnumerator operation on a value type.
18077 * cs-parser.jay: Add more simple parsing error catches.
18079 * statement.cs (Switch): Add support for string switches.
18080 Handle null specially.
18082 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
18084 2001-11-28 Ravi Pratap <ravi@ximian.com>
18086 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18088 (declare_local_constant): New helper function.
18090 * statement.cs (AddConstant): Keep a separate record of constants
18092 (IsConstant): Implement to determine if a variable is a constant.
18094 (GetConstantExpression): Implement.
18096 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18098 * statement.cs (IsVariableDefined): Re-write.
18100 2001-11-27 Ravi Pratap <ravi@ximian.com>
18102 * class.cs (TypeContainer::FindMembers): Look for constants
18103 in the case when we are looking for MemberTypes.Field
18105 * expression.cs (MemberAccess::DoResolve): Check that in the
18106 case we are a FieldExpr and a Literal, we are not being accessed
18107 by an instance reference.
18109 * cs-parser.jay (local_constant_declaration): Implement.
18111 (declaration_statement): Implement for constant declarations.
18113 2001-11-26 Miguel de Icaza <miguel@ximian.com>
18115 * statement.cs (Switch): Catch double defaults.
18117 (Switch): More work on the switch() statement
18118 implementation. It works for integral values now, need to finish
18122 2001-11-24 Miguel de Icaza <miguel@ximian.com>
18124 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18125 integer literals into other integer literals. To be used by
18128 2001-11-24 Ravi Pratap <ravi@ximian.com>
18130 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18133 (EmitDynamicInitializers): Cope with the above since we extract data
18134 directly from ArrayData now.
18136 (ExpectInitializers): Keep track of whether initializers are mandatory
18139 (Bounds): Make it a hashtable to prevent the same dimension being
18140 recorded for every element in that dimension.
18142 (EmitDynamicInitializers): Fix bug which prevented the Set array method
18145 Also fix bug which was causing the indices to be emitted in the reverse
18148 2001-11-24 Miguel de Icaza <miguel@ximian.com>
18150 * expression.cs (ArrayCreation): Implement the bits that Ravi left
18151 unfinished. They do not work, because the underlying code is
18154 2001-11-22 Miguel de Icaza <miguel@ximian.com>
18156 * cs-parser.jay: Remove bogus fixme.
18158 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18159 on Switch statement.
18161 2001-11-23 Ravi Pratap <ravi@ximian.com>
18163 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18166 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18167 parameter. Apparently, any expression is allowed.
18169 (ValidateInitializers): Update accordingly.
18171 (CheckIndices): Fix some tricky bugs thanks to recursion.
18173 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
18174 I was being completely brain-dead.
18176 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18177 and re-write acordingly.
18179 (DelegateInvocation): Re-write accordingly.
18181 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18183 (MakeByteBlob): Handle types more correctly.
18185 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18186 initialization from expressions but it is incomplete because I am a complete
18189 2001-11-22 Miguel de Icaza <miguel@ximian.com>
18191 * statement.cs (If.Emit): Fix a bug that generated incorrect code
18192 on If. Basically, we have to return `true' (ie, we do return to
18193 our caller) only if both branches of the if return.
18195 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18196 short-circuit operators, handle them as short circuit operators.
18198 (Cast.DoResolve): Resolve type.
18199 (Cast.Cast): Take an expression as the target type.
18201 * cs-parser.jay (cast_expression): Remove old hack that only
18202 allowed a limited set of types to be handled. Now we take a
18203 unary_expression and we resolve to a type during semantic
18206 Use the grammar productions from Rhys to handle casts (this is
18207 not complete like Rhys syntax yet, we fail to handle that corner
18208 case that C# has regarding (-x), but we will get there.
18210 2001-11-22 Ravi Pratap <ravi@ximian.com>
18212 * class.cs (EmitFieldInitializer): Take care of the case when we have a
18213 field which is an array type.
18215 * cs-parser.jay (declare_local_variables): Support array initialization too.
18217 * typemanager.cs (MakeKey): Implement.
18219 (everywhere): Use the above appropriately.
18221 * cs-parser.jay (for_statement): Update for array initialization while
18222 declaring variables.
18224 * ecore.cs : The error message was correct, it's the variable's names that
18225 were misleading ;-) Make the code more readable.
18227 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18228 the correct type etc.
18230 (ConvertExplicit): Handle Enum types by examining the underlying type.
18232 2001-11-21 Ravi Pratap <ravi@ximian.com>
18234 * parameter.cs (GetCallingConvention): Always return
18235 CallingConventions.Standard for now.
18237 2001-11-22 Miguel de Icaza <miguel@ximian.com>
18239 * expression.cs (Binary.ResolveOperator): Update the values of `l'
18240 and `r' after calling DoNumericPromotions.
18242 * ecore.cs: Fix error message (the types were in the wrong order).
18244 * statement.cs (Foreach.ProbeCollectionType): Need to pass
18245 BindingFlags.Instance as well
18247 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18248 implicit int literal conversion in an empty cast so that we
18249 propagate the right type upstream.
18251 (UnboxCast): new class used to unbox value types.
18252 (Expression.ConvertExplicit): Add explicit type conversions done
18255 (Expression.ImplicitNumericConversion): Oops, forgot to test for
18256 the target type before applying the implicit LongLiterals to ULong
18259 2001-11-21 Miguel de Icaza <miguel@ximian.com>
18261 * cs-parser.jay (for_statement): Reworked the way For works: now
18262 we declare manually any variables that are introduced in
18263 for_initializer to solve the problem of having out-of-band code
18264 emition (that is what got for broken).
18266 (declaration_statement): Perform the actual variable declaration
18267 that used to be done in local_variable_declaration here.
18269 (local_variable_declaration): Do not declare anything, just pass
18270 the information on a DictionaryEntry
18272 2001-11-20 Ravi Pratap <ravi@ximian.com>
18274 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18275 re-write of the logic to now make it recursive.
18277 (UpdateIndices): Re-write accordingly.
18279 Store element data in a separate ArrayData list in the above methods.
18281 (MakeByteBlob): Implement to dump the array data into a byte array.
18283 2001-11-19 Ravi Pratap <ravi@ximian.com>
18285 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18288 * constant.cs (Define): Implement.
18290 (EmitConstant): Re-write fully.
18292 Pass in location info.
18294 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18297 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18298 DictionaryEntry since we need location info too.
18300 (constant_declaration): Update accordingly.
18302 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18303 code into another method : UpdateIndices.
18305 2001-11-18 Ravi Pratap <ravi@ximian.com>
18307 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18308 some type checking etc.
18310 2001-11-17 Ravi Pratap <ravi@ximian.com>
18312 * expression.cs (ArrayCreation::ValidateInitializers): Implement
18313 bits to provide dimension info if the user skips doing that.
18315 Update second constructor to store the rank correctly.
18317 2001-11-16 Ravi Pratap <ravi@ximian.com>
18319 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18320 and try to implement.
18322 * ../errors/cs0150.cs : Add.
18324 * ../errors/cs0178.cs : Add.
18326 2001-11-16 Miguel de Icaza <miguel@ximian.com>
18328 * statement.cs: Implement foreach on multi-dimensional arrays.
18330 * parameter.cs (Parameters.GetParameterByName): Also lookup the
18331 name of the params argument.
18333 * expression.cs: Use EmitStoreOpcode to get the right opcode while
18334 initializing the array.
18336 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18337 we can use this elsewhere.
18339 * statement.cs: Finish implementation of foreach for single
18342 * cs-parser.jay: Use an out-of-band stack to pass information
18343 around, I wonder why I need this.
18345 foreach_block: Make the new foreach_block the current_block.
18347 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18348 function used to return a static Parameters structure. Used for
18349 empty parameters, as those are created very frequently.
18351 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18353 2001-11-15 Ravi Pratap <ravi@ximian.com>
18355 * interface.cs : Default modifier is private, not public. The
18356 make verify test passes again.
18358 2001-11-15 Ravi Pratap <ravi@ximian.com>
18360 * support.cs (ReflectionParameters): Fix logic to determine
18361 whether the last parameter is a params one. Test 9 passes again.
18363 * delegate.cs (Populate): Register the builders we define with
18364 RegisterParameterForBuilder. Test 19 passes again.
18366 * cs-parser.jay (property_declaration): Reference $6 instead
18367 of $$ to get at the location.
18369 (indexer_declaration): Similar stuff.
18371 (attribute): Ditto.
18373 * class.cs (Property): Register parameters for the Get and Set methods
18374 if they exist. Test 23 passes again.
18376 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18377 call to EmitArguments as we are sure there aren't any params arguments.
18378 Test 32 passes again.
18380 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18381 IndexOutOfRangeException.
18383 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18384 Test 33 now passes again.
18386 2001-11-15 Miguel de Icaza <miguel@ximian.com>
18388 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18389 broke a bunch of things. Will have to come up with a better way
18390 of tracking locations.
18392 * statement.cs: Implemented foreach for single dimension arrays.
18394 2001-11-09 Miguel de Icaza <miguel@ximian.com>
18396 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18397 an error. This removes the lookup from the critical path.
18399 * cs-parser.jay: Removed use of temporary_loc, which is completely
18402 2001-11-14 Miguel de Icaza <miguel@ximian.com>
18404 * support.cs (ReflectionParameters.ParameterModifier): Report
18405 whether the argument is a PARAMS argument or not.
18407 * class.cs: Set the attribute `ParamArrayAttribute' on the
18408 parameter argument.
18410 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18411 and cons_param_array_attribute (ConstructorInfo for
18412 ParamArrayAttribute).,
18414 * codegen.cs: Emit the return using the `Return' statement, that
18415 way we can report the error correctly for missing return values.
18417 * class.cs (Method.Emit): Clean up.
18419 * expression.cs (Argument.Resolve): Take another argument: the
18420 location where this argument is used. Notice that this is not
18421 part of the "Argument" class as to reduce the size of the
18422 structure (we know the approximate location anyways).
18424 Test if the argument is a variable-reference, if not, then
18425 complain with a 206.
18427 (Argument.Emit): Emit addresses of variables.
18429 (Argument.FullDesc): Simplify.
18431 (Invocation.DoResolve): Update for Argument.Resolve.
18433 (ElementAccess.DoResolve): ditto.
18435 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18436 method should be virtual, as this method is always virtual.
18438 (NewDelegate.DoResolve): Update for Argument.Resolve.
18440 * class.cs (ConstructorInitializer.DoResolve): ditto.
18442 * attribute.cs (Attribute.Resolve): ditto.
18444 2001-11-13 Miguel de Icaza <miguel@ximian.com>
18446 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18448 * expression.cs (ParameterReference): Drop IStackStorage and implement
18449 IAssignMethod instead.
18451 (LocalVariableReference): ditto.
18453 * ecore.cs (FieldExpr): Drop IStackStorage and implement
18454 IAssignMethod instead.
18456 2001-11-13 Miguel de Icaza <miguel@ximian.com>
18458 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18459 enumerations that are used in heavily used structures derive from
18460 byte in a laughable and pathetic attempt to reduce memory usage.
18461 This is the kind of pre-optimzations that you should not do at
18462 home without adult supervision.
18464 * expression.cs (UnaryMutator): New class, used to handle ++ and
18465 -- separatedly from the other unary operators. Cleans up the
18466 code, and kills the ExpressionStatement dependency in Unary.
18468 (Unary): Removed `method' and `Arguments' from this class, making
18469 it smaller, and moving it all to SimpleCall, so I can reuse this
18470 code in other locations and avoid creating a lot of transient data
18471 strucutres when not required.
18473 * cs-parser.jay: Adjust for new changes.
18475 2001-11-11 Miguel de Icaza <miguel@ximian.com>
18477 * enum.cs (Enum.Populate): If there is a failure during
18480 * cs-parser.jay (opt_enum_base): we used to catch type errors
18481 here, but this is really incorrect. The type error should be
18482 catched during semantic analysis.
18484 2001-12-11 Ravi Pratap <ravi@ximian.com>
18486 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18487 current_local_parameters as expected since I, in my stupidity, had forgotten
18490 * attribute.cs (GetValidPlaces): Fix stupid bug.
18492 * class.cs (Method::Emit): Perform check on applicability of attributes.
18494 (Constructor::Emit): Ditto.
18496 (Field::Emit): Ditto.
18498 (Field.Location): Store location information.
18500 (Property, Event, Indexer, Operator): Ditto.
18502 * cs-parser.jay (field_declaration): Pass in location for each field.
18504 * ../errors/cs0592.cs : Add.
18506 2001-11-12 Ravi Pratap <ravi@ximian.com>
18508 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18510 (InitCoreTypes): Update accordingly.
18512 (RegisterAttrType, LookupAttr): Implement.
18514 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18515 info about the same.
18517 (Resolve): Update to populate the above as necessary.
18519 (Error592): Helper.
18521 (GetValidPlaces): Helper to the above.
18523 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18525 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18527 2001-11-12 Ravi Pratap <ravi@ximian.com>
18529 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18531 * ../errors/cs0617.cs : Add.
18533 2001-11-11 Ravi Pratap <ravi@ximian.com>
18535 * enum.cs (Emit): Rename to Populate to be more consistent with what
18536 we expect it to do and when exactly it is called.
18538 * class.cs, rootcontext.cs : Update accordingly.
18540 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18541 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18543 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18545 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18546 of a fieldinfo using the above, when dealing with a FieldBuilder.
18548 2001-11-10 Ravi Pratap <ravi@ximian.com>
18550 * ../errors/cs0031.cs : Add.
18552 * ../errors/cs1008.cs : Add.
18554 * ../errrors/cs0543.cs : Add.
18556 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18559 (FindMembers): Implement.
18561 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18562 enums and delegates too.
18564 (enum_types): Rename to builder_to_enum.
18566 (delegate_types): Rename to builder_to_delegate.
18568 * delegate.cs (FindMembers): Implement.
18570 2001-11-09 Ravi Pratap <ravi@ximian.com>
18572 * typemanager.cs (IsEnumType): Implement.
18574 * enum.cs (Emit): Re-write parts to account for the underlying type
18575 better and perform checking etc.
18577 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18578 of the underlying type.
18580 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18583 * enum.cs (error31): Helper to report error #31.
18585 * cs-parser.jay (enum_declaration): Store location of each member too.
18587 * enum.cs (member_to_location): New hashtable.
18589 (AddEnumMember): Update location hashtable.
18591 (Emit): Use the location of each member while reporting errors.
18593 2001-11-09 Miguel de Icaza <miguel@ximian.com>
18595 * cs-parser.jay: A for_initializer if is a
18596 local_variable_declaration really ammount to have an implicit
18597 block with the variable declaration and no initializer for for.
18599 * statement.cs (For.Emit): Cope with null initializers.
18601 This fixes the infinite loop on for initializers.
18603 2001-11-08 Miguel de Icaza <miguel@ximian.com>
18605 * enum.cs: More cleanup.
18607 * ecore.cs: Remove dead code.
18609 * class.cs (Property.Emit): More simplification.
18610 (Event.Emit): ditto.
18612 Reworked to have less levels of indentation.
18614 2001-11-08 Ravi Pratap <ravi@ximian.com>
18616 * class.cs (Property): Emit attributes.
18626 * enum.cs (Emit): Ditto.
18628 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18631 * class.cs (Field, Event, etc.): Move attribute generation into the
18632 Emit method everywhere.
18634 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18635 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18636 as we had no way of defining nested enums !
18638 * rootcontext.cs : Adjust code accordingly.
18640 * typemanager.cs (AddEnumType): To keep track of enum types separately.
18642 2001-11-07 Ravi Pratap <ravi@ximian.com>
18644 * expression.cs (EvalConstantExpression): Move into ecore.cs
18646 * enum.cs (Enum): Rename some members and make them public and readonly
18647 according to our convention.
18649 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18652 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18654 (Enum::Emit): Write a simple version for now which doesn't try to compute
18655 expressions. I shall modify this to be more robust in just a while.
18657 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18659 (TypeContainer::CloseType): Create the Enum types too.
18661 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18663 * expression.cs (EvalConstantExpression): Get rid of completely.
18665 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18666 user-defined values and other cases.
18668 (IsValidEnumLiteral): Helper function.
18670 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
18671 out there in the case we had a literal FieldExpr.
18673 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18675 (Literalize): Revamp a bit to take two arguments.
18677 (EnumLiteral): New class which derives from Literal to wrap enum literals.
18679 2001-11-06 Ravi Pratap <ravi@ximian.com>
18681 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18683 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18685 (Resolve): Use the above to ensure we have proper initializers.
18687 2001-11-05 Ravi Pratap <ravi@ximian.com>
18689 * expression.cs (Expression::EvalConstantExpression): New method to
18690 evaluate constant expressions.
18692 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18694 2001-11-07 Miguel de Icaza <miguel@ximian.com>
18696 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18699 (Binary.ResolveOperator): Handle operator != (object a, object b)
18700 and operator == (object a, object b);
18702 (Binary.DoNumericPromotions): Indicate whether the numeric
18703 promotion was possible.
18705 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18708 Made the ArrayAccess implement interface IAssignMethod instead of
18709 IStackStore as the order in which arguments are passed reflects
18712 * assign.cs: Instead of using expr.ExprClass to select the way of
18713 assinging, probe for the IStackStore/IAssignMethod interfaces.
18715 * typemanager.cs: Load InitializeArray definition.
18717 * rootcontext.cs (RootContext.MakeStaticData): Used to define
18718 static data that can be used to initialize arrays.
18720 2001-11-05 Miguel de Icaza <miguel@ximian.com>
18722 * expression.cs: Handle operator== and operator!= for booleans.
18724 (Conditioal.Reduce): Implement reducer for the ?: operator.
18726 (Conditional.Resolve): Implement dead code elimination.
18728 (Binary.Resolve): Catch string literals and return a new
18729 concatenated string.
18731 (Unary.Reduce): Implement reduction of unary expressions.
18733 * ecore.cs: Split out the expression core handling here.
18735 (Expression.Reduce): New method used to perform constant folding
18736 and CSE. This is needed to support constant-expressions.
18738 * statement.cs (Statement.EmitBoolExpression): Pass true and false
18739 targets, and optimize for !x.
18741 2001-11-04 Ravi Pratap <ravi@ximian.com>
18743 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18744 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18745 set custom atttributes.
18747 * literal.cs (Literal::GetValue): New abstract method to return the actual
18748 value of the literal, cast as an object.
18750 (*Literal): Implement GetValue method.
18752 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18753 expressions to the arraylist but objects of type Argument.
18755 * class.cs (TypeContainer::Emit): Emit our attributes too.
18757 (Method::Emit, Constructor::Emit): Ditto.
18759 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18760 to be ignoring earlier.
18762 2001-11-03 Ravi Pratap <ravi@ximian.com>
18764 * attribute.cs (AttributeSection::Define): Implement to do the business
18765 of constructing a CustomAttributeBuilder.
18767 (Attribute): New trivial class. Increases readability of code.
18769 * cs-parser.jay : Update accordingly.
18771 (positional_argument_list, named_argument_list, named_argument): New rules
18773 (attribute_arguments): Use the above so that we are more correct.
18775 2001-11-02 Ravi Pratap <ravi@ximian.com>
18777 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18778 to perform all checks for a method with a params parameter.
18780 (Invocation::OverloadResolve): Update to use the above method and therefore
18781 cope correctly with params method invocations.
18783 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
18786 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18787 constructors in our parent too because we can't afford to miss out on
18790 * attribute.cs (AttributeSection): New name for the class Attribute
18792 Other trivial changes to improve readability.
18794 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18795 use the new class names.
18797 2001-11-01 Ravi Pratap <ravi@ximian.com>
18799 * class.cs (Method::Define): Complete definition for params types too
18801 (Indexer::Define): Ditto.
18803 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18804 Cope everywhere with a request for info about the array parameter.
18806 2001-11-01 Ravi Pratap <ravi@ximian.com>
18808 * tree.cs (RecordNamespace): Fix up to check for the correct key.
18810 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
18811 local_variable_type to extract the string corresponding to the type.
18813 (local_variable_type): Fixup the action to use the new helper method.
18815 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
18818 * expression.cs : Clean out code which uses the above.
18820 2001-10-31 Ravi Pratap <ravi@ximian.com>
18822 * typemanager.cs (RegisterMethod): Check if we already have an existing key
18823 and bale out if necessary by returning a false.
18825 (RegisterProperty): Ditto.
18827 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18828 and print out appropriate error messages.
18830 * interface.cs (everywhere): Ditto.
18832 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18833 location to constructor.
18835 * class.cs (Property, Event, Indexer): Update accordingly.
18837 * ../errors/cs111.cs : Added.
18839 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18840 of a method, as laid down by the spec.
18842 (Invocation::OverloadResolve): Use the above method.
18844 2001-10-31 Ravi Pratap <ravi@ximian.com>
18846 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18847 now take a TypeContainer and a Parameters object.
18849 (ParameterData): Modify return type of ParameterModifier method to be
18850 Parameter.Modifier and not a string.
18852 (ReflectionParameters, InternalParameters): Update accordingly.
18854 * expression.cs (Argument::GetParameterModifier): Same here.
18856 * support.cs (InternalParameters::ParameterType): Find a better way of determining
18857 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18858 symbol in it at all so maybe this is only for now.
18860 2001-10-30 Ravi Pratap <ravi@ximian.com>
18862 * support.cs (InternalParameters): Constructor now takes an extra argument
18863 which is the actual Parameters class.
18865 (ParameterDesc): Update to provide info on ref/out modifiers.
18867 * class.cs (everywhere): Update call to InternalParameters to pass in
18868 the second argument too.
18870 * support.cs (ParameterData): Add ParameterModifier, which is a method
18871 to return the modifier info [ref/out etc]
18873 (InternalParameters, ReflectionParameters): Implement the above.
18875 * expression.cs (Argument::ParameterModifier): Similar function to return
18876 info about the argument's modifiers.
18878 (Invocation::OverloadResolve): Update to take into account matching modifiers
18881 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18882 a new SetFormalParameters object which we pass to InternalParameters.
18884 2001-10-30 Ravi Pratap <ravi@ximian.com>
18886 * expression.cs (NewArray): Merge into the ArrayCreation class.
18888 2001-10-29 Ravi Pratap <ravi@ximian.com>
18890 * expression.cs (NewArray): Merge classes NewBuiltinArray and
18891 NewUserdefinedArray into one as there wasn't much of a use in having
18894 * expression.cs (Argument): Change field's name to ArgType from Type.
18896 (Type): New readonly property which returns the proper type, taking into
18897 account ref/out modifiers.
18899 (everywhere): Adjust code accordingly for the above.
18901 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18902 whether we are emitting for a ref or out parameter.
18904 * expression.cs (Argument::Emit): Use the above field to set the state.
18906 (LocalVariableReference::Emit): Update to honour the flag and emit the
18909 * parameter.cs (Attributes): Set the correct flags for ref parameters.
18911 * expression.cs (Argument::FullDesc): New function to provide a full desc.
18913 * support.cs (ParameterData): Add method ParameterDesc to the interface.
18915 (ReflectionParameters, InternalParameters): Implement the above method.
18917 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18920 (Invocation::FullMethodDesc): Ditto.
18922 2001-10-29 Miguel de Icaza <miguel@ximian.com>
18924 * cs-parser.jay: Add extra production for the second form of array
18927 * expression.cs (ArrayCreation): Update to reflect the above
18930 * Small changes to prepare for Array initialization.
18932 2001-10-28 Miguel de Icaza <miguel@ximian.com>
18934 * typemanager.cs (ImplementsInterface): interface might be null;
18935 Deal with this problem;
18937 Also, we do store negative hits on the cache (null values), so use
18938 this instead of calling t.GetInterfaces on the type everytime.
18940 2001-10-28 Ravi Pratap <ravi@ximian.com>
18942 * typemanager.cs (IsBuiltinType): New method to help determine the same.
18944 * expression.cs (New::DoResolve): Get rid of array creation code and instead
18945 split functionality out into different classes.
18947 (New::FormArrayType): Move into NewBuiltinArray.
18949 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18952 (NewBuiltinArray): New class to handle creation of built-in arrays.
18954 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18955 account creation of one-dimensional arrays.
18957 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18959 (NewUserdefinedArray::DoResolve): Implement.
18961 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18963 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18964 we maintain inside the TypeManager. This is necessary to perform lookups on the
18967 (LookupType): Update to perform GetType on the module builders too.
18969 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18971 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18973 2001-10-23 Ravi Pratap <ravi@ximian.com>
18975 * expression.cs (New::DoResolve): Implement guts of array creation.
18977 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18979 2001-10-27 Miguel de Icaza <miguel@ximian.com>
18981 * expression.cs: Fix bug I introduced lsat night that broke
18984 (Expression.Resolve): Report a 246 error (can not resolve name)
18985 if we find a SimpleName in the stream.
18987 (Expression.ResolveLValue): Ditto.
18989 (Expression.ResolveWithSimpleName): This function is a variant of
18990 ResolveName, this one allows SimpleNames to be returned without a
18991 warning. The only consumer of SimpleNames is MemberAccess
18993 2001-10-26 Miguel de Icaza <miguel@ximian.com>
18995 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18996 might arrive here. I have my doubts that this is correct.
18998 * statement.cs (Lock): Implement lock statement.
19000 * cs-parser.jay: Small fixes to support `lock' and `using'
19002 * cs-tokenizer.cs: Remove extra space
19004 * driver.cs: New flag --checked, allows to turn on integer math
19007 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19008 Threading.Monitor.Exit
19010 2001-10-23 Miguel de Icaza <miguel@ximian.com>
19012 * expression.cs (IndexerAccess::DoResolveLValue): Set the
19013 Expression Class to be IndexerAccess.
19015 Notice that Indexer::DoResolve sets the eclass to Value.
19017 2001-10-22 Miguel de Icaza <miguel@ximian.com>
19019 * class.cs (TypeContainer::Emit): Emit code for indexers.
19021 * assign.cs (IAssignMethod): New interface implemented by Indexers
19022 and Properties for handling assignment.
19024 (Assign::Emit): Simplify and reuse code.
19026 * expression.cs (IndexerAccess, PropertyExpr): Implement
19027 IAssignMethod, clean up old code.
19029 2001-10-22 Ravi Pratap <ravi@ximian.com>
19031 * typemanager.cs (ImplementsInterface): New method to determine if a type
19032 implements a given interface. Provides a nice cache too.
19034 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19037 (ConvertReferenceExplicit): Ditto.
19039 * delegate.cs (Delegate::Populate): Update to define the parameters on the
19040 various methods, with correct names etc.
19042 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
19043 Operator.UnaryNegation.
19045 * cs-parser.jay (operator_declarator): Be a little clever in the case where
19046 we have a unary plus or minus operator.
19048 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
19051 * everywhere : update accordingly.
19053 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19056 * class.cs (Method::Define): For the case where we are implementing a method
19057 inherited from an interface, we need to set the MethodAttributes.Final flag too.
19058 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19060 2001-10-21 Ravi Pratap <ravi@ximian.com>
19062 * interface.cs (FindMembers): Implement to work around S.R.E
19065 * typemanager.cs (IsInterfaceType): Implement.
19067 (FindMembers): Update to handle interface types too.
19069 * expression.cs (ImplicitReferenceConversion): Re-write bits which
19070 use IsAssignableFrom as that is not correct - it doesn't work.
19072 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19073 and accordingly override EmitStatement.
19075 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19076 using the correct logic :-)
19078 2001-10-19 Ravi Pratap <ravi@ximian.com>
19080 * ../errors/cs-11.cs : Add to demonstrate error -11
19082 2001-10-17 Miguel de Icaza <miguel@ximian.com>
19084 * assign.cs (Assign::Resolve): Resolve right hand side first, and
19085 then pass this as a hint to ResolveLValue.
19087 * expression.cs (FieldExpr): Add Location information
19089 (FieldExpr::LValueResolve): Report assignment to readonly
19092 (Expression::ExprClassFromMemberInfo): Pass location information.
19094 (Expression::ResolveLValue): Add new method that resolves an
19097 (Expression::DoResolveLValue): Default invocation calls
19100 (Indexers): New class used to keep track of indexers in a given
19103 (IStackStore): Renamed from LValue, as it did not really describe
19104 what this did. Also ResolveLValue is gone from this interface and
19105 now is part of Expression.
19107 (ElementAccess): Depending on the element access type
19109 * typemanager.cs: Add `indexer_name_type' as a Core type
19110 (System.Runtime.CompilerServices.IndexerNameAttribute)
19112 * statement.cs (Goto): Take a location.
19114 2001-10-18 Ravi Pratap <ravi@ximian.com>
19116 * delegate.cs (Delegate::VerifyDelegate): New method to verify
19117 if two delegates are compatible.
19119 (NewDelegate::DoResolve): Update to take care of the case when
19120 we instantiate a delegate from another delegate.
19122 * typemanager.cs (FindMembers): Don't even try to look up members
19123 of Delegate types for now.
19125 2001-10-18 Ravi Pratap <ravi@ximian.com>
19127 * delegate.cs (NewDelegate): New class to take care of delegate
19130 * expression.cs (New): Split the delegate related code out into
19131 the NewDelegate class.
19133 * delegate.cs (DelegateInvocation): New class to handle delegate
19136 * expression.cs (Invocation): Split out delegate related code into
19137 the DelegateInvocation class.
19139 2001-10-17 Ravi Pratap <ravi@ximian.com>
19141 * expression.cs (New::DoResolve): Implement delegate creation fully
19142 and according to the spec.
19144 (New::DoEmit): Update to handle delegates differently.
19146 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19147 because of which we were printing out arguments in reverse order !
19149 * delegate.cs (VerifyMethod): Implement to check if the given method
19150 matches the delegate.
19152 (FullDelegateDesc): Implement.
19154 (VerifyApplicability): Implement.
19156 * expression.cs (Invocation::DoResolve): Update to accordingly handle
19157 delegate invocations too.
19159 (Invocation::Emit): Ditto.
19161 * ../errors/cs1593.cs : Added.
19163 * ../errors/cs1594.cs : Added.
19165 * delegate.cs (InstanceExpression, TargetMethod): New properties.
19167 2001-10-16 Ravi Pratap <ravi@ximian.com>
19169 * typemanager.cs (intptr_type): Core type for System.IntPtr
19171 (InitCoreTypes): Update for the same.
19173 (iasyncresult_type, asynccallback_type): Ditto.
19175 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19178 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19181 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19182 the builders for the 4 members of a delegate type :-)
19184 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19187 * expression.cs (New::DoResolve): Implement guts for delegate creation.
19189 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19191 2001-10-15 Miguel de Icaza <miguel@ximian.com>
19193 * statement.cs (Break::Emit): Implement.
19194 (Continue::Emit): Implement.
19196 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
19197 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
19198 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
19199 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
19202 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19203 properties that track the label for the current loop (begin of the
19204 loop and end of the loop).
19206 2001-10-15 Ravi Pratap <ravi@ximian.com>
19208 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19209 use of emitting anything at all.
19211 * class.cs, rootcontext.cs : Get rid of calls to the same.
19213 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19215 (Populate): Define the constructor correctly and set the implementation
19218 * typemanager.cs (delegate_types): New hashtable to hold delegates that
19221 (AddDelegateType): Implement.
19223 (IsDelegateType): Implement helper method.
19225 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19227 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19228 and accordingly handle it.
19230 * delegate.cs (Populate): Take TypeContainer argument.
19231 Implement bits to define the Invoke method. However, I still haven't figured out
19232 how to take care of the native int bit :-(
19234 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
19235 Qualify the name of the delegate, not its return type !
19237 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19240 (StandardConversionExists): Checking for array types turns out to be recursive.
19242 (ConvertReferenceExplicit): Implement array conversion.
19244 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19246 2001-10-12 Ravi Pratap <ravi@ximian.com>
19248 * cs-parser.jay (delegate_declaration): Store the fully qualified
19249 name as it is a type declaration.
19251 * delegate.cs (ReturnType, Name): Rename members to these. Make them
19254 (DefineDelegate): Renamed from Define. Does the same thing essentially,
19255 as TypeContainer::DefineType.
19257 (Populate): Method in which all the definition of the various methods (Invoke)
19260 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19263 (CloseDelegate): Finally creates the delegate.
19265 * class.cs (TypeContainer::DefineType): Update to define delegates.
19266 (Populate, Emit and CloseType): Do the same thing here too.
19268 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19269 delegates in all these operations.
19271 2001-10-14 Miguel de Icaza <miguel@ximian.com>
19273 * expression.cs: LocalTemporary: a new expression used to
19274 reference a temporary that has been created.
19276 * assign.cs: Handle PropertyAccess back here, so that we can
19277 provide the proper semantic access to properties.
19279 * expression.cs (Expression::ConvertReferenceExplicit): Implement
19280 a few more explicit conversions.
19282 * modifiers.cs: `NEW' modifier maps to HideBySig.
19284 * expression.cs (PropertyExpr): Make this into an
19285 ExpressionStatement, and support the EmitStatement code path.
19287 Perform get/set error checking, clean up the interface.
19289 * assign.cs: recognize PropertyExprs as targets, and if so, turn
19290 them into toplevel access objects.
19292 2001-10-12 Miguel de Icaza <miguel@ximian.com>
19294 * expression.cs: PropertyExpr::PropertyExpr: use work around the
19297 * typemanager.cs: Keep track here of our PropertyBuilders again to
19298 work around lameness in SRE.
19300 2001-10-11 Miguel de Icaza <miguel@ximian.com>
19302 * expression.cs (LValue::LValueResolve): New method in the
19303 interface, used to perform a second resolution pass for LValues.
19305 (This::DoResolve): Catch the use of this in static methods.
19307 (This::LValueResolve): Implement.
19309 (This::Store): Remove warning, assigning to `this' in structures
19312 (Invocation::Emit): Deal with invocation of
19313 methods on value types. We need to pass the address to structure
19314 methods rather than the object itself. (The equivalent code to
19315 emit "this" for structures leaves the entire structure on the
19316 stack instead of a pointer to it).
19318 (ParameterReference::DoResolve): Compute the real index for the
19319 argument based on whether the method takes or not a `this' pointer
19320 (ie, the method is static).
19322 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19323 value types returned from functions when we need to invoke a
19324 method on the sturcture.
19327 2001-10-11 Ravi Pratap <ravi@ximian.com>
19329 * class.cs (TypeContainer::DefineType): Method to actually do the business of
19330 defining the type in the Modulebuilder or Typebuilder. This is to take
19331 care of nested types which need to be defined on the TypeBuilder using
19332 DefineNestedMethod.
19334 (TypeContainer::GetClassBases): Implement. Essentially the code from the
19335 methods in RootContext, only ported to be part of TypeContainer.
19337 (TypeContainer::GetInterfaceOrClass): Ditto.
19339 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19341 * interface.cs (Interface::DefineInterface): New method. Does exactly
19342 what RootContext.CreateInterface did earlier, only it takes care of nested types
19345 (Interface::GetInterfaces): Move from RootContext here and port.
19347 (Interface::GetInterfaceByName): Same here.
19349 * rootcontext.cs (ResolveTree): Re-write.
19351 (PopulateTypes): Re-write.
19353 * class.cs (TypeContainer::Populate): Populate nested types too.
19354 (TypeContainer::Emit): Emit nested members too.
19356 * typemanager.cs (AddUserType): Do not make use of the FullName property,
19357 instead just use the name argument passed in as it is already fully
19360 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19361 to TypeContainer mapping to see if a type is user-defined.
19363 * class.cs (TypeContainer::CloseType): Implement.
19365 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19366 the default constructor.
19368 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19371 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19373 * interface.cs (CloseType): Create the type here.
19375 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19378 Remove all the methods which are now in TypeContainer.
19380 2001-10-10 Ravi Pratap <ravi@ximian.com>
19382 * delegate.cs (Define): Re-write bits to define the delegate
19385 2001-10-10 Miguel de Icaza <miguel@ximian.com>
19387 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19389 * expression.cs (ImplicitReferenceConversion): handle null as well
19390 as a source to convert to any reference type.
19392 * statement.cs (Return): Perform any implicit conversions to
19393 expected return type.
19395 Validate use of return statement.
19397 * codegen.cs (EmitContext): Pass the expected return type here.
19399 * class.cs (Method, Constructor, Property): Pass expected return
19400 type to EmitContext.
19402 2001-10-09 Miguel de Icaza <miguel@ximian.com>
19404 * expression.cs: Make DoResolve take an EmitContext instead of a
19407 Replaced `l' and `location' for `loc', for consistency.
19409 (Error, Warning): Remove unneeded Tc argument.
19411 * assign.cs, literal.cs, constant.cs: Update to new calling
19414 * codegen.cs: EmitContext now contains a flag indicating whether
19415 code is being generated in a static method or not.
19417 * cs-parser.jay: DecomposeQI, new function that replaces the old
19418 QualifiedIdentifier. Now we always decompose the assembled
19419 strings from qualified_identifier productions into a group of
19422 2001-10-08 Miguel de Icaza <miguel@ximian.com>
19424 * rootcontext.cs: Deal with field-less struct types correctly now
19425 by passing the size option to Define Type.
19427 * class.cs: Removed hack that created one static field.
19429 2001-10-07 Miguel de Icaza <miguel@ximian.com>
19431 * statement.cs: Moved most of the code generation here.
19433 2001-10-09 Ravi Pratap <ravi@ximian.com>
19435 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19438 (ElementAccess): Remove useless bits for now - keep checks as the spec
19441 2001-10-08 Ravi Pratap <ravi@ximian.com>
19443 * expression.cs (ElementAccess::DoResolve): Remove my crap code
19444 and start performing checks according to the spec.
19446 2001-10-07 Ravi Pratap <ravi@ximian.com>
19448 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19449 rank_specifiers instead.
19451 (rank_specifiers): Change the order in which the rank specifiers are stored
19453 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19455 * expression.cs (ElementAccess): Implement the LValue interface too.
19457 2001-10-06 Ravi Pratap <ravi@ximian.com>
19459 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19460 except that user defined conversions are not included.
19462 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
19463 perform the conversion of the return type, if necessary.
19465 (New::DoResolve): Check whether we are creating an array or an object
19466 and accordingly do the needful.
19468 (New::Emit): Same here.
19470 (New::DoResolve): Implement guts of array creation.
19472 (New::FormLookupType): Helper function.
19474 2001-10-07 Miguel de Icaza <miguel@ximian.com>
19476 * codegen.cs: Removed most of the code generation here, and move the
19477 corresponding code generation bits to the statement classes.
19479 Added support for try/catch/finalize and throw.
19481 * cs-parser.jay: Added support for try/catch/finalize.
19483 * class.cs: Catch static methods having the flags override,
19484 virtual or abstract.
19486 * expression.cs (UserCast): This user cast was not really doing
19487 what it was supposed to do. Which is to be born in fully resolved
19488 state. Parts of the resolution were being performed at Emit time!
19492 2001-10-05 Miguel de Icaza <miguel@ximian.com>
19494 * expression.cs: Implicity convert the result from UserCast.
19496 2001-10-05 Ravi Pratap <ravi@ximian.com>
19498 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19499 prevented it from working correctly.
19501 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19502 merely ConvertImplicit.
19504 2001-10-05 Miguel de Icaza <miguel@ximian.com>
19506 * typemanager.cs: Make the LookupTypeContainer function static,
19507 and not per-instance.
19509 * class.cs: Make static FindMembers (the one that takes a Type
19512 * codegen.cs: Add EmitForeach here.
19514 * cs-parser.jay: Make foreach a toplevel object instead of the
19515 inline expansion, as we need to perform semantic analysis on it.
19517 2001-10-05 Ravi Pratap <ravi@ximian.com>
19519 * expression.cs (Expression::ImplicitUserConversion): Rename to
19520 UserDefinedConversion.
19522 (Expression::UserDefinedConversion): Take an extra argument specifying
19523 whether we look for explicit user conversions too.
19525 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19527 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19529 (ExplicitUserConversion): Make it a call to UserDefinedConversion
19530 with the appropriate arguments.
19532 * cs-parser.jay (cast_expression): Record location too.
19534 * expression.cs (Cast): Record location info.
19536 (Expression::ConvertExplicit): Take location argument.
19538 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19539 to determine if we are doing explicit conversions.
19541 (UserCast::Emit): Update accordingly.
19543 (Expression::ConvertExplicit): Report an error if everything fails.
19545 * ../errors/cs0030.cs : Add.
19547 2001-10-04 Miguel de Icaza <miguel@ximian.com>
19549 * modifiers.cs: If the ABSTRACT keyword is present, also set the
19550 virtual and newslot bits.
19552 * class.cs (TypeContainer::RegisterRequiredImplementations):
19553 Record methods we need.
19555 (TypeContainer::MakeKey): Helper function to make keys for
19556 MethodBases, since the Methodbase key is useless.
19558 (TypeContainer::Populate): Call RegisterRequiredImplementations
19559 before defining the methods.
19561 Create a mapping for method_builders_to_methods ahead of time
19562 instead of inside a tight loop.
19564 (::RequireMethods): Accept an object as the data to set into the
19565 hashtable so we can report interface vs abstract method mismatch.
19567 2001-10-03 Miguel de Icaza <miguel@ximian.com>
19569 * report.cs: Make all of it static.
19571 * rootcontext.cs: Drop object_type and value_type computations, as
19572 we have those in the TypeManager anyways.
19574 Drop report instance variable too, now it is a global.
19576 * driver.cs: Use try/catch on command line handling.
19578 Add --probe option to debug the error reporting system with a test
19581 * report.cs: Add support for exiting program when a probe
19582 condition is reached.
19584 2001-10-03 Ravi Pratap <ravi@ximian.com>
19586 * expression.cs (Binary::DoNumericPromotions): Fix the case when
19587 we do a forcible conversion regardless of type, to check if
19588 ForceConversion returns a null.
19590 (Binary::error19): Use location to report error.
19592 (Unary::error23): Use location here too.
19594 * ../errors/cs0019.cs : Check in.
19596 * ../errors/cs0023.cs : Check in.
19598 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19599 case of a non-null MethodInfo object with a length of 0 !
19601 (Binary::ResolveOperator): Flag error if overload resolution fails to find
19602 an applicable member - according to the spec :-)
19603 Also fix logic to find members in base types.
19605 (Unary::ResolveOperator): Same here.
19607 (Unary::report23): Change name to error23 and make first argument a TypeContainer
19608 as I was getting thoroughly confused between this and error19 :-)
19610 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19611 (::FindMostEncompassedType): Implement.
19612 (::FindMostEncompassingType): Implement.
19613 (::StandardConversionExists): Implement.
19615 (UserImplicitCast): Re-vamp. We now need info about most specific
19616 source and target types so that we can do the necessary conversions.
19618 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19619 mathematical union with no duplicates.
19621 2001-10-03 Miguel de Icaza <miguel@ximian.com>
19623 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19624 in order from base classes to child classes, so that we can in
19625 child classes look up in our parent for method names and
19626 attributes (required for handling abstract, virtual, new, override
19627 constructs: we need to instrospect our base class, and if we dont
19628 populate the classes in order, the introspection might be
19629 incorrect. For example, a method could query its parent before
19630 the parent has any methods and would determine that the parent has
19631 no abstract methods (while it could have had them)).
19633 (RootContext::CreateType): Record the order in which we define the
19636 2001-10-02 Miguel de Icaza <miguel@ximian.com>
19638 * class.cs (TypeContainer::Populate): Also method definitions can
19639 fail now, keep track of this.
19641 (TypeContainer::FindMembers): Implement support for
19642 DeclaredOnly/noDeclaredOnly flag.
19644 (Constructor::Emit) Return the ConstructorBuilder.
19646 (Method::Emit) Return the MethodBuilder.
19647 Check for abstract or virtual methods to be public.
19649 * rootcontext.cs (RootContext::CreateType): Register all the
19650 abstract methods required for the class to be complete and the
19651 interface methods that must be implemented.
19653 * cs-parser.jay: Report error 501 (method requires body if it is
19654 not marked abstract or extern).
19656 * expression.cs (TypeOf::Emit): Implement.
19658 * typemanager.cs: runtime_handle_type, new global type.
19660 * class.cs (Property::Emit): Generate code for properties.
19662 2001-10-02 Ravi Pratap <ravi@ximian.com>
19664 * expression.cs (Unary::ResolveOperator): Find operators on base type
19665 too - we now conform exactly to the spec.
19667 (Binary::ResolveOperator): Same here.
19669 * class.cs (Operator::Define): Fix minor quirk in the tests.
19671 * ../errors/cs0215.cs : Added.
19673 * ../errors/cs0556.cs : Added.
19675 * ../errors/cs0555.cs : Added.
19677 2001-10-01 Miguel de Icaza <miguel@ximian.com>
19679 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19680 single integer which is really efficient
19682 2001-10-01 Ravi Pratap <ravi@ximian.com>
19684 * expression.cs (Expression::ImplicitUserConversion): Use location
19685 even in the case when we are examining True operators.
19687 * class.cs (Operator::Define): Perform extensive checks to conform
19688 with the rules for operator overloading in the spec.
19690 * expression.cs (Expression::ImplicitReferenceConversion): Implement
19691 some of the other conversions mentioned in the spec.
19693 * typemanager.cs (array_type): New static member for the System.Array built-in
19696 (cloneable_interface): For System.ICloneable interface.
19698 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19699 we start resolving the tree and populating types.
19701 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19703 2001-10-01 Miguel de Icaza <miguel@ximian.com>
19705 * expression.cs (Expression::ExprClassFromMemberInfo,
19706 Expression::Literalize): Create literal expressions from
19707 FieldInfos which are literals.
19709 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19710 type casts, because they were wrong. The test suite in tests
19713 (ImplicitNumericConversion): ushort to ulong requires a widening
19716 Int32 constant to long requires widening cast as well.
19718 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19719 for integers because the type on the stack is not i4.
19721 2001-09-30 Miguel de Icaza <miguel@ximian.com>
19723 * expression.cs (report118): require location argument.
19725 * parameter.cs: Do not dereference potential null value.
19727 * class.cs: Catch methods that lack the `new' keyword when
19728 overriding a name. Report warnings when `new' is used without
19729 anything being there to override.
19731 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19733 * class.cs: Only add constructor to hashtable if it is non-null
19734 (as now constructors can fail on define).
19736 (TypeManager, Class, Struct): Take location arguments.
19738 Catch field instance initialization in structs as errors.
19740 accepting_filter: a new filter for FindMembers that is static so
19741 that we dont create an instance per invocation.
19743 (Constructor::Define): Catch errors where a struct constructor is
19746 * cs-parser.jay: Pass location information for various new
19749 * delegate.cs (Delegate): take a location argument.
19751 * driver.cs: Do not call EmitCode if there were problesm in the
19752 Definition of the types, as many Builders wont be there.
19754 * decl.cs (Decl::Decl): Require a location argument.
19756 * cs-tokenizer.cs: Handle properly hex constants that can not fit
19757 into integers, and find the most appropiate integer for it.
19759 * literal.cs: Implement ULongLiteral.
19761 * rootcontext.cs: Provide better information about the location of
19762 failure when CreateType fails.
19764 2001-09-29 Miguel de Icaza <miguel@ximian.com>
19766 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19769 * expression.cs (Binary::CheckShiftArguments): Add missing type
19771 (Binary::ResolveOperator): Add type to the logical and and logical
19772 or, Bitwise And/Or and Exclusive Or code paths, it was missing
19775 (Binary::DoNumericPromotions): In the case where either argument
19776 is ulong (and most signed types combined with ulong cause an
19777 error) perform implicit integer constant conversions as well.
19779 2001-09-28 Miguel de Icaza <miguel@ximian.com>
19781 * expression.cs (UserImplicitCast): Method should always be
19783 (Invocation::BetterConversion): Simplified test for IntLiteral.
19785 (Expression::ImplicitNumericConversion): Split this routine out.
19786 Put the code that performs implicit constant integer conversions
19789 (Expression::Resolve): Become a wrapper around DoResolve so we can
19790 check eclass and type being set after resolve.
19792 (Invocation::Badness): Remove this dead function
19794 (Binary::ResolveOperator): Do not compute the expensive argumnets
19795 unless we have a union for it.
19797 (Probe::Emit): Is needs to do an isinst and then
19798 compare against null.
19800 (::CanConvert): Added Location argument. If the Location argument
19801 is null (Location.Null), then we do not report errors. This is
19802 used by the `probe' mechanism of the Explicit conversion. We do
19803 not want to generate an error for something that the user
19804 explicitly requested to be casted. But the pipeline for an
19805 explicit cast first tests for potential implicit casts.
19807 So for now, if the Location is null, it means `Probe only' to
19808 avoid adding another argument. Might have to revise this
19811 (ClassCast): New class used to type cast objects into arbitrary
19812 classes (used in Explicit Reference Conversions).
19814 Implement `as' as well.
19816 Reverted all the patches from Ravi below: they were broken:
19818 * The use of `level' as a mechanism to stop recursive
19819 invocations is wrong. That was there just to catch the
19820 bug with a strack trace but not as a way of addressing
19823 To fix the problem we have to *understand* what is going
19824 on and the interactions and come up with a plan, not
19825 just get things going.
19827 * The use of the type conversion cache that I proposed
19828 last night had an open topic: How does this work across
19829 protection domains. A user defined conversion might not
19830 be public in the location where we are applying the
19831 conversion, a different conversion might be selected
19832 (ie, private A->B (better) but public B->A (worse),
19833 inside A, A->B applies, but outside it, B->A will
19836 * On top of that (ie, even if the above is solved),
19837 conversions in a cache need to be abstract. Ie, `To
19838 convert from an Int to a Short use an OpcodeCast', not
19839 `To convert from an Int to a Short use the OpcodeCast on
19840 the variable 5' (which is what this patch was doing).
19842 2001-09-28 Ravi Pratap <ravi@ximian.com>
19844 * expression.cs (Invocation::ConversionExists): Re-write to use
19845 the conversion cache
19847 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19848 cache all conversions done, not just user-defined ones.
19850 (Invocation::BetterConversion): The real culprit. Use ConversionExists
19851 to determine if a conversion exists instead of acutually trying to
19852 perform the conversion. It's faster too.
19854 (Expression::ConvertExplicit): Modify to use ConversionExists to check
19855 and only then attempt the implicit conversion.
19857 2001-09-28 Ravi Pratap <ravi@ximian.com>
19859 * expression.cs (ConvertImplicit): Use a cache for conversions
19860 already found. Check level of recursion and bail out if necessary.
19862 2001-09-28 Miguel de Icaza <miguel@ximian.com>
19864 * typemanager.cs (string_concat_string_string, string_concat_object_object):
19865 Export standard methods that we expect for string operations.
19867 * statement.cs (Block::UsageWarning): Track usage of variables and
19868 report the errors for not used variables.
19870 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19873 2001-09-27 Miguel de Icaza <miguel@ximian.com>
19875 * codegen.cs: remove unnneded code
19877 * expression.cs: Removed BuiltinTypeAccess class
19879 Fix the order in which implicit conversions are
19882 The previous fixed dropped support for boxed conversions (adding a
19883 test to the test suite now)
19885 (UserImplicitCast::CanConvert): Remove test for source being null,
19886 that code is broken. We should not feed a null to begin with, if
19887 we do, then we should track the bug where the problem originates
19888 and not try to cover it up here.
19890 Return a resolved expression of type UserImplicitCast on success
19891 rather than true/false. Ravi: this is what I was talking about,
19892 the pattern is to use a static method as a "constructor" for
19895 Also, do not create arguments until the very last minute,
19896 otherwise we always create the arguments even for lookups that
19897 will never be performed.
19899 (UserImplicitCast::Resolve): Eliminate, objects of type
19900 UserImplicitCast are born in a fully resolved state.
19902 * typemanager.cs (InitCoreTypes): Init also value_type
19903 (System.ValueType).
19905 * expression.cs (Cast::Resolve): First resolve the child expression.
19907 (LValue): Add new method AddressOf to be used by
19910 Change the argument of Store to take an EmitContext instead of an
19911 ILGenerator, because things like FieldExpr need to be able to call
19912 their children expression to generate the instance code.
19914 (Expression::Error, Expression::Warning): Sugar functions for
19917 (Expression::MemberLookup): Accept a TypeContainer instead of a
19918 Report as the first argument.
19920 (Expression::ResolvePrimary): Killed. I still want to improve
19921 this as currently the code is just not right.
19923 (Expression::ResolveMemberAccess): Simplify, but it is still
19926 (Unary::Resolve): Catch errors in AddressOf operators.
19928 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19929 index to a byte for the short-version, or the compiler will choose
19930 the wrong Emit call, which generates the wrong data.
19932 (ParameterReference::Emit, ::Store): same.
19934 (FieldExpr::AddressOf): Implement.
19936 * typemanager.cs: TypeManager: made public variable instead of
19939 * driver.cs: document --fatal.
19941 * report.cs (ErrorMessage, WarningMessage): new names for the old
19942 Error and Warning classes.
19944 * cs-parser.jay (member_access): Turn built-in access to types
19945 into a normal simplename
19947 2001-09-27 Ravi Pratap <ravi@ximian.com>
19949 * expression.cs (Invocation::BetterConversion): Fix to cope
19950 with q being null, since this was introducing a bug.
19952 * expression.cs (ConvertImplicit): Do built-in conversions first.
19954 2001-09-27 Ravi Pratap <ravi@ximian.com>
19956 * expression.cs (UserImplicitCast::Resolve): Fix bug.
19958 2001-09-27 Ravi Pratap <ravi@ximian.com>
19960 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19961 I had introduced long ago (what's new ?).
19963 * expression.cs (UserImplicitCast::CanConvert): Static method to do
19964 the work of all the checking.
19965 (ConvertImplicit): Call CanConvert and only then create object if necessary.
19966 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19968 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19969 that is the right way.
19971 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
19972 overloading resolution. Use everywhere instead of cutting and pasting code.
19974 (Binary::ResolveOperator): Use MakeUnionSet.
19976 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
19977 we have to convert to bool types. Not complete yet.
19979 2001-09-27 Miguel de Icaza <miguel@ximian.com>
19981 * typemanager.cs (TypeManager::CSharpName): support ushort.
19983 * expression.cs (Expression::TryImplicitIntConversion): Attempts
19984 to provide an expression that performsn an implicit constant int
19985 conversion (section 6.1.6).
19986 (Expression::ConvertImplicitRequired): Reworked to include
19987 implicit constant expression conversions.
19989 (Expression::ConvertNumericExplicit): Finished.
19991 (Invocation::Emit): If InstanceExpression is null, then it means
19992 that we perform a call on this.
19994 2001-09-26 Miguel de Icaza <miguel@ximian.com>
19996 * expression.cs (Unary::Emit): Remove some dead code.
19997 (Probe): Implement Resolve and Emit for `is'.
19998 (Expression::ConvertImplicitRequired): Attempt to do constant
19999 expression conversions here. Maybe should be moved to
20000 ConvertImplicit, but I am not sure.
20001 (Expression::ImplicitLongConstantConversionPossible,
20002 Expression::ImplicitIntConstantConversionPossible): New functions
20003 that tell whether is it possible to apply an implicit constant
20004 expression conversion.
20006 (ConvertNumericExplicit): Started work on explicit numeric
20009 * cs-parser.jay: Update operator constants.
20011 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20012 (Parameters::GetSignature): Hook up VerifyArgs here.
20013 (Parameters::VerifyArgs): Verifies that no two arguments have the
20016 * class.cs (Operator): Update the operator names to reflect the
20017 ones that the spec expects (as we are just stringizing the
20020 * expression.cs (Unary::ResolveOperator): Fix bug: Use
20021 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20022 previous usage did only work for our methods.
20023 (Expression::ConvertImplicit): Handle decimal implicit numeric
20024 conversions as well.
20025 (Expression::InternalTypeConstructor): Used to invoke constructors
20026 on internal types for default promotions.
20028 (Unary::Emit): Implement special handling for the pre/post
20029 increment/decrement for overloaded operators, as they need to have
20030 the same semantics as the other operators.
20032 (Binary::ResolveOperator): ditto.
20033 (Invocation::ConversionExists): ditto.
20034 (UserImplicitCast::Resolve): ditto.
20036 2001-09-26 Ravi Pratap <ravi@ximian.com>
20038 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20039 operator, return after emitting body. Regression tests pass again !
20041 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20042 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20043 (Invocation::OverloadResolve): Ditto.
20044 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20046 * everywhere : update calls to the above methods accordingly.
20048 2001-09-26 Miguel de Icaza <miguel@ximian.com>
20050 * assign.cs (Assign): Make it inherit from ExpressionStatement.
20052 * expression.cs (ExpressionStatement): New base class used for
20053 expressions that can appear in statements, so that we can provide
20054 an alternate path to generate expression that do not leave a value
20057 (Expression::Emit, and all the derivatives): We no longer return
20058 whether a value is left on the stack or not. Every expression
20059 after being emitted leaves a single value on the stack.
20061 * codegen.cs (EmitContext::EmitStatementExpression): Use the
20062 facilties of ExpressionStatement if possible.
20064 * cs-parser.jay: Update statement_expression.
20066 2001-09-25 Miguel de Icaza <miguel@ximian.com>
20068 * driver.cs: Change the wording of message
20070 2001-09-25 Ravi Pratap <ravi@ximian.com>
20072 * expression.cs (Binary::ResolveOperator): Had forgottten to set
20073 the type of the expression to the return type of the method if
20074 we have an overloaded operator match ! The regression tests pass again !
20075 (Unary::ResolveOperator): Ditto.
20077 * expression.cs (Invocation::ConversionExists): Correct the member lookup
20078 to find "op_Implicit", not "implicit" ;-)
20079 (UserImplicitCast): New class to take care of user-defined implicit conversions.
20080 (ConvertImplicit, ForceConversion): Take TypeContainer argument
20082 * everywhere : Correct calls to the above accordingly.
20084 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20085 (ConvertImplicit): Do user-defined conversion if it exists.
20087 2001-09-24 Miguel de Icaza <miguel@ximian.com>
20089 * assign.cs: track location.
20090 (Resolve): Use implicit conversions on assignment.
20092 * literal.cs: Oops. Not good, Emit of short access values should
20093 pass (Bytes) or the wrong argument will be selected.
20095 * expression.cs (Unary::Emit): Emit code for -expr.
20097 (Unary::ResolveOperator): Handle `Substract' for non-constants
20098 (substract from zero from the non-constants).
20099 Deal with Doubles as well.
20101 (Expression::ConvertImplicitRequired): New routine that reports an
20102 error if no implicit conversion exists.
20104 (Invocation::OverloadResolve): Store the converted implicit
20105 expressions if we make them
20107 2001-09-24 Ravi Pratap <ravi@ximian.com>
20109 * class.cs (ConstructorInitializer): Take a Location argument.
20110 (ConstructorBaseInitializer): Same here.
20111 (ConstructorThisInitializer): Same here.
20113 * cs-parser.jay : Update all calls accordingly.
20115 * expression.cs (Unary, Binary, New): Take location argument.
20116 Update accordingly everywhere.
20118 * cs-parser.jay : Update all calls to the above to take a location
20121 * class.cs : Ditto.
20123 2001-09-24 Ravi Pratap <ravi@ximian.com>
20125 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20126 (Invocation::BetterConversion): Same here
20127 (Invocation::ConversionExists): Ditto.
20129 (Invocation::ConversionExists): Implement.
20131 2001-09-22 Ravi Pratap <ravi@ximian.com>
20133 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20134 Also take an additional TypeContainer argument.
20136 * All over : Pass in TypeContainer as argument to OverloadResolve.
20138 * typemanager.cs (CSharpName): Update to check for the string type and return
20141 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20144 2001-09-21 Ravi Pratap <ravi@ximian.com>
20146 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20147 (Invocation::BetterFunction): Implement.
20148 (Invocation::BetterConversion): Implement.
20149 (Invocation::ConversionExists): Skeleton, no implementation yet.
20151 Okay, things work fine !
20153 2001-09-21 Miguel de Icaza <miguel@ximian.com>
20155 * typemanager.cs: declare and load enum_type, delegate_type and
20158 * expression.cs (Expression::Emit): Now emit returns a value that
20159 tells whether a value is left on the stack or not. This strategy
20160 might be reveted tomorrow with a mechanism that would address
20161 multiple assignments.
20162 (Expression::report118): Utility routine to report mismatches on
20165 (Unary::Report23): Report impossible type/operator combination
20168 (Unary::IsIncrementableNumber): Whether the type can be
20169 incremented or decremented with add.
20170 (Unary::ResolveOperator): Also allow enumerations to be bitwise
20172 (Unary::ResolveOperator): Implement ++, !, ~,
20174 (Invocation::Emit): Deal with new Emit convetion.
20176 * All Expression derivatives: Updated their Emit method to return
20177 whether they leave values on the stack or not.
20179 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20180 stack for expressions that are statements.
20182 2001-09-20 Miguel de Icaza <miguel@ximian.com>
20184 * expression.cs (LValue): New interface. Must be implemented by
20186 (LocalVariableReference, ParameterReference, FieldExpr): Implement
20189 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20190 interface for generating code, simplifies the code.
20192 2001-09-20 Ravi Pratap <ravi@ximian.com>
20194 * expression.cs (everywhere): Comment out return statements in ::Resolve
20195 methods to avoid the warnings.
20197 2001-09-20 Miguel de Icaza <miguel@ximian.com>
20199 * driver.cs (parse): Report error 2001 if we can not open the
20202 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20205 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20208 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20209 otherwise nested blocks end up with the same index.
20211 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20213 * expression.cs: Instead of having FIXMEs in the Resolve
20214 functions, throw exceptions so it is obvious that we are facing a
20217 * cs-parser.jay (invocation_expression): Pass Location information.
20219 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20220 Use a basename for those routines because .NET does not like paths
20223 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20226 2001-09-19 Miguel de Icaza <miguel@ximian.com>
20228 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20229 are loading the correct data types (throws an exception if not).
20230 (TypeManager::InitCoreTypes): Use CoreLookupType
20232 * expression.cs (Unary::ResolveOperator): return the child
20233 expression for expressions which are just +expr.
20234 (Unary::ResolveOperator): Return negative literals for -LITERAL
20235 expressions (otherwise they are Unary {Literal}).
20236 (Invocation::Badness): Take into account `Implicit constant
20237 expression conversions'.
20239 * literal.cs (LongLiteral): Implement long literal class.
20240 (IntLiteral): export the `Value' of the intliteral.
20242 2001-09-19 Ravi Pratap <ravi@ximian.com>
20244 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20246 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
20247 instead of 'Operator'
20249 * expression.cs (Binary::ResolveOperator): Update accordingly.
20250 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20253 * cs-parser.jay (unary_expression): Update to use the new names.
20255 * gen-treedump.cs (GetUnary): Same here.
20257 * expression.cs (Unary::Resolve): Implement.
20258 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
20259 operators are found instead of making noise ;-)
20260 (Unary::ResolveOperator): New method to do precisely the same thing which
20261 Binary::ResolveOperator does for Binary expressions.
20262 (Unary.method, .Arguments): Add.
20263 (Unary::OperName): Implement.
20264 (Unary::ForceConversion): Copy and Paste !
20266 * class.cs (Operator::Define): Fix a small bug for the case when we have
20269 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20270 for the inbuilt operators. Only overloading works for now ;-)
20272 2001-09-18 Miguel de Icaza <miguel@ximian.com>
20274 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20275 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20277 * expression.cs (This::Emit): Implement.
20278 (This::Resolve): Implement.
20279 (TypeOf:Resolve): Implement.
20280 (Expression::ResolveSimpleName): Add an implicit this to instance
20282 (MemberAccess::Resolve): Deal with Parameters and Fields.
20283 Bind instance variable to Field expressions.
20284 (FieldExpr::Instance): New field used to track the expression that
20285 represents the object instance.
20286 (FieldExpr::Resolve): Track potential errors from MemberLookup not
20288 (FieldExpr::Emit): Implement.
20290 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20291 the last instruction contains a return opcode to avoid generating
20292 the last `ret' instruction (this generates correct code, and it is
20293 nice to pass the peverify output).
20295 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20296 initializer for static and instance variables.
20297 (Constructor::Emit): Allow initializer to be null in the case of
20298 static constructors. Only emit initializer for instance
20301 (TypeContainer::FindMembers): Return a null array if there are no
20304 Also fix the code for the MemberTypes.Method branch, as it was not
20305 scanning that for operators (or tried to access null variables before).
20307 * assign.cs (Assign::Emit): Handle instance and static fields.
20311 * driver.cs: Stop compilation if there are parse errors.
20313 * cs-parser.jay (constructor_declaration): Provide default base
20314 initializer for non-static constructors.
20315 (constructor_declarator): Do not provide a default base
20316 initializers if none was specified.
20317 Catch the fact that constructors should not have parameters.
20319 * class.cs: Do not emit parent class initializers for static
20320 constructors, that should be flagged as an error.
20322 2001-09-18 Ravi Pratap <ravi@ximian.com>
20324 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20325 Move back code into TypeContainer::Populate.
20327 2001-09-18 Ravi Pratap <ravi@ximian.com>
20329 * class.cs (TypeContainer::AddConstructor): Fix the check to
20330 compare against Name, not Basename.
20331 (Operator::OpType): Change Plus and Minus to Add and Subtract.
20333 * cs-parser.jay : Update accordingly.
20335 * class.cs (TypeContainer::FindMembers): For the case where we are searching
20336 for methods, don't forget to look into the operators too.
20337 (RegisterMethodBuilder): Helper method to take care of this for
20338 methods, constructors and operators.
20339 (Operator::Define): Completely revamp.
20340 (Operator.OperatorMethod, MethodName): New fields.
20341 (TypeContainer::Populate): Move the registering of builders into
20342 RegisterMethodBuilder.
20343 (Operator::Emit): Re-write.
20345 * expression.cs (Binary::Emit): Comment out code path to emit method
20346 invocation stuff for the case when we have a user defined operator. I am
20347 just not able to get it right !
20349 2001-09-17 Miguel de Icaza <miguel@ximian.com>
20351 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20354 (Expression::MemberLookup): Provide a version that allows to
20355 specify the MemberTypes and BindingFlags.
20357 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20358 so it was not fetching variable information from outer blocks.
20360 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20361 Beforefieldinit as it was buggy.
20363 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20364 that Ravi put here.
20366 * class.cs (Constructor::Emit): Only emit if block is not null.
20367 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20368 deal with this by semantically definining it as if the user had
20371 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20372 constructors as we now "emit" them at a higher level.
20374 (TypeContainer::DefineDefaultConstructor): Used to define the
20375 default constructors if none was provided.
20377 (ConstructorInitializer): Add methods Resolve and Emit.
20379 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20381 2001-09-17 Ravi Pratap <ravi@ximian.com>
20383 * class.cs (TypeContainer::EmitDefaultConstructor): Register
20384 the default constructor builder with our hashtable for methodbuilders
20387 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20388 and argument_count is 0 in which case we have a match.
20389 (Binary::ResolveOperator): More null checking and miscellaneous coding
20392 2001-09-17 Ravi Pratap <ravi@ximian.com>
20394 * rootcontext.cs (IsNameSpace): Compare against null.
20396 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20398 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20399 and Unary::Operator.
20401 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20404 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20405 we have overloaded operators.
20406 (Binary::ResolveOperator): Implement the part which does the operator overload
20409 * class.cs (Operator::Emit): Implement.
20410 (TypeContainer::Emit): Emit the operators we have too.
20412 * expression.cs (Binary::Emit): Update to emit the appropriate code for
20413 the case when we have a user-defined operator.
20415 2001-09-17 Miguel de Icaza <miguel@ximian.com>
20417 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20419 2001-09-16 Ravi Pratap <ravi@ximian.com>
20421 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20422 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20423 (Constructor::Emit): Implement.
20424 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20425 if we have no work to do.
20426 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
20429 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20430 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20432 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20435 2001-09-15 Ravi Pratap <ravi@ximian.com>
20437 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20439 (Tree::RecordNamespace): Method to do what the name says ;-)
20440 (Tree::Namespaces): Property to get at the namespaces hashtable.
20442 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
20445 * rootcontext.cs (IsNamespace): Fixed it :-)
20447 2001-09-14 Miguel de Icaza <miguel@ximian.com>
20449 * class.cs (TypeContainer::FindMembers): Add support for
20451 (MethodCore): New class that encapsulates both the shared aspects
20452 of a Constructor and a Method.
20453 (Method, Constructor): Factored pieces into MethodCore.
20455 * driver.cs: Added --fatal which makes errors throw exceptions.
20456 Load System assembly as well as part of the standard library.
20458 * report.cs: Allow throwing exceptions on errors for debugging.
20460 * modifiers.cs: Do not use `parent', instead use the real type
20461 container to evaluate permission settings.
20463 * class.cs: Put Ravi's patch back in. He is right, and we will
20464 have to cope with the
20466 2001-09-14 Ravi Pratap <ravi@ximian.com>
20468 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20469 FamORAssem, not FamANDAssem.
20471 2001-09-14 Miguel de Icaza <miguel@ximian.com>
20473 * driver.cs: Added --parse option that only parses its input files
20476 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
20477 incorrect. IsTopLevel is not used to tell whether an object is
20478 root_types or not (that can be achieved by testing this ==
20479 root_types). But to see if this is a top-level *class* (not
20480 necessarly our "toplevel" container).
20482 2001-09-14 Ravi Pratap <ravi@ximian.com>
20484 * enum.cs (Enum::Define): Modify to call the Lookup method on the
20485 parent instead of a direct call to GetType.
20487 2001-09-14 Ravi Pratap <ravi@ximian.com>
20489 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20490 Modifiers.TypeAttr. This should just be a call to that method.
20492 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20493 object so that we can determine if we are top-level or not.
20495 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
20498 * enum.cs (Enum::Define): Ditto.
20500 * modifiers.cs (FieldAttr): Re-write.
20502 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20503 (TypeContainer::HaveStaticConstructor): New property to provide access
20504 to precisely that info.
20506 * modifiers.cs (MethodAttr): Re-write.
20507 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20509 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20510 of top-level types as claimed.
20512 2001-09-13 Miguel de Icaza <miguel@ximian.com>
20514 * expression.cs (MemberLookup): Fruitless attempt to lookup
20515 constructors. Maybe I need to emit default constructors? That
20516 might be it (currently .NET emits this for me automatically).
20517 (Invocation::OverloadResolve): Cope with Arguments == null.
20518 (Invocation::EmitArguments): new function, shared by the new
20519 constructor and us.
20520 (Invocation::Emit): Handle static and instance methods. Emit
20521 proper call instruction for virtual or non-virtual invocations.
20522 (New::Emit): Implement.
20523 (New::Resolve): Implement.
20524 (MemberAccess:Resolve): Implement.
20525 (MethodGroupExpr::InstanceExpression): used conforming to the spec
20526 to track instances.
20527 (FieldExpr::Resolve): Set type.
20529 * support.cs: Handle empty arguments.
20531 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20532 SimpleLookup): Auxiliary routines to help parse a qualifier
20535 Update qualifier_identifier rule.
20537 * codegen.cs: Removed debugging messages.
20539 * class.cs: Make this a global thing, this acts just as a "key" to
20540 objects that we might have around.
20542 (Populate): Only initialize method_builders_to_methods once.
20544 * expression.cs (PropertyExpr): Initialize type from the
20547 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20548 Resolve pattern. Attempt to implicitly convert value to boolean.
20551 * expression.cs: Set the type for the int32/int32 argument case.
20552 (Binary::ResolveOperator): Set the return type to boolean for
20553 comparission operators
20555 * typemanager.cs: Remove debugging print code.
20557 (Invocation::Resolve): resolve type.
20559 * class.cs: Allocate a MemberInfo of the correct size, as the code
20560 elsewhere depends on the test to reflect the correct contents.
20562 (Method::) Keep track of parameters, due to System.Reflection holes
20564 (TypeContainer::Populate): Keep track of MethodBuilders to Method
20567 (TypeContainer::FindMembers): Use ArrayList and then copy an array
20568 of the exact size and return that.
20570 (Class::LookupMethodByBuilder): New function that maps
20571 MethodBuilders to its methods. Required to locate the information
20572 on methods because System.Reflection bit us again.
20574 * support.cs: New file, contains an interface ParameterData and
20575 two implementations: ReflectionParameters and InternalParameters
20576 used to access Parameter information. We will need to grow this
20579 * expression.cs (Invocation::GetParameterData): implement a cache
20580 and a wrapper around the ParameterData creation for methods.
20581 (Invocation::OverloadResolve): Use new code.
20583 2001-09-13 Ravi Pratap <ravi@ximian.com>
20585 * class.cs (TypeContainer::EmitField): Remove and move into
20586 (Field::Define): here and modify accordingly.
20587 (Field.FieldBuilder): New member.
20588 (TypeContainer::Populate): Update accordingly.
20589 (TypeContainer::FindMembers): Implement.
20591 2001-09-13 Miguel de Icaza <miguel@ximian.com>
20593 * statement.cs: (VariableInfo::VariableType): New field to be
20594 initialized with the full type once it is resolved.
20596 2001-09-12 Miguel de Icaza <miguel@ximian.com>
20598 * parameter.cs (GetParameterInfo): Use a type cache to compute
20599 things only once, and to reuse this information
20601 * expression.cs (LocalVariableReference::Emit): Implement.
20602 (OpcodeCast::Emit): fix.
20604 (ParameterReference::Resolve): Implement.
20605 (ParameterReference::Emit): Implement.
20607 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20608 that are expressions need to stay as Expressions.
20610 * typemanager.cs (CSharpName): Returns the C# name of a type if
20613 * expression.cs (Expression::ConvertImplicit): New function that
20614 implements implicit type conversions.
20616 (Expression::ImplicitReferenceConversion): Implements implicit
20617 reference conversions.
20619 (EmptyCast): New type for transparent casts.
20621 (OpcodeCast): New type for casts of types that are performed with
20622 a sequence of bytecodes.
20624 (BoxedCast): New type used for casting value types into reference
20625 types. Emits a box opcode.
20627 (Binary::DoNumericPromotions): Implements numeric promotions of
20628 and computation of the Binary::Type.
20630 (Binary::EmitBranchable): Optimization.
20632 (Binary::Emit): Implement code emission for expressions.
20634 * typemanager.cs (TypeManager): Added two new core types: sbyte
20637 2001-09-12 Ravi Pratap <ravi@ximian.com>
20639 * class.cs (TypeContainer::FindMembers): Method which does exactly
20640 what Type.FindMembers does, only we don't have to use reflection. No
20641 implementation yet.
20643 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20644 typecontainer objects as we need to get at them.
20645 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20647 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20648 typecontainer object.
20650 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20651 of just a Report object.
20653 2001-09-11 Ravi Pratap <ravi@ximian.com>
20655 * class.cs (Event::Define): Go back to using the prefixes "add_" and
20657 (TypeContainer::Populate): Now define the delegates of the type too.
20658 (TypeContainer.Delegates): Property to access the list of delegates defined
20661 * delegates.cs (Delegate::Define): Implement partially.
20663 * modifiers.cs (TypeAttr): Handle more flags.
20665 2001-09-11 Ravi Pratap <ravi@ximian.com>
20667 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20669 (Operator::Define): Re-write logic to get types by using the LookupType method
20670 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20671 (Indexer::Define): Ditto.
20672 (Event::Define): Ditto.
20673 (Property::Define): Ditto.
20675 2001-09-10 Ravi Pratap <ravi@ximian.com>
20677 * class.cs (TypeContainer::Populate): Now define operators too.
20678 (TypeContainer.Operators): New property to access the list of operators
20680 (Operator.OperatorMethodBuilder): New member to hold the method builder
20681 for the operator we are defining.
20682 (Operator::Define): Implement.
20684 2001-09-10 Ravi Pratap <ravi@ximian.com>
20686 * class.cs (Event::Define): Make the prefixes of the accessor methods
20687 addOn_ and removeOn_
20689 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20690 of the location being passed in too. Ideally, this should go later since all
20691 error reporting should be done through the Report object.
20693 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20694 (Populate): Iterate thru the indexers we have and define them too.
20695 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20696 for the get and set accessors.
20697 (Indexer::Define): Implement.
20699 2001-09-09 Miguel de Icaza <miguel@ximian.com>
20701 * expression.cs (Binary::Resolve): Beginning of it. I scratched
20702 my previous implementation, did not work.
20704 * typemanager.cs: Add a couple of missing types (the longs).
20706 * literal.cs: Use TypeManager.bool_type instead of getting it.
20708 * expression.cs (EventExpr): New kind of expressions.
20709 (Expressio::ExprClassFromMemberInfo): finish
20711 2001-09-08 Miguel de Icaza <miguel@ximian.com>
20713 * assign.cs: Emit stores to static fields differently.
20715 2001-09-08 Ravi Pratap <ravi@ximian.com>
20717 * Merge in changes and adjust code to tackle conflicts. Backed out my
20718 code in Assign::Resolve ;-)
20720 2001-09-08 Ravi Pratap <ravi@ximian.com>
20722 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20723 instead Report.Error and also pass in the location.
20724 (CSharpParser::Lexer): New readonly property to return the reference
20725 to the Tokenizer object.
20726 (declare_local_variables): Use Report.Error with location instead of plain
20730 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20731 (Operator.CheckBinaryOperator): Ditto.
20733 * cs-parser.jay (operator_declarator): Update accordingly.
20735 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20736 (CheckBinaryOperator): Same here.
20738 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20739 on the name without any prefixes of namespace names etc. This is because we
20740 already might have something already fully qualified like
20741 'System.Console.WriteLine'
20743 * assign.cs (Resolve): Begin implementation. Stuck ;-)
20745 2001-09-07 Ravi Pratap <ravi@ximian.com>
20747 * cs-tokenizer.cs (location): Return a string which also contains
20750 * expression.cs (ElementAccess): New class for expressions of the
20751 type 'element access.'
20752 (BaseAccess): New class for expressions of the type 'base access.'
20753 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20756 * cs-parser.jay (element_access): Implement action.
20757 (base_access): Implement actions.
20758 (checked_expression, unchecked_expression): Implement.
20760 * cs-parser.jay (local_variable_type): Correct and implement.
20761 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20763 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20765 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20766 name and the specifiers.
20768 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20770 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
20771 making them all public ;-)
20773 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20776 2001-09-07 Miguel de Icaza <miguel@ximian.com>
20778 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20780 (FieldExpr, PropertyExprs): New resolved expressions.
20781 (SimpleName::MemberStaticCheck): Perform static checks for access
20782 to non-static fields on static methods. Maybe this should be
20783 generalized for MemberAccesses.
20784 (SimpleName::ResolveSimpleName): More work on simple name
20787 * cs-parser.jay (primary_expression/qualified_identifier): track
20788 the parameter index.
20790 * codegen.cs (CodeGen::Save): Catch save exception, report error.
20791 (EmitContext::EmitBoolExpression): Chain to expression generation
20792 instead of temporary hack.
20793 (::EmitStatementExpression): Put generic expression code generation.
20795 * assign.cs (Assign::Emit): Implement variable assignments to
20796 local variables, parameters and fields.
20798 2001-09-06 Miguel de Icaza <miguel@ximian.com>
20800 * statement.cs (Block::GetVariableInfo): New method, returns the
20801 VariableInfo for a variable name in a block.
20802 (Block::GetVariableType): Implement in terms of GetVariableInfo
20804 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20805 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20807 2001-09-06 Ravi Pratap <ravi@ximian.com>
20809 * cs-parser.jay (operator_declaration): Continue on my quest : update
20810 to take attributes argument.
20811 (event_declaration): Ditto.
20812 (enum_declaration): Ditto.
20813 (indexer_declaration): Ditto.
20815 * class.cs (Operator::Operator): Update constructor accordingly.
20816 (Event::Event): Ditto.
20818 * delegate.cs (Delegate::Delegate): Same here.
20820 * enum.cs (Enum::Enum): Same here.
20822 2001-09-05 Ravi Pratap <ravi@ximian.com>
20824 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20826 * ../tests/cs0658.cs : New file to demonstrate error 0658.
20828 * attribute.cs (Attributes): New class to encapsulate all attributes which were
20829 being passed around as an arraylist.
20830 (Attributes::AddAttribute): Method to add attribute sections.
20832 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20833 (struct_declaration): Update accordingly.
20834 (constant_declaration): Update.
20835 (field_declaration): Update.
20836 (method_header): Update.
20837 (fixed_parameter): Update.
20838 (parameter_array): Ditto.
20839 (property_declaration): Ditto.
20840 (destructor_declaration): Ditto.
20842 * class.cs (Struct::Struct): Update constructors accordingly.
20843 (Class::Class): Ditto.
20844 (Field::Field): Ditto.
20845 (Method::Method): Ditto.
20846 (Property::Property): Ditto.
20847 (TypeContainer::OptAttribute): update property's return type.
20849 * interface.cs (Interface.opt_attributes): New member.
20850 (Interface::Interface): Update to take the extra Attributes argument.
20852 * parameter.cs (Parameter::Parameter): Ditto.
20854 * constant.cs (Constant::Constant): Ditto.
20856 * interface.cs (InterfaceMemberBase): New OptAttributes field.
20857 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
20858 the attributes as a parameter.
20859 (InterfaceProperty): Update constructor call.
20860 (InterfaceEvent): Ditto.
20861 (InterfaceMethod): Ditto.
20862 (InterfaceIndexer): Ditto.
20864 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
20865 pass the attributes too.
20866 (interface_event_declaration): Ditto.
20867 (interface_property_declaration): Ditto.
20868 (interface_method_declaration): Ditto.
20869 (interface_declaration): Ditto.
20871 2001-09-05 Miguel de Icaza <miguel@ximian.com>
20873 * class.cs (Method::Define): Track the "static Main" definition to
20874 create an entry point.
20876 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20877 EntryPoint if we find it.
20879 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20880 (EmitContext::ig): Make this variable public.
20882 * driver.cs: Make the default output file be the first file name
20883 with the .exe extension.
20885 Detect empty compilations
20887 Handle various kinds of output targets. Handle --target and
20888 rename -t to --dumper.
20890 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20891 methods inherited from Expression return now an Expression. This
20892 will is used during the tree rewriting as we resolve them during
20895 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20896 the spec. Missing entirely is the information about
20897 accessability of elements of it.
20899 (Expression::ExprClassFromMemberInfo): New constructor for
20900 Expressions that creates a fully initialized Expression based on
20901 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20904 (Invocation::Resolve): Begin implementing resolution of invocations.
20906 * literal.cs (StringLiteral): Implement Emit.
20908 2001-09-05 Ravi Pratap <ravi@ximian.com>
20910 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20913 2001-09-04 Ravi Pratap <ravi@ximian.com>
20915 * cs-parser.jay (attribute_arguments): Implement actions.
20916 (attribute): Fix bug in production. Implement action.
20917 (attribute_list): Implement.
20918 (attribute_target): Implement.
20919 (attribute_target_specifier, opt_target_specifier): Implement
20920 (CheckAttributeTarget): New method to check if the attribute target
20922 (attribute_section): Implement.
20923 (opt_attributes): Implement.
20925 * attribute.cs : New file to handle attributes.
20926 (Attribute): Class to hold attribute info.
20928 * cs-parser.jay (opt_attribute_target_specifier): Remove production
20929 (attribute_section): Modify production to use 2 different rules to
20930 achieve the same thing. 1 s/r conflict down !
20931 Clean out commented, useless, non-reducing dimension_separator rules.
20933 * class.cs (TypeContainer.attributes): New member to hold list
20934 of attributes for a type.
20935 (Struct::Struct): Modify to take one more argument, the attribute list.
20936 (Class::Class): Ditto.
20937 (Field::Field): Ditto.
20938 (Method::Method): Ditto.
20939 (Property::Property): Ditto.
20941 * cs-parser.jay (struct_declaration): Update constructor call to
20942 pass in the attributes too.
20943 (class_declaration): Ditto.
20944 (constant_declaration): Ditto.
20945 (field_declaration): Ditto.
20946 (method_header): Ditto.
20947 (fixed_parameter): Ditto.
20948 (parameter_array): Ditto.
20949 (property_declaration): Ditto.
20951 * constant.cs (Constant::Constant): Update constructor similarly.
20952 Use System.Collections.
20954 * parameter.cs (Parameter::Parameter): Update as above.
20956 2001-09-02 Ravi Pratap <ravi@ximian.com>
20958 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20959 (TypeContainer.delegates): New member to hold list of delegates.
20961 * cs-parser.jay (delegate_declaration): Implement the action correctly
20962 this time as I seem to be on crack ;-)
20964 2001-09-02 Miguel de Icaza <miguel@ximian.com>
20966 * rootcontext.cs (RootContext::IsNamespace): new function, used to
20967 tell whether an identifier represents a namespace.
20969 * expression.cs (NamespaceExpr): A namespace expression, used only
20970 temporarly during expression resolution.
20971 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20972 utility functions to resolve names on expressions.
20974 2001-09-01 Miguel de Icaza <miguel@ximian.com>
20976 * codegen.cs: Add hook for StatementExpressions.
20978 * class.cs: Fix inverted test for static flag in methods.
20980 2001-09-02 Ravi Pratap <ravi@ximian.com>
20982 * class.cs (Operator::CheckUnaryOperator): Correct error number used
20983 to make it coincide with MS' number.
20984 (Operator::CheckBinaryOperator): Ditto.
20986 * ../errors/errors.txt : Remove error numbers added earlier.
20988 * ../errors/cs1019.cs : Test case for error # 1019
20990 * ../errros/cs1020.cs : Test case for error # 1020
20992 * cs-parser.jay : Clean out commented cruft.
20993 (dimension_separators, dimension_separator): Comment out. Ostensibly not
20994 used anywhere - non-reducing rule.
20995 (namespace_declarations): Non-reducing rule - comment out.
20997 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20998 with TypeContainer::AddEnum.
21000 * delegate.cs : New file for delegate handling classes.
21001 (Delegate): Class for declaring delegates.
21003 * makefile : Update.
21005 * cs-parser.jay (delegate_declaration): Implement.
21007 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
21009 * class.cs (Event::Define): Implement.
21010 (Event.EventBuilder): New member.
21012 * class.cs (TypeContainer::Populate): Update to define all enums and events
21014 (Events): New property for the events arraylist we hold. Shouldn't we move to using
21015 readonly fields for all these cases ?
21017 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
21019 * class.cs (Property): Revamp to use the convention of making fields readonly.
21020 Accordingly modify code elsewhere.
21022 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21023 the Define method of the Property class.
21025 * class.cs : Clean up applied patch and update references to variables etc. Fix
21027 (TypeContainer::Populate): Update to define all the properties we have. Also
21028 define all enumerations.
21030 * enum.cs (Define): Implement.
21032 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
21034 * cs-parser.jay (overloadable_operator): The semantic value is an
21035 enum of the Operator class.
21036 (operator_declarator): Implement actions.
21037 (operator_declaration): Implement.
21039 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21040 validity of definitions.
21041 (Operator::CheckBinaryOperator): Static method to check for binary operators
21042 (TypeContainer::AddOperator): New method to add an operator to a type.
21044 * cs-parser.jay (indexer_declaration): Added line to actually call the
21045 AddIndexer method so it gets added ;-)
21047 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
21048 already taken care of by the MS compiler ?
21050 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
21052 * class.cs (Operator): New class for operator declarations.
21053 (Operator::OpType): Enum for the various operators.
21055 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
21057 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21058 ostensibly handle this in semantic analysis.
21060 * cs-parser.jay (general_catch_clause): Comment out
21061 (specific_catch_clauses, specific_catch_clause): Ditto.
21062 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21063 (catch_args, opt_catch_args): New productions.
21064 (catch_clause): Rewrite to use the new productions above
21065 (catch_clauses): Modify accordingly.
21066 (opt_catch_clauses): New production to use in try_statement
21067 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21068 and re-write the code in the actions to extract the specific and
21069 general catch clauses by being a little smart ;-)
21071 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21072 Hooray, try and catch statements parse fine !
21074 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
21076 * statement.cs (Block::GetVariableType): Fix logic to extract the type
21077 string from the hashtable of variables.
21079 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21080 I end up making that mistake ;-)
21081 (catch_clauses): Fixed gross error which made Key and Value of the
21082 DictionaryEntry the same : $1 !!
21084 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
21086 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21088 * cs-parser.jay (event_declaration): Correct to remove the semicolon
21089 when the add and remove accessors are specified.
21091 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
21093 * cs-parser.jay (IndexerDeclaration): New helper class to hold
21094 information about indexer_declarator.
21095 (indexer_declarator): Implement actions.
21096 (parsing_indexer): New local boolean used to keep track of whether
21097 we are parsing indexers or properties. This is necessary because
21098 implicit_parameters come into picture even for the get accessor in the
21099 case of an indexer.
21100 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21102 * class.cs (Indexer): New class for indexer declarations.
21103 (TypeContainer::AddIndexer): New method to add an indexer to a type.
21104 (TypeContainer::indexers): New member to hold list of indexers for the
21107 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
21109 * cs-parser.jay (add_accessor_declaration): Implement action.
21110 (remove_accessor_declaration): Implement action.
21111 (event_accessors_declaration): Implement
21112 (variable_declarators): swap statements for first rule - trivial.
21114 * class.cs (Event): New class to hold information about event
21116 (TypeContainer::AddEvent): New method to add an event to a type
21117 (TypeContainer::events): New member to hold list of events.
21119 * cs-parser.jay (event_declaration): Implement actions.
21121 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
21123 * cs-parser.jay (dim_separators): Implement. Make it a string
21124 concatenating all the commas together, just as they appear.
21125 (opt_dim_separators): Modify accordingly
21126 (rank_specifiers): Update accordingly. Basically do the same
21127 thing - instead, collect the brackets here.
21128 (opt_rank_sepcifiers): Modify accordingly.
21129 (array_type): Modify to actually return the complete type string
21130 instead of ignoring the rank_specifiers.
21131 (expression_list): Implement to collect the expressions
21132 (variable_initializer): Implement. We make it a list of expressions
21133 essentially so that we can handle the array_initializer case neatly too.
21134 (variable_initializer_list): Implement.
21135 (array_initializer): Make it a list of variable_initializers
21136 (opt_array_initializer): Modify accordingly.
21138 * expression.cs (New::NType): Add enumeration to help us
21139 keep track of whether we have an object/delegate creation
21140 or an array creation.
21141 (New:NewType, New::Rank, New::Indices, New::Initializers): New
21142 members to hold data about array creation.
21143 (New:New): Modify to update NewType
21144 (New:New): New Overloaded contructor for the array creation
21147 * cs-parser.jay (array_creation_expression): Implement to call
21148 the overloaded New constructor.
21150 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
21152 * class.cs (TypeContainer::Constructors): Return member
21153 constructors instead of returning null.
21155 2001-08-26 Miguel de Icaza <miguel@ximian.com>
21157 * typemanager.cs (InitCoreTypes): Initialize the various core
21158 types after we have populated the type manager with the user
21159 defined types (this distinction will be important later while
21160 compiling corlib.dll)
21162 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21163 on Expression Classification. Now all expressions have a method
21164 `Resolve' and a method `Emit'.
21166 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21167 generation from working. Also add some temporary debugging
21170 2001-08-24 Miguel de Icaza <miguel@ximian.com>
21172 * codegen.cs: Lots of code generation pieces. This is only the
21173 beginning, will continue tomorrow with more touches of polish. We
21174 handle the fundamentals of if, while, do, for, return. Others are
21175 trickier and I need to start working on invocations soon.
21177 * gen-treedump.cs: Bug fix, use s.Increment here instead of
21180 * codegen.cs (EmitContext): New struct, used during code
21181 emission to keep a context. Most of the code generation will be
21184 * cs-parser.jay: Add embedded blocks to the list of statements of
21185 this block. So code generation proceeds in a top down fashion.
21187 2001-08-23 Miguel de Icaza <miguel@ximian.com>
21189 * statement.cs: Add support for multiple child blocks.
21191 2001-08-22 Miguel de Icaza <miguel@ximian.com>
21193 * codegen.cs (EmitCode): New function, will emit the code for a
21194 Block of code given a TypeContainer and its ILGenerator.
21196 * statement.cs (Block): Standard public readonly optimization.
21197 (Block::Block constructors): Link children.
21198 (Block::Child): Child Linker.
21199 (Block::EmitVariables): Emits IL variable declarations.
21201 * class.cs: Drop support for MethodGroups here, delay until
21203 (Method::): Applied the same simplification that I did before, and
21204 move from Properties to public readonly fields.
21205 (Method::ParameterTypes): Returns the parameter types for the
21206 function, and implements a cache that will be useful later when I
21207 do error checking and the semantic analysis on the methods is
21209 (Constructor::GetCallingConvention): Renamed from CallingConvetion
21210 and made a method, optional argument tells whether this is a class
21211 or a structure to apply the `has-this' bit.
21212 (Method::GetCallingConvention): Implement, returns the calling
21214 (Method::Define): Defines the type, a second pass is performed
21215 later to populate the methods.
21217 (Constructor::ParameterTypes): implement a cache similar to the
21218 one on Method::ParameterTypes, useful later when we do semantic
21221 (TypeContainer::EmitMethod): New method. Emits methods.
21223 * expression.cs: Removed MethodGroup class from here.
21225 * parameter.cs (Parameters::GetCallingConvention): new method.
21227 2001-08-21 Miguel de Icaza <miguel@ximian.com>
21229 * class.cs (TypeContainer::Populate): Drop RootContext from the
21232 (Constructor::CallingConvention): Returns the calling convention.
21233 (Constructor::ParameterTypes): Returns the constructor parameter
21236 (TypeContainer::AddConstructor): Keep track of default constructor
21237 and the default static constructor.
21239 (Constructor::) Another class that starts using `public readonly'
21240 instead of properties.
21242 (Constructor::IsDefault): Whether this is a default constructor.
21244 (Field::) use readonly public fields instead of properties also.
21246 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21247 track of static constructors; If none is used, turn on
21248 BeforeFieldInit in the TypeAttributes.
21250 * cs-parser.jay (opt_argument_list): now the return can be null
21251 for the cases where there are no arguments.
21253 (constructor_declarator): If there is no implicit `base' or
21254 `this', then invoke the default parent constructor.
21256 * modifiers.cs (MethodAttr): New static function maps a set of
21257 modifiers flags into a MethodAttributes enum
21258 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
21259 MethodAttr, TypeAttr to represent the various mappings where the
21260 modifiers are used.
21261 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
21263 2001-08-19 Miguel de Icaza <miguel@ximian.com>
21265 * parameter.cs (GetParameterInfo): Fix bug where there would be no
21268 * interface.cs (PopulateIndexer): Implemented the code generator
21269 for interface indexers.
21271 2001-08-17 Miguel de Icaza <miguel@ximian.com>
21273 * interface.cs (InterfaceMemberBase): Now we track the new status
21276 (PopulateProperty): Implement property population. Woohoo! Got
21277 Methods and Properties going today.
21279 Removed all the properties for interfaces, and replaced them with
21280 `public readonly' fields.
21282 2001-08-16 Miguel de Icaza <miguel@ximian.com>
21284 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21285 initialize their hashtables/arraylists only when they are needed
21286 instead of doing this always.
21288 * parameter.cs: Handle refs and out parameters.
21290 * cs-parser.jay: Use an ArrayList to construct the arguments
21291 instead of the ParameterCollection, and then cast that to a
21294 * parameter.cs: Drop the use of ParameterCollection and use
21295 instead arrays of Parameters.
21297 (GetParameterInfo): Use the Type, not the Name when resolving
21300 2001-08-13 Miguel de Icaza <miguel@ximian.com>
21302 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21303 and instead use public readonly fields.
21305 * class.cs: Put back walking code for type containers.
21307 2001-08-11 Miguel de Icaza <miguel@ximian.com>
21309 * class.cs (MakeConstant): Code to define constants.
21311 * rootcontext.cs (LookupType): New function. Used to locate types
21314 2001-08-08 Miguel de Icaza <miguel@ximian.com>
21316 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
21317 this System.Reflection code is. Kudos to Microsoft
21319 * typemanager.cs: Implement a type cache and avoid loading all
21320 types at boot time. Wrap in LookupType the internals. This made
21321 the compiler so much faster. Wow. I rule!
21323 * driver.cs: Make sure we always load mscorlib first (for
21324 debugging purposes, nothing really important).
21326 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
21327 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
21329 * rootcontext.cs: Lookup types on their namespace; Lookup types
21330 on namespaces that have been imported using the `using' keyword.
21332 * class.cs (TypeContainer::TypeAttr): Virtualize.
21333 (Class::TypeAttr): Return attributes suitable for this bad boy.
21334 (Struct::TypeAttr): ditto.
21335 Handle nested classes.
21336 (TypeContainer::) Remove all the type visiting code, it is now
21337 replaced with the rootcontext.cs code
21339 * rootcontext.cs (GetClassBases): Added support for structs.
21341 2001-08-06 Miguel de Icaza <miguel@ximian.com>
21343 * interface.cs, statement.cs, class.cs, parameter.cs,
21344 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21345 Drop use of TypeRefs, and use strings instead.
21347 2001-08-04 Miguel de Icaza <miguel@ximian.com>
21351 * class.cs (Struct::Struct): set the SEALED flags after
21352 checking the modifiers.
21353 (TypeContainer::TypeAttr): new property, returns the
21354 TypeAttributes for a class.
21356 * cs-parser.jay (type_list): Oops, list production was creating a
21357 new list of base types.
21359 * rootcontext.cs (StdLib): New property.
21360 (GetInterfaceTypeByName): returns an interface by type name, and
21361 encapsulates error handling here.
21362 (GetInterfaces): simplified.
21363 (ResolveTree): Encapsulated all the tree resolution here.
21364 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21367 * driver.cs: Add support for --nostdlib, to avoid loading the
21368 default assemblies.
21369 (Main): Do not put tree resolution here.
21371 * rootcontext.cs: Beginning of the class resolution.
21373 2001-08-03 Miguel de Icaza <miguel@ximian.com>
21375 * rootcontext.cs: Provide better error reporting.
21377 * cs-parser.jay (interface_base): set our $$ to be interfaces.
21379 * rootcontext.cs (CreateInterface): Handle the case where there
21380 are no parent interfaces.
21382 (CloseTypes): Routine to flush types at the end.
21383 (CreateInterface): Track types.
21384 (GetInterfaces): Returns an array of Types from the list of
21385 defined interfaces.
21387 * typemanager.c (AddUserType): Mechanism to track user types (puts
21388 the type on the global type hash, and allows us to close it at the
21391 2001-08-02 Miguel de Icaza <miguel@ximian.com>
21393 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21394 RecordInterface instead.
21396 * cs-parser.jay: Updated to reflect changes above.
21398 * decl.cs (Definition): Keep track of the TypeBuilder type that
21399 represents this type here. Not sure we will use it in the long
21400 run, but wont hurt for now.
21402 * driver.cs: Smaller changes to accomodate the new code.
21404 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21407 * rootcontext.cs (CreateInterface): New method, used to create
21408 the System.TypeBuilder type for interfaces.
21409 (ResolveInterfaces): new entry point to resolve the interface
21411 (CodeGen): Property, used to keep track of the code generator.
21413 2001-07-26 Miguel de Icaza <miguel@ximian.com>
21415 * cs-parser.jay: Add a second production for delegate_declaration
21418 (enum_body): Put an opt_comma here instead of putting it on
21419 enum_body or enum_member_declarations so we can handle trailing
21420 commas on enumeration members. Gets rid of a shift/reduce.
21422 (type_list): Need a COMMA in the middle.
21424 (indexer_declaration): Tell tokenizer to recognize get/set
21426 * Remove old targets.
21428 * Re-add the parser target.
21430 2001-07-13 Simon Cozens <simon@simon-cozens.org>
21432 * cs-parser.jay: Add precendence rules for a number of operators
21433 ot reduce the number of shift/reduce conflicts in the grammar.
21435 2001-07-17 Miguel de Icaza <miguel@ximian.com>
21437 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21440 Get rid of old crufty code.
21442 * rootcontext.cs: Use this to keep track of the parsed
21443 representation and the defined types available to the program.
21445 * gen-treedump.cs: adjust for new convention.
21447 * type.cs: Split out the type manager, and the assembly builder
21450 * typemanager.cs: the type manager will live here now.
21452 * cil-codegen.cs: And the code generator here.
21454 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
21456 * makefile: Fixed up for easy making.
21458 2001-07-13 Simon Cozens <simon@simon-cozens.org>
21460 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21463 (unary_expression): Expand pre_increment_expression and
21464 post_decrement_expression to reduce a shift/reduce.
21466 2001-07-11 Simon Cozens
21468 * cs-tokenizer.cs: Hex numbers should begin with a 0.
21470 Improve allow_keyword_as_indent name.
21472 2001-06-19 Miguel de Icaza <miguel@ximian.com>
21474 * Adjustments for Beta2.
21476 2001-06-13 Miguel de Icaza <miguel@ximian.com>
21478 * decl.cs: Added `Define' abstract method.
21479 (InTransit): new property, used to catch recursive definitions.
21481 * interface.cs: Implement `Define'.
21483 * modifiers.cs: Map Modifiers.constants to
21484 System.Reflection.TypeAttribute flags.
21486 * class.cs: Keep track of types and user-defined types.
21487 (BuilderInit): New method for creating an assembly
21488 (ResolveType): New function to launch the resolution process, only
21489 used by interfaces for now.
21491 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21492 that are inserted into the name space.
21494 2001-06-08 Miguel de Icaza <miguel@ximian.com>
21496 * ARGH. I have screwed up my tree so many times due to the use of
21497 rsync rather than using CVS. Going to fix this at once.
21499 * driver.cs: Objetify driver. Load assemblies, use assemblies to
21502 2001-06-07 Miguel de Icaza <miguel@ximian.com>
21504 * Experiment successful: Use System.Type rather that our own
21507 2001-05-25 Miguel de Icaza <miguel@ximian.com>
21509 * cs-parser.jay: Removed nsAliases from here.
21511 Use new namespaces, handle `using XXX;'
21513 * namespace.cs: Reimplemented namespace handling, use a recursive
21514 definition of the class. Now we can keep track of using clauses
21515 and catch invalid using clauses.
21517 2001-05-24 Miguel de Icaza <miguel@ximian.com>
21519 * gen-treedump.cs: Adapted for all the renaming.
21521 * expression.cs (Expression): this class now has a Type property
21522 which returns an expression Type.
21524 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21525 `Type', as this has a different meaning now in the base
21527 2001-05-22 Miguel de Icaza <miguel@ximian.com>
21529 * interface.cs, class.cs: Removed from all the sources the
21530 references to signature computation, as we can not do method
21531 signature computation during the parsing time, as we are not
21532 trying to solve at that point distinguishing:
21536 void a (NS.Blah x) {}
21539 Which depending on the context might be valid or not, as we do not
21540 know if Blah is the same thing as NS.Blah at that point.
21542 * Redid everything so the code uses TypeRefs now instead of
21543 Types. TypeRefs are just temporary type placeholders, that need
21544 to be resolved. They initially have a pointer to a string and the
21545 current scope in which they are used. This is used later by the
21546 compiler to resolve the reference to an actual Type.
21548 * DeclSpace is no longer a CIR.Type, and neither are
21549 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
21550 are all DeclSpaces, but no Types.
21552 * type.cs (TypeRefManager): This implements the TypeRef manager,
21553 which keeps track of all the types that need to be resolved after
21554 the parsing has finished.
21556 2001-05-13 Miguel de Icaza <miguel@ximian.com>
21558 * ARGH. We are going to have to store `foreach' as a class rather
21559 than resolving it, as we need to verify error 1579 after name
21560 resolution. *OR* we could keep a flag that says `This request to
21561 IEnumerator comes from a foreach statement' which we can then use
21562 to generate the error.
21564 2001-05-10 Miguel de Icaza <miguel@ximian.com>
21566 * class.cs (TypeContainer.AddMethod): we now add methods to the
21567 MethodGroup instead of the method hashtable.
21569 * expression.cs: Add MethodGroup abstraction, which gets us one
21570 step closer to the specification in the way we handle method
21573 * cs-parser.jay (primary_expression): qualified_identifier now
21574 tried to match up an identifier to a local variable reference or
21575 to a parameter reference.
21577 current_local_parameters is now a parser global variable that
21578 points to the current parameters for the block, used during name
21581 (property_declaration): Now creates an implicit `value' argument to
21584 2001-05-09 Miguel de Icaza <miguel@ximian.com>
21586 * parameter.cs: Do not use `param' arguments as part of the
21587 signature, per the spec.
21589 2001-05-08 Miguel de Icaza <miguel@ximian.com>
21591 * decl.cs: Base class for classes, structs and interfaces. This
21592 is the "Declaration Space"
21594 * cs-parser.jay: Use CheckDef for checking declaration errors
21595 instead of having one on each function.
21597 * class.cs: Factor out some code for handling error handling in
21598 accordance to the "Declarations" section in the "Basic Concepts"
21599 chapter in the ECMA C# spec.
21601 * interface.cs: Make all interface member classes derive from
21602 InterfaceMemberBase.
21604 2001-05-07 Miguel de Icaza <miguel@ximian.com>
21606 * Many things: all interfaces are parsed and generated in
21607 gen-treedump. Support for member variables, constructors,
21608 destructors, properties, constants is there.
21610 Beginning of the IL backend, but very little done, just there for
21613 2001-04-29 Miguel de Icaza <miguel@ximian.com>
21615 * cs-parser.jay: Fix labeled statement.
21617 * cs-tokenizer.cs (escape): Escape " and ' always.
21618 ref_line, ref_name: keep track of the line/filename as instructed
21619 by #line by the compiler.
21622 2001-04-27 Miguel de Icaza <miguel@ximian.com>
21624 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21625 to match the values in System.CodeDOM.
21627 Divid renamed to Divide.
21629 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21631 (Statements.set): remove.
21633 * System.CodeDOM/CodeCatchClause.cs: always have a valid
21636 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21637 falseStatements always have valid values.
21639 * cs-parser.jay: Use System.CodeDOM now.